[vtkusers] vtkWindowToImageFilter ignores vtkBillboardTextActor3D actors from renderer

David Lonie david.lonie at kitware.com
Tue Feb 14 09:18:28 EST 2017


This sounds like a bug in the actor. It needs to account for the
render window scaling while drawing the text.

I don't know when we'll be able to take a look at this, but in the
meantime can you file an issue on the VTK bug tracker so we don't lose
track of it?

https://gitlab.kitware.com/vtk/vtk/issues

Thanks,
Dave

On Mon, Feb 13, 2017 at 1:28 PM, M. Jordan <mjordan at live.at> wrote:
> When I use "windowToImageFilter->SetMagnification(1)" the text is here!
>
> Is there any solution to get images with higher resolution AND text?
>
>
>
> ________________________________
> Von: vtkusers <vtkusers-bounces at vtk.org> im Auftrag von M. Jordan
> <mjordan at live.at>
> Gesendet: Montag, 13. Februar 2017 17:17
> An: vtkusers at vtk.org
> Betreff: [vtkusers] vtkWindowToImageFilter ignores vtkBillboardTextActor3D
> actors from renderer
>
>
> Hi,
>
> I use the following lines of code to save the screen to a .png file.
>
>     // set up screenshot
>     vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter =
>     vtkSmartPointer<vtkWindowToImageFilter>::New();
>     windowToImageFilter->SetInput(renderer->GetRenderWindow());
>     //set the resolution of the output image
>     windowToImageFilter->SetMagnification(Quality);
>     //also record the alpha (transparency) channel
>     windowToImageFilter->SetInputBufferTypeToRGBA();
>     // read from the back buffer
>     windowToImageFilter->ReadFrontBufferOff();
>     windowToImageFilter->Update();
>     // write image
>     vtkSmartPointer<vtkPNGWriter> writer =
>     vtkSmartPointer<vtkPNGWriter>::New();
>     QString full_path = Path + "/Screenshot_" +
> QTime::currentTime().toString().remove(":") + ".png";
>     writer->SetFileName(full_path.toStdString().c_str());
>     writer->SetInputConnection(windowToImageFilter->GetOutputPort());
>     writer->Write();
>
> Everything works great but the vtkBillboardTextActor3D actors are not part
> of the resulting image.
> (Of course I added them to the renderer and I can see the text on the
> screen!)
>
> What could be the problem?
>
> Thank you!
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list