Pano2VR is a tool to create panoramas for QuicktimeVR or Flash. You can embed the Flash in your surface application and completly control it with multitouch by using the Pano2VR Flash Javascript API.

Unfortunatly, the only way to embed your Flash is the Shockwave ActiveX.  So we need to put it in a WindowsFormsHost wich has some side effects with Z-Order and contact detection. The WindowsFormsHost always renders on top. So contacts on our window will not be recognized. You can however use the core layer of surface and wire up a ContactTarget with the window handle of the FormsHost.

However, I used a different approach. I put a transparent(*) window on top of the window that has the windowsformshost. That window can be used to recognize the contacts. If you had any UI controls, that would need to be placed on top of the flash, that would also be the place to do it. So this would also solve the Z-Order issue.

I also put the Active X in my own usercontrol for convinience reasons. The usercontrol then supplies all the function calls for loading, paning, tilting and zooming. The functions inside the flash are called with the activex’s CallFunction method. You also need to make sure to set the “externalinterface=1” flashvar when loading the movie. Otherwise the function calls will throw a COMException.

In the overlaywindow I initialize an Affine2DManipulationProcessor to track the contacts on it’s surface. The deltas will then be used to call the Flash’s functions and thats it.

* Well, not really transparent, since then the contacts just fall throug and the contact events will not raise. But a white background with an opacity of 0.01