|
|
|
|
|
- Creating several drawings with the same color and line style
Creating several drawings with the same color and line style The following code shows how to draw several drawings (circles and rectangles) with the same color and 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  // 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(IMG_ImageDrawing, LineColor, LineStyle) // Draw the circle dCircle(IMG_ImageDrawing, 10, 10, 50, 50) // Draw the rectangle dRectangle(IMG_ImageDrawing, 40, 40, 80, 80)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|