Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从画布中获取数据并设置 img 元素的 src 属性。这里的问题是,画布有一个用 css 设置的背景图像,而不是用画布方法。有什么方法或方法可以提取背景图像,以便 toDataURL 方法可以捕获它?
谢谢
我想您不将背景图像绘制到画布本身是有充分理由的,因此我可以为您提供以下解决方案: