首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CropperJS:图像输出--“麦田”框不可见

CropperJS:图像输出--“麦田”框不可见
EN

Stack Overflow用户
提问于 2016-10-06 16:00:06
回答 1查看 1.8K关注 0票数 0

我使用javascript 番薯来裁剪用户上传的图像。在裁剪器显示中,裁剪框外的图像不可见.以下图片所示的样本-

我的裁缝配置是-

代码语言:javascript
复制
var cropper_opts = {
  aspectRatio: 1/1,
  viewMode: 0,
  crop: function(e){}, //to show the crop box manually
  minCanvasWidth: 0,
  minCanvasHeight: 0,
  minCropBoxWidth: 0,
  minCropBoxHeight: 0,
  minContainerWidth: 860,   //decides the size of image
  minContainerHeight: 355,  //decides the size of image
  autoCropArea: 1,
  modal: true,      // Show the black modal
  guides: true,     // Show the dashed lines for guiding
  center: true,     // Show the center indicator for guiding
  highlight: true,  // Show the white modal to highlight the crop box
  background: true, // Show the grid background
}

请帮我解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2017-02-20 15:23:36

这可能是因为您在某种类型的html模板中使用cropper,该模板已经集成了cropper,而画布元素已经应用了其他样式。

检查这个类.cropper-canvas

在我的例子中,我发现我使用的模板将其不透明度设置为0。

代码语言:javascript
复制
.cropper-canvas {
  cursor: crosshair;
  background-color: #fff;
  opacity: 0; /* that's the problem */
  filter: alpha(opacity=0);
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39900677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档