1 Replies - 7130 Views - Last Post: 27 June 2012 - 08:08 AM

#1 d.buckner  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 73
  • Joined: 04-December 08

positioning objects relative to other positions

Posted 26 June 2012 - 06:49 PM

I am attempting to graphically display angles, I don't know where to begin with this. I would eventually like this to be able to display an angle from user input, the problem I am having is I have 3 lines, the bottom line which will always remain the same, the angled line which will change, and the top line which will remain the same angle and length but will change starting position based on the final position of the angled line. The following is what I am starting with:

<Path x:Name="Bottom" Data="M220,204.25 L342.92554,204" Fill="#FFF9F9FF" Height="3.25" Margin="19.824,234.75,0,0" Stretch="Fill" Stroke="White" StrokeThickness="3" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Left" Width="125.926"/>
			<Path x:Name="Bend" Data="M142.62154,237.35834 L216.70325,237.42766" Fill="#FFF9F9FF" HorizontalAlignment="Left" Height="3.065" Margin="137.668,234.248,0,0" Stretch="Fill" Stroke="White" UseLayoutRounding="False" VerticalAlignment="Top" Width="75.127" StrokeThickness="3" RenderTransformOrigin="0.017000000923872,0.950999975204468">
				<Path.RenderTransform>
					<CompositeTransform TranslateX="5.055290699005127" TranslateY="0.51790362596511841" Rotation="-30"/>
				</Path.RenderTransform>
			</Path>
			<Path x:Name="Top" Data="M205.00006,201.16699 L326.1976,201.16699" Fill="#FFF9F9FF" Height="3" Margin="204,200.167,127.802,0" Stretch="Fill" Stroke="White" StrokeThickness="3" UseLayoutRounding="False" VerticalAlignment="Top"/>
		



Basically I need to understand how to permanently attach the beginning of the top line to the end of the angled line so when the angle of the bent line changes the upper line stays the same length but the starting position will depend on the finished position of the angled line, which will depend on the angle input from the user.

Is This A Good Question/Topic? 0
  • +

Replies To: positioning objects relative to other positions

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,653
  • Joined: 02-June 10

Re: positioning objects relative to other positions

Posted 27 June 2012 - 08:08 AM

I'm way out of my element here, but isn't the biggest problem here the fact that you are drawing 2 individual path objects?

Since a path can take multiple points and draw several segments in one command, wouldn't drawing a multi-point path solve the issue of making sure your segments are always connected?

If this MSDN example can draw a complex object like this in one path I would expect two straight segments to be a simple matter of providing 3 points.
http://msdn.microsof...y/ms747393.aspx
Attached Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1