[vtkusers] vtkWindowToImageFilter ignores vtkBillboardTextActor3D actors from renderer

M. Jordan mjordan at live.at
Mon Feb 13 13:28:24 EST 2017


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!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170213/6ad345e3/attachment.html>


More information about the vtkusers mailing list