View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015384VTK(No Category)public2015-03-17 14:382016-08-12 09:55
ReporterSam Fries 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version6.0.0 
Target VersionFixed in Version 
Summary0015384: Resizing vtkRenderWindow while OffScreenRendering is True makes bad output
DescriptionRunning the below script will generate output that looks like the associated vtkRenderer isn't getting resized, though when I printed out the results of ren.GetSize(), they reflected the correct size. I've attached the resized PNG output.

import vtk

win = vtk.vtkRenderWindow()
win.SetSize(300, 300)

ren = vtk.vtkRenderer()
ren.SetBackground(.5, .4, .3)

win.AddRenderer(ren)
win.SetOffScreenRendering(True)

filter = vtk.vtkWindowToImageFilter()
filter.SetInput(win)
filter.Update()

writer = vtk.vtkPNGWriter()
writer.SetInputConnection(filter.GetOutputPort())
writer.SetFileName("base.png")
writer.Write()

win.SetSize(600, 300)
filter = vtk.vtkWindowToImageFilter()
filter.SetInput(win)
filter.Update()

writer.SetInputConnection(filter.GetOutputPort())
writer.SetFileName("resized.png")
writer.Write()
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Filespng file icon resized.png [^] (1,225 bytes) 2015-03-17 14:38

 Relationships

  Notes
(0034349)
David C. Lonie (developer)
2015-04-09 15:10

What platform is this on? When I run the test on current master, the resized.png is solid brown as expected.

Also be sure to note the warning on vtkWindowToImageFilter: http://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html#details [^] That may be relevant to your issue.
(0034350)
Sam Fries (reporter)
2015-04-09 15:23

This is on OSX 10.8.5. The note indicates that I should be calling modified on the Filter, which isn't strictly necessary in the test I gave above, as I just created a new filter; that said, thanks! You just solved some issues I was having on other stuff with regards to reusing a WindowToImageFilter. I'm still getting this on whatever version of VTK we're using in UV-CDAT.
(0034354)
Joe Melnyk (reporter)
2015-04-10 12:17

I'm experiencing a variation of this issue. When I migrated from VTK 5.10 to 6.1 it came about. I previously had code that would take an actively used (and on-screen rendering) vtkWin32OpenGLRenderWindow, set it to render off-screen, change the size of it, render, then pass it into the WindowToImageFilter and then the vtkBMPWriter. It works fine except the size remains unchanged. Adding the above-mentioned Modified() call has no effect. And again, this issue didn't exist with 5.10. This is on Windows 7 and 8, developing in VS 2013. My only workaround is to delete the actively used render window, recreate it, set it to offscreen, then use it as before. This gives the user a quick black window though when the window is destroyed/recreated.
(0037374)
Kitware Robot (administrator)
2016-08-12 09:55

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-03-17 14:38 Sam Fries New Issue
2015-03-17 14:38 Sam Fries File Added: resized.png
2015-04-09 15:10 David C. Lonie Note Added: 0034349
2015-04-09 15:23 Sam Fries Note Added: 0034350
2015-04-10 12:17 Joe Melnyk Note Added: 0034354
2016-07-06 16:47 Berk Geveci Status backlog => expired
2016-08-12 09:55 Kitware Robot Note Added: 0037374
2016-08-12 09:55 Kitware Robot Status expired => closed
2016-08-12 09:55 Kitware Robot Resolution open => moved
2016-08-12 09:55 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team