Code Snippet
if(r->GETvisibility())
{
HBITMAP hBmp;
CBitmap bmp;
CDC bmpDC;
CClientDC dc1(this);
BITMAP bi;
bmpDC.DeleteDC();
bmpDC.CreateCompatibleDC(&dc1);
hBmp = r->REThbitmap();
bmp.DeleteObject();
bmp.Detach();
bmp.Attach(hBmp);
CBitmap *pOldbmp = bmpDC.SelectObject(&bmp);
bmp.GetBitmap(&bi);
dc1.StretchBlt((r->RETminx()-pDoc->minx)/extent,(pDoc->maxy-r->RETmaxy())/extent,(r->RETmaxx()-r->RETminx())/extent,(r->RETmaxy()-r->RETminy())/extent,&bmpDC,0,0,bi.bmWidth,bi.bmHeight,SRCCOPY);
}
else
{
/*
bmpDC.DeleteDC();
bmp.DeleteObject();
bmp.Detach();*/
}
Description : -
1. In this case when the value of raster1 is not 0, it implies that there exist a BMP image that must be displayed
2. If r->GETvisibility is true, then we must display the image on the screen
3. If r->GETvisibility is false, then we must not display the image on the screen
when the image is loaded for the first time it is displayed properly. WHen we make the image invisible then it hides correctly.
The problem arises when we make the image visible again, this time the image is not displayed on the screen. I don't want this to happen.
Pls help