Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7639981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:33:48+00:00 2026-05-31T08:33:48+00:00

In my application, I need to grab the thumbnail image from files picked using

  • 0

In my application, I need to grab the thumbnail image from files picked using File Picker. The following line throws COM exception when File Picker returns a file that does not have a thumbnail image such as an empty *.bmp file. How do I avoid this?

 StorageItemThumbnail t = await f.GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.DocumentsView);

EDIT: additional details and I meant .bmp not .png sorry…

To reproduce:

  1. Right click in any directory in Metro desktop mode, in the context menu click New->Bitmap Image
  2. In a test program, launch File Picker, then call GetThumbnailAsync on that file returned; you get the exception below.

Exception Details:

System.Runtime.InteropServices.COMException was unhandled by user code

HResult=-2147467259
Message=Error HRESULT E_FAIL has been returned
from a call to a COM component.
Source=mscorlib
ErrorCode=-2147467259 StackTrace:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
—some stuff ommitted—
InnerException: null

Code to launch the File Picker:

public static async Task<IReadOnlyList<StorageFile>> PickMulipleFilesAsync()
    {
        FileOpenPicker picker = new FileOpenPicker();
        picker.SuggestedStartLocation = PickerLocationId.Desktop;
        picker.FileTypeFilter.Add("*");
        var files = await picker.PickMultipleFilesAsync();

        return files;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:33:49+00:00Added an answer on May 31, 2026 at 8:33 am

    As mentioned in above comments and also by someone on MSDN forums. A workaround is simply the call to GetThumbnailAsync in a in a try-catch block and put a placeholder image when there is no thumbnail.

    StorageItemThumbnail t=null;
    BitmapImage thumbnailImage= new BitmapImage();//image used for display
    try{    
        t = await f.GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.DocumentsView);
    }
    catch(Exception e){
        t = null;
    }
    if (null == t)
        thumbnailImage = placeholder;//no thumbnail then use the placeholder image
    else 
        thumbnailImage.SetSource(t);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the java web application need to select the file from server and print
I am using the following query to grab delivery types from an SQL database,
In my C# application I need to create a .resx file of strings customized
In my iPhone application I need to show a video image in UITableView. Each
Using Classic ASP (stop tutting), I need to build an application that transfers high
I want to make an application that will grab the HTML from a website
I am using C# and ASP.NEt to create a web application where I need
Case: I need to feed my application a URL from any location on the
Here is the application I need help with: http://www.nypinball.com/inventory.php The entire box at the
My ASP.Net application generates an <asp:Table> from the codebehind. What I need is for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.