[vtkusers] a question about save vtkRenderWindow as JPEG file...

Wenlong Wang scc.wwl at gmail.com
Wed Oct 26 11:03:54 EDT 2011


Do you mean you want to save a screenshot?

2011/10/26 steelblue <812075761 at qq.com>

> hi everyone:
>
>   i have problem about save vtkRenderWindow as JPEG file,
>   this is my code:
>
>                 vtkRenderWindow
> renWin=vtkpanel.getRenderWindow();//vtkpanel is a vtkPanel
>                 vtkWindowToImageFilter w2i =new vtkWindowToImageFilter();
>                 w2i.SetInput(renWin);
>                 w2i.Modified();
>                 vtkJPEGWriter writer =new  vtkJPEGWriter();
>                 writer.SetInput(w2i.GetOutput());
>                 writer.SetFileName("f://vtk.jpg");
>                 writer.Write();
>
>  but the result only a JPEG file that is black,total black ,,..
>
>  the problem bothered me so much,,who can give me a solution......
>  thanks so so much!!
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/a-question-about-save-vtkRenderWindow-as-JPEG-file-tp4940006p4940006.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111026/0448c715/attachment.htm>


More information about the vtkusers mailing list