|
|
IconPackager Sample
From time to time I take on the task to reconstruct the user-interface of an application that I stumble upon while scouring the internet. I redo them mostly because I want to demonstrate how the WTL programming library can help you to realize even the most complex UI, but often also because I find the product's design and visual appearance interesting, user-friendly or just compelling.
And this is a recreation of a utility recently released by StarDock: IconPackager.
StarDock is probably best known for their Windows skinning effort, such as the
WindowBlinds
application. But the company has always been at the forefront when it comes to using
bitmapped widgets.
Recall how boring buttons looked in Windows 2000; all drawn with rectangles and solid
fill. Along came StarDock and paved the way, and Microsoft eventually produced the
Windows XP Style engine.
Source codeThe main problem with having an application with a custom background (shaded in this case) is that traditional child controls in Windows do not handle transparency well at all. To approach this problem, I'm using the same trick as in the Photo Gallery sample: the child control captures the background of the parent window, and when it needs to paint itself, it starts out by filling the client area with the captured background image. This is much the same how the Windows Style engine now does things with theDrawThemeParentBackground API.
Obviously there are a few quirks, such as the need to re-capture the background whenever
the control moves or is resized, or even when the parent window is resized.
The StarDock's IconPackager gradient fill in both the window background and
the Sidebar blue shade, is actually done with a PNG bitmap rather that using APIs
such as the native
Another nasty problem is prevention of flicker. The original StarDock utility doesn't allow
the window to resize, so that usually solves a major source of flicker but with the smooth
fading animations occuring several places on the window, it becomes noticeable.
The solution is simple: just add the
This sample was designed to run on Windows XP or better. It appears to load on Windows 2000
but looks pretty ugly. That can be fixed by messing with the custom draw code (ie. supporting
the Source Code DependenciesWindows XPMicrosoft Visual Studio.NET 2008 Microsoft WTL 8.0 Library Microsoft GDI+ Download Files
Written by Bjarke Viksoe. Article submitted 10/29/2008. To the top
|
|||