AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones de dibujo
  • Drawing a rectangle in an Image control
dRectangle (Example)
Drawing a rectangle in an Image control
The following code is used to draw a rectangle in an Image control (IMG_ImageDrawing). The coordinates of the rectangle are entered by the user in edit controls (EDT_X1, EDT_Y1, EDT_X2, EDT_Y2). The background color and the line color of the rectangle 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 rectangle
dRectangle(EDT_X1, EDT_Y1, EDT_X2, EDT_Y2, BackgroundColor, LineColor)
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local