windows 8 - Loading Image from Content to StorageFile^ in Metro C++ -
I am trying to share an image in the Windows 8 Metro C ++ application using stock charms. To do this, I need to load the image StorageFile ^. I think it should look like this:
create_task (imageFile-> GetFileFromPathAsync ("textures / title.png")). Then ([this] (StorageFile ^ storageFile) {imageFile = storeFile;}); Where imageFile is defined in the header file
Windows :: archive :: storage file ^ imageFile; This actual code will throw this exeption
An invalid parameter was passed in a function that considers the invalid parameter deadly. This is very trivial, but there are very few documents about sharing in the Metro, and only Microsoft's example shows how to share using FilePicker.
If someone knows how to do this properly then it will be very grateful.
If "textured" is your application package, you should use the StorageFile :: GetFileFromApplicationUriAsync:
Yuri ^ uri = Refue New Uri ("MS-APX: /// Assets / Logo .png"); Then ([] (Task & lt; Storagefile ^ & gt; t) {Auto Storage File = T.Get (); AutoF = Storage File-> Filetype;}); You can also use work-based continuity to observe exception information more closely (as I showed above) In your case, the internal exception is: the specified path ( Property / logo.png) contains one or more invalid characters.
This is due to the forward-slash, if you change it to a backslash, see 'Ll: The specified path (property + logo.) Is not a complete path, and the relative path is not allowed.
If you want to use GetFileFromPathAsync, then I
To find out that your app is being installed and making its way from there
Comments
Post a Comment