This documentation is for the old version. Go to the latest Graphics Mill docs

Bitmap.Draw Method (GdiGraphics, Single, Single, Single, Single, CombineMode, Single, InterpolationMode)

Draws current bitmap on given GdiGraphics object.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)


Visual Basic
Public Sub Draw ( _
	destinationGraphics As GdiGraphics, _
	destinationX As Single, _
	destinationY As Single, _
	destinationWidth As Single, _
	destinationHeight As Single, _
	combine As CombineMode, _
	opacity As Single, _
	interpolationMode As InterpolationMode _
public void Draw(
	GdiGraphics destinationGraphics,
	float destinationX,
	float destinationY,
	float destinationWidth,
	float destinationHeight,
	CombineMode combine,
	float opacity,
	InterpolationMode interpolationMode



Type: Aurigma.GraphicsMill.Drawing.GdiGraphics

Target GdiGraphics object (on which current bitmap should be drawn).

Type: System.Single

Horizontal position of left-top corner of the destination rectangle.

Type: System.Single

Vertical position of left-top corner of the destination rectangle.

Type: System.Single

Width of the destination rectangle. You can pass 0 to indicate that method should calculate width automatically (see Remarks section for details).

Type: System.Single

Height of the destination rectangle. You can pass 0 to indicate that method should calculate height automatically (see Remarks section for details).

Type: Aurigma.GraphicsMill.Transforms.CombineMode

Algorithm of images blending (plain pixels copying, alpha blending, bitwise operations, etc).

Type: System.Single

A number in range [0, 1] specifying total opacity of the image. If 0, image is completely transparent, if 1, image is completely opaque.

Type: Aurigma.GraphicsMill.Transforms.InterpolationMode

Algorithm of resizing. Using this parameter you can select between speed and quality of resizing.


Bitmap is drawn to destination rectangle on the given GdiGraphics object. If current bitmap dimensions differ from dimensions of destination rectangle, it is resized to have the same size as destination rectangle.


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. 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) to increase the performance.

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 are 0, it will take source image dimensions (Width and Height 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 property of the source bitmap.

See Also