eendeego / node-openvg-canvas

Canvas implementation on top of node-openvg
179 stars 25 forks source link

drawImage(canvas, 0, 0) #30

Open 2xAA opened 8 years ago

2xAA commented 8 years ago

Official Canvas supports using the Canvas as an Image using context.drawImage. Is there a possibility to do this with this library?

I'm not specifically asking for it to be added, just the theory behind it with either this library or OpenVG itself. I'd be more than happy working on implementing it myself.

From the MozDocs: image An element to draw into the context. The specification permits any canvas image source (CanvasImageSource), such as an HTMLImageElement, an HTMLVideoElement, an HTMLCanvasElement or an ImageBitmap.

I know this isn't an exact implementation, but there's any possibility to emulate this, it would be awesome.

Best, Sam

eendeego commented 8 years ago

Yes, it can be done. OpenVG has an api to copy images from the framebuffer to a "memory" backed image.

Patches are welcome!

2xAA commented 8 years ago

Well, I need this for a project I'm working on at University, so I'll get going on it and submit a pull request soon - thanks.