CoderzHeaven

March 29, 2012

How to set a Bitmap Image as Source of an image in Windows Phone 7?

This is a sample code snippet that adds a Bitmap as Source of an image in windows phone 7.

Uri uri = new Uri("Background.png", UriKind.Relative);StreamResourceInfo resourceInfo = Application.GetResourceStream(uri);BitmapImage bmp = new BitmapImage();bmp.SetSource(resourceInfo.Stream);image1.Source = bmp;

Assuming you have placed an image in the UI and named it image1.

Website PinFacebook TwitterMyspaceFriendfeedTechnoratidel.icio.usDiggGoogleStumbleUponPremium Responsive

Leave a Reply Cancel reply