|
| 1 | +# ASPNetImage |
| 2 | + |
| 3 | +A COM Interop wrapper written in C# for the .NET 2.0 System.Drawing namespace meant as a drop-in replacement for the third-party ASPImage component by ServerObjects Inc. |
| 4 | + |
| 5 | +While attemting to perform a web server update to Windows Server 2008 for a classic ASP app, I discovered that the long-used ASPImage 2.x COM object no longer functions, exiting with a memory error. Research into the issue for a solution unearthed a handful of reports from people experiencing the same issue and no luck with customer support or locating an inexpensive, drop-in alternative. Thus this replacement was born :) |
| 6 | + |
| 7 | +The ASPNetImage component essentially exposes part of the System.Drawing namespace to classic ASP via an interop COM object using the interface outlined by ServerObjects' ASPImage 2.x component. Switching from ASPImage to ASPNetImage requires you to only register the new DLL and change the object reference in Server.CreateObject() calls in your code. No other changes are required. |
| 8 | + |
| 9 | +A debug and release build of the DLL is included in the repository, or you can compile it yourself after generating a signing key. Checkout a working copy of the source repository or you may download the current release in the Downloads section. |
| 10 | + |
| 11 | + |
| 12 | +# Implementation Details |
| 13 | +It is a work in progress and any help completing the object is appreciated. All properties and methods are stubbed out, but as of this writing, currently only a small subset of properties and methods are implemented either in part or whole. |
| 14 | + |
| 15 | + |
| 16 | +**Fully Implemented** |
| 17 | + |
| 18 | +*Properties:* |
| 19 | + |
| 20 | + * AutoClear |
| 21 | + * Expires - Always returns future date |
| 22 | + * Filename |
| 23 | + * JPEGQuality |
| 24 | + * RegisteredTo - Returns "This Organization" by default, but can be set to any string |
| 25 | + * Version - Returns last known ASPImage version with "(ASPNetImage)" appended |
| 26 | + |
| 27 | +*Methods:* |
| 28 | + |
| 29 | + * BrightenImage |
| 30 | + * ClearImage |
| 31 | + * CropImage |
| 32 | + * DarkenImage |
| 33 | + * FillRect |
| 34 | + * FlipImage |
| 35 | + * GetImageFileSize |
| 36 | + * LoadImage |
| 37 | + * Resize |
| 38 | + |
| 39 | + |
| 40 | +**Partially Implemented** |
| 41 | + |
| 42 | +*Properties:* |
| 43 | + |
| 44 | + * Error - Returns the error from LoadImage and SaveImage methods only. |
| 45 | + |
| 46 | + * ImageFormat - Only JPEG, BMP, GIF and PNG formats are supported for output |
| 47 | + |
| 48 | +*Methods:* |
| 49 | + |
| 50 | + * ResizeR - Calls the Resize method. |
| 51 | + |
| 52 | + * RotateImage - Only rotates at 90, 180 and 270 degrees clockwise |
| 53 | + |
| 54 | + * SaveImage - Saves the image, but currently only in JPEG format. |
| 55 | + |
| 56 | + |
| 57 | +**Additional Properties And Methods** |
| 58 | + |
| 59 | + * ConstrainResize - When set to true, automatically crops the image during a resize to fit the dimensions and retain the original image's aspect ratio |
| 60 | + |
| 61 | + * GetImageSize - Returns the image dimensions for the currently loaded image |
0 commit comments