// the background image, a floor plan
myDiagram.add(
$(go.Part, // this Part is not bound to any model data
{ layerName: "Background", position: new go.Point(0, 0),
selectable: false, pickable: false },
$(go.Picture, "https://upload.wikimedia.org/wikipedia/commons/9/9a/Sample_Floorplan.jpg")
));
1 个回复
et_sed 2019-11-05
如果你想要它移动和缩放等,那么只需将它作为单独的部件添加,就像在Floor Monitor中一样:
// the background image, a floor plan myDiagram.add( $(go.Part, // this Part is not bound to any model data { layerName: "Background", position: new go.Point(0, 0), selectable: false, pickable: false }, $(go.Picture, "https://upload.wikimedia.org/wikipedia/commons/9/9a/Sample_Floorplan.jpg") ));
https://gojs.net/latest/samples/kittenMonitor.html