如何在UWP Windows 10 for Mobile中使用Lumia Imaging SDK的Blend Effect?

时间:2015-11-04 09:18:46

标签: c# uwp windows-10-mobile lumia-imaging-sdk

如何在UWP Windows 10 for Mobile中使用Lumia Imaging SDK的Blend Effect?

这是我从混合效果获取字节数组的代码。它适用于桌面模式,但不适用于移动设备(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);
                    }
                }

我的代码出了什么问题?

1 个答案:

答案 0 :(得分:0)

我之前也遇到过这样的问题而且它是模拟器。在物理设备上运行时未出现错误。