Click here to Skip to main content
15,888,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multithreading using AfxBeginThread Pin
David Crow1-Apr-10 7:53
David Crow1-Apr-10 7:53 
GeneralRe: Multithreading using AfxBeginThread Pin
kartikthakre2-Apr-10 3:54
kartikthakre2-Apr-10 3:54 
QuestionHow to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 7:10
professionalbioan31-Mar-10 7:10 
AnswerRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 7:31
professionalChris Losinger31-Mar-10 7:31 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 7:58
professionalbioan31-Mar-10 7:58 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 8:06
professionalChris Losinger31-Mar-10 8:06 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 8:23
professionalbioan31-Mar-10 8:23 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 8:30
professionalChris Losinger31-Mar-10 8:30 
pDIB is your input image. it's a pointer to a DIB, which is a device-independent bitmap: a BITMAPINFOHEADER followed by a palette, followed by the pixel data.

you need the memcpy because CreateDIBSection only allocates the memory for the DIBSection. you need to put your own pixel data into the allocated memory.

and note that a DIBSection is not a standard HBITMAP. you can use a DIBSection as if it was an HBITMAP, and it will work exactly the same as a standard HBITMAP for most uses, but it's not exactly the same thing. see the MSDN for the differences. if you need a standard HBITMAP, you can use CreateDIBitmap instead of CreateDIBSection:

hbm = CreateDIBitmap(hDC,       // handle to device context
(LPBITMAPINFOHEADER)lpbi,       // pointer to bitmap info header 
(LONG)CBM_INIT,                 // initialization flag
lpDIBBits,                      // pointer to initialization data 
(LPBITMAPINFO)lpbi,             // pointer to bitmap info
DIB_RGB_COLORS );               // color-data usage


GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 8:39
professionalbioan31-Mar-10 8:39 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 9:08
professionalChris Losinger31-Mar-10 9:08 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 9:38
professionalbioan31-Mar-10 9:38 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 9:46
professionalChris Losinger31-Mar-10 9:46 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 9:58
professionalbioan31-Mar-10 9:58 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 10:07
professionalChris Losinger31-Mar-10 10:07 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 10:22
professionalbioan31-Mar-10 10:22 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 10:30
professionalChris Losinger31-Mar-10 10:30 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 10:37
professionalbioan31-Mar-10 10:37 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan31-Mar-10 10:59
professionalbioan31-Mar-10 10:59 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger31-Mar-10 16:42
professionalChris Losinger31-Mar-10 16:42 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
bioan1-Apr-10 22:50
professionalbioan1-Apr-10 22:50 
GeneralRe: How to extract the bitmap (HBITMAP) from a BITMAPINFOHEADER variable? Pin
Chris Losinger2-Apr-10 1:15
professionalChris Losinger2-Apr-10 1:15 
QuestionGetRegValue and using it correctly, need help. Pin
rbwest8631-Mar-10 7:08
rbwest8631-Mar-10 7:08 
AnswerRe: GetRegValue and using it correctly, need help. Pin
Richard MacCutchan31-Mar-10 7:31
mveRichard MacCutchan31-Mar-10 7:31 
QuestionAlways on top Pin
trioum31-Mar-10 7:01
trioum31-Mar-10 7:01 
AnswerRe: Always on top Pin
Graham Breach31-Mar-10 7:28
Graham Breach31-Mar-10 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.