[vtkusers] Offscreen rendering beyond screen resolution with WindowToImageFilter magnification

ianl ilindsay at insigniamedical.co.uk
Thu Apr 21 04:14:11 EDT 2016


Hi, sorry for reviving an old post, but just in case anyone else has this
issue, I have a potential workaround for Windows builds.

It seems that VTK creates the offscreen window for OpenGL to draw to behind
the scenes as having a border by default. This leads to the window being
created with the WS_OVERLAPPEDWINDOW style. It turns out that Windows will
crop windows of this style to the desktop area, so the actual size of the
window will be clamped if it exceeds the desktop dimensions in either
direction. This can be verified by calling SetSize with some large values on
a bordered offscreen vtk window, then immediately calling GetSize and
checking the results.

The solution is simply to turn borders off with SetBorders(0). This results
in the window being created with the WS_POPUP style and all is ok from then
on - the window is the size you asked for.

Maybe this should be implicit for offscreen windows as this use case is
likely to be a server side rendering application running on a small desktop?

Hope that helps someone, it kept me busy for a couple of days tracking it
down!



--
View this message in context: http://vtk.1045678.n5.nabble.com/Offscreen-rendering-beyond-screen-resolution-with-WindowToImageFilter-magnification-tp5724102p5737815.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list