GdiPlus

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

  • Metafile handling (WMF, EMF, EMF+) is not really implemented.
  • TIFF files cannot be saved or loaded.
  • JPEG and GIF files cannot be saved.
  • Native gdiplus is capable of applying an arbitrary affine transform to an image, using the transform matrix of the target Graphics object. Builtin gdiplus can only stretch images vertically or horizontally.
  • Options passed in via an ImageAttributes object are ignored.

  • No support for loading or saving of image file metadata.
  • No support for loading multi-frame images. WindowsCodecs does support them; we just need gdiplus to take advantage of this capability.

  • No support for saving multi-frame images. This won't matter until we can save GIF or TIFF files, as the other formats do not support multi-frame images.
  • Native gdiplus does all drawing to Bitmap images in software. This means that an application can pass its own buffer, and rendering to the image will go to that buffer. We need the ability to draw to that memory in software rather than going through gdi32.

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.


CategoryToDo , CategoryDLLs

GdiPlus (last edited 2010-02-23 19:10:51 by VincentPovirk)