15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Scaling with CWnd::Print()

Quang Ngo -- quang@psnw.com
Wednesday, September 11, 1996

Environment: Win95, VC++ 4.1

Hello everyone,

I'm never good at printing.  I'm sure someone can help me with this
basic question.  I'm trying to print the content of the CListCtrl
using the CWnd::Print() function.  I call this function as follow:

void CMyView::OnDraw(CDC* pDC)
{
       if (pDC->IsPrinting())
       {
               m_wndList.Print(pDC, PF_CLIENT);
               ...
       }
       ....
}

This method works fine.  However, since the mapping mode of pDC
is MM_TEXT the output on paper is really small.  I believe I need
to change it to MM_ISOTROPIC for scaling.  Futuremore, I need to
call SetWindowOrg(), SetViewportExt(), etc... to make it work.
I kept on trying but never got it to work.

Could someone show me how to scale it 2 times larger?

Thanks in advance,
-Quang (quang@psnw.com)



Dean Henkel -- Dean_Henkel@mixcom.com
Friday, September 13, 1996

Quang,

You are correct in using MM_ISOTROPHIC for the mapping mode and 
using SetViewPort() etc.  My code looks like this:
	int nPageWidth = pDC->GetDeviceCaps(HORZRES);
	int nPageHeight = pDC->GetDeviceCaps(VERTRES);
	pDC->SetMapMode(MM_ISOTROPIC);
	pDC->SetWindowExt(nPageWidth,nPageHeight);
	pDC->SetViewportExt(nPageWidth,nPageHeight);

The problem is that the above doesn't work the way I expected it 
to.  We HAD Microsoft Premier Support so I contacted Microsoft 
on this problem.  They said not to use Print().  It doesn't work 
right and they know it.  Maybe in the next release.  I was told 
by them to print out information "by hand" using the old print 
methods.
Regards,

Dean

Black Cat wrote:
> 
> Environment: Win95, VC++ 4.1
> 
> Hello everyone,
> 
> I'm never good at printing.  I'm sure someone can help me with this
> basic question.  I'm trying to print the content of the CListCtrl
> using the CWnd::Print() function.  I call this function as follow:
> 
> void CMyView::OnDraw(CDC* pDC)
> {
>        if (pDC->IsPrinting())
>        {
>                m_wndList.Print(pDC, PF_CLIENT);
>                ...
>        }
>        ....
> }
> 
> This method works fine.  However, since the mapping mode of pDC
> is MM_TEXT the output on paper is really small.  I believe I need
> to change it to MM_ISOTROPIC for scaling.  Futuremore, I need to
> call SetWindowOrg(), SetViewportExt(), etc... to make it work.
> I kept on trying but never got it to work.
> 
> Could someone show me how to scale it 2 times larger?
> 
> Thanks in advance,
> -Quang (quang@psnw.com)




| Вернуться в корень Архива |