Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Canvas, Vertikaler Text (https://www.delphipraxis.net/58487-canvas-vertikaler-text.html)

alzaimar 8. Dez 2005 19:24

Re: Canvas, Vertikaler Text
 
Hier:
Delphi-Quellcode:
Procedure VerticalText(Rotation, x, y: Integer; aText: String; aCanvas: TCanvas);
Var
  aFt: LOGFONT;
  hOldFont: THandle;

Begin
  hOldFont := aCanvas.Font.Handle;
  Try
    aCanvas.Font.Name :='Arial'; // Muss TrueType sein
    GetObject(aCanvas.Font.Handle, SizeOf(aFt), @Aft);
    aFt.lfEscapement := 10 * Rotation; // Rotate ist der Winkel in Grad
    aFt.lfOrientation := aft.lfEscapement;
    aFt.lfQuality := ANTIALIASED_QUALITY;
    aCanvas.Font.Handle := CreateFontIndirect(aFt);
    aCanvas.TextOut(x, y, aText);
  Finally
    DeleteObject(aCanvas.Font.Handle);
    aCanvas.Font.Handle := hOldFont;
  End;
End;


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:52 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz