• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

How many color in a bitmap?

I just want to know how many color are
in a picturebox and what are the RGB values ?

Thanks a lot.
0
dhamet
Asked:
dhamet
1 Solution
 
prem_kumar_25Commented:
256

0
 
caraf_gCommented:
The answer is wrong. It depends on your display setup.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
dhametAuthor Commented:
OK, first of all, I'm french so...
Be gentle with my english...
Let's try to be clear :
For exemple I have a bitmap with only 11
colors used in, I would like to know the
RGB values for these 11 colors.
I'm quite sure the only way - to be fast - is to read
(something, somewhere?) in the bitmap
header.

My purpose is to play with Hue, Saturity and Luminosity (HSL) with each color of the bitmap.
For exemple, creating an ActiveX button
which have the capicity to be highlited when you move on (by playing with brightness).
If you have an answer and if you are interested, I can send you a very good beginning of this (little) ActiveX project.
   
 
0
 
caraf_gCommented:
Hm.. that requires API calls, I think.

Maybe someone like waty might know the answer. Otherwise (dare I say) it might by an idea to check the VB API section in news.devx.com
0
 
raymerCommented:
You can see how many colors are in a *bitmap* file by using my free mmInfo.exe program at the link below(comes with full VB source).

As was mentioned previously, the color depth of the picture control hDC is the same as the current display color depth.  So if you do a SavePicture on a picture box the bit depth of the resulting file will depend on your current graphics adaptor settings.

Hope this helps,
Ray Mercer
MS-MVP Visual Basic
http://www.shrinkwrapvb.com
0
 
caraf_gCommented:
Nice bit of code!
0
 
raymerCommented:
Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now