Skip to content

Instantly share code, notes, and snippets.

@RockyMyx
Created May 29, 2013 05:29
Show Gist options
  • Save RockyMyx/5668163 to your computer and use it in GitHub Desktop.
Save RockyMyx/5668163 to your computer and use it in GitHub Desktop.
C#: Read-Zip-In-Silverlight
var client = new WebClient();
client.OpenReadCompleted += (s, ex) =>
{
var info = new StreamResourceInfo(ex.Result, null);
var bitmapInfo = Application.GetResourceStream(info, new Uri("1.png", UriKind.RelativeOrAbsolute));
var bitmap = new BitmapImage();
bitmap.SetSource(bitmapInfo.Stream);
this.image1.Source = bitmap;
};
var url = Application.Current.Host.Source.AbsolutePath.Replace("SilverlightAis.xap", "1.zip");
client.OpenReadAsync(new Uri(url, UriKind.Relative));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment