[vtkusers] Set Image position on vtkActor2D

Matteo sendtomatteo at yahoo.it
Wed Mar 2 10:55:55 EST 2011


Found the problem, SetPosition was needing coordinated in pixel but 
SetPosition2 in normalized format.
So with this code now it works:

             
ImageActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
             
ImageActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
             ImageActor->SetPosition(0.25,0.25);
             ImageActor->SetWidth(0.5);
             ImageActor->SetHeight(0.4);

Regards


Il 02/03/2011 14:28, Matteo ha scritto:
> Hi
> I need to display an image in a part of the screen.
> I'm using the chain:
> vtkImageImport->vtkImageMapToColors->vtkImageMapper->vtkActor2D->vtkRenderer
>
> I have set Position and Position2 of vtkActor2D to set the image box.
>
> It looks is not enough...
>
> So I set vtkImageMapper::RenderToRectangleOn() hoping for a solution, 
> but only Position2 is rightly imported, the image starts always from 
> (0,0) (any 'Position' looks ignored)
>
> [I check into vtkImageMapper.cxx and the flag RenderToRectangle is 
> never used...this is also strange...]
>
> Any help?
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110302/2ffb4b5f/attachment.htm>


More information about the vtkusers mailing list