rcalt2vt
Topic Author
Posts: 17
Joined: 21 Feb 2014, 22:59

Xaml image atlas noobie question

21 Feb 2014, 23:15

I'm just getting started diving into Xaml and Noesis gui, and got to say really liking it so far. I'm running into something that isn't an issue with Noesis, but is causing me some heartache and thought those with experience might know what I am doing wrong.

The problem I am having is that in Blend and in Kaxaml, any Rectangle object using a fill from the image atlas is rendering in the preview as off, how off depends on the texture size used. It renders just fine using Noesis gui through unity though. I'm generating the image atlas using Texture Packer and the Xaml data format found on the Noesis gui github page.

Thoughts?

Also, how do I go about getting this forum account flagged as a Unity license user?
 
wckdspn
Posts: 67
Joined: 18 Aug 2012, 23:14

Re: Xaml image atlas noobie question

21 Feb 2014, 23:39

What's the DPI on the image?
 
rcalt2vt
Topic Author
Posts: 17
Joined: 21 Feb 2014, 22:59

Re: Xaml image atlas noobie question

22 Feb 2014, 00:05

72 dpi at 2048 x 2048, The odd part is, the way it looks (even though it's not correct) is the same in Blend and Kaxaml. Viewing it in Unity though with NoesisGUI and everything looks correct. Not a big deal, but slows down building UIs.

Xaml code is:
<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid>  
    <Grid.Resources>
      <ResourceDictionary Source="ArtTextureAtlas.xaml"/>
    </Grid.Resources>
  
    <Rectangle Fill="{StaticResource win_bkgr}" Width="454" Height="697"/>
    <Rectangle Fill="{StaticResource AbBar_Main}" Width="742" Height="120" VerticalAlignment="Bottom" />
  </Grid>
</Page>
Image Resource is:
<!-- Created using Noesis XAML exporter for TexturePacker (http://www.texturepacker.com) -->
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ImageBrush x:Key="AbBar_Main" ImageSource="ArtTextureAtlasXaml.png" Viewbox="2,2,742,120" ViewboxUnits="Absolute" Stretch="Fill"/>
    <ImageBrush x:Key="win_bkgr" ImageSource="ArtTextureAtlasXaml.png" Viewbox="1293,2,454,697" ViewboxUnits="Absolute" Stretch="Fill"/>
...
...
</ResourceDictionary>
 
wckdspn
Posts: 67
Joined: 18 Aug 2012, 23:14

Re: Xaml image atlas noobie question

22 Feb 2014, 00:13

WPF sizes everything by "virtual" pixels, such that 96 virtual pixels fit in one inch (then adjusts actual pixels when rendering). Try either A) removing DPI info from the image (if it is, for example, a PNG), or B) setting it to 96 DPI and see what effect that has.
 
rcalt2vt
Topic Author
Posts: 17
Joined: 21 Feb 2014, 22:59

Re: Xaml image atlas noobie question

22 Feb 2014, 00:17

I just have to say, I love you for that bit of info...and that has one of the more annoying things I've seen in a framework. Thanks man, switching the image to 96dpi resolved it.
 
User avatar
jsantos
Site Admin
Posts: 2923
Joined: 20 Jan 2012, 17:18
Contact:

Re: Xaml image atlas noobie question

22 Feb 2014, 12:46

Also, how do I go about getting this forum account flagged as a Unity license user?
I have contacted you in private about this.

Who is online

Users browsing this forum: Google [Bot] and 4 guests