crop

crop ( string pathImageOrigine , int x , int y , int width , int height , string _pathCroppedImage ) : string

Crop an image

Example


image_path = crop("C:\\Users\\Admin\\Downloads\\image.jpg", 0, 0, 100, 100, "C:\\Users\\Admin\\Downloads\\image_cropped.jpg") 
console(image_path) // -> C:\\Users\\Admin\\Downloads\\image_cropped.jpg

Paramètres

pathImageOrigine

path of the image to crop

x

coordinate X of the part of the original image to be cut out. This is the top left corner of the crop rectangle.

y

coordinate Y of the part of the original image to be cut out. This is the top left corner of the crop rectangle.

width

Width of the cutting rectangle

height

Height of the cutting rectangle

_pathCroppedImage (optional)

Path for the cropped image. If null a temp name file in generated. PNG format is used.

Valeur de retour

Returns the path of the cropped image