Day055 — display image in full screen using VTK
1 min readNov 14, 2018
I want to write a cpp program that displays image in full screen using VTK. Here is my requirement:
- display fullscreen image
- no border
- show image in fit center fashion
- hide cursor
- 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!!!