简体   繁体   中英

How to convert gdImagePtr to base64 string

I am working on streamdeck plugin. Streamdeck supports showing custom images is base64 format. I would like to generate an image using libgd and send the base64 string to streamdeck.

You would need to first render to a framebuffer (virtual screen), then capture the texture from that (because no direct reads on a framebuffer), then convert that captured texture to a pixmap, then get the pixels to a bytebuffer, then convert to base64.

Framebuffer https://libgdx.com/wiki/graphics/opengl-utils/frame-buffer-objects

Framebuffer conversion libgdx TextureRegion to Pixmap

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM