Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this simple Code Image stream from Absolute url and store to isolated storage </p> <pre><code>namespace eQuadrigaWP7 { public class ItemViewModel : INotifyPropertyChanged { private string _imgURL; public string imgURL { get { return _imgURL; } set { if (value != _imgURL) { _imgURL = value; } } } private BitmapImage _Image; public BitmapImage Iimage { get { return _Image; } set { if (value != _Image) { _Image = value; } } } public void LoadIimage() { if (this.imgURL == null) throw new Exception("Error equadriga log"); HttpWebRequest downloadthumbnailrequest = (HttpWebRequest)WebRequest.Create(new Uri(this._imgURL)); ///this is main DownloadThumbNailState thumbnailState = new DownloadThumbNailState(); thumbnailState.AsyncRequest = downloadthumbnailrequest; downloadthumbnailrequest.BeginGetResponse(new AsyncCallback(HandleThumNailDownLoadResponse), thumbnailState); } private void HandleThumNailDownLoadResponse(IAsyncResult asyncResult) { DownloadThumbNailState thumbnailState = (DownloadThumbNailState)asyncResult.AsyncState; HttpWebRequest downloadthumbnailrequest = (HttpWebRequest)thumbnailState.AsyncRequest; thumbnailState.AsyncResponse = (HttpWebResponse)downloadthumbnailrequest.EndGetResponse(asyncResult); Stream imageStream = thumbnailState.AsyncResponse.GetResponseStream(); byte[] b = new byte[imageStream.Length]; imageStream.Read(b,0,Convert.ToInt32(imageStream.Length)); imageStream.Close(); MemoryStream ms = new MemoryStream(b); Deployment.Current.Dispatcher.BeginInvoke(() =&gt; { BitmapImage bmp = new BitmapImage(); bmp.SetSource(ms); String tempJPEG = "logo.jpg"; using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(tempJPEG)) { myIsolatedStorage.DeleteFile(tempJPEG); } IsolatedStorageFileStream fileStream = myIsolatedStorage.CreateFile(tempJPEG); WriteableBitmap wb = new WriteableBitmap(bmp); Extensions.SaveJpeg(wb, fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85); fileStream.Close(); this.Iimage = bmp; } }); } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String propertyName) { if (null != PropertyChanged) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public class DownloadThumbNailState { public HttpWebRequest AsyncRequest { get; set; } public HttpWebResponse AsyncResponse { get; set; } } } } ItemViewModel imageitem = new ItemViewModel(); imageitem.imgURL = "http://www.yoursite.in/bilder/9780199738663/titel.jpg"; imageitem.LoadIimage(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload