GDI + PageUnit是否准确? [英] Is GDI+ PageUnit Supposed to be Accurate?

查看:72
本文介绍了GDI + PageUnit是否准确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我画了一个6英寸乘2英寸的矩形,在一个用户控件上用

PageUnit of Inches,我得到一个7乘2.2英寸的矩形。

这是人们所期望的吗?我本来希望它至少是b
一致地缩放。


Charles

If I draw a rectangle, 6 inches by 2 inches, on a user control with a
PageUnit of Inches, I get a rectangle of 7 by 2.2 inches.

Is this what people would expect? I would have hoped that it was at least
scaled consistently.

Charles

推荐答案

GDI +表示所有显示器都是96 DPI,但不是全部都是。这可能是导致你所看到的一切的b $ b。您的测量值似乎超出了

的误差幅度。 - 额外的英寸? - 但这是我所知道的唯一可以导致差异的



我听说有人通过划线来管理这个一定数量的

像素并要求用户提供所述线的测量值。来自

那里 - 假设你的工作完全以英寸(或任何计量单位

你选择让他们使用) - 你可以做自己的物理翻译
尺寸与像素。你必须让它们在

方向上测量,并且在轴外绘制它们。可能很难,但它可能是可行的。


我相信你可以通过Windows API和Interop查询显示器,但是

即使你得到真正的物理尺寸,我也不认为你会有更多的运气在GDI +中进行转换会对你有用。


HTH


- Scott


" Charles Law" < BL *** @ nowhere.com>写在消息

新闻:O5 ************** @ TK2MSFTNGP14.phx.gbl ...
GDI+ says all monitors are 96 DPI, but not all of them are. That may be
causing what you''re seeing. Your measurements would seem to be outside of
that "margin for error" - an extra inch? - but it''s the only thing I know of
that would cause the differential.

I have heard of people managing this by drawing a line a certain number of
pixels and asking the user to provide the measurement of said line. From
there - assuming you work entirely in inches (or whatever unit of measure
you choose to have them use) - you could do your own translation of physical
dimensions to pixels. You would have to have them measure in both
directions, and drawing "off the axes" might be tough, but it could be
workable.

I believe you can query the monitor through the Windows API and Interop, but
even if you get the true physical dimensions, I don''t think you''ll have much
luck making a transformation in GDI+ that will work for you.

HTH

- Scott

"Charles Law" <bl***@nowhere.com> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
如果我画一个矩形,一个6英寸乘2英寸,在一个用英寸的PageUnit的用户控件上,我得到一个7乘2.2英寸的矩形。

这是人们所期望的吗?我希望它至少能够一致地缩放。

Charles
If I draw a rectangle, 6 inches by 2 inches, on a user control with a
PageUnit of Inches, I get a rectangle of 7 by 2.2 inches.

Is this what people would expect? I would have hoped that it was at least
scaled consistently.

Charles



Charles,


你得到的答案确实让我想起了另一位英国人曾在这个

新闻组中写过的内容。


见完整的主题(虽然它只有在第一个

回答之前才重要)
http://groups.google.com/group/micro...4af837e33f202d


(我在等待)


:-)))


我希望这会有所帮助,


Cor
Charles,

The answer you got did remind me what another Englishman once wrote in this
newsgroup.

See the complete thread (although it is only important until the first
answer)
http://groups.google.com/group/micro...4af837e33f202d

(I am waiting)

:-)))

I hope this helps,

Cor


您好Scott


感谢您的回复。我试过测量标准。矩形为100

×100 mm,并使用ScaleTransform缩放图形对象,这个

校正标准矩形尺寸。但是,当我将矩形的尺寸加倍时,新宽度仅为195毫米而不是200毫米。它会显示转换/缩放不是线性的,这使得它无法正确扩展。


Charles

" Scott McChesney" < SC ********************* @ us.army.mil>在消息中写道

新闻:e7 ************** @ TK2MSFTNGP15.phx.gbl ...
Hi Scott

Thanks for the reply. I have tried measuring a "standard" rectangle of 100
by 100 mm, and scaling the graphics object with ScaleTransform, and this
corrects the standard rectangle dimensions. However, when I double the size
of the rectangle, the new width is only 195 mm instead of 200 mm. It would
seem that the transformation/scaling is not linear, which makes it
impossible to scale anything correctly.

Charles
"Scott McChesney" <sc*********************@us.army.mil> wrote in message
news:e7**************@TK2MSFTNGP15.phx.gbl...
GDI +说所有显示器都是96 DPI,但不是全部。这可能会导致你所看到的。您的测量结果似乎超出了误差幅度的范围。 - 额外的英寸? - 但这是我所知道的唯一可能导致差异的东西。

我听说人们通过划一行一定数量的像素来管理这个并要求用户提供所述线的测量。从
那里 - 假设你完全以英寸(或任何计量单位)工作,你选择使用它们 - 你可以自己将物理尺寸转换为像素。你必须让它们在两个方向上测量,并且在轴外绘制它们。可能很难,但它可能是可行的。

我相信你可以通过Windows API和Interop查询显示器,
但即使你得到真正的物理尺寸,我不认为你会有很多运气在GDI +中进行转换,这对你有用。

HTH

- Scott

查尔斯劳 < BL *** @ nowhere.com>在消息中写道
新闻:O5 ************** @ TK2MSFTNGP14.phx.gbl ...
GDI+ says all monitors are 96 DPI, but not all of them are. That may be
causing what you''re seeing. Your measurements would seem to be outside of
that "margin for error" - an extra inch? - but it''s the only thing I know
of that would cause the differential.

I have heard of people managing this by drawing a line a certain number of
pixels and asking the user to provide the measurement of said line. From
there - assuming you work entirely in inches (or whatever unit of measure
you choose to have them use) - you could do your own translation of
physical dimensions to pixels. You would have to have them measure in
both directions, and drawing "off the axes" might be tough, but it could
be workable.

I believe you can query the monitor through the Windows API and Interop,
but even if you get the true physical dimensions, I don''t think you''ll
have much luck making a transformation in GDI+ that will work for you.

HTH

- Scott

"Charles Law" <bl***@nowhere.com> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
如果我画一个矩形,6英寸乘2英寸,在一个用英寸的PageUnit的用户控件上,我得到一个7乘2.2英寸的矩形。

这是人们所期望的吗?我希望它至少能够持续缩放。

Charles
If I draw a rectangle, 6 inches by 2 inches, on a user control with a
PageUnit of Inches, I get a rectangle of 7 by 2.2 inches.

Is this what people would expect? I would have hoped that it was at least
scaled consistently.

Charles




这篇关于GDI + PageUnit是否准确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆