Search code examples
c#windows-phone-8bitmapimagenokia-imaging-sdklumia-imaging-sdk

How to convert from PhotoResult or BitmapImage to Bitmap?


How to convert from PhotoResult to Bitmap in Nokia Imaging SDK? I wish to break an image into smaller images. The Bitmap class in Nokia.Graphics.Imaging has a constructor which takes another bitmap and a rectangle. I wish to use it. I cannot find any good examples on this. Please assist.


Solution

  • Ah - you can first create an EditingSession with

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

    (documentation here) and then render that to a Bitmap with RenderToBitmapAsync() (which has an overload that takes a Rect)

    Hope that helps!

    old answer:

    I'm not sure what a PhotoResult is, but here's the documentation for the constructor you mentioned. What question do you have about it?