Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating Thumb size in an Adorner
Message
From
29/01/2008 05:03:56
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Calculating Thumb size in an Adorner
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01286488
Message ID:
01286488
Views:
206
Hi,

I have a Canvas containing various nested FrameworkElements (no predefined nesting limit but in practice it should not exceed a depth of, say, four)
where each elemement may have its own RenderTransform applied.

When an Adorner is added to a nested element it, of course, inherits (not strictly the right term - but you know what I mean) the RenderTransform of its associated element - including the transforms imposed by each of the elements ancestors.

All this is fine in that the Adorners thumbs will be rotated correctly and can easily be located as required over the AdornedElement. Obviously, however, I don't want the actual thumb size to be *scaled* to the AdornedElement.

I've seen references to using the Adorner.GetDesiredTransform() but I don't see how this would help in this situation since I need to 'unscale' the thumb size all the way up to the form level.

If rotation wasn't involved I could easily work out the total scaling factor between the selected element and the 'top level' using a TranslatePoint() call. Even with rotation I suppose I could do this using trig.

But does anyone have a better suggestion ?
Regards,
Viv
Reply
Map
View

Click here to load this message in the networking platform