Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips

#2: How I can display the rotated text?

With next procedure you can display the text with any angle.

procedure AngleTextOut(ACanvas: TCanvas; Angle, X, Y: Integer; Str: string);
  LogRec: TLogFont;
  NewFontHandle: hFont;
  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);

Angle is the angle of rotation in the degrees, clockwise.

If somebody know how display the rotated text with wordwrap property, then
send a sources or link to me.

PS: I hope that you not forget that on my site you can download a freeware
TAngleLabel component with correct layout and alignment calculations.

Published: July 30, 1999

See also
Word Web-stream
SMImport suite
SMMsg suite
ABA Spreadsheet Convert
Clarion to Text converter
Excel Reader (dll)
Excel Web-stream
Viewer for TNEF-files (winmail.dat)
Paradox to Text converter

Contact to webmaster


Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2018, Scalabium Software. All rights reserved.

SMReport Autogenerated