1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
//Prepare Printing
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
}
// DoPreparePrinting
BOOL CMyView::DoPreparePrinting(CPrintInfo* pInfo)
{
pInfo->m_nOffsetPage = 0;
pInfo->SetMaxPage (1);
return CView::DoPreparePrinting (pInfo);
}
// Print
void CMyView::OnPrint( CDC *pDC, CPrintInfo *pInfo )
{
pInfo->m_rectDraw.SetRect(0,0, pDC->GetDeviceCaps(HORZRES),pDC->GetDeviceCaps(VERTRES));
OnDrawImpression( pDC );
}
void CMyView::OnDrawImpression(CDC* pDC)
{
pDC->Rectangle (CRect (0, 0, 500, 500));
} |
Partager