You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
779 B
42 lines
779 B
import Konva from "konva";
|
|
|
|
export default function (width,height){
|
|
const x=width*0.495,y=260,_width=width*0.186,_height=height*0.713
|
|
const container=new Konva.Group({
|
|
id:'sb',
|
|
x:x,
|
|
y:y,
|
|
width:_width,
|
|
height:_height
|
|
})
|
|
|
|
const imageObj = new Image();
|
|
imageObj.src = require('@/assets/sliao/personbg.png');
|
|
imageObj.onload = function () {
|
|
const shape = new Konva.Image({
|
|
x: 0,
|
|
y: 0,
|
|
width: _width,
|
|
height:_height,
|
|
image: this,
|
|
});
|
|
container.add(shape)
|
|
shape.zIndex(0)
|
|
}
|
|
|
|
const text=new Konva.Text({
|
|
x: 0,
|
|
y: 0,
|
|
width: _width,
|
|
height:_height,
|
|
fill:'black',
|
|
text:'划线设备',
|
|
align:'center',
|
|
verticalAlign:'middle',
|
|
})
|
|
|
|
container.add(text)
|
|
|
|
return container
|
|
}
|