Posts Tagged ‘Bungie Card’

Bungie Card Windows Sidebar Gadget

I suppose I’m a glutton for punishment. After writing my last two Windows Sidebar gadgets, I really meant to swear them off entirely. They’re really a pain to develop. But when my favorite video game developer, Bungie (recently of Halo fame) launched their new “Bungie Cards“, I knew I had to support them. Bungie Cards are basically like Xbox Gamer Cards, but for Halo 3. I assume when new Bungie games get released, they’ll feed into the Bungie Card system as well. My new gadget is not terribly complicated - it just displays your Halo 3 Bungie Card, in either the small or wide form.

When it’s floating, you can choose either form of the Bungie Card. It’s a little weirder when it’s docked to the sidebar. First, it scales down to fit the sidebar. Then, to see the wide version, you just click on the gadget and the wide card shows up in a flyout. It’s a nice way to keep track of things without taking up too much space. As a bonus, double-clicking on either form will take you to your Halo 3 stats page.

Like the other gadgets I’ve done, this was much more difficult to develop than it should have been. The hardest part was getting the scaled-down card for when the sidebar is docked. At first I just zoomed out the page, like I had done for my Xbox Live Gamercard gadget, but it looked absolutely awful. With the exception of newer browsers like Firefox 3 and Safari, “resizing” an image by just changing the HTML element’s dimensions has always used nearest-neighbor filtering, resulting in a truly horrid image. My first instinct was to try and use the MS-proprietary “filter” CSS property to apply a Matrix DXImageTransform that would do the scaling, since that transform has an argument that’ll get it to use bilinear filtering, which is at least decent. However, Sidebar seems to think that that is a dangerous “active content” operation and blocks it. I tweaked it around for a while before stumbling on a workaround - the BasicImage filter was not blocked, and if I applied any transform at all, the basic zoom scaling would filter the image in a more pleasant way. So right now I’m using an opacity filter set to make the image completely opaque. It’s silly, but it works, and I guess this is what I should expect at this point. Trust me, you wouldn’t have liked it before - the image on the left is the way it looks now, the image on the right is with the original smoothing method:

I actually have another Xbox-related Sidebar gadget in development which is more complex but of limited interest. I hope everyone enjoys the Bungie Card gadget - feel free to send me feedback directly, and please rate the gadget at Windows Live Gallery.