- Gradient parameters
- Background color
gBackgroundGradient (Function) In french: gFondDégradé Describes a display color in gradient mode. This color can be used for the background of the text displayed in an element of a List Box or Combo Box control, for a table cell, etc. Caution: This function cannot be directly used for the background of a window (see the example below).
// Add the "Yellow" word on a gradient background (from red to green) into "LIST_ColorList" ListAdd(LIST_ColorList, gBackgroundGradient(LightRed, LightGreen) + "Yellow")
// Caption with text on gradient background STC_Element.Caption = gBackgroundGradient(RGB(166, 223, 98), RGB(87, 171, 47)) + gPen(LightRed) + ... "Caption with gradient background"
// Example used to apply a gradient window background. // Use an off-screen image control whose size is identical to the window size (IMG_Gradient) MyImage is string MyImage = CompleteDir(fExeDir()) + "BckgrdImage.JPG" IF fFileExist(MyImage) = True THEN fDelete(MyImage) IMG_Gradient = gBackgroundGradient(PastelRed, PastelBlue, 70) dSaveImageJPEG(IMG_Gradient, MyImage, 65) WIN_Widow1.BackgroundImage = MyImage
Syntax
<Result> = gBackgroundGradient(<Start color> , <End color> [, <Angle> [, <Color 3> [, <Distance color 3> [, <Color 4> [, <Distance color 4>]]]]])
<Result>: Character string Control string to be used: <Start color>: Integer or constant Start color of the gradient. This color can correspond to: <End color>: Integer or constant End color of the gradient. This color can correspond to: <Angle>: Optional integer Angle that will be used for the selection of colors in the gradient. The angle value is included between 0 (horizontal angle, default value) and 360°. <Color 3>: Optional constant or integer Color that will be used in the gradient. This color can correspond to: <Distance color 3>: Optional integer Percentage separating the start color from color 3. <Color 4>: Optional constant or integer Color that will be used in the gradient. This color can correspond to: <Distance color 4>: Optional integer Percentage separating the start color from color 4. Remarks The color parameters are used as follows: The angle is used to define the orientation of the gradient. The gradients performed with 3 or 4 colors are only available for an angle set to 0 or 90 degrees. Remark: On some systems (e.g., 256-color Remote Desktop Connection), gradients are not available. In this case, a rectangle whose color corresponds to <Start color> is displayed. - gBackgroundGradient can be used to define the background of a clickable area in the title bar and status bar of a window or in a Static control.
- When gBackgroundGradient is called with the Transparent constant, text can overlay an image.
This page is also available for…
|
|
|
|