ImageGear .NET v25.0 - Updated
constrain Method

ImageGear.Web.UI Library > ImageGear.Web.UI Namespace > Point class : constrain Method
Constrains this point to the bounds of a rectangle.
Syntax
ASP.NET Ajax Javascript (Specification) 
function constrain( 
   rectangle : Rectangle
) : (Any);
ASP.NET Ajax Javascript (Usage) 
var resultVar = instanceOfPoint.constrain(Rectangle);

Parameters

rectangle
The rectangle to which this function will constrain the point.
Remarks

The function will modify this object so that the point lies within the bounds of the specified rectangle. The resulting point will be as close as possible to the original point, while still lying inside the specified rectangle.

There are two exceptions to the defined behavior of this function: points along the bottom and right edges. Technically, a rectangle contains all the points whose x coordinate is greater than or equal to the left edge and less than the right edge and whose y coordinate is greater than or equal to the top edge and less than the bottom edge. To simplify the implementation of this function, it may select a point whose x coordinate is equal to (not less than) the right edge or whose y coordinate is equal to (not less than) the bottom edge.

See Also

Reference

Point class
Point Members