Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

LockScreen Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public ref class LockScreen abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.System.UserProfile.UserProfileLockScreenContract, 65536)]
class LockScreen final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.System.UserProfile.UserProfileLockScreenContract), 65536)]
public static class LockScreen
Public Class LockScreen
Inheritance
Object Platform::Object IInspectable LockScreen
Attributes

Windows requirements

Requirements Description
Device family
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
API contract
Windows.System.UserProfile.UserProfileLockScreenContract (introduced in v1.0)

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::Foundation::IAsyncAction MainPage::ExampleCoroutineAsync(Windows::Storage::StorageFile const& file)
{
 co_await 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();
Windows::Storage::Streams::IRandomAccessStream imageStream{
 Windows::System::UserProfile::LockScreen::GetImageStream()
};
auto imageStream = Windows::System::UserProfile::LockScreen::GetImageStream();

Properties

Name Description
OriginalImageFile

Gets the current lock screen image.

Methods

Name Description
GetImageStream()

Gets the current lock screen image as a data stream.

RequestSetImageFeedAsync(Uri)

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

SetImageFileAsync(IStorageFile)

Sets the lock screen image from a StorageFile object.

SetImageStreamAsync(IRandomAccessStream)

Sets the lock screen image from a data stream.

TryRemoveImageFeed()

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

Applies to

See also


Feedback

Was this page helpful?