Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - WPG DragDeltaEventArgs.HorizontalChange

Reply
 
Old 04-27-2009   #1 (permalink)
Viv P


 
 

WPG DragDeltaEventArgs.HorizontalChange

Hi,

I have a Canvas contained within another Canvas. I'm using an adorner with
Thumbs to resize the inner canvas. In the relevant Thumbs DragDelta() I have
the usual:
adornedElement.Width = adornedElement.Width + args.HorizontalChange;
and all works as expected.
Now I want to Zoom the containing Canvas. If I use a ScaleTransform as the
RenderTransform again all is fine. But if I apply this to the LayoutTransform
instead (which is my preference) then the DeltaEventArgs.HorizontalChange
returns weird values.

As a rough example assume I am (fairly steadily) increasing the width of the
inner canvas then tracing the successive HorizontalChange values shows
something like: -8,10,-7,16,-15,19,-19,27,-28,35,-38,46,-50 etc. (These are
obviously actually double values - I've just rounded them here for
readability).

So the absolute values are continually increasing and are alternatively
negative/positive.
What causes this behaviour? What can prevent it?

Thx,
Viv


My System SpecsSystem Spec
Old 04-27-2009   #2 (permalink)
Viv P


 
 

RE: WPG DragDeltaEventArgs.HorizontalChange

I've worked out that if I need to adjust the HorizontalChange value based on
the current LayoutTransform before applying it.

But I don't really understand why this is required with a LayoutTransform
and not with a RenderTransform. A clear explanation of what is going on would
be appreciated.
Thx,
Viv
My System SpecsSystem Spec
Reply

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46