4 Replies Latest reply: Mar 25, 2010 4:41 PM by polatkanfatih RSS

    image over image

    polatkanfatih Community Member

      i want to put an image over another one like a watermark.... i tried it but images laying out like in table rows... how can i  do this?

       

      thanks...

        • 1. Re: image over image
          Matt Le Fevre Community Member

          you'd probably have to set the 'layout' attribute to 'absolute' and position the x/y coords manually

          • 2. Re: image over image
            polatkanfatih Community Member

            thanks for your answer but neither HBox nor image have layout property...

            • 3. Re: image over image
              Matt Le Fevre Community Member

              HBoxs have their layout set by default to 'horizontal', hence the name Hbox.

               


              try wrapping both images in a canvas.

               

              eg:

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
                  <mx:Box>
                      <mx:Canvas id="canv1">
                          <mx:Image source="http://republika.pl/blog_lz_3164469/3322912/tr/banan_2004609d.jpg"/>
                          <mx:Label text="Watermark" fontSize="24" x="{canv1.width/2 - 50}" y="{canv1.height/2 - 50 }"/>    
                          <mx:Label text="Watermark" fontSize="24" x="{canv1.width/2 - 50}" y="{canv1.height/2 + 50 }"/>
                      </mx:Canvas>
                  </mx:Box>
              </mx:Application>
              
              

               

              simply replace the labels with another image

               

               

              and make sure it has transparency

              • 4. Re: image over image
                polatkanfatih Community Member

                thanks very much....