When I want to pick photo from my library, and initially do something with this photo I want to crop it and resize to 300x300. Everything is OK, until I choose a big photo.
When I pick a big image (10000x6000) PhotoChooserTask
does nothing (from the user's point of view), PhotoChooserTask
just crashes (not the application). Then when I try picking another one I get "Not allowed to call Show() multiple times before an invocation returns"
exception.
It seems PhotoChooserTask
still has the previous object inside, and I don't know how to dispose or clear PhotoChooserTask
.
PS. without setting
chooser.PixelHeight = 300;
chooser.PixelWidth = 300;
Photo will set, and everything is ok.
PS2.
Samsung ATIV S does not have a problem. Only nokia 1320 ,520 and 530
PhotoChooserTask chooser = new PhotoChooserTask();
try
{
chooser.ShowCamera = true;
chooser.PixelHeight = 300;
chooser.PixelWidth = 300;
chooser.Completed += (s, result) =>
{
if (result.Error != null){ return; }
if (result.ChosenPhoto != null)
{
var bitmap = new BitmapImage();
bitmap.SetSource(result.ChosenPhoto);
Service.uploadPhoto(receiver, (ImageSource)bitmap);
}
};
chooser.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
When the photo is big and height is set the debugger doesn't enters inside chooser.Completed