---
title: "Bitmap.DrawOn Method (Graphics, Rectangle, Rectangle, CombineMode, Single, ResizeInterpolationMode)"
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_DrawOn_6_887a7865.htm
product: "Graphics Mill"
---

# Bitmap.DrawOn Method (Graphics, Rectangle, Rectangle, CombineMode, Single, ResizeInterpolationMode)
 
Draws the current bitmap on a given System.Drawing.Graphics object (standard .NET class for drawing).
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public void DrawOn(Graphics destinationGraphics,Rectangle destinationRectangle,Rectangle sourceRectangle,CombineMode combine,float opacity,ResizeInterpolationMode interpolationMode
)
```
 
### Parameters
 
 - destinationGraphics
     - Type: System.Drawing.Graphics
A System.Drawing.Graphics object on which the current bitmap should be drawn.

 - destinationRectangle
     - Type: System.Drawing.Rectangle
 Rectangle structure that specifies the location and size of the drawn image.

 - sourceRectangle
     - Type: System.Drawing.Rectangle
 Rectangle structure that specifies the portion of the image object to draw.

 - combine
     - Type: [Aurigma.GraphicsMill.Transforms.CombineMode](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_CombineMode.htm.md)
The images blending algorithm (plain pixels copying, alpha blending, bitwise operations, etc).

 - opacity
     - Type: System.Single
The opacity of the image in range `[0, 1]`. If `0`, image is completely transparent, if `1`, image is completely opaque.

 - interpolationMode
     - Type: [Aurigma.GraphicsMill.Transforms.ResizeInterpolationMode](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_ResizeInterpolationMode.htm.md)
The resize algorithm. Using this parameter you can select between speed and quality of resizing.
 
## Remarks
  
The bitmap is drawn to the destination rectangle on the given System.Drawing.Graphics object with dimensions equal to the dimensions of the bitmap.
 
**Note** 
If the 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/gm/P_Aurigma_GraphicsMill_PixelFormat_Format32bppArgb.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 the bitmap to some GDI-compatible format (like [Format32bppArgb](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PixelFormat_Format32bppArgb.htm.md)) to increase the performance.
 
If you want this method to calculate width and height automatically, you can pass `0` to the corresponding arguments. The dimensions 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/gm/P_Aurigma_GraphicsMill_Bitmap_Width.htm.md) and [Height](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_Height.htm.md) properties). This way the image will not be resized during drawing.
2. If only one of arguments is `0`, it will calculate this argument to save proportion. For example, the 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 `300`.
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [DrawOn Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Bitmap_DrawOn.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)

### Manual

- [Combine Modes](https://www.graphicsmill.com/docs/gm/combine-modes.htm.md)
