Rotated text
- From: "Tom de Neef" <tdeneef@xxxxxxxx>
- Date: Sat, 18 Nov 2006 17:30:27 +0100
Currently I use the procedure below to output text at an angle on a canvas.
Several source on the internet approach it in this way. But I must say: the
quality of the result is pretty poor. Are there better ways to do this ?
Thank you,
Tom
procedure AngleTextOut(ACanvas: TCanvas; Angle, X, Y: Integer; Str: string);
var
LogRec: TLogFont;
OldFontHandle,NewFontHandle: hFont;
begin
GetObject(ACanvas.Font.Handle, SizeOf(LogRec), Addr(LogRec));
LogRec.lfEscapement := Angle*10;
NewFontHandle := CreateFontIndirect(LogRec);
OldFontHandle := SelectObject(ACanvas.Handle, NewFontHandle);
ACanvas.TextOut(X, Y, Str);
NewFontHandle := SelectObject(ACanvas.Handle, OldFontHandle);
DeleteObject(NewFontHandle);
end;
.
- Follow-Ups:
- Re: Rotated text
- From: Hans-Peter Diettrich
- Re: Rotated text
- From: alanglloyd@xxxxxxx
- Re: Rotated text
- From: Andreas Koch
- Re: Rotated text
- Prev by Date: Re: Grids ?
- Next by Date: Re: Access violation for TWebBrowser: fixes didn't work at all
- Previous by thread: Access violation for TWebBrowser: fixes didn't work at all
- Next by thread: Re: Rotated text
- Index(es):