📅  最后修改于: 2022-03-11 14:59:06.593000             🧑  作者: Mango
var src = 'https://picsum.photos/id/237/200/300';
var stage = new Konva.Stage({
container: 'container',
width: 400,
height: 300,
});
// with help of clipFunc on the layer
var layer = new Konva.Layer({
clipFunc: function(ctx) {
ctx.arc(130, 140, 70, 0, Math.PI * 2, false);
}
});
stage.add(layer);
Konva.Image.fromURL('https://picsum.photos/id/237/200/300', function(theDog) {
theDog.setAttrs({
x: 0,
y: 0,
scaleX: 1,
scaleY: 1,
});
layer.add(theDog);
layer.batchDraw();
});