Guest User

Untitled

a guest
Oct 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. public byte[] temp;
  2. private void savebutton_Click (object sender, RoutedEventArgs e)
  3. {
  4. var library = new MediaLibrary();
  5. library.SavePicture(textBox1.Text.ToString(),temp);
  6. NavigationService.GoBack();
  7. }
  8. void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
  9. {
  10. if (e.Error == null && !e.Cancelled)
  11. {
  12. try
  13. {
  14. BitmapImage image = new BitmapImage();
  15. image.SetSource(e.Result);
  16. image1.Source = image;
  17.  
  18. temp = new byte[e.Result.Length];
  19. }
  20. catch (Exception ex)
  21. {
  22. //Exception handle appropriately for your app
  23. MessageBox.Show(ex.ToString());
  24. }
  25. }
  26. else
  27. {
  28. //Either cancelled or error handle appropriately for your app
  29. }
  30. }
Add Comment
Please, Sign In to add comment