- Drawing in anti-aliasing mode
- Using the drawing functions
- Pattern and PHP
In french: dRemplissage
Colors an area:
- in an Image control,
- in an Image variable.
This type of variable is not available.
This coloring is applied to all the juxtaposed points that have the same color as the specified start point.
// Initialize the drawing in an Image control
// Color an area in light blue
dFill(10, 50, LightBlue)
Versions 24 and later New in version 24
dFill([<Image>, ] <X> , <Y> [, <Fill color> [, <Border color>]])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Image to use. This image can correspond to:
- the name of an Image control.
- the name of an Image variable.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing
X coordinate (in pixels) of the point inside the area to color. This position is given in relation to the top left corner of the image control (coordinates set to (0, 0)).
Y coordinate (in pixels) of the point inside the area to color. This position is given in relation to the top left corner of the image control (coordinates set to (0, 0)).
<Fill color>: Integer or constant (optional)
Color used to fill the area. This color can correspond to:
If this parameter is not specified, the fill color:
- is Transparent if function dBackground has not been used before,
- corresponds to the Color specified in the last call to function dBackground.
<Border color>: Integer or constant (optional)
Area border color. This color can correspond to:
If this parameter is not specified, the area border color adapts to the fill color.
Drawing in anti-aliasing mode
When drawing in anti-aliasing mode (constant drawAntiAliasing
in the dChangeMode
function), the graphics card smoothes the points and colors used at the edges of the shapes.
In this case, <Border color> is not displayed in the drawing and the fill is applied to the entire drawing.
Pattern and PHP
In PHP, the drawing functions are based on the graphic library GD. This library is commonly used by the PHP hosting companies and therefore it is always enabled. The version of the GD library must be version 2.0.28 (or later). This library can be downloaded from the PHP site.
To enable (if necessary) this library locally, the following elements are required:
- PHP installed.
- the PHP.INI file found in the Windows directory must contain the following line: "extension=php_gd2.dll" (instead of ";extension=php_gd2.dll").
- the php_gd2.dll file must exist in the directory of PHP extensions. This directory is defined in the PHP.INI file by the "extension_dir" variable.
Limitation for dFill
: The opacity defined by dBackground
Unit examples (WINDEV): The drawing functions
Business / UI classification: Neutral code
This page is also available for…