Simple Conversion (System.Drawing Interop)

Interoperability Bitmap Watermark

Converts Aurigma.GraphicsMill.Bitmap to System.Drawing.Bitmap and vice versa.

Сode Snippet

// Imagine that you have a legacy application which works with System.Drawing.Bitmap,
// and you want to integrate it with Graphics Mill.
using (var gmBitmap1 = new Bitmap("Copenhagen_RGB.jpg"))
using (var sdBitmap = (System.Drawing.Bitmap)gmBitmap1)
{
    // Here we modify System.Drawing.Bitmap
    Utils.ApplyWatermark(sdBitmap);

    // If all you need is to copy pixels, just cast your System.Drawing.Bitmap
    // to Aurigma.GraphicsMill.Bitmap.
    using (var gmBitmap2 = (Bitmap)sdBitmap)
    {
        gmBitmap2.Save("SimpleConversion.jpg");
    }
}

Input

Copenhagen_RGB.jpg

Output

SimpleConversion.jpg

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog