Содержание

GetRectImage

Returns image of the specified area of the browser window.

Syntax

function GetRectImage(aLeft: integer; aTop: integer; aRight: integer;
  aBottom: integer): TCSImage; overload;
 
function GetRectImage(aRect: TCSRect): TCSImage; overload;

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(IntToStr(Image.Pixels[10,10]));