Autor Beitrag
goldensurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Di 01.03.05 14:56 
Hallo,
ich habe eine Form, darauf eine Paintbox.
Einen Graph ausgeben klappt wunderbar, ebenso horizontaler Text.
Wie kann ich aber Text (es geht um eine Achsenbeschriftung) vertikal (von unten nach oben) ausgeben?

Danke und ciao,
Ralf
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Di 01.03.05 15:03 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
procedure TForm1.Button1Click(Sender: TObject);
var
  Text: String;
  Log: TLogFont;
  HFnt: HFont;
begin
  //retrieve current font settings:
  GetObject (Canvas.Font.Handle, SizeOf(Log), @Log);

  //Apply rotation of 90 deg.
  Log.lfEscapement:= 900;
  Log.lfOutPrecision:= OUT_TT_ONLY_PRECIS;

  //create a new font based upon new settings
  HFnt:= CreateFontIndirect (Log);
  SelectObject (Canvas.Handle, HFnt);

  //sample text
  text := 'Vertical';
  Windows.TextOut (Canvas.Handle, 100100, @Text[1], Length (Text));

  //free resources
  DeleteObject (HFnt);
end;
goldensurfer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Di 01.03.05 15:45 
Das werde ich probieren. Vielen Dank!! :D

Ciao
Ralf
Astraios
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 25



BeitragVerfasst: Do 22.09.05 14:46 
Hilfe!

Welche Units muss ich einbinden, damit ich HFONT usw. verwenden kann? (Delphi 2005)
goldensurfer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 22.09.05 14:55 
user profile iconAstraios hat folgendes geschrieben:
Welche Units muss ich einbinden, damit ich HFONT usw. verwenden kann? (Delphi 2005)


Also bei mir musste ich gar nix einbinden - die Definition von HFont steht in der Unit "Windows". Ich habe allerdings auch schon eine recht alte Version (Delphi 4). Inwieweit man mittlerweile von diesem Unit-Konzept abgekommen ist, kann ich Dir leider nicht sagen. Aber versuch's mal damit.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Do 22.09.05 15:00 
HFont ist auch nur nen THandle bzw DWORD bzw Cardinal;

HFnt: Cardinal;


sollte also reichen

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Astraios
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 25



BeitragVerfasst: Do 22.09.05 15:21 
und TLogFont?
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Fr 23.09.05 21:17 
ist das selbe wie


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
CONST   LF_FACESIZE = 32;
TYPE
  tagLOGFONTA = packed record
    lfHeight: Longint;
    lfWidth: Longint;
    lfEscapement: Longint;
    lfOrientation: Longint;
    lfWeight: Longint;
    lfItalic: Byte;
    lfUnderline: Byte;
    lfStrikeOut: Byte;
    lfCharSet: Byte;
    lfOutPrecision: Byte;
    lfClipPrecision: Byte;
    lfQuality: Byte;
    lfPitchAndFamily: Byte;
    lfFaceName: array[0..LF_FACESIZE - 1of AnsiChar;
  end;

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit