Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#19

Re: [GR32] How to add intensity?

  Alt 25. Jan 2010, 14:58
Delphi-Quellcode:
property Bits: PColor32Array read FBits;

TColor32Array = array [0..0] of TColor32;

TColor32Entry = packed record
  case Integer of
    0: (B, G, R, A: Byte);
    1: (ARGB: TColor32);
    2: (Planes: array[0..3] of Byte);
    3: (Components: array[TColor32Component] of Byte);
end;

function Color32(WinColor: TColor): TColor32; overload;
{$IFDEF WIN_COLOR_FIX}
var
  I: Longword;
{$ENDIF}
begin
{$IFDEF CLX}
  WinColor := ColorToRGB(WinColor);
{$ELSE}
  if WinColor < 0 then WinColor := GetSysColor(WinColor and $000000FF);
{$ENDIF}
  
{$IFDEF WIN_COLOR_FIX}
  Result := $FF000000;
  I := (WinColor and $00FF0000) shr 16;
  if I <> 0 then Result := Result or TColor32(Integer(I) - 1);
  I := WinColor and $0000FF00;
  if I <> 0 then Result := Result or TColor32(Integer(I) - $00000100);
  I := WinColor and $000000FF;
  if I <> 0 then Result := Result or TColor32(Integer(I) - 1) shl 16;
{$ELSE}
  asm
        MOV EAX,WinColor
        BSWAP EAX
        MOV AL,$FF
        ROR EAX,8
        MOV Result,EAX
  end;
{$ENDIF}
end;
There are not my symbols, there are in GR32. I'm using this record in all filters and look to be correct
  Mit Zitat antworten Zitat