Print Preview and Printing a Document? 
Author Message
 Print Preview and Printing a Document?

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);



Thu, 12 Jul 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Print Preview and Printing a Document?

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

3. Print Preview without Document/View architecture

4. Print Preview without Document/View architecture

5. Adding Print and Print Preview to Richedit Control

6. Why I can't print directly after Print Preview

7. Printing/Print preview problem with CRichEditView.

8. Printing / Print Preview problem?

9. Print / Print Preview Commands

10. Display bitmaps in Print Preview and printing bitmaps.

11. image shown on print preview but not printed

12. Text on screen looks differently that when printed/print previewed

 

 
Powered by phpBB® Forum Software