IXYChartStringApproxMeasurer.XYChartMeasureStringApproximately
(METH)
METHOD XYChartMeasureStringApproximately : Visu_TypeString
Measures a given string using a given font and inserts line breaks at the corresponding positions in order that the string fits into a given length. The return value is the modified string
- InOut:
Scope
Name
Type
Comment
Return
XYChartMeasureStringApproximately
Visu_TypeString
Input
pabyCharWidths
POINTER TO ARRAY [0..0] OF BYTE
Points to an array, that contains character widths of represetative characters for each used font. The actual parameter is not of this type and the implementor (in the target visu) knows the correct declaration of this array. Not needed in the integrated visualization, therefore an arbitrary array is used.
pbyString
Visu_TypeString
The string to measure
xWstring
BOOL
If TRUE, then pbyString is a POINTER TO WSTRING otherwise a POINTER TO STRING
iBufferSize
INT
The size of the string pbyString in bytes. This parameter has to be positive in order to have line breaks inserted value = 0: we dont insert line breaks, just measure the length of the string
sFontName
STRING
The name of the font to use
iFontHeight
INT
The height of the font to use
dwFontFlags
DWORD
The flags of the font to use
iMaxLength
INT
The maximum length of the string in pixels, that does not require a line break value = 0: we dont insert line breaks, just measure the length of the string
Output
iLength
INT
Returns the length of the string (the maximum length of single lines within a multiline string). The return value is an approximate length or a negative value if the string cannot be measured at the moment (in this case in the next update-paint cycle a subsequent call of this method will return the length).
iHeight
INT
Returns the height of the string. Because the font is the same for all the line, the height is referred to a single line
iCountLines
INT
Returns the number of lines the string spans, including automatically determined line breaks