LockScreen LockScreen LockScreen LockScreen Class

Provides properties and methods to manage the full-screen image used as the lock screen background.

Syntax

Declaration

public static class LockScreenpublic static class LockScreenPublic Static Class LockScreenpublic static class LockScreen

Remarks

Examples

This example uses the SetImageFileAsync(IStorageFile) 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 summary

Gets the current lock screen image.

Methods summary

Gets the current lock screen image as a data stream.

Registers an RSS image feed to be used as a lock screen slideshow. (Windows 8.1 only)

Sets the lock screen image from a StorageFile object.

Sets the lock screen image from a data stream.

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

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 Uripublic static Uri OriginalImageFile { get; }

    Property Value

    • 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 IRandomAccessStreampublic static IRandomAccessStream GetImageStream()

    Returns

    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();
    
  • 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 )public static IAsyncOperation<SetImageFeedResult> RequestSetImageFeedAsync(Uri syndicationFeedUri)

    Parameters

    • syndicationFeedUri

      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 IAsyncActionpublic static IAsyncAction SetImageFileAsync(IStorageFile value)

    Parameters

    Returns

  • 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 IAsyncActionpublic static IAsyncAction SetImageStreamAsync(IRandomAccessStream value)

    Parameters

    Returns

  • TryRemoveImageFeed()
    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 boolpublic static bool TryRemoveImageFeed()

    Returns

    • bool
      bool
      bool
      bool

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

    Remarks

    This image feed was registered through the RequestSetImageFeedAsync(Uri) 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.

Device family

Windows Desktop Extension SDK (introduced v10.0.10240.0)

API contract

Windows.System.UserProfile.UserProfileLockScreenContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.System.UserProfile.dll