Содержание

getRectImage

Returns image of the specified area of the browser window.

Syntax

getRectImage = function(aLeft, aTop, aRight, aBottom);
 
getRectImage = function(aRect);

Parameters

Returned value

Examples

  1. //Load a page with image (in this case - captcha)
    loadURI('http://www.google.com/recaptcha/learnmore');
    //Get an element, containing the image
    var imageElement = getElement('img',0,['src'],['google.com/recaptcha/']);
    //Get an element rectangle
    var imageRect = getElementRect(imageElement);
    //Get the image of the rectangle area
    var image = getRectImage(imageRect);
    //Deduce to the log  the color of image pixel  with coordinates (10,10)
    log(image.pixels[10][10]);