• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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