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

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -

c# - Roxy file manager in MVC doesn't accept session path -