i want to crop an image... picture is in picture box,,
-
i want to crop an image... picture is in picture box,, iam trying this... but public void CropImage(bool enableImg) { cropEnable = enableImg; if (cropEnable) { Rectangle cropArea = new Rectangle(20, 20, 100, 100); Pic = (Bitmap)CroppingImage(m, cropArea); m = (Bitmap)Pic; Invalidate(); } } public Image CroppingImage(Image img, Rectangle cropArea) { Bitmap bmpImage = new Bitmap(img); Bitmap bmpCrop = bmpImage.Clone(cropArea, bmpImage.PixelFormat); return (Image)(bmpCrop); } and the 2nd one: public Image CropImage(Image img, Rectangle rect) { return ((Bitmap)img).Clone(rect, img.PixelFormat); } private void button1_Click(object sender, EventArgs e) { Rectangle CropRectangle = new Rectangle(100, 100, 100, 100); pbx.Image = CropImage(pbx.Image, CropRectangle); } but a same error is generated. error is this: Error 1 Inconsistent accessibility: parameter type 'I_M_Editor.Rectangle' is less accessible than method 'I_M_Editor.frmEditable.CropImage(System.Drawing.Image, I_M_Editor.Rectangle)' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 442 22 I'M Editor --------------------------------------------------------------------------------
maifs