Click here to Skip to main content
15,911,848 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: two dialogs placing problem? Pin
Mark Salsbery30-Oct-07 10:17
Mark Salsbery30-Oct-07 10:17 
GeneralRe: two dialogs placing problem? Pin
led mike30-Oct-07 11:10
led mike30-Oct-07 11:10 
QuestionNumber of Columns used in excel Pin
prithaa30-Oct-07 6:28
prithaa30-Oct-07 6:28 
QuestionI Need some help creating HBITMAP Pin
Miguel Resto30-Oct-07 5:12
Miguel Resto30-Oct-07 5:12 
AnswerRe: I Need some help creating HBITMAP [modified] Pin
Mark Salsbery30-Oct-07 6:49
Mark Salsbery30-Oct-07 6:49 
GeneralRe: I Need some help creating HBITMAP Pin
Miguel Resto30-Oct-07 17:18
Miguel Resto30-Oct-07 17:18 
GeneralRe: I Need some help creating HBITMAP Pin
Nelek30-Oct-07 22:13
protectorNelek30-Oct-07 22:13 
GeneralRe: I Need some help creating HBITMAP Pin
Mark Salsbery31-Oct-07 5:03
Mark Salsbery31-Oct-07 5:03 
Miguel Resto wrote:
do you know how to write the hbitmap object to a bmp file???



Yes.  You have almost everything you need except a BITMAPFILEHEADER...

BITMAPFILEHEADER FileHdr;
FileHdr.bfType = 'MB';
FileHdr.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) + (sizeof(RGBQUAD) * 255) + 30400;
FileHdr.bfReserved1 = 0;
FileHdr.bfReserved2 = 0;
FileHdr.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) + (sizeof(RGBQUAD) * 255);

Now, before you delete pbmi or t...

Open/truncate a file for writing
Write from &FilHdr (sizeof(BITMAPFILEHEADER) bytes)
Write from pbmi (sizeof(BITMAPINFO) + (sizeof(RGBQUAD) * 255) bytes)
Write from t (30400 bytes)
Close the file

That's it Smile | :)

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

Questiongot problem in compiling Pin
scizj30-Oct-07 4:31
scizj30-Oct-07 4:31 
AnswerRe: got problem in compiling Pin
led mike30-Oct-07 4:38
led mike30-Oct-07 4:38 
AnswerRe: got problem in compiling Pin
David Crow30-Oct-07 4:39
David Crow30-Oct-07 4:39 
GeneralRe: got problem in compiling Pin
led mike30-Oct-07 6:02
led mike30-Oct-07 6:02 
AnswerRe: got problem in compiling Pin
Nelek30-Oct-07 22:04
protectorNelek30-Oct-07 22:04 
QuestionNaive Bayes Pin
rarayi30-Oct-07 4:02
rarayi30-Oct-07 4:02 
AnswerRe: Naive Bayes Pin
Nelek30-Oct-07 4:09
protectorNelek30-Oct-07 4:09 
AnswerRe: Naive Bayes Pin
led mike30-Oct-07 4:39
led mike30-Oct-07 4:39 
Questionhow can i forbid anyone else to change the time of the computer? Pin
lostangels30-Oct-07 3:37
lostangels30-Oct-07 3:37 
AnswerRe: how can i forbid anyone else to change the time of the computer? Pin
Nelek30-Oct-07 4:08
protectorNelek30-Oct-07 4:08 
AnswerRe: how can i forbid anyone else to change the time of the computer? Pin
led mike30-Oct-07 4:41
led mike30-Oct-07 4:41 
Questionhelp needed for MFC ritch GUI controls Pin
sarat12in30-Oct-07 3:28
sarat12in30-Oct-07 3:28 
AnswerRe: help needed for MFC ritch GUI controls Pin
Dewm Solo30-Oct-07 3:51
Dewm Solo30-Oct-07 3:51 
AnswerRe: help needed for MFC ritch GUI controls Pin
led mike30-Oct-07 4:43
led mike30-Oct-07 4:43 
Questionsend big message from client to server [modified] Pin
Russell'30-Oct-07 2:22
Russell'30-Oct-07 2:22 
AnswerRe: send big message from client to server Pin
JudyL_MD30-Oct-07 2:27
JudyL_MD30-Oct-07 2:27 
AnswerRe: send big message from client to server Pin
Mark Salsbery30-Oct-07 7:15
Mark Salsbery30-Oct-07 7:15 

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.