Click here to Skip to main content
15,890,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionClicking a button remotely Pin
Stargazer10225-Aug-06 18:10
Stargazer10225-Aug-06 18:10 
AnswerRe: Clicking a button remotely Pin
Hamid_RT28-Aug-06 7:09
Hamid_RT28-Aug-06 7:09 
QuestionA good book to learn about displaying images with MFC? Pin
csmithmaui25-Aug-06 16:21
csmithmaui25-Aug-06 16:21 
AnswerRe: A good book to learn about displaying images with MFC? Pin
Dave Calkins25-Aug-06 16:52
Dave Calkins25-Aug-06 16:52 
GeneralRe: A good book to learn about displaying images with MFC? Pin
csmithmaui25-Aug-06 17:23
csmithmaui25-Aug-06 17:23 
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 
I'm actually trying to save in a .dib file an image that I create pixel by pixel (without displaying it in a view). I'm able to create the file and the header (but i'm certainly wrong ...?) with this code but the result is a blank file (but the properties of the file are fine, eg.: size, color depth). I have no idea how to draw pixels in the file:

BITMAPFILEHEADER hdr;
BITMAPINFOHEADER bi;

CFile file;
file.Open( szFile, CFile::modeWrite|CFile::modeCreate);

bi.biBitCount = 24;
bi.biClrImportant = 0;
bi.biClrUsed = 0;
bi.biCompression = BI_RGB;
bi.biHeight = 2048;
bi.biPlanes = 1;
bi.biSize = sizeof(BITMAPINFOHEADER);
bi.biSizeImage = 0;
bi.biWidth = 1024;
bi.biXPelsPerMeter = 0;
bi.biYPelsPerMeter = 0;

int nColors = 1 << bi.biBitCount;

hdr.bfType= ((WORD) ('M' << 8) | 'B');
hdr.bfSize= sizeof(bi) + sizeof( hdr );
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits= (DWORD) (sizeof( hdr ) + bi.biSize + nColors * sizeof(RGBQUAD));

file.Write( &hdr, sizeof(hdr) );
file.Write( &bi, sizeof(bi) );
file.Close();


I tried with mfc's DCs but I want to save an image much larger than the window. Also I don't wanna display it in a view. Does anyone has an idea how to achieve this, with or without DCs?
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 
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 

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.