Graphics Mill provides two drawing engines. The old one is represented by the Drawing.Graphics class implemented with the Windows GDI engine. The new drawing engine is represented by the AdvancedDrawing.Graphics class. Whereas, the standard .NET drawing classes are based on the GDI+ drawing engine. This article examines the high and low points of all these engines.
The following table illustrates the comparison between GraphicsMill.AdvancedDrawing, GraphicsMill.Drawing, and System.Drawing. It may help you to decide what engine suits you best, but if you want more details, read the article in full.
Parameter | GraphicsMill. |
GraphicsMill. |
System.Drawing |
---|---|---|---|
Speed | |||
Quality | |||
Preciseness | |||
Text Drawing | |||
Alpha Blending | |||
Drawing on CMYK and Grayscale | |||
Indexed Pixel Formats | |||
Vector Graphics |
The major disadvantage of System.Drawing and GraphicsMill.AdvancedDrawing is slow performance. For some operations, they may be much slower than GraphicsMill.Drawing. In fact, System.Drawing provides a lot of features, which are often unnecessary for performance-critical applications. For example, if you draw tens of lines, shapes, or curves with System.Drawing, you may experience a delayed response for mouse events, flicker, etc. Drawing the same using GraphicsMill.Drawing is much faster, with no noticeable delays.
Quality is a strength of System.Drawing and GraphicsMill.AdvancedDrawing, since they can use the antialiasing technique, which makes the drawing look smooth and high-quality. Compare the following three images:
System.Drawing | GraphicsMill.AdvancedDrawing | GraphicsMill.Drawing |
However, there is one quality area in which System.Drawing is lacking compared to GraphicsMill.Drawing and GraphicsMill.AdvancedDrawing - text rendering. System.Drawing implements a custom text renderer, which makes the text smoother, even for small font sizes. When the font size is 8 or less, the text becomes quite hard to read, because it looks too blurry. On the other hand, GraphicsMill.Drawing and GraphicsMill.AdvancedDrawing are adaptive to the font size: it uses smoothing on big font sizes and disables it for small font sizes.
Sometimes System.Drawing paints polygons imprecisely. This means that some combinations of coordinates and drawing styles cause polygons to be drawn in areas other than the specified coordinates. This occurs very rarely, but if you want to be sure that your polygons will be drawn right where they should be, it is better to use GraphicsMill.Drawing or GraphicsMill.AdvancedDrawing.
System.Drawing and GraphicsMill.AdvancedDrawing handle the alpha channel, which allows the creating and editing of images containing transparency. The GraphicsMill.Drawing class cannot produce non-opaque drawings because it does not support alpha channels. In addition, it cannot handle bitmaps containing alpha channels. If you try to call any drawing method of GraphicsMill.Drawing for a bitmap with an alpha channel, the UnsupportedPixelFormatException exception will be thrown.
On the other hand, you can combine GraphicsMill.Drawing with the capabilities of Graphics Mill in handling alpha channels. This approach will allow you to get all the benefits of GraphicsMill.Drawing plus alpha handling. For more information about handling alpha data in Graphics Mill, see the Overlaying Images, Combine Modes, and Adding Vignette topics.
System.Drawing has less text drawing features than GraphicsMill.Drawing and GraphicsMill.AdvancedDrawing:
Only GraphicsMill.AdvancedDrawing allows you to draw on CMYK, Grayscale, formats with alpha, and extended formats (16 bits per channel).
System.Drawing and GraphicsMill.AdvancedDrawing fail with indexed bitmaps (1-bit, 4-bit, and 8-bit palette-based bitmaps), while the GraphicsMill.Drawing class enables you to draw directly on indexed bitmaps without costly conversions into 24-bit RGB and back.
Only GraphicsMill.AdvancedDrawing supports the output of vector graphics. It works with the PDF, EPS, and SVG formats.
System.Drawing and GraphicsMill.AdvancedDrawing are preferable to create high-quality imagery because they offer antialiased output and support alpha channels. GraphicsMill.Drawing works better when you need higher performance, which makes it good for real-time rendering. The possibility to work directly with indexed colors makes GraphicsMill.Drawing useful to operate with 1-bit documents (for example, faxes), web graphics (in GIF format), etc. GraphicsMill.AdvancedDrawing and GraphicsMill.Drawing provide better text rendering support. Only GraphicsMill.AdvancedDrawing supports the output of vector graphics and drawing on CMYK and Grayscale images.