var cropedImage:BitmapData = new BitmapData(positionImage.width, positionImage.height);
var matrix:Matrix = new Matrix;
var matrixXY:Point = new Point();
var smooth:Boolean = false;
var bounds1 = positionImageMasking.getRect(this);
var bounds2 = positionImage.getRect(this);
matrixXY.x = (bounds1.x - bounds2.x)/positionImageMasking.scaleX;
matrixXY.y = (bounds1.y - bounds2.y)/positionImageMasking.scaleY;
trace("matrixXY.x = " + matrixXY.x);
matrix.tx = matrixXY.x;
matrix.ty = matrixXY.y;
matrix.scale(positionImageMasking.scaleX, positionImageMasking.scaleY);
//matrix.rotate(Math.PI/14);
if (positionImageMasking.scaleX != 1)
{
smooth = true;
}
cropedImage.draw(loadedBitmap.bitmapData, matrix,null,null,null,smooth);
var mc:MovieClip = new MovieClip();
mc.graphics.beginBitmapFill(cropedImage);
mc.graphics.drawRect(0, 0, positionImage.width, positionImage.height);
mc.graphics.endFill();
addChild(mc);
Category List
- Actionscript 3 (2)
- Digital Painting (1)
- Life style (1)
- Photoshop (1)
- Sencha Touch (1)
Blog Archive
-
▼
2010
(50)
-
▼
March
(12)
- Mootool | Native Array Sum Value in Elements
- Identify Font
- AS3 | Call Javascript Function
- AS3 | Stage no scale
- Flash AS3 | Why buttonMode not working
- AS3 Convert MovieClip or Display to BitmapData
- AS3 | Crop image
- Flash AS3 | Proportion Width and ScaleX
- Wamp & Another Package PHP | Virtual Host
- PHP | Config with Apache 2.2
- Flash AS3 | Open local Image
- Flash AS3 | Remove all child from display object
-
▼
March
(12)