   windows gdi graphics
  this has probably been asked quite a few times..sorry if it has.im trying to make a blackjack game in windows 32.i have it all set up but the cards im trying to load wont show the the screen   HBITMAP hbitmap = (HBITMAP)LoadImage(gl_hInstance,"\\Images\\back.jpg",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);HDC hdc = GetDC(MainWindow);HDC image_dc = CreateCompatibleDC(hdc);HBITMAP old_hbitmap = (HBITMAP)SelectObject(image_dc,hbitmap);BitBlt(hdc,50,50,320,192,image_dc,0,0,SRCCOPY);im sure the path is correct..i even tried using my back.bmp files but still it shows nothing. 
  Did you repaint the window (is this code within WM_PAINT)? Are you receiving any errors?   Colin Jeanne | Invader''s Realm;  ok i got the back.bmp to load...but only when i have it in same directory as my cpp filesso now it goes to..how do i load jpg instead of .bmpand is it smart to preload all 53 cardsand if i have pics in a Images folder inside the cpp directory...how would i reach that inthe "" of the function ;  since i didn''t get an answer i went ahead and tried.. void TestGraph(){HBITMAP hbitmap[52];hbitmap[0]= (HBITMAP)LoadImage(gl_hInstance,"back.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[1]= (HBITMAP)LoadImage(gl_hInstance,"heart02.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[2]= (HBITMAP)LoadImage(gl_hInstance,"heart03.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[3]= (HBITMAP)LoadImage(gl_hInstance,"heart04.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[4]= (HBITMAP)LoadImage(gl_hInstance,"heart05.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[5]= (HBITMAP)LoadImage(gl_hInstance,"heart06.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[6]= (HBITMAP)LoadImage(gl_hInstance,"heart07.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[7]= (HBITMAP)LoadImage(gl_hInstance,"heart08.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[8]= (HBITMAP)LoadImage(gl_hInstance,"heart09.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[9]= (HBITMAP)LoadImage(gl_hInstance,"heart10.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[10]= (HBITMAP)LoadImage(gl_hInstance,"hearjack.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[11]= (HBITMAP)LoadImage(gl_hInstance,"heartqueen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[12]= (HBITMAP)LoadImage(gl_hInstance,"hearking.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[13]= (HBITMAP)LoadImage(gl_hInstance,"heartace.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[14]= (HBITMAP)LoadImage(gl_hInstance,"diamond02.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[15]= (HBITMAP)LoadImage(gl_hInstance,"diamond03.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[16]= (HBITMAP)LoadImage(gl_hInstance,"diamond04.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[17]= (HBITMAP)LoadImage(gl_hInstance,"diamond05.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[18]= (HBITMAP)LoadImage(gl_hInstance,"diamond06.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[19]= (HBITMAP)LoadImage(gl_hInstance,"diamond07.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[20]= (HBITMAP)LoadImage(gl_hInstance,"diamond08.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[21]= (HBITMAP)LoadImage(gl_hInstance,"diamond09.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[22]= (HBITMAP)LoadImage(gl_hInstance,"diamond10.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[23]= (HBITMAP)LoadImage(gl_hInstance,"diamondjack.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[24]= (HBITMAP)LoadImage(gl_hInstance,"diamondqueen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[25]= (HBITMAP)LoadImage(gl_hInstance,"diamondking.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[26]= (HBITMAP)LoadImage(gl_hInstance,"diamondace.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[27]= (HBITMAP)LoadImage(gl_hInstance,"club02.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[28]= (HBITMAP)LoadImage(gl_hInstance,"club03.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[29]= (HBITMAP)LoadImage(gl_hInstance,"club04.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[30]= (HBITMAP)LoadImage(gl_hInstance,"club05.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[31]= (HBITMAP)LoadImage(gl_hInstance,"club06.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[32]= (HBITMAP)LoadImage(gl_hInstance,"club07.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[33]= (HBITMAP)LoadImage(gl_hInstance,"club08.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[34]= (HBITMAP)LoadImage(gl_hInstance,"club09.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[35]= (HBITMAP)LoadImage(gl_hInstance,"club10.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[35]= (HBITMAP)LoadImage(gl_hInstance,"clubjack.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[36]= (HBITMAP)LoadImage(gl_hInstance,"clubqueen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[37]= (HBITMAP)LoadImage(gl_hInstance,"clubking.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[38]= (HBITMAP)LoadImage(gl_hInstance,"clubace.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[39]= (HBITMAP)LoadImage(gl_hInstance,"spade02.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[40]= (HBITMAP)LoadImage(gl_hInstance,"spade03.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[41]= (HBITMAP)LoadImage(gl_hInstance,"spade04.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[42]= (HBITMAP)LoadImage(gl_hInstance,"spade05.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[43]= (HBITMAP)LoadImage(gl_hInstance,"spade06.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[44]= (HBITMAP)LoadImage(gl_hInstance,"spade07.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[45]= (HBITMAP)LoadImage(gl_hInstance,"spade08.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[46]= (HBITMAP)LoadImage(gl_hInstance,"spade09.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[47]= (HBITMAP)LoadImage(gl_hInstance,"spade10.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[48]= (HBITMAP)LoadImage(gl_hInstance,"spadejack.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[49]= (HBITMAP)LoadImage(gl_hInstance,"spadequeen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[50]= (HBITMAP)LoadImage(gl_hInstance,"spadeking.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);hbitmap[51]= (HBITMAP)LoadImage(gl_hInstance,"spadeace.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);HDC hdc = GetDC(MainWindow);HDC image_dc = CreateCompatibleDC(hdc);HBITMAP old_hbitmap = (HBITMAP)SelectObject(image_dc,hbitmap[0]);BitBlt(hdc,5,40,320,192,image_dc,0,0,SRCCOPY);}only back.bmp worksi see all the files..i did copy and paste...i switch the back.bmp into other elements but still onlyback works...any ideas ;  << only back.bmp works >>Not sure what you mean by that. Do you want all 52 cards to display to the screen at once? If so, you'll need 52 statements like this, or simply use a loopfor (i=0; i<52; i++){SelectObject(bmp_dc, hbmp);<br>BitBlt(back_dc, xbmp, ybmp, 30, 30, bmp_dc, 0, 0, SRCCOPY);<br>}<br><br>Each of those hbmp you loaded in will have to be "blitted" to your dc (in my case back_dc) if you want to see them all. This is just an example – my variables and sizes are different, and I'm using a back or double buffer, but you can see my GDI pac-man ghost bmp demo to see what you are missing<br><br><a href="http://www.bringyou.to/games/VazPacGhost.cpp">source</a> | <a href="http://www.bringyou.to/games/VazPacGhost.exe">EXE</a><br><br>You indeed have to LOAD all your bmps in (creating 52 handles to those bitmaps, or 52 hbmp), BUT you &#111;nly "blit" to the screen the cards you want to see. I assume you understand that – but you want to display all 52 cards as a test to see if they loaded in correctly?<br><br>Phil P   <br><br><SPAN CLASS=editedby>[edited by - PhilVaz on February 4, 2004 9:04:45 PM]</SPAN>;  yay i get that..but only 1 file is working.  The back.bmp file.the other files dont show.  I tried placing the back.bmp into other elements of the array and worked.  I just find it strange only 1 outof the 52 files display the card to the screen. ;  << I tried placing the back.bmp into other elements of the array and worked. I just find it strange only 1 out of the 52 files display the card to the screen. >>Well you must be doing something wrong or forgetting something.... the steps are(1) Declare your bmp, and hbmp variables(2) Load each bmp with LoadImage and save in corresponding hbmpThese 2 steps are done once (like in GameInit)Then each time you want to display a bmp to the screen you(3) SelectObject into your temp dc and blit to your screen dc like so SelectObject(bmp_dc, hbmp);<br>BitBlt(back_dc, xbmp, ybmp, 30, 30, bmp_dc, 0, 0, SRCCOPY);<br><br>bmp_dc is your temp dc for &#111;ne bitmap, and back_dc is your entire screen dc (back buffer in my case). I haven't had a problem yet. You might want to read through the MSDN site &#111;n GDI and bitmaps<br><br><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_99ir.asp">GDI bitmaps</a><br><br>Phil P   <br><br><SPAN CLASS=editedby>[edited by - PhilVaz on February 4, 2004 10:30:33 PM]</SPAN>;  ill try it out again tomorrow ;  Are you sure the other files are successfully loading? Did you ever double check to make sure that LoadImage() returned a valid handle?   Colin Jeanne | Invader''s Realm;  If you''re making blackjack in windows, have you considered using cards.dll?cards.dll tutorial