Click here to Skip to main content
15,925,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Should be easy.. Pin
Navin19-Mar-04 6:36
Navin19-Mar-04 6:36 
GeneralInserting data to exe file Pin
Chernobog119-Mar-04 3:52
Chernobog119-Mar-04 3:52 
GeneralRe: Inserting data to exe file Pin
Prakash Nadar19-Mar-04 5:59
Prakash Nadar19-Mar-04 5:59 
GeneralRe: Inserting data to exe file Pin
Chernobog119-Mar-04 7:00
Chernobog119-Mar-04 7:00 
GeneralRe: Inserting data to exe file Pin
Prakash Nadar19-Mar-04 15:06
Prakash Nadar19-Mar-04 15:06 
GeneralRe: Inserting data to exe file Pin
Navin19-Mar-04 6:38
Navin19-Mar-04 6:38 
QuestionHow to load bitmap ? Pin
rrrado19-Mar-04 3:31
rrrado19-Mar-04 3:31 
AnswerRe: How to load bitmap ? Pin
Antti Keskinen20-Mar-04 4:45
Antti Keskinen20-Mar-04 4:45 
Hmm..

Bitmaps are usually selected into a device context, and generally, you create a device context that represents the current display. The best way to alter this behaviour is to manually create a DC large enough to hold your bitmap, and with the correct color depth. Then, you can select this bitmap into a device context and use the device context's functions to retrieve the color of each pixel. The problem with GetBitmapBits is that it creates a screen-compatible DC to which the bitmap is selected, and bases it's results into the return values of pixel query on the DC surface. Thus, if the DC is set to 16-bit depth, the resulting bit array consists of 16-bit data.

I'm not sure, but the DC parameter of GetDIBits represents a device context into which the device dependant bitmap is to be selected. The best way to proceed would be to create arbitary device contextes with different color depths, and see how the resulting bitmap bits vary.

The easiest way, of course, is to force the display to 32-bit depth before doing the loading: just put a 32-bit screen depth as a prerequisite for your application.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How to load bitmap ? Pin
rrrado21-Mar-04 21:05
rrrado21-Mar-04 21:05 
QuestionA Debugger Coded using MFC's?? Pin
Caoimh19-Mar-04 3:03
Caoimh19-Mar-04 3:03 
AnswerRe: A Debugger Coded using MFC's?? Pin
Michael Dunn19-Mar-04 4:24
sitebuilderMichael Dunn19-Mar-04 4:24 
GeneralRe: A Debugger Coded using MFC's?? Pin
Caoimh19-Mar-04 4:32
Caoimh19-Mar-04 4:32 
GeneralRe: A Debugger Coded using MFC's?? Pin
Prakash Nadar19-Mar-04 5:56
Prakash Nadar19-Mar-04 5:56 
QuestionHow to 'lock' some computer Pin
Frosty_Muad'Dib19-Mar-04 2:06
Frosty_Muad'Dib19-Mar-04 2:06 
AnswerRe: How to 'lock' some computer Pin
Alexander M.,19-Mar-04 2:36
Alexander M.,19-Mar-04 2:36 
AnswerRe: How to 'lock' some computer Pin
David Crow19-Mar-04 2:38
David Crow19-Mar-04 2:38 
General Problem with reading from Socket using CArchive::Read() Pin
s_k19-Mar-04 2:05
s_k19-Mar-04 2:05 
Generalis there a max. length of a array in c++ Pin
ben_tros19-Mar-04 2:03
ben_tros19-Mar-04 2:03 
GeneralRe: is there a max. length of a array in c++ Pin
KaЯl19-Mar-04 2:46
KaЯl19-Mar-04 2:46 
GeneralRe: is there a max. length of a array in c++ Pin
David Crow19-Mar-04 2:46
David Crow19-Mar-04 2:46 
GeneralRe: is there a max. length of a array in c++ Pin
DragonFlys_Water19-Mar-04 6:26
DragonFlys_Water19-Mar-04 6:26 
GeneralRe: is there a max. length of a array in c++ Pin
Navin19-Mar-04 6:33
Navin19-Mar-04 6:33 
QuestionHow to Create a Button with Tooltip in "win32 application project"?<IMERGENCY> Pin
akira3219-Mar-04 1:57
akira3219-Mar-04 1:57 
AnswerRe: How to Create a Button with Tooltip in "win32 application project"?<IMERGENCY> Pin
Prakash Nadar19-Mar-04 5:54
Prakash Nadar19-Mar-04 5:54 
QuestionCombo Box Text + Icon - No owner draw? Pin
Skute19-Mar-04 1:35
Skute19-Mar-04 1:35 

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.