Flash笔记之用位图填充圆

package { import flash.display.*; import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.geom.Matrix; import flash.net.URLRequest; public class Drawing extends Sprite { private var _loader:Loader; public function Drawing() { _loader = new Loader( ); _loader.load(new URLRequest("http://www.rightactionscript.com/samplefiles/image2.jpg")); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoad); } private function onImageLoad(event:Event):void { var bitmap:BitmapData = new BitmapData(_loader.width, _loader.height); bitmap.draw(_loader); var sampleSprite:Sprite = new Sprite( ); sampleSprite.graphics.beginBitmapFill(bitmap,new Matrix(),false,true); sampleSprite.graphics.drawCircle(100, 100, 100); sampleSprite.graphics.endFill( ); addChild(sampleSprite); } } }

你可能感兴趣的:(Flash笔记之用位图填充圆)