ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Exclusive WINDEV, WEBDEV and WINDEV Mobile SaaS (Update 2) new feature. See "Using SaaS-exclusive new features in a project".
Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Font
  • Using the drawing functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Calculates text height in pixels. This text can be found:
  • in an Image control,
  • in a variable of type Image.
  • WINDEVWEBDEV - Server code in a variable of type WDPic (on the background layer),
  • WINDEVWEBDEV - Server code in a variable of type picLayer.
Linux Caution: In Linux, this function requires a specific configuration. For more details, see The drawings.
New in SaaS
This new function is available from WINDEV Suite SaaS 2025 Update 2.
Example
Info("The height of the text 'Hello' is: " + dTextHeight(MyImage, "Hello"))
Syntax
<Result> = dTextHeight([<Image>, ] <Text> [, <Maximum width> [, <& character support>]])
<Result>: Integer
Text height, expressed in pixels.
<Image>: Optional control name or optional Image, WDPic or picLayer variable
Reports and QueriesWindowsLinuxAndroidiPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC) Image to use. This image can correspond to:
  • the name of an Image control.
  • the name of a variable of type Image.
  • WINDEVWEBDEV - Server code the name of a variable of type WDPic. Only the background layer will be handled.
  • WINDEVWEBDEV - Server code the name of a variable of type picLayer.
If this parameter is not specified, it is necessary to define the drawing destination with dStartDrawing.
<Text>: Character string
Text whose height must be calculated. This text can be:
  • a string (without formatting marks such as TAB, CR, etc.),
  • a numeric.
<Maximum width>: Optional integer
Maximum text width, expressed in pixels.
If this parameter is not specified or is set to -1, there will be o width limit.
<& character support>: Optional boolean
  • True (default value) if the "&" character must not be interpreted as an underline operator.
  • False if the "&" character must be interpreted as an underline operator. In this case, the character after "&" will be underlined.
Remarks

Font

By default:
  • The font used is "MS Sans Serif" (size 13).
  • The writing direction is horizontal (from left to right).
  • The coordinates of the upper-left corner of the image are (0,0).
  • The "&" character is not interpreted.
To change these parameters, use dFont.
AndroidJava The default font may differ according to the system on which the application is run.

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.
  • Reports and QueriesWindowsLinuxAndroidiPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC) Method 2: specify design destination directly in syntax (via parameter)
    The <Image> parameter is used to specify directly the target of the drawing. dStartDrawing becomes useless. This function must be deleted.
Business / UI classification: Neutral code
Component: wd300pnt.dll
Minimum version required
  • Version 2025 (SaaS)
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/25/2025

Send a report | Local help