2011年3月30日

Matrix 旋转mc 注册点在mc的左上角

摘要: var myMatrix:Matrix = mc.transform.matrix;//计算原点/*var tempx,tempy;tempx = mc.x + mc.width / 2;tempy = mc.y + mc.height / 2;myMatrix.translate(-tempx,-tempy);myMatrix.rotate(30*Math.PI/180);myMatrix.translate(tempx,tempy);mc.transform.matrix = myMatrix;*//*var tempx,tempy;tempx=mc.x+mc.width/2;tempy= 阅读全文
posted @ 2011-03-30 10:45 602147629 阅读(384) 评论(0) 推荐(0) 编辑

getColorBoundsRect() BitmapData抠图

摘要: 为什么要去扣图?扣图的一般应用主要是为了处理一些png图片的大小问题,bitmapdata的大小消耗是bitmapdata的高宽大小决定的,因为一张png图包含的透明部分而设计往往懒于将每张图片都做到最小,所以一般这部分应该使用程序实现的,我们可以编写一个air项目对图片进行批处理,也可以根据实际在程序运行期间实现对图像大小的优化。怎么样去扣图?主要方法用到getColorBoundsRect来获取非透明区域的大小,getColorBoundsRect的参数可以方便的让我们赛选出非透明区域处理过程如下:bitmapdata.getColorBoundsRect(0xFF000000,0x000 阅读全文
posted @ 2011-03-30 10:27 602147629 阅读(1704) 评论(1) 推荐(0) 编辑