Skip to main content
gamedev.net
🔒 Locked

How do load bitmap?

Started by dai1016 Jan 16, 2003 at 1:33 AM 0 replies 150+ views
Original Post
dai1016
dai1016
I define hdc, hdc1 and bitmap in dialog class as follow: HDC hdc; HBITMAP bitmap; bitmap = (HBITMAP)::LoadImageNULL, file, IMAGE_BITMAP, 640, 480, LR_LOADFROMFILE); if(bitmap==NULL) MessageBox("Can''t load bitmap!"); ::SelectObject(hdc,bitmap); //set hdc bitmap pOPla->GetDC( &hdc1 ); ::BitBlt( hdc1 , 0 , 0 , 640 , 480 , hdc , 0 , 0 , SRCCOPY ); sprintf( num , " %d picture" , i ); //set message char ::TextOut(hdc1, 0, 0, num, lstrlen(num)); //draw message char pOPla[i]->ReleaseDC( hdc1 ); //release DC Why can not load bitmap, but char can load successfully! In addition, program running in CFrameWnd class very well!(it didn''t work in CDialog class). I doubt something have wrong with "::SelectObject(hdc,bitmap);" and "pOPla[i]->GetDC( &hdc1);" Is it can not use in this way at CDialog class. D.M=3++
D.M=3++

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.