I would like to print an image from a picturebox control and allow the user to select the printer
and page layout if possible.
But the problem that I am facing is that the image is not fitting to a page and I cant select the appropriate
printer and page layout.
How could i go about resizing/rescaling an image so it fits on the page either landscape or portrait?
Most of my images are 1024 by 768.
i did set the picturebox to the following:
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
Here is my print code:
private void button1_Click(object sender, EventArgs e)
{
printDocument1.OriginAtMargins = true;
printPreviewDialog1.ShowDialog();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(myPictureBox.Image, 0, 0);
}
I then discovered that i had to to set printPreviewDialog's Document property to printDocument1.
If anyone could assist me with this please, it would be much appreciated.
Thanks in advance.
This post has been edited by MarmiteX1: 28 January 2010 - 02:14 PM

New Topic/Question
Reply




MultiQuote




|