Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does WinRT handle BitmapImage and Image memory
    primarykey
    data
    text
    <p>I am new to programming <strong>Windows</strong> Store Apps with <code>C#</code> and I am trying to understand how image memory is handled. My app is very simple:</p> <p>1) it references a bitmap from a file using a <code>Windows.UI.Xaml.Media.Imaging.BitmapImage</code> object and then uses that as the Source for a <code>Windows.UI.Xaml.Controls.Image</code> object. In my case the image on disk has larger dimensions than what is being displayed on screen so it is being scaled by the system.</p> <p>My question is how does <strong>WinRT</strong> handle the memory for the image? I used the <em><code>vmmap</code></em> tool and I see in the Mapped File section there is an entry for my image file. I guess this means that the raw bytes for this file are fully loaded into memory. Since this is a JPG these bytes must be decoded into pixel bytes. It seems from my tests that setting the UriSource of the BitmapImage doesn't actually cause any processing to take place since it takes 0 ms and that instead there is some lazy loading going on.</p> <p>So the questions are: Which object is dominator of the the uncompressed unscaled pixel data? What object is the dominator for the scaled pixel data that gets drawn on screen? Are there tools that can easily show me this? In the Java world I use the Eclipse memory analyzer tool. I tried using PerfView but the results make no sense to me, it seems the tool was meant for analyzing performance.</p> <p><strong>UPDATE</strong>:</p> <p>At the BUILD conference the team discussed the <code>Windows Performance Toolkit</code>. I never heard anyone mention PerfView so I believe that WPT is the latest and greatest tool for analyzing memory and performance, here is a link:</p> <p><a href="http://msdn.microsoft.com/en-us/performance/cc825801.aspx">http://msdn.microsoft.com/en-us/performance/cc825801.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    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.
 

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