System.Drawing supports a limited range of input file formats. You may wish to combine the import and export facilities of ImageGlue with those of System.Drawing for a more comprehensive approach to drawing images.

This example shows how to draw import an Adobe Photoshop file using Imageglue and then export it in JPEG format using System.Drawing.

Drawing using ImageGlue

We create our ImageGlue bitmap and draw our image onto it.


using (Image bm = Bitmap.FromFile(Server.MapPath("rez/layers2.psd"))) {

Exporting using System.Drawing

To export using System.Drawing we'll need a System.Drawing Bitmap which we can obtain using the ToSystemDrawingBitmap function. After this it's simply a matter of exporting the image as a JPG.


  using (System.Drawing.Bitmap img = Bitmap.ToSystemDrawingBitmap((Bitmap)bm)) {
    var format = System.Drawing.Imaging.ImageFormat.Jpeg;
    img.Save(Server.MapPath("ImageGlue_Import_NET_9.jpg"), format);

Input and Output

Sample input and output images are shown below.