[vtkusers] How ensure the size of an obj vtkImagereSlice?

Jose Barreto jose.de.paula at live.com
Tue Oct 27 09:24:25 EDT 2015


I could do!If someone needs done as follows.this->SuspendLayout();		// save
old values of size		int dimensaoNova[2], dimensaoAntiga[2];	
dimensaoAntiga[0] = plPanoramica->Size.Width;		dimensaoAntiga[1] =
plPanoramica->Size.Height;		// to capture the values of the current monitor
DPI		float dpiX, dpiY;		Graphics^ graphics = this->CreateGraphics();		dpiX =
graphics->DpiX;		dpiY = graphics->DpiY;		delete graphics;		// the value in
MM for X		double mmX = abs(GetImageSlice()->GetXRange()[1]);		// the value
in MM to Y		double mmY = abs(GetImageSlice()->GetYRange()[1] *
GetConnectorItkVtk()->GetOutput()->GetSpacing()[1]);		//MM * dpi / polegada	
dimensaoNova[0] = (mmX * dpiX) / 25.4;		dimensaoNova[1] = (mmY * dpiY) /
25.4;		// changes the renderWindow to the new value, remembering that my
camera this has focused on the image using ParallelProjectionOn	
GetRenderWindow()->SetSize(dimensaoNova);		// Convert a renderWindow to an
image		vtkSmartPointer renderLarge = vtkSmartPointer::New();	
renderLarge->SetInput(GetRenderer2D());		renderLarge->SetMagnification(1);	
renderLarge->Update();		// write the image		vtkSmartPointer< vtkBMPWriter>jw
= vtkSmartPointer::New();		jw->SetInputData(renderLarge->GetOutput());	
jw->SetFileName("d:/panoramica.bmp");		jw->Write();		// returns the size
values for renderwindow		GetRenderWindow()->SetSize(dimensaoAntiga);			
this->ResumeLayout();



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkusers-How-ensure-the-size-of-an-obj-vtkImagereSlice-tp5734576p5734618.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151027/cab85f16/attachment.html>


More information about the vtkusers mailing list