[vtkusers] vtkImageResize doesn't resize...

Jecko90 filippo.santarelli at unicam.it
Mon May 23 13:56:41 EDT 2016


Hi!! 

I'm trying to resize all the vtkImageActors of a vtkRenderer to a fixed
width and height. 
The code snippet below in my nooby opinion should work, instead it does
nothing. 
What are the mistakes I did?

I've been stuck with this problem for days...Please help me to solve it!! 

        vtkSmartPointer<vtkProp> Prop = PropCollection->GetNextProp();
        if (Prop->IsA("vtkImageActor")) {
            vtkSmartPointer<vtkImageActor> ImageActor =
vtkImageActor::SafeDownCast(Prop);
            
            vtkSmartPointer<vtkImageResize> ImageResize =
vtkSmartPointer<vtkImageResize>::New();
            ImageResize->SetResizeMethodToOutputDimensions();
            ImageResize->SetOutputDimensions(maxWidth, maxHeight, -1);
            ImageResize->SetInputData(ImageActor->GetMapper()->GetInput());
            ImageResize->Update();
           
ImageActor->GetMapper()->SetInputConnection(ImageResize->GetOutputPort());
        }
        renderWindow->Render();



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageResize-doesn-t-resize-tp5738186.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list