明辉手游网中心:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

以任意角度显示文字

[摘要]var LogFont: TLogFont; theFont: TFont; begin with Form1.Canvas do begin Font.Name := &...
var
  LogFont: TLogFont;
  theFont: TFont;
begin
  with  Form1.Canvas do
  begin
    Font.Name := '宋体';
    Font.Size := 18;
    Font.Color := clYellow;  
    theFont := TFont.Create;
    theFont.Assign( Font );
    GetObject( theFont.Handle, Sizeof(LogFont),  @LogFont );
    LogFont.lfEscapement := 450; // 45度
    LogFont.lfOrientation := 450;  // 45度
    theFont.Handle := CreateFontIndirect( LogFont );
    Font.Assign( theFont );  
    theFont.Free;
    TextOut( X, Y, 'Hello!' );
  end;
end;