This project is read-only.

Convert graphics to image.

Nov 3, 2013 at 11:57 AM

First of all, good work, nana library is really wonderful.

Any way to convert graphics to image ?, I'm unable to do it without doing modifications to the core.

I'm using the cpp11 version.

Thanks in advance.

Nov 3, 2013 at 9:13 PM
Edited Nov 3, 2013 at 9:13 PM
What's the purpose to convert graphics to image? saving the graphics in an image file? if so, it is not supported currently. But there is a workaround to fix the problem.
#include <nana/paint/pixel_buffer.hpp>

pixel_buffer pixbuf(graphics.handle());
pixel_rgb_t * data = pixbuf.raw_ptr(row);  // get the pixel data in line row.
then, you can write the data to an image file by yourself.

Hope this will help you.

Nov 4, 2013 at 6:47 AM

I will try this later,

Thank you.