Results 1 to 2 of 2

Thread: [RESOLVED] Dynamic line in a canvas

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Location
    San Marcos, TX
    Posts
    177

    Resolved [RESOLVED] Dynamic line in a canvas

    How can I draw a line in a canvas that starts at a specific coordinate, but ends dynamically. The line basically needs to start at a point in the canvas and just be a horizontal line that stretches in length with the dynamic length of the grid cell the canvas is located in?

    Here's some code:
    Code:
    <Canvas Grid.Row="1">
      <Line
        X1="10" Y1="8"
        X2="220" Y2="8"
        Stroke="#FFDED0D0"
        StrokeThickness="2" />
    </Canvas>
    <Canvas Grid.Column="1" Grid.Row="1">
    **the line with the dynamic length stretches along this canvas**
    </Canvas>
    <Canvas Grid.Column="2" Grid.Row="1">
      <Line
        X1="0" Y1="8"
        X2="240" Y2="8"
        Stroke="#FFDED0D0"
        StrokeThickness="2" />
    </Canvas>
    Thanks for your help!

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Location
    San Marcos, TX
    Posts
    177

    Re: Dynamic line in a canvas

    Nevermind, I just did it with an image, setting stretch to Fill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width