vue-skia icon indicating copy to clipboard operation
vue-skia copied to clipboard

How to render on offscreen-canvas

Open sheepbox8646 opened this issue 1 year ago • 2 comments
trafficstars

首先,我很开心能找到这个项目

Remotion有一个包基于react-native-skia封装了一些做视频用的组件:

https://www.remotion.dev/docs/skia/skia-canvas

而我们团队正在开发一个叫VueMotion(https://github.com/Bug-Duck/vuemotion)的动画引擎,准备集成入Skia, 最初方案是CanvasKit-WASM, 但是如果封装下去工程量会非常大,所以我无意间搜索到了vue-skia

但是我研究了一下发现无法渲染到离屏画布上, 请问有什么解决方案?如果没有的话,我觉得可以封装类似于以下的API:

<script setup>
// ...
const ele = ref(null)
const { surface }  = useOffscreenCanvas(ele) 
// ...
</script>
<template>
<template>
  <v-surface ref="ele">
    ...
  </v-surface>
</template>
</template>

最终的需求是获取到图片的Blob对象。

如果看到了麻烦看一眼,谢谢!!!!!!!!!qwq

sheepbox8646 avatar Oct 01 '24 05:10 sheepbox8646