Great WPF Applications #1: British Library Turning the Pages

I'm going to start off this series with a real blockbuster that was announced just this morning. I've been looking forward to the moment when we could reveal this application for months, as I think it's one of the most exciting applications I've ever had an involvement with.

The British Library is one of the world's leading libraries and the national library of the United Kingdom. By charter, it holds a copy of every book ever published in the UK, along with 58 million newspapers, 4.5 million maps, and 3.5 million sound recordings. They hold some of the most priceless literary treasures in existence, including the Codex Sinaiticus (one of the oldest New Testaments in existence), the Lindisfarne Gospels, one of Leonardo Da Vinci's notebooks, the first atlas of Europe by Mercator, the original illustrated manuscript Lewis Carroll's Alice's Adventures in Wonderland, Jane Austen's History of England and Mozart's musical diary.

Although most of these works are on display to the public, it's hard to interact with them. Even if you can physically visit the British Library in London, these books are kept in a dimly lit environment, with only one page on display at a time. Most of them are extremely fragile due to their age, and of course all of them are unique.

Enter a fantastic new application, developed in partnership between the British Library and Armadillo Systems. The British Library have digitized the pages of fifteen of their most valuable works and created Turning the Pages, a browser-based WPF application that allows you to interact with these books in a virtual environment from the comfort of your home. You can open a book on your desktop and by clicking on a page, physically turn it in a 3D environment. You can zoom or pan around each of the pages; the page turns themselves are created by modeling the actually deformation of different types of material (for example, a book with vellum pages is far heavier than something printed on paper, so you'll actually see the page start to collapse under its own weight). For certain books, such as the Sherborne Missal, a 15th Century prayer book that is considered by many to be the most magnificent English book from the Middle Ages to have survived the Reformation, you'll see that the gold leaf catches the light as you move the book around. Another really cool aspect of this application is that this project has reunited two of Leonardo Da Vinci's notebooks digitally: you can compare the Codex Leicester (owned by Bill Gates) and the Codex Arundel (part of the British Library's collection) side-by-side.

(Some secret shortcuts: use the mousewheel to zoom, shift+drag to rotate the book, ctrl+drag to pan around the scene. Use the settings dialog to allow the opening of multiple books simultaneously, and then right-click on the desktop to add new books to an existing scene. Be aware that adding multiple books starts to impose a considerable load on the graphics hardware, so you'll need plenty of video RAM if you want to use this feature intensively.)

It's worth just highlighting for a moment the unique value that the WPF platform brought to the table for the British Library. No other browser-based technology can support the complex 3D models and lighting that are required to produce the rich experience you see here. Direct3D itself would clearly provide the 3D power needed, but it's not easy to deploy and service an application like this. Thanks to the new HD Photo format for digital images that was introduced with Windows Vista and supported by WPF, this application achieves unparalleled compression of high-quality images, which translates into smaller downloads. You'll see lots of little WPF tricks throughout the application, including the use of vector-based animated icons, glassy effects using alpha-channel transparency, and a templatized ListBox for the menu.

Don't just take my word for it: here's what Michael Stocking, the Managing Director of Armadillo Systems, has to say about WPF:

"We've been working with the British Library for about nine years. We were looking for a way to make the book experience real. Windows Vista has allowed us to build an engine that will scale to build a true online library of thousands of books. As a developer, we've gone from a standing start to producing a pre-production application in twelve weeks. It's been amazing; the British Library are really excited about this. There’s no other way to achieve what we've done other than using Windows Vista."

You can run the application directly by going to this page. Find out more about the application at this site that describes the project in more detail. Armadillo Systems have turned this project into a toolkit, and they're now working with other libraries and museums (including the National Library of Ireland) to create similar environments tailored to their needs. They did a great job, actually - even with what WPF provides, the success of this project is a testament to their talents in getting the most out of the platform in a partial-trust environment.

Try it out - you'll enjoy it! (Make sure you have .NET Framework 3.0 or Windows Vista installed on your machine, of course.)