Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Uwp 如何在应用程序中显示文件和文件夹的缩略图?_Uwp - Fatal编程技术网

Uwp 如何在应用程序中显示文件和文件夹的缩略图?

Uwp 如何在应用程序中显示文件和文件夹的缩略图?,uwp,Uwp,我正在构建一个应用程序,我想在其中显示光盘中文件和文件夹的缩略图。如何操作?一旦您有权访问文件夹(通过使用FolderPicker的用户选择或通过图片库等功能),您就可以从系统中检索缩略图。您可以使用getScaledImageAshumbnailAsync()进行此操作。例如: private async Task<BitmapImage> GetThumbnail(StorageFile file) {     if (file != null)     {         St

我正在构建一个应用程序,我想在其中显示光盘中文件和文件夹的缩略图。如何操作?

一旦您有权访问文件夹(通过使用
FolderPicker
的用户选择或通过
图片库
等功能),您就可以从系统中检索缩略图。您可以使用
getScaledImageAshumbnailAsync()
进行此操作。例如:

private async Task<BitmapImage> GetThumbnail(StorageFile file)
{
    if (file != null)
    {
        StorageItemThumbnail thumb = await file.GetScaledImageAsThumbnailAsync(ThumbnailMode.VideosView);
        if (thumb != null)
        {
            BitmapImage img = new BitmapImage();
            await img.SetSourceAsync(thumb);
            return img;
        }
    }
    return null;
}
private异步任务GetThumbnail(存储文件)
{
如果(文件!=null)
    {
StorageItemThumbnail=wait file.getScaledImageAshumbnailAsync(ThumbnailMode.VideosView);
if(thumb!=null)
        {
BitmapImage img=新的BitmapImage();
等待img.SetSourceAsync(拇指);
返回img;
        }
    }
返回null;
}

一旦您有权访问文件夹(通过使用
FolderPicker
的用户选择或通过
图片库
等功能),您就可以从系统中检索缩略图。您可以使用
getScaledImageAshumbnailAsync()
进行此操作。例如:

private async Task<BitmapImage> GetThumbnail(StorageFile file)
{
    if (file != null)
    {
        StorageItemThumbnail thumb = await file.GetScaledImageAsThumbnailAsync(ThumbnailMode.VideosView);
        if (thumb != null)
        {
            BitmapImage img = new BitmapImage();
            await img.SetSourceAsync(thumb);
            return img;
        }
    }
    return null;
}
private异步任务GetThumbnail(存储文件)
{
如果(文件!=null)
    {
StorageItemThumbnail=wait file.getScaledImageAshumbnailAsync(ThumbnailMode.VideosView);
if(thumb!=null)
        {
BitmapImage img=新的BitmapImage();
等待img.SetSourceAsync(拇指);
返回img;
        }
    }
返回null;
}

您好,欢迎来到StackOverflow。请回顾如何提出有关stackoverflow的好问题您好,欢迎来到stackoverflow。请回顾如何提出有关stackoverflow的好问题