PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Creating several drawings with the same color and line style
Creating several drawings with the same color and line style
The following code is used to draw several drawings (a circle and a rectangle) with the same color and the same line style. The drawings will be created in an Image control (IMG_ImageDrawing). The color and the style of the line are selected by the user via two radio buttons (RADIO_SelectColor and RADIO_SelectStyle).
// Declare the variables
LineColor is int
LineStyle is int
// Declare the drawing in the "IMG_ImageDrawing" control
dStartDrawing(IMG_ImageDrawing)
// Retrieve the selected line color
SWITCH RADIO_SelectColor
CASE 1: LineColor = LightRed
CASE 2: LineColor = LightBlue
CASE 3: LineColor = LightGreen
CASE 4: LineColor = LightYellow
END
// Retrieve the selected line style
SWITCH RADIO_SelectStyle
CASE 1: LineStyle = 0
CASE 2: LineStyle = 1
CASE 3: LineStyle = 2
CASE 4: LineStyle = 3
CASE 5: LineStyle = 4
CASE 6: LineStyle = 5
END
// Initialize the color and the style of the lines
dPen(LineColor, LineStyle)
// Draw the circle
dCircle(10, 10, 50, 50)
// Draw the rectangle
dRectangle(40, 40, 80, 80)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment