上一篇 | 下一篇

如何旋转字体

发布: 2008-6-26 17:34 | 作者: admin | 来源: | 查看: 4次

如何旋转字体

下面的例子把文本旋转45度:

procedure TForm1.Button1Click(Sender: TObject);

var

lf : TLogFont;

tf : TFont;

begin

with Form1.Canvas do begin

Font.Name := 'Arial';

Font.Size := 24;

tf := TFont.Create;

tf.Assign(Font);

GetObject(tf.Handle, sizeof(lf), @lf);

lf.lfEscapement := 450;

lf.lfOrientation := 450;

tf.Handle := CreateFontIndirect(lf);

Font.Assign(tf);

tf.Free;

TextOut(20, Height div 2, 'Rotated Text!');

end;

end;

字号: | 推荐给好友

评分:0

我来说两句