在视图中打印图形时为什么实线会像虚线

gb102 2005-03-23 10:33:13
我用MM_TEXT模式在视图中绘制的图形在显示设备上显示时是直线,但是当我打印时却发现打印和显示的效果不一样,打印出的图形有点像虚线,由许多小点组成,但是又和虚线不同,比虚线要密。不知道是不是和绘图模式有关,请大家帮帮忙,我也不知道怎么办了,很急,最好能够不改变绘图模式就解决这个问题
...全文
216 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
gb102 2005-04-02
  • 打赏
  • 举报
回复
有没有不改变映射模式就可以解决这个问题的方法啊,我现在的程序比较大而且耦合性太强,如果要改变映射模式就要改许多地方
菜牛 2005-03-24
  • 打赏
  • 举报
回复
是不是颜色的问题,搞成半色调了。
bobob 2005-03-23
  • 打赏
  • 举报
回复
重载OnPrepareDC

void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);

CSize size = CSize(800, 560);
pDC->SetWindowExt(size);

int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)size.cx * xLogPixPerInch/96 ;
long yExt = (long)size.cy * yLogPixPerInch/96 ;
pDC->SetViewportExt((int)xExt, (int)yExt);
}
老夏Max 2005-03-23
  • 打赏
  • 举报
回复
最好不要使用MM_TWIPS模式,这种模式一般是用在排版上的,很少有人使用,并且转换起来比较麻烦!
老夏Max 2005-03-23
  • 打赏
  • 举报
回复
如果是固定的大小的可以使用下面的映射方式:(引自MSDN)
MM_HIENGLISH Each logical unit is converted to 0.001 inch. Positive x is to the right; positive y is up.


MM_HIMETRIC Each logical unit is converted to 0.01 millimeter. Positive x is to the right; positive y is up.


MM_ISOTROPIC Logical units are converted to arbitrary units with equally scaled axes; that is, 1 unit along the x-axis is equal to 1 unit along the y-axis. Use the SetWindowExt and SetViewportExt member functions to specify the desired units and the orientation of the axes. GDI makes adjustments as necessary to ensure that the x and y units remain the same size.


MM_LOENGLISH Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up.


MM_LOMETRIC Each logical unit is converted to 0.1 millimeter. Positive x is to the right; positive y is up.
老夏Max 2005-03-23
  • 打赏
  • 举报
回复
也许是和映射模式有关吧。
MM_TEXT是1对1的映射,线也是由点组成的!
galois_godel 2005-03-23
  • 打赏
  • 举报
回复
换MM_TWIPS试试
xuzheng318 2005-03-23
  • 打赏
  • 举报
回复
帮楼主顶!关注!
j805 2005-03-23
  • 打赏
  • 举报
回复
我也碰到这个问题了,仔细看是很细的锯齿线。
关注。

19,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧