1 Reply Latest reply on Sep 3, 2008 10:15 AM by maxonico

    Strange behavior when using Bitmaps

    maxonico
      Hi everyone, I'm having a bad time with AIR and I would like to know if anyone can help. I'm making a flv player using AIR (using Flex3) that can capture images from the video, to achieve that I have a borderless window (showFlexChrome = false, SystemChrome = 'none', Transparent = true) and a simple method; everything goes fine in the main window, but when I try to open a new window (that I have previously created and contains an Image control) and pass a bitmap to it, the image appears cutted.

      In the image you can see what I'm talking about:

      Link to image

      And the complete code for the window:

      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Window xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="absolute" width="563" height="394" creationComplete="applyProps();registerMovementHandler()"
      showFlexChrome="false" transparent="true" systemChrome="none">
      <mx:Script>
      <![CDATA[
      private var _imgSource:Bitmap;
      private var _x:Number;
      private var _y:Number;

      public function registerMovementHandler():void {
      imgSnap.addEventListener( MouseEvent.MOUSE_DOWN, mouseDrag );
      }

      public function mouseDrag(event:MouseEvent):void {
      stage.nativeWindow.startMove();
      }

      public function set ImgSource(value:Bitmap):void{
      _imgSource = value;
      }

      public function set X(value:Number):void{
      _x = value;
      }

      public function set Y(value:Number):void{
      _y = value;
      }

      //wait 'til the image control is loaded
      private function applyProps():void{
      if(imgSnap!=null){
      imgSnap.source = _imgSource;
      imgSnap.x = 0; imgSnap.y = 0;
      }
      this.x = _x; this.y = _y;
      this.validateNow();
      }
      ]]>
      </mx:Script>
      <mx:Image x="10" y="10" id="imgSnap" width="541" height="372"/>
      </mx:Window>



      I would really appreciate your help, thanks!