ResourceDictionary Texture Optimization
Hello! Hoping you are all well. Noesis is terrific and it is a joy to work with. I have an optimization question.
If I have a resource dictionary with definitions as follows:
...
Is this internally stored as a single texture? More specifically, is it 1x or 3x memory usage?
If I have a resource dictionary with definitions as follows:
Is this internally stored as one texture or two? More specifically, is it 1x or 2x memory usage?
Thanks!
If I have a resource dictionary with definitions as follows:
Code: Select all
<ImageBrush x:Key="Window_0_TL" ImageSource="Images/window chrome/popup/background_x1.png" ViewboxUnits="Absolute" Viewbox="0,0,20,20"/>
<ImageBrush x:Key="Window_0_T" ImageSource="Images/window chrome/popup/background_x1.png" ViewboxUnits="Absolute" Viewbox="20,0,426,20"/>
<ImageBrush x:Key="Window_0_TR" ImageSource="Images/window chrome/popup/background_x1.png" ViewboxUnits="Absolute" Viewbox="446,0,20,20"/>
Is this internally stored as a single texture? More specifically, is it 1x or 3x memory usage?
If I have a resource dictionary with definitions as follows:
Code: Select all
<ImageBrush x:Key="Fwd Light_Light" ImageSource="Images/context menu/actions/light/light.png" Stretch="None"/>
<ImageBrush x:Key="Lnd Light_Light" ImageSource="Images/context menu/actions/light/light.png" Stretch="None"/>
Thanks!
Re: ResourceDictionary Texture Optimization
We don't create extra textures. so if you have one texture in Unity, that the one we are using internally. So, in both examples you provided we are always using one texture and 1x memory usage.
Note that since 3.1, Sprites are supported in DataContexts and accessible to ImageSource properties in XAML using data-binding. See our Inventory sample.
Or if you prefer you can also use CroppedBitmap in XAML.
Note that since 3.1, Sprites are supported in DataContexts and accessible to ImageSource properties in XAML using data-binding. See our Inventory sample.
Or if you prefer you can also use CroppedBitmap in XAML.
Re: ResourceDictionary Texture Optimization
Understood, thank you!
Re: ResourceDictionary Texture Optimization
Hello! I am revisiting this question with a new variation. Let's say that I have a single XAML shape that is stored as a resource. If I have 100 instances of the XAML shape displayed in my NoesisView, is that 1x memory consumption or 100x memory consumption? Similarly, is it 1x rendering bandwidth or 100x rendering bandwidth? Thank you!
Re: ResourceDictionary Texture Optimization
There is a memory cost "per instance", not 100x, but probably 10-15x. For each instance there is a "cached" representation of the path optimized for rendering on the GPU. These are separate caches because each instance can be rendered at a different scale.
For the rendering, each path is rendered again (we don't cache into textures), so in this case, 100x
For the rendering, each path is rendered again (we don't cache into textures), so in this case, 100x
Who is online
Users browsing this forum: Semrush [Bot] and 88 guests