views:

123

answers:

1

Hi there,

I need to overlay two images (say, JPEG and PNG with transparency).

Input: - JPEG image - PNG image

Output: - JPEG image with PNG applied.

What is the best approach to do that?

Thank you in advance for the replies and hints!

Cheers

A: 

You can use a DrawingGroup like this:

var group = new DrawingGroup();
group.Children.Add(new ImageDrawing(new BitmapImage(new Uri(@"...\Some.jpg", UriKind.Absolute)), new Rect(0, 0, ??, ??)));
group.Children.Add(new ImageDrawing(new BitmapImage(new Uri(@"...\Some.png", UriKind.Absolute)), new Rect(0, 0, ??, ??)));

MyImage.Source = new DrawingImage(group);
Tergiver