case 1:
CaptureScreen.GetDesktopImage().Save(this.saveFileDialog1.FileName,
System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 2:
CaptureScreen.GetDesktopImage().Save(this.saveFileDialog1.FileName,
System.Drawing.Imaging.ImageFormat.Gif);
break;
case 3:
CaptureScreen.GetDesktopImage().Save(this.saveFileDialog1.FileName,
System.Drawing.Imaging.ImageFormat.Bmp);
break;
case 4:
CaptureScreen.GetDesktopImage().Save(this.saveFileDialog1.FileName,
System.Drawing.Imaging.ImageFormat.Tiff);
break;
}
PlatformInvokeUSER32.ShowWindow(Form.ActiveForm.Handle,4);
}
}
4 实现代码
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace WindowsApplication3
{
// <summary>
// Plateform 的摘要说明。
// </summary>
public class PlatformInvokeGDI32
{
#region Class Variables
public const int SRCCOPY = 13369376;
#endregion
#region Class Functions
[DllImport("gdi32.dll",EntryPoint="DeleteDC")]
public static extern IntPtr DeleteDC(IntPtr hDc);
[DllImport("gdi32.dll",EntryPoint="DeleteObject")]
public static extern IntPtr DeleteObject(IntPtr hDc);
|