I am looking for a touchscreen-friendly file picker for Windows 10. In Windows 8 and 8.1, i used FileOpenPicker:
FileOpenPicker fileOpenPicker = new FileOpenPicker();
fileOpenPicker.FileTypeFilter.Add(".wma");
fileOpenPicker.FileTypeFilter.Add(".mp3");
fileOpenPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
fileOpenPicker.ViewMode = PickerViewMode.List;
IReadOnlyList<StorageFile> files = await fileOpenPicker.PickMultipleFilesAsync();
which produced a nice interface (example), but in Windows 10, the same code displays the same interface as OpenFileDialog would (example), which is very hard to use on a touchscreen. Does anyone know how to get Windows 8/8.1 style FileOpenPicker in Windows 10, or knows an alternative?
In my application I have ask user to select folder (with standard folder picker that is not much touch friendly), but after this I have shown my own custom control that have display files in folder and let them select in touch friendly manner.
Related
I need to pick an image from photo galley or take new one, and after that crop the image by x*x (like Skype profile image picker for windows phone) and save it. I am developing an universal windows app with c# for windows 10 mobile and desktop.
I need use tools that the OS give me . and before in windows 8 and 8.1 there was PhotoChooserTask for this work but not in UWP windows 10
in screen there is a camera button for take new image or choose one of Photos and after pick one of them we can crop it.
You can use the FileOpenPicker to let the end user choose a picture :
var picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
And then use XamlCropControl to let him crop the picture
https://xamlcropcontrol.codeplex.com/
I have an app that captures images from the device's camera and saves them as StorageFiles to a folder in my app's roaming data. I've been trying to make a page that will open the image and show a preview, but I've been having many problems doing that, so I want to just open the image in the default photos app. However, I can't find any way to do that. Using await Launcher.LaunchUriAsync(new Uri(#"ms-appdata:///roaming/folder/img.jpg")); asks if I want to search for an app in the Store (searches for "ms-appdata"). Does the native Photos app for Windows (Phone) have a dedicated URI scheme? Also, I am targeting Windows 10 with this app, so the URI schemes (if any) may have changed.
Launcher.LaunchUriAsync is for launching an application using the URI scheme, this is not what you want.
Instead you'll want to launch an app based on a file:
Get the image as a StorageFile
var imageFile = await StorageFile.GetFileFromPathAsync(#"ms-appdata:///roaming/folder/img.jpg");
Then you tell the OS to launch an app to handle that file. It's then up to the user to choose which app to handle the image file:
var success = await Windows.System.Launcher.LaunchFileAsync(imageFile);
You can read more about "launching" files here.
I want to create an app which will let the user open an mp3 file.
I am using FileOpenPicker but get the error while creating an object of FileOpenPicker itself.
FileOpenPicker filePicker = new FileOpenPicker();
This line is throwing an error:
An exception of type 'System.NotSupportedException' occurred in PhoneApp1.DLL but was not handled in user code.
Can someone tell me what is the problem here.
Windows phone 8 don't support the FileOpenPicker https://wpdev.uservoice.com/forums/110705-dev-platform/suggestions/1897833-video-chooser-task. This feature was added in the windows phone 8.1
From MSDN:
In Windows 8 if you attempt to display the file picker while your app is snapped, the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped, or by unsnapping it before you call the file picker.
Link to Class: http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.pickers.fileopenpicker?cs-save-lang=1&cs-lang=csharp#code-snippet-1
I need to access videos on camera roll and also on Music+Video. but it seems there is no way at all.
Here in the documentation says we can use:
MediaLibrary library = new MediaLibrary();
But it only can access musics.
Can we say I should forget this thing for ever in WP8?
Unfortunately, there is no way to access videos in Media Library.
You have read-write access only to audio and photos.
See this answer: https://stackoverflow.com/a/13473349/1029518
There are a couple answers in the following thread which points out it is now feasible to read the video files via KnownFolders if you upgrade to Windows Phone 8.1: Windows Phone 8: Media file access
Here is an alternative option for accessing the videos (also in Windows Phone 8.1):
FileOpenPicker picker = new FileOpenPicker();
picker.ViewMode = PickerViewMode.Thumbnail;
picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
picker.FileTypeFilter.Add(".mp4");
picker.PickSingleFileAndContinue();
Once you have the file you should be able to play it back.
am developing an application which can fetch files from internet.. how do i download and save a "docx" or "wav" file from internet within the application and use it later with other application likes office or windows media player.
You can download files in the background (ie. they will continue even when your application is not running).
Having said that, you should research the types of files you need to support. For example, you can play an audio file (if the format is supported) or add it to Music hub but you cannot open a file in Office. Very few filetypes can be integrated with, so do some research before you start writing your app otherwise you might be disappointed.
place an image control in your page. here im1 is controls name.
it is working for me
string imgurl="http://.........";(path)
Uri addrs=new Uri(imgurl,UriKind.Absolute);
BitmapImage bitmap = new BitmapImage(addrs);
im1.Source = bitmap;