Печать пустой страницы во время печати панели форм в winforms C#
printing blank page in printer as well as microsoft xps document also.i changed in below my code.But I am getting blank only.
Что я уже пробовал:
printing blank page in printer as well as microsoft xps document also private void printButton_Click(object sender, EventArgs e) { CaptureScreen(); printDialog1.AllowSomePages = true; printDialog1.ShowHelp = true; printDialog1.Document = printDoc1; DialogResult result = printDialog1.ShowDialog(); if (result == DialogResult.OK) { printDoc1.Print(); } } private void CaptureScreen() { Graphics myGraphics = this.CreateGraphics(); Size s = this.Size; memoryImage = new Bitmap(s.Width, s.Height, myGraphics); Graphics memoryGraphics = Graphics.FromImage(memoryImage); memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s); } void printDoc1_PrintPage(object sender, PrintPageEventArgs e) { e.Graphics.DrawImage(memoryImage, 0, 0); }