ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Drawing a line in an Image control
Drawing a line in an Image control
The following code is used to draw a line in an Image control (IMG_ImageDrawing). The coordinates of the start point and end point of the line are entered by the user in edit controls (EDT_X1, EDT_Y1, EDT_X2, EDT_Y2). The color of the line is selected by the user via a radio button (RADIO_SelectColor).
// Declare the variable
LineColor is int
 
// Declare the drawing in the "IMG_ImageDrawing" control
dStartDrawing(IMG_ImageDrawing)
 
// Retrieve the color of the line
SWITCH RADIO_SelectColor
CASE 1: LineColor = LightRed
CASE 2: LineColor = LightBlue
CASE 3: LineColor = LightGreen
CASE 4: LineColor = LightYellow
END
 
// Draw the line
dLine(EDT_X1, EDT_Y1, EDT_X2, EDT_Y2, LineColor)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help