WP7 ScrollViewer内容被剪裁

时间:2012-12-27 06:45:48

标签: canvas scrollviewer clip

我在Canvas中添加ScrollViewer并设置画布剪辑如下。但内容被剪裁了。我很迷惑。请帮帮我。

public MainPage()
{
    InitializeComponent();

    for (int i = 0; i < 10; ++i)
    {
        Canvas canvas = new Canvas();
        canvas.Width = 456;
        canvas.Height = 456;
        RectangleGeometry clipRect = new RectangleGeometry();
        clipRect.Rect = new Rect(0, 0, 456, 456);
        clipRect.RadiusX = 8;                       
        clipRect.RadiusY = 8;                      
        canvas.Clip = clipRect;
        Image image = new Image();
        image.Width = 456;
        image.Height = 456;
        image.Stretch=Stretch.Fill;
        image.Source = new BitmapImage(new Uri("/ApplicationIcon.png", UriKind.Relative));
        canvas.Children.Add(image);
        scrollContent.Children.Add(canvas);
    }
}

结果:滚动一段距离后,它将被剪裁。

0 个答案:

没有答案