---
title: "Bitmap.FromHdc Method "
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_FromHdc_2_cd97b51f.htm
product: "Graphics Mill"
---

# Bitmap.FromHdc Method 
 
Creates a [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md) from the specified device context.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public static Bitmap FromHdc(IntPtr hdc,Rectangle rect
)
```
 
### Parameters
 
 - hdc
     - Type: System.IntPtr
A handle to the device context.

 - rect
     - Type: System.Drawing.Rectangle
The rectangle that specifies a viewport to get the bitmap from.
 
### Return Value
The [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md) that this method creates.
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
