首页 > 解决方案 > 我可以在平台 WPF 中使用 Xam.Plugin.Forms.ImageCircle

问题描述

我是新手,所以我开始学习如何在我的 Xamarin 项目中应用插件名称 Xam.Plugin.Forms.ImageCircle。我添加了平台 WPF 而不是 UWP,并且在我安装了上面的插件之后,我无法在文件 App.xaml.cs 中调用 ImageCircleRenderer.Init()。所以我想知道我是否可以使用这个插件以及如何配置它以防在 WPF 中使用这个插件。谢谢

标签: c#wpfxamarin.formsxamarin.windowsxamarin.wpf

解决方案


我已经检查了 wpf 上的包,它不起作用。

如果你想在 wpf 中使用圆形图像,你可以试试下面的代码。

  <Ellipse Width="250" Height="250">
        <Ellipse.Fill>
            <ImageBrush ImageSource="http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG" />
        </Ellipse.Fill>
    </Ellipse>

推荐阅读