Autor Beitrag
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 06.05.05 13:51 
wie heißt die GDI API mit der man die breite eines textest (pixeln) herausbekommt

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 06.05.05 16:15 
uall@ogc Threadstarter
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 06.05.05 16:38 
jo das war sie brauche sie für

www.uall.info/pics/textoutw3.JPG

ist mir auch erst später eingefallen das ich einfach
Canvas.TextWidth
mal debuggen sollte

danke

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Delphi-Pro
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Fr 06.05.05 16:56 
Könntest du das Programm mal bitte anhängen das sieht nämlich ziemlich interessant aus :P
Delphi-Pro
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 06.05.05 22:53 
Wie witzig ... Hab heute erst genau die gleiche Funktion in der DSCal-Kompo optimiert und dabei festgestellt, dass sich der TCanvas.TextWidth-Aufruf mit folgendem SRC auf das Doppelte beschleunigen lässt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Function ITextWidth(C: TCanvas; Var Text: String): Integer;
Var
    P: tagSize;
    CanvH: THandle;
Begin
    CanvH := Canvas.Handle;
    asm
        //GetTextExtentPoint32(C.Handle, PChar(Text), Length(Text), P);
        LEA     EAX, [P]
        PUSH    EAX
        MOV     EAX, DWORD PTR [Text]
        MOV     EAX, DWORD PTR [EAX]
        PUSH    DWORD PTR [EAX-$00000004]
        PUSH    EAX        
        PUSH    DWORD PTR [CanvH]
        CALL    GetTextExtentPoint32
        //Result := P.cx;
        MOV     EAX, DWORD PTR [P.tagSIZE.cx]
    end;
End;


@user profile iconuall@ogc: Kannst Du mal gucken, ob Du TCanvas.GetHandle irgendwie per ASM gecallt bekommst?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
uall@ogc Threadstarter
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: Sa 07.05.05 13:06 
da es hier um die API gings hab ichs hier mal geupped für die dies sich anschauen wollen

www.delphi-forum.de/....php?p=249503#249503

@BenBE jo regeln wir über ICQ

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