LockScreen
LockScreen
LockScreen
LockScreen
Class
Definition
Provides properties and methods to manage the full-screen image used as the lock screen background.
public : static class LockScreenpublic static class LockScreenPublic Static Class LockScreen// You can use this class in JavaScript.
- Attributes
| Device family |
Windows Desktop Extension SDK (introduced v10.0.10240.0)
|
| API contract |
Windows.System.UserProfile.UserProfileLockScreenContract (introduced v1)
|
Examples
This example uses the SetImageFileAsync method of this class to set the lock screen image. The variable file is assumed to be a previously assigned image.
Windows.System.UserProfile.LockScreen.setImageFileAsync(file);
Windows.System.UserProfile.LockScreen.SetImageFileAsync(file);
using namespace Windows::System::UserProfile;
LockScreen::SetImageFileAsync(file)
This example uses the GetImageStream method of this class to retrieve the lock screen image.
IRandomAccessStream imageStream = LockScreen.GetImageStream();
auto imageStream = Windows::System::UserProfile::LockScreen::GetImageStream();
Properties
OriginalImageFile OriginalImageFile OriginalImageFile OriginalImageFile
Gets the current lock screen image.
public : static Uri OriginalImageFile { get; }public static Uri OriginalImageFile { get; }Public Static ReadOnly Property OriginalImageFile As Uri// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
The Uniform Resource Identifier (URI) of the lock screen image.
Remarks
This property retrieves only files. If the image was set through a stream, this call will return E_FILE_NOT_FOUND.
Methods
GetImageStream() GetImageStream() GetImageStream() GetImageStream()
Gets the current lock screen image as a data stream.
public : static IRandomAccessStream GetImageStream()public static IRandomAccessStream GetImageStream()Public Static Function GetImageStream() As IRandomAccessStream// You can use this method in JavaScript.
The stream that contains the lock screen image data.
Examples
The following example demonstrates this method being used to retrieve the current lock screen image. For a full sample, see the Personalization app sample.
IRandomAccessStream imageStream = LockScreen.GetImageStream();
auto imageStream = Windows::System::UserProfile::LockScreen::GetImageStream();
Remarks
This method can be called only by apps that have set the "Picture Library Access" capability in the package manifest or by the app that set this image on the lock screen.
RequestSetImageFeedAsync(Uri) RequestSetImageFeedAsync(Uri) RequestSetImageFeedAsync(Uri) RequestSetImageFeedAsync(Uri)
Registers an RSS image feed to be used as a lock screen slideshow. (Windows 8.1 only)
public : static IAsyncOperation<SetImageFeedResult> RequestSetImageFeedAsync(Uri syndicationFeedUri)public static IAsyncOperation<SetImageFeedResult> RequestSetImageFeedAsync(Uri syndicationFeedUri)Public Static Function RequestSetImageFeedAsync(syndicationFeedUri As Uri) As IAsyncOperation( Of SetImageFeedResult )// You can use this method in JavaScript.
- syndicationFeedUri
- Uri Uri Uri Uri
The Uniform Resource Identifier (URI) of the RSS image feed.
One of the SetImageFeedResult values.
Remarks
The slideshow can be stopped by calling TryRemoveImageFeed.
Important
Using a Really Simple Syndication (RSS) feed as a lock screen image source is not supported on Windows 10. The method returns an expected result, but the lock screen slide show does not work due to changes to the Really Simple Syndication (RSS) feature in Windows 10.
SetImageFileAsync(IStorageFile) SetImageFileAsync(IStorageFile) SetImageFileAsync(IStorageFile) SetImageFileAsync(IStorageFile)
Sets the lock screen image from a StorageFile object.
public : static IAsyncAction SetImageFileAsync(IStorageFile value)public static IAsyncAction SetImageFileAsync(IStorageFile value)Public Static Function SetImageFileAsync(value As IStorageFile) As IAsyncAction// You can use this method in JavaScript.
The StorageFile object that contains the new image for the lock screen.
The object used to set the image for the lock screen.
SetImageStreamAsync(IRandomAccessStream) SetImageStreamAsync(IRandomAccessStream) SetImageStreamAsync(IRandomAccessStream) SetImageStreamAsync(IRandomAccessStream)
Sets the lock screen image from a data stream.
public : static IAsyncAction SetImageStreamAsync(IRandomAccessStream value)public static IAsyncAction SetImageStreamAsync(IRandomAccessStream value)Public Static Function SetImageStreamAsync(value As IRandomAccessStream) As IAsyncAction// You can use this method in JavaScript.
The stream that contains the image data.
The object used to set the lock screen image.
TryRemoveImageFeed() TryRemoveImageFeed() TryRemoveImageFeed() TryRemoveImageFeed()
Unregisters the image feed being used in the lock screen slideshow, stopping the slideshow. (Windows 8.1 only)
public : static PlatForm::Boolean TryRemoveImageFeed()public static bool TryRemoveImageFeed()Public Static Function TryRemoveImageFeed() As bool// You can use this method in JavaScript.
true if the image feed was disabled; otherwise, false.
Remarks
This image feed was registered through the RequestSetImageFeedAsync method.
Important
Using a Really Simple Syndication (RSS) feed as a lock screen image source is not supported on Windows 10. The method returns an expected result, but the lock screen slide show does not work due to changes to the Really Simple Syndication (RSS) feature in Windows 10.