Draws current bitmap on another bitmap.
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
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 _ )
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 )
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.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.
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:
All coordinates are measured in units specified with Unit property of the source bitmap.
'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)
//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);