---
title: "Bitmap..::.Draw Method (Bitmap, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, CombineMode, Single, InterpolationMode)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Draw_12_bc9ded2d.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.Draw Method (Bitmap, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, CombineMode, Single, InterpolationMode)
 
Draws current bitmap on another bitmap.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub Draw ( _destinationBitmap As Bitmap, _destinationX As Integer, _destinationY As Integer, _destinationWidth As Integer, _destinationHeight As Integer, _sourceX As Integer, _sourceY As Integer, _sourceWidth As Integer, _sourceHeight As Integer, _combine As CombineMode, _opacity As Single, _interpolationMode As InterpolationMode _
)
```
 
```csharp
public void Draw(Bitmap destinationBitmap,int destinationX,int destinationY,int destinationWidth,int destinationHeight,int sourceX,int sourceY,int sourceWidth,int sourceHeight,CombineMode combine,float opacity,InterpolationMode interpolationMode
)
```
 
### Parameters
 
 - destinationBitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
Target (destination) bitmap (on which current bitmap should be drawn).

 - destinationX
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Horizontal position of left-top corner of the destination rectangle.

 - destinationY
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Vertical position of left-top corner of the destination rectangle.

 - destinationWidth
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Width of the destination rectangle. You can pass 0 to indicate that method should calculate width automatically (see **Remarks** section for details).

 - destinationHeight
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Height of the destination rectangle. You can pass 0 to indicate that method should calculate height automatically (see **Remarks** section for details).

 - sourceX
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Horizontal position of left-top corner of the source rectangle.

 - sourceY
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Vertical position of left-top corner of the source rectangle.

 - sourceWidth
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Width of the source rectangle. You can pass 0 to indicate that method should calculate width automatically (see **Remarks** section for details).

 - sourceHeight
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Height of the source rectangle. You can pass 0 to indicate that method should calculate height automatically (see **Remarks** section for details).

 - 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
  
Pixels from source rectangle of current bitmap are drawn to destination rectangle on the target bitmap. If source rectangle dimensions differ from dimensions of destination rectangle, pixels are resized to have the same size as destination rectangle.
 
**Note** 
If pixel formats of bitmaps are different, the method may fail (for some pairs of pixel formats). So it is recommended to make sure that current bitmap pixel format is compatible with target bitmap (or, ideally, the same).
 
If you want method to calculate width and height automatically, you can pass 0 to these arguments. It will be calculated with the following way:
 
1. If both width and heigth (both for source and destination rectangles) 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 source bitmap.
 
## Examples
  
```
'Load background image
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("C:\pyramid.jpg")

'Load small image (foreground image)
Dim smallBitmap As New Aurigma.GraphicsMill.Bitmap("C:\watermark.png")

'Draw foreground image on background with transparency
smallBitmap.Draw(bitmap, 10, bitmap.Height - smallBitmap.Height - 10, _
    smallBitmap.Width, smallBitmap.Height, _
    Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 0.7F, _
    Aurigma.GraphicsMill.Transforms.InterpolationMode.HighQuality)
```
 
```csharp
//Load background image
Aurigma.GraphicsMill.Bitmap bitmap =
    new Aurigma.GraphicsMill.Bitmap(@"C:\pyramid.jpg");

//Load small image (foreground image)
Aurigma.GraphicsMill.Bitmap smallBitmap =
    new Aurigma.GraphicsMill.Bitmap(@"C:\watermark.png");

//Draw foreground image on background with transparency
smallBitmap.Draw(bitmap, 10, bitmap.Height-smallBitmap.Height-10, 
    smallBitmap.Width, smallBitmap.Height, 
    Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 0.7f, 
    Aurigma.GraphicsMill.Transforms.InterpolationMode.HighQuality);
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Draw Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Bitmap_Draw.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)

### Manual

- [Combine Modes](https://www.graphicsmill.com/docs/gm5/CombineModes.htm.md)
- [Overlaying Images](https://www.graphicsmill.com/docs/gm5/OverlayingImages.htm.md)
