.net 在windows phone应用程序中剪裁画布线条
我在windows phone应用程序的画布上剪辑内容时遇到问题。下面是重现问题的页面的XAML:.net 在windows phone应用程序中剪裁画布线条,.net,silverlight,windows-phone-7,xaml,windows-phone-8,.net,Silverlight,Windows Phone 7,Xaml,Windows Phone 8,我在windows phone应用程序的画布上剪辑内容时遇到问题。下面是重现问题的页面的XAML: <phone:PhoneApplicationPage x:Class="PhoneApp1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xm
<phone:PhoneApplicationPage
x:Class="PhoneApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<Grid x:Name="LayoutRoot" >
<ScrollViewer x:Name="ChartScroller" HorizontalScrollBarVisibility="Visible" >
<Canvas x:Name="chartCanvas" Width="4000" Height="1000" >
<Line Stroke="Red" X1="0" X2="3000" Y1="100" Y2="100" />
<Line Stroke="Yellow" X1="0" X2="3500" Y1="200" Y2="200" />
<Line Stroke="Blue" X1="0" X2="4000" Y1="300" Y2="300" />
<Line Stroke="Green" X1="2800" X2="2800" Y1="0" Y2="1000" />
</Canvas>
</ScrollViewer>
</Grid>
</phone:PhoneApplicationPage>
下面是结果的屏幕截图:
问题是红、黄、蓝三条线似乎被剪断了——我希望它们在水平方向上比绿线走得更远,它们的长度也应该不同。我搞不懂为什么会这样
任何帮助都将不胜感激。hello@rip我已经检查了您的问题,我发现您做得很好,实际上windows phone的line类存在问题,您无法生成长度超过2700的线路,我也在设备上检查过。 所以你可以从第一行结束的地方再画一行。这只是一个解决办法。我已经检查了Windows 8,Wpf,一切正常。用你的行交换