Draw distorted image on html5's canvas

后端 未结 4 1367
后悔当初
后悔当初 2020-12-16 03:22

Is it possible, and if so how, to draw images with its four corners distorted to a non rectangular shape. For example if you were wanting to draw the image as if it had bee

4条回答
  •  佛祖请我去吃肉
    2020-12-16 04:15

    You could try function transferPoint (xI, yI, source, destination) explicated here.

    Source and destination are the four points of source and destination rectangles. The code works for (SVG) path coordinates (curve and line), but with some modification should work also with pixels.

提交回复
热议问题