---
title: "RectangleRubberband Class"
canonical: https://www.graphicsmill.com/docs/gmwc/T_J_GraphicsMill_RectangleRubberband.htm
archived: true
applies_to:
  - product: "Graphics Mill Web Controls"
---

**You’re viewing documentation for an outdated product.** Graphics Mill Web Controls is no longer part of Graphics Mill. For current design editing and rendering tools, see [Design Atoms .NET](https://customerscanvas.com/docs/on-premises/design-atoms-cs/), [Design Atoms JS](https://customerscanvas.com/docs/on-premises/design-atoms-js/), and [Design Editor](https://customerscanvas.com/docs/on-premises/design-editor/).

# RectangleRubberband Class

**Applies to:** Graphics Mill Web Controls · **Archived documentation**
 
This client-side class corresponds to the [RectangleRubberband](https://www.graphicsmill.com/docs/gmwc/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/gmwc/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/gmwc/T_J_GraphicsMill_BaseViewer.htm.md) control surface. Depending on this control properties you can resize (see [resizeMode](https://www.graphicsmill.com/docs/gmwc/P_J_GraphicsMill_RectangleRubberband_resizeMode.htm.md) property) or move (see [movable](https://www.graphicsmill.com/docs/gmwc/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/gmwc/P_J_GraphicsMill_RectangleRubberband_rectangle.htm.md). It will return the rectangle displayed at the [BaseViewer](https://www.graphicsmill.com/docs/gmwc/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/gmwc/P_J_GraphicsMill_RectangleRubberband_resizeMode.htm.md) property. The required aspect ratio is specified with the [ratio](https://www.graphicsmill.com/docs/gmwc/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 transform. Use [maskVisible](https://www.graphicsmill.com/docs/gmwc/P_J_GraphicsMill_RectangleRubberband_maskVisible.htm.md) property for it.
 
You can attach this control to the [BaseViewer](https://www.graphicsmill.com/docs/gmwc/T_J_GraphicsMill_BaseViewer.htm.md) using its property [BaseViewer.rubberband](https://www.graphicsmill.com/docs/gmwc/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/gmwc/T_J_GraphicsMill_UserInputController.htm.md)
            - *+* [GraphicsMill..RectangleController](https://www.graphicsmill.com/docs/gmwc/T_J_GraphicsMill_RectangleController.htm.md)
                - *+* GraphicsMill..RectangleRubberband
   
## See Also

### Reference

- [RectangleRubberband Members](https://www.graphicsmill.com/docs/gmwc/AllMembers_T_J_GraphicsMill_RectangleRubberband.htm.md)
- [GraphicsMill Namespace](https://www.graphicsmill.com/docs/gmwc/N_J_GraphicsMill.htm.md)
- [Aurigma.GraphicsMill.AjaxControls..RectangleRubberband](https://www.graphicsmill.com/docs/gmwc/T_Aurigma_GraphicsMill_AjaxControls_RectangleRubberband.htm.md)
