直接贴代码:有更好的大家一起交流啊
Rectangle bounds = Screen.GetBounds(Screen.GetBounds(Point.Empty));
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
}
//Convert the Image to a JPG
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, imgFormat);
return ms;
}