展开全部
public int width = Screen.PrimaryScreen.Bounds.Width;
public int height = Screen.PrimaryScreen.Bounds.Height;
Bitmap btm = new Bitmap(width,height);
using (Graphics g = Graphics.FromImage(btm))
{
g.CopyFromScreen(0, 0, 0, 0, Screen.AllScreens[0].Bounds.Size);
g.Dispose();
pictureBox1.Image = btm;
string save = "F:\\屏幕获取保存\\" + DateTime.Now.ToString("yyyymmddhhmmssmmmm") + ".jpeg";
btm.Save(save);
你自己改一下吧,把这个写在一个事件中
public int height = Screen.PrimaryScreen.Bounds.Height;
Bitmap btm = new Bitmap(width,height);
using (Graphics g = Graphics.FromImage(btm))
{
g.CopyFromScreen(0, 0, 0, 0, Screen.AllScreens[0].Bounds.Size);
g.Dispose();
pictureBox1.Image = btm;
string save = "F:\\屏幕获取保存\\" + DateTime.Now.ToString("yyyymmddhhmmssmmmm") + ".jpeg";
btm.Save(save);
你自己改一下吧,把这个写在一个事件中
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询