muthyala
November 9th, 2004, 07:48 AM
Hi,
I am displaying BMP Image on dialog by using DirectDraw. I need to show cross on image and should move with any keys or mouse.
Please tell me how can proceed further, because i am new to graphics programming.
This is some of my code to display bitmap.
HBITMAP hbitmap = (HBITMAP)LoadImage(hinstance,bmp_name,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP old_bitmap = (HBITMAP)SelectObject(hdc,hbitmap);
HDC surfaceDC = NULL; // We're going to fill this with the HDC of our backSurface
HRESULT result = backSurface->GetDC(&surfaceDC);
if(result != DD_OK){
SelectObject(hdc,old_bitmap);
DeleteObject(hbitmap);
return false;
}
StretchBlt(surfaceDC,0,0,m_size.cx,m_size.cy,hdc,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
backSurface->ReleaseDC(surfaceDC);
SelectObject(hdc,old_bitmap);
DeleteObject(hbitmap);
Thank you
Muthyala
I am displaying BMP Image on dialog by using DirectDraw. I need to show cross on image and should move with any keys or mouse.
Please tell me how can proceed further, because i am new to graphics programming.
This is some of my code to display bitmap.
HBITMAP hbitmap = (HBITMAP)LoadImage(hinstance,bmp_name,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP old_bitmap = (HBITMAP)SelectObject(hdc,hbitmap);
HDC surfaceDC = NULL; // We're going to fill this with the HDC of our backSurface
HRESULT result = backSurface->GetDC(&surfaceDC);
if(result != DD_OK){
SelectObject(hdc,old_bitmap);
DeleteObject(hbitmap);
return false;
}
StretchBlt(surfaceDC,0,0,m_size.cx,m_size.cy,hdc,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
backSurface->ReleaseDC(surfaceDC);
SelectObject(hdc,old_bitmap);
DeleteObject(hbitmap);
Thank you
Muthyala