using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace Isotope.ScreenCaptureLib
{
public static class DrawingUtil
{
///
/// Creates a new bitmap from a specific region of another bitmap
///
///
///
///
public static Bitmap CopyBitmap(Bitmap bmp_source, Rectangle region)
{
var bmp_dest = new Bitmap(region.Width, region.Height);
using (var g = Graphics.FromImage(bmp_dest))
{
g.DrawImage(bmp_source, 0, 0, region, GraphicsUnit.Pixel);
}
return bmp_dest;
}
}
}