bitmapdata的功能,不规则图形的遮罩
摘要:import flash.display.Bitmap;import flash.display.BitmapData;import flash.display.BitmapDataChannel;import flash.geom.Point;import flash.geom.Rectangle;var bmd1:BitmapData = new BitmapData(200, 200, true, 0xFFCCCCCC);var seed:int = int(Math.random() * int.MAX_VALUE);var channels:uint = BitmapDataChan
阅读全文
posted @
2013-09-27 02:40
猎妖手
阅读(541)
推荐(0)
使用BITMAPDATA制作残影效果
摘要:在MC运动的过程中,先对MC加入滤镜,然后建立一个bitmapdata进行绘制,踪迹由于colorTransform进行递减而消失。//实现1import flash.events.Event;var radius = 5;var particle = new Sprite();particle.graphics.lineStyle(2,0xffffff);particle.graphics.beginFill(0xffffff,0.8);particle.graphics.drawCircle(-radius,-radius,2 * radius);particle.graphics.end
阅读全文
posted @
2013-09-27 02:18
猎妖手
阅读(257)
推荐(0)
Flash使用bitmapData打造随机凹凸拼图效果
摘要:下午没事做,就弄了个随机切拼图效果,还没做判断,只是个切法的计算,稍后整理下就应该是个成品,嘿嘿~原理主要就是用bitmap进行切图,以前都是用遮照做太占资源.效果如下:http://www.wzsky.net/html/Photo/Flash/84950.html
阅读全文
posted @
2013-09-27 02:18
猎妖手
阅读(282)
推荐(0)
getColorBoundsRect() BitmapData抠图
摘要:为什么要去扣图?扣图的一般应用主要是为了处理一些png图片的大小问题,bitmapdata的大小消耗是bitmapdata的高宽大小决定的,因为一张png图包含的透明部分而设计往往懒于将每张图片都做到最小,所以一般这部分应该使用程序实现的,我们可以编写一个air项目对图片进行批处理,也可以根据实际在程序运行期间实现对图像大小的优化。怎么样去扣图?主要方法用到getColorBoundsRect来获取非透明区域的大小,getColorBoundsRect的参数可以方便的让我们赛选出非透明区域处理过程如下:bitmapdata.getColorBoundsRect(0xFF000000,0x000
阅读全文
posted @
2013-09-27 02:04
猎妖手
阅读(461)
推荐(0)
Truncating ByteArray Does Not Dispose Contents, Free Up Memory
摘要:http://www.ghostwire.com/blog/archives/as3-truncating-bytearray-does-not-dispose-contents-free-up-memory/When targeting Flash Player 10 or AIR 1.5, you can use theclear()method of theByteArrayclass to explicitly clear the contents of the byte array and free up the memory otherwise used by the bytes.
阅读全文
posted @
2013-09-12 03:03
猎妖手
阅读(247)
推荐(0)
Serializing A Bundle Of Bitmaps As Data Objects
摘要:http://www.ghostwire.com/blog/archives/as3-serializing-a-bundle-of-bitmaps-as-data-objects/[AS3] Serializing A Bundle Of Bitmaps As Data ObjectsPublished bysunnyat 2:31 pm underFlash,Flash AS3,TipsThis post is a supplement to“Serializing Bitmaps (Storing BitmapData As Raw Binary/ByteArray)”. In that
阅读全文
posted @
2013-09-12 03:01
猎妖手
阅读(276)
推荐(0)
Bitmap序列化(将BitmapData保存为原生Binary/ByteArray)
摘要:当应用程序需要将位图图像保存到本地或发送到服务端时, 通常的方法是在发送数据前将图像通过PNG或JPEG编码。如果只是想保存位图图像,只要序列化BitmapData即可,将图像转换为JPEG/PNG是完全没有必要的。BitmapData 转换为 ByteArray获得BitmapData对应的字节数组, 所要做的只是调用getPixels()方法。getPixels()方法需要指定捕捉区域;最便捷的方法就是使用即将序列化的BitmapData的rect属性。// ActionScript 3.0// 假定“bitmapImage”是需要序列化的位图对象var bytes:ByteArray =
阅读全文
posted @
2013-09-12 02:57
猎妖手
阅读(954)
推荐(0)