以任意角度顯示文字
發(fā)表時(shí)間:2023-08-17 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]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;