![]() Using the display objects getBounds function can be a reliable solution to translate the coordinates while drawing : private function drawOntoGraphics(source : IBitmapDrawable, target : Graphics, position : Point = null) : void Somewhat related but not so hot question: How to put an image (say, PNG) on a graphics in Flex 3? Target.drawRect(bounds.x + position.x, bounds.y + position.y, Target.beginBitmapFill(bitmapData, fillMatrix) Var fillMatrix:Matrix = new Matrix(1, 0, 0, 1, bounds.x + position.x, Var drawMatrix:Matrix = new Matrix(1, 0, 0, 1, -bounds.x, -bounds.y) īitmapData.draw(placeholder, drawMatrix) Var bitmapData:BitmapData = new BitmapData(bounds.width, bounds.height, Var bounds:Rectangle = placeholder.getBounds(placeholder) Var placeholder:MovieClip = new MovieClip() Var sourceCopy:MovieClip = new sourceClass() Var sourceClass:Class = getDefinitionByName(getQualifiedClassName(source))
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |