Coder Social home page Coder Social logo

Comments (17)

dlhandsome avatar dlhandsome commented on May 17, 2024

目前没有封装resizecut的方法,先尝试修改实例里的cut属性吧

this.wecropper.cut = {
  x: newX,
  y: newY,
  width: newWidth,
  height: newHeight 
}

from we-cropper.

umeitime avatar umeitime commented on May 17, 2024

@dlhandsome 这个设置没有任何效果,我发现。

from we-cropper.

umeitime avatar umeitime commented on May 17, 2024

@dlhandsome 初始化的宽高 缩放比例是对的, 但是按照你的那个方法设置并updateCanvas 图片的裁切区域修改了,但是图片缩放比不对了。

from we-cropper.

umeitime avatar umeitime commented on May 17, 2024

pushOrign里面的width,height还是原来初始化的值,我手动修改了这个宽高,但是移动的时候,计算就不准确了。

from we-cropper.

dlhandsome avatar dlhandsome commented on May 17, 2024

稍晚些出一个resizeCut的方法

from we-cropper.

umeitime avatar umeitime commented on May 17, 2024

@dlhandsome 谢谢,麻烦了。

from we-cropper.

acmilankaka avatar acmilankaka commented on May 17, 2024

现在能用吗?

from we-cropper.

remember-5 avatar remember-5 commented on May 17, 2024

现在能用吗?

from we-cropper.

lvzhou2017 avatar lvzhou2017 commented on May 17, 2024

请问方法出了吗?

from we-cropper.

0415ypt00 avatar 0415ypt00 commented on May 17, 2024

请问这个方法出了吗 急用啊老铁

from we-cropper.

cced3000 avatar cced3000 commented on May 17, 2024

同求resizeCut的方法

from we-cropper.

lylovexm avatar lylovexm commented on May 17, 2024

请问这个方法现在有吗?

from we-cropper.

tianqingpeng avatar tianqingpeng commented on May 17, 2024

同求resizeCut的方法

from we-cropper.

yovenny avatar yovenny commented on May 17, 2024

同求resizeCut的方法

from we-cropper.

yovenny avatar yovenny commented on May 17, 2024

解决办法:方案一

   this.cropper.width=opt.width
    this.cropper.height=opt.height
    this.cropper.cut ={
      x: opt.cut.x,
      y: opt.cut.y,
      width: opt.cut.width,
      height: opt.cut.height
  }
//下面三个三个方法重置局部变量x、y、 boundWidth、boundHeight
    this.cropper.cutt();
    this.cropper.methods();
    this.cropper.init();

方案二

1.将 x、y、 boundWidth、boundHeight 改自身变量self.x等,需要相关方法引用,
2.新增方法update这几个值,x、y、 boundWidth、boundHeight、cut、with/height
width/height 或者应该叫cutWidth/cutHeiht、boundWidth/boundHeight 实际画布宽高,就是你传进去的

from we-cropper.

yovenny avatar yovenny commented on May 17, 2024

内部参数使用安排的不是很好,2.0可以重构好点

from we-cropper.

shishufei avatar shishufei commented on May 17, 2024

同求resizeCut的方法

pushOrign里面的宽度,高度还是原来的初始化值,我手动修改了这个宽高,但是移动的时候,计算就不准确了。

你的问题解决了吗

from we-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.