Solved

GETDIB.

Posted on 2004-03-22
3
504 Views
Last Modified: 2013-11-20
Hi,
   If I have a BITMAP variable , can I change the RGB pixel values directly by accessing the bmBits field?

Is there a need to use GetDIBits() to get the device independent bitmap? What are the repercussions if I do not use GetDIBits and change the pixels directly via BITMAP.bmBits?

Also, how do I get a handle to BITMAP (i.e. HBITMAP)?

Thanks a lot.
0
Comment
Question by:limin123
[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
  • 2
3 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 10659898
>If I have a BITMAP variable , can I change the RGB pixel values directly by accessing the bmBits field?

Yes, you can. But it is a DDB. Each device has a unique color format. You will have to know the color format of your device and you can't transfer it to other devices.

>Also, how do I get a handle to BITMAP (i.e. HBITMAP)?

No way. But you should know the HBITMAP. Otherwise, how do you get the BITMAP?
0
 
LVL 1

Author Comment

by:limin123
ID: 10663977
So if I am doing image processing, am I better off using the DIB bits since this is a closer representation of what will be stored as a device independent bmp file?

If I am capturing frames from a web cam, will it return the bits as DIB or DDB?

Thanks a lot.

0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 10664574
>So if I am doing image processing, am I better off using the DIB bits since this is a closer representation of what will be stored as a device independent bmp file?

Yes, what are stored in a bmp file are DIB bits.

>If I am capturing frames from a web cam, will it return the bits as DIB or DDB?

It should give you DIB if it is across the network.
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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

690 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