- Using the drawing functions
- Fonts
dFont (Function) In french: dPolice Declares the font that will be used by dText: - in an Image control,
- in a variable of type Image.
// Initialize the drawing in an Image control dStartDrawing(IMG_Drawing) // Declare the character font: // Arial, size 12, bold dFont("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
<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. <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: | | iBold | Assigns the bold attribute to the text drawn. | iItalic | Assigns the italic attribute to the text drawn. | iNormal (Default value) | Normalizes the text drawn | iStrikeOut | Strikes the text drawn.
| iUnderlined | Underlines the text drawn.
|
<Text inclination>: Optional integer Specifies the inclination of the text (in degrees). The default value is 0. Remarks Using the drawing functions The drawing functions can be used according to 2 methods: - Method 1: Using dStartDrawing
- 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.
The drawing will not be displayed if dEndDrawing and dStartDrawing are called in the same process: it will be automatically erased.
 Method 2: indicating the drawing target 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.
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|