简体   繁体   English

打印Picturebox C#的全部内容

[英]Print Full Content of Picturebox C#

So I know that you can print the image content of a picture box using: 因此,我知道您可以使用以下方法打印图片框的图像内容:

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
    e.Graphics.DrawImage(pictureBox1.Image, 0, 0);
}

To print the background image, I will need to change to: 要打印背景图像,我将需要更改为:

e.Graphics.DrawImage(pictureBox1.BackgroundImage, 0, 0);

Question is how do you print both? 问题是您如何同时打印两者?

Thanks, 谢谢,

Just do the background first: 只需先做背景:

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
    e.Graphics.DrawImage(pictureBox1.BackgroundImage, 0, 0);
    e.Graphics.DrawImage(pictureBox1.Image, 0, 0);
}

Manipulate it as you wish.. 随意操作。

Bitmap bmp = new Bitmap (500,500);
pictureBox1.DrawToBitmap(bmp, pictureBox1.DisplayRectangle);
bmp.Save("C:\\abcd.jpg");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM