PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Coordinates
  • Using the drawing functions
  • Pattern and PHP
  • Drawing in Browser code
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Draws a line composed of several segments:
  • in an Image control,
  • in an Image variable.
    WEBDEV - Browser code This type of variable is not available.
  • Versions 25 and later
    WINDEVWEBDEV - Server code in a WDPic variable (on the background layer),
    New in version 25
    WINDEVWEBDEV - Server code in a WDPic variable (on the background layer),
    WINDEVWEBDEV - Server code in a WDPic variable (on the background layer),
  • Versions 25 and later
    WINDEVWEBDEV - Server code in an picLayer variable.
    New in version 25
    WINDEVWEBDEV - Server code in an picLayer variable.
    WINDEVWEBDEV - Server code in an picLayer variable.
Versions 25 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 25
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
The first coordinate indicates the starting point of the first segment, then each coordinate indicates the end of the previous segment and the beginning of the next segment.
Example
dStartDrawing(IMG_Dessin)
// Dessine un trait vert en pointillés d'une épaisseur de 4 pixels
dPen(DarkGreen, 2, 4)
// Ligne composée de 4 segments
dPolyline(4, 10, 100, 50, 60, 80, 90, 150, 13)
dStartDrawing(IMG_Dessin)
dPen(DarkGreen, 2, 4)
// Dessin d'une ligne à partir d'un tableau de coordonnées de points (syntaxe 2)
tabCoordonnéesXY is array of 0 by 2 int = [[2, 3], [14, 100], [10,70], [50, 80]]
dPolyline(tabCoordonnéesXY)
dPen(IMG_Dessin, DarkGreen, 2, 4)
tabCoordonnéesXY2 is array of 0 int = [2, 2, 140, 2, 150, 70, 0, 100, 200, 100]
dPolyline(IMG_Dessin, tabCoordonnéesXY2)
Syntax

Building a line point by point Hide the details

dPolyline([<Image>, ] <NbPoint> , <X1> , <Y1> , <X2> , <Y2> [, <Xn> [, <Yn> [, <Line color>]]])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<NbPoint>: entier
Number of line segments. This parameter defines the number of <X>, <Y> pairs to specify in the function.
<X1>: entier
X-coordinate of the first segment of the line. These coordinates are expressed in pixels.
<Y1>: entier
Y-coordinate of the first segment of the line. These coordinates are expressed in pixels.
<X2>: entier
X-coordinate of the second segment of the line. These coordinates are expressed in pixels.
<Y2>: entier
Y-coordinate of the second segment of the line. These coordinates are expressed in pixels.
<Xn>: Optional integer
X-coordinate of the N segment of the line. These coordinates are expressed in pixels.
<Yn>: Optional integer
Y-coordinate of the N segment of the line. These coordinates are expressed in pixels.
<Line color>: Integer or constant (optional)
Line color. This color can correspond to:If this parameter is not specified, the line color:
  • corresponds to the color specified in the last call to dPen,
  • is identical to the Color used for the Background if the dPen function was not used.

Building a line via an array of X and Y-coordinates Hide the details

dPolyline([<Image>, ] <Array of coordinates> [, <Line color>])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Array of coordinates>: Array of integers or array of points
WLanguage array of integers containing the coordinates of segments that make up the line. The even subscript represent the X-coordinates while the odd subscripts represent the Y-coordinates of points. These coordinates are expressed in pixels.
<Line color>: Integer or constant (optional)
Line color. This color can correspond to:If this parameter is not specified, the line color:
  • corresponds to the color specified in the last call to dPen,
  • is identical to the Color used for the Background if the dPen function was not used.
Versions 26 and later
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC)

Construction of an row via an Variable type Polygon Hide the details

dPolyline([<Image>, ] <Polygon> [, <Line color>])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Polygon>: Variable type Polygon
Name of the variable of type Polygon describing the different points of the Polygon.
<Line color>: Integer or constant (optional)
Line color. This color can correspond to:If this parameter is not specified, the line color:
  • corresponds to the color specified in the last call to dPen,
  • is identical to the Color used for the Background if the dPen function was not used.
New in version 26
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC)

Construction of an row via an Variable type Polygon Hide the details

dPolyline([<Image>, ] <Polygon> [, <Line color>])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Polygon>: Variable type Polygon
Name of the variable of type Polygon describing the different points of the Polygon.
<Line color>: Integer or constant (optional)
Line color. This color can correspond to:If this parameter is not specified, the line color:
  • corresponds to the color specified in the last call to dPen,
  • is identical to the Color used for the Background if the dPen function was not used.
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC)

Construction of an row via an Variable type Polygon Hide the details

dPolyline([<Image>, ] <Polygon> [, <Line color>])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
    WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • Versions 25 and later
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    New in version 25
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
    WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Polygon>: Variable type Polygon
Name of the variable of type Polygon describing the different points of the Polygon.
<Line color>: Integer or constant (optional)
Line color. This color can correspond to:If this parameter is not specified, the line color:
  • corresponds to the color specified in the last call to dPen,
  • is identical to the Color used for the Background if the dPen function was not used.
Remarks

Coordinates

Coordinates are given with respect to the top left corner of the image (coordinates: (0.0)).

Using the drawing functions

The drawing functions can be used according to 2 methods:
  • Method 1: Using dStartDrawing
    • dStartDrawing must be called before any other drawing function. dStartDrawing is used to define the element (Image control or variable) to which the drawing functions will be applied.
    • When drawing on an Image control:
      • The drawing functions operate on a copy ("bitmap") of the image. You can use the drawing functions of Windows (via API or CallDLL32) but these functions must use the DC (Device Context) returned by dStartDrawing.
      • dEndDrawing and dStartDrawing must not be called in the same process.
        The drawing will not be displayed if dEndDrawing and dStartDrawing are called in the same process: it will be automatically erased.
  • Versions 24 and later
    Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystUser code (UMC) Method 2: indicating the drawing target directly in the syntax (via a parameter)
    The <Image> parameter is used to specify directly the target of the drawing. The dStartDrawing function becomes unnecessary. This function must be deleted.
    Versions 25 and later
    Android This syntax is now available.
    New in version 25
    Android This syntax is now available.
    Android This syntax is now available.
    New in version 24
    Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystUser code (UMC) Method 2: indicating the drawing target directly in the syntax (via a parameter)
    The <Image> parameter is used to specify directly the target of the drawing. The dStartDrawing function becomes unnecessary. This function must be deleted.
    Versions 25 and later
    Android This syntax is now available.
    New in version 25
    Android This syntax is now available.
    Android This syntax is now available.
    Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystUser code (UMC) Method 2: indicating the drawing target directly in the syntax (via a parameter)
    The <Image> parameter is used to specify directly the target of the drawing. The dStartDrawing function becomes unnecessary. This function must be deleted.
    Versions 25 and later
    Android This syntax is now available.
    New in version 25
    Android This syntax is now available.
    Android This syntax is now available.
WEBDEV - Browser code

Drawing in Browser code

Some drawing functions are available in Browser code. The drawing functions in Browser code are based on the HTML 5 standard. More specifically, these functions are based on the "canvas" tag of HTML 5.
The drawing features in browser code are available for the recent browsers only (supporting the HTML 5 standard). To find out whether the drawing features are proposed by your browser, use DrawingAvailable.
Caution: To use the drawing functions with Internet Explorer 9, the project must include the reference to the DTD file. To do so, the HTML mode must be "HTML 4.01 Transitional + DTD". This option is available in the "Advanced" tab of the description window of project.
Reminder: To open the project description window, go to the "Project" tab, "Project" group and click "Description".
Special case: Drawing in the browser of an Android phone: The browser drawing functions are only available starting with version 3 of Android.
Related Examples:
The drawing functions Unit examples (WINDEV): The drawing functions
[ + ] Using the main drawing functions of WINDEV to:
- Initialize an Image control for drawing
- Draw simple shapes
- Write a text into a drawing
- Change the color in a drawing
Business / UI classification: Neutral code
Component: wd270pnt.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment