Win10鎖屏壁紙怎麼保存下來

Win10的鎖屏壁紙質量頗高,不少用戶都希望把它們保存下來。如何保存Win10鎖屏壁紙呢?本文從多個方面進行詳細介紹。

一、鎖屏壁紙怎麼保存到相冊

如果您想把鎖屏壁紙保存到Win10相冊中,可以按照以下操作:

步驟1:右鍵點擊桌面空白處,選擇「個性化」。

步驟2:在「個性化設置」中點擊「鎖屏」。

步驟3:在「選擇您的鎖屏設置」中選中要保存的圖片,然後點擊「瀏覽」。

步驟4:選擇「本地磁盤」,在彈出的「保存為」窗口中,選擇保存的路徑和文件名,最後點擊「保存」即可。

代碼示例:

// C#代碼示例
// 獲取當前鎖屏壁紙
string wallpaperPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets");
string destinationPath = "D:\Pictures\";
Directory.CreateDirectory(destinationPath);
var fileNames = Directory.GetFiles(wallpaperPath);
foreach (string fileName in fileNames)
{
    try
    {
        File.Copy(fileName, Path.Combine(destinationPath, Path.GetFileName(fileName) + ".jpg"));
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex.Message);
    }
}

二、Win10鎖屏壁紙怎麼保存

如果你想保存Win10系統當前使用的鎖屏壁紙,可以使用Windows自帶的截圖工具或者第三方軟件進行截圖。

方式1:使用Windows自帶截圖工具

步驟1:按下Win+PrntScrn鍵,會自動將截圖保存到系統的默認圖片文件夾中。

方式2:使用第三方截圖軟件

推薦使用免費的截圖軟件Snipaste進行截圖,下載網址:https://www.snipaste.com/

代碼示例:

// C#代碼示例
private async void SaveWallpaperButton_Click(object sender, RoutedEventArgs e)
{
    var savePicker = new FileSavePicker();
    savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
    savePicker.FileTypeChoices.Add("JPEG file", new List() { ".jpg" });
    savePicker.SuggestedFileName = "LockScreen";
    var file = await savePicker.PickSaveFileAsync();
    if (file != null)
    {
        var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);
        RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();
        await renderTargetBitmap.RenderAsync(LockScreenContainer);
        var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
        var logicalDpi = DisplayInformation.GetForCurrentView().LogicalDpi;
        var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, fileStream);
        encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, (uint)renderTargetBitmap.PixelWidth, (uint)renderTargetBitmap.PixelHeight, logicalDpi, logicalDpi, pixelBuffer.ToArray());
        await encoder.FlushAsync();
        fileStream.Dispose();
    }
}

三、鎖屏壁紙圖片怎麼保存

如果你想保存從鎖屏圖片文件夾中選擇的特定圖片,可以按照以下步驟操作:

步驟1:打開文件夾,找到鎖屏壁紙所在的文件夾,默認路徑為:%localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets。

步驟2:在文件夾中選中要保存的圖片,複製到想要存儲的文件夾中。

代碼示例:

// C#代碼示例
private void SaveSelectedWallpaperButton_Click(object sender, RoutedEventArgs e)
{
    var folderPicker = new FolderPicker();
    folderPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
    folderPicker.FileTypeFilter.Add("*");
    var folder = folderPicker.PickSingleFolderAsync();
    if (folder != null)
    {
        var fileNames = SelectedWallpaperList.SelectedItems.Cast().ToList();
        foreach (string fileName in fileNames)
        {
            var wallpaperPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets", fileName);
            var destinationPath = Path.Combine(folder.Path, fileName + ".jpg");
            File.Copy(wallpaperPath, destinationPath);
        }
    }
}

四、鎖屏壁紙如何保存

如果你想將鎖屏壁紙設置為桌面壁紙,也可以進行保存,具體操作步驟如下:

步驟1:在「選擇您的鎖屏設置」中選擇要設置為桌面壁紙的鎖屏壁紙。

步驟2:點擊「更改為桌面壁紙」按鈕,就可以將其設置為桌面壁紙了。

代碼示例:

// C#代碼示例
private async void SetWallpaperButton_Click(object sender, RoutedEventArgs e)
{
    if (SelectedWallpaperList.SelectedItems.Count == 0)
    {
        return;
    }

    var fileNames = SelectedWallpaperList.SelectedItems.Cast().ToList();
    var wallpaperPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets", fileNames.ElementAt(0));
    if (!File.Exists(wallpaperPath))
    {
        return;
    }

    var wallpaperFile = await DownloadFile(wallpaperPath);
    if (wallpaperFile != null)
    {
        var profile = UserProfilePersonalizationSettings.Current;
        var result = await profile.TrySetWallpaperImageAsync(wallpaperFile);
        if (result)
        {
            await new MessageDialog("桌面壁紙已設置成功").ShowAsync();
        }
    }

    if (wallpaperFile != null)
    {
        await wallpaperFile.DeleteAsync();
    }
}

private async Task DownloadFile(string imageUrl)
{
    try
    {
        var fileUri = new Uri("ms-appdata:///local/" + Guid.NewGuid() + ".jpg");
        StorageFile destinationFile = await StorageFile.GetFileFromApplicationUriAsync(fileUri);
        StorageFile downloadedFile = await StorageFile.GetFileFromPathAsync(imageUrl);
        await downloadedFile.CopyAndReplaceAsync(destinationFile);
        return destinationFile;
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex.Message);
        return null;
    }
}

五、鎖屏屏保壁紙選取

如果你想選擇特定的圖片作為鎖屏壁紙,可以參照以下步驟選取:

步驟1:右鍵點擊桌面空白處,選擇「個性化」。

步驟2:在「個性化設置」中點擊「鎖屏」。

步驟3:在「選擇您的鎖屏設置」下方,點擊「瀏覽」按鈕,並選擇要設置為鎖屏壁紙的圖片即可。

代碼示例:

// C#代碼示例
private async void PickWallpaperButton_Click(object sender, RoutedEventArgs e)
{
    var picker = new FileOpenPicker();
    picker.ViewMode = PickerViewMode.Thumbnail;
    picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
    picker.FileTypeFilter.Add(".jpg");
    picker.FileTypeFilter.Add(".png");
    var file = await picker.PickSingleFileAsync();
    if (file != null)
    {
        var profile = UserProfilePersonalizationSettings.Current;
        var result = await profile.TrySetLockScreenImageAsync(file);
        if (result)
        {
            await new MessageDialog("鎖屏壁紙已設置成功").ShowAsync();
        }
    }
}

本文介紹了多種保存Win10鎖屏壁紙的方法,希望對你有所幫助。

原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/237518.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
小藍的頭像小藍
上一篇 2024-12-12 12:05
下一篇 2024-12-12 12:05

相關推薦

  • 如何下載Mac原生壁紙?

    要下載Mac原生壁紙,你可以按照以下方法操作。 一、從官方網站下載Mac原生壁紙 從蘋果官方網站下載Mac原生壁紙是最安全、最簡便的方法。以下是具體步驟: 1、打開蘋果官網,進入「…

    編程 2025-04-25
  • 分享遊戲中那些高清的壁紙(我的世界壁紙高清)

    作為一個,我的世界重度玩家,沒有幾張我的世界風格的壁紙,怎麼可以? 下面GG君就發你幾張!沒有水印的高清大圖!喜歡保存吧!記得關注我! 最後,來一張GG君,最喜歡的:

  • 必應每日壁紙:帶給你不一樣的視覺體驗

    必應每日壁紙是由Microsoft提供的一個全球性網絡服務,每天更新一張背景圖片。它的出現,讓用戶可以在不同時間、不同偏好下,享受到極具個性化的視覺體驗。 一、必應每日壁紙API …

    編程 2025-01-11
  • c語言替換壁紙,c語言動態壁紙

    本文目錄一覽: 1、怎麼用c語言寫一個設置壁紙的demo? 2、C語言怎麼設置一張圖片為桌面背景? 3、如何用C語言換桌面背景 怎麼用c語言寫一個設置壁紙的demo? (資料參考如…

    編程 2024-12-23
  • 開心助手改默認桌面,桌面助手怎麼設置壁紙

    本文目錄一覽: 1、開心助手怎麼刪除系統樂家桌面軟件 2、開心助手可以替換第三方桌面嗎 3、蘋果將手機助手設置到桌面 開心助手怎麼刪除系統樂家桌面軟件 1、首先要打開開心助手。 2…

    編程 2024-12-09
  • php畫背景圖片大全唯美傷感,php壁紙

    本文目錄一覽: 1、用php代碼怎麼以背景圖片加上文字生成新的圖片,然後在標題處絕對調用該圖片? 2、ppt背景圖片大全 唯美 3、用php做圖片的循環製作成一張文章的背景圖片 4…

    編程 2024-12-05
  • python微軟壁紙,python代碼壁紙

    本文目錄一覽: 1、做windows界面,用QT還是MFC? 2、python怎麼在桌面創圖標 3、python不能弄到筆記本電腦桌面嗎 4、python安裝好了怎麼弄到桌面上 做…

    編程 2024-11-26
  • 蘋果手機怎麼設置壁紙

    手機壁紙便是我們常說的屏幕背景圖,一張好看的手機壁紙能使我們的心情變得愉悅。這個壁紙可以是風景、美食、喜歡的偶像、自己養的寵物,或者是你的家人、朋友。 擁有特殊含義的照片會更讓人想…

    2024-11-21
  • 華為Mate60Pro如何設置全景天氣壁紙

    華為Mate 60 Pro是今年華為中非常火熱的機型之一,華為Mate 60 Pro不僅僅升級了處理器以及各種配置,而且還為用戶們帶來了很多新的功能應用,從華為Mate 60 Pr…

    2024-11-21
  • 探秘unsplash壁紙

    一、unsplash壁紙官網 Unsplash(https://unsplash.com/)是一個免費、開放的圖片庫,提供高清晰度的圖片,壁紙等資源,任何人可以免費使用、複製、修改…

    編程 2024-11-14

發表回復

登錄後才能評論