I want to save and load InkCanvas
gif
file without FilePicker
.
I saw a sample using FilePicker
, but I want to save the gif
file automatically when I click the save button.
For example, when I save 1 InkCanvas
gif
file,
Then the gif
file is saved at in a specific folder on my C: drive.
I also want the file name grow automatically, so that I can load specific InkCanvas
file.
Is this possible?
UWP apps run in a sandbox, so that the user can know what the app is doing and which files on her hard drive it accesses.
In case you want to save files to a location on the user's hard drive, you will have to be given access to this location first. There are several options how to achieve this:
FutureAccessList
, where you can store theStorageFile
under a key, which will allow you to retrieve it again next time.FutureAccessList
, where you can store theStorageFolder
under a key, which will allow you to retrieve it again next time.picturesLibrary
capability in the package.appxmanifest file and then get access to the user's pictures library for writing like this:Windows.Storage.StorageLibrary.GetLibraryAsync(Windows.Storage.KnownLibraryId.Pictures);
broadFileSystemAccess
capability in your app's manifest and then you can directly access any filesystem path the user has access to. The only problem with this is that you need to have a good reason to do this (like building a file explorer app, or similar), because this capability is checked during Microsoft Store Certification and it is possible that your app would get rejected if the presence of this capability would seem unnecessary for the type of application you are publishing.