Image Resize C#,VB.NET Opensource Library

强颜欢笑 提交于 2019-12-13 18:47:50

问题


Any one point me on good direction on how to resize a jpg image to exactly particular size (Both File size and pixel size Ex. 148 x 72 px , 300 KB ).

To Acheive this, Quality of images can be adjusted.

It may a .NET library /code but it should be free for commercial use / open source.

I want it in either C# or VB.NET as library.


回答1:


You can use the Graphics.DrawImage to resize the image. Then you can adjust the quality by passing a parameter to the Bitmap.Save method (more info). I don't know how you can go from a file size to get the correct compression parameter. You could always try multiple compression parameters until the file size matched what you needed.



来源:https://stackoverflow.com/questions/668318/image-resize-c-vb-net-opensource-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!