---
title: "RectangleRubberband Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_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 class represents the rectangular rubberband.
 
**Namespace:** [Aurigma.GraphicsMill.WebControls](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WebControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.WebControls (in Aurigma.GraphicsMill.WebControls.dll)
 
## Syntax
  
```
Public Class RectangleRubberband _Inherits RectangleController _Implements IRubberband, IUserInputController, IPostBackDataHandler, IPostBackEventHandler
```
 
```csharp
public class RectangleRubberband : RectangleController, IRubberband, IUserInputController, IPostBackDataHandler, IPostBackEventHandler
```
 
## Remarks
  
You can use this class to draw a rectangle on the [BitmapViewer](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_BitmapViewer.htm.md) control surface. Depending on this control properties you can resize (see [ResizeMode](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_WebControls_RectangleRubberband_ResizeMode.htm.md) property) or move (see [Movable](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_WebControls_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_Aurigma_GraphicsMill_WebControls_RectangleRubberband_Rectangle.htm.md). It will return the rectangle displayed at the [BitmapViewer](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_BitmapViewer.htm.md) control in coordinates of the bitmap 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_Aurigma_GraphicsMill_WebControls_RectangleRubberband_ResizeMode.htm.md) property. The required aspect ratio is specified with the [Ratio](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_WebControls_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_Aurigma_GraphicsMill_WebControls_RectangleRubberband_MaskVisible.htm.md) property for it.
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [System.Web.UI.Control](http://msdn2.microsoft.com/en-us/983zwx2h)
        - [System.Web.UI.WebControls.WebControl](http://msdn2.microsoft.com/en-us/k1x24e42)
            - [Aurigma.GraphicsMill.WebControls.UserInputController](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_UserInputController.htm.md)
                - [Aurigma.GraphicsMill.WebControls.RectangleController](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_RectangleController.htm.md)
                    - Aurigma.GraphicsMill.WebControls.RectangleRubberband
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
   
## See Also

### Reference

- [RectangleRubberband Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_WebControls_RectangleRubberband.htm.md)
- [Aurigma.GraphicsMill.WebControls Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WebControls.htm.md)
