2009-05-08 23 views
0

在我的項目中我用16 + 16 32 + 32 48 + 48 128 + 128不同大小的圖像作爲系統托盤圖標的圖像陣列,但我把bitmes然後顯示如何將位圖存儲到flex中的動作(動作腳本3)?

錯誤#2005:參數0是類型不正確。應該是類型BitmapDat。

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

我錯了什麼代碼。如何將圖像存儲到位圖數組?

回答

0

您應改爲使用BitmapData類。閱讀更多關於BitmapBitmapDatahere

Here's有關Flex任務欄圖標的教程。

+0

NativeApplication.nativeApplication.icon.bitmaps = new Array(bitmapData()); 公共功能bitmapData():BitmapData {0} {0} {0}} var myBitmapData:BitmapData = new BitmapData(40,40,false,0x0000FF00); var clockImage:BitmapData = new BitmapData(this.width,this.height,true,0x0011111); clockImage.draw(this); return clockImage; } \t \t 我試過這段代碼,但它顯示黑色圖像圖標。我想我的數組存儲圖標。我做的事 ? – 2009-05-08 09:57:42

+0

dirkgently由於回覆我 – 2009-05-08 09:58:59

+0

您需要先加載圖像,然後將其複製到BitmapData。請通過第二個鏈接。 – dirkgently 2009-05-08 10:25:58