没人理我,论坛好冷,下面是目前的做法,效率感人
- Image<Rgb, byte> img = dargImagebox4.Image as Image<Rgb, byte>;
- string[] arr=textBox6.Text.Split(',');
- int Left = (int)(img.Width - double.Parse(arr[0]));
- int top = (int)(img.Height - double.Parse(arr[1]));
- int wid = img.Width - Left;
- int heigh = img.Height - top;
- Image<Rgb, byte> img2 = new Image<Rgb, byte>(wid,heigh);
- for (int i = 0; i < heigh; i++)
- {
- for (int j = 0; j < wid; j++)
- {
- img2[i,j]=img[i+top,j+Left];
- }
- }
- img.Dispose();
- dargImagebox4.Image = img2;
复制代码
|