?
Solved

RGB problem?

Posted on 2001-07-13
4
Medium Priority
?
801 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

Technology Partners: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 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