I have some images in a grid. When an image is selected I want to center in the window and scale it up. I can use the transformation matrices on the images, but I can't for the life of me figure out how to get the initial coordinates so I can compute the translation offset.
Also...is there a way to dynamically adjust z-position so that a selected image will always appear on top of other images
Thanks!

Transforming An Element...How to get initial coordinates?
FranciscoJSC
There's a couple of questions that I'd need answered to really give you a good suggestion on how to approach this. First, do you want to animate the zoom Second, should the original thumbnail of the image remain Visible while the larger version is being displayed.
Without these answers I fear I may lead you down a path that may not achieve your design goals.
HTH,
Drew
clubberx
First, there is no way simple way to change z-order. The element must be added to the child collection of the Grid at the end to make it the top most element within that Grid. What I recommend in this case is that you introduce a Rectangle that is z-order'ed above the Grid itself and is painted with a VisualBrush of the element that you wish to make appear over everything else. Then you position that element over the original Visual and perform the transition you're attempting.
As for coordinates, you need to use VisualTreeHelper's GetOffset (search the forums and newsgroups for details on how to use this) and to size the Rectangle I mentioned to meet the initial size of the elements you're going to paint it with you'll probably need to use GetContentBounds/GetDescendantBounds.
HTH,
Drew
Lita123
Thanks for the help...greatly appreciated! Yes, I need to animate the zoom and the grid of images should fade to transparency. The reason I asked about setting the position of the rectangle is that when I tried to call its setValue method I didn't see an appropriate "left" or "top" property. So now I'm working with a Canvas and it all works beautifully.
Musiconet