源代码中包括8个源文件,它们的功能分别是:
* WebImageMaker.cs
The source code for the server control class, WebImageMaker. Also contains definitions of three enumerations – ControlMode, which keeps track of what the control is currently doing (e.g., displaying the canvas), and WebImageFormat and WebImageQuality, which are also attributes of the control and allow the developer to enforce how the final web image is created.
* IImageProvider.cs
An interface that defines the operations the control needs to perform on images. By encapsulating this, we could switch to a different image library in future. Most of the file I/O is done in here as well, because drawing APIs typically have the ability to read and write images to and from disk, and it might be unnecessarily awkward to separate out I/O operations from drawing operations.
* ImageProviderImpl.cs
An implementation of IImageProvider that uses the GDI+ libraries in System.Drawing.
* WebImageMakerImageHelper.cs
A helper class that's used to serve the images the control creates. This is separated off to optionally allow the control's generated images to be served by a different handler.
* WebImageMakerHandler.ashx
Optional HttpHandler to use if you don't want the control itself to handle the serving of its generated images.
* WebImageMaker.css
Client side stylesheet that sets the CSS attributes for the various elements rendered by the control.
* WebImageMaker_canvas.js
Client-side script that powers the user interface when the control is in Canvas mode.
* WebImageMaker_normal.js
Client-side script that helps display thumbnails for previously uploaded raw image files, when the control is not in Canvas mode.