游子日月长

笑渐不闻声渐悄,多情却被无情恼!

导航

输出旋转字体

procedure AngleTextOut(CV: TCanvas; const sText: String; x, y, angle:integer);
var
  LogFont: TLogFont;
  SaveFont: TFont;

begin
  SaveFont := TFont.Create;
  SaveFont.Assign(CV.Font);
  GetObject(SaveFont.Handle, sizeof(TLogFont), @LogFont);
  with LogFont do
  begin
    lfEscapement := angle *10;
    lfPitchAndFamily := FIXED_PITCH or FF_DONTCARE;
  end; {with}
  CV.Font.Handle := CreateFontIndirect(LogFont);
  SetBkMode(CV.Handle, TRANSPARENT);
  CV.TextOut(x, y, sText);
  CV.Font.Assign(SaveFont);
  SaveFont.Free;
end;

posted on 2017-02-07 15:09  游子日月长  阅读(142)  评论(0编辑  收藏  举报