I have a WPF application with an image over which a user control is installed. I would like the custom control background to be transparent, but buttons, etc. This user control was durable.
Below is the image that I have. I would like the inside of the red area to be transparent (user control can theoretically have many different shapes), but with the controls contained in it solid.

XAML main window:
<Canvas Height="450" Width="300"> <Border Opacity=".2" > <Image Source="D:\\BarbourCoat.jpg" Width="300" ></Image> </Border> <local:UserControl1 Height="100" Canvas.Left="10" Canvas.Top="10" Width="100"/> </Canvas>
So far, the XAML user control:
<Canvas Background="Transparent"> <Path Data="M 10 10 L 100 10 L 250 50 L 280 200 L 180 250 L 25 270 Z" Stroke="Red"></Path> <Button Content="Button" HorizontalAlignment="Left" Margin="41,53,0,0" VerticalAlignment="Top" Width="75"/> <TextBox HorizontalAlignment="Left" Height="23" Margin="90,112,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/> <TextBlock HorizontalAlignment="Left" Margin="69,209,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/> </Canvas>
Itβs hard for me to handle this, any help would be greatly appreciated.
source share