Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bitmap file

Posted on 1998-05-19
4
Medium Priority
?
244 Views
Last Modified: 2010-04-10
Can I know how to open a bitmap file and get certain informations like color of a pixel ?
0
Comment
Question by:chc79
4 Comments
 

Expert Comment

by:jann
ID: 1164319
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
 
LVL 10

Accepted Solution

by:
RONSLOW earned 400 total points
ID: 1164320
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
 
LVL 22

Expert Comment

by:nietod
ID: 1164321
You can also use GetDIBits() to get the colors of ALL the pixels into an array all at one time.
0
 

Author Comment

by:chc79
ID: 1164322
Thanks very much, I realy need it :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question