c# - How to handle a BitmapImage when giving a image URI that doesn't exist? -


I am trying to download an image and it is a source of a bitmap image I'm setting in But there is potentially a case where the image does not exist, that is, the reaction is a 404. I am currently doing this:

  Bitmap image bitmap image = new bitmap image (new yuri ("link_ to_ iTage"));   

Although there is no error, I prefer to show the message or something instead of handling the case and displaying a blank code BitmapImage Is there a way to get the code? Or is there a different approach?

Subscribe to the bitmap image. accident. The reason for the failure can be read from the event handler.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -