Delphi 2009 GDI+ Library
The Delphi 2009 GDI+ Library by Erik van Bilsen is a free library that gives Delphi developers access to GDI+, the 2D graphics API built into Microsoft Windows. GDI+ itself is part of the operating system and offers anti-aliased drawing, alpha blending, gradient brushes, advanced text output and loading and saving of common image formats, but its native interface is a flat C API that is awkward to use from Delphi. This library wraps that API in an object-oriented, Delphi-friendly layer, so developers can draw lines, shapes, text and images in their applications with much less code.
Lets Delphi developers draw anti-aliased graphics, text and images with GDI+ through a simple object-oriented API.
Features
The library offers a range of features, including:
• API design: The classes are modeled after the .NET System.Drawing namespace instead of the C++ GDI+ classes, which makes the library more high level and easier to use.
• Object interfaces: All GDI+ objects, such as graphics, pens and brushes, are implemented as object interfaces, so memory is managed automatically and objects do not have to be freed by hand.
• Exception handling: Errors are reported the Delphi way through exceptions instead of status codes that have to be checked after every call.
• Properties: Values are exposed as Delphi properties instead of separate getter and setter methods.
• Colors and simple types: Colors, points, sizes and rectangles are lightweight records with convenient constructors, predefined color constants and overloaded operators.
• Image encoders and decoders: Loading and saving images in the formats supported by GDI+, such as BMP, JPEG, PNG, GIF and TIFF, is simplified.
• GDI+ 1.1: The extensions added in GDI+ version 1.1 with Windows Vista and certain Office versions are supported.
• VCL interoperability: Optional class helpers connect the library with Delphi's TBitmap and TCanvas classes.
• Sample applications: The package contains sample programs that demonstrate GDI+ through examples taken from the Windows Platform SDK.
• DLL support: The library can also be used from code compiled into a DLL.
• Unicode: The code relies on generics and the Unicode strings introduced in Delphi 2009.
• License: The library is completely free; the license terms are in the included License.txt file, and the code is also available on SourceForge.
Conclusion
The Delphi 2009 GDI+ Library is a compact and free way to use Windows GDI+ from Delphi 2009 and later. It turns the low-level GDI+ API into an easy object-oriented layer with automatic memory management, exceptions and properties, and it comes with sample code. It does not work with Delphi 2007 and older versions, and it is no longer actively updated, but the full Pascal source code is included in the download.