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(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)