void CGLVImpressionView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { CView::OnPrepareDC(pDC, pInfo); // TODO: Add your specialized code here and/or call the base class pDC->SetMapMode(MM_ISOTROPIC); // Working with (1 logical unit = 1 mm) for both width & height of the device context. pDC->SetWindowExt(1, 1); pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES) / pDC->GetDeviceCaps(HORZSIZE), pDC->GetDeviceCaps(VERTRES) / pDC->GetDeviceCaps(VERTSIZE)); pDC->SetBkMode(TRANSPARENT); //CView::OnPrepareDC(pDC, pInfo); }
void CGLVImpressionView::OnBeginPrinting(CDC* pDC, CPrintInfo* /*pInfo*/) { // TODO: Add your specialized code here and/or call the base class m_fnTimes12.CreatePointFont(120, _T("Times New Roman"), pDC); m_fnTimes14.CreatePointFont(140, _T("Times New Roman"), pDC); //CView::OnBeginPrinting(pDC, pInfo); }
void CGLVImpressionView::OnBeginPrinting(CDC* pDC, CPrintInfo* /*pInfo*/) { // TODO: Add your specialized code here and/or call the base class pDC->SetMapMode(MM_ISOTROPIC); // Working with (1 logical unit = 1 mm) for both width & height of the device context. pDC->SetWindowExt(pDC->GetDeviceCaps(HORZSIZE), pDC->GetDeviceCaps(VERTSIZE)); pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES), pDC->GetDeviceCaps(VERTRES)); m_fnTimes12.CreatePointFont(120, _T("Times New Roman"), pDC); m_fnTimes14.CreatePointFont(140, _T("Times New Roman"), pDC); //CView::OnBeginPrinting(pDC, pInfo);}
void CGLVImpressionView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo){ CView::OnPrepareDC(pDC, pInfo); // TODO: Add your specialized code here and/or call the base class pDC->SetMapMode(MM_ISOTROPIC); // Working with (1 logical unit = 1 mm) for both width & height of the device context. pDC->SetWindowExt(pDC->GetDeviceCaps(HORZSIZE), pDC->GetDeviceCaps(VERTSIZE)); pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES), pDC->GetDeviceCaps(VERTRES)); pDC->SetBkMode(TRANSPARENT); //CView::OnPrepareDC(pDC, pInfo);}
MM_TEXT
CreatePointFont()
CreateFont()
OnBeginPrinting
OnPrepareDC
int dpi=pDC->GetDeviceCaps(LOGPIXELSX); int dpmm=dpi/25; //dots per mm pDC->SetMapMode(MM_ISOTROPIC); pDC->SetWindowExt(1, 1); pDC->SetViewportExt(dpmm,dpmm);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)