上面是调用WinAPI方式的,用.NET自带的类方式如下。

   Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
   Graphics gs 
= Graphics.FromImage(bmp);
      gs.CopyFromScreen(
0000new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height));
  
this.pictureBox1.Image = bmp;

 

 

相关文章: