我遇到一个问题,我正在缩小图像,然后尝试打印该图像。
但是打印时,图像会变得模糊。这是我用来调整图像大小和打印的代码。
Private Sub printDocument2_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles _
printDocument2.PrintPage
DriverSheetImage2 = New Bitmap(DriverSheetImage, DriverSheetImage.Width * 0.85, DriverSheetImage.Height * 0.85)
e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor
e.Graphics.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
e.Graphics.DrawImage(DriverSheetImage2, 0, 0)
End Sub
我是否缺少图形属性来平滑事物或以不会导致图像模糊的方式调整其大小?
最佳答案
正如评论所建议的那样,最终使用了带有新矩形的 DrawImage 方法,因此最终代码如下所示
e.Graphics.DrawImage(DriverSheetImage, New Rectangle(0, 0, DriverSheetImage.Width * 0.85, DriverSheetImage.Height * 0.85))
关于.net - 打印后缩小的图像模糊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48869247/