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 6527909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:29:08+00:00 2026-05-25T09:29:08+00:00

I have programmed an application that it needs to download *.png files and set

  • 0

I have programmed an application that it needs to download *.png files and set it into the background of the button in WPF. So, when i run this program, it faces the Error as

No imaging component suitable to complete this operation was found.”

My code is as below :

First application downloads the file with WebClient class’s object:

System.Net.WebClient wClient = new System.Net.WebClient();
Uri downloadUri = new Uri(MyUri, UriKind.Absolute);
wClient.DownloadFileAsync(downloadUri, "MyImage.png");
wClient.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(wClient_DownloadFileCompleted);

and when download completed event occurred:

ImageBtn.Dispatcher.Invoke(new Action(() =>
{
    ImageBrush ib = new ImageBrush();
    BitmapImage bi = new BitmapImage();
    bi.BeginInit();
    bi.UriSource = new Uri("MyImage.png", UriKind.Relative);
    bi.EndInit();

    ib.ImageSource = bi;
    ImageBtn.Background = ib;
}

NOTE
Because of run these blocks of codes in BackgroundWorker, I use Dispatcher to set button Background property

So, when i run the program, System.NotSupportedException occurred as below :

Exception from HRESULT: 0x88982F50 Error Code : -2003292336 Message :
No imaging component suitable to complete this operation was found.
Source : PresentationCore Stack Trace : at
System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri
uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId,
Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream&
unmanagedMemoryStream, SafeFileHandle& safeFilehandle) at
System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri
baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy,
Boolean insertInDecoderCache) at
System.Windows.Media.Imaging.BitmapImage.FinalizeCreation() at
System.Windows.Media.Imaging.BitmapSource.CompleteDelayedCreation()
at System.Windows.Media.Imaging.BitmapSource.get_WicSourceHandle()
at System.Windows.Media.Imaging.BitmapSource.get_DUCECompatiblePtr()
at
System.Windows.Media.Imaging.BitmapSource.UpdateBitmapSourceResource(Channel
channel, Boolean skipOnChannelCheck) at
System.Windows.Media.Imaging.BitmapSource.AddRefOnChannelCore(Channel
channel) at
System.Windows.Media.Imaging.BitmapSource.System.Windows.Media.Composition.DUCE.IResource.AddRefOnChannel(Channel
channel) at
System.Windows.Media.ImageBrush.AddRefOnChannelCore(Channel channel)
at
System.Windows.Media.Brush.System.Windows.Media.Composition.DUCE.IResource.AddRefOnChannel(Channel
channel) at
System.Windows.Media.RenderData.System.Windows.Media.Composition.DUCE.IResource.AddRefOnChannel(Channel
channel) at System.Windows.UIElement.RenderContent(RenderContext
ctx, Boolean isOnChannel) at
System.Windows.Media.Visual.UpdateContent(RenderContext ctx,
VisualProxyFlags flags, Boolean isOnChannel) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.UpdateChildren(RenderContext ctx,
ResourceHandle handle) at
System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at
System.Windows.Media.Visual.Render(RenderContext ctx, UInt32
childIndex) at
System.Windows.Media.CompositionTarget.Compile(Channel channel) at
System.Windows.Media.CompositionTarget.System.Windows.Media.ICompositionTarget.Render(Boolean
inResize, Channel channel) at
System.Windows.Media.MediaContext.Render(ICompositionTarget
resizedCompositionTarget) at
System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object
resizedCompositionTarget) at
System.Windows.Media.MediaContext.RenderMessageHandler(Object
resizedCompositionTarget) at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs) at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler) at
System.Windows.Threading.DispatcherOperation.InvokeImpl() at
System.Threading.ExecutionContext.runTryCode(Object userData) at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Windows.Threading.DispatcherOperation.Invoke() at
System.Windows.Threading.Dispatcher.ProcessQueue() at
System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32
msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam, Boolean& handled) at
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs) at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler) at
System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority
priority, TimeSpan timeout, Delegate method, Object args, Int32
numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,
Int32 msg, IntPtr wParam, IntPtr lParam) at
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
frame) at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window) at
WPF_KSMMessenger.App.Main() in
C:\Users\Hossein\Desktop\WPF_KSMMessenger\WPF_KSMMessenger\obj\x86\Debug\App.g.cs:line
0 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()

What should I do to solve this problem?

Thanks for your attention.

  • 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-25T09:29:09+00:00Added an answer on May 25, 2026 at 9:29 am

    Your code works fine for me on a random image selected from Google images, so my guess is that the image you are downloading has an issue of some sort. You can try the following code in the handler right before Dispatcher.Invoke.

    var encoder = new PngBitmapEncoder();
    var image = new BitmapImage( new Uri( "MyImage.png", UriKind.Relative ) );
    encoder.Frames.Add( BitmapFrame.Create( image ) );
    
    using ( var stream = new FileStream( "MyImage2.png", FileMode.Create, FileAccess.Write ) )
    {
        encoder.Save( stream );
    }
    

    Then use “MyImage2.png” instead. It is an attempt to have the encoder “fix” the image before loading it into the brush. To be honest, while this code works for me, I almost didn’t post this because I have no idea if it will work for your situation, and I don’t like posting code when I don’t know the result. Definitely let me know if it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that is programmed in C# 3.5 under Windows. This application
I have a standalone application that needs to connect to a Sybase database via
I have an application that requires millions of subtractions and remainders, i originally programmed
I have a C++ application with data that needs to be shared with a
I have a WPF application that I need to have users access directories in.
I run an in-house application, programmed with visual studio 2008, that uses SQL Server
I have page that has some javascript that needs to run at page load.
I have recently programmed a console application and I've experienced a lot of pain
I have multiple IPs on a NIC. I've programmed a console application to connect
I have a software that allow to write add-on in javascript files (.js) that

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.