2 Replies Latest reply on Jun 1, 2009 2:52 PM by vorpal

    BitmapData.draw wont work if TextField.antiAliasType is AntiAliasType.ADVANCED

    mmJez
      The following AS3 app illustrates my problem; A TextField with antiAliasType="advanced" wont draw any pixels if passed as a parameter to BitmapData.draw().

      A TextField with the same settings will happily render through DisplayObjectContainer.addChild().
      A TextField with the same settings but with antiAliasType="normal" will happily draw pixels with BitmapData.draw().

      Please show me what I have done wrong.
      If it is a bug (or a feature) then this is the last fcuking straw and I'm moving to a platform the works (like ie7 lol).

      Cheers
      Jeremy

      quote:


      package {

      import flash.text.AntiAliasType;
      import flash.display.Bitmap;
      import flash.display.BitmapData;
      import flash.display.Sprite;
      import flash.text.TextField;
      import flash.text.TextFormat;

      public class TestBitmapDraw extends Sprite{

      // Embed a font by name.
      [Embed(source="verdana.ttf", fontName="_verdana_regular", fontFamily="_verdana")]
      private var Font_Verdana:Class;

      public function TestBitmapDraw() {
      super();

      var tfmt:TextFormat = new TextFormat()
      tfmt.font = "_verdana_regular"

      var tf1:TextField = new TextField()
      tf1.embedFonts = true
      tf1.text = "TF1"
      tf1.setTextFormat(tfmt)
      tf1.x = 10
      tf1.y = 10
      addChild(tf1)
      // Will draw

      var tf2:TextField = new TextField()
      tf2.embedFonts = true
      tf2.antiAliasType = AntiAliasType.ADVANCED
      tf2.text = "TF2"
      tf2.setTextFormat(tfmt)
      tf2.x = 10
      tf2.y = 50
      addChild(tf2)
      // Will draw

      var tf3:TextField = new TextField()
      tf3.embedFonts = true
      tf3.text = "TF3"
      tf3.setTextFormat(tfmt)
      var bd1:BitmapData = new BitmapData(100, 40)
      bd1.draw(tf3)
      var bmp1:Bitmap = new Bitmap(bd1)
      bmp1.x = 110
      bmp1.y = 10
      addChild(bmp1)
      // Will draw

      var tf4:TextField = new TextField()
      tf4.antiAliasType = AntiAliasType.ADVANCED
      tf4.embedFonts = true
      tf4.text = "TF4"
      tf4.setTextFormat(tfmt)
      var bd2:BitmapData = new BitmapData(100, 40)
      bd2.draw(tf4)
      var bmp2:Bitmap = new Bitmap(bd2)
      bmp2.x = 110
      bmp2.y = 50
      addChild(bmp2)
      // DRAWS NOTHING!
      }
      }}