Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: loading a bitmap Pin
gUrM33T8-Apr-04 20:56
gUrM33T8-Apr-04 20:56 
GeneralRe: loading a bitmap Pin
autodebug8-Apr-04 21:12
autodebug8-Apr-04 21:12 
GeneralRe: loading a bitmap Pin
gUrM33T8-Apr-04 20:59
gUrM33T8-Apr-04 20:59 
GeneralRe: loading a bitmap Pin
Anonymous8-Apr-04 21:14
Anonymous8-Apr-04 21:14 
GeneralRe: loading a bitmap Pin
schumi19808-Apr-04 21:18
schumi19808-Apr-04 21:18 
GeneralRe: loading a bitmap Pin
gUrM33T9-Apr-04 1:07
gUrM33T9-Apr-04 1:07 
GeneralRe: loading a bitmap Pin
Anonymous9-Apr-04 11:01
Anonymous9-Apr-04 11:01 
GeneralRe: loading a bitmap Pin
gUrM33T9-Apr-04 15:34
gUrM33T9-Apr-04 15:34 
hdc = BeginPaint(hWnd, &ps);
hdc = GetDC(hWnd);    // remove this statement
hbitmap = (HBITMAP)LoadImage(NULL,szFileName,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);

if(hbitmap==NULL)
{  // add this
MessageBox(hWnd,"coudnt load ", "error ", MB_OK);
break;    // replace it with <big>return</big> statement
}  // add this

// this doesnt return NULL , so the image is getting loaded properly ????

HDC hdcMem = CreateCompatibleDC(hdc); 
GetObject(hbitmap ,sizeof(bmp), &bmp);
SelectObject(hdcMem, hbitmap); 
BitBlt(hdc, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY); 
DeleteDC(hdcMem);
EndPaint(hWnd, &ps);


Rest everything looks fine.

Gurmeet S. Kochar
If you believe in God, it's because of the Devil

My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control

GeneralRe: loading a bitmap Pin
schumi19809-Apr-04 15:42
schumi19809-Apr-04 15:42 
Generalin menu resource ,what's the difference between &quot;IDR_***TYPE&quot;and &quot;IDR_MAINFRAME&quot; Pin
vividtang8-Apr-04 20:44
vividtang8-Apr-04 20:44 
GeneralRe: in menu resource ,what's the difference between &quot;IDR_***TYPE&quot;and &quot;IDR_MAINFRAME&quot; Pin
vividtang9-Apr-04 16:14
vividtang9-Apr-04 16:14 
GeneralTimer Pin
Anonymous8-Apr-04 20:42
Anonymous8-Apr-04 20:42 
GeneralRe: Timer Pin
toxcct8-Apr-04 21:53
toxcct8-Apr-04 21:53 
GeneralRe: Timer Pin
vcplusplus9-Apr-04 5:52
vcplusplus9-Apr-04 5:52 
GeneralRe: Timer Pin
GflPower8-Apr-04 22:09
GflPower8-Apr-04 22:09 
GeneralRe: Timer Pin
Renjith Ramachandran8-Apr-04 22:26
Renjith Ramachandran8-Apr-04 22:26 
GeneralRe: Timer Pin
David Crow9-Apr-04 5:14
David Crow9-Apr-04 5:14 
GeneraleMbedded VC Pin
gUrM33T8-Apr-04 19:59
gUrM33T8-Apr-04 19:59 
GeneralRe: eMbedded VC Pin
gUrM33T8-Apr-04 20:41
gUrM33T8-Apr-04 20:41 
GeneralRe: eMbedded VC Pin
Cedric Moonen8-Apr-04 23:49
Cedric Moonen8-Apr-04 23:49 
GeneralRe: eMbedded VC Pin
ruzel20-Apr-04 20:43
ruzel20-Apr-04 20:43 
GeneralRe: eMbedded VC Pin
Mike Dimmick9-Apr-04 0:18
Mike Dimmick9-Apr-04 0:18 
GeneralRe: eMbedded VC Pin
gUrM33T9-Apr-04 1:30
gUrM33T9-Apr-04 1:30 
Questionwhere to find useful material and information of splitter window and many views? Pin
vividtang8-Apr-04 19:59
vividtang8-Apr-04 19:59 
QuestionHow to make a Setup Program Pin
Anonymous8-Apr-04 19:41
Anonymous8-Apr-04 19:41 

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.