If you want to use a regular image with no transparency and put a semi-transparent border around it, simply put the Image in the XAML above into a <Border /> with BorderBrush set to a semi-transparent color (i.e: a color like #AABBBBBB where AA defines transparency)
发布评论
评论(2)
以下是部分透明 WPF 启动画面的步骤:
1) 创建具有所需半透明部分的 PNG
2)在您的 SplashScreen.xaml(或任何名称)中,执行以下操作:
如果您想使用不透明的常规图像并在其周围放置半透明边框,只需将上面 XAML 中的图像放入
将BorderBrush
设置为半透明颜色(即:类似#AABBBBBB
的颜色,其中 AA 定义透明度)Here are the steps for a partly transparent WPF splashscreen:
1) Create a PNG with the desired semi-transparent parts
2) In your SplashScreen.xaml (or whatever the name of it), do this:
If you want to use a regular image with no transparency and put a semi-transparent border around it, simply put the Image in the XAML above into a
<Border />
withBorderBrush
set to a semi-transparent color (i.e: a color like#AABBBBBB
where AA defines transparency)查看 .NET 表单上的透明度属性
在图像边框上将此方块设置为特定颜色,然后使用透明度属性应用 MaskColor
一旦我找到了一个代码示例,该示例采用 PNG 图像并在表单上应用透明度组件。 。
此代码项目教程可以提供帮助:
C# 透明度教程 - 第 1 部分
< a href="http://www.codeproject.com/KB/GDI-plus/CsTranspTutorial2.aspx" rel="nofollow">C# 透明度教程 - 第 2 部分
C# 透明度教程 - 第 3 部分
Look at Transparency Properties on .NET forms
On your image border put this square in a specific color, then use the Transparency property to apply a MaskColor
Once i found a code exemple taht takes a PNG image and apply the transparency component on the form...
This code project tutorial can help:
Transparency Tutorial with C# - Part 1
Transparency Tutorial with C# - Part 2
Transparency Tutorial with C# - Part 3