Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.153 Beiträge
 
Delphi 12 Athens
 
#14

Re: Rgb mittels Asm darstellen

  Alt 7. Mai 2009, 16:08
die zwei 00 stören nicht, aber Farben aus gewissen paletten

Delphi-Quellcode:
// Quelle siehe Anhang

Const COLOR_SCROLLBAR = TColorIndex(0);
  COLOR_BACKGROUND = TColorIndex(1);
  COLOR_ACTIVECAPTION = TColorIndex(2);

  cpSystemPalette = $00;
  cpActingPalette = $01;
  cpLogicalPalette = $02;
  cpNoColor = $1F;
  cpDefaultColor = $20;
  cpSystemColor = $FF;

  clScrollBar = TColor(cpSystemColor shl 24 or COLOR_SCROLLBAR);
  clBackground = TColor(cpSystemColor shl 24 or COLOR_BACKGROUND);
  clActiveCaption = TColor(cpSystemColor shl 24 or COLOR_ACTIVECAPTION);


Function ColorToRGB(Color: TColor): TColor;
  Var _Color: TColorRec Absolute Color;

  Begin
    If _Color.Palette = cpSystemColor Then Result := GetSysColor(Color and $FF) and $FFFFFF
    Else If _Color.Palette in [cpSystemPalette..cpLogicalPalette] Then Result := Color and $FFFFFF
    Else Result := $000000;
  End;
so hat z.B. clBackground den Wert $FF000001 (auch so zu finden in der Unit Graphics von Delphi)

Speziell die Systemfarben sind über ihren Index kodiert und müssen erst entschlüsselt werden.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat