react-canvaskit icon indicating copy to clipboard operation
react-canvaskit copied to clipboard

How to draw svg and images using react-canvaskit

Open xurenda opened this issue 3 years ago • 6 comments

I want to draw svg and images on canvas, it seems react-canvaskit does not provide these functions, is there any way?

xurenda avatar Jul 22 '21 07:07 xurenda

It's certianly possible but it seems react-canvaskit doesn't to have that api mapped from canvaskit. I'll see if I can update the canvaskit dependency and add image support.

Zubnix avatar Jul 23 '21 06:07 Zubnix

work is being done in https://github.com/udevbe/react-canvaskit/tree/canvaskit-wasm-update All but offscreen rendering is working, once that is done, I'll add image support.

Zubnix avatar Jul 23 '21 07:07 Zubnix

OK, thank you. Looking forward to your updates.

xurenda avatar Jul 23 '21 07:07 xurenda

work is being done in https://github.com/udevbe/react-canvaskit/tree/canvaskit-wasm-update All but offscreen rendering is working, once that is done, I'll add image support.

I've just discovered this excellent repo, is there any example for current svg support ?

boulabiar avatar Jan 07 '22 15:01 boulabiar

Unfortunately most of my time is currently spend developing greenfield.

I'll see if I can continue and fix up the upgrade branch and add basic image support in the next few days.

Zubnix avatar Jan 07 '22 22:01 Zubnix

I've added encoded image support (tested with png). SVG images don't seem to be supported by canvaskit, only individual SVG paths.

Zubnix avatar Jan 10 '22 12:01 Zubnix