using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tango.ScreenCapture { public class GdiScreenCapture : IScreenCaptureMethod { public Bitmap GetDesktopBitmap(CaptureRegion region) { var bitmap = new Bitmap(region.Width, region.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(region.Left, region.Top, 0, 0, bitmap.Size, System.Drawing.CopyPixelOperation.SourceCopy); } return bitmap; } public void Dispose() { //Do nothing } } }