I need to convert hex colors from Photoshop to something usable in GDI

Here's what my color values look like now:

DrawBorder hdc, rct, lPnt, hPen, 10999801

If I replace the value above (10999801) with a value converted from hex 
to decimal it draws an entirely different color.


How can I accurately convert colors?


Thank you
0
John
6/16/2010 7:29:10 PM
vb.general.discussion 1016 articles. 0 followers. Follow

6 Replies
586 Views

Similar Articles

[PageSpeed] 40


"John Smith" <spam@not-a-real-domain-name.com> wrote in message 
news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...
> Here's what my color values look like now:
>
> DrawBorder hdc, rct, lPnt, hPen, 10999801
>
> If I replace the value above (10999801) with a value converted from hex to 
> decimal it draws an entirely different color.
>
>
> How can I accurately convert colors?
>
>
> Thank you

The number you are passing (10999801) is a decimal number.  If you wanted 
that to be interpreted as a hex number simply append &H to the front of it 
like so &H10999801.

Steve 

0
Steve
6/16/2010 8:01:47 PM
Steve wrote:
> 
> 
> "John Smith" <spam@not-a-real-domain-name.com> wrote in message 
> news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...
>> Here's what my color values look like now:
>>
>> DrawBorder hdc, rct, lPnt, hPen, 10999801
>>
>> If I replace the value above (10999801) with a value converted from 
>> hex to decimal it draws an entirely different color.
>>
>>
>> How can I accurately convert colors?
>>
>>
>> Thank you
> 
> The number you are passing (10999801) is a decimal number.  If you 
> wanted that to be interpreted as a hex number simply append &H to the 
> front of it like so &H10999801.
> 
> Steve

I'm lost. How can I convert a standard html hexadecimal color to 
something I can use in GDI? One color I'd like to use is a7d7f9.

When I convert the above using the following site:

http://www.statman.info/conversions/hexadecimal.html

The color is a shade of yellow instead of light blue/aqua (my intended 
color).


Thank you










0
John
6/16/2010 8:33:23 PM
"John Smith" <spam@not-a-real-domain-name.com> wrote in message 
news:OQagwMZDLHA.4400@TK2MSFTNGP05.phx.gbl...
> Steve wrote:
>>
>>
>> "John Smith" <spam@not-a-real-domain-name.com> wrote in message 
>> news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...
>>> Here's what my color values look like now:
>>>
>>> DrawBorder hdc, rct, lPnt, hPen, 10999801
>>>
>>> If I replace the value above (10999801) with a value converted from hex 
>>> to decimal it draws an entirely different color.
>>>
>>>
>>> How can I accurately convert colors?
>>>
>>>
>>> Thank you
>>
>> The number you are passing (10999801) is a decimal number.  If you wanted 
>> that to be interpreted as a hex number simply append &H to the front of 
>> it like so &H10999801.
>>
>> Steve
>
> I'm lost. How can I convert a standard html hexadecimal color to something 
> I can use in GDI? One color I'd like to use is a7d7f9.
>
> When I convert the above using the following site:
>
> http://www.statman.info/conversions/hexadecimal.html
>
> The color is a shade of yellow instead of light blue/aqua (my intended 
> color).

HTML colors are in R-G-B order; VB colors are reversed but you can use the 
RGB function to build them by breaking the hex string into 3 2-characters 
pairs

try rgb(&Ha7,&Hd7,&Hf9)

0
Bob
6/16/2010 8:45:11 PM
"John Smith" <spam@not-a-real-domain-name.com> wrote in message 
news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...

> Here's what my color values look like now:
>
> DrawBorder hdc, rct, lPnt, hPen, 10999801
>
> If I replace the value above (10999801) with a value converted from hex to 
> decimal it draws an entirely different color.

So try reversing Red and Blue in the hex representation before you convert 
it to decimal.

For example, your color above is #A7D7F9. If we use RGB order then Red = A7, 
Green = D7, Blue = F9 and we get a pale slate blue. If, however, this number 
is in BGR order (Red = F9, Green = D7, Blue = A7) it should result in a 
flesh tone (or at least it's pretty close the the flesh tone of a white guy 
like me). Whichever one of these your 10999801 above is tells you how your 
hex format needs to be. 


0
Jeff
6/16/2010 8:52:17 PM
John Smith legte dieses als Verkn�pfung auf seinen Bildschirm :
> Steve wrote:
>> 
>> 
>> "John Smith" <spam@not-a-real-domain-name.com> wrote in message 
>> news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...
>>> Here's what my color values look like now:
>>>
>>> DrawBorder hdc, rct, lPnt, hPen, 10999801
>>>
>>> If I replace the value above (10999801) with a value converted from hex to 
>>> decimal it draws an entirely different color.
>>>
>>>
>>> How can I accurately convert colors?
>>>
>>>
>>> Thank you
>> 
>> The number you are passing (10999801) is a decimal number.  If you wanted 
>> that to be interpreted as a hex number simply append &H to the front of it 
>> like so &H10999801.
>> 
>> Steve
>
> I'm lost. How can I convert a standard html hexadecimal color to something I 
> can use in GDI? One color I'd like to use is a7d7f9.
>
> When I convert the above using the following site:
>
> http://www.statman.info/conversions/hexadecimal.html
>
> The color is a shade of yellow instead of light blue/aqua (my intended 
> color).
>
>
> Thank you

John,
you have to revers the hex values:
in windows it's BGR in html its RGB
So to get the desired color change from A7D7F9 to F9D7A7

Helmut.


0
Helmut
6/16/2010 9:08:31 PM
Jeff Johnson wrote:
> "John Smith" <spam@not-a-real-domain-name.com> wrote in message 
> news:OxG92oYDLHA.5476@TK2MSFTNGP06.phx.gbl...
> 
>> Here's what my color values look like now:
>>
>> DrawBorder hdc, rct, lPnt, hPen, 10999801
>>
>> If I replace the value above (10999801) with a value converted from hex to 
>> decimal it draws an entirely different color.
> 
> So try reversing Red and Blue in the hex representation before you convert 
> it to decimal.
> 
> For example, your color above is #A7D7F9. If we use RGB order then Red = A7, 
> Green = D7, Blue = F9 and we get a pale slate blue. If, however, this number 
> is in BGR order (Red = F9, Green = D7, Blue = A7) it should result in a 
> flesh tone (or at least it's pretty close the the flesh tone of a white guy 
> like me). Whichever one of these your 10999801 above is tells you how your 
> hex format needs to be. 
> 
> 


I got it. Thanks to all for the help.



0
John
6/17/2010 9:27:00 PM
Reply:

Similar Artilces:

Changing color of a range of cells dending up on a value in anothr
Hi, I need to change the color of a range of cell, depending up on the value in another cell. I am using Excel 2003. And it allows me to give only 3 conditions when using conditional format. But I have 7 differnt conditions. Thanks in advance for any help. Srajes. Unless you move to XL2007, you will need to use VBA. Here are some sites that will help http://www.ozgrid.com/VBA/excel-conditional-formatting-limit.htm http://www.mvps.org/dmcritchie/excel/condfmt.htm Alternatively, there is an add-in here http://www.xldynamic.com/source/xld.CFPlus.Download.html -- Steve "Srajes&qu...

color according to name
If the name "Dave" appears in B3, I want C3-Z3 to have a blue background color. What's that formula? dzelnio Select C3:Z3 and Format>Conditional Formatting>Formula is: =$B3="Dave" Format to Blue. Gord Dibben MS Excel MVP On Thu, 05 Jul 2007 10:47:29 -0700, dzelnio <dzelnio@yahoo.com> wrote: >If the name "Dave" appears in B3, I want C3-Z3 to have a blue >background color. > >What's that formula? > >dzelnio Works great! Thanks Dave On Jul 5, 1:39 pm, Gord Dibben <gorddibbATshawDOTca> wrote: > Select C3:Z...

I use client ID #s. Some begin with 0. 0 needs to show
I am creating a client sheet. Some of the Client ID #s begin with Zero. How can I get the Zero to show? hi, you can format the cells as a text, hope this helps Regards from Brazil Marcelo "rmingle" escreveu: > I am creating a client sheet. Some of the Client ID #s begin with Zero. How > can I get the Zero to show? You can also use a custom format: Suppose you ID numbers have 7 character including the leading 0 then do this: Select the cell(s) Press Ctrl-1 In the numbers tab select custom. In the box "type" enter 7 zero's HTH "Marcelo" wr...

Need large gap in chart
I am making a line graph with 2 sets of numbers that are very far apart - one set of numbers is around 7000 to 8000, and the other set is closer to 80,000. Of course, I get one line at the top of the chart that is pretty easy to read, but the line on the bottom that represents the smaller numbers is just TINY and looks pretty much straight. My question is this: is there a way to put a "break" into the graph between the smaller numbered data and the larger ones so they are all easier to read? Like a jagged line showing where the jump occurs or something? Hi, Jon has an exampl...

How to change background color of a window that has been created.
I need to change the background of a window that has been created, can you help? Hello Jerry, > I need to change the background of a window that has been created, can > you help? > Answer depends upon the type of window. Typically you can do this in OnEraseBkgnd. Certain controls respond to WM_CTLCOLOR and yet some other, like CButton, need to be owner drawn to change the color. If you have a generic CWnd, you can always specify the brush in the window class; so no special painting is needed. This is good when you know that the background will have one color all the time. -...

Need help with IF function
I need help writing an IF expression: IF("reference cell is empty", leave blank, otherwise statement) than -- Message posted from http://www.ExcelForum.com =IF(A1="","",Statement -- Message posted from http://www.ExcelForum.com =if(Cell Number="","",Statement) rmo5354 wrote: > *I need help writing an IF expression: > IF("reference cell is empty", leave blank, otherwise statement) > > thanx -- Message posted from http://www.ExcelForum.com To indicate a cell is empty, simply use quotes with nothing in between t...

need help working in publisher 07
when i open a blank document it looks very squatty...the measurements are bigger across the top of the page and narrower along the sides of the page, even tho both are in inches. Do you mean your page is landscape instead of portrait? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "rebecca" <rebecca@discussions.microsoft.com> wrote in message news:D569716A-8BBE-4FBF-89B6-5DD7E519E1D3@microsoft.com... > when i open a blank document it looks very squatty...the measurements are > bigger across the top of ...

I need to auto insert names in outlook address bar
I have outlook. I would like to have the address inserted after I type a few letters. I know this features exists, but I cannot for the life of me figure this one out. Please help. thanx for any assistance. think peace, max This feature only exists in Outlook 2002 and higher. -- Patricia Cardoza Outlook MVP Author - Special Edition Using Microsoft Office Outlook 2003 Lead Author - Access 2003 VBA Programmer's Reference Author - Absolute Beginner's Guide to Microsoft OneNote 2003 http://blogs.officezealot.com/cardoza http://www.cardozasolutions.com "max" <max@dis...

Regarding data needed for regular meetings
Hello. I have a project that must be finished in Q4 in order to garner revenue for the year. To that end, I'm enforcing daily (1/2 hour) and weekly meetings. I'm trying to figure out what views are appropriate for which meeting. Perhaps in the daily meeting a view filtered to show the week's activities. Then in the weekly meeting, what, maybe a report showing activities for the month along with risks and issues? Anybody have real-world expertise they can apply to this? Thanks in advance. ...

Is there a way to Sort Data by font color or cell shading?
I have a long list of items that I sort by either item number or date depending on what I'm looking for. From time to time these items status will change and I will gray them out by just shading the background of the cell gray. Is there a way I can sort these items by the background/shading of the cell first and then the secondary sort be date? So all the cells which contain gray shading will be first in the list (sorted by date if possible) then the rest of the list without the gray shading will follow by date as well. Thanks. Take a look at this link: http://www.cpearson.c...

Infozip wrapper needed
Hi All I read that someone has created a wrapper class for the Infozip dll's. But nowadays the link is dead. Can someone please provide me with this class anyway. Thanks in advance //Mikael ...

Printing Font color
Can anyone tell me how to print normal text in a color other than black? Have tried all types of fill for text (both black and gray) and still always prints BLACK. Ellen this would be an issue of your printer driver - not Publisher. The issue you describe is unknown in Publisher. However, we can get to the bottom of it for you. What version of Windows and Publisher are you using? Is this 'normal text' in a Text Frame or WordArt? What brand and model of printer are you using? -- ...

color coding events
I would like to color code events on my daily calendar and wonder if there is a way to change the color of text on individual events On 3/7/2010 6:27 AM, jcurtis wrote: > I would like to color code events on my daily calendar and wonder if > there is a way to change the color of text on individual events Which version of Outlook? Outlook 2007 introduced colored categories and I use them daily for color-coding events. Prior to Outlook 2007, colored labels were your option: http://office.microsoft.com/en-us/outlook/HP030848441033.aspx Additional information: htt...

Convert Alpha to Numeric
I have two spreadsheet which I would like to compare. One has numeric data, the other has the same data but the references codes have been entered as alpha. Does anyone know how this can be converted to numeric? Many thanks for your help. Not sure, but maybe as a start, you could try something along these lines using VLOOKUP and CODE() ? Assume the sample (numeric) data below is in Sheet1 cols A and B, with the numeric refcodes in col A RefCode Field1 65 Text1 66 Text2 67 Text3 etc And you have in Sheet2, the alphas as the RefCodes in col A RefCode Field1 A Text1 B Text2 C Text3 etc ...

Query error after converting
I'm running Access 2003. I have a working database. It seems as if the database is in Access 2000 format, because when I go to Convert, the 'Convert to Access 2000' option is grayed out. I need to convert this database to both Access 2002-2003 and Access 97. I have this part of VB code, and it works fine in the current version, as well as in Access 2002-2003 (after converting to Access 2002-2003). Dim rstRoutes As Recordset Dim strSQL As String ...... strSQL = "SELECT DISTINCT [Route] " & _ "FROM Highways_Info " & _ "WHERE ...

Assigning a color to a cell
I saw some other post about kind of the same problem but not this way. I have a risk evaluation formula in a cell. Output range is between 1 and 9 If between 1 and 3, I want to assign the color lightgreen to it If between 4 and 6 I want to assign the color yellow to it and red if 7 to 9. Is this possible within the Function use ? If not, How can I apply that automatically ? a macro ? How ? TIA Hi See menu Format > Conditional format. It has a very helpful wizard. (Remember to consider what should happen at exact numbers 3, 6, 9.) HTH. Best wishes Harald "Junkyard Engineer&qu...

converting from text to numerical number
I have a spread sheet of entire year schedule. The format as following: 1 2 3 .... 31 row 1 row 2 row 3 Jan row 4 row 5 Feb row x Dec I would like to replace column 1 up to Jan to 1. Replace the cell below Jan to Feb to 2. etc. Would anyone help. Thanks in advance. You could select cells A1:A3, type a 1, then press Ctrl+Enter Select A4:A5, type a 2, and press Ctrl+Enter And so on, till all twelve months are done. james wrote: > I have a spread sheet of entire year schedule. The format as following: > > 1 2 3 .... 31 &...

[more of a 'c' question really] Converting doubles to strings without getting scientific notation
Hello hello.. I'm using _gcvt in a dialog to display a double, but when it gets small the string appears in scientific notation ie 0.02 become 2e-02 Is there another conversion routine I can use to prevent this? I have a not terribly scientific customer who would prefer a straight forward decimal display. Thanks "Zardoz" <thing@thing.thing> wrote in message news:122lvvkvicks85nka58iugok64ba0plpem@4ax.com... > Hello hello.. > > > I'm using _gcvt in a dialog to display a double, but when it gets > small the string appears in scientific notation ...

Need Formula Help....
Hi: Is there a formula string for something like this.....?: I want a number in a cell when a specific word is typed in another cell, for example, if I wanted the number 50 to appear in C2 if I type the word, say, Airplane, in cell C1? Thanks, pinger You need to define what you want when cell C1 does not contain the word airplane. Enter this formula in C2: =IF(C1="airplane",50,"") If C1 does not contain airplane the formula will leave the cell blank. -- Biff Microsoft Excel MVP "pinger" <pinger@ec.rr.com> wrote in message news:47cf6287$0...

Investors Needed!!!
INVESTMENT OPPORTUNITY! Fork It Over! a Ground Floor Unique Dimension & Concept In the Children's Entertainment Market... For More information http://www.kidseyeview.us ...

I need a formula to mark up a product by 200%
Hello, i am stupid when it comes to this stuff and frustrate easily!! If their is anyone that can help me i would greatly appreciate it. I have a product and it cost me $4.50 to produce. I would like to mark it up 200%. What would the function be?? Thanks On Thu, 4 Mar 2010 18:29:01 -0800, StitchWitch <StitchWitch@discussions.microsoft.com> wrote: >Hello, i am stupid when it comes to this stuff and frustrate easily!! If >their is anyone that can help me i would greatly appreciate it. I have a >product and it cost me $4.50 to produce. I would like to mark ...

I need help setting up my database
I used Access in the past, so I have a general idea on how to use it, but now I have Microsoft 2007, so it's not as familiar. I currently have an excel document with staff names and drills they have performed. The drills include dates, times, an observer, and if they passed or failed. I had considered doing something where I had a table with all my staff, and then connecting tables for each person to list out the specifics for their drills. I don't know how to link the relationship with that though because the table name was the staff's name, so there wasn't a...

Converting a number to Hour & Min format
I am attempting to take a basic number, say 2000, and convert the number into an hour and minute format (i.e. 33:33) only. Everytime I use the custom format tab or the time/date tab I get a date included or an AM/PM setting. Any ideas or suggestions? Thanks in advance. Hi, For any number to be converted into time format you need to divide tha number by 24, since Excel time code is 24 (hr) code. then you forma the divided answer (83.33) into time, you will get 8:00 regards sazi -- Message posted from http://www.ExcelForum.com Use Format/Cells/Number/Custom [hh]:mm In article <...

Need to get slope of peaks on excel graph
I have a graph with many peaks which are decreasing logarithmically and i need to get the slope of these peaks ignoring the "Noise" which is below these peaks. Any suggestions ??? Sorry I probaly didnt word the question well. My graph has many peaks e.g. 20 peaks, each one smaller than the previous one. What i am trying to do is draw a lins through the top of these peaks and then get the slope of this line. I have tried using the trendling but with no success. It does give me ths slope of the whole graph which is useful but not what i am looking for. Regards Capillod &quo...

What is a good program to convert pdf files to word?
I want to be able tosave pdf files as word files. PDF is essentially a graphics format. How well it can be converted to Word format rather depends on what it contains. The most reliable method is to use OCR software, such as Finereader. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<>...