sarika sarikaa

sarika sarikaa

  • NA
  • 60
  • 8.3k

print image from picturebox wchich feet in A4 size paper

May 5 2018 4:56 AM
i  want to print image in A4 size paper from picturebox on click on print button.
 
 
 
i have tried this , but when i will print this image on A4 size paper it cant print the hole image.
 
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();
}
 

Answers (1)