How to use Blend Effect from Lumia Imaging SDK in UWP windows 10 for Mobile?
this is my code for get byte array from blend effect. it's work for Desktop Mode, but not for Mobile(Windows Phone)
byte[] byteImageResult;
var fileWM = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/ADI.Mobile-wm.png"));
using (var stream = await capturedMedia.OpenAsync(FileAccessMode.Read))
using (var fileStreamWM = await fileWM.OpenAsync(FileAccessMode.Read))
using (var _blendEffect = new BlendEffect())
{
_blendEffect.Source = new RandomAccessStreamImageSource(stream);
_blendEffect.ForegroundSource = new RandomAccessStreamImageSource(fileStreamWM);
_blendEffect.TargetArea = new Rect(0, 0.93, 0, 0);
_blendEffect.TargetOutputOption = OutputOption.PreserveSize;
using (var renderer = new JpegRenderer(_blendEffect))
{
IBuffer jpegBuffer = await renderer.RenderAsync();
byteImageResult = jpegBuffer.ToArray();
biResult = await Tools.ByteArrayToBitmapImage(byteImageResult);
}
}
What's wrong with my code?