سلام بر برنامه نویسان عزیز ایران زمین 😉 در این مطلب کد استفاده از Image به عنوان Opacity Mask با wpf و سی شارپ را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
تصویر خروجی این کد:
کد استفاده از Image به عنوان Opacity Mask با wpf و سی شارپ :
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.SampleViewer"
Title="Examples" >
<Canvas>
<Image Height="150" Width="200" Source="c:\image.jpg" HorizontalAlignment="Left" Margin="10">
<Image.OpacityMask>
<ImageBrush ImageSource="c:\image.png"/>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.SampleViewer"
Title="Examples" >
<Canvas>
<Image Height="150" Width="200" Source="c:\image.jpg" HorizontalAlignment="Left" Margin="10">
<Image.OpacityMask>
<ImageBrush ImageSource="c:\image.png"/>