I saved the image in MediaLibrary as follow
System.Windows.Media.Imaging.Extensions.SaveJpeg(wb, msWrite, g_IntWidth, g_IntHeight, 0, 100); MediaLibrary ML = new MediaLibrary(); ML.SavePicture("My1stPhoto.jpg", msWrite);
The problem is :
later when I use PhotoChooser to select previously saved Photo ( My1stPhoto.jpg ), but this is working. It seems the return filename is not the same as My1stPhoto.jpg
I used below code , the byte is 0 ? Need your help. Thanks.
void photoChooserTask_Completed(object sender, PhotoResult e) { strSelectedFilenameinHub = e.OriginalFileName; StreamResourceInfo sri = null; Uri jpegUri = new Uri( strSelectedFilenameinHub, UriKind.Relative); sri = Application.GetResourceStream(jpegUri); byte[] imageData = new byte[sri.Stream.Length]; sri.Stream.Read(imageData, 0, System.Convert.ToInt32(sri.Stream.Length)); }