Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery jcrop-中心的默认作物选择_Jquery_Asp.net_Image Resizing_Jcrop - Fatal编程技术网

Jquery jcrop-中心的默认作物选择

Jquery jcrop-中心的默认作物选择,jquery,asp.net,image-resizing,jcrop,Jquery,Asp.net,Image Resizing,Jcrop,我在ASP.NET C#应用程序中使用JCrop来裁剪图像。 默认情况下,我希望裁剪选择区域设置在图像的中心, 这是我当前的代码,但问题是,它总是以0,0开始选择 $('#img_crop').Jcrop({ //img_crop is the ID of image control onChange: updatePreview, // will display the selected img on change.

我在ASP.NET C#应用程序中使用JCrop来裁剪图像。 默认情况下,我希望裁剪选择区域设置在图像的中心, 这是我当前的代码,但问题是,它总是以0,0开始选择

            $('#img_crop').Jcrop({    //img_crop is the ID of image control
                onChange: updatePreview, // will display the selected img on change.
                onSelect: updatePreview, // will display the selected img Img_preview
                bgColor: 'black',
                bgOpacity: .6,
                //setSelect: [100, 100, 240, 240],
                setSelect:   [ ($('#img_crop').attr('width') / 2) - 70, 
                       ($('#img_crop').attr('height') / 2) - 70, 
                       ($('#img_crop').attr('width') / 2) + 70, 
                       ($('#img_crop').attr('height') / 2) + 70
                     ],
                onSelect: storeCoords, // will tell the coordinates
                aspectRatio: 1

            }

“宽度”和“高度”属性可能未设置。我宁愿使用$(''img_-crop').width()和$(''img_-crop').height(),看看这是否有效

检查这一个解决方案是什么??