AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones de dibujo
  • Drawing text in an Image control: dynamic font
  • Drawing text in an Image control
Drawing text in an Image control: dynamic font
WINDEVWEBDEV - Código ServidorReportes y ConsultasWindowsCódigo de Usuario (UMC)PHPAjax The following code draws text in an Image control (IMG_ImageDrawing). The text to draw is entered by the user in an Edit control (EDT_EditText). The font is selected by the user with FontSelect.
// Create a default font
DefaultF is Font = FontCreate("Arial", 12)
// Use a variable to store the user font
UserF is Font
// Ask the user to modify his font
FontSelect(UserF, True, DefaultF)
// Initialize the font
dFont(UserF)
// Draw the text
dText(10, 10, EDT_EditText)
Drawing text in an Image control
The following code draws text in an Image control (IMG_ImageDrawing). The text to draw is entered by the user in an Edit control (EDT_EditText). The font and the size of the text are selected by the user via two radio buttons (RADIO_SelectFont and RADIO_SelectSize).
// Declare the variables
TextFont is string
TextSize is int
 
// Declare the drawing in the "IMG_ImageDrawing" control
dStartDrawing(IMG_ImageDrawing)
 
// Retrieve the selected font
SWITCH RADIO_SelectFont
CASE 1: TextFont = "Arial"
CASE 2: TextFont = "Times New Roman"
CASE 3: TextFont = "Courier New"
END
 
// Retrieve the selected size
SWITCH RADIO_SelectSize
CASE 1: TextSize = 10
CASE 2: TextSize = 12
CASE 3: TextSize = 14
END
 
// Initialize the font
dFont(TextFont, TextSize)
// Draw the text
dText(10, 10, EDT_EditText)
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