/// <summary> /// Captures a screen shot of a specific window, and saves it to a file /// </summary> /// <param name="handle"></param> /// <param name="filename"></param> /// <param name="format"></param> public static void CaptureWindowToFile(IntPtr handle, string filename, ImageFormat format) { DirectBitmap img = CaptureWindow(handle); img.Save(filename, format); }
/// <summary> /// Captures a screen shot of the entire desktop, and saves it to a file /// </summary> /// <param name="filename"></param> /// <param name="format"></param> public static void CaptureScreenToFile(string filename, ImageFormat format) { DirectBitmap img = CaptureScreen(); img.Save(filename, format); }