Day055 — display image in full screen using VTK

Jacky Tsang
1 min readNov 14, 2018

--

I want to write a cpp program that displays image in full screen using VTK. Here is my requirement:

  1. display fullscreen image
  2. no border
  3. show image in fit center fashion
  4. hide cursor
  5. no mouse interaction

And here is the final program:

Requirement 1-3:

// calculate how far the camera should be placed
double a = renderer->GetActiveCamera()->GetViewAngle();
double b = renderer->GetActiveCamera()->GetDistance();
double c = ((3840 / 2) / tan(a / 180 * pi / 2));
renderer->GetActiveCamera()->Dolly(b / c);

Requirement 4-5:

// remove all interaction
renderWindowInteractor->RemoveAllObservers();
// hide cursor
renderWindowInteractor->HideCursor();

reference website:

coming soon!!!

--

--

No responses yet