VegaRise.NET
Back to DOM

GradientDirectionEnum

Definition

Namespace
DOM.Enums
Assembly
DOM.dll

Specifies the direction of a gradient fill.

Remarks

A simplified, three-value alternative to the more detailed . Useful when the consumer only needs to express a general direction. LinearShade.Angle

Examples

csharp
1// 1. Vertical gradient
2var dir = GradientDirection.Vertical;
3
csharp
1// 2. Horizontal gradient
2var dir = GradientDirection.Horizontal;
3
csharp
1// 3. Diagonal gradient
2var dir = GradientDirection.Diagonal;
3
csharp
1// 4. Map to a rotation angle
2var angle = dir switch
3{
4 GradientDirection.Horizontal => 0,
5 GradientDirection.Vertical => 90,
6 GradientDirection.Diagonal => 45,
7 _ => 0
8};
9

Fields

Diagonal

Diagonal gradient (corner to corner).

Horizontal

Horizontal gradient (left to right).

Vertical

Vertical gradient (top to bottom).

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.