Rendering HTML elements to

前端 未结 6 2025
天命终不由人
天命终不由人 2020-11-28 03:53

Is there a way to have an arbitrary HTML element rendered in a canvas (and then access its buffer...).

6条回答
  •  有刺的猬
    2020-11-28 04:07

    The CSS element() function may eventually help some people here, even though it's not a direct answer to the question. It allows you to use an element (and all children, including videos, cross-domain iframes, etc.) as a background image (and anywhere else that you'd normally use url(...) in your CSS code). Here's a blog post that shows what you can do with it.

    It has been implemented in Firefox since 2011, and is being considered in Chromium/Chrome (don't forget to give the issue a star if you care about this functionality).

提交回复
热议问题