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

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -