1 September 2005

Gdi Plus


I have always been surprised at the state of affairs of any graphics api, but perhaps it is because I was spoiled in the early 1980's, by the fine work done by Bill Atkinson with the Macintosh Quickdraw.  It was perhaps that Atkinson worked more independently than his successors, that his work was better thought out, more consistent, elegant and well documented that it in many respects is better than what we have today.  I recall with early windows 32 bit api's they had largely borrowed form QuickDraw, filling in many of QuickDraw's shortcomings with novel ideas of their own.  The problem was, and even today still is with GDI plus enhancement, that for every shortcoming that is corrected, new and obvious inconsistencies, mistakes, misdirections, and just plain slop are introduced.  I was recently asked to show a machine vision expert and  mathlab level programmer how to throw some bits and bytes / pixels on the screen.  Not having done this in four years it was a painful experience, just to re figure what was the proper way to access the pixmap.  Of all the interfaces what was the one that really worked, while the others were just for this application or these conditions or dead ends when somebody started to generalize functionality and then just gave up.  I left my friend with an example and many bytes, bits, code fragments and spare parts lying around like some cluttered and dirty old automobile garage.  Then a couple of months later I happened across the latest Microsoft improvement called GDIplus.  How come I couldn't find this in the help system when I was in their developer environment before?


For the windows Vis.Net, lookup gdiplus, the big differences are


The following very quick Windows example shows
This example is almost 1K lines of code.  All but perhaps near 100 are the MFC auto generated.
Development environment Microsoft Visual C++.net  V7.1, but it would be pretty trivial to port it to earlier versions.
Download Project, source (~50kb)


Example of GDI plus tool kit