Skip to main content

Microsoft Silverlight

RenderTransforms on ChildsRSS Feed

(0)

hammadmirza
hammadmirza

Member

Member

324 points

107 Posts

RenderTransforms on Childs

Hi, i have a drawing application, with zooming option and i have resizing and rotating controls on elements (that can be placed on drawing canvas). But when i zoom in/out the canvas zooms (OK) and the elements (OK) but the rotating and resizing controls also scale+/-. But this doesnt happen in Good drawing applications, rotating and resizing controls maintain their size no matter what is the zoom value. I got an idea to apply the reverse scale transform, when the zoom value is changed, on the rotate and resize controls. But suppose there are 100 elements on canvas, how everyone of them can be notified that "Please reverse the scale transform" If anyone has some suggestions. Thanks

http://hammadmirza.wordpress.com
http://www.idraw.co.cc
(IF YOUR PROBLEM HAS BEEN ANSWERED OR SOLVED, MARK IT AS ANSWER)

peterdungan
peterdungan

Member

Member

223 points

150 Posts

Re: RenderTransforms on Childs

Place the zoom controls outside of the canvas that you apply the transform to.

hammadmirza
hammadmirza

Member

Member

324 points

107 Posts

Re: RenderTransforms on Childs

No that is not the solution, as i will lose the zooming on the elements then!

 Actually i have a Control that handles resize/rotation, and the shapes/elements to be drawn are added into that control.

http://hammadmirza.wordpress.com
http://www.idraw.co.cc
(IF YOUR PROBLEM HAS BEEN ANSWERED OR SOLVED, MARK IT AS ANSWER)

metal
metal

Participant

Participant

1243 points

262 Posts

Re: RenderTransforms on Childs

I can see no way around looping through either the visual tree or a List of your types that you build ass they are added. 

            foreach (UIElement obj in LayoutRoot.Children) {
                if (obj is MyProject.MyImageContainer)  {
                    obj.ReverseScaling();
                }
            }

 

 

            foreach (MyImageContainer obj in MyImageContainers) {
                 obj.ReverseScaling();
            }

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities