Print Picture
-
I am trying to print out everything in Picturebox. I can't print out anything except blank. Here is my source in MyViewClass::OnPrint(CDC* pDC, CPrintInfo* pInfo ) and please help me how I am doing wrong? CRect rect; GetWindowRect(&rect); //CDC* pTempDC = GetWindowDC(); CDC memDC; //IGBMapViewCtrl d; //d.GetDC(); memDC.CreateCompatibleDC( pDC ); // create bitmap with my window-pDC and set it in the memory-DC CBitmap bitmap; bitmap.CreateCompatibleBitmap( m_MapView.GetDC(), rect.Width(), rect.Height()); memDC.SelectObject(&bitmap); // open printer dialog // detach DCs bitmap.Detach();
-
I am trying to print out everything in Picturebox. I can't print out anything except blank. Here is my source in MyViewClass::OnPrint(CDC* pDC, CPrintInfo* pInfo ) and please help me how I am doing wrong? CRect rect; GetWindowRect(&rect); //CDC* pTempDC = GetWindowDC(); CDC memDC; //IGBMapViewCtrl d; //d.GetDC(); memDC.CreateCompatibleDC( pDC ); // create bitmap with my window-pDC and set it in the memory-DC CBitmap bitmap; bitmap.CreateCompatibleBitmap( m_MapView.GetDC(), rect.Width(), rect.Height()); memDC.SelectObject(&bitmap); // open printer dialog // detach DCs bitmap.Detach();
-
to print a bitmap, you need to use a device independent bitmap (DIB), not a device dependent bitmap
-
to print a bitmap, you need to use a device independent bitmap (DIB), not a device dependent bitmap
Thank you, I will test it. Shin