heres what i did with my class:
Code:
class image
{
private:
HDC hdcimage=NULL;
BITMAP bm;
HBITMAP hbmOld;
public:
image(HDC img=NULL)
{
HBITMAP g_hbmBall = (HBITMAP)LoadImage(NULL, "C:\\FireDragon.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_SHARED);
HDC hdcMem = CreateCompatibleDC(NULL);
hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmBall);
GetObject(g_hbmBall, sizeof(bm), &bm);
}
int height()
{
return (int)bm.bmHeight;
}
int width()
{
return (int)bm.bmWidth;
}
operator HDC()
{
return hdcimage;
}
~image()
{
SelectObject(hdcimage, hbmOld);
DeleteDC(hdcimage);
}
};
image m;
heres how i use it:
Code:
TransparentBlt(hdcWindow, 0, 0,m.width(), m.height(),(HDC) m, 0, 0,m.width, m.height, GetPixel(m,0,0));
for now, i get these error message:
"cannot convert 'image::width' from type 'int (image:()' to type 'int'"
i don't understand why the error
can anyone explain to me what i'm doing wrong?