gpt4 book ai didi

xaml - 如何在Windows Store App中裁剪带有圆角的内容

转载 作者:行者123 更新时间:2023-12-04 03:04:32 24 4
gpt4 key购买 nike

我已经尝试过使用<Grid/>(内部具有交互式内容,而不仅仅是图像)裁剪了带有圆角的(可以使用<Border/><Rectangle/>进行任何操作)。

我尝试了多种解决方案,但没有一个与Windows Store App兼容。

无刷:

  • RadialGradientBrush is not supported in a Windows App project.
  • DrawingBrush is not supported in a Windows App project.
  • The type 'VisualBrush' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.


没有面具:

  • The attachable property 'OpacityMask' was not found in type 'Image'.
  • The attachable property 'OpacityMask' was not found in type 'StackPanel'.
  • The attachable property 'OpacityMask' was not found in type 'Grid'.


无圆角几何:

  • The property 'RadiusX' was not found in type 'RectangleGeometry'.
  • MultiBinding is not supported in a Windows App project.


从技术上讲,在C#/XAML Windows应用商店中这是不可能的吗?

最佳答案

您是否尝试过将控件置于边界内?只需将边框的拐角半径设置为150,您就可以实现完美的圆形控制。这是一个带有按钮的示例。

    <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Center"  Height="200" Margin="0,0,0,0" VerticalAlignment="center" Width="200" CornerRadius="150">

<Button x:Name="btnPlayback" Content="Play" HorizontalAlignment="Center" Height="200" Margin="0,0,0,0" VerticalAlignment="center" Width=" 200" BorderThickness="0" Click="btnPlayback_Click_1"/>

</Border>

关于xaml - 如何在Windows Store App中裁剪带有圆角的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16341788/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com