[vtkusers] Pan, brightness & contrast (2D).

noadi at cs.huji.ac.il noadi at cs.huji.ac.il
Tue Aug 17 06:20:08 EDT 2004


Hi.
I want to pan (without having to use the middle button of the mouse, since
I want to use outer button that I will create in a MFC dialog) a 2D picture
and to change its brightness and contrast. How can I do this without using
an imageViewer?

My code now is:
bmpReader = vtkBMPReader::New();
bmpReader->SetFileName("D:\\vtkExp\\femur1.bmp");
bmpReader->Update();
vtkImageActor* act = vtkImageActor::New();
act->SetInput(bmpReader->GetOutput());
vtkRenderer* renderer = vtkRenderer::New();
renderer->AddActor(act);

CRect rect; 

CWnd* wind = GetDlgItem(IDC_PIC);
renwin = vtkWin32OpenGLRenderWindow::New();
wind->GetClientRect(&rect); 
renwin->SetSize(rect.Width(), rect.Height());
renwin->SetParentId(wind->m_hWnd); 
::SetParent(renwin->GetWindowId(), this->m_hWnd); 
renwin->AddRenderer(renderer); 
renwin->Render();
	
	vtkRenderWindowInteractor* renwinint = vtkRenderWindowInteractor::New();
	renwinint->SetRenderWindow(renwin);
	renwinint->Initialize();


camera = vtkCamera::New();
renderer->SetActiveCamera(camera);
renderer->ResetCamera();
renderer->SetBackground(1,1,1);





--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .





More information about the vtkusers mailing list