---
title: "RectangleRubberband Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_RectangleRubberband.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# RectangleRubberband Class
 
This client-side class corresponds to the [RectangleRubberband](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_AjaxControls_RectangleRubberband.htm.md) server-side control and gives an opportunity to obtain access to its primary members in JavaScript.
 
**Namespace:** [GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_J_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill.AjaxControls (in Aurigma.GraphicsMill.AjaxControls.dll)
 
## Syntax
  
```
GraphicsMill.RectangleRubberband = function();

Type.createClass('GraphicsMill.RectangleRubberband',GraphicsMill.RectangleController);
```
 
## Remarks
  
This class represents the rectangular rubberband and can be used to draw a rectangle on the [BaseViewer](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_BaseViewer.htm.md) control surface. Depending on this control properties you can resize (see [resizeMode](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_resizeMode.htm.md) property) or move (see [movable](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_movable.htm.md) property) this rectangle by the mouse. This way this rubberband is extremely useful to make a rectangular selection on the bitmap.
 
To get or set the rectangle (selection) programmatically, you can use property [rectangle](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_rectangle.htm.md). It will return the rectangle displayed at the [BaseViewer](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_BaseViewer.htm.md) control in coordinates of the content associated with it.
 
The rectangle can be resized either arbitrary, or only increase or decrease the width and height equally (i.e. preserving the rectangle proportion). It is specified by the [resizeMode](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_resizeMode.htm.md) property. The required aspect ratio is specified with the [ratio](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_ratio.htm.md) property.
 
You can specify whether to display a mask which shadows the image out of the rectangle. It is convenient when you use this rubberband together with the [Crop](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Crop.htm.md) transform. Use [maskVisible](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_RectangleRubberband_maskVisible.htm.md) property for it.
 
You can attach this control to the [BaseViewer](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_BaseViewer.htm.md) using its property [BaseViewer.rubberband](https://www.graphicsmill.com/docs/gm5/P_J_GraphicsMill_BaseViewer_rubberband.htm.md) form the client-side code.
 
## Inheritance Hierarchy
  
- Sys.Component
    - Sys.UI.Control
        - [GraphicsMill.UserInputController](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_UserInputController.htm.md)
            - [GraphicsMill.RectangleController](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_RectangleController.htm.md)
                - GraphicsMill.RectangleRubberband
   
## See Also

### Reference

- [RectangleRubberband Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_J_GraphicsMill_RectangleRubberband.htm.md)
- [GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_J_GraphicsMill.htm.md)
- [Aurigma.GraphicsMill.AjaxControls.RectangleRubberband](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_AjaxControls_RectangleRubberband.htm.md)
