Einzelnen Beitrag anzeigen

Amateurprofi

Registriert seit: 17. Nov 2005
Ort: Hamburg
1.041 Beiträge
 
Delphi XE2 Professional
 
#32

AW: Prüfung eines Bitmaps auf Transparenz (gehts noch schneller)?

  Alt 23. Feb 2016, 00:18
@Harry:
Versuche mal das:

Code:
FUNCTION IsPartlyTransparentAsm(P0,P1:Pointer; W,H:NativeInt):Boolean;
asm
               sub     edx,eax
               js      @BottomUp
               imul    edx,H
               add     eax,edx
@BottomUp:    lea     eax,[eax+ecx*4+3]
               imul    ecx,H
               neg     ecx
@Loop:        cmp     byte[eax+ecx*4],$FF
               jne     @True
               add     ecx,1
               jl      @Loop
               xor     al,al
               jmp     @End
@True:        mov     al,True
@End:
end;
Delphi-Quellcode:
FUNCTION IsPartlyTransparent(Bmp:TBitMap):Boolean;
begin
   with Bmp do
      Result:=IsPartlyTransparentAsm(ScanLine[0],ScanLine[1],Width,Height);
end;
Gruß, Klaus
Die Titanic wurde von Profis gebaut,
die Arche Noah von einem Amateur.
... Und dieser Beitrag vom Amateurprofi....
  Mit Zitat antworten Zitat