GradientWrapMode Enumeration
Represents the mode how a gradient is treated when the gradient area is exceeded.
Namespace: KGySoft.Drawing.ShapesAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
public enum GradientWrapMode
Public Enumeration GradientWrapMode
public enum class GradientWrapMode
The following table demonstrates the possible GradientWrapMode values and their effect:
Description | Image 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. |  |
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. |  |
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. |  |
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. |  |
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.
Stop | 0 |
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.
|
Clip | 1 |
The gradient is clipped at the specified start and end points, as if the exceeding area was transparent.
|
Repeat | 2 |
The gradient is repeated beyond the specified start and end points.
|
Mirror | 3 |
The gradient is mirrored beyond the specified start and end points.
|