1

如何将PhotoResult转换为Nokia Imaging SDK中的位图? 我希望将图像分解成更小的图像。 Nokia.Graphics.Imaging中的位图类有一个构造函数,它接受另一个位图和一个矩形。我希望使用它。 我在这找不到任何好的例子。请协助。如何把PhotoResult或BitmapImage转换成Bitmap?

回答

1

啊 - 你可以先用

var session = await EditingSessionFactory.CreateEditingSessionAsync(photoResult.ChosenPhoto); 

documentation here) 创建EditingSession,然后渲染成位图与RenderToBitmapAsync()(其中有采用一个矩形的过载)

希望帮助!

老答案:

我不知道一个PhotoResult是什么,但here's the documentation for the constructor you mentioned。你有什么问题呢?

+0

PhotoResult是使用Windows Phone的一个PhotoChooser任务时返回的类的对象。那里提供的文档不适合这种情况。 – rahulroy9202

2

在Nokia Imaging SDK的新版本1.0中,您可以使用StreamImageSource读取ChosenPhoto流。

0

NokiaImagingSDK 1.2

Bitmap bmp = null; 
await streamImageSource.GetBitmapAsync(bmp, OutputOption.PreserveAspectRatio);