Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对比ImageEditor与croppie、cropper等图片裁剪库API设计问题 #36

Open
luxiaowu opened this issue Mar 3, 2017 · 0 comments
Open

Comments

@luxiaowu
Copy link

luxiaowu commented Mar 3, 2017

实现固定大小的图片裁剪

怎么让裁剪框不动,拖动图片(可放大缩小,最小不小过裁剪框)
我看croppie和cropper的API上都很清楚,区分裁剪框和容器

croppie

var vanilla = new Croppie(el, {
  viewport: {
    width: 300,
    height: 300
  },
  boundary: {
    width: 300,
    height: 300
  },
  showZoomer: false,
  // enableExif: true,
  enableOrientation: true
});
vanilla.bind({
  url: objectURL,
  orientation: 6
});
vanilla.result({
  type: 'blob',
  size: {
    width: 300,
    height: 300
  },
  // format: 'jpeg',
  // quality: 0.8
}).then(function (blob) {
  // do something with cropped blob
});

cropper

$(element).cropper({
  // width: 300,
  // height: 300,
  viewMode: 3,
  dragMode: 'move',
  autoCropArea: 1,
  restore: false,
  guides: false,
  highlight: false,
  cropBoxMovable: false,
  cropBoxResizable: false,
  aspectRatio: 1,
})

求使用 motionImageEditor的代码示例

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant