小数学帮助图像调整大小所需 [英] Little Math-help for image resize needed

查看:108
本文介绍了小数学帮助图像调整大小所需的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个价值X宽度和Y高度的图像。

I have an Image with the Value X width and Y height.

现在我想将高度设置为60px。

Now I want to set the height ever to 60px.

通过哪个计算我可以计算图像正确调整大小的高度?

With which calculation I can calculate the height that the image is correct resized?

推荐答案

我想你正试图保持纵横比。如果是这样,请使用以下内容:

I think you are trying to maintain aspect ratio. If so use the following:

ratio = orginialHeight / newHeight

ratio = orginialHeight / newHeight

newWidth = orginialWidth * ratio

newWidth = orginialWidth * ratio

这篇关于小数学帮助图像调整大小所需的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆