ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Drawing the chord of a circle in an Image control
Drawing the chord of a circle in an Image control
The following code is used to draw the chord of a circle in an Image control (IMG_ImageDrawing). The coordinates of the rectangle in which the circle will be drawn and the coordinates of the start and end points of the chord are entered by the user in edit controls (EDT_X1, EDT_Y1, EDT_X2, EDT_Y2, EDT_X3, EDT_Y3, EDT_X4, EDT_Y4). The background color and the line color of the chord are selected by the user via two radio buttons (RADIO_SelectBackground and RADIO_SelectLine).
// Declare the variables
BackgroundColor is int
LineColor is int
 
// Declare the drawing in the "IMG_ImageDrawing" control
dStartDrawing(IMG_ImageDrawing)
 
// Retrieve the selected background color
SWITCH RADIO_SelectBackground
CASE 1: BackgroundColor = LightRed
CASE 2: BackgroundColor = LightBlue
CASE 3: BackgroundColor = LightGreen
CASE 4: BackgroundColor = LightYellow
END
 
// Retrieve the selected line color
SWITCH RADIO_SelectLine
CASE 1: LineColor = LightRed
CASE 2: LineColor = LightBlue
CASE 3: LineColor = LightGreen
CASE 4: LineColor = LightYellow
END
 
// Draw the chord of a circle
dChord(EDT_X1, EDT_Y1, EDT_X2, EDT_Y2, EDT_X3, EDT_Y3, EDT_X4, EDT_Y4, BackgroundColor, 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