首页 > 代码库 > Capture Current Soft Screen

Capture Current Soft Screen

Bitmap memoryImage;
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);
}

 

private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{

e.Graphics.DrawImage(memoryImage, 0, 0);
}