The answer is in the help files:
use the BitmapData of you image and set the smoothing argument 'true'
 

import flash.display.*;
import flash.geom.*;

var bmpd:BitmapData = new BitmapData(20,20);
var rect1:Rectangle = new Rectangle(0,0,10,10);
var rect2:Rectangle = new Rectangle(0, 10, 10, 20);
var rect3:Rectangle = new Rectangle(10, 0, 20, 10);
var rect4:Rectangle = new Rectangle(10, 10, 20, 20);
bmpd.fillRect(rect1, 0xAA0000FF);
bmpd.fillRect(rect2, 0xAA00FF00);
bmpd.fillRect(rect3, 0xAAFF0000);
bmpd.fillRect(rect4, 0xAA999999);

this.createEmptyMovieClip("bmp_fill_mc", this.getNextHighestDepth());
with (bmp_fill_mc) {
    matrix = new Matrix(); 
    matrix.rotate(Math.PI/8);
    repeat = true;
    smoothing = true;
    beginBitmapFill(bmpd, matrix, repeat, smoothing);
    moveTo(0, 0);
    lineTo(0, 60);
    lineTo(60, 60);
    lineTo(60, 0);
    lineTo(0, 0);
    endFill();
}

bmp_fill_mc._xscale = 200;
bmp_fill_mc._yscale = 200;

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of lincoln
Sent: Monday, February 05, 2007 16:34
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Antialiasing BitmapData in AS2?

I am also having a similar unsightly antialiasing or "ripping" issue
that I was hoping for a solution.  I have a jpg in flash that i'm
skewing and distorting while animating.  The combination of these
effects is causing a very noticeable ripping artifact in the image where
it looks as if the image is literally breaking apart and not being able
to catch up to the animation.

Does anyone know or have a proper sample of a technique to avoid this?
Smoothing on, of course...anything else?

-lm

On Feb 5, 2007, at 3:27 AM, Zeh Fernando wrote:

>> I guess an algorithm could be conceived that would somehow infer 
>> sub-pixel values, but this feels like it would be unnecessary faff, 
>> and very slow.
>> Anyone know of a quick-and-dirty way of smoothing a bitmap? I guess I

>> could render at a higher resolution than needed and scale down, to 
>> mimic calculating sub-pixels, but that also feels inefficient. There 
>> must be a clever cheaty way of doing this?
>
> From what I know, rendering at a higher size then scaling is the only 
> correct way; it's more or less what 3d cards do when rendering 
> antialias on games.
>
> All "antialiasing" techniques that take an image into account and try 
> to create antialias out of thin air will just be different blurring 
> techniques and will fail under certain specific situations. If you 
> only have 'rounded' linear art as the example you linked to this might

> be feasible as you won't have to worry abour corners, so blurring + a 
> few different threshold levels will create some nice antialias for 
> you... but I personally think rendering at a higher size then scaling 
> would be faster.
>
>
> Zeh
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training 
> http://www.figleaf.com http://training.figleaf.com
>

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to