0 Replies Latest reply on Aug 26, 2009 10:52 PM by diego.volpe

    ImageSnapshot.captureBitmapData vs BitmaData.draw - smooth problem

    diego.volpe

      Trying to capture bitmaps from a RichEditableText component (SDK 4.0.0.9592) using ImageSnapshot.captureBitmapData ends up in a not smoothed image. It seems that the smooth argument takes no effect.

      Using BitmapData.draw the captured BitmapData seems to be smoothed.

      Am I missing something? Is that a bug ?

       

      Here is the code:

      [Bindable]
      private var imgText:BitmapData;
      
      protected function captureTextImage():void
      {
           var bmp:BitmapData = new BitmapData( txtFlow.width, txtFlow.height, true );
           bmp.draw( txtFlow, null, null, null, null, true );
           //bmp = ImageSnapshot.captureBitmapData( txtFlow, null, null, null, null, true );
           imgText = bmp;
      }
      
      ...
      
      <s:RichEditableText id="txtFlow"
           width="450" height="300" backgroundColor="0x0000FF" backgroundAlpha="0.2"
           textFlow="{TextFlowUtil.importFromXML(theXML)}"/>
      
      <s:BitmapImage source="{imgText}" width="{txtFlow.width}" height="{txtFlow.height}"/>
      
      

      Thanks