Raster.toRect( x1, y1, x2, y2 )

Returns an object containing the upper-left corner (x,y) coordinates and dimmensions for the rectangle formed by the given x1,y1 and x2,y2 points.

Parameters

Name Type   Description
x1 number first point's x coordinate
y1 number first point's y coordinate
x2 number second point's x coordinate
y2 number second point's y coordinate

Returns

Type Description
object An object containing the upper-left corner (x,y) coordinates and dimmensions of the rectangle. The returned object has the following fields:
x       Rectangle's upper-left x coordinate.
y       Rectangle's upper-left y coordinate.
width   Rectangle's width
height  Rectangle's height
Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López