Monday, July 12, 2010

Announcing Blake.NUI - a multi-touch NUI library

Almost all my free time and creative efforts recently have been focused on my book, but I've been able to put together something really cool that I think will be useful for anyone doing multi-touch natural user interface work with WPF. Actually, it's a couple really cool things packaged into one.

I'm happy to announce Blake.NUI, an open-source library for multi-touch NUI development. Blake.NUI is available under the MS-PL license at CodePlex:

It is a collection of the most useful reusable code that I have created for my own projects and for my book's code samples. It currently includes code for WPF 4 and Surface, although in the future I may add Silverlight code as well.

The library is still in undergoing changes. I may add or rearrange things, but I will document changes from version to version. Here are some of the things currently included in Blake.NUI:

  • Controls
    • ZoomCanvas - an infinite canvas control that is the heart of NaturalShow
    • CircleText - layout text along the circumference of a circle
  • Gestures
    • TapGestureTrigger - a configurable Blend Trigger that fires when the user completes a tap gesture
    • DoubleTapGestureTrigger - a configurable Blend Trigger that fires when the user completes a double tap gesture
  • TouchDevices
    • MouseTouchDevice - promotes mouse input to WPF 4 touch events
    • SurfaceTouchDevice - promotes Microsoft Surface vision system input to WPF 4 touch events
  • Common classes and utilities
    • DisplayMatrix
    • AnimateUtility and SurfaceAnimateUtility
    • ScatterMatrixHelper
    • MathUtility
    • VisualUtility
  • NaturalShow
    • Common models, views, factories, and other classes
The full NaturalShow application is not yet included, but many of the core classes are. I'm updating NaturalShow to use Blake.NUI rather than its older, internal versions of the same code.

I'm particularly excited about SurfaceTouchDevice, since with one line of code it enables you to write multi-touch applications against the WPF 4 Touch API, including the integrated touch events and manipulations, and run it on your existing Microsoft Surface devices without modification. This also means you can, with a simple project structure, target both Win7 Touch and Surface v1 with 99% of the same code base! You do have to install .NET 4 and/or Visual Studio 2010 on your Surface.

I will be celebrating the launch of Blake.NUI all this wee by posting a series of blog posts about how to use the library. In addition, you can buy the ebook edition of Multitouch on Windows until July 23rd for 35% off through this link using coupon code blake35bl. (Disclosure: if you buy after clicking this affiliate link it gives me a few extra dollars from the sale.)

I am asking as a courtesy that if you find Blake.NUI useful, particularly for commercial projects, that you buy a copy of my book, Multitouch on Windows. The coupon code provided should help. 

Please let me know what you think about Blake.NUI and whether you think you'll use it in your applications.


  1. Thank you for this excellent work. Looking forward to exploring it this week, and will also purchase your book shortly.

  2. Thanks Avesh! Please report back what you think and whether it is helpful

  3. Hi Josh, very cool package! Some of the things your offering should actually be part of a standard package. We've been working several items ourselves and I bet we're not the only ones.
    What we still need is something like the multiscaleimage from Silverlight. We've been working on something like that, but we're not quite there yet.

  4. Thanks Remco!

    I have heard of a couple people working on sharing components for Surface. Josh Santangelo has posted a few cool things on his blog:

    DeepZoom is a commonly requested Surface scenario.

    Do you have any videos online of your work?


  5. Great stuff here Josh. The SurfaceTouchDevice will definitely come in handy. Looking forward to your follow-up posts.

  6. Hi, great stuff there. Very helpful for those doing touch apps for windows. For the gestures, can i suggest to add swipe/flicks(left, right, up, down) trigger as well? For example, in the iphone, we flick on an item to delete the item. Thanks so much for this project.

  7. Thanks rainasu!

    A flick gesture shouldn't be too difficult to create, although enabling regular manipulations is probably more useful in most cases. I'll put it my TODO list.

    I don't have an iPhone, but flick to delete (or anything easy to do with a destructive result) sounds like a bad idea in general. If the action is reversible, then it would be OK.

  8. on the iphone, when u do a flick, it will prompt you with a delete button appearing on the item which gives you the option to really delete the item... therefore it's not as destructive as you have thought... cheers

  9. I already have one book of surface made by dr Neil only dedicated to surface and more explaining the SDK itself. I have to say that I was a bit upset of the content but have to take is as an approach.

    Hope to get yours soon.

    What I really whish to get for instance in behaviour for surface is all relative to fliping, ready 3d control etc.. A kind of basic UX experience animation and control for those who are not necessary designer.

  10. @linus:
    That makes sense. If the flick to enable the delete button a consistent thing across most apps? How do users first learn about the gesture?

    Thanks for the comment. Flipping SVIs is common request but it still a challenge. I've been investigating different approaches but have not finalized one I'm happy with yet. I will make sure to address that in my book and blog.


Note: Only a member of this blog may post a comment.