今天在onDraw里面画了一个网格宽度是200,高度是280,差不多就是A4的尺寸。并标记了坐标
我用GDI+,图片画刷画了一个区域,也是在OnDraw里面画的,结果
具体代码
Graphics graphics(pDC->m_hDC);
graphics.SetpageUnit(Unit::UnitPixel);
Pen pen(Color::Red,2);
Graphicspath path;
PointF pts[]={PointF(0.0f,0.0f),PointF(50.0f,70.0f),PointF(100.0f,200.0f),PointF(100.0f,280.0f),PointF(0,280.0)};
path.AddCurve(pts,6,0,5,0.0f);
path.CloseFigure();
Pen pen1(Color::red);
graphics.DrawPaht(&pen1,&path);
Bimtap mao(_T("3.jgp"));
TextureBrush tBrush(&mao,WrapMode::WrapMModeTile);
graphics.FillPath(&tBrush,&path);
如果不加红色部分,就会打印预览和打印出来的实际尺寸不相符。