-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
png not respecting user dims if bigger than screen (Mac) #129
Comments
@doutriaux1 do you want to look into this or should someone else? |
@aashish24 apparently there's nothing to do about it, short of re-running the pipeline on the bg=1 canvas when calling png. @chaosphere2112 mentioned we can't just transfer the VTK Actor to the new backend. |
@doutriaux1 not sure if understand it correctly.
For OpenGL that is true (and I would think that for the rendering as well but may be not SVG). The underlying system would not let the window bigger than the window viewport. |
@aashish24 This was referencing information that you and David Lonie told me a year or two ago about my animation solution; we can't move the entire |
thanks @chaosphere2112 that makes sense. |
@doutriaux1 I think we can close it? |
@aashish24 let's at least add a warning to the user. |
@scottwittenburg @doutriaux1 This happens with master after the context2d merge as well (on linux) |
@doutriaux1 @scottwittenburg @aashish24 VTK has support for saving images with a certain magnification. That means that the window on the screen and the high resolution image should have the same ratio. The image will have higher resolution. I can add another parameter to the png function: magnification and deprecate width and height for png (issue a warning if they are used) but compute the magnification from width and height. What do you think? |
@danlipsa I'm not sure I follow this. @scottwittenburg has a fix at: https://github.com/CDAT/vcs/pull/376/files if @scottwittenburg thinks your idea is better then let's update @scottwittenburg branch with it. |
I think it makes sense for the window and the png to have the same ratio - otherwise you could get something very different in the png |
@danlipsa, again I'm not sure exactly about what you're suggesting (link to examples?) but for the logo, I think that the idea was that the user's png would NOT be stretched in any away, but fit into the width/height box defined. We could add an option to make the log fit exactly that user-defined box and stretch the image. Is that what you're suggesting? |
No. That's not for the logo, but for saving a plot as a png with higher resolution than the window |
Take a look at the example at the beginning of the issue |
@danlipsa ok it makes more sense now... Ok according to @aashish24 comments above now that we have the new opengl "actually since we are hoping to move to opengl2, this won't br an issue since if you have a vtkRenderer and you pass it to a new vtkRenderWindow it should destroy the current context objects and create new ones (typically OpenGL stuff) but i will double check on it." @danlipsa I trust your judgement. Feel free to pass a PR, I think what the user wants in the end is the capability to save the png (pdf, svg, etc...) at much higher res that the window shows. e.g window is opened with 800px wide but user wants to save with 3000px wide. |
Sounds good - I think that's the best way to fix this. I'll start working on this. |
after context2d when running (edited) script above, width of png is 8000 but height gets stuck at 1876. When running with bg=1 I DO get a png that is 8000x4000 but the picture is cramped in the corner. |
I did some work on this in December: VTK did not report the new dimensions correctly after resizing. It does now. I did not get a change to look in vcs to completely fix this. |
The text was updated successfully, but these errors were encountered: