2012-06-27 3 views
2

그래서, 내가 생각 기본적으로 내가이 타원라인 모양 및 Shananagins

의 중심 사이의 선을 그리려고 노력 그리고있어이 그것을 수행해야합니다

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; 

을 이제 당신이 할 수 참조, 나는 점을

그리고 아직 .... 처음 시작할 타원 = 라인의 시작점을 설정 한 enter image description here

왜 그림의 선 시작점이 왼쪽에있는 점의 중심이 아닌지?

답변

3

두 번째로 myPath.VerticalAlignment 대신 iLine.VerticalAlignment을 의미한다고 생각하십니까?

+0

mg <. <............. –