嘿,大家好,我有一張圖片,我正在從互聯網上下載,需要將它調整到1/4的大小,同時保持其寬高比。任何想法如何做到這一點最簡單?在保持縱橫比的同時調整圖像大小
WebRequest requestPic = WebRequest.Create(imageURL);
WebResponse responsePic = requestPic.GetResponse();
Image webImage = Image.FromStream(responsePic.GetResponseStream());
// Need to resize image here
Random rand = new Random();
string imageName = string.Format("{0:x}{1:x}", DateTime.Now.Ticks, rand.Next(0, 60400000));
if (webImage != null)
{
webImage.Save(string.Format("c:\\{0}.jpg", imageName));
}
謝謝!
@Marino - 實際上它會使它成爲它的1/16。 – 2011-05-09 22:02:50
如果你正在談論該地區,那麼肯定是的 – 2011-05-09 22:41:54