TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Zvonimir Tusek
NA
9
575
One image (kinect depth map) as opacityMask for other image
Oct 20 2019 3:37 PM
Hi, I have two image controls.
I want to use Img1 as a OpacityMask of Img2.
<Image Name="Img1" Width="500" Height="500" />
<Image Name="Img2" Width="500" Height="500" Source="c:\temp\background.jpg" />
Img1 - image to apply mask to
Img2 - image to apply mask from
The
source of Img1
is being read from
kinect depth image:
(I'm using OpenCV)
var depthBmp = depthFrame.SliceDepthImage((int)sliderMin.Value, (int)sliderMax.Value);
Image<Bgr, Byte> openCVImg = new Image<Bgr, byte>(depthBmp.ToBitmap()); outImg.Source = ImageHelpers.ToBitmapSource(openCVImg);
Img1.Source = ImageHelpers.ToBitmapSource(openCVImg);
-------------------------------------------------------------------------------------------
When I create ImageBrush, set its Imagesource to Img1.Source and apply OpacityMask from Brush, nothing happens, Img2 is shown without mask:
brush = new ImageBrush();
brush.ImageSource = Img1.Source;
Img2.OpacityMask = brush;
-----------------------------------------------------------------------------------------
For example, the mask is applied when I use BitmapImage as ImageSource of ImageBrush:
BitmapImage Img3 = new BitmapImage(new Uri(@"c:\temp\turtle.png", UriKind.Absolute));
brush = new ImageBrush();
brush.ImageSource = Img3.Source;
Img2.OpacityMask = brush;
--------------------------------------------------------------------------------------------
Tnx.
Zvonimir
Reply
Answers (
0
)
Change Combo box arrow image with other image
ListView button click event