Magnifier: An Interesting Discovery

I've been playing around with some of the accessibility and UI automation features in Windows Vista recently, with the view to writing a short article on the topic. En route, I came across a somewhat remarkable discovery (to me, at least).

I'm sure that most people are familiar with the Desktop Window Manager or DWM in Windows Vista (we're recording an interview for Channel 9 with Greg Schechter, one of the architects, tomorrow). You're probably aware that the role of the DWM is to composite the desktop based on in-memory buffers to which applications render themselves, as opposed to rendering directly to screen in previous Windows releases. Since the DWM controls desktop rendering, it can do clever things like showing those groovy Flip 3D effects when a user hits Win+Tab, automatically scaling windows for high-DPI displays, or displaying live thumbnails when a user hovers the mouse over a minimized window in the taskbar. Not everyone knows that the DWM does its dirty work through the unmanaged lower tiers of WPF, known as the Media Integration Layer or MIL.

Anyway, as I was saying, I was experimenting with some of the accessibility features in Windows Vista, specifically the Magnifier tool, which can be used by partially sighted users to zoom in on the area of the screen that the mouse is hovering over. Using this tool feels a little like viewing VGA 640x480 on a 24" monitor - that is to say, the pixels are up to 16x their normal size. So it's big, but it's also blocky. But I just chanced to hover the mouse over a WPF application that I had running at the time, and... wow!

Here's a screenshot so that you can see the effect (cropped, click the image to see a larger, lossless version).

In the lower window, I'm viewing a XAML sample that was created by converting the Yellowstone Map image from Adobe Illustrator using Mike Swanson's XAML exporter tool for that application. In the upper window, I have Magnifier running at 4x normal resolution. But instead of just scaling each pixel to be a 4x4 pixel square, the DWM works in concert with WPF to actually scale the original canvas to its new size. So rather than simply magnifying the existing rendered bitmap, it actually uses every pixel so that the magnified view is actually four times more detailed than the original.

I showed this to one of my customers that builds large engineering displays, and the product manager was blown away - the ability to zoom in on one part of that display without affecting the overall screen was something he considered a "killer feature" for their application. And of course, you get it free with WPF.

If you want to try this out yourself, simply click the Start menu, type Magnifier in the search box and execute it; open a WPF application, and then hover the mouse over the application. Of course, you'll need a Windows Vista machine with the DWM running (if you can't see the Aero Glass experience, then the DWM isn't running, and it won't work). I should also caution that this feature is pretty buggy in the February CTP release of Windows Vista (the most current external release at the time of writing) - it works, but you probably need to toggle the DWM on and off after enabling Magnifier and before starting the WPF application.

Anyway, I thought this was cool, and nobody I've shown this to was expecting to see this, so I figured I'd share it with you too!