Re: MFC and GDI+
I can't duplicate your problem.
I tried the following in a sample mfc application with printing, printview
classes:
void CgdiplusprintingView::OnDraw(CDC* pDC)
{
CgdiplusprintingDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: add draw code for native data here
Graphics graphics(pDC->GetSafeHdc());
Pen greenPen(Color(255, 0, 255, 0));
SolidBrush solidBrush(Color(255, 0, 0, 255));
// Draw a line with antialiasing
graphics.SetSmoothingMode( SmoothingModeAntiAlias );
// Create a Pen object.
Pen blackPen(Color(255, 0, 0, 0), 3);
// Create two Point objects that define the line.
Point point1(25, 100);
Point point2(200, 100);
graphics.DrawLine(&blackPen, point1, point2);
// Add a rectangle and an ellipse
graphics.DrawRectangle(&greenPen, Rect(50, 10, 25, 75));
graphics.DrawEllipse(&greenPen, Rect(100, 10, 25, 75));
// Add an ellipse (drawn with antialiasing)
graphics.SetSmoothingMode(SmoothingModeHighQuality);
graphics.DrawEllipse(&greenPen, Rect(150, 10, 25, 75));
// Add some text (drawn with antialiasing)
FontFamily fontFamily(L"Arial");
Font font(&fontFamily, 24, FontStyleRegular, UnitPixel);
graphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
graphics.RotateTransform(30.0f);
graphics.DrawString(L"Smooth Text", 11, &font,
PointF(75.0f, 75.0f), &solidBrush);
}
I get exactly what is displayed on my screen and print preview.
If I wanted to get the best quality possible, I would have recorded the
above calls to an enhanced metafile as the enhanced metafile is a vectorized
format that scales to any device.