ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Coordinates
  • Drawing in 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 multiple segments in an Image control.
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
IMG_Drawing.Pen(LightBlue, 2, 4) 
arrCoordinatesXY2 is array of 0 int = [2, 2, 140, 2, 150, 70, 0, 100, 200,100]
IMG_Drawing.DrawPolyline(arrCoordinatesXY2)
Syntax

Building a line point by point Hide the details

<Image control>.DrawPolyline(<NbPoint> , <X1> , <Y1> , <X2> , <Y2> [, <Xn> [, <Yn> [, <Line color>]]])
<Image control>: Control name
Name of the Image control to be used.
<NbPoint>: Integer
Number of line segments. This parameter defines the number of <X>, <Y> pairs to specify in the function.
<X1>: Integer
X-coordinate of the first segment of the line. These coordinates are expressed in pixels.
<Y1>: Integer
Y-coordinate of the first segment of the line. These coordinates are expressed in pixels.
<X2>: Integer
X-coordinate of the second segment of the line. These coordinates are expressed in pixels.
<Y2>: Integer
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:
  • is Transparent if <Image>.Pen has not been previously used.
    For a variable of type Image, the line will be black.
  • corresponds to the color specified in the last call to <Image>.Pen.

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

<Image control>.DrawPolyline(<Array of coordinates> [, <Line color>])
<Image control>: Control name
Name of the Image control to be used.
<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 indices represent the X-coordinates while the odd indices represent the Y-coordinates of the 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:
  • is Transparent if <Image>.Pen has not been previously used.
    For a variable of type Image, the line will be black.
  • corresponds to the color specified in the last call to <Image>.Pen.
Reports and QueriesWindowsLinuxAndroidiPhone/iPadUser code (UMC)

Building a line using a variable of type Polygon Hide the details

<Image control>.DrawPolyline(<Polygon> [, <Line color>])
<Image control>: Control name
Name of the Image control to be used.
<Polygon>: Polygon variable
Name of the Polygon variable that describes 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:
  • is Transparent if <Image>.Pen has not been previously used.
    For a variable of type Image, the line will be black.
  • corresponds to the color specified in the last call to <Image>.Pen.
Remarks

Coordinates

Coordinates are specified with respect to the upper-left corner of the image (coordinates: (0.0)).
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 project description window.
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: wd300pnt.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/17/2024

Send a report | Local help