Avalonia:如何将PNG显示为图像?
我还没有看到完成此操作的f#示例,或任何与我想做的足够相似的示例,因此希望这里的解决方案对他人有帮助。
我正在将Avalonia与F#一起构建简单的UI。我想在我的UI中包括图像,但是花了几个小时来查看文档和示例以及我所看到的一切外观都被过度复杂(也许真的很复杂?)。
我正在创建类似的图像:
let b = (Avalonia.Media.Imaging.Bitmap @"C:\Images\icon.png")
Image.create [
Image.source b
]
这只是什么都没有显示。我在这里想念什么?
I haven't seen an F# example of accomplishing this, or any examples similar enough to what I am trying to do, so hopefully a solution here will be helpful to others.
I am using Avalonia with F# to build a simple UI. I want to include images in my UI, but have spent hours looking at documentation and examples and everything I've seen looks to be overcomplicated (maybe it really is just that complicated?).
I am creating an image like:
let b = (Avalonia.Media.Imaging.Bitmap @"C:\Images\icon.png")
Image.create [
Image.source b
]
This just displays nothing. What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要在上面的评论中添加更多详细信息,这是对我有用的:
To add more detail to my comment above, here's what works for me:
Result is: