[vtkusers] Re: problem with fitting image into viewport

Goodwin Lawlor goodwin.lawlor at ucd.ie
Tue May 30 14:15:34 EDT 2006


Goodwin Lawlor wrote:
> Thomas Lambertz wrote:
>> Hi Goodwin,
>>
>> thx for your answer. The link is unfortuantly one of the ones i based 
>> my code on. They used a vtkActor which seemes to work fine.
>>
>> I am still not sure wether it has to do with vtkActor2D or the 
>> vtkImageMapper i used - or better the way i used them. The bug is 
>> certanly in my code.
>> Any suggestions ?
>>
>> Kind regards,
>> Tom
>>
> 
> Hi Tom,
> 
> You need to set the renWin to the same size as the image...
> 
> int dims[3];
> connector->GetOutput()->GetDimensions(dims);
> renWin->SetSize(dims[0],dims[1]);
> 
> the parallel scale should be set to half the y image dimension:
> 
> ren2->GetActiveCamera()->SetParallelScale(dims[1]/2);
> 
Make that:

ren2->GetActiveCamera()->SetParallelScale(dims[1]/2.0);




More information about the vtkusers mailing list