pixie/examples/image_tiled.nim

22 lines
349 B
Nim
Raw Normal View History

2021-02-25 16:57:49 +00:00
import pixie
2021-02-25 18:05:46 +00:00
let image = newImage(200, 200)
2021-02-25 16:57:49 +00:00
image.fill(rgba(255, 255, 255, 255))
var path: Path
path.polygon(
vec2(100, 100),
70,
sides = 8
)
image.fillPath(
path,
Paint(
2021-02-25 17:43:09 +00:00
kind: pkImageTiled,
2021-02-25 16:57:49 +00:00
image: readImage("tests/images/png/baboon.png"),
2021-02-25 17:43:09 +00:00
imageMat: scale(vec2(0.08, 0.08))
2021-02-25 16:57:49 +00:00
)
)
image.writeFile("examples/image_tiled.png")