Solved

RGB problem?

Posted on 2001-07-13
4
800 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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