Set wxGraphicsContext page scale, which is required for printing to work properly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-05-10 13:52:12 +00:00
parent 512220b67b
commit a53b5e867b

View File

@@ -1151,6 +1151,14 @@ void wxGDIPlusContext::SetDefaults()
m_context->SetSmoothingMode(SmoothingModeHighQuality);
m_state1 = m_context->Save();
m_state2 = m_context->Save();
// Setup page scale, based on DPI ratio.
// Antecedent should be 100dpi when the default page unit (UnitDisplay)
// is used. Page unit UnitDocument would require 300dpi instead.
// Note that calling SetPageScale() does not have effect on non-printing
// DCs (that is, any other than wxPrinterDC or wxEnhMetaFileDC).
REAL dpiRatio = 100.0 / m_context->GetDpiY();
m_context->SetPageScale(dpiRatio);
}
wxGDIPlusContext::~wxGDIPlusContext()