Generating image thumbnails in ASP.NET?

前端 未结 7 1555
再見小時候
再見小時候 2020-12-08 22:02

What is the fastest and more reliable way of generating thumbnails in .NET? I need to get any image, compress it in JPEG and resize it.

I\'ve seen several examples w

7条回答
  •  不知归路
    2020-12-08 22:30

    See my answer here Create thumbnail image

    There is a function on Image which returns a thumbnail like this:

    Image image = Image.FromFile(fileName);
    Image thumb = image.GetThumbnailImage(120, 120, ()=>false, IntPtr.Zero);
    thumb.Save(Path.ChangeExtension(fileName, "thumb"));
    

提交回复
热议问题