Solved

Bitmap file

Posted on 1998-05-19
4
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

739 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