Solved

RGB problem?

Posted on 2001-07-13
4
794 Views
Last Modified: 2012-06-21
Hi guys,

Tell me if I am wrong. The RGB system in Delphi has the R and B wrong placed. I mean, for delphi is really BGR. I made a simple test to prove it:

   Label1.Color := $ff99cc is $cc99ff in a web page.

have you ever seen this behaviour?

best regards,
Manuel Lopez (lopem)
0
Comment
Question by:lopem
4 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 0 total points
ID: 6281486
That is because the color value, e.g. $FF99CC is physically stored in memory in this order: $CC $99 $FF $00

Motorola processors (I think since the 68000) for instance would store it like this: $00 $FF $99 $CC

The first method is called big-endian, the second method little-endian.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6281824
Epsylon is right. However, I feel the need to say this clearly: It has nothing to do with Delphi. It's the same in every other language...   :-)
0
 
LVL 3

Author Comment

by:lopem
ID: 6282342
Thanks buddies!

Now I know why this is Experts-Exchange!

best regards
Manuel Lopez (lopem)
0
 
LVL 1

Expert Comment

by:l8knight
ID: 6282798
The type of TLabel.Color is actually TColor which is defined as $xxBBGGRR, if you want to specify it as an RGB value you should use the RGB function...

Label1.Color := RGB($ff, $99, $cc);

FYI -> TColor is equivilant to Microsoft defined COLORREF

hope this helps explain it

l8knight
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question