was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

72 Visitors Online


 
...Text rotieren?
Autor: Thomas Stutz
[ Tip ausdrucken ]  

Tip Bewertung (26):  
     




procedure TForm1.FormPaint(Sender: TObject);
var
  
lf: TLogFont;
  tf: TFont;
begin
  with 
Form1.Canvas do
  begin
    
Font.Name := 'Arial';
    Font.Size := 24;
    tf        := TFont.Create;
    try
      
tf.Assign(Font);
      GetObject(tf.Handle, SizeOf(lf), @lf);
      lf.lfEscapement  := 320;
      lf.lfOrientation := 320;
      SetBkMode(Handle, TRANSPARENT);
      tf.Handle := CreateFontIndirect(lf);
      Font.Assign(tf);
    finally
      
tf.Free;
    end;
    TextOut(10, Height div 2, 'Your Rotated Text!');
  end;
end;




The LOGFONT structure holds information about a logical font.
The various members of the structure specify properties of the logical font:

lfEscapement
The angle between the font's baseline and escapement vectors,
in units of 1/10 degrees.
Windows 95, 98: This must be equal to lfOrientation.

lfOrientation
The angle between the font's baseline and the device's x-axis,
in units of 1/10 degrees.
Windows 95, 98: This must be equal to lfEscapement.

lfWidth
The average width of the font's characters.
If 0, the font mapper tries to determine the best value

lfWeight
One of the following flags specifying the
boldness (weight) of the font:

FW_DONTCARE = 0 Default weight.
FW_THIN = 100 Thin weight.
FW_EXTRALIGHT = 200 Extra-light weight.
FW_LIGHT = 300 Light weight.
FW_NORMAL = 400 Normal weight.
FW_MEDIUM = 500 Medium weight.
FW_SEMIBOLD = 600 Semi-bold weight.
FW_BOLD = 700 bold weight.
FW_EXTRABOLD = 800 Extra-bold weight.
FW_HEAVY = 900 Heavy weight.


lfItalic
A non-zero value if the font is italicized, 0 if not.

lfUnderline
A non-zero value if the font is underlined, 0 if not.

lfStrikeOut
A non-zero value if the font is striked out, 0 if not.

 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners