Do you want to see your Images/Bitmaps when you're debugging with Visual Studio?
Thursday, November 19, 2009 9:16 PM
Do you want to see those cool Images/Bitmaps when you're debugging your code? Read on to help fill the one gapping hole in Visual Studio's debugger.
When you're debugging your code and come across an Image/Bitmap, how does Visual Studio show it to you? Quick? What's the answer? You're able to see a DataSet using the DataSet Debugging Visualizer but that's not the case with Images! Why is that? Why didn't MS just provide one natively? That's one gaping hole IMHO.
HHHMMM? Ya, like THAT'S useful?! Well, that information is all good'n'dandy but what's it REALLY telling you? Look at the Size property, yup, you have an image! But really that's about all you can tell about. You can't tell what it looks like if you downloaded it from the web on the fly? You certainly can't tell if it's a photo or piece of clip art? This type of view doesn't give you a context. Let's fix that!
I have another blog which shows you how to create your own Debugging Visualizer, but today I got tired of not having one specifically for Images/Bitmaps, so very quickly I whipped one up.
The benefits to using this Image/Bitmap Debugger Visualizer are:
- clear context of the picture you're dealing with
- including IF you indeed have a picture, you'll see a message about no image if it's null/missing
- you can easily see the size of the image (KB) as well as the height and width of it
- you can quicly hit ESC to get back to your debugging session, the faster you see the bigger picture the faster you can fix the bug right?
- if you want to save the image for what ever reason, hit th File\Save As and you can save the image in multiple formats (GIF, BMP, PNG, JPG)
The solution is available as well as the one DLL file (as a zip) to download and copy to one of the following directories (depending on the version of Windows you have).
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers
Now that you can see exactly what you think (or not think HAHA) you have, it's time to grab a coffee and get coding!
Image Debugger Visualizer (as ZIP) to copy to correct location to use
PCHenry, TechTidBits: Visual Studio Debugger Visualizers are VERY cool! You gotta check this out!