こんにちは誰かが私が作成した長方形から画像を保存する方法を知っていますか?
protected override void OnPaint(PaintEventArgs e)
{
Bitmap bitmap = new Bitmap(@"Pictures/testing.jpg");
Image img = bitmap;
int width = testing.Width / 3;
int height = testing.Height / 3;
Rectangle destrect = new Rectangle(0, 0, width, height);
GraphicsUnit units = GraphicsUnit.Pixel;
System.Drawing.Imaging.ImageAttributes imageAttr= new System.Drawing.Imaging.ImageAttributes();
//1.1.jpg//
//e.Graphics.DrawImage(img,destrect,0,0, width, height, units, imageAttr);
//1.2.jpg//
e.Graphics.DrawImage(img, destrect, width, 0,width, height, units, imageAttr);
base.OnPaint(e);
}
希望の画像を切り抜いてありますが、保存方法がわかりません。助けていただければ幸いです。