void camera_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { //Code to display the photo on the page in an image control named myImage. System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage(); bmp.SetSource(e.ChosenPhoto); using (System.IO.IsolatedStorage.IsolatedStorageFile isoStore = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication()) { if (!isoStore.DirectoryExists(item.Group.Title)) isoStore.CreateDirectory(item.Group.Title); string fileName = string.Format("{0}/{1}.jpg", item.Group.Title, DateTime.Now.ToString("dd-MM-yyyy HH-mm-ss")); using (System.IO.IsolatedStorage.IsolatedStorageFileStream targetStream = isoStore.CreateFile(fileName)) { WriteableBitmap wb = new WriteableBitmap(bmp); wb.SaveJpeg(targetStream, wb.PixelWidth, wb.PixelHeight, 0, 100); targetStream.Close(); } if (null == item.UserImages) item.UserImages = new System.Collections.ObjectModel.ObservableCollection<string>(); item.UserImages.Add(fileName); } } }
private async void task_Completed(object sender, PhotoResult e) { /* byte[] imageBits = new byte[(int)e.ChosenPhoto.Length]; e.ChosenPhoto.Read(imageBits, 0, imageBits.Length); e.ChosenPhoto.Seek(0, System.IO.SeekOrigin.Begin); MemoryStream screenshot = new MemoryStream(imageBits); BitmapImage imageFromStream = new BitmapImage(); imageFromStream.SetSource(screenshot); */ Stream imgstream = e.ChosenPhoto; //System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage(); //bmp.SetSource(e.ChosenPhoto); //img.Source = bmp; ApplyButton.Visibility = Visibility.Visible; session = await EditingSessionFactory.CreateEditingSessionAsync(imgstream); try { session.AddFilter(FilterFactory.CreateCartoonFilter(true)); // Save the image as a jpeg to the camera roll using (MemoryStream stream = new MemoryStream()) { WriteableBitmap bitmap = new WriteableBitmap(3552, 2448); await session.RenderToWriteableBitmapAsync(bitmap); bitmap.SaveJpeg(stream, bitmap.PixelWidth, bitmap.PixelHeight, 0, 100); img.Source = bitmap; } //Force the framework to redraw the Image. } catch (Exception exception) { MessageBox.Show("Exception:" + exception.Message); } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (_photoResult != null) { Model.OriginalImage = _photoResult.ChosenPhoto; Model.Saved = false; _photoResult = null; NavigationService.Navigate(new Uri("/Pages/SegmenterPage.xaml", UriKind.Relative)); } else { if (_viewModel == null) { _viewModel = new GalleryPageViewModel(); await _viewModel.Initialize(); DataContext = _viewModel; } Model.AnnotationsBitmap = null; Model.KernelShape = Lumia.Imaging.Adjustments.LensBlurPredefinedKernelShape.Circle; Model.KernelSize = 0.0; Model.OriginalImage = null; Model.Saved = false; } }
private void ReadMetadataFromImage(object sender, PhotoResult photoResult) { //Setting the fileName string fileName = "myWP7.dat"; new IsolatedStorageService().WriteOutToFile(fileName, photoResult.ChosenPhoto); missingPetUploadViewModel.ImageUri = new Uri(photoResult.OriginalFileName); }
void cameraCaptureTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null) { } }
void pcTask_Completed(object sender, PhotoResult e) { //如果照相成功则把照片保存到独立存储空间并显示出来 if (e.TaskResult == TaskResult.OK && e.Error == null) { BitmapImage bmpimg = new BitmapImage(); bmpimg.SetSource(e.ChosenPhoto); App app = Application.Current as App; Image img = new Image(); img.Source = bmpimg; //app.DIYImg = img; //image1.Source = bmpimg; //IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication(); //if (!isf.DirectoryExists("UsersImage")) //{ // isf.CreateDirectory("UsersImage"); //} //using (Stream storagefilestream = isf.OpenFile(MusicName + ".jpg", FileMode.OpenOrCreate, FileAccess.Write)) //{ // WriteableBitmap wb = new WriteableBitmap(bmpimg); // wb.SaveJpeg(storagefilestream, wb.PixelWidth, wb.PixelHeight, 0, 100); //} //NavigationService.Navigate(new Uri("/JigsawPuzzle;component/DIYPage.xaml", UriKind.Relative)); thread.Start(); } }
private void PhotoChooserCompleted(object sender, PhotoResult e) { this.showInProgress = false; if (e.TaskResult == TaskResult.OK) { // Defensive. This should not happen unless maybe someone programmatically saved a 0 length image in // the picture gallery which I am not even sure the phone API will allow. // Since this.ocrData.PhotoStream will not accept a zero length stream we'll act defensively here. if (e.ChosenPhoto.Length > 0) { Stream photoStream; // This is the point where we have a photo available. photoStream = e.ChosenPhoto; // Extract the orientation flag from the photo before we do the scaling down. // If the scaling down is performed we'll no longer have the Exif info in the photo stream. ExifUtils exifUtils = new ExifUtils(OcrClientUtils.GetPhotoBits(photoStream)); this.ocrData.ExifOrientationFlag = exifUtils.GetOrientationFlag(); if (DoLimitPhotoSize) { photoStream = OcrClientUtils.LimitPhotoSize(photoStream, PhotoMaxSizeDiagonal); } // When setting this.ocrData.PhotoStream, the ocrData instance will notify anyone who subscribed // to its PropertyChanged event. One of the subscribers to PropertyChanged will see that // the PhotoStream became available and it will trigger the OCR conversion. this.ocrData.PhotoStream = photoStream; } } }
private void photoChooserTask_Completed(object sender, PhotoResult e) { BitmapImage image = new BitmapImage(); image.SetSource(e.ChosenPhoto); bitmapFotoDonatur = e.ChosenPhoto; FotoDonatur = (image); }
void task_Completed(object sender, PhotoResult e) { if(e.TaskResult == TaskResult.OK) { var bmp = new WriteableBitmap(0,0); bmp.SetSource(e.ChosenPhoto); var bmpres = new WriteableBitmap(bmp.PixelWidth,bmp.PixelHeight); var txt = new WindowsPhoneControl1(); txt.Text = txtInput.Text; txt.FontSize = 36 * bmpres.PixelHeight / 480; txt.Width = bmpres.PixelWidth; txt.Height = bmpres.PixelHeight; //should call Measure and when uicomponent is not in visual tree txt.Measure(new Size(bmpres.PixelWidth, bmpres.PixelHeight)); txt.Arrange(new Rect(0, 0, bmpres.PixelWidth, bmpres.PixelHeight)); bmpres.Render(new Image() { Source = bmp }, null); bmpres.Render(txt, null); bmpres.Invalidate(); display.Source = bmpres; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (_photoResult != null) { if (_brush == null) { _brush = new SolidColorBrush(Colors.Red); } } else { _brush = null; } if (_photoResult != null) { var originalBitmap = new BitmapImage { DecodePixelWidth = (int)(480.0 * Application.Current.Host.Content.ScaleFactor / 100.0) }; originalBitmap.SetSource(_photoResult.ChosenPhoto); OriginalImage.Source = originalBitmap; originalBitmap = null; _photoResult = null; } ManipulationArea.ManipulationStarted += AnnotationsCanvas_ManipulationStarted; ManipulationArea.ManipulationDelta += AnnotationsCanvas_ManipulationDelta; ManipulationArea.ManipulationCompleted += AnnotationsCanvas_ManipulationCompleted; }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { firstimage.Source = new BitmapImage(new Uri(e.OriginalFileName)); } }
void cameraTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { JpegInfo info = ExifLib.ExifReader.ReadJpeg(e.ChosenPhoto, e.OriginalFileName); // Load the picture in a BitmapImage System.Windows.Media.Imaging.BitmapImage bitmap = new System.Windows.Media.Imaging.BitmapImage(); bitmap.SetSource(e.ChosenPhoto); // Place the loaded image in a WriteableBitmap WriteableBitmap writeableBitmap = new WriteableBitmap(bitmap); // Execute the filter on the pixels of the bitmap ApplyFilter(writeableBitmap.Pixels); // Set the source of our image to the WriteableBitmap photoImage.Source = writeableBitmap; //start count doown timer countDownTimer = new DispatcherTimer(); countDownTimer.Interval = new TimeSpan(0, 0, 0, 1); countDownTimer.Tick += new EventHandler(countDownTimerEvent); // countDownTimer.Start(); txtCountdown.Text = "\n" + "seconds remaining"; ReadExif(info); } }
void ctask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { //CapturedImage = new WriteableBitmap(); CapturedImage = PictureDecoder.DecodeJpeg(e.ChosenPhoto); //CapturedImage.Resize(); string imgSize = (e.ChosenPhoto.Length / 1024).ToString(); string Height = CapturedImage.PixelHeight.ToString(); string Width = CapturedImage.PixelWidth.ToString(); long memoryRemaining = (long) DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage"); MessageBox.Show("Mem: " + memoryRemaining + "Size: " + imgSize + Environment.NewLine + "Dim: " + Height + "x" + Width); StoreImageItem(); //CapturedImage = PictureDecoder.DecodeJpeg(e.ChosenPhoto); //myImage.Source = bmp; //myImage.Stretch = Stretch.Uniform; // swap UI element states //savePhotoButton.IsEnabled = true; //statusText.Text = ""; } else { //savePhotoButton.IsEnabled = false; //statusText.Text = "Task Result Error: " + e.TaskResult.ToString(); MessageBox.Show("Error"); } CapturedImage = null; }
private void Task_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { if (Helpers.FileHelpers.IsValidPicture(e.OriginalFileName)) { if (App.PhotoModel != null) { App.PhotoModel.Dispose(); App.PhotoModel = null; GC.Collect(); } using (MemoryStream stream = new MemoryStream()) { e.ChosenPhoto.CopyTo(stream); App.PhotoModel = new PhotoModel() { Buffer = stream.GetWindowsRuntimeBuffer() }; App.PhotoModel.Captured = (sender == _cameraCaptureTask); App.PhotoModel.Dirty = App.PhotoModel.Captured; } Dispatcher.BeginInvoke(() => { NavigationService.Navigate(new Uri("/Pages/PhotoPage.xaml", UriKind.Relative)); }); } else { MessageBox.Show(AppResources.App_MessageBox_UnsupportedImage_Message, AppResources.App_MessageBox_UnsupportedImage_Caption, MessageBoxButton.OK); } } }
void photoChooserTask_Completed(object sender, PhotoResult e) { ShareMediaTask shareMediaTask = new ShareMediaTask(); shareMediaTask.FilePath = e.OriginalFileName; shareMediaTask.Show(); }
private void cct_Completed(object sender, PhotoResult e) { if (e.Error == null) { this.CallbackName = this.successCallback; switch (e.TaskResult) { case TaskResult.OK: int streamLength = Convert.ToInt32(e.ChosenPhoto.Length); byte[] fileData = new byte[streamLength + 1]; e.ChosenPhoto.Read(fileData, 0, streamLength); e.ChosenPhoto.Close(); string base64 = Convert.ToBase64String(fileData); this.CallbackArgs = new[] { base64 }; break; default: this.CallbackArgs = new[] { string.Empty }; break; } } else { this.CallbackName = this.errorCallback; this.CallbackArgs = new[] { e.Error.Message }; } }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult != TaskResult.OK) { return; } WebClient webClient = new WebClient(); webClient.OpenWriteCompleted += (s, args) => { using (BinaryReader br = new BinaryReader(e.ChosenPhoto)) { using (BinaryWriter bw = new BinaryWriter(args.Result)) { long bCount = 0; long fileSize = e.ChosenPhoto.Length; byte[] bytes = new byte[2 * 1024]; do { bytes = br.ReadBytes(2 * 1024); bCount += bytes.Length; bw.Write(bytes); } while (bCount < fileSize); } } }; webClient.WriteStreamClosed += webClient_WriteStreamClosed; webClient.OpenWriteAsync(new Uri("http://www.cnblogs.com")); }
void ptsk_Completed(object sender, PhotoResult e) { BitmapImage bi = new BitmapImage(); if(e.ChosenPhoto !=null) bi.SetSource(e.ChosenPhoto); img.Source = bi; }
// Called when an existing photo is chosen with the photo chooser. private void OnPhotoChooserTaskCompleted(object sender, PhotoResult e) { // Hide text messages txtError.Visibility = Visibility.Collapsed; txtMessage.Visibility = Visibility.Collapsed; // Make sure the PhotoChooserTask is resurning OK if (e.TaskResult == TaskResult.OK) { // initialize the result photo stream photoStream = new MemoryStream(); // Save the stream result (copying the resulting stream) e.ChosenPhoto.CopyTo(photoStream); // save the original file name fileName = e.OriginalFileName; // display the chosen picture var bitmapImage = new System.Windows.Media.Imaging.BitmapImage(); bitmapImage.SetSource(photoStream); imgSelectedImage.Source = bitmapImage; // enable the upload button btnUpload.IsEnabled = true; } else { // if result is not ok, make sure user can't upload btnUpload.IsEnabled = false; } }
private void OnPhotoChooserTaskCompleted(object sender, PhotoResult e) { var stream = e.ChosenPhoto; if (stream == null) { // If connected to Zune and debugging (WP7), the PhotoChooserTask won't open so we just pick the first image available. #if DEBUG var mediaLibrary = new MediaLibrary(); if (mediaLibrary.SavedPictures.Count > 0) { var firstPicture = mediaLibrary.SavedPictures[0]; stream = firstPicture.GetImage(); } #else return; #endif } var bitmapImage = new BitmapImage(); bitmapImage.SetSource(stream); //TODO: close stream? _writableBitmap = new WriteableBitmap(bitmapImage); pixelatedImage.Source = _writableBitmap; _originalPixels = new int[_writableBitmap.Pixels.Length]; _writableBitmap.Pixels.CopyTo(_originalPixels, 0); PixelateWriteableBitmap(); }
async void pct_Completed(object sender, PhotoResult e) { if (e.TaskResult != TaskResult.OK || e.ChosenPhoto == null) return; try { // Create a source to read the image from PhotoResult stream using (var source = new StreamImageSource(e.ChosenPhoto)) { using (var effect = new PixlateEffect(source)) { _effect = effect; var target = new WriteableBitmap((int)ResultImage.ActualWidth, (int)ResultImage.ActualHeight); // Create a new renderer which outputs WriteableBitmaps using (var renderer = new WriteableBitmapRenderer(effect, target)) { // Render the image with the filter(s) await renderer.RenderAsync(); // Set the output image to Image control as a source ResultImage.Source = target; } } } } catch (Exception exception) { MessageBox.Show(exception.Message); return; } }
protected void cameraTask_Completed(object sender, PhotoResult e) { rho.common.Hashtable<String, String> mapRes = new rho.common.Hashtable<String, String>(); switch (e.TaskResult) { case TaskResult.OK: mapRes["imageUri"] = e.OriginalFileName; mapRes["image_uri"] = e.OriginalFileName; mapRes["status"] = "ok"; break; case TaskResult.None: mapRes["message"] = "Error"; mapRes["status"] = "error"; break; case TaskResult.Cancel: mapRes["message"] = "User cancelled operation"; mapRes["status"] = "cancel"; break; default: break; } _oResult.set(mapRes); //Code to display the photo on the page in an image control named myImage. //System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage(); //bmp.SetSource(e.ChosenPhoto); //myImage.Source = bmp; }
void cct_Completed(object sender, PhotoResult e) { BitmapImage bi = new BitmapImage(); bi.SetSource(e.ChosenPhoto); SaveImage(bi); PageSource.InvokeScript("getImage", "pic.jpg"); }
void photoChooser_Completed(object sender, PhotoResult e) { if (e.ChosenPhoto == null) { return; } stream= e.ChosenPhoto.AsInputStream(); }
void task_Completed(object sender, PhotoResult e) { BitmapImage image = new BitmapImage(); image.SetSource(e.ChosenPhoto); image1.Source = image; SetPicture(); }
private void PhotoChosen(object sender, PhotoResult photoResult) { if (photoResult.TaskResult != TaskResult.OK) return; target.UploadAvatar(photoResult.ChosenPhoto, "image/png", UpdatedAvatar); Avatar.Source = null; LoadingBar.IsIndeterminate = true; }
void Complete_PhotoChooserTask(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { App.PhotoResult = e; NavigationService.Navigate(new Uri("/NewChallenge.xaml", UriKind.Relative)); } }
private void cameraCaptureTask_Completed(object sender, PhotoResult e) { byte[] bytes = new byte[e.ChosenPhoto.Length]; e.ChosenPhoto.Position = 0; e.ChosenPhoto.Read(bytes, 0, (int)e.ChosenPhoto.Length); imageAttachment.Blob = bytes; isNew = true; }
private void photo_ChooserTaskCompleted(object sender, PhotoResult e) { Stream photoStream = e.ChosenPhoto; photoName.Text = e.OriginalFileName; var memoryStream = new MemoryStream(); photoStream.CopyTo(memoryStream); avatarImage = memoryStream.ToArray(); }
private void cameraTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { var bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); image1.Source = bmp; } }
private void OnCameraCaptureTaskCompleted(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); previewImageUserControl.previewImage.Source = bmp; } }
void camera_Completed(object sender, PhotoResult e) { _image = ImageHelper.GetFileBytes(e.ChosenPhoto); var bmp = new BitmapImage(); bmp.SetSource(ImageHelper.GetFileStream(_image)); img.Source = null; img.Source = bmp; }
void OnPhotoChooserCompleted(object sender, PhotoResult args) { if (args.Error == null && args.ChosenPhoto != null) { jpegBits = new byte[args.ChosenPhoto.Length]; args.ChosenPhoto.Read(jpegBits, 0, jpegBits.Length); LoadBitmap(jpegBits); } }
void OnCameraCaptureTaskCompleted(object sender, PhotoResult args) { if (args.TaskResult == TaskResult.OK) { BitmapImage bmp = new BitmapImage(); bmp.SetSource(args.ChosenPhoto); img.Source = bmp; } }
private async void OnPhotoChooserTaskCompleted(object sender, PhotoResult e) { if (e.Error != null) { this.ShowMessage(e.Error.ToString()); } else if (e.OriginalFileName == null) { this.ShowMessage("No Photo Choosen."); } else { string[] filePathSegments = e.OriginalFileName.Split('\\'); string fileName = filePathSegments[filePathSegments.Length - 1]; try { var progressHandler = new Progress <LiveOperationProgress>((LiveOperationProgress progress) => { this.progressBar.Value = progress.ProgressPercentage; }); this.ShowProgress(); LiveOperationResult operationResult = await this.liveClient.UploadAsync( this.tbUrl.Text, fileName, e.ChosenPhoto, OverwriteOption.Rename, new CancellationToken(false), progressHandler); e.ChosenPhoto.Dispose(); this.progressBar.Value = 0; dynamic result = operationResult.Result; string fileLocation = result.source; LiveDownloadOperationResult downloadOperationResult = await this.liveClient.DownloadAsync(fileLocation, new CancellationToken(false), progressHandler); using (Stream downloadStream = downloadOperationResult.Stream) { if (downloadStream != null) { var imgSource = new BitmapImage(); imgSource.SetSource(downloadStream); this.imgPreview.Source = imgSource; this.ShowImage(); } } } catch (Exception exp) { this.ShowMessage(exp.ToString()); } } }
private void ProcessImage(PhotoResult e) { // setting the image in the display and start scanning in the background var bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); BarcodeImage.Source = bmp; scannerWorker.RunWorkerAsync(new WriteableBitmap(bmp)); }
private void pct_Completed(object sender, PhotoResult e) { //Code will be executed when an image BitmapImage image = new BitmapImage(); image.SetSource(e.ChosenPhoto); //display on image control imgPhoto.Source = image; }
private void PhotoChooser_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { var selectedImage = new BitmapImage(); selectedImage.SetSource(e.ChosenPhoto); _vm.OriginalImage = selectedImage; } }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage(); bmp.SetSource(e.ChosenPhoto); imageInput.Source = bmp; } }
private void OnChoosePhotoTaskCompleted(object sender, PhotoResult e) { if (TaskResult.OK != e.TaskResult) { return; } using (Stream pictureStream = e.ChosenPhoto) AddNewMediaStream(pictureStream, e.OriginalFileName); }
void task_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { image.SetSource(e.ChosenPhoto); imgBrush.ImageSource = image; rect.Fill = imgBrush; } }
void photoChoserTask_Completed(object sender, PhotoResult e) { if ((null == e.Error) && (TaskResult.OK == e.TaskResult)) { capturedImage = new BitmapImage(); capturedImage.SetSource(e.ChosenPhoto); ChosenPhotoImage.Source = capturedImage; } }
void pc_Completed(object sender, PhotoResult e) { try { var originalFileName = Path.GetFileName(e.OriginalFileName); SaveImage(e.ChosenPhoto, originalFileName, 0, 100); } catch {} }
void CameraCaptureTaskCompleted(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { var bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); imgFromCamera.Source = bmp; } }
private void Camera_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage fotoTirada = new BitmapImage(); fotoTirada.SetSource(e.ChosenPhoto); foto.Source = fotoTirada; } }
private void FotoChooser_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage fotoGaleria = new BitmapImage(); fotoGaleria.SetSource(e.ChosenPhoto); foto.Source = fotoGaleria; } }
void cct_Completed(object sender, PhotoResult e) { BitmapImage img = new BitmapImage(); //set the image sourse img.SetSource(e.ChosenPhoto); //display photo on image imgPhoto.Source = img; }
protected void cameraTask_Completed(object sender, PhotoResult e) { rho.common.Hashtable <String, String> mapRes = new rho.common.Hashtable <String, String>(); switch (e.TaskResult) { case TaskResult.OK: WriteableBitmap writeableBitmap = new WriteableBitmap(1600, 1200); writeableBitmap.LoadJpeg(e.ChosenPhoto); string imageFolder = "rho/apps"; //CFilePath.join( rho_native_rhopath(), RHO_APPS_DIR);//"rho"; string datetime = DateTime.Now.ToString().Replace("/", ""); datetime = datetime.Replace(":", ""); string imageFileName = "Foto_" + datetime.Replace(" ", String.Empty) + ".jpg"; string filePath = ""; using (var isoFile = IsolatedStorageFile.GetUserStoreForApplication()) { if (!isoFile.DirectoryExists(imageFolder)) { isoFile.CreateDirectory(imageFolder); } filePath = System.IO.Path.Combine(imageFolder, imageFileName); using (var stream = isoFile.CreateFile(filePath)) { writeableBitmap.SaveJpeg(stream, writeableBitmap.PixelWidth, writeableBitmap.PixelHeight, 0, 100); } } mapRes["imageUri"] = "/" + imageFileName; //e.OriginalFileName; mapRes["image_uri"] = "/" + imageFileName; //e.OriginalFileName; mapRes["status"] = "ok"; break; case TaskResult.None: mapRes["message"] = "Error"; mapRes["status"] = "error"; break; case TaskResult.Cancel: mapRes["message"] = "User cancelled operation"; mapRes["status"] = "cancel"; break; default: break; } _oResult.set(mapRes); //Code to display the photo on the page in an image control named myImage. //System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage(); //bmp.SetSource(e.ChosenPhoto); //myImage.Source = bmp; }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage img = new BitmapImage(); img.SetSource(e.ChosenPhoto); //pictureChoose.Source = img; } }
private void Camera_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage fotoTirada = new BitmapImage(); fotoTirada.SetSource(e.ChosenPhoto); pathFoto = Path.GetFileName(e.OriginalFileName); imgFoto.Source = fotoTirada; } }
private void ProcessPhotoResult(PhotoResult e) { if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null) { var bytes = new byte[e.ChosenPhoto.Length]; e.ChosenPhoto.Position = 0; e.ChosenPhoto.Read(bytes, 0, (int)e.ChosenPhoto.Length); entity.Photo = bytes; } }
/// <summary> /// Permet de récupérer la photo prise ou sélectionnée par l'utilisateur /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChoixPhotoCompleted(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { WriteableBitmap imageSelectionne = BitmapFactory.New(1, 1).FromStream(e.ChosenPhoto); imageSelectionne = imageSelectionne.Resize(450, 732, WriteableBitmapExtensions.Interpolation.Bilinear); PhoneApplicationService.Current.State["photo"] = imageSelectionne; NavigationService.Navigate(new Uri("/Pages/ValidationPhotoPage.xaml", UriKind.Relative)); } }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { //Code to display the photo on the page in an image control named myImage. isImageUpload = true; ObjBmpImage.SetSource(e.ChosenPhoto); imgProfile.Source = ObjBmpImage; } }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BitmapImage bimg = new BitmapImage(); bimg.SetSource(e.ChosenPhoto); img_Avatar.Source = bimg; register.ImageFileData = Helper.StreamToBytes(e.ChosenPhoto); } }
void photoChooserTask_Completed(object sender, PhotoResult e) { StringBuilder sb = new StringBuilder(); if (e.TaskResult == TaskResult.OK) { SaveToIsolatedStorage(e.ChosenPhoto, "userBackground.jpg"); this.ReadFromIsolatedStorage("userBackground.jpg"); } }
void pct_Completed(object sender, PhotoResult e) { // code to display image BitmapImage Image = new BitmapImage(); // set image source Image.SetSource(e.ChosenPhoto); // display on image control this.imgShow.Source = Image; }
/*Methods to Photos*/ private void task_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { info.Text = "Imagen cargada"; image.SetSource(e.ChosenPhoto); imgBrush.ImageSource = image; newImage.Fill = imgBrush; } }
void phototask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { image = new BitmapImage(); image.SetSource(e.ChosenPhoto); fileName = e.OriginalFileName; renrenbitmap.Source = image; } }
async void pct_Completed(object sender, PhotoResult e) { await ParseHelper.UpdateUserProfilePic(e.ChosenPhoto); // update profile image on page: BitmapImage bi = new BitmapImage(); bi.SetSource(e.ChosenPhoto); imgThumbnail.Source = bi; }
void photoChooserTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { byte[] myArray = Utils.Utility.ReadFully(e.ChosenPhoto); ViewModel.AddPictureTourCommand.Execute(myArray); } PhotoHubLLS.ItemsSource = ViewModel.PictureTourList; }