---
title: "Bitmap..::.FromHdc Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_FromHdc_2_cd97b51f.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/)

# Bitmap.FromHdc Method 
 
Extracts the image data from the specified device context and creates the [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) class instance containing this image data.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Shared Function FromHdc ( _hdc As IntPtr, _rectangle As Rectangle _
) As Bitmap
```
 
```csharp
public static Bitmap FromHdc(IntPtr hdc,Rectangle rectangle
)
```
 
### Parameters
 
 - hdc
     - Type: [System.IntPtr](http://msdn2.microsoft.com/en-us/5he14kz8)
The handle to device context to get the bitmap from.

 - rectangle
     - Type: [System.Drawing.Rectangle](http://msdn2.microsoft.com/en-us/1zk39146)
The rectangle of which specifies a viewport to get the bitmap from.
 
### Return Value
The [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) class instance which contains the image data from the device context.
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
