【问题标题】:how to store bitmaps into arrary in flex (action script3)?如何将位图存储到 flex 中的数组中(actionscript 3)?
【发布时间】:2009-05-08 09:42:21
【问题描述】:

在我的项目中,我为系统托盘图标使用了具有 16+16 32+32 48+48 128+128 不同尺寸图像的图像数组,但我穿上 bitmes 然后显示

错误 #2005:参数 0 的类型不正确。应该是 BitmapDat 类型。

public var imageURLs:Array = ['icon/toy.png','toy32.png','TOY48.png','joy128.png']; NativeApplication.nativeApplication.icon.bitmaps = new Array(imageURLs);

我做错了什么代码。如何将图像存储到位图数组?

【问题讨论】:

    标签: apache-flex actionscript-3 air flash


    【解决方案1】:

    您应该改用BitmapData 类。阅读有关BitmapBitmapDatahere 的更多信息。

    Here's Flex 任务栏图标教程。

    【讨论】:

    • NativeApplication.nativeApplication.icon.bitmaps = new Array(bitmapData());公共函数 bitmapData():BitmapData{ var myBitmapData:BitmapData = new BitmapData(40, 40, false, 0x0000FF00); var clockImage:BitmapData = new BitmapData(this.width, this.height,true,0x0011111); clockImage.draw(this);返回时钟图像;我试过这段代码,但它显示黑色图像图标。我想要我的数组存储图标。我在做什么?
    • 您需要先加载图像,然后将其复制到BitmapData。请通过第二个链接。
    • images.push(event.target.content.bitmapData) 是什么意思?你知道吗?
    • 在我的回答中添加了指向教程的链接。你的语句意味着'images'是一个BitmapData数组,'push'方法将一个bitmapData对象添加到这个数组中。
    猜你喜欢
    • 2010-10-09
    • 1970-01-01
    • 2010-11-03
    • 2014-05-13
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    • 1970-01-01
    • 2011-09-19
    相关资源
    最近更新 更多