int index = inp.PostedFile.FileName.LastIndexOf("\\");
string name = inp.PostedFile.FileName.Substring(index+1); System.Drawing.Image oldimage = System.Drawing.Image.FromStream(inp.PostedFile.InputStream);
System.Drawing.Image thumbnailImage =
oldimage.GetThumbnailImage(oldimage.Width, oldimage.Height,new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
Bitmap output=new Bitmap(thumbnailImage);
thumbnailImage.Save(path,System.Drawing.Imaging.ImageFormat.Gif); Image1.Visible=true;
Image1.ImageUrl= path;
这个是代码。
string name = inp.PostedFile.FileName.Substring(index+1); System.Drawing.Image oldimage = System.Drawing.Image.FromStream(inp.PostedFile.InputStream);
System.Drawing.Image thumbnailImage =
oldimage.GetThumbnailImage(oldimage.Width, oldimage.Height,new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
Bitmap output=new Bitmap(thumbnailImage);
thumbnailImage.Save(path,System.Drawing.Imaging.ImageFormat.Gif); Image1.Visible=true;
Image1.ImageUrl= path;
这个是代码。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货