[vtkusers] a question about save vtkRenderWindow as JPEG file...

steelblue 812075761 at qq.com
Wed Oct 26 11:54:52 EDT 2011


soory ,...
this is code:
                vtkActor actor=new vtkActor();	
		vtkCubeSource cubeSource=new vtkCubeSource();
		vtkPolyDataMapper mapper=new vtkPolyDataMapper();
		
		mapper.SetInput(cubeSource.GetOutput());
		actor.SetMapper(mapper);
		actor.GetProperty().SetColor(0.9804,0.5020,0.4471);
		
		pnlRenWin.GetRenderer().AddActor(actor);
		pnlRenWin.GetRenderer().SetBackground(0, 0, 1);
		pnlRenWin.GetRenderer().GetActiveCamera().SetPosition(4, 4, 4);

               vtkWindowToImageFilter w2i =new vtkWindowToImageFilter();		   
		 w2i.SetInput(pnlRenWin.getRenderWindow());
		 //w2i.Update();	 
		 w2i.Modified();
		 vtkJPEGWriter writer =new  vtkJPEGWriter();
		 writer.SetInput(w2i.GetOutput());
		 writer.SetFileName("f://vtk.jpg");
		 writer.Write();


--
View this message in context: http://vtk.1045678.n5.nabble.com/a-question-about-save-vtkRenderWindow-as-JPEG-file-tp4940006p4940191.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list