Scale & transform

 

http://msdn.microsoft.com/en-us/magazine/dd188700.aspx

 

I am learning this article. What I am thinking is to write something similar to Magnify in this sample.

 

For example, if user want to add a magnify to a control, it will add a mirror control to its root node. This mirror control will take a snapshot of current screen, and then use clip, transform to magnify  the control. It sounds workable, isn’t it?

 

I have encountered following issues when implementing this:

 

1.      I am using Canvas to adjust its layout.  But after setting its scale, the position is not correct any more

2.      I am using RenderTargetBitmap. However, it is disable in Silverlight.

 

I write a similar one in WPF. If any one who has any other idea to zoom the selected area, please let me know.

 

Write a Zoom control

 

Code

 

Second, adding event handler

 

Code

 

Sample to use this control:

 

            MagnifyControl magnify = new MagnifyControl();
            magnify.WireUp(RootCanvas, MainCanvas, LayoutRoot);   

 

posted @ 2009-11-23 20:15  Pang pang Xiong  阅读(433)  评论(0编辑  收藏  举报