I cant seem to get a BITMAP to show on my HDC
//globals
Code://Win32 Bitmap stuff HANDLE hImage; HWND button_hWnd; HDC hdc; HDC c_hdc; BITMAP Bitmap; SIZE ImageSize;in the Wndproc WM_PAINT messageCode:hImage = LoadImage(hInstance,"Test.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); if(hImage != INVALID_HANDLE_VALUE) { MessageBox(NULL,"Loaded Test.bmp","",0); } hdc = GetDC(hWnd); c_hdc = CreateCompatibleDC(hdc); GetObject(c_hdc,sizeof(BITMAP),&Bitmap); ImageSize.cx = Bitmap.bmWidth; ImageSize.cy = Bitmap.bmHeight;
Code:case WM_PAINT: hdc = BeginPaint(hWnd, &ps); SelectObject(c_hdc,hImage); BitBlt(hdc,0,0,ImageSize.cx,ImageSize.cy,c_hdc,0,0,SRCCOPY); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break;



LinkBack URL
About LinkBacks



