Convert graphics to image.

Nov 3, 2013 at 10:57 AM
Hi,

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.

Karim.
Coordinator
Nov 3, 2013 at 8:13 PM
Edited Nov 3, 2013 at 8: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.

Jinhao
Nov 4, 2013 at 5:47 AM
Ok,

I will try this later,

Thank you.

Karim.