javascript - Why I cannot use Konva.Image() in Konva.Shape.fillPatternImage(imageObj)? -


the following example konvajs library load image:

var imageobj = new image(); imageobj.onload = function() {    var yoda = new konva.image({     x: 50,     y: 50,     image: imageobj,     width: 106,     height: 118 });    , here code    
  var annotation = new konva.line({      points: this.contour,      stroke: color,      closed: true,      strokewidth: 1  });    var nativeimageobject = new image();    nativeimageobject.onload = function() {        var konvaimage = new konva.image({          image: nativeimageobject      });        annotation.fillpatternimage(konvaimage);               dentalchart.pattern.custompatternimages.push(custompatternimage);        gridlayer.add(annotation);        stage.draw();    };    nativeimageobject.src = pattern.todataurl();    nativeimageobject.id = patternenum + '' + color;      

for fillpatternimage use native image object.

http://konvajs.github.io/docs/styling/fill.html


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -