创建者更新后[UWP] [C#]剪辑被破坏 [英] [UWP][C#] clipping broken after Creators Update

查看:66
本文介绍了创建者更新后[UWP] [C#]剪辑被破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的App来重现这个问题:

A simple App to reproduce the issue:

xaml:

<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Name="RootElement" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Tapped="RootElement_Tapped">

    </Grid>
</Page>

xaml.cs

namespace App1
{

  /// <summary>
  /// An empty page that can be used on its own or navigated to within a Frame.
  /// </summary>
  public sealed partial class MainPage : Page
  {
    Grid grid;
    public MainPage()
    {
      this.InitializeComponent();

      grid = new Grid();
      grid.Width = 300;
      grid.Height = 300;
      grid.Background = new SolidColorBrush(Colors.MediumPurple);
      RootElement.Children.Add(grid);

      Canvas canvas = new Canvas();
      Canvas.SetLeft(canvas, -100);
      Canvas.SetTop(canvas, -100);
      canvas.Width = 400;
      canvas.Height = 400;
      grid.Children.Add(canvas);


      Action<double, double, double, double> DrawLine = (X1, Y1, X2, Y2) =>
      {
        Windows.UI.Xaml.Shapes.Line line = new Windows.UI.Xaml.Shapes.Line();
        line.Stroke = new SolidColorBrush(Windows.UI.Colors.Cyan);
        line.X1 = X1;
        line.Y1 = Y1;
        line.X2 = X2;
        line.Y2 = Y2;
        line.StrokeThickness = 2;
        canvas.Children.Add(line);
      };


      for (double i = Canvas.GetTop(canvas); i < canvas.Height; i += 10)
      {
        DrawLine(Canvas.GetLeft(canvas), i, canvas.Width, i);
      }
    }

    private void RootElement_Tapped(object sender, TappedRoutedEventArgs e)
    {
      RectangleGeometry rectangleGeometry = new RectangleGeometry();
      rectangleGeometry.Rect = new Rect(0, 0, 300, 300);

      grid.Clip = rectangleGeometry;
    }
  }
}




在运行Creators Update的机器上使用此应用程序在VS2015中生成不同的结果在没有Creators Update的机器上运行它。应用创建者更新后,grid.Clip被破坏并且不会产生相同的结果。


using this app in VS2015 on a machine running Creators Update produces a different result to running it on a machine without Creators Update. With Creators Update applied, the grid.Clip is broken and does not produce the same result.

推荐答案

您好,

感谢您发布此处。

由于您的问题与UWP论坛有关,我将把案件提交给UWP论坛。

Since your issue is related to UWP forum, I will move the case to UWP forum.

最好的问候,

Hart


这篇关于创建者更新后[UWP] [C#]剪辑被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆