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

VerticalPastingShootingStrategy locally may work wrong #20

Closed
eoff opened this issue Mar 27, 2015 · 1 comment
Closed

VerticalPastingShootingStrategy locally may work wrong #20

eoff opened this issue Mar 27, 2015 · 1 comment

Comments

@eoff
Copy link

eoff commented Mar 27, 2015

If you need to make screenshots on your local monitor (for example, laptop display) there might occur difference between

$(window).height()

and

BufferedImage baseImage = simple().getScreenshot(wd);
int h = baseImage.getHeight();

This is because high-resolution monitors (like retina displays) perform image scaling.
For example, I get following values:

$(window).height(); 728

BufferedImage baseImage = simple().getScreenshot(wd);
int h = baseImage.getHeight(); 1456

and finally this causes missing part of image when parts are combined:

for (int n = 0; n < scrollTimes; n++) {
    js.executeScript("scrollTo(0, arguments[0])", winH * n);
    waitForScrolling();
    BufferedImage part = super.getScreenshot(wd);
    graphics.drawImage(part, 0, n * winH, null);
}
@pazone
Copy link
Owner

pazone commented Mar 27, 2015

(Dublicate)Use dpr() method. You've got too good computer with retina display. And drp of your display is 2. All in all it should work

 new AShot().dpr(2)........takeScreenshot()

@pazone pazone closed this as completed Mar 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants