简体   繁体   English

使用byteArray显示图像失败(未处理的IOErrorEvent :. text = Error#2124:加载的文件是未知类型)

[英]display image using byteArray failed (Unhandled IOErrorEvent:. text=Error #2124:Loaded file is an unknown type)

Problem:can't display jpeg image when using the byteArray as source . 问题:将byteArray用作source时,无法显示jpeg图像。

suppose there is an existing image named "card". 假设有一个名为“ card”的现有图像。 <Image id="card"/> . <Image id="card"/> Here is the scenario: 这是场景:

1.get bitmapData: var bitmapData:BitmapData = Bitmap(card.content).bitmapData 1.获取bitmapData: var bitmapData:BitmapData = Bitmap(card.content).bitmapData

2.get byteArray: var pixels:ByteArray = bitmapData.getPixels(bitmapData.rect) 2.get byteArray: var pixels:ByteArray = bitmapData.getPixels(bitmapData.rect)

3.attach the byteArray to an new Image: var another:Image = new Image(); another.source = pixels. 3.将byteArray附加到新的Image: var another:Image = new Image(); another.source = pixels. var another:Image = new Image(); another.source = pixels.

(I also tried to use another way, still can't work: var loader:Loader = new Loader(); loader.loader(pixels); ) loader.loader(pixels) will throw an error! (我也尝试使用另一种方法,但仍然无法正常工作: var loader:Loader = new Loader(); loader.loader(pixels);loader.loader(pixels)将引发错误! * The error is "Unhandled IOErrorEvent:. text=Error #2124":Loaded file is an unknown type * * 错误是“未处理的IOErrorEvent :。 text = Error#2124”:加载的文件是未知类型 *

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flash AS3文本=错误#2124:导入XML时加载的文件是未知类型? - Flash AS3 text=Error #2124: Loaded file is an unknown type when importing XML? Flex RSL-IE显示错误#2124:加载的文件是未知类型 - Flex RSL - IE shows Error #2124: Loaded file is an unknown type 错误 2124 未知类型 - Error 2124 Unknown Type 错误#2044:未处理的IOErrorEvent :。 text =错误#2038:文件I / O错误 - Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error 错误#2044:未处理的IOErrorEvent:。 text =错误#2032:流错误 - Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error 错误#2044:未处理的IOErrorEvent :。 text =错误#2032:流错误 - Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error 错误#2044:未处理的IOErrorEvent :。 text =错误#2032:流错误 - Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error 错误#2044:未处理的IOErrorEvent :。 Flash AS3 - Error #2044: Unhandled IOErrorEvent:. Flash AS3 如何修复错误:错误 #2044:未处理的 IOErrorEvent:。 文本=错误 #2035:未找到 URL - How to fix the error: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found Flex4调用的SWF文件中未处理的IOErrorEvent - Unhandled IOErrorEvent in SWF file called by Flex4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM