Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Bitmap file

Can I know how to open a bitmap file and get certain informations like color of a pixel ?
0
chc79
Asked:
chc79
1 Solution
 
jannCommented:
If you have a DIB file, you can load the DIB file and using GetInfoHeader() function to get the header information which including the color of pixels.
0
 
RONSLOWCommented:
LoadImage will read in a bitmap file from either a resource or from an external file.

Create a CompatibleDC and select your bitmap into it.  Then you can use GetPixel to get teh RGB colour at any location.

GetInfoHeader will/may give you the pallete of colours used, but not the colour of a given pixel.

0
 
nietodCommented:
You can also use GetDIBits() to get the colors of ALL the pixels into an array all at one time.
0
 
chc79Author Commented:
Thanks very much, I realy need it :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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