HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
18
1
var stage = acgraph.create("container");
2
stage.path()
3
.moveTo(stage.width() / 2, 0)
4
.lineTo(stage.width() / 2, stage.height());
5
stage.text(20, 0, "Stretch image");
6
stage.rect(2, 18, stage.width() / 2 - 4, stage.height() - 22)
7
.fill({
8
src: "https://static.anychart.com/images/kitty.png",
9
mode: "stretch"
10
})
11
.stroke("1 #000");
12
stage.text(stage.width() / 2 + 20, 0, "Pattern image");
13
stage.rect(stage.width() / 2 + 2, 18, stage.width() / 2 - 4, stage.height() - 22)
14
.fill({
15
src: "https://static.anychart.com/images/kitty.png",
16
mode: "tile"
17
})
18
.stroke("1 #000");