Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB color conversion VB grey?? 1

Status
Not open for further replies.

johnnyv

Programmer
Jul 13, 2001
216
CA
can any one explain to me how the color codes in Visual Basic work vrs PS

ie
white in Vb is &H80000005&
while
white in PS is ffffff

what got me started on this is that I need to know what standard grey, in VB, is in Photoshop??

can anyone point me in the right direction to find a tutorial that would explain the color codes and how they work??
 
For a quick fix I would take a screen shot of the colour you need and then paste the image into Photoshop and use the eye dropper tool and find out what the colour is.

This should work with any colour you need to get the hex value for.

Not sure if it will be 100% accurate but when I have used it, it has been right.

As for how the conversion from VB colours to hex I have no idea.
Manic
-----------------------------
I've broken it again !!
-----------------------------
lee.gale@virgin.net
 
I use a program called PKColorPicker from which automatically shows you Windows color codes, hex, RGB, HLS values all at the same time. It runs in the background, and is really handy! It is a good supplement for programmers. The webpage is all in German but it should be easy to figure out how to download it.
 
I ran into this problem a couple years ago and forgot how it was resolved. If you are visually comparing, be sure to set your monitor to the highest color depth (24 or 32 bit) so that you can accurately compare the PS grey to VB grey.

Even though the VB grey has a weird number definition, can you choose a color using a standard Windows/VB color picker dialog? That dialog should have RGB values in it. With this dialog, you should be able to see what RGB values turn into the VB color coding.

 
Thanks for the replys Guys
Pasting an image of the form into PS works will for the short term and I took a look at the web site I like it, too bad I don't speake or read German
Jimoblak your right working with teh RGB colors should work as well

Thanks again
John
 
Granted this is kind of an old post, and I haven't been in VB for a while, but isn't &H80000005& a system color (content window background, or something similar - the color of the area behind input text) and not an actual color value?

I remember just passing something like this: "H00" & [Some string hex BGR (backwards!... gotta love it, eh?) value] & "&" for a lazy, bloated and dirty way to draw simple pixels/areas. It would help to know what you're working on though. If you're drawing large areas and need a more streamlined way of color mixing, this could turn out to be a much more hairy problem. =]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top