【发布时间】:2011-08-23 10:49:55
【问题描述】:
我无法得到一个简单的答案。 我有像素坐标,我想在这些坐标的(横向)页面中打印图像。
在我的印刷活动中,我这样做:
Dim mypoint As New PointF(1, 1192)
e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)
这显然行不通:我指定了像素,但驱动程序需要英寸(?)还是什么?
尝试:e.Graphics.PageUnit = GraphicsUnit.Inch,但没有成功。
我想要一种转换方法,例如:
Dim mypoint As New PointF(convertPixelsIntoInches(1), convertPixelsIntoInches(1192))
e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)
Private Function convertPixelsIntoInches(ByVal pixels As Integer) As Single
Return ??
End Function
有什么提示吗?谢谢。
【问题讨论】:
-
在本地磁盘上创建镜像文件并查看创建的内容。这将引导您走上正确的道路。 (1,1192) 不会是一个非常宽的图像(1 像素)。
-
不,你没有得到这个问题。图像很好,50x50 像素,问题在于从像素到打印系统期望的坐标转换。
标签: .net vb.net printing coordinate-transformation