473,750 Members | 2,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Algorithm to Convert WPF ellipse from different definition

I am given an Ellipse in the following definition:

<Path Name="_Display2 _Ellipse2" Height="50" Width="60" Stroke="black"
StrokeThickness ="1" Fill="teal" Visibility="Vis ible">
<Path.Data>
<EllipseGeometr y Center="0,0" RadiusX="1" RadiusY="1">
<EllipseGeometr y.Transform>
<MatrixTransfor m>
<MatrixTransfor m.Matrix>
<Matrix M11="76.5" M12="0" M21="0" M22="-27"
OffsetX="370.5" OffsetY="508" />
</MatrixTransform .Matrix>
</MatrixTransform >
</EllipseGeometry .Transform>
</EllipseGeometry >
</Path.Data>
</Path>


However, my application is expecting an ellipse in a definition like
the following:

<Path Name="_Display2 _Ellipse2" Stroke="black" StrokeThickness ="1"
Fill="teal" Visibility="Vis ible" Canvas.Top="405 .5"
Canvas.Left="44 0.5" Data="M153.5,26 .5 C153.5,11.58831 2 119.24979,0.5
77,0.5 C34.750217,0.5 0.5,12.588312 0.5,27.5 C0.5,42.41169
34.750217,54.5 77,54.5 C119.24979,54.5 153.5,41.41169 153.5,26.5 z"
Height="64" Width="205" Stretch="Fill"/>

I am wondering if anyone knows of any algorithm to do the conversion.
Any help or hint is greatly appreciated.
Apr 10 '08 #1
0 1246

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
25366
by: aarklon | last post by:
Hi folks, I found an algorithm for calculating the day of the week here:- http://www.faqs.org/faqs/calendars/faq/part1/index.html in the section titled 2.5 what day of the week was 2 august 1953 I checked the algorithm it is very correct.
5
9243
by: lgeastwood | last post by:
I have tweaked the PictureBox97.mdb (Stephen Lebans <www.lebans.com>) code to nicely draw lines, rectangles and circles to the specs that I input. I'm at a loss though with trying to setup an Ellipse Drawing Function. The following code I found on Google works in VB5 and draws an ellipse shape no problem using the Circle Method. Private Sub cmdDrawEllipse_Click() Dim X As Long, Y As Long Dim ElipseWidth As Integer, ElipseHeight As...
11
8724
by: Christopher Ireland | last post by:
Hello! Using the definition for en ellipse (http://en.wikipedia.org/wiki/Ellipse) I can draw an arc of points. However, the end points of this arc do not coincide with the end points of an arc drawn with the DrawArc method, e.g. public partial class Form2 : Form { public Form2() {
2
12658
by: weird0 | last post by:
I wanted to draw an ellipse using c# with System.Drawing.Graphics. I tried out several tutorials and none of them worked and there seems to be something missing. One did execute without any errors but it did not render an ellipse on the form. I want to create an ellipse with just a new project with one form default, that is Form1. I want the draw ellipse function to be in some other class,say Shapes( user-defined) and then call it in the...
3
9807
by: illusion.admins | last post by:
I am trying to code something to tell me if a selected point is in a particular ellipse. For the ellipse I know how it was constructed (know the x,y, and width, height). But if I just check to see if the point is in the rectangle making up the ellipse wouldn't that possibly give me a false answer? Eg if the point is the upper left coordinate of the rectangle...this point is in the rectangle making up ellipse but NOT the ellipse itself. ...
1
3572
by: PankajGaur | last post by:
Hi, I need to create a Ellipse shaped user control which have folloiwng attributes: 1) The edges are smooth 2) The control shuld only be selected when click on the ellipse shape & not when click on the empty area of Client Rectangle What I have done so far: I override the OnPaintMethod as below:
8
6737
by: =?Utf-8?B?RGFu?= | last post by:
I would like to draw an ellipse on a windows form and through mouse drags stretch, rotate and relocate the ellipse. Thanks in advance - Dan
0
1377
by: =?Utf-8?B?UGFua2FqR2F1cg==?= | last post by:
Hi, I need to create a Ellipse shaped user control which have folloiwng attributes: 1) The edges are smooth 2) The control shuld only be selected when click on the ellipse shape & not when click on the empty area of Client Rectangle What I have done so far: I override the OnPaintMethod as below:
5
9694
by: Brosert | last post by:
I am writing (or trying to) a small program to draw a maze, that can then be traversed by a user. I have set up a grid of squares that can be either present (blocking the path) or not (allowing the user to navigate into that square). My first problem, is that all algorithms I can find on the net (Prim, Kruskal etc) deal with a cell having walls (or Nodes having edges/vertexes, if you prefer) - and I can't think of a way to convert my current...
0
9001
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9344
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8264
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.