Solved

HBITMAP And BITMAPINFOHEADERS

Posted on 2001-07-02
7
360 Views
Last Modified: 2013-11-20
Hi

What is the relationship between a BITMAPINFOHEADER and a HBITBMAP?

I have a LPBITMAPINFOHEADER but i want a HBITMAP so i can display it in a CStatic.


Cheers

Richard
0
Comment
Question by:RichJackson
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:MichaelS
ID: 6245737
Don't think that you can do it in some easy way. Why you have only LPB...ER?
0
 

Author Comment

by:RichJackson
ID: 6246515
I am using AVI api, to return a single frame. The frame data is returned as a packed DIB.

All i want to do is display it!

Thanks Again

Rich
0
 
LVL 6

Expert Comment

by:MichaelS
ID: 6247492
than display dib directly, can you show your code or tell which function do you using?
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 9

Accepted Solution

by:
Pacman earned 50 total points
ID: 6248434
CreateDIBitmap() is your function:

HBITMAP CreateDIBitmap(
  HDC hdc,     // handle to device context
  CONST BITMAPINFOHEADER *lpbmih,  // ptr to bmp size and
                                   // format data
  DWORD fdwInit,            // initialization flag
  CONST VOID *lpbInit,      // ptr to initialization data
  CONST BITMAPINFO *lpbmi,  // ptr to bmp color-format data
  UINT fuUsage              // color-data usage
);

lpbInit points to your packed DIB-data.
You must create a BITMAPINFO structure which describes the bitmap.

Pacman
0
 
LVL 9

Expert Comment

by:Pacman
ID: 6248440
I'm not sure if this works with packed DIBs ...
But it's worth a try.
0
 

Author Comment

by:RichJackson
ID: 6282023
CreateDIBitmap() is definetely my function! Cheers

The only thing is i am struggling with the fourth paramter ptr to initialisation data, i guess i need to manipulate my LPBitmapInfoheader.  But i dunno how!

Thanks Again Richard


 
0
 
LVL 9

Expert Comment

by:Pacman
ID: 6285505
lpbInit is the bitmap data itself.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
isEverywhere  challenge 19 75
Window placement 17 82
twoTwo  challenge 35 102
Bartender label printing - switch on and off graphics 3 38
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 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