Create(StatrColor: IGxColor; EndColor: IGxColor; Angle: Double; [Rect: IGxRect = Null]);
Create(StatrColor: Prognoz.Platform.Interop.Drawing.GxColor;
EndColor: Prognoz.Platform.Interop.Drawing.GxColor;
Angle: Double; Rect: Prognoz.Platform.Interop.Drawing.GxRect);
StatrColor. Gradient start color.
EndColor. Gradient end color.
Angle. Gradient angle.
Rect. Rectangle limiting gradient area. The rectangle is not specified by default, the linear gradient brush sized 100*100 pixels is created.
The Create method creates a new linear gradient brush in accordance with the specified parameters.
To execute the example, add a link to the Drawing system assembly.
Function GetLinearGradientBrush(StartColor: GxKnownColor; EndColor: GxKnownColor; Angle: Double): IGxLinearGradientBrush;
Var
SColor, EColor: IGxColor;
LGradientBrush: IGxLinearGradientBrush;
Begin
SColor := New GxColor.FromKnownColor(StartColor);
EColor := New GxColor.FromKnownColor(EndColor);
LGradientBrush := New GxLinearGradientBrush.Create(SColor, EColor, Angle);
Return LGradientBrush;
End Function GetLinearGradientBrush;
The function returns the linear gradient brush with the specified colors and gradient angle. The brush size is 100*100 pixels.
Imports Prognoz.Platform.Interop.Drawing;
Function GetLinearGradientBrush(StartColor: GxKnownColor; EndColor: GxKnownColor; Angle: Double): GxLinearGradientBrush;
Var
SColor, EColor: GxColor;
GxColorCls: GxColorClass = New GxColorClassClass();
LGradientBrush: GxLinearGradientBrush = New GxLinearGradientBrushClass();
Begin
SColor := GxColorCls.FromKnownColor(StartColor);
EColor := GxColorCls.FromKnownColor(EndColor);
LGradientBrush.Create(SColor, EColor, Angle, Null);
Return LGradientBrush;
End Function;
The result of the Fore.NET example execution matches that of the Fore example.
See also: