User (Legacy) Posted August 6, 2003 Report Share Posted August 6, 2003 Dear Concerned. I'm trying to implement Print Preview. In SoftwareFX KB, I found the article as following. ----------------------------------------- if (pInfo->m_bPreview) { CDC *sdc; sdc = GetDC(); // Screen DC int xScrRes = sdc->GetDeviceCaps(LOGPIXELSX); // Screen resolution (X) int yScrRes = sdc->GetDeviceCaps(LOGPIXELSY); // Screen resolution (Y) int xPrnRes = pDC->GetDeviceCaps(LOGPIXELSX); // Printer resolution (X) int yPrnRes = pDC->GetDeviceCaps(LOGPIXELSY); // Printer resolution (Y) int nPrnWidth = pDC->GetDeviceCaps(HORZRES); // Page size (X) int nPrnHeight = pDC->GetDeviceCaps(VERTRES); // Page size (Y) ReleaseDC(sdc); pDC->SaveDC(); // Save settings // Maps to equivalent SCREN resolution pDC->SetMapMode(MM_ANISOTROPIC); pDC->SetWindowExt(MulDiv(nPrnWidth,xScrRes,xPrnRes),MulDiv(nPrnHeight,yScrRe s,yPrnRes)); pDC->SetViewportExt(nPrnWidth,nPrnHeight); m_pChartFX->Paint((long)pDC->m_hDC,MulDiv(pInfo->m_rectDraw.left,xScrRes,xPr nRes), MulDiv(pInfo->m_rectDraw.top,yScrRes,yPrnRes), MulDiv(pInfo->m_rectDraw.right,xScrRes,xPrnRes), MulDiv(pInfo->m_rectDraw.bottom,yScrRes,yPrnRes), (CfxChartPaint) 0,0); pDC->RestoreDC(-1); // Restore settings} else m_pChartFX->Paint((long)pDC->m_hDC, pInfo->m_rectDraw.left, pInfo->m_rectDraw.top, pInfo->m_rectDraw.right, pInfo->m_rectDraw.bottom, CPAINT_PRINT,0);------------------------------------------------But Paint method can print only one page.My Chart has lots of points. Is there any way to use "Paint method" with scrolling Chart?And Is there any way to know the number of pages without using "PrintIt method"Please, Help me...Good Luck... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.