Draws the specified Bitmap, using its original physical size, at the location specified by a coordinate pair.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public void DrawImage( Bitmap bitmap, int destinationX, int destinationY, CombineMode combine )
Type: Aurigma.GraphicsMill.Bitmap
The Bitmap to draw.Type: System.Int32
The x-coordinate of the upper-left corner of the drawn image.Type: System.Int32
The y-coordinate of the upper-left corner of the drawn image.The bitmap is drawn to the destination rectangle on this Graphics with dimensions equal to the dimensions of the bitmap.
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. 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) to increase the performance.
using (var bitmap = new Bitmap(@"Images\in.jpg")) using (var watermark = new Bitmap(@"Images\watermark.png")) { //Make the watermark semitransparent. watermark.Channels.ScaleAlpha(0.8F); //Watermark an image. using (var graphics = bitmap.GetGraphics()) { graphics.DrawImage(watermark, 10, bitmap.Height - watermark.Height - 40, CombineMode.Alpha); //Save the resulting image bitmap.Save(@"Images\Output\out.jpg"); } }