Draws a Bitmap object.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Sub DrawImage ( _ bitmap 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 _ )
public void DrawImage( Bitmap bitmap, int destinationX, int destinationY, int destinationWidth, int destinationHeight, int sourceX, int sourceY, int sourceWidth, int sourceHeight, CombineMode combine, float opacity, InterpolationMode interpolationMode )
Type: Aurigma.GraphicsMill.Bitmap
Bitmap object you are going to draw.Type: System.Int32
Horizontal position of left-top corner of the destination rectangle.Type: System.Int32
Vertical position of left-top corner of the destination rectangle.Type: System.Int32
Width of the destination rectangle. You can pass 0 to indicate that method should calculate width automatically (see Remarks section for details).Type: System.Int32
Height of the destination rectangle. You can pass 0 to indicate that method should calculate height automatically (see Remarks section for details).Type: System.Int32
Horizontal position of left-top corner of the source rectangle.Type: System.Int32
Vertical position of left-top corner of the source rectangle.Type: System.Int32
Width of the source rectangle. You can pass 0 to indicate that method should calculate width automatically (see Remarks section for details).Type: System.Int32
Height of the source rectangle. You can pass 0 to indicate that method should calculate height automatically (see Remarks section for details).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.Image is drawn from source rectangle on given bitmap to destination rectangle on this GdiGraphics. If source rectangle 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 (both for source and destination rectangles) , you can pass 0 to these arguments. It will be calculated with the following way:
All coordinates are measured in units specified with Unit property of the bitmap.