0
私のウェブサイトには、クライアント側から画像をアップロードするための部分があります。画像の表示に問題があります。画像のサイズはbollixです。アップロード時に画像のサイズを変更できますか?MVC.NETで画像をどのようにサイズ変更するのですか?
この私のコード:
[HttpPost]
public ActionResult Create(int id,HttpPostedFileBase photoFile)
{
if (photoFile != null)
{
Photo photo = new Photo();
photo.Part = db.Parts.Find(id);
photo.PhotoContent = photoFile.ContentType;
photo.PhotoByte = new byte[photoFile.ContentLength];
photoFile.InputStream.Read(photo.PhotoByte, 0, photoFile.ContentLength);
db.Photos.Add(photo);
db.SaveChanges();
return RedirectToAction("Index", new { id = photo.Part.Id });
}
return View();
}
の可能性のある重複(http://stackoverflow.com/questions/1922040/resize-an-image-c-sharp)[画像のC#のサイズを変更します] –