I want to copy a file from the Assets folder to the local folder. For this example lets use the LockScreenLogo.scale-200.png file as it commes with the default template. The docs give an example of file access here, https://docs.microsoft.com/en-us/windows/uwp/files/file-access-permissions. If I modify that example to access LockScreenLogo and on MainPage.cpp it would look like
Windows::Foundation::IAsyncAction MainPage::ExampleCoroutineAsync()
{
Windows::Storage::StorageFile file{
co_await Windows::Storage::StorageFile::GetFileFromApplicationUriAsync(Windows::Foundation::Uri{L"ms-appx:///Assets/LockScreenLogo.scale-200.png"})
};
}
This doesn't compile. And no examples are given to copy a file from Assets to the LocalFolder. Which I access else where with
auto location = winrt::Windows::Storage::ApplicationData::Current().LocalFolder();
winrt::Windows::Storage::StorageFolder Locationf{ location };
How can I copy a file from the assets folder to the LocalFolder?