簡體   English   中英

打印Picturebox C#的全部內容

[英]Print Full Content of Picturebox C#

因此,我知道您可以使用以下方法打印圖片框的圖像內容:

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

要打印背景圖像,我將需要更改為:

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

問題是您如何同時打印兩者?

謝謝,

只需先做背景:

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);
}

隨意操作。

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