Autor Beitrag
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Sa 28.09.02 11:22 
Wie kann ich eine Farbe vom Typ TColor in seine RGB Bestandteile zerlegen? Irgdenwie mit Hex...???

MFG Rool
OregonGhost
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 215



BeitragVerfasst: Sa 28.09.02 12:01 
ausblenden Quelltext
1:
2:
3:
4:
5:
var r, g, b: BYTE;
...
r := GetRValue(color);
g := GetGValue(color);
b := GetBValue(color);

Wenn's schneller gehen soll, mit shr arbeiten (in C sind die obigen Funktionen in Wirklichkeit Makros, also nichts anderes als ShiftRight, in OP sind es Funktionen)
ausblenden Quelltext
1:
2:
3:
4:
...
r := Byte(color);
g := Byte(color shr 8);
b := Byte(color shr 16);

_________________
Oregon Ghost
---
Wenn NULL besonders groß ist, ist es fast schon wie ein bisschen eins.