<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d13405220\x26blogName\x3dPavan+Podila\x27s+Blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://pavanpodila.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://pavanpodila.blogspot.com/\x26vt\x3d-3240902251102105728', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Monday, April 24, 2006

Rotational scroller with IScrollInfo

Ben Constable has published a set of tutorials/posts on IScrollInfo, in which he explains how one can create custom scrollers. I found these posts very interesting and decided to give it a little twist. Generally the scrollbar that you see on the right is used to scroll the content up/down. In Ben's posts, he uses the TranslateTransform to move the content up/down depending on the VerticalOffset.

I decided to replace the translation with rotation. Instead of TranslateTransform I use a RotateTransform and map the vertical offset to an angle between 0-180. Although such a rotational scroller is pretty useless, it does show a different way in which one can use the IScrollInfo interface. How about a simple dial control? We can hide the horizontal scrollbar and replace the vertical scrollbar with a custom ControlTemplate. The inner content could then be custom drawn to depict a dial.

Check out the Flash video