AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones de dibujo
  • Changing the color of an area
Changing the color of an area
The following code changes the color of an area in an Image control (IMG_ImageDrawing). The user clicks the Image control to select the area. The new color is selected by the user via a radio button (RADIO_SelectColor). The coordinates of the mouse click can be retrieved with MouseXPos and MouseYPos.
In this example, we will assume that the Image control (IMG_ImageDrawing) contains several drawings.
// -- Click code of "IMG_ImageDrawing"
// Declare the variables
AreaColor is int
XCoord is int
YCoord is int
 
// Declare the drawing in the "IMG_ImageDrawing" control
dStartDrawing(IMG_ImageDrawing)
 
// Retrieve the coordinates of the mouse click
XCoord = MouseXPos()
YCoord = MouseYPos()
 
// Retrieve the selected fill color
SWITCH RADIO_SelectColor
CASE 1: AreaColor = LightRed
CASE 2: AreaColor = LightBlue
CASE 3: AreaColor = LightGreen
CASE 4: AreaColor = LightYellow
END
 
// Color the area
dFill(XCoord, YCoord, AreaColor)
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