get_image

get_image($src_path,$image_path,$x,$y,$width,$height); - get a new image - as part of the specified available since version 4.9.29

The function accepts parameters as input:

  • $src_path – path to the original image (can be relative)
  • $image_path – path to the new image(can be relative)
  • $x – x-coordinate of the beginning of the new image in the original
  • $y – y-coordinate of the beginning of the new image in the original
  • $width – width of the new image
  • $height – height of the new image

    After testing, the function returns the result of its work to the script :
  • true – completed successfully (boolean)
  • false – operation failed (boolean)

    PHP example: image->".basename(__FILE__)."
    "; //1 echo "1.Let's go to the polygon:"; echo $browser->navigate("http://humanemulator.net/poligon/image.html")."
    "; //2 echo "2.Screenshot of the src image to file:"; echo $image->screenshot_by_src("test \ test.bmp", "http://www.humanemulator.net/screenshots/02.jpg")." n"; //3 echo "3.Cut the picture from the file:"; echo $image->get_image("test \ test.bmp", "test \ part.jpg", 126,72,40,33)." n"; //4 echo "4.Let's show the result:"; echo $app->shell_execute("open", "test \ part.jpg"); //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # Start echo("
    image.xxxxxxxxx
    ") # 1 echo("1.Let's go to the polygon:") echo(browser.navigate("http://www.humanemulator.net/poligon/image.html"), "
    ") # 2 echo("2.Screenshot of the src image to file:") echo(image.screenshot_by_src("test \ test.bmp", "http://www.humanemulator.net/screenshots/02.jpg"), " ") # 3 echo("3.Cut the picture from the file:") echo(image.get_image("test \ test.bmp", "test \ part.jpg", 126,72,40,33), " ") # 4 echo("4.Let's show the result:") echo(app.shell_execute("open", "test \ part.jpg")) # end echo("

    ") # Quit app.quit()
    C# example: #region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program: XHEScript { static void Main(string [] args) { //init XHE server = "127.0.0.1:7072"; InitXHE(); //Start echo("
    image.get_image
    "); //1 step echo("1.Let's go to the polygon:"); echo(browser.navigate("http://www.humanemulator.net/poligon/image.html") + "
    "); //step 2 echo("2.Screenshot of the src image to file:"); echo(image.screenshot_by_src("test \ test.bmp", "http://www.humanemulator.net/screenshots/02.jpg") + " n"); //step 3 echo("3.Cut the picture from the file:"); echo(image.get_image("test \ test.bmp", "test \ part.jpg", 126,72,40,33) + " n"); //step 4 echo("4.Let's show the result:"); echo(app.shell_execute("open", "test \ part.jpg")); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7010"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    image.get_image
    "); //1 step echo("1.Let's go to the polygon:"); echo(browser.navigate("http://www.humanemulator.net/poligon/image.html") + "
    "); //step 2 echo("2.Screenshot of the src image to file:"); echo(image.screenshot_by_src("test \ test.bmp", "http://www.humanemulator.net/screenshots/02.jpg") + " n"); //step 3 echo("3.Cut the picture from the file:"); echo(image.get_image("test \ test.bmp", "test \ part.jpg", 126,72,40,33) + " n"); //step 4 echo("4.Let's show the result:"); echo(app.shell_execute("open", "test \ part.jpg")); //end echo("

    "); //Quit app.quit();