Resize image while keeping aspect ratio in Java

后端 未结 7 871
清歌不尽
清歌不尽 2020-12-13 10:58

im trying to resize bufferdImage in memory in java but to keep the aspect ratio of the image im have something like this but this is not good

int w = pictu         


        
相关标签:
7条回答
  • 2020-12-13 11:30

    You may have a look at perils-of-image-getscaledinstance.html that explains why getScaledInstance(), used in some of the answers, should be avoided.

    The article also provides alternative code.

    0 讨论(0)
提交回复
热议问题