我想要的是将任何尺寸大于 480k 像素的图片缩小到 480k 像素或更小;
-- maxSize = 480k
-- picture1.Size = 1600*300 = 480k = maxSize => that's OK.
-- picture2.Size = 2600*200 = 520k => problem (should be reduced to maxSize or less).
picture2.Size / maxSize = 1.083
picture2.Size/1.083 = 480148 (~= maxSize) => that's OK.
假设 1.083 是图片调整大小的比率: ratio = 1.083;
如何应用此比例来保持图片纵横比?