int CPreviewDC::SetMapMode(int nMapMode) { ASSERT(m_hAttribDC != NULL); int nModeOld = ::SetMapMode(m_hAttribDC, nMapMode); MirrorMappingMode(TRUE); return nModeOld; }
int CPreviewDC::SetMapMode( int nMapMode ) /****************************************/ { int nOldMapMode = ::SetMapMode( m_hAttribDC, nMapMode ); MirrorMappingMode( TRUE ); return( nOldMapMode ); }
CSize CPreviewDC::ScaleWindowExt( int xNum, int xDenom, int yNum, int yDenom ) /****************************************************************************/ { CSize size; ::ScaleWindowExtEx( m_hAttribDC, xNum, xDenom, yNum, yDenom, &size ); MirrorMappingMode( TRUE ); return( size ); }
void CPreviewDC::SetScaleRatio( int nNumerator, int nDenominator ) /****************************************************************/ { m_nScaleNum = nNumerator; m_nScaleDen = nDenominator; MirrorMappingMode( TRUE ); MirrorFont(); }
CSize CPreviewDC::SetWindowExt( int cx, int cy ) /**********************************************/ { CSize size; ::SetWindowExtEx( m_hAttribDC, cx, cy, &size ); MirrorMappingMode( TRUE ); return( size ); }
CSize CPreviewDC::SetWindowExt(int x, int y) { ASSERT(m_hAttribDC != NULL); CSize sizeExtOld; VERIFY(::SetWindowExtEx(m_hAttribDC, x, y, &sizeExtOld)); MirrorMappingMode(TRUE); return sizeExtOld; }
void CPreviewDC::SetAttribDC(HDC hDC) { ASSERT(hDC != NULL); CDC::SetAttribDC(hDC); MirrorMappingMode(TRUE); MirrorFont(); MirrorAttributes(); }
CSize CPreviewDC::ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom) { ASSERT(m_hAttribDC != NULL); CSize sizeExtOld; VERIFY(::ScaleWindowExtEx(m_hAttribDC, xNum, xDenom, yNum, yDenom, &sizeExtOld)); MirrorMappingMode(TRUE); return sizeExtOld; }
void CPreviewDC::SetAttribDC( HDC hDC ) /*************************************/ { CDC::SetAttribDC( hDC ); if( m_hDC != NULL ) { MirrorAttributes(); MirrorFont(); MirrorMappingMode( TRUE ); } }
void CPreviewDC::SetScaleRatio(int nNumerator, int nDenominator) { m_nScaleNum = nNumerator; m_nScaleDen = nDenominator; if (m_hAttribDC != NULL) { MirrorMappingMode(TRUE); MirrorFont(); } }
void CPreviewDC::SetOutputDC( HDC hDC ) /*************************************/ { CDC::SetOutputDC( hDC ); m_nSaveDCIndex = ::SaveDC( m_hDC ); if( m_hAttribDC != NULL ) { MirrorAttributes(); MirrorFont(); MirrorMappingMode( FALSE ); } }
void CPreviewDC::ClipToPage() /***************************/ { POINT point; point.x = ::GetDeviceCaps( m_hAttribDC, HORZRES ); point.y = ::GetDeviceCaps( m_hAttribDC, VERTRES ); PrinterDPtoScreenDP( &point ); ::SetMapMode( m_hDC, MM_TEXT ); ::SetViewportOrgEx( m_hDC, m_sizeTopLeft.cx, m_sizeTopLeft.cy, NULL ); ::SetWindowOrgEx( m_hDC, 0, 0, NULL ); ::IntersectClipRect( m_hDC, 1, 1, point.x - 2, point.y - 2 ); MirrorMappingMode( FALSE ); }
void CPreviewDC::SetOutputDC(HDC hDC) { ASSERT(hDC != NULL); m_nSaveDCIndex = ::SaveDC(hDC); // restore in ReleaseOutputDC() CDC::SetOutputDC(hDC); if (m_hAttribDC != NULL) { MirrorMappingMode(FALSE); if (m_hFont) ::SelectObject(m_hDC, m_hFont); else MirrorFont(); MirrorAttributes(); } }
void CPreviewDC::ClipToPage() { ASSERT(m_hAttribDC != NULL); ASSERT(m_hDC != NULL); // Create a rect in Screen Device coordinates that is one pixel larger // on all sides than the actual page. This is to hide the fact that // the printer to screen mapping mode is approximate and may result // in rounding error. CPoint pt(::GetDeviceCaps(m_hAttribDC, HORZRES), ::GetDeviceCaps(m_hAttribDC, VERTRES)); PrinterDPtoScreenDP(&pt); // Set the screen dc to MM_TEXT and no WindowOrg for the interesection ::SetMapMode(m_hDC, MM_TEXT); ::SetWindowOrgEx(m_hDC, 0, 0, NULL); ::SetViewportOrgEx(m_hDC, m_sizeTopLeft.cx, m_sizeTopLeft.cy, NULL); ::IntersectClipRect(m_hDC, -1, -1, pt.x + 2, pt.y + 2); // Resynchronize the mapping mode MirrorMappingMode(FALSE); }