Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8122061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:42:36+00:00 2026-06-06T05:42:36+00:00

What I want to do is find a way to know what the coordinates

  • 0

What I want to do is find a way to know what the coordinates (or any property is) of the object (image) so I can use that to code where to put an ellipse on the image. I found something that talked about how to find the location of a texbox inside a stackpanel, but when I try to use the example, it throws an exeception “TargetInvocationException was unhandled”. Maybe I just dont understand how to do reference the different objects. I know the problem is in the first Dim Statement.

In Xaml:

<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Canvas x:Name="Can1">      
        <Image x:Name="Table1" Source="c:\images\table.jpg" Width="100" Height="100" Canvas.Left="75" Canvas.Top="75" />
        <Ellipse Canvas.Left="100" Canvas.Top="100" Width="50" Height="50" Stroke="Green" StrokeThickness="4" />
    </Canvas>
</Window>

And in the code:

Class MainWindow 
    Dim gt1 As GeneralTransform = Table1.TransformToAncestor(Can1)
    Dim currentpoint As Point = gt1.Transform(New Point(0, 0))
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:42:38+00:00Added an answer on June 6, 2026 at 5:42 am

    So it should have been:

         Class MainWindow 
          Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded 
            Dim GT1 As GeneralTransform = Table1.TransformToAncestor(Can1) 
            Dim currentpoint As Point = GT1.Transform(New Point(0, 0)) 
          End Sub
         End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to find out if there is any way to block a
Could anyone find a way of improving this code a bit? I want to
I want to have a good test setup but, I can't find a way
I've been searching, but can't find a way to do this. I want the
This will probably be obvious but I can't find the best way. I want
I know why it's happening but I want to find a way around it
I want to find a way to copy one file to multiple locations simultaneously
I WANT to find out if a there is a way to check if
i want to update my sqlite database but i cannot find the way to
I want find all Saturdays and Sundays in A given month. How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.