وبلاگ شخصی حامد شیرزاد
وبلاگ شخصی حامد شیرزاد
صفحات وبلاگ
نویسنده: حامد شیرزاد - ۱۳٩٠/٧/۱٥

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

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;

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.
نویسندگان وبلاگ:
مطالب اخیر:
کدهای اضافی کاربر :