在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
this.Visible = false; System.Threading.Thread.Sleep(200); Bitmap bit = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); Graphics g = Graphics.FromImage(bit); g.CopyFromScreen(new Point(0, 0), new Point(0, 0), bit.Size); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "bmp|*.bmp|jpg|*.jpg|gif|*.gif"; if (saveFileDialog.ShowDialog() != DialogResult.Cancel) { bit.Save(saveFileDialog.FileName); } g.Dispose(); this.Visible = true;
截图窗体方法 Bitmap bit = new Bitmap(this.Width,this.Height); Graphics g = Graphics.FromImage(bit); g.CopyFromScreen(this.Location, new Point(0, 0), bit.Size); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "bmp|*.bmp|jpg|*.jpg|gif|*.gif"; if (saveFileDialog.ShowDialog() != DialogResult.Cancel) { bit.Save(saveFileDialog.FileName); } g.Dispose();
|
请发表评论