Image on top of another Image...

Hi...

Currently now I have displayed my main menu image using the code as below.

HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,file,IMAGE_BITMAP,
0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);

CBitmap bmp;
bmp.Attach(hBmp);

CClientDC dc(this);
CDC bmDC;
bmDC.CreateCompatibleDC(&dc);
CBitmap *pOldbmp = bmDC.SelectObject(&bmp);

BITMAP bi;
bmp.GetBitmap(&bi);

dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY);
bmDC.SelectObject(pOldbmp);

But now due to I want to have mouseover effect over the places i want to click, and yet i don't want to redraw the whole screen, is it possible to just state a CRect region over the places i want to click and paste the mouseover effect image?? If yes, how to code it?? :ehh:

Regards,
[852 byte] By [primistic] at [2007-11-19 6:14:09]
# 1 Re: Image on top of another Image...
Handle the WM_MOUSEMOVE, WM_LBUTTONDOWN, etc messages and check yourself if the mouse is within a certain rectangle on your bitmap. If so, blit the hover image on the correct place.
Marc G at 2007-11-11 0:32:04 >
# 2 Re: Image on top of another Image...
Handle the WM_MOUSEMOVE, WM_LBUTTONDOWN, etc messages and check yourself if the mouse is within a certain rectangle on your bitmap. If so, blit the hover image on the correct place.

Hi Marc G...
thanks..
but is it possible to show a bit of coding for bliting the hover image? really appreciate for your help... thanks and regards... :wave:
primistic at 2007-11-11 0:33:02 >
# 3 Re: Image on top of another Image...
I don't know what to show...
Just use bitblt to blit a piece of your bitmap. See the MSDN for the parameters to bitblt.
Marc G at 2007-11-11 0:34:00 >
# 4 Re: Image on top of another Image...
You have already writen the code for BitBlt.
dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY);

You can use the same code with the second image and SRCCOPY option, cant you
Vinod S at 2007-11-11 0:35:02 >
# 5 Re: Image on top of another Image...
thanks a lot Marc...
i tot that by using this code.. it will erase my former image... thanks again... :wave:
primistic at 2007-11-11 0:36:01 >