Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating Thumb size in an Adorner
Message
De
29/01/2008 05:03:56
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Calculating Thumb size in an Adorner
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Divers
Thread ID:
01286488
Message ID:
01286488
Vues:
207
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
Répondre
Fil
Voir

Click here to load this message in the networking platform