Reputation: 235
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,
Upvotes: 1
Views: 850
Reputation: 30032
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);
}
Upvotes: 3
Reputation: 6672
Manipulate it as you wish..
Bitmap bmp = new Bitmap (500,500);
pictureBox1.DrawToBitmap(bmp, pictureBox1.DisplayRectangle);
bmp.Save("C:\\abcd.jpg");
Upvotes: 2