views:

235

answers:

1

I need to move a ring with a solid border over an an image. I figured I would make the ring's inner area transparent using the bitmap.threshold() method and move it over the image. However the threshold() method's sourceRect parameter is a Rectangle and I need mine to be a circle.

This is the method:

**public function threshold(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, operation:String, threshold:uint, color:uint = 0, mask:uint = 0xFFFFFFFF, copySource:Boolean = false):uint**

Is this the correct way to do this or is there some other method.

Thanks

+1  A: 

You can make the non-masked regions complete transparent by setting their alpha's to 0. Colors in Actionscript can be represented as 4 byte (32 bit) values, the first byte (or was it the last?...) contains the alpha value. If you set this to 0, Flex will consider the portion with that color to be completely transparent.

So you can create a transparent rectangle and put a solid circle inside of it. Then you can just move this rectangle over your image. I believe there is no need to call the threshold function if you do this.

CookieOfFortune