Solved

GETDIB.

Posted on 2004-03-22
3
496 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now