[vtk-developers] PNG problem

Joachim Pouderoux joachim.pouderoux at kitware.com
Wed Jul 22 11:08:49 EDT 2015


Can you try to add windowToImageFilter->ReadFrontBufferOff(); before
calling Update()?

*Joachim Pouderoux*

*PhD, Technical Expert*
*Kitware SAS <http://www.kitware.fr>*


2015-07-22 17:07 GMT+02:00 Manole Buican <manole.buican at terrasigna.com>:

>  Hi Joachim
>
>
>
> It's a valid white file.
>
>
>
> Manole
>
>
>  ------------------------------
> *From:* Joachim Pouderoux [joachim.pouderoux at kitware.com]
> *Sent:* Wednesday, July 22, 2015 6:05 PM
> *To:* Manole Buican
> *Cc:* vtk-developers at vtk.org
> *Subject:* Re: [vtk-developers] PNG problem
>
>   Hi Manole,
>
> Is the the 2KB PNG file valid and defines an empty/all black image ?
>
>  Joachim
>
>  *Joachim Pouderoux*
>
> *PhD, Technical Expert*
> *Kitware SAS <http://www.kitware.fr>*
>
>
> 2015-07-22 16:47 GMT+02:00 Manole Buican <manole.buican at terrasigna.com>:
>
>>  Hi all,
>>
>> Code like
>>
>> void DlgResVis2D::saveTmpPicture(QString &filename)
>> {
>>         vtkNew<vtkWindowToImageFilter> windowToImageFilter;
>>         vtkWindow* pRenderWindow = (vtkWindow *)
>> m_pView->GetRenderWindow();
>>
>>         windowToImageFilter->SetInput(pRenderWindow);
>>         windowToImageFilter->SetMagnification(1);
>>         windowToImageFilter->SetInputBufferTypeToRGBA();
>>         windowToImageFilter->Update();
>>
>>         vtkSmartPointer <vtkPNGWriter> writer = vtkSmartPointer
>> <vtkPNGWriter>::New();
>>         writer->SetFileName(filename.toAscii());
>>         writer->SetInputConnection(windowToImageFilter->GetOutputPort());
>>         writer->Write();
>> }
>>
>> exports a picture in PNG on 5 computers. On the sixth computer produce
>> only a 2KB empty PNG file (no error is prompted), while on each other 5
>> computers produce 35KB PNG file with the same image.
>> Does anybody encounter the same behavior?
>>
>> Thx in advance,
>> Manole Buican
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150722/ac2b3874/attachment-0001.html>


More information about the vtk-developers mailing list