Here is my code:
Uri u = new Uri(@"C:\roomieUser\w3.tif");
Windows.System.UserProfile.LockScreen.RequestSetImageFeedAsync(u);
I am trying to change the lock screen in a Windows forms application. I have managed to use WinRT libraries in Windows forms application and there are two methods to change picture one is written above and other is as below
LockScreen.SetImageFileAsync(); //But it requires IStorageFile passed in method
I have pictures stored in "resources" folder, is there any method to convert/use these pictures as IStorageFile
?
File path is correct but when I tries to run it shows an error message that
Element not found. (Exception from HRESULT: 0x80070490)
LockScreen.RequestSetImageFeedAsync
is supposed to be called with a Uri pointing to an RSS feed, not an image. This method is deprecated in Windows 10.
You can use StorageFile.GetFileFromApplicationUriAsync
to get files from the application's resources folder.
User contributions licensed under CC BY-SA 3.0