Bitmap memoryImage; private void CaptureScreen() { Graphics myGraphics = this.CreateGraphics(); Size s = tabControlMain.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); } private void printDocumentReal_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawImage(memoryImage, 0, 0); } private PrintDocument printDocumentReal = new PrintDocument(); private void printToolStripButton_Click(object sender, EventArgs e) { CaptureScreen(); printDocumentReal.Print(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)