Crop, Blend (Watermark) Photos on Windows Phone 8.1 with the Lumia Imaging SDK

I recently needed the ability to combine two images on Windows Phone 8.1 (WinRT not Silverlight) so that one overlays the other, like a watermark. Because the watermark image was a fixed size and dimension, we also needed to make sure that the photo being merged shared the same aspect ratio (in this case a square).

Although I found many examples for cropping and blending in Silverlight, Windows 8.1, and Win32 (GDI+), none of them apply to Windows Phone 8.1 as it omits many of the required libraries and references.

One solution often suggested is to use XAML to layer the images on top of each other, and although this works visually, it doesn’t help if you actually need a merged photo, such as for upload to a service like Facebook or Instagram.

Fortunately in the end, I was able to leverage the Lumia Imaging SDK to perform both the cropping and the blending of the two images, and in this post we’ll look at some of the code that makes this happen. In addition, I’ve created a sample project that demonstrates the operations, available for download to anyone who might need it.

Read more at the Falafel Software Blog: Crop, Blend (Watermark) Photos on Windows Phone 8.1 with the Lumia Imaging SDK