Skip to content
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

Screenshot feature produces pixelated low-res image for larger windows #120

Closed
djkrose opened this issue Feb 16, 2019 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@djkrose
Copy link

djkrose commented Feb 16, 2019

Isn't the screenshot feature supposed to produce high-res images depending on the dpi setting? - Doesn't work for me.
Snoop gives me a crystal clear magnifier zoom and zooms perfectly in the preview area as well, but when I click on the screenshot icon, chose 600 dpi, it produces a pixelated mess. Looks like 96 dpi just upscaled.

For reproduction, I created a simple dummy WPF app, .Net Framework 4.6.1, with just 3 controls.
WpfApp1.zip

My WPF app: Large window, 3 controls...
wpfapp1

Perfectly zoomable in preview area
previewarea

Taking screenshot, 600 dpi ...
save

Result file:
snoopscreenshot

Looking closer into the result file ...
snoopscreenshot-zoomed

So what is happening here?
When I test with a very small window the end result looks better. Is the actual resolution somehow limited by the screen resolution (1920x1080)? But why does magnifier and preview look so good then?

Tested with Snoop 2.10.0

@batzen
Copy link
Collaborator

batzen commented Feb 16, 2019

Will have a look when i am back home. But remember that zooming in the magnifier does not zoom an image. It zooms the UI which means it's a vector graphic. When taking a screenshot it produces a pixel based image. You will never get the same zoom quality when comparing vector to pixel images.
Taking a screenshot of a single control should be possible though. Have you tried that?

@djkrose
Copy link
Author

djkrose commented Feb 16, 2019

I know, I was thinking that the screenshot feature first zooms the vector wpf according to the dpi setting, and then takes that screenshot. What else is the dpi setting otherwise for? That's even what the original contributor claims where I found the feature described first: https://qmino.wordpress.com/2010/09/20/high-res-screenshots-of-wpf-apps/

Interestingly, the screenshot feature does vector zoom a bit, just not anywhere near the claimed dpi for a larger window. When "screenshotting" the radio button control only, the vector zoom is much better, but it introduces a new problem: The image gets distorted. See how the radio button is not round anymore?

radiobutton

Compare that with the tree preview:
previewradioround

My guess is: The screenshot feature tries to zoom but gets somehow limited by the actual screen size. If that's a WPF renderer limitation, the magnifier and preview seem not to be limited by it. So a solution could be to take the zoomed screenshot in multiple zoomed parts and stitch the raster image together. Similar as to how high-dpi browser screenshot tools do it (eg. Chrome -> Print full screen).

@batzen
Copy link
Collaborator

batzen commented Feb 16, 2019

Ok. That looks wrong. Will have a look in about a week.

@batzen batzen self-assigned this Apr 16, 2019
@batzen
Copy link
Collaborator

batzen commented Jul 9, 2019

So a week was a bit optimistic.
The screenshots are actually really high dpi which means the image is just create with greater dimensions.
So if you choose 600 dpi and your control has a width of 800px the image will have 5000px.
I still had no time to have a look at the distorted issue you posted.

@batzen
Copy link
Collaborator

batzen commented May 24, 2020

@djkrose i finally found some time to investigate this further and indeed the quality is way below what can be expected when increasing the DPI for the image.
The poor quality is caused by some conversion in the capture code.

@batzen batzen added the bug label May 24, 2020
@batzen batzen added this to the 3.0 milestone May 24, 2020
@djkrose
Copy link
Author

djkrose commented May 24, 2020

Glad you could find it. Thanks for investigating!

@batzen
Copy link
Collaborator

batzen commented May 24, 2020

Finally found a solution.
Using 4800 DPI (left before, right after)
image
image

Just have to do some finishing before i push the code changes.

@batzen batzen closed this as completed in df7da84 May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants