Open OriBibi opened 3 years ago
I was also thinking about storing NSVG struct data in a buffer and use that instead of an embedded SVG file in cases where I need embedded vector graphics. Here's something I came up with (storing the NSVG data in a file however): https://gist.github.com/darealshinji/b857c8690e6919888300979d950ec15d But it's messy and loading the data from the file doesn't work. Maybe you can make something out of it.
To convert the parsed svg to an raster image, an example rasterizer is availaibe in the file "nanosvgrast.h".
For a usage example, you may look to the git project TkSVG
Hope this helps, Harald
example2.c is a good starting point: https://github.com/memononen/nanosvg/blob/master/example/example2.c
After I got svg file(I hope it's ok the way I did it..) I want to convert the NSVGimage* to some buffer (like grayscale).
I dont need to show the picture, all I want is to get the image in buffer. can you help me to do that?