ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Graphic string functions
  • Gradient parameters
  • Background color
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Warning This function cannot be used directly for a window background (see example below).
Example
// Ajout du mot "Jaune" sur fond dégradé rouge à vert dans la liste "LISTE_ListeCouleur"
ListAdd(LISTE_ListeCouleur, gBackgroundGradient(LightRed, LightGreen) + "Jaune")
// Libellé avec un texte sur fond dégradé
LIB_Elément.Libellé = gBackgroundGradient(RGB(166, 223, 98), RGB(87, 171, 47)) + gPen(LightRed) + ...
	"Libellé avec fond dégradé"
// Exemple permettant d'appliquer un fond de fenêtre dégradé.
// Il faut utiliser un champ Image hors écran de la taille de la fenêtre (ici IMG_Degrade)

MonImage is string
MonImage = CompleteDir(fExeDir()) + "ImageFond.JPG"
IF fFileExist(MonImage) = True THEN fDelete(MonImage)
IMG_Degrade = gBackgroundGradient(PastelRed, PastelBlue, 70)
dSaveImageJPEG(IMG_Degrade, MonImage, 65)
FEN_Fenêtre1.ImageFond = MonImage
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

Gradient parameters

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.
Note Gradients are not available on some systems or under TSE 256 colors. In this case, a rectangle whose color corresponds to <Start color> is displayed.

Background color

  • 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 Text control.
  • When gBackgroundGradient is called with the Transparent constant, text can overlay an image.
Component: wd300obj.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help