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

C / C++ / MFC

 
AnswerRe: MFC resizing OpenGL Pin
zqueezy20-May-07 2:37
zqueezy20-May-07 2:37 
GeneralRe: MFC resizing OpenGL Pin
Hans Dietrich20-May-07 5:26
mentorHans Dietrich20-May-07 5:26 
QuestionHow do I create a CBitmap from raw data in memory? Pin
fixitnow20-May-07 2:25
fixitnow20-May-07 2:25 
AnswerRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery20-May-07 6:48
Mark Salsbery20-May-07 6:48 
GeneralRe: How do I create a CBitmap from raw data in memory? Pin
fixitnow20-May-07 18:43
fixitnow20-May-07 18:43 
QuestionRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery21-May-07 4:47
Mark Salsbery21-May-07 4:47 
AnswerRe: How do I create a CBitmap from raw data in memory? Pin
fixitnow22-May-07 23:12
fixitnow22-May-07 23:12 
GeneralRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery23-May-07 5:30
Mark Salsbery23-May-07 5:30 
Since you are using CreateDIBitmap(), the DC you use is going to determine the format of the
destination bitmap.

By default a DC has a monochrome bitmap selected into it, so that's the format you're going to
get.

You have (at least) two alternatives to fix this:

1) Create a DDB bitmap (HBITMAP) of the desired destination bitmap format and select it into the
DC before calling CreateDIBitmap().
2) Use CreatDIBSection section to create the destination bitmap and copy the source pixel bits
to the DIBSection's DIB bits.

Mark


"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

Questioncode completion feature Pin
SumitMandal20-May-07 0:50
SumitMandal20-May-07 0:50 
AnswerRe: code completion feature Pin
Hans Dietrich20-May-07 4:15
mentorHans Dietrich20-May-07 4:15 
QuestionWindows Message Handling Pin
sawerr19-May-07 23:07
sawerr19-May-07 23:07 
AnswerRe: Windows Message Handling Pin
zqueezy20-May-07 2:19
zqueezy20-May-07 2:19 
GeneralRe: Windows Message Handling Pin
jk chan20-May-07 2:25
jk chan20-May-07 2:25 
AnswerRe: Windows Message Handling Pin
cp987620-May-07 16:19
cp987620-May-07 16:19 
QuestionHiding/Showing Radio Controls Pin
si_6919-May-07 22:33
si_6919-May-07 22:33 
AnswerRe: Hiding/Showing Radio Controls Pin
Rajesh R Subramanian19-May-07 22:40
professionalRajesh R Subramanian19-May-07 22:40 
GeneralRe: Hiding/Showing Radio Controls Pin
si_6919-May-07 22:47
si_6919-May-07 22:47 
GeneralRe: Hiding/Showing Radio Controls Pin
Ravi Bhavnani20-May-07 20:26
professionalRavi Bhavnani20-May-07 20:26 
AnswerRe: Hiding/Showing Radio Controls Pin
David Crow21-May-07 3:45
David Crow21-May-07 3:45 
QuestionSliderbar problem Pin
scody19-May-07 21:26
scody19-May-07 21:26 
AnswerRe: Sliderbar problem Pin
zqueezy20-May-07 2:31
zqueezy20-May-07 2:31 
AnswerRe: Sliderbar problem Pin
Mark Salsbery20-May-07 6:53
Mark Salsbery20-May-07 6:53 
QuestionIPaddress control-please help me Pin
prathuraj19-May-07 21:04
prathuraj19-May-07 21:04 
AnswerRe: IPaddress control-please help me Pin
Arman S.19-May-07 21:07
Arman S.19-May-07 21:07 
GeneralRe: IPaddress control-please help me Pin
prathuraj19-May-07 21:16
prathuraj19-May-07 21:16 

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.