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 > Avalon

Vista - Finding edge coordinates of elements

 
 
Old 01-08-2008   #1 (permalink)
Ofer


 
 

Finding edge coordinates of elements

Hello,

I'm looking for a way to find a bounding box around controls. Specifically,
i would like to find the edge points of an image xaml control
programattically (top right, bottom left).

I tried using a GeneralTransform to transform my control to its ancestor
then trying to transform a couple of different points, but that didn't work
as i don't have access to the edge points to begin with; just margins.

Is there some sort of easy way to figure out where those points are?

Thank you,
-- Ofer

My System SpecsSystem Spec
Old 01-08-2008   #2 (permalink)
Ofer


 
 

RE: Finding edge coordinates of elements

I figured it out. There's a handy method called TranslatePoint that's
inherited from UIElement. It allows you to know what a pixel point in one
control is relative to another. For me, i gave it point (0, 0) in my image
control and told it to translate that to the window.


"Ofer" wrote:
Quote:

> Hello,
>
> I'm looking for a way to find a bounding box around controls. Specifically,
> i would like to find the edge points of an image xaml control
> programattically (top right, bottom left).
>
> I tried using a GeneralTransform to transform my control to its ancestor
> then trying to transform a couple of different points, but that didn't work
> as i don't have access to the edge points to begin with; just margins.
>
> Is there some sort of easy way to figure out where those points are?
>
> Thank you,
> -- Ofer
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Store Program Coordinates .NET General
Can't delete elements in folder Recent elements Vista General
Support for Adobe photoshop elements 5 or premier elements 3 on Vista 64 bits Vista General


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