Apache flex Flex:如何从flash.display.Bitmap创建图像控件?
我需要从位图创建一个图像控件,因为我有一个ItemRedender用于列表控件Apache flex Flex:如何从flash.display.Bitmap创建图像控件?,apache-flex,image,list,itemrenderer,Apache Flex,Image,List,Itemrenderer,我需要从位图创建一个图像控件,因为我有一个ItemRedender用于列表控件 我正在尝试在列表控件中显示图像列表(位图),但现在无法显示。只需创建新图像并将图像源设置为位图,即可将位图用作图像。您可以这样做: var _image:Image = new Image(); _image.source = yourBitmap; 试试这个例子,希望这会有所帮助 请修改图像路径 <?xml version="1.0" encoding="utf-8"?> <mx:Applica
我正在尝试在列表控件中显示图像列表(位图),但现在无法显示。只需创建新图像并将图像源设置为位图,即可将位图用作图像。您可以这样做:
var _image:Image = new Image();
_image.source = yourBitmap;
试试这个例子,希望这会有所帮助 请修改图像路径
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
[Embed(source="assets/<image1>")]
[Bindable]
public var img1:Class;
[Embed(source="assets/<image2>")]
[Bindable]
public var img2:Class;
[Bindable]
private var arr:Array = new Array({image:img1},{image:img2});
]]>
</mx:Script>
<mx:List dataProvider="{arr}" width="100%" height="100%">
<mx:itemRenderer>
<mx:Component>
<mx:Image source="{data.image}"/>
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Application>