Screen capture is not working as expected when width and height are provided.
// working as expected
robot.screen.capture()
// NOT working as expected
robot.screen.capture(0, 0, 200, 200)
Expected Behavior
robot.screen.capture(x, y, w, h) should return the correct image.
Current Behavior
Cropped screen captures are incorrect, for example:
Steps to Reproduce (for bugs)
I would expect this test case to pass, but it is currently failing:
it('Get a cropped bitmap and make sure the colorAt works as expected', function() {
var x = 15;
var y = 35;
var w = 10;
var h = 10;
var full = robot.screen.capture();
var crop = robot.screen.capture(x, y, w, h);
// check that each pixel in the crop matches the corresponding pixel in the full screen capture
for (var i = 0; i < w; i++) {
for (var j = 0; j < h; j++) {
var fullPixelColor = full.colorAt(x + i, y + j);
var cropPixelColor = crop.colorAt(i, j);
expect(fullPixelColor).toEqual(cropPixelColor);
}
}
});
Summary
Screen capture is not working as expected when
width
andheight
are provided.Expected Behavior
robot.screen.capture(x, y, w, h)
should return the correct image.Current Behavior
Cropped screen captures are incorrect, for example:
Steps to Reproduce (for bugs)
I would expect this test case to pass, but it is currently failing:
Your Environment