Solved

RGB problem?

Posted on 2001-07-13
4
790 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now