Click here to Skip to main content
15,902,908 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DIBs and BMP's Pin
Gary R. Wheeler15-Jun-03 3:07
Gary R. Wheeler15-Jun-03 3:07 
GeneralRe: DIBs and BMP's Pin
Tommy2k15-Jun-03 4:35
Tommy2k15-Jun-03 4:35 
GeneralRe: DIBs and BMP's Pin
Ryan Binns15-Jun-03 5:01
Ryan Binns15-Jun-03 5:01 
GeneralRe: DIBs and BMP's Pin
Ryan Binns15-Jun-03 3:08
Ryan Binns15-Jun-03 3:08 
GeneralRe: DIBs and BMP's Pin
Gary R. Wheeler15-Jun-03 3:30
Gary R. Wheeler15-Jun-03 3:30 
GeneralRe: DIBs and BMP's Pin
Ryan Binns15-Jun-03 3:40
Ryan Binns15-Jun-03 3:40 
GeneralRe: DIBs and BMP's Pin
Tommy2k15-Jun-03 4:43
Tommy2k15-Jun-03 4:43 
GeneralRe: DIBs and BMP's Pin
Ryan Binns15-Jun-03 4:53
Ryan Binns15-Jun-03 4:53 
That's all you need. The BITMAPINFO structure is simply a BITMAPINFOHEADER followed by a colour table, which I assume you've got. If your image is 16-bit or above, no colour table is needed, so you don't have to worry about it.

For a 16, 24, or 32-bit image, just do this:
BITMAPINFO bi = { dib, 0 };
HBITMAP hbm = CreateDIBitmap(hDC, &dib, CBM_INIT, lpbits, &bi, DIB_RGB_COLORS);

For a 256 or less colour image, you'll need to include the colour table in the BITMAPINFO structure.

Ryan

Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)

Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

GeneralRe: DIBs and BMP's Pin
Tommy2k15-Jun-03 5:08
Tommy2k15-Jun-03 5:08 
GeneralGetFieldValue and Thread ... Pin
Hadi Rezaee15-Jun-03 2:29
Hadi Rezaee15-Jun-03 2:29 
GeneralA modal dlg in muli-thread Pin
FlyingDancer15-Jun-03 2:28
FlyingDancer15-Jun-03 2:28 
GeneralRe: A modal dlg in muli-thread Pin
Gary R. Wheeler15-Jun-03 3:14
Gary R. Wheeler15-Jun-03 3:14 
GeneralRe: A modal dlg in muli-thread Pin
FlyingDancer15-Jun-03 3:27
FlyingDancer15-Jun-03 3:27 
GeneralRe: A modal dlg in muli-thread Pin
Gary R. Wheeler15-Jun-03 3:34
Gary R. Wheeler15-Jun-03 3:34 
GeneralRe: A modal dlg in muli-thread Pin
FlyingDancer15-Jun-03 3:43
FlyingDancer15-Jun-03 3:43 
Generaldrag and drop Pin
shanila15-Jun-03 0:56
shanila15-Jun-03 0:56 
QuestionWhy won't CStatic paint? Pin
murdoc515014-Jun-03 23:45
murdoc515014-Jun-03 23:45 
AnswerRe: Why won't CStatic paint? Pin
Stan the man15-Jun-03 2:34
Stan the man15-Jun-03 2:34 
GeneralRe: Why won't CStatic paint? Pin
murdoc515015-Jun-03 3:29
murdoc515015-Jun-03 3:29 
GeneralRe: Why won't CStatic paint? Pin
Stan the man15-Jun-03 15:25
Stan the man15-Jun-03 15:25 
GeneralRe: Why won't CStatic paint? Pin
murdoc515016-Jun-03 4:15
murdoc515016-Jun-03 4:15 
GeneralRe: Why won't CStatic paint? Pin
Stan the man16-Jun-03 5:20
Stan the man16-Jun-03 5:20 
GeneralAbout an "unexpected #else " probelm Pin
FlyingDancer14-Jun-03 21:22
FlyingDancer14-Jun-03 21:22 
GeneralRe: About an "unexpected #else " probelm Pin
Gary R. Wheeler15-Jun-03 2:49
Gary R. Wheeler15-Jun-03 2:49 
GeneralRe: About an "unexpected #else " probelm Pin
FlyingDancer15-Jun-03 3:21
FlyingDancer15-Jun-03 3:21 

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.