JCropped获取裁剪的图像高度 [英] JCropped Get Cropped Image Height
本文介绍了JCropped获取裁剪的图像高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用JCrop来获取要裁剪的图像的尺寸.我有用于获取尺寸集的代码,如下所示:
I'm using JCrop to get the dimensions of the image to be cropped. I have the code for getting the dimensions set like this:
function updateCoordinates(c) {
console.log(c)
$('#image_x').val(c.x);
$('#image_x2').val(c.x2);
$('#image_y').val(c.y);
$('#image_y2').val(c.y2);
$('#image_w').val(c.w);
}
$('#jcrop_target').Jcrop({
aspectRatio : 2 / 1,
onSelect : updateCoordinates,
onChange : updateCoordinates
});
变量'c'具有值c.x,c.x2,c.y,c.y2和c.w.我正在猜测c.w =宽度,c.x = x坐标,c.y = y坐标,但是如何获得图像的高度?我很想将这些值传递给PHP Imagick裁剪.
the variable 'c' has the values c.x, c.x2, c.y, c.y2 and c.w . I'm making a guess that c.w = width, c.x = x coordinates and c.y = y coordinates, but how do I get the height of the image? I am cry to pass the values into PHP Imagick cropping.
<?php
$picture = new Imagick($this -> getOriginalUrl());
$picture->cropImage($width, $height, $x, $y);
我觉得我缺少明显的东西.
I Feel like I'm missing something obvious.
推荐答案
c.y2-c.y给出裁剪区域的高度.
c.y2 - c.y gives the height of the cropped area.
这篇关于JCropped获取裁剪的图像高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文