Reputation: 10509
A Zune splash screen:
has a square, semi-transparent border around splash screen image.
How can one get such semi-transparent border on .net app's splash screen?
Upvotes: 1
Views: 922
Reputation: 356
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
Upvotes: 0
Reputation: 16628
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:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
<Grid>
<Image Source="MyPngImagePath" />
</Grid>
</Window>
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)
Upvotes: 1