Autor Beitrag
martin_gnoe
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 12.06.06 10:18 
Hallo,

Wie aus dem Titel schon hervorgeht ich will aus einer Variable vom Typ Color die Integer Werte auslesen.
Gibt es vielleicht irgendeine Funktion mit der das zu schaffen wäre (so zusagen genau das umgekehrte was rgb(..., ..., ...) macht)???

Beispiel:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var rot: Color;
    farbwert: array[0..2] of Integer;

procedure....
begin
rot:=rgb(255, 0, 0);
farbwert[0]:= // ???
farbwert[1]:= // ???
farbwert[2]:= // ???
end;



Wäre nett wenn mir jemand helfen könnte.
Danke!!!
mfg Martin

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mo 12.06.06 11:33 
Ist da nicht GetRValue, GetGValue, GetBValue das richtige?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 12.06.06 17:58 
Nimm doch einfach folgenden Datentyp:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
type
    TColorRGB = packed Record Case Boolean of
        0: (C: TColor; );
        1: (R,G,B,S: Byte; );
    end;


Schreiben einer var C: TColorRGB; geht dann mit C.C := clLime und das Lesen über RedPart := C.R; für den Rot-Anteil ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
martin_gnoe
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 12.06.06 18:16 
THX hat funktioniert!!!