/// <param name="Width">宽度</param> /// <param name="Height">高度</param> public void MakeSmallImg(System.Web.HttpPostedFile postFile, string saveImg, System.Double Width, System.Double Height) {
//SourcePhotoName string m_OriginalFilename = postFile.FileName; string m_strGoodFile = saveImg;
//GetPhotoObject From SourceFile System.Drawing.Image m_Image = System.Drawing.Image.FromStream(postFile.InputStream, true);
System.Double NewWidth, NewHeight; if (m_Image.Width > m_Image.Height) { NewWidth = Width; NewHeight = m_Image.Height * (NewWidth / m_Image.Width); } else { NewHeight = Height; NewWidth = (NewHeight / m_Image.Height) * m_Image.Width; }
if (NewWidth > Width) { NewWidth = Width; } if (NewHeight > Height) { NewHeight = Height; }
//GetPhotoSize System.Drawing.Size size =new System.Drawing.Size((int)NewWidth, (int)NewHeight); //The New of Bimp Photo System.Drawing.Image bitmap = new System.Drawing.Bitmap(size.Width, size.Height);
上一篇:系统解答:引导或系统启动驱动程序无法加载
下一篇:ASP.NET设计中的性能优化问题
|