private async Task <bool> openHiddenImage(StorageFile hiddenImageFile) { if (await this.isHiddenImageTooLarge(hiddenImageFile)) { return(false); } var copyBitmapImage = await FileUtilities.MakeCopyOfTheImage(hiddenImageFile); await PictureUtilities.LoadImageData(this.HiddenPicture, hiddenImageFile, copyBitmapImage); return(true); }
private async Task openDraggedFile(DragEventArgs dragEvent) { if (dragEvent.DataView.Contains(StandardDataFormats.StorageItems)) { var items = await dragEvent.DataView.GetStorageItemsAsync(); var sourceImageFile = items[0] as StorageFile; var copyBitmapImage = await FileUtilities.MakeCopyOfTheImage(sourceImageFile); if (sourceImageFile != null) { await PictureUtilities.LoadImageData(this.SourcePicture, sourceImageFile, copyBitmapImage); } } }
/// <summary> /// Opens the source image. /// </summary> /// <returns> /// true if file opened, false otherwise /// </returns> public async Task <bool> OpenSourceImage() { var sourceImageFile = await FileUtilities.SelectFile(); if (!await this.isFileValid(sourceImageFile)) { return(false); } var copyBitmapImage = await FileUtilities.MakeCopyOfTheImage(sourceImageFile); await PictureUtilities.LoadImageData(this.SourcePicture, sourceImageFile, copyBitmapImage); return(true); }