I want to configure printing in my program and I have problem in dividing my view into multiple pages to be printed
my program is a drawing program that basically contain two C-arrays one for drawn lines and the other for the curves
when I search for the printing I understand that I have to specify what will be drawn at each page by myself inside OnPrint() function. so I tried to do this. but it did not works
here what I did I only try on the lines array I was trying to print on the second page
void Cpatron1View::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
Cpatron1Doc* doc = GetDocument();
ASSERT_VALID(pDoc);
int cur= pInfo->m_nCurPage;
int pageHeight = pDC->GetDeviceCaps(VERTRES);
int pageWidth = pDC->GetDeviceCaps(HORZSIZE);
if(cur==2){
////////////////////////////////
for(int i=0; i< doc->mylines.GetSize() ; i++){
if((abs(doc->mylines[i]->getspoints().y)< pageHeight) &&
(abs(doc->mylines[i]->getepoints().y)< pageHeight ) &&
(abs(doc->mylines[i]->getspoints().x)> pageWidth ) &&
(abs(doc->mylines[i]->getepoints().x)> pageWidth )
){
if(doc->mylines[i]->type ==1 || doc->mylines[i]->type ==2 ||
doc->mylines[i]->type ==3 || doc->mylines[i]->type ==5 ){
doc->mylines[i]->drawline(pDC);
}
if(doc->basic == true && doc->mylines[i]->type ==4){
doc->mylines[i]->drawline(pDC);
}//basic
}//if
}//for lines
///////////////////////////////
////////////////////////////
}//print
CScrollView::OnPrint(pDC, pInfo);
}
would you please tell me how I can get the page height/width and convert it to .mm
because in my drawing I am using MM_LOMETRIC mode so I feel confused how
I compare pixels to mm.
please help me in get more understanding printing on many pages
Thanks a lot

New Topic/Question
Reply



MultiQuote





|