如何用A4纸打印图像 [英] how to print images in A4 paper

查看:149
本文介绍了如何用A4纸打印图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在数据库中有图像。



i想要打印图像整张(A4)纸,尺寸为180 * 100像素。



i正在寻找带有c#代码的窗体表格



I have a images in database .

i want to print the images in whole (A4) paper with the size of 180*100 px.

i am looking for windows form with c# codes

推荐答案

这可以通过<$ c轻松完成$ c> System.Drawing.Printing.PrintDocument :

http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx [ ^ ]。



要打印图像本身,您需要使用 System.Drawing.Graphics.DrawImage 方法之一,这些方法允许您选择所需的矩形大小。请参阅:

http://msdn.microsoft.com /en-us/library/system.drawing.graphics.aspx [ ^ ]。



确保选择与像素大小相匹配的图像大小,这将是在运行时可用。在这种情况下, DrawImage 方法将自动为您重新采样图像。你只是数学和位置的数学。



-SA
This is easily done by using System.Drawing.Printing.PrintDocument:
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].

To print the image itself, you will need to use one of the System.Drawing.Graphics.DrawImage methods, those which allows you to choose required rectangle size. Please see:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^].

Make sure you select the image size matching the page size in pixel, which will be available to you during runtime. In this case, the DrawImage method will resample the image for you, automatically. Just do you math on size and location.

—SA


这篇关于如何用A4纸打印图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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