title: WritableBitmap to RandomAccessStreamReference
body: <p>i have next question:</p>
  
  <p>I have made a screenshot using WinRT XAML Toolkit (code1)</p>
  
  <p>Now i want to attach this WritableBitmap to email (code2)</p>
  
  <p><strong>CODE 1</strong></p>
  
  <pre><code>WriteableBitmap wb = null;
              var start = DateTime.Now;
              const int count = 1;
              for (int i = 0; i &lt; count; i++)
              {
                  wb = await WriteableBitmapRenderExtensions.Render(this);
              }
              var end = DateTime.Now;
              var duration = end - start;
              var renderInS = duration.TotalMilliseconds / count;
              if (renderInS &gt; 0)
              {
                  test.Source = wb;
                  // HERE MUST BE CODE INCLUDED
              }
  </code></pre>
  
  <p><strong>CODE 2</strong></p>
  
  <pre><code>DataPackage requestData = request.Data;
              requestData.Properties.Title = TitleInputBox.Text;
              requestData.Properties.Description = DescriptionInputBox.Text; // The description is optional.
  
              // It's recommended to use both SetBitmap and SetStorageItems for sharing a single image
              // since the target app may only support one or the other.
  
              List&lt;IStorageItem&gt; imageItems = new List&lt;IStorageItem&gt;();
              imageItems.Add(this.imageFile);
              requestData.SetStorageItems(imageItems);
  
              RandomAccessStreamReference imageStreamRef = RandomAccessStreamReference.CreateFromFile(this.imageFile);
              requestData.Properties.Thumbnail = imageStreamRef;
              requestData.SetBitmap(imageStreamRef);
              succeeded = true;
  </code></pre>
  
  <p>This means i need to firstly save image to local storage, and then read it and attach it.</p>
  
  <p><strong>The question:</strong></p>
  
  <p><strong>1) How to save WritableBitmap to applications local storage?</strong></p>
  
  <p><strong>2) Maybe there is a way not to save image to attach it?</strong></p>