Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要根据特定的纵横比调整图像大小。
例如,如果我有尺寸为 1600*800 的图像,则比例为 2:1,
假设我需要调整图像大小,所以比例必须是 2:3。
知道如何实施吗?
只需根据高度值设置宽度 * 一个标量
width = height * 2 //2:1 width = height * 0.66 //2:3