Page 1 of 1

Resize image in PHP using System.Drawing

PostPosted: January 25th, 2012, 6:25 pm
by Jakub Misek
The sample resizes an image from file "original.jpg" to "resized.jpg". It uses System.Drawing.dll .NET assembly and Bitmap class.

Notice the configuration "app.config", where assemblies needed to be loaded into PHP context are specified within <classLibrary> section. In order to run the sample as a website, copy the configuration into your "web.config".

The sample can be compiled and debugged from Visual Studio when using Phalanger Tools, or from the command line by running attached "build.cmd".