Share via


LockScreen 类

定义

提供用于管理用作锁屏界面背景的全屏图像的属性和方法。

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
继承
Object Platform::Object IInspectable LockScreen
属性

Windows 要求

设备系列
Windows Desktop Extension SDK (在 10.0.10240.0 中引入)
API contract
Windows.System.UserProfile.UserProfileLockScreenContract (在 v1.0 中引入)

示例

此示例使用此类的 SetImageFileAsync 方法来设置锁屏界面图像。 假定变量 文件 是以前分配的映像。

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)

此示例使用此类的 GetImageStream 方法检索锁屏界面图像。

IRandomAccessStream imageStream = LockScreen.GetImageStream();
Windows::Storage::Streams::IRandomAccessStream imageStream{
    Windows::System::UserProfile::LockScreen::GetImageStream()
};
auto imageStream = Windows::System::UserProfile::LockScreen::GetImageStream();

属性

OriginalImageFile

获取当前锁屏界面图像。

方法

GetImageStream()

获取当前锁屏界面图像作为数据流。

RequestSetImageFeedAsync(Uri)

注册要用作锁屏界面幻灯片放映的 RSS 图像源。 (仅 Windows 8.1)

SetImageFileAsync(IStorageFile)

设置 StorageFile 对象的锁屏界面图像。

SetImageStreamAsync(IRandomAccessStream)

设置数据流中的锁屏界面图像。

TryRemoveImageFeed()

取消注册锁屏幻灯片中使用的图像源,停止幻灯片放映。 (仅 Windows 8.1)

适用于

另请参阅