Rectangle rec = new Rectangle(paint_Control1.X1, 0, paint_Control1.X2 - paint_Control1.X1, paint_Control1.Height); Bitmap bmp = new Bitmap(paint_Control1.X2 - paint_Control1.X1, paint_Control1.Height); paint_Control1.DrawToBitmap(bmp, rec);
public static Bitmap Extract(Bitmap src, Rectangle section) { Bitmap bmp = new Bitmap(section.Width, section.Height); using (Graphics g = Graphics.FromImage(bmp)) { g.DrawImage(src, 0, 0, section, GraphicsUnit.Pixel); } return bmp; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)