Copying the Device COntext
-
I have to get the Bitmap of a HTML page,without displaying it . The class used to load HTML is CDhtmlDialog .This is the sample code CDhtmlDialog key; Key.Navigate(fileName,0,NULL,NULL,NULL,0); Key.SetWindowPos(this,rect1.left,rect1.top,rect1.Width(),rect1.Height(),SWP_SHOWWINDOW);//OK working CDC * pDc=Key.GetDC(); HDC htmlDC=pDc->GetSafeHdc(); //create a sample image CImage dest; if(dest.CreateEx(118,88,24,BI_RGB,NULL,0)==FALSE) { AfxMessageBox("Error in extracting the Keyframe"); return FALSE; } HDC destDC=dest.GetDC(); SetStretchBltMode(destDC,HALFTONE); //copy the if(StretchBlt(destDC,0,0,118,88,htmlDC,0,0,rect1.Width(),rect1.Height(),SRCCOPY)==FALSE) { AfxMessageBox("Unable to Extract Key Frame"); return FALSE; } Now the problem with this is that the BItMap is not of the HTML page but of the application Mainframe window !!!!!!