---
title: "GdiGraphics..::.DrawImage Method (Bitmap, Rectangle, Rectangle, CombineMode, Single, InterpolationMode)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawImage_6_936bf27d.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/)

# GdiGraphics.DrawImage Method (Bitmap, Rectangle, Rectangle, CombineMode, Single, InterpolationMode)
 
Draws a [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) object.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub DrawImage ( _bitmap As Bitmap, _destinationRect As Rectangle, _sourceRect As Rectangle, _combine As CombineMode, _opacity As Single, _interpolationMode As InterpolationMode _
)
```
 
```csharp
public void DrawImage(Bitmap bitmap,Rectangle destinationRect,Rectangle sourceRect,CombineMode combine,float opacity,InterpolationMode interpolationMode
)
```
 
### Parameters
 
 - bitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) object you are going to draw.

 - destinationRect
     - Type: [System.Drawing.Rectangle](http://msdn2.microsoft.com/en-us/1zk39146)
The destination rectangle.

 - sourceRect
     - Type: [System.Drawing.Rectangle](http://msdn2.microsoft.com/en-us/1zk39146)
The source rectangle.

 - combine
     - Type: [Aurigma.GraphicsMill.Transforms.CombineMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_CombineMode.htm.md)
Algorithm of images blending (plain pixels copying, alpha blending, bitwise operations, etc).

 - opacity
     - Type: [System.Single](http://msdn2.microsoft.com/en-us/3www918f)
A number in range [0, 1] specifying total opacity of the image. If 0, image is completely transparent, if 1, image is completely opaque.

 - interpolationMode
     - Type: [Aurigma.GraphicsMill.Transforms.InterpolationMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_InterpolationMode.htm.md)
Algorithm of resizing. Using this parameter you can select between speed and quality of resizing.
 
## Remarks
  
Image is drawn from source rectangle on given bitmap to destination rectangle on this [GdiGraphics](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md). If source rectangle dimensions differ from dimensions of destination rectangle, it is resized to have the same size as destination rectangle.
 
**Note** 
If bitmap has pixel format which is not GDI-compatible (e.g. extended pixel formats, CMYK, etc) method will automatically create a copy converted to the [Format32bppArgb](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md). That's why you always get it drawn, but if you are going to call this method multiple times, it is recommended to convert it to some GDI-compatible format (like [Format32bppArgb](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md)) to increase the performance.
 
If you want method to calculate width and height automatically (both for source and destination rectangles) , you can pass 0 to these arguments. It will be calculated with the following way:
 
1. If both width and heigth are 0, it will take source image dimensions ([Width](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Bitmap_Width.htm.md) and [Height](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Bitmap_Height.htm.md) properties). This way no resize will be done during drawing.
2. If only one of arguments is 0, it will calculate this argument to save proportion. For example, source image is 800x600, and you pass 400 as width and 0 as height. Height will be calculated to preserve aspect ratio of the image, i.e. it will be equal to 300.

All coordinates are measured in units specified with [Unit](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_UnitConverterObject_Unit.htm.md) property of the bitmap.
   
## See Also

### Reference

- [GdiGraphics Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md)
- [DrawImage Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawImage.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)

### Manual

- [Combine Modes](https://www.graphicsmill.com/docs/gm5/CombineModes.htm.md)
