Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: A good book to learn about displaying images with MFC? Pin
Christian Graus25-Aug-06 16:58
protectorChristian Graus25-Aug-06 16:58 
GeneralRe: A good book to learn about displaying images with MFC? Pin
csmithmaui25-Aug-06 17:16
csmithmaui25-Aug-06 17:16 
Questiondrawing in a dib file Pin
hugoiko25-Aug-06 16:05
hugoiko25-Aug-06 16:05 
AnswerRe: drawing in a dib file Pin
Dave Calkins25-Aug-06 16:17
Dave Calkins25-Aug-06 16:17 
GeneralRe: drawing in a dib file Pin
hugoiko26-Aug-06 14:02
hugoiko26-Aug-06 14:02 
GeneralRe: drawing in a dib file Pin
Dave Calkins26-Aug-06 17:44
Dave Calkins26-Aug-06 17:44 
GeneralRe: drawing in a dib file Pin
hugoiko27-Aug-06 11:53
hugoiko27-Aug-06 11:53 
GeneralRe: drawing in a dib file Pin
Dave Calkins27-Aug-06 12:38
Dave Calkins27-Aug-06 12:38 
If you're not seeing the same color throughout the image, then as you said its probably an alignment issue. I looked around and was unable to find the docs I used way back when when I was doing something similar.

Note that there might be an easier way to do this. The CImage class will save to the DIB (.bmp) file as well as a ton of other formats. So, if you can get your image into a CImage, you can then let it do the saving for you.

Since you're writing directly to the bits, I'd say get your image into a DIB section and select that DIB section into a device context. Then create a regular bitmap of the same size and select that into another device context. Then just blt from the one to the other. Now you could use the CImage stuff to save it to disk and not worry about the file format stuff.

Granted, this assumes you've correctly constructed the image in memory to begin with, which won't be the case if you don't properly align each row of pixels in memory. So, you still have to solve that problem, but this would at least do the file format stuff for you. Plus it opens up t he other file formats (.jpg, .gif, .png, etc.).
GeneralRe: drawing in a dib file Pin
hugoiko27-Aug-06 13:58
hugoiko27-Aug-06 13:58 
AnswerRe: drawing in a dib file Pin
Hamid_RT28-Aug-06 7:11
Hamid_RT28-Aug-06 7:11 
QuestionEnter Key killing my dialog [modified] Pin
Ger Hayden25-Aug-06 13:17
Ger Hayden25-Aug-06 13:17 
AnswerRe: Enter Key killing my dialog Pin
RChin25-Aug-06 14:16
RChin25-Aug-06 14:16 
AnswerRe: Enter Key killing my dialog Pin
Justin Tay25-Aug-06 14:21
Justin Tay25-Aug-06 14:21 
Questionthe : operator Pin
Waldermort25-Aug-06 13:10
Waldermort25-Aug-06 13:10 
AnswerRe: the : operator Pin
BadKarma25-Aug-06 13:29
BadKarma25-Aug-06 13:29 
GeneralRe: the : operator Pin
Waldermort25-Aug-06 13:44
Waldermort25-Aug-06 13:44 
GeneralRe: the : operator Pin
Justin Tay25-Aug-06 13:54
Justin Tay25-Aug-06 13:54 
GeneralRe: the : operator Pin
BadKarma25-Aug-06 14:02
BadKarma25-Aug-06 14:02 
GeneralRe: the : operator [modified] Pin
Waldermort25-Aug-06 14:16
Waldermort25-Aug-06 14:16 
QuestionSkinning Pin
BlitzPackage25-Aug-06 12:07
BlitzPackage25-Aug-06 12:07 
AnswerRe: Skinning Pin
Mircea Puiu26-Aug-06 20:22
Mircea Puiu26-Aug-06 20:22 
QuestionSHFileOperation is pissing me off - won't copy just 1 file Pin
AceCoolie25-Aug-06 11:36
AceCoolie25-Aug-06 11:36 
AnswerRe: SHFileOperation is pissing me off - won't copy just 1 file Pin
Waldermort25-Aug-06 13:12
Waldermort25-Aug-06 13:12 
GeneralRe: SHFileOperation is pissing me off - won't copy just 1 file Pin
AceCoolie26-Aug-06 4:48
AceCoolie26-Aug-06 4:48 
AnswerRe: SHFileOperation is pissing me off - won't copy just 1 file Pin
Justin Tay25-Aug-06 14:00
Justin Tay25-Aug-06 14:00 

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.