ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Using the drawing functions
  • Fonts
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Declares the font that will be used by dText:
  • in an Image control,
  • in a variable of type Image.
  • WINDEV in a variable of type WDPic (on the background layer),
  • WINDEV in a variable of type picLayer.
Linux Caution: Using this function under Linux requires a specific configuration.. For more details, see The drawings.
// Initialise le dessin dans un champ Image
dStartDrawing(IMG_Dessin)

// Déclaration de la police de caractères:
// Arial, taille 12, gras
dFont("Arial", 12, iBold)
WINDEVJavaUser code (UMC)
// Déclaration de la police de caractères:
// Arial, taille 12, gras
dFont(IMG_Dessin, "Arial", 12, iBold)
Syntax

Using a specific font for the drawings Hide the details

dFont([<Image>, ] <Font> [, <Font size> [, <Font attributes> [, <Text inclination>]]])
<Image>: Optional control name or optional Image, WDPic or picLayer variable
WindowsLinuxJavaUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • WINDEV the name of a variable of type WDPic. Only the background layer will be handled.
  • WINDEV the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Font>: Character string
Name of the font used when the text is drawn by dText. This parameter must not correspond to a font family. The list of fonts installed on the current computer is returned by FontList.
Java If the name of the font is not found, Windows searches for a font whose name is close to the requested one. To do so, dStartDrawing must have been used.
<Font size>: Optional integer
Size of the font (in pixels). The default value is 12.
<Font attributes>: Optional constant (or combination of constants)
Font attributes to use:
iBoldAssigns the bold attribute to the text drawn.
iItalicAssigns the italic attribute to the text drawn.
iNormal
(Default value)
Normalizes the text drawn
iStrikeOutStrikes the text drawn.
iUnderlinedUnderlines the text drawn.
<Text inclination>: Optional integer
Specifies the inclination of the text (in degrees). The default value is 0.
WINDEVUser code (UMC)

Using a font created programmatically Hide the details

dFont([<Image>, ] <Font used>)
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • WINDEV the name of a variable of type WDPic. Only the background layer will be handled.
  • WINDEV the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Font used>: Font
Font that will be used for the drawings. This parameter corresponds to a variable of type Font. The font characteristics have been defined with FontCreate or via the font properties.
Remarks

Using the drawing functions

The drawing functions can be used according to 2 methods:
  • Method 1: Using the dDrawingStartfunction
    • dStartDrawing must be called before any other drawing function. dStartDrawing is used to define the element (Image control or variable) to which the drawing functions will be applied.
    • When drawing on an Image control:
      • The drawing functions operate on a copy ("bitmap") of the image. You can use the drawing functions of Windows (via API or CallDLL32) but these functions must use the DC (Device Context) returned by dStartDrawing.
      • dEndDrawing and dStartDrawing must not be called in the same process.
        If function dEndDrawing is called in the same process as function dStartDrawing, the drawing will not appear: it will be automatically deleted.
  • WindowsLinuxJavaUser code (UMC) Method 2: Indicate the design destination directly in the syntax (via a parameter)
    The <Image> parameter is used to specify directly the target of the drawing. dStartDrawing becomes useless. This function must be deleted.
WINDEVWindowsJavaUser code (UMC)

Fonts

FontList is used to retrieve the list of valid fonts (TrueType, PostScript) installed on the current computer.
To get good results when angling the text drawn, the <Font> used must be a "TrueType" font.
Business / UI classification: Neutral code
Component: wd300pnt.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help