Bitmap & BitmapData classes in Actionscript 3.0
来源:互联网 发布:万维网域名注册 编辑:程序博客网 时间:2024/05/01 08:03
- A Bitmap instance has oneBitmapData instance as property.
- When you use Loader to load an image, its property 'content' references to theBitmap object of the loaded image.
- If you have one variable of Bitmap type, you should create it by using 'new Bitmap()', then convet the 'content' toBitmap and assign it to your variable:_bm = Bitmap($e.target.content); target is referencing to the the loader instance.
- Of course, in some cases you have got the BitmapData instance of the image, then you can simply pass it toBitmap constructor: _bm = new Bitmap(bitmapdata);
- Bitmap is complex data type, so passing aBitmap type variable among functions will pass it as reference, that is Actionscript natural feature. And, if you add oneBitmap object to one Sprite, that will result in it be removed from its parent Sprite. So to pass a reference to aBitmap instance as parameter to function that may add it to Sprite, will not work. See the first picture.
- But if you pass BitmapData instance to a function, and in that function you create a brand newBitmap using that BitmapData, the BitmapData will be cloned. And that is what you expect. See the second picture.
pass Bitmap object:
pass BitmapData object:
download the sourcefile
REFS:
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d60.html
- Bitmap & BitmapData classes in Actionscript 3.0
- bitmap & bitmapdata
- Bitmapdata,从actionscript 到 android
- Bitmap与BitmapData
- Bitmap与BitmapData整理
- Bitmap 和 BitmapData 类
- RegExp in ActionScript 3.0
- Bitmap类和BitmapData类
- Constructor Overloading in Actionscript 3.0
- 位图——Bitmap和BitmapData(一)
- 用Bitmap/BitmapData 实现人物行走
- Bitmap图片处理的效率----BitmapData
- As3.0中的位图(Bitmap/BitmapData)编程
- As3.0中的位图(Bitmap/BitmapData)编程
- As3.0中的位图(Bitmap/BitmapData)编程
- As3.0中的位图(Bitmap/BitmapData)编程
- Bitmap图片处理的效率----BitmapData
- Reflection in Actionscript 3.0/Flex 2
- 虚拟继承、虚函数学习总结
- Linux下,Java图形界面程序中文显示不正常(显示为方格)问题解决
- linux上网老是断线的解决方法
- 16. 5. 3. 改变Stroke厚度-Changing the Thickness of the Stroking Pen
- Android 开发手记一 NDK编程实例
- Bitmap & BitmapData classes in Actionscript 3.0
- 配置编译内核
- 在Struts2中实现自定义分页标签全攻略(一)
- JSP漏洞大观
- Java Servlet及Cookie的使用
- jsp防盗链
- (JSP)如何将网页数据输出为Excel或Word文件
- 填充EXCEL打印
- QT3的MuitiLineEdit类到QT4的移植