This returns a sequence of three values: The height, in pixels, of the text drawn, and the number of characters used that could fit into the rectangle specified, and the dimensions of the rectangle used. This rectangle is returned in the same format as the input parameter rect
Example:
sequence result sequence rect result = drawText(myWind, "Fourscore and twenty years ago, our fathers, ...", {5,5,140, 75}, DT_WORDBREAK, 4, 0, 0) textheight = result[1] textcnt= result[2] rect = result[3]
This is a special version of wPuts that can be faster under certain
circumstances.
HDC is the Device Context of a control and not its Id. This can
be obtained by getDC() or assignFont(). And must be released after
use.
TextDef is a sequence of up to 7 elements. Elements 4 thru 7 are
optional and can be 'omitted' by using an empty sequence for them.
The elements are ...
pTextDefn[1] = text string to display.
pTextDefn[2] = x (horizontal pixel position)
pTextDefn[3] = y (vertical pixel position)
pTextDefn[4] = Foregroud color
pTextDefn[5] = Background color
pTextDefn[6] = Mode (OPAQUE or TRANSPARENT)
pTextDefn[7] = Vertical Alignment with respect to character height.
(AlignTop, AlignBottom, AlignBaseline)
Example:
atom hdc hdc = assignFont(Mypixmap) H = getTextHeight(Mypixmap, "|") W = 4 textOut(hdc,{" Name:", W, 0 * H, Black, White, OPAQUE}) textOut(hdc,{"Address:", W, 1 * H}) textOut(hdc,{" Age:", W, 2 * H}) textOut(hdc,{" Weight:", W, 3 * H})W = getTextWidth(Mypixmap, "_") * 9 textOut(hdc,{NameFld, W, 0 * H, Blue, BrightWhite}) textOut(hdc,{AddressFld, W, 1 * H}) textOut(hdc,{sprintf("%d",AgeFld), W, 2 * H}) textOut(hdc,{sprintf("%5.2f", WeightFld), W, 3 * H}) releaseDC(Mypixmap)
l rect defines the left, top and maximum right pixel (for multiple line text) Example:
sequence result result = textRect(myWind, "Fourscore and twenty years ago, our fathers, ...", {5,5,140, 75}, DT_WORDBREAK, 4, 0, 0)