Einzelnen Beitrag anzeigen

Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

Re: 8 bit Color Byte zu 24 bit Farbe umrechnen

  Alt 27. Sep 2005, 11:08
Normalerweise löst man das über Bitwiederholungen:
Delphi-Quellcode:
function ColorByteTo24Bit (const AColor: Byte): TColor;
var
  R, G, B: Byte;
begin
  R := (AColor and $07) shl 5;
  G := (AColor and $38) shl 2;
  B := (AColor and $C0);
  Result := RGB(R or (R shr 3) or (R shr 6),
                G or (G shr 3) or (G shr 6),
                B or (B shr 2) or (B shr 4) or (B shr 6));
end;
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat