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.
Comments
Post a Comment