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 8143411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:07:07+00:00 2026-06-06T13:07:07+00:00

So, Basically I’m trying to draw a line between the center of 2 ellipses

  • 0

So, Basically I’m trying to draw a line between the center of 2 ellipses

And I think this should do it:

Path myPath = new Path();
myPath.Stroke = System.Windows.Media.Brushes.Black;     
myPath.StrokeThickness = 4;
myPath.HorizontalAlignment = HorizontalAlignment.Left;
myPath.VerticalAlignment = VerticalAlignment.Center;
EllipseGeometry myEllipseGeometry = new EllipseGeometry();
myEllipseGeometry.Center = new System.Windows.Point((xQuard * 10) + 100, yQuard * 10);
myEllipseGeometry.RadiusX = 2;
myEllipseGeometry.RadiusY = 2;
myPath.Data = myEllipseGeometry;
GraphPanel.Children.Add(myPath);

//if it's not the first point...
if (prevA != 0.0)
{
Path iLine = new Path();
iLine.Stroke = Brushes.Black;
iLine.StrokeThickness = 4;
iLine.HorizontalAlignment = HorizontalAlignment.Left;
myPath.VerticalAlignment = VerticalAlignment.Center;
LineGeometry iLineGeometry = new LineGeometry();

iLineGeometry.StartPoint = myEllipseGeometry.Center;

iLineGeometry.EndPoint = new System.Windows.Point(prevA, prevB);

iLine.Data = iLineGeometry;
GraphPanel.Children.Add(iLine);

}

//Set the previous point(s)
prevA = (xQuard * 10) + 100;
prevB = yQuard * 10;

Now as you can see, I’ve set the Line’s StartPoint = to the first ellipse start point

And Yet….
enter image description here

Why is the Line’s start point in the picture not the center of the point on the left?

  • 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-06T13:07:08+00:00Added an answer on June 6, 2026 at 1:07 pm

    I think you mean iLine.VerticalAlignment instead of myPath.VerticalAlignment the second time, right?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I want to convert a virtual path to an absolute path.
Basically, I have a list of delivery checkboxes one for deliver to this address
Basically, what I'm trying to create is a page of div tags, each has
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I'm attempting to add rows to a table, I need to do this
Basically what I'm trying to do is make a very simple vertical bullet projectile
Basically this function is meant to store the height value of the element that
Basically, each time I click on a graphicsview, I'd like a new QGraphicsEllipseItem to
Basically I need to be able to do this: var obj = {foo:bar}, arr
Basically I'm trying to improve on the Ghosts in a Pacman game I'm making.

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.