[vtkusers] Save vtkChartXY to PNG

Alex Malyushytskyy alexmalvtk at gmail.com
Wed Oct 24 21:33:20 EDT 2012


You can forcevtk use an offscreen rendering:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/OffScreenRendering

Alex

On Wed, Oct 24, 2012 at 6:29 AM, Jakub Poła <jakub.pola at gmail.com> wrote:
>
> Thank you for your help Jothy. This filter is working but I have to create
> renderWindow and call at least once Render() method to obtain proper output
> data from vtkWindowToImageFilter. I would like to omit render window and go
> directly from vtkChartXY to PNG ( Let  assume that there is no X11 support
> on the machine where program will work), but I suppose that it is not
> possible easily.
>
>
>
>
> On 10/24/2012 01:55 PM, Jothybasu Selvaraj wrote:
>>
>> Here you go
>>
>> vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter =
>>              vtkSmartPointer<vtkWindowToImageFilter>::New();
>>      windowToImageFilter->SetInput(this->view->GetRenderWindow());
>>      windowToImageFilter->Update();
>>
>>
>>      vtkSmartPointer<vtkPNGWriter> writer =
>>              vtkSmartPointer<vtkPNGWriter>::New();
>>      writer->SetFileName("FileName");
>>      writer->SetInput(windowToImageFilter->GetOutput());
>>      writer->Write();
>>
>> Jothy
>>
>> On Wed, Oct 24, 2012 at 12:52 PM, Jakub Poła <jakub.pola at gmail.com> wrote:
>>>
>>> Good Morning,
>>>
>>> I have question related to create charts in vtk. Is it possible to save
>>> chart as png image without creating the snapshot of window like in
>>> paraview?
>>> I would like to write a batch program which aims to analyze large data
>>> set
>>> and creates series of charts.
>>> I have vtkTable feeded by the vtkExtractArraysOverTime filter, then
>>> basing
>>> on this table I would like to create chart object which I would like save
>>> as
>>> PNG image.
>>>
>>> Thank you very much for your support.
>>> Jakub
>>>
>>> --
>>> Pozdrawiam,
>>> Jakub Poła
>>>
>>> _______________________________________________
>>> 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
>>
>>
>>
>
>
> --
> Pozdrawiam,
> Jakub Poła
>
> _______________________________________________
> 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