From: Mike H. <mi...@sy...> - 2006-03-03 15:29:55
|
I would like to write a function in C that creates a PNG plot using plplot and then returns a gdImagePtr representing that image. After a couple days of investigation, I can only come up with the following obvious solution: gdImagePtr im_in; FILE * outfile; outfile = fopen("output.png", "wb"); plsfile(outfile); plinit(); /* plot making code .... */ plend(); outfile = fopen("output.png", "rb"); im_in = gdImageCreateFromPng(outfile); close(outfile); return im_in; Is there a way to accomplish this result without the intermediate step of writing the image file to disk? Thanks very much, Mike |