这是我的代码,已经通过,语言C#,系统Win2K
IntPtr hdc=(IntPtr)Gdi32.GetDC(null); //获得桌面设备场景
Graphics g1=Graphics.FromHdc(hdc);
Bitmap MyImage = new Bitmap ( Screen.PrimaryScreen.Bounds.Width , Screen.PrimaryScreen.Bounds.Height , g1 ) ; //根据屏幕大小创建一个与之相同大小的Bitmap对象
Graphics g2 = Graphics.FromImage ( MyImage ) ;
IntPtr dc2 = g2.GetHdc();
BitBlt ( (void*)dc2 , 0 , 0 , Screen.PrimaryScreen.Bounds.Width , Screen.PrimaryScreen.Bounds.Height , (void*)hdc , 0 , 0 , 13369376 ) ;
g2.ReleaseHdc ( dc2 ) ;
MyImage.Save(@"e:src.bmp",ImageFormat.Bmp);