procedure GetTextImage (aText:
string;
var aBitmap: TBitmap);
var
R : TRect;
begin
with aBitmap.Canvas
do
begin
SetRect(R, 0, 0, MaxInt, MaxInt);
DrawText(
Handle, PChar(aText), Length(aText), R, DT_CALCRECT);
aBitmap.Width := R.Right - R.Left;
aBitmap.Height := R.Bottom - R.Top;
OffsetRect(R, -R.Left, -R.Top);
DrawText(
Handle, PChar(aText), Length(aText), R, 0);
end;
end;