从图片框中打印A4尺寸的图像 [英] Print the image in A4 size pape from picturebox

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

问题描述

我试过这个,但是当我用A4尺寸的纸张打印图像时,它会剪掉一半的图像。

请给我解决方案,图像应该是A4尺寸纸张的尺寸:



我尝试了什么:



我试过这个,但当我打印出来的图片时A4尺寸的纸张切成一半的图像。

请给我解决方案,图像应该在A4尺寸的纸张上:



I hav Tried this , But when i print the image in A4 size paper it cut half image .
please give me solution that image should feet in A4 size paper:

What I have tried:

I hav Tried this , But when i print the image in A4 size paper it cut half image .
please give me solution that image should feet in A4 size paper:

private void button1_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
PrintDocument doc = new PrintDocument();
doc.PrintPage += Doc_PrintPage;
pd.Document = doc;
if (pd.ShowDialog() == DialogResult.OK)
doc.Print();

}

private void Doc_PrintPage(object sender, PrintPageEventArgs e)
{

Bitmap bm = new Bitmap(pictureBox1.Width,pictureBox1.Height);
pictureBox1.DrawToBitmap(bm, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height));
e.Graphics.DrawImage(bm,0,0);
bm.Dispose();
}

推荐答案

请看这里: c# - 使用PrintDocument打印图像。如何调整图像以适合纸张大小 - Stack Overflow [ ^ ]


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

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