I'm doing the standard CameraChooserTask dance. In my callback, I'd like to get the dimensions of the captured photo.
I tried using BitmapImage
, as below, but since the BitmapImage
isn't part of the render tree, I don't think it actually does any decoding (its ImageOpened
event doesn't fire).
private void CameraCapture_Completed(object sender, PhotoResult e)
{
if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null)
{
// This code DOES NOT work:
// BitmapImage bi = new BitmapImage();
// bi.SetSource(stream);
// ... use bi.PixelHeight and bi.PixelWidth ...