How Simple is That?

So how simple can you get?

Let's take a Photoshop file. Resize it so it fits within a 200 pixel square, put a frame round it and then save it out as a JPEG.

XImage image = XImage.FromFile(@"c:\pic.psd");
Canvas canvas = new Canvas();
canvas.Width = 200;

DrawOptions drawOpts = new DrawOptions(canvas);
drawOpts.ImageFit = DrawOptions.ImageFitType.AspectRatio;
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Draw;

canvas.DrawImage(image, drawOpts);
canvas.DrawRect(new XRect(0, 0, canvas.Width, canvas.Height), drawOpts);
canvas.SaveAs(@"c:\pic.jpg");

Setting the ImageFitType to AspectRatio scales the image to fit within the canvas, shrinking it down to an appropriate size.

For the purposes of this example we used a Photoshop file. However we could have used a PDF, an EPS, a Flash Movie or indeed any of the numerous file formats supported by ImageGlue. When you save the canvas, ImageGlue will look at the file name you have given it and work out how to format the image.

You'll note that this code could have been written in either VB or VB.NET. We want to make life easy for you - ImageGlue .NET and ImageGlue ASP use practically identical object structures - so if you have one - migrating to the other is child's play.

There are many more examples of how to use ImageGlue included with the software. Download Software...