All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.ashot.screentaker.HeadCuttingShootingStrategy Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package ru.yandex.qatools.ashot.screentaker;

import org.openqa.selenium.WebDriver;

import java.awt.image.BufferedImage;

/**
 * @author Pavel Zorin
 */

public class HeadCuttingShootingStrategy extends ShootingStrategy {

    protected int headerToCut;

    public HeadCuttingShootingStrategy(int headerToCut) {
        this.headerToCut = headerToCut;
    }

    @Override
    public BufferedImage getScreenshot(WebDriver wd) {
        BufferedImage baseImage = simple().getScreenshot(wd);
        int h = baseImage.getHeight();
        int w = baseImage.getWidth();
        return baseImage.getSubimage(0, headerToCut, w, h - headerToCut);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy