Click or drag to resize
Ab4d.SharpEngine logo

TextureFactoryCreateGradientRawImageData(GradientStop, Int32, Boolean, Boolean) Method

Create a RawImageData with data array filled with color gradient defined by the given array of gradient stops.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.1.9680+a1b1e43de1ad9a7e35472c33948d688d7b40ef79
Syntax
C#
public static RawImageData CreateGradientRawImageData(
	GradientStop[] gradientStops,
	int textureSize = 256,
	bool isHorizontal = true,
	bool isColorAlphaPremultiplied = false
)

Parameters

gradientStops  GradientStop
Array of gradient stops that define the color gradient.
textureSize  Int32  (Optional)
Width (when isHorizontal is true) or Height (when isHorizontal is false) of the generated texture.
isHorizontal  Boolean  (Optional)
true to create a horizontal texture (size: textureSize x 1); false to create a vertical texture (size: 1 x textureSize).
isColorAlphaPremultiplied  Boolean  (Optional)
when true, then the colors in gradientStops are already alpha-premultiplied. When false (by default), then the colors are not alpha-premultiplied

Return Value

RawImageData
Generated RawImageData.
See Also