1 Reply Latest reply on Apr 25, 2010 9:27 PM by UbuntuPenguin

    Image Size Mangling

    UbuntuPenguin Level 4

      TL;DR  Adding to a Group another Group than contains an image mangles the image's size.


      Hello Everyone ,

        I have a Group (ParentGroup) and I am adding another group to it (ChildGroup).  ChildGroup contains an image , and is set to be the full size of the image it contains.  When ChildGroup has an image that is relatively large ( 300 x 400 ) everything works okay.  But when the image in ChildGroup is small ( 20 x 20 ) ,it gets mangled when added to ParentGroup.

             By mangled I mean  , a square image somehow comes out looking like a rectangle ?  Using a tooltip to verify the image  shows that it has the "correct" dimensions , but it clearly is wrong.  I am adding childGroup to parentGroup using *.addElement


      Here is the pseudo code for ParentGroup:

      <s:Group >
              <s:BasicLayout />
          <s:BorderContainer width="100%" height="100%" >
                  <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />


      Here is the pseudo code for the ChildGroup:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Group toolTip="{'Width: ' + this.width + ' Height: ' + this.height}"  width="{image.width}" height="{image.height}">
              <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"  />
          <s:BorderContainer width="100%" height="100%" >
              <s:Graphic x="0" y="0" width="100%" height="100%">
                  <s:BitmapImage width="100%" height="100%"
                                 smooth="true" fillMode="scale"
                                 source="{image.bitmapData}" />       



      Sincereley ,