Windows Vista Forums

Finding edge coordinates of elements
  1. #1


    Ofer Guest

    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

  2. #2


    Ofer Guest

    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:

    > 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

Finding edge coordinates of elements problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Store Program Coordinates Derek Hart .NET General 2 25 Nov 2008
Can't delete elements in folder Recent elements Gudmund Liebach Nielsen Vista General 1 05 May 2008
Support for Adobe photoshop elements 5 or premier elements 3 on Vista 64 bits Sébastien DELAYRE Vista General 5 26 Mar 2007
Texture Coordinates across multiple meshes Avery Z Avalon 1 19 Oct 2006
How to get the coordinates of a FrameworkElement? Jason Dolinger Avalon 2 31 Jan 2006