---
title: "Path.GetContour Method (Bitmap, Channel, Single)"
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Path_GetContour_3_aed77fd4.htm
archived: false
applies_to:
  - product: "Graphics Mill"
    versions: ["12.1", "6.x-12.x (may differ)"]
    entity_id: "https://www.graphicsmill.com/#software-application"
---

# Path.GetContour Method (Bitmap, Channel, Single)

**Applies to:** Graphics Mill 12.1, 6.x-12.x (may differ)
 
Gets the contour of the region where the specified channel of a bitmap reaches the specified level.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public static Path GetContour(Bitmap bitmap,Channel channel,float level
)
```
 
### Parameters
 
 - bitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
A bitmap to find the contour in.

 - channel
     - Type: [Aurigma.GraphicsMill.Channel](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Channel.htm.md)
The channel to trace.

 - level
     - Type: System.Single
The level as a fraction of the largest channel value, greater than `0` and not greater than `1`.
 
### Return Value
A [Path](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Path.htm.md) object that contains one closed subpath for each outer boundary and each hole. It is empty (never `null`) when no pixel reaches the level.
 
## Remarks
  
The contour has sub-pixel accuracy. Its points are interpolated between pixel centers, so anti-aliased edges and soft masks give smooth lines. [GetAlphaContour()](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Drawing_Path_GetAlphaContour.htm.md) follows pixel edges, so its contour has steps.
 
The pixel (x, y) covers the area from x to x + 1 and from y to y + 1. Pixels outside the bitmap count as 0, so a region that touches the border is closed just outside the bitmap.
 
You can trace any channel of any pixel format except the spot ones. [Alpha](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Channel.htm.md) of a bitmap without an alpha channel is 1 everywhere. An indexed bitmap is traced in the colors and alpha of its palette.
 
All subpaths have consistent directions, so you can fill the contour with either filling rule.
 
The contours of this method and of [GetAlphaContour()](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Drawing_Path_GetAlphaContour.htm.md) are offset by half a pixel from each other. Do not mix the contours of the two methods.
 
## Examples
  
```csharp
// Trace the alpha channel at 50% with sub-pixel accuracy.
var contour = Path.GetContour(image, Channel.Alpha, 0.5f);
```
 
The contours that GetAlphaContour and GetContour return for a small image of a circle, scaled four times.
 ![The contours that GetAlphaContour and GetContour return for a small image of a circle, scaled four times.](https://www.graphicsmill.com/docs/gm/PathGetContour.png)
 
## Exceptions
  
|  Exception |  Condition |
| --- | --- |
 |  System.ArgumentNullException |  The bitmap is `null`. |
 |  System.ArgumentOutOfRangeException |  The channel is not defined, or the level is out of range. |
   
## See Also

### Reference

- [Path Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Path.htm.md)
- [GetContour Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Drawing_Path_GetContour.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)

### Manual

- [Working with Paths](https://www.graphicsmill.com/docs/gm/working-with-path.htm.md)
