Fresh Click Media

Web and Software Development

December 8, 2010
by shane
0 comments

How to create a Custom Debug Visualizer in Visual Studio

In this screencast, I talk through the process of creating a simple custom debug visualizer to view a System.Drawing.Image image.

Essentially, the visualizer is a class library that references the Microsoft.VisualStudio.DebuggerVisualizers and System.Windows.Forms assemblies. The project has a class, ImageVisualizer, that inherits the .NET framework DialogDebuggerVisualizer class, and overrides its Show method:

class ImageVisualizer : DialogDebuggerVisualizer
{
    protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
    {
        Image image = (Image)objectProvider.GetObject();
        ImageForm form = new ImageForm { DebugImage = image };
        windowService.ShowDialog(form);
    }
}

This converts the variable that’s being debugged to an Image type using the objectProvider parameter’s GetObject method call. This is then assigned to the dialog’s DebugImage property, and the dialog is shown using the windowService parameter’s ShowDialog method.

The actual dialog is very simple indeed, comprising of just a PictureBox to show the image, and a close button to, well, close the dialog.

public Image DebugImage
{
    set
    {
        this.pictureBoxImage.Image = value;
        this.pictureBoxImage.SizeMode = PictureBoxSizeMode.Zoom;
    }
    get
    {
        return this.pictureBoxImage.Image;
    }
}

The dialog class’ DebugImage property simply assigns the picture box’s Image property and zooms. I kept things simple for the screencast, but there’s no reason why the dialog couldn’t be extended to show other image properties such as image location, image type, and dimensions.

To use the visualizer, simply build the project and copy the dll to the Visualizers directory, which on my machine is:

C:Program Files (x86)Microsoft Visual Studio 10.0Common7PackagesDebuggerVisualizers

This particular path relates specifically to my machine, since I’m running 64 bit windows, and Visual Studio 10. Once the dll has been copied, it can be used on the next debug session. In the screencast, I use a simple console program example that loads an image from file. Clicking on the magnifying glass opens up the visualizer’s dialog, and the image can be seen.

October 31, 2010
by shane
2 Comments

iPhone Game Review – Cut the Rope

ZeptoLab’s ‘Cut the Rope’ is another shining example of iPhone puzzle gaming, and was riding high at the top of the App Store charts. Always a bit partial to a bit of cerebral action, I didn’t hesitate in paying the paltry 59p.

This YouTube trailer gives a good overview of what’s in store to prospective rope-cutters.

The basic idea is to guide the candy to the little green Om Nom through 100 levels of obstacles. The game features fun graphics, and some of the level design is ingenious. However, I did find some of the levels a little fiddly, and the levels were a little easy to get through, with some easy levels sandwiched between trickier ones.

Overall though, the game is great fun, though not in the same league as the perennial Angry Birds.

September 29, 2010
by shane
1 Comment

Introducing HTML5 Book Review

Introducing HTML5 Book Cover

About a year ago, it was jQuery. Now it seems to be HTML5 that’s getting everybody excited. Unfortunately, HTML5 has become something of an umbrella term for all sorts of technologies that are no part of it. No matter – there are books to help us discern the fluff from the substance.

Not long ago, I reviewed A Book Apart’s HTML5 for Web Designers; another HTML book that’s getting people excited is Introducing HTML5, co-authored by Bruce Lawson and Remy Sharp. In my review of HTML5 for Web Designers, I was probably a little too polite. Whilst I enjoyed reading it, it was too thin and didn’t cover anything in any great detail. Lawson and Sharp’s effort suggests an introduction, but is much more what you’d expect from a book on the subject.

The diplomatic view on the two books is that they reach out to different audiences, and that the abridged format of HTML5 for Web Designers is appropriate for designers wishing to get the facts without the technical detail. I’m going to stick my neck on the line here and say that Introducing HTML5 is the better book, but since I thrive on technical detail, that will come as no surprise.

The book’s dedicated website has a Chapter listing for the book, which is listed here to give you an idea of what’s covered:

  1. Introduction: why HTML5 exists
  2. Structuring a page
  3. Marking up a blog & the outlining algorithm
  4. Forms
  5. Multimedia (video, audio) markup and APIs
  6. Canvas
  7. Storage
  8. Working Offline
  9. Drag & Drop
  10. Geolocation
  11. Messages, Web Workers & Web Sockets

The website also contains a list of companion links for the book, which is a great source of information and inspiration.

The book’s aimed primarily at developers with a working knowledge of HTML and JavaScript, but I don’t see why designers shouldn’t give it a shot. The book’s well written by two authors who are both conversant with their subject matter, but also deliver it in a fun and flowing way that makes it a worthwhile purchase for anybody interested in working on a new generation of web apps.

August 23, 2010
by shane
0 comments

Color Stream – Smashing Mag’s Color tool for the iPhone

Color Stream iPhone App

I’m an avid reader of Smashing Magazine, and welcome their wide variety of blog posts on all aspects of website design and development. I was pleasantly surprised when they announced Color Steam a couple of days ago. The free app is like a version of Adobe Kuler, allowing you to create colour schemes from scratch or from snaps using your iPhone camera. I found it easy to use, and quite fun too. The only downside is that it requires iOS4, so some older iPhone users will be excluded from the experience.

You can download the Color Steam application from the usual place.