How to do perspective view with html5 canvas

后端 未结 2 1199
傲寒
傲寒 2021-01-12 08:26

I would like to make an image into skewed/perspective/rotated in html5 canvas. The image below is exactly what I would want to do.

相关标签:
2条回答
  • 2021-01-12 08:56

    Anyone who is still wondering, you can easily do this using http://evanw.github.io/glfx.js/docs/

    0 讨论(0)
  • 2021-01-12 09:17

    Unfortunately it isn't possible to use the canvas context setTransform method to perform perspective transformations (you are limited to translate, scale, rotate and skew).

    However, depending on your use-case, you may be able to fake it:

    http://tulrich.com/geekstuff/canvas/perspective.html http://yuiblog.com/blog/2008/06/23/slicing/

    0 讨论(0)
提交回复
热议问题