Autor Beitrag
bobbie
Hält's aus hier
Beiträge: 11

Win Vista
Delphi 7 Enterprise
BeitragVerfasst: Sa 16.02.08 06:50 
Hallo Delphianer,

ich habe das Problem, dass ich gerne eine Pixelfarbe x,y als String ausgegeben hätte.
Also zum Beispiel als "#FFFFFF" oder "0xFFFFFF", wobei mir das Erste lieber wäre...

Ich hoffe ihr könnt mir weiterhelfen - schon mal vielen Dank!!!


MfG
Bobbie
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 16.02.08 08:46 
Schau dir mal die Funktion ColorToString an.

_________________
We are, we were and will not be.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 16.02.08 11:58 
Naja, ColorToString verwendet aber die Konstanten-Namen, wenn es geht.

In deinem Fall dürfte '#'+IntToHex(farbwert,6) interessanter sein. Wobei du beachten musst: im HTML-Farbcode sind Rot und Blau vertauscht!

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Sa 23.02.08 18:32 
Vorher aber den Farbwert noch durch ColorToRGB() durchjagen, sonst bekommt ihr falsche Daten wenn z.B. Farbkonstanten angegeben werden (z.B. clWindow).

clNone würde ich entsprechend vorher noch rausfiltern und anders ausgeben.

_________________
49 63 68 68 61 62 65 6B 65 69 6E 65 41 68 6E 75 6E 67 21