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
XYChartMeasureStringApproximatelyVisu_TypeStringInput
pabyCharWidthsPOINTER 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.
pbyStringVisu_TypeStringThe string to measure
xWstringBOOLIf TRUE, then pbyString is a POINTER TO WSTRING otherwise a POINTER TO STRING
iBufferSizeINTThe 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
sFontNameSTRINGThe name of the font to use
iFontHeightINTThe height of the font to use
dwFontFlagsDWORDThe flags of the font to use
iMaxLengthINTThe 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
iLengthINTReturns 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).
iHeightINTReturns the height of the string. Because the font is the same for all the line, the height is referred to a single line
iCountLinesINTReturns the number of lines the string spans, including automatically determined line breaks