[vtkusers] Help: image size!!

Wu Ruoyun MRYWu at ntu.edu.sg
Mon Jun 16 21:01:02 EDT 2003


Hi

I have a renderWindow to display video and the video (640x480) fits the entire window. The following codes may help you to achieve the same thing. You need to make your renderWindow have a size of 640x480 first.

	videoImageImport = vtkImageImport::New();
	videoImageImport->SetImportVoidPointer( (void*) videoImage );
	videoImageImport->SetWholeExtent( 0, 640-1, 0, 480-1, 0, 0 );
	videoImageImport->SetDataExtentToWholeExtent();
	videoImageImport->SetDataScalarTypeToUnsignedChar();
	videoImageImport->SetNumberOfScalarComponents( 3 );
	videoImageImport->SetDataSpacing( 1, 1, 1 );
	videoImageImport->SetDataOrigin( -640/2, -480/2, 0 );

	videoImageActor = vtkImageActor::New();
	videoImageActor->SetInput(videoImageImport->GetOutput());
	videoRenderer = vtkRenderer::New();
	videoRenderer->AddActor(videoImageActor);

	videoCamera = vtkCamera::New();
	videoCamera->SetPosition( 0, 0, 500 );
	videoCamera->SetClippingRange( 1, 1000 );
	videoCamera->ComputeViewPlaneNormal();
	videoCamera->ParallelProjectionOn();
	videoCamera->SetParallelScale( 480/2 );
	videoRenderer->SetActiveCamera( videoCamera );

Best Wishes!
Ruoyun

-----Original Message-----
From: marisa aurelio [mailto:asiram00 at hotmail.com]
Sent: Tuesday, June 17, 2003 12:07 AM
To: vtkusers at public.kitware.com
Subject: [vtkusers] Help: image size!!


Hi vtkUsers,

I have an image and a renderWindow. I would like that the image would fit 
the entire renderWindow.

I've tried to capture the image size and put the dimensions on the 
dimensions of the renderWindow.

But, the image shrinks propotionate to the to the image size. It seems VTK 
has a default image viewer property, so that all images are viewed in tha 
same manner, independently of their size.

Can anybody help me????? Tell me how to break this rule???

Thanks in advance,
Marisa

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list