Click here to Skip to main content
15,902,762 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my WPF application, I am drawing polylines to indicate a mesh (triangles and quadilaterals) based on X/Y coordinates read from a file. This file contains multiple zones, and each zone contains many x/y coordinates. For each zone, I need to draw it's mesh, based on it's X/Y coordinates.

In my C# code, I am creating Polylines from a set of 4 x/y coordinates, then adding the Polyline to a single cell Grid panel to be displayed.

Zone 1's Y height is 18 feet, and with each subsequent Zone generated, the Y height will increase, up to Zone 67, which is 165 feet.

The problem is that the image displayed in the Grid is always the same. However, the X length seems to increase as it should.

Following is my code that creates the Polyline and adds it to the Grid.

C#
Polyline polyline2 = new Polyline()
{
   Stroke = System.Windows.Media.Brushes.DarkBlue,
   StrokeThickness = .8,
   SnapsToDevicePixels = true,
   HorizontalAlignment = System.Windows.HorizontalAlignment.Left,
   VerticalAlignment = System.Windows.VerticalAlignment.Bottom,
   Stretch = Stretch.Uniform
};
   
foreach (Point point in points)
{
    polyline2.Points.Add(point);
}
gridPlot.Children.Add(polyline2);


Following is my XAML code;
XML
<igDock:ContentPane x:Name="contentPanePlot2" Tag="PlotView2" Header="Plot View 2" TabHeader="Plot View 2" AllowDockingLeft="True" AllowDockingRight="True" PinButtonVisibility="Collapsed" CloseButtonVisibility="Collapsed" WindowPositionMenuVisibility="Collapsed">
    <Grid x:Name="gridPlot" Grid.Row="1" Margin="20">
        <Grid.LayoutTransform>
            <ScaleTransform ScaleY="-1"/>
        </Grid.LayoutTransform>
    </Grid>
</igDock:ContentPane>


How can I force the display to size correctly in the Y (vertical) direction?

Following are links to two images which explain the problem.
The first is Zone 1 and the second is Zone 67.

https://skydrive.live.com/#cid=474829871261F415&id=474829871261F415%21131

https://skydrive.live.com/#cid=474829871261F415&id=474829871261F415%21131
Regards
Posted
Updated 17-Jul-13 11:18am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900