Lock​Screen Lock​Screen Lock​Screen 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
Attributes
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.10240.0)
API contract
Windows.System.UserProfile.UserProfileLockScreenContract (introduced v1)

Remarks

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

Gets the current lock screen image.

public static Uri OriginalImageFile { get; }public static Uri OriginalImageFile { get; }Public Static ReadOnly Property OriginalImageFile As Uri
Value
Uri Uri Uri

The Uniform Resource Identifier (URI) of the lock screen image.

Attributes

Remarks

This property retrieves only files. If the image was set through a stream, this call will return E_FILE_NOT_FOUND.

See Also

Methods

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
Returns

The stream that contains the lock screen image data.

Attributes

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.

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();
See Also

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 )
Parameters
syndicationFeedUri
Uri Uri Uri

The Uniform Resource Identifier (URI) of the RSS image feed.

Returns

One of the SetImageFeedResult values.

Attributes

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)

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
Parameters
value
IStorageFile IStorageFile IStorageFile

The StorageFile object that contains the new image for the lock screen.

Returns

The object used to set the image for the lock screen.

Attributes
See Also

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
Parameters
value
IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream that contains the image data.

Returns

The object used to set the lock screen image.

Attributes
See Also

TryRemoveImageFeed() TryRemoveImageFeed() TryRemoveImageFeed()

Unregisters the image feed being used in the lock screen slideshow, stopping the slideshow. (Windows 8.1 only)

public static bool TryRemoveImageFeed()public static bool TryRemoveImageFeed()Public Static Function TryRemoveImageFeed() As bool
Returns
bool bool bool

true if the image feed was disabled; otherwise, false.

Attributes

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.

See Also