---
title: "UnitConverter Class"
canonical: https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_UnitConverter.htm
product: "Graphics Mill"
---

# UnitConverter Class
 
Contains methods and properties intended to convert values from one spatial units to another.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public class UnitConverter
```
 
## Remarks
  
This class provides three static methods which enables you to convert:
 
- Device-dependent units (pixels) -&gt; device-independent units (like inches, centimeters, etc). See the method [ConvertPixelsToUnits(Single, Int32, Unit)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_UnitConverter_ConvertPixelsToUnits_3_d5fc159a.htm.md).
- Device-independent units -&gt; device-dependent units. See the method [ConvertUnitsToPixels(Single, Single, Unit)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_UnitConverter_ConvertUnitsToPixels_3_1df1b0a2.htm.md).
- One device-independent units -&gt; another device-independent units. See the method [ConvertUnitsToUnits(Single, Single, Unit, Unit)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_UnitConverter_ConvertUnitsToUnits_4_11d3dc01.htm.md).

All these method require a parameter called resolution - a number of pixels in one inch (dots per pixel - DPI). Typically this parameter depends on the resolution you are going to get when printing the image (e.g. 300 or 600 DPI). Also, it can be a screen resolution (as usual, 96 DPI).
 
## Inheritance Hierarchy
  
- System.Object
    - Aurigma.GraphicsMill.UnitConverter
 
## Thread Safety
 Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
   
## See Also

### Reference

- [UnitConverter Members](https://www.graphicsmill.com/docs/gm/AllMembers_T_Aurigma_GraphicsMill_UnitConverter.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
