我正在开发一个程序来获取高级屏幕截图。但是我遇到了一个错误,我希望有人可以帮助我。
我可以用这段代码截屏:
// The screenshot will be stored in this bitmap. Bitmap capture = new Bitmap(screenBounds.Width, screenBounds.Height); // The code below takes the screenshot and // saves it in "capture" bitmap. g = Graphics.FromImage(capture); g.CopyFromScreen(Point.Empty, Point.Empty, screenBounds); // This code assigns the screenshot // to the Picturebox so that we can view it pictureBox1.Image = capture; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; // The code below make the form visible again, enables the "Save" button and stops the timer. this.Show(); button2.Enabled = true; timer1.Stop();
在图片框上绘图:
color = new SolidBrush(Color.Black); Graphics g = pictureBox1.CreateGraphics(); g.FillEllipse(color, e.X, e.Y, 10, 10); g.Dispose();
问题:我只能保存截图,不能保存图纸。
我希望有人能帮帮忙