Solved

Bitmap file

Posted on 1998-05-19
4
236 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

734 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