---
title: "BaseViewer..::.controlToWorkspaceRectangle Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_J_GraphicsMill_BaseViewer_controlToWorkspaceRectangle.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/)

# BaseViewer.controlToWorkspaceRectangle Method 
 
Translates rectangle coordinates from the control-related coordinate system to the workspace-related one.
 
**Namespace:** [GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_J_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill.AjaxControls (in Aurigma.GraphicsMill.AjaxControls.dll)
 
## Syntax
  
```
function controlToWorkspaceRectangle(rect);
```
 
### Parameters
 
 - rect
     - Type: [GraphicsMill.Rectangle](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_Rectangle.htm.md)
Rectangle coordinates in the control coordinate system.
 
### Return Value
Rectangle coordinates in the workspace coordinate system.
 
## Remarks
  
The [BitmapViewer](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_BitmapViewer.htm.md) allows to handle two coordinate systems: workspace-related and control-related and provides the controlToWorkspaceRectangle(Rectangle) method to translate the rectangle from the control-related coordinate system to the workspace-related one.
 
The workspace-related coordinate system represents logical coordinates of the image loaded in the control and allows to work with it regardless of zoom, scroll or alignment. The control-related one is used to measure parameters of standard control events (e.g. position of the mouse pointer).
 
This method corresponds to [BaseViewer.ControlToWorkspace(System.Drawing.RectangleF)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_AjaxControls_BaseViewer_ControlToWorkspace_1_a73b99d3.htm.md) server-side member.
   
## See Also

### Reference

- [BaseViewer Class](https://www.graphicsmill.com/docs/gm5/T_J_GraphicsMill_BaseViewer.htm.md)
- [GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_J_GraphicsMill.htm.md)
- [BaseViewer.workspaceToControlRectangle(Rectangle)](https://www.graphicsmill.com/docs/gm5/M_J_GraphicsMill_BaseViewer_workspaceToControlRectangle.htm.md)
