T
T
TANK_IST2017-08-20 18:32:35
JavaScript
TANK_IST, 2017-08-20 18:32:35

How to paint a shape with a picture?

There is a figure

var path = new Path2D('M79.9,11.6l9.9,2.7l6.7,2l3.4,1.1l4,2.3l4,3.7l2.9,7.5l1.7,8l2,3.7l2.3,1.7l3.7,5.2l1.7,4.3v4.6l-2,2.9l-2,2.9 l1.7,3.7l2.3,4l3.4,3.2l4,2.9l4.3,4.9v2.9h-81l1.1-11.5v-5.2l0.9-3.2l1.7-4l0.3-2.9l-1.7-4.3v-3.7l0.6-2.4l1.4-3.1l0.9-1.7l1.1-3.7 l0.9-2.3l1.4-2h2.6l1.1-1.4l0.3-2.3l0.3-4l2.3-1.4l1.4-1.4l0.3-2l0.3-1.7l0.3-2.3l1.1-3.4L79.9,11.6z');

I can paint it with color But how can I paint it with a picture? ctx.fillStyle = '#AF5200';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2017-08-20
@TANK_IST

createPattern

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question