GradientWrapMode Enumeration

Represents the mode how a gradient is treated when the gradient area is exceeded.

See the online help for image examples.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
C#
public enum GradientWrapMode

Examples

The following table demonstrates the possible GradientWrapMode values and their effect:

DescriptionImage Example
Stop: The gradient stops at the specified start and end points, and the exceeding area is simply filled with the specified end colors in both directions. In this example a horizontal gradient is drawn from 20 to 80, using Linear color space from red to blue.Linear gradient brush with Stop wrap mode. AntiAliasing = true, AlphaBlending = true.
Clip: The gradient is clipped at the specified start and end points, as if the exceeding area was transparent. This example is the same gradient as above, but with Clip wrap mode.Linear gradient brush with Clip wrap mode. AntiAliasing = true, AlphaBlending = true.
Repeat: The gradient is repeated beyond the specified start and end points. In this example a diagonal gradient is drawn from (-10, 10) to (10, -10), using Srgb color space from white to black.Linear gradient brush with Repeat wrap mode. AntiAliasing = true, AlphaBlending = true.
Mirror: The gradient is mirrored beyond the specified start and end points. This example is the same gradient as above, but with Mirror wrap mode.Linear gradient brush with Mirror wrap mode. AntiAliasing = true, AlphaBlending = true.

  Note

A GradientWrapMode value is used only when the gradient is specified by two points. When just an angle is specified, the gradient is always stretched to the bounds of the shape.
See the Examples section of the CreateLinearGradient(Single, Color32, Color32, WorkingColorSpace) method for an example for such a gradient.

Members

Stop0 The gradient stops at the specified start and end points, and the exceeding area is simply filled with the specified end colors in both directions.
Clip1 The gradient is clipped at the specified start and end points, as if the exceeding area was transparent.
Repeat2 The gradient is repeated beyond the specified start and end points.
Mirror3 The gradient is mirrored beyond the specified start and end points.

See Also