GDI+
gdiplus.dll is a graphical library introduced in ~2001 by Microsoft to make two-dimensional drawing easier. It runs on top of gdi32, and besides the changes in the programming model it also adds new features such as gradient fills, anti-aliasing, more extensive image handling, etc. There are two main components of GDI+: a flat C API where the main implementation rests, and C++ wrappers that reside in the (numerous) public headers associated with GDI+. As the latter are public and built into programs compiled on Windows, Wine's gdiplus focuses on the flat API.
Microsoft's GDI+ uses mostly gdi32 blt operations to copy its rendering results onto the destination device context whereas Wine's GDI+ (written summer 2007 by Evan Stade) passes calls through to their gdi32 equivalents. The latter approach has better performance and shorter development time, but sacrifices control over finer details.
TODO
Graphics
- Drawing modes. This includes compositing mode, smoothing mode, etc. These modes are not easily implemented within the current Wine GDI+ paradigm, which is to let gdi32 do all the work, and AFAIK would require GDI+ taking rendering into its own hands and blt-ing the results, which is something we want to avoid (see introduction). These modes make gdiplus prettier but their absence generally doesn't break any programs, so this is a low priority.
Brushes
- Path gradient brushes. Currently they are just implemented as solid fills, where the color for the fill is the start-color of the gradient fill. A possible, easy improvement would be to use an average of the start and end colors as the solid color. I've noticed some gradient fills that go from the background color (usually white) to another color. Currently they are drawn as the background color, thus they do not show up at all.
- Texture brushes seem to be a bit off (forcing the source image to 256-color and limiting the size). They should probably be implemented based on an actual image object instead of a gdi texture brush. More testing is required.
Strings
- String drawing. Most formatting options are currently ignored.
- Strings aren't drawn properly with brushes that are not a solid fully-opaque color.
Images
Image rendering, and especially metafile handling (WMF, EMF, EMF+) are not really implemented. Currently there is a quick-and-dirty implementation in place with many stub functions and dependence on OLEPicture for rendering. Loading/Saving of bitmaps should probably be handled by the (currently missing from Wine) Windows Imaging Component (http://msdn.microsoft.com/en-us/library/ms735422(VS.85).aspx).
General
- Startup/shutdown functions. These are currently stubs. I'm not even sure what their purpose is in Windows; Wine's implementation doesn't need them.
Object locking. (see ObjectBusy error code)
- Unimplemented objects and functions. These are numerous.
Related DLLs
Helpful Links
Jose Roca's GDI+ documentation is an invaluable resource and much easier to use than MSDN.
The Mono project's GDI+ uses Cairo as a backend. Looking at their code can sometimes be better documentation than anything else on the web, although the details (like parameter checking) don't always precisely conform to Windows.
