Display bitmaps in Print Preview and printing bitmaps. 
Author Message
 Display bitmaps in Print Preview and printing bitmaps.

I'm trying to get BitBlt to draw a bitmap in the OnDraw function so it show
up on the print preview and be printed. The flowing code works in the
View::Paint() to display the bitmap on the screen but not in the
View::OnDraw to be printed. Any help would be appreciated.

  CClientDC dc(this); // device context for painting

HBITMAP hbitmap =
  ::LoadBitmap(::AfxGetInstanceHandle(),
  MAKEINTRESOURCE(IDB_MYBMP));

// Create a memory DC
HDC hMemDC = :: CreateCompatibleDC(NULL);

// Select the bitmap in the memory dc.
SelectObject(hMemDC,hbitmap);

// Copy the memory dc into the screen dc
int bb = ::BitBlt(dc.m_hDC, //destination
     20,  //RECTAB[4]
     20,
     150,
     175,
     hMemDC, // Source
     0,
     0,
     SRCCOPY);

// Delete the memory DC and the bitmap

::DeleteDC(hMemDC);
::DeleteObject(hbitmap);



Sun, 08 Jul 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Print preview with large bitmaps

2. Print Preview Control and Print Preview Dialog - need some help ASAP

3. Question on printing coloured generated bitmaps (DIB)...

4. Printing Bitmaps

5. Printing 'transparent' bitmaps

6. Printing bitmaps

7. printing bitmaps as WYSIWYG

8. Printing Bitmaps in Visual C++

9. Printing bitmaps

10. Problem printing bitmaps with SDK in Win95

11. printing bitmaps as WYSIWYG

12. Printing 256 color bitmaps?

 

 
Powered by phpBB® Forum Software