【发布时间】:2013-04-06 03:08:48
【问题描述】:
这是我第一次尝试的方式:
$('#thumbnail').imgAreaSelect({
x1: 5,
y1: 5,
x2: $('#thumbnail').width(),
y2: $('#thumbnail').width()*0.66,
aspectRatio: '1:0.66'
});
但一些裁剪后的图像不会溢出...
这似乎对我尝试过的大多数图像分辨率进行了预选...
var thwidth = $('#thumbnail').width();
var thheight = $('#thumbnail').height();
aspectRatio = 0.66;
$('#thumbnail').imgAreaSelect({
x1: 5,
y1: 5,
x2: thwidth - 80,
y2: (thwidth - 80) * aspectRatio,
aspectRatio: '1:0.66'
});
但它不会选择可能的最大值;而且我觉得有点脏……
如何选择最大的(如果可能,居中)宽度/高度坐标尊重纵横比? (在这种情况下:1:0.66)
【问题讨论】:
标签: javascript jquery jquery-plugins crop aspect-ratio