gpt4 book ai didi

c# - 具有外部背景图像的 WPF 按钮

转载 作者:太空狗 更新时间:2023-10-29 20:01:55 25 4
gpt4 key购买 nike

我知道很多人问过 WPF 按钮的背景图像,这是可能的,但我想问一下如何将外部图像(来自 Internet)添加到按钮的背景中。有办法吗?

最佳答案

使用 ImageBrush 显式设置按钮的背景:

<Button Content="Hello">
<Button.Background>
<ImageBrush ImageSource="http://example.com/foo.jpg" />
</Button.Background>
</Button>

关于c# - 具有外部背景图像的 WPF 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5799359/

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