private static Bitmap cutImage(Bitmap bmp, int w, int h, int x, int y) { Bitmap cut = null; try { cut = new Bitmap(w, h); Graphics g = Graphics.FromImage(cut); g.DrawImage(bmp, x, y); g.Dispose(); } catch (Exception e) { } return cut; }