xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
privatevarrotateDeg:Number=0;
//鼠标滚动缩放
privatefunctionimgZoom(evt:MouseEvent):void
{
varp:Point =imgs.globalToLocal(newPoint(evt.stageX,evt.stageY));//指定以鼠标的所在位置 为中心 放大
varpt:Point =tf.globalToLocal(newPoint(evt.stageX,evt.stageY));
vartempMatrix:Matrix = imgs.transform.matrix;
vartempM:Matrix = tf.transform.matrix;
tempMatrix.translate(-p.x,-p.y);//1,限制放大缩小的上边框
tempM.translate(-p.x,-p.y);
if(evt.delta < 0)
{
tempMatrix.scale(0.9, 0.9);//向下滚动缩小
tempM.scale(0.9, 0.9);
}
else
{
tempMatrix.scale(1.1, 1.1);//向上滚动放大
tempM.scale(1.1, 1.1);
}
tempMatrix.translate(p.x,p.y);//1,限制放大缩小的下边框
tempM.translate(p.x,p.y);
imgs.transform.matrix = tempMatrix;
tf.transform.matrix = tempM;
rotateDeg = imgs.rotation;
}
]]>
-->