Click here to Skip to main content
16,008,490 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWireless? Pin
dandy7224-Aug-05 3:56
dandy7224-Aug-05 3:56 
AnswerRe: Wireless? Pin
David Crow24-Aug-05 4:20
David Crow24-Aug-05 4:20 
GeneralRe: Wireless? Pin
dandy7224-Aug-05 5:11
dandy7224-Aug-05 5:11 
GeneralRe: Wireless? Pin
David Crow24-Aug-05 5:25
David Crow24-Aug-05 5:25 
GeneralRe: Wireless? Pin
Ravi Bhavnani24-Aug-05 11:07
professionalRavi Bhavnani24-Aug-05 11:07 
GeneralCapturing HDC Pin
rocky_pulley24-Aug-05 3:43
rocky_pulley24-Aug-05 3:43 
GeneralRe: Capturing HDC Pin
emadns24-Aug-05 3:54
emadns24-Aug-05 3:54 
GeneralRe: Capturing HDC Pin
rocky_pulley24-Aug-05 4:18
rocky_pulley24-Aug-05 4:18 
Ok, here's what I'm trying, it's just giving me a blank (black) 500x500 bitmap:

CDC memDC;
memDC.CreateCompatibleDC(GetDC());
CBitmap *bmp = new CBitmap();
bmp->CreateCompatibleBitmap(&memDC, 500, 500);
CBitmap *old = memDC.SelectObject(bmp);
CRect rc(0, 0, 500, 500);
memDC.FillRect(rc, new CBrush(RGB(0, 255, 255)));
memDC.TextOut(50, 50, "BLAH");

//This stuff writes the bitmap and I know that it works.
HANDLE hDib = DDBToDIB(*bmp, BI_RGB, NULL);
WriteDIB("c:\\test\\testbmp.bmp", hDib);

memDC.SelectObject(old);

I have also tried to put the "memDC.SelectObject(old);" line before the bitmap writes and it gives the same problem. I know that the bitmap writing code works, I've used it before on CBitmaps just fine, so I'm sure that the problem exists in this drawing code somewhere. This code is being run from a CDialog, so that's where the GetDC() comes from.

-- Rocky Dean Pulley
-- DreamSys Software
-- http://www.dreamsyssoft.com
GeneralRe: Capturing HDC Pin
Chris Losinger24-Aug-05 4:23
professionalChris Losinger24-Aug-05 4:23 
GeneralRadio button Pin
Nishad S24-Aug-05 1:23
Nishad S24-Aug-05 1:23 
GeneralRe: Radio button Pin
David Crow24-Aug-05 3:40
David Crow24-Aug-05 3:40 
QuestionRepresent font size..?? Pin
TssPrasad24-Aug-05 1:09
sussTssPrasad24-Aug-05 1:09 
AnswerRe: Represent font size..?? Pin
Nishad S24-Aug-05 1:41
Nishad S24-Aug-05 1:41 
Generalproblem of transfering file from one pc 2 another Pin
manishgandhi24-Aug-05 0:47
manishgandhi24-Aug-05 0:47 
GeneralRe: problem of transfering file from one pc 2 another Pin
kakan24-Aug-05 1:00
professionalkakan24-Aug-05 1:00 
GeneralRe: problem of transfering file from one pc 2 another Pin
ThatsAlok24-Aug-05 18:38
ThatsAlok24-Aug-05 18:38 
GeneralADPCM format Pin
harrykouk24-Aug-05 0:43
harrykouk24-Aug-05 0:43 
GeneralRe: ADPCM format Pin
David Crow24-Aug-05 4:00
David Crow24-Aug-05 4:00 
Generalprobelms in file reading ,,suggest best method Pin
a_david12324-Aug-05 0:42
a_david12324-Aug-05 0:42 
GeneralRe: probelms in file reading ,,suggest best method Pin
Mukhan24-Aug-05 1:26
Mukhan24-Aug-05 1:26 
GeneralRe: probelms in file reading ,,suggest best method Pin
David Crow24-Aug-05 3:55
David Crow24-Aug-05 3:55 
GeneralRe: probelms in file reading ,,suggest best method Pin
Jose Lamas Rios24-Aug-05 3:50
Jose Lamas Rios24-Aug-05 3:50 
GeneralRe: probelms in file reading ,,suggest best method Pin
David Crow24-Aug-05 3:54
David Crow24-Aug-05 3:54 
Generalmemcmp & bitmaps Pin
dave2k24-Aug-05 0:13
dave2k24-Aug-05 0:13 
GeneralRe: memcmp & bitmaps Pin
Anonymous24-Aug-05 3:58
Anonymous24-Aug-05 3:58 

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.