Jump to content
Software FX Community

[Q] Print Problem..


Recommended Posts

I am using   change MapMode, and I show Screen correct.

But printing not correct. because chart font is very small.

I set logigal coordinates , and set font , and set Chart Information.

But this failuer.. why this it?

print result.

chart in text size then small "Font Test"(this test text )

///////////////////////////// init

////////////////////////////////////////////////////

m_pChartFX.CreateInstance(__uuidof(ChartFX));

....

.... init chart information ....

....

///////////////////////////////// Change CDC Attrib..

OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)

{

// TODO: Add your specialized code here and/or call the base class

pDC->SetMapMode(MM_ANISOTROPIC);

pDC->SetWindowExt(m_lsize); // in logical coordinates

CPoint ptVpOrg=CPoint(0,0);

if (!pDC->IsPrinting()) {

pDC->SetViewportExt(m_lsize.cx,m_lsize.cy); // in device coordinates

// by default shift viewport origin in negative direction of scroll

ASSERT(pDC->GetWindowOrg() == CPoint(0,0));

ptVpOrg = -GetDeviceScrollPosition();

pDC->SetViewportExt(printSize);

}

// Set the new origin

pDC->SetViewportOrg(ptVpOrg);

CView::OnPrepareDC(pDC, pInfo);

}

///////////////////////////////// do WM_PAINT Message /////////////////

if (font.CreatePointFontIndirect(&m_lgfont,pDC))

{

oldfont=(CFont*)pDC->SelectObject(&font);

//All Font change Font...

for (int i=0;i<=12;i++)

m_pChartFX->HFont[(enum CfxFont)i]=(LONG)(HFONT)font;

if (pDC->IsPrinting())

{

m_pChartFX->Printer->TopMargin=0;

m_pChartFX->Printer->LeftMargin=0;

m_pChartFX->Printer->BottomMargin=0;

m_pChartFX->Printer->TopMargin=0;

m_pChartFX->Printer->UsePrinterResolution=FALSE;

m_pChartFX->Printer->hDC=(LONG)pDC->GetSafeHdc();

}

m_pChartFX->Paint((LONG)pDC->GetSafeHdc(),rect.left,rect.top,rect.right,rect

.bottom,CPAINT_PRINT,NULL);

pDC->TextOut(rect.left,rect.top,"Font Test");

}

////////////////////////////

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...