I'd like to get a screenshot of a generated chart. Anybody know how to
do it?
I have tried below code. Although I could get a window in which a
chart was drawn, newimage.jpg was just a black image.
As a debugger, the bufferedImage was null object at the line marked
(*).
ChartLauncher.openChart(ChartGenerator.getChart(), new
Rectangle(0,200,400,400), "Surface");
Chart chart = ChartGenerator.getChart();
BufferedImage bufferedImage = chart.getCanvas().screenshot();
try{
file = new File("newimage.jpg");
(*) ImageIO.write((RenderedImage)bufferedImage, "jpg", file); //<--
bufferedImage is null object as a debugger.
}catch(IOException e) {
}
I could get screen shot image.
As mentioned by your post, I used a image generating code written in
the Launcher.
I really enjoy the jzy3d with WIndows PC. Great library.
But I can't run it on mac os... I'll post the problem another post...
Thanks.
On Feb 5, 2:10 am, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> Thanks :)
> If you checkout the trunk, you may look at the Launcher (http://code.google.com/p/jzy3d/source/browse/trunk/src/demos/net/masa...
> )
> I could efficiently generate an image by calling:
>
> Chart chart = SurfaceDemo.getChart(Quality.Intermediate, "swing");
> ImageIO.write(chart.screenshot(), "png", new File(fileName));
>
> I added this feature very recently so maybe it is not completely stable?
> I both tried to screenshot using an AWT and Swing canvas with success.
>
> You may try updating the project because the trunk changes often.
>
> Regards
> Martin
>
> 2010/2/4 ak <akihito.s...@gmail.com>
I guess the screenshot issue wasn't a bug. It was just my fault to use
the jzy3d library.
Machintosh problem would be a bug. At first, I post a issue as a new
post of the Google group.
On Feb 6, 7:56 pm, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> Thanks for you reply!
> That would be great to have a description of your bug on the issue list (http://code.google.com/p/jzy3d/issues/list). Please add a screenshot to
> exhibit your problem.
> That's the second time someone reports a problem with MacOS: Massimiliano
> reported a problem with the colorbar display.
>
> 2010/2/6 ak <akihito.s...@gmail.com>