3 Replies Latest reply on Jul 7, 2011 7:43 AM by kglad

    Rotated GlowFilter looks bad

    Brian Vaughn Level 1

      I'm trying to apply a GlowFilter (border) to a image and then rotate+skew it. Unfortunately, doing this makes the filter look bad (jagged edges) even though the image itself is smooth. I've tried a few things, including using different filters (like the DropShadowFilter).

       

      Here's a rough example of what I'm doing...

       

      const cardDeckBorderThickness:int = 2;
      const cardDeckScaleFactor:Number = .12;
      const cardDeckRotation:int = 30;
      const cardDeckSkew:int = -20;
      
      
      
      var image:Image = new Image();
      image.source = /* image here */;
      image.smoothBitmapContent = true;
      image.filters = [ new spark.filters.GlowFilter( 0xFFFFFF, 1, cardDeckBorderThickness, cardDeckBorderThickness, 255, BitmapFilterQuality.MEDIUM ) ];
      
      deckCardsContainer.addElement( image );
      var matrix:Matrix = image.transform.matrix;
      matrix.c = Math.tan( cardDeckSkew * ( Math.PI / 180 ) );
      
      var rotationPoint:Point = new Point( image.width / 2, image.height / 2 );
      rotationPoint = matrix.transformPoint( rotationPoint );
      
      matrix.translate( -rotationPoint.x, -rotationPoint.y );
      matrix.rotate( cardDeckRotation * ( Math.PI / 180 ) );
      matrix.translate( rotationPoint.x, rotationPoint.y );
      
      matrix.scale( cardDeckScaleFactor, cardDeckScaleFactor );
      
      image.transform.matrix = matrix;
      
      

       

      Any suggestions?