【问题标题】:Canvas lines getting clipped in windows phone app画布线在 Windows Phone 应用程序中被剪裁
【发布时间】:2013-08-08 05:03:44
【问题描述】:

我在 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"
    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>

这是结果的屏幕截图:

问题是红色、黄色和蓝色的线条似乎被剪掉了——我希望它们在水平方向上比绿色线条走得更远,它们的长度也应该不同。我无法弄清楚为什么会这样?

任何帮助将不胜感激。

【问题讨论】:

  • 用你的线条换取

标签: .net silverlight windows-phone-7 xaml windows-phone-8


【解决方案1】:

你好@rip 我检查了你的问题,我发现你做得很好,实际上 windows phoneline class 有问题,你无法制作长度超过 2700 的线我也在设备上检查过。 所以你可以做的是从第一行结束的地方再画一个..只是一个解决方法。我已经检查了它是否适用于 Windows 8 ,Wpf 一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多