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 LockScreen
public static class LockScreen
Public Static Class LockScreen
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
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
var uri = Windows.System.UserProfile.LockScreen.originalImageFile;
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.

See Also

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
var iRandomAccessStream = Windows.System.UserProfile.LockScreen.getImageStream();
Returns

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.

See Also

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 )
Windows.System.UserProfile.LockScreen.requestSetImageFeedAsync(syndicationFeedUri).done( /* Your success and error handlers */ );
Parameters
syndicationFeedUri
Uri Uri Uri Uri

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

Returns

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
Windows.System.UserProfile.LockScreen.setImageFileAsync(value).done( /* Your success and error handlers */ );
Parameters
value
IStorageFile 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.

See Also

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
Windows.System.UserProfile.LockScreen.setImageStreamAsync(value).done( /* Your success and error handlers */ );
Parameters
value
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream that contains the image data.

Returns

The object used to set the lock screen image.

See Also

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
var bool = Windows.System.UserProfile.LockScreen.tryRemoveImageFeed();
Returns
Platform::Boolean bool bool bool

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.

See Also