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

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Oct 26 11:51:28 EDT 2011


What kind of graphics card do you have ? What kind of rendering are
you doing ? Meaning that you are showing a cone in 3d but when you
capture it, you get nothing ?

And please keep the discussion on the mailing list as well.

Seb



On Wed, Oct 26, 2011 at 11:41 AM, steelPeng <812075761 at qq.com> wrote:
> Seb,,
> the result also the same ,,a all black tiff......
>
>
> ------------------ Original ------------------
> From:  "Sebastien Jourdain"<sebastien.jourdain at kitware.com>;
> Date:  Wed, Oct 26, 2011 11:33 PM
> To:  "steelPeng"<812075761 at qq.com>;
> Cc:  "vtkusers"<vtkusers at vtk.org>;
> Subject:  Re: [vtkusers] a question about save vtkRenderWindow as JPEG
> file...
>
> You can find the code here:
>
> https://github.com/Kitware/VTK/blob/master/Wrapping/Java/vtk/vtkPanel.java
>
> In the method HardCopy on line 393.
>
> Seb
>
> On Wed, Oct 26, 2011 at 11:29 AM, steelPeng <812075761 at qq.com> wrote:
>> hi,Seb,,
>> where is the code?can you tell me how to get ?
>>
>>
>> ------------------ Original ------------------
>> From:  "Sebastien Jourdain"<sebastien.jourdain at kitware.com>;
>> Date:  Wed, Oct 26, 2011 11:27 PM
>> To:  "Jothybasu Selvaraj"<jothybasu at gmail.com>;
>> Cc:  "steelblue"<812075761 at qq.com>; "vtkusers"<vtkusers at vtk.org>;
>> Subject:  Re: [vtkusers] a question about save vtkRenderWindow as JPEG
>> file...
>>
>> On the Java API of the vtkPanel, there is a hard copy or something
>> like that which do this with the tiff format.
>> Just look at the code and you should be able to replace the tiff
>> writer by the jpeg one in one of your method.
>>
>> Seb
>>
>> On Wed, Oct 26, 2011 at 11:13 AM, Jothybasu Selvaraj
>> <jothybasu at gmail.com> wrote:
>>> Can you try replacing w2i.Modified() with w2i.Update() ?
>>>
>>>
>>> Jothy
>>>
>>> On Wed, Oct 26, 2011 at 4:02 PM, steelblue <812075761 at qq.com> wrote:
>>>>
>>>> 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
>>>
>>>
>>>
>>> --
>>> Jothybasu K Selvaraj
>>> PhD Student
>>> University of Liverpool
>>> Liverpool,UK
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>



More information about the vtkusers mailing list