leovandriel / cvplot

Graph plots, drawing, layout and windows in OpenCV
MIT License
124 stars 28 forks source link

save plot as image #18

Open rafaelmizrahi opened 2 years ago

rafaelmizrahi commented 2 years ago

Hi, is it possible to save the plot as an image. I could not find any clear example for that. thanks.

rafaelmizrahi commented 2 years ago

I see that the draw function returns a reference to a buffer. I have successfully saved it as an image. I managed so by changing view_ into public and mimicking part of the code inside Figure::show

please let me know your official answer of how to support saving plots as images.

leovandriel commented 2 years ago

Hi @rafaelmizrahi, thank you for opening an issue. I added Figure::drawFile in #27, which draws the figure on a Mat of given size and writes it as PNG. See FigureTest for an example. Is this what you were looking for?

PRIZV0 commented 1 year ago

Can we save the whole Window as image instead of single Figure?