[vtkusers] vtkWindowToImageFilter

Mark Wyszomierski markww at gmail.com
Tue Apr 3 13:40:24 EDT 2007


Hi,

I'm using the source from the example page. Looks like:

void CSomeClass::Screenshot(vtkRenderWindow* pRenWin)
{
    vtkWindowToImageFilter* w2i = vtkWindowToImageFilter::New();
    vtkBMPWriter* writer = vtkBMPWriter::New();
    w2i->SetInput(pRenWin);
    w2i->Update();
    writer->SetInputConnection(w2i->GetOutputPort());
    writer->SetFileName("C:\\test.bmp");
    pRenWin->Render();
    writer->Write();
}

if the render window was doing offscreen rendering, the resulting
image will be just black. If doing on screen rendering, the filter
will just capture any other windows 'on top of' the render window. I
thought this filter used to capture exactly what was in the renderer,
regardless of what other windows were on top of it, or if it was doing
offscreen rendering. I know if I revert back to the VTK release
version the same code above works fine with offscreen rendering,
probably with onscreen rendering and overlapping windows?

Thanks,
Mark




On 4/3/07, Dominik Szczerba <domi at vision.ee.ethz.ch> wrote:
> I once had a similar problem (empty screen) and if I recall properly the
> solution was to call Modified() somewhere.
> Dominik
>
> On Tuesday 03 April 2007 15:19, Mark Wyszomierski wrote:
> > Hi,
> >
> > Has anyone tried using the CVS version of vtkWindowToImageFilter? It
> > seems to produce an empty image when used. Reverting back to the
> > 'release' version 5x of VTK, the same code that uses it produces
> > correct results. Just wondering if anyone experienced the same thing
> > or any ways around it,
> >
> > Thanks,
> > Mark
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
> --
> Dominik Szczerba, PhD
> Computer Vision Lab CH-8092 Zurich
> http://www.vision.ee.ethz.ch/~domi
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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