-1

I am trying to set source for an image. The catch here is the Uri for the image am receiving. The data is coming from the device lockscreen. The uri is

res://UIXMobileAssets{ScreenResolution}!lock.sms.dualsim1.png

The regular code

Image imgLogo = new Image();
imgNotificationThreeLogo.Source = new BitmapImage(new Uri(spliNotifications[1], UriKind.RelativeOrAbsolute));

throws exception "host name could not be parsed". Has anyone had any experience on this. Please help.

TIA. Appreciate your help!

Apoorva
  • 1,047
  • 13
  • 33

1 Answers1

-1

try this

        Image image = new Image();
        BitmapImage bmp = new BitmapImage();
        bmp.UriSource=new Uri (spliNotifications[1],UriKind.RelativeOrAbsolute);
        image.Source = bmp;
Ghazanfar Khan
  • 3,648
  • 8
  • 44
  • 89
  • 1
    This answer would be much better if there was some explanation of how this code solves the problem better than the user's existing code. – Heretic Monkey Mar 24 '15 at 15:45
  • I do not understand how this is any different from what is already in place? And also, tried it, doesn't work! – Apoorva Mar 25 '15 at 06:42
  • Do you debug the code ? Is image path value is coming? What you are getting in spliNotifications[1]? – Ghazanfar Khan Mar 25 '15 at 10:53