打印预览时文字斜显示,每次刷新(放大、缩小)时显示方向不一样。设置成横向预览时,文字垂直显示。
另外怎么改变背景的预览方向。

解决方案 »

  1.   

    void EkChangePrintingOrientation( CDC* pDC, CPrintInfo* pInfo, short NewOrientation )
    {
    ASSERT_VALID( pDC );
    ASSERT( pInfo != NULL ); DEVMODE* pDevMode = pInfo->m_pPD->GetDevMode(); // Only change if new orientation is different 
    if( pDevMode->dmOrientation != NewOrientation )
    {
    pDevMode->dmOrientation = NewOrientation;
    pDC->ResetDC( pDevMode );
    }
    }void CDrawView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) 
    {
    // Programatically force the page's orientation
    if( pInfo != NULL )
    {
    // Find out the orientation we want: every third page
    // will print in "landscape" mode
    BOOL bLandscape = ( ( pInfo->m_nCurPage % 3 ) == 0 );
    short NewOrientation = bLandscape ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT; EkChangePrintingOrientation( pDC, pInfo, NewOrientation );
    } CView::OnPrepareDC(pDC, pInfo); pDC->SetMapMode( MM_LOMETRIC );
    }