使用装载器装入.BMP(位图)和.TIFF文件中的Flash 10位图、文件、BMP、TIFF

2023-09-09 21:33:32 作者:低喃一句有你真好

我正在开发使用Flash 10图片上传。 我使用的FileReference 对象浏览图像和装载机来显示图像:

I am developing a Image uploader using Flash 10. I am using FileReference object to browse images and Loader to show the image:

样品code:

var tempFileRef:FileReference = FileReference(ev.target);
var oLoader:Loader = new Loader();
oLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoad);
oLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
oLoader.loadBytes(tempFileRef.data);

它工作正常的 .JPG 和 .gif注意:文件,但是当我浏览.BMP或.TIFF文件,我得到的错误:

It works fine with .jpg and .gif files but when I browse .bmp or .tiff file, I am getting the error:

Error #2124: Loaded file is an unknown type.

有没有办法来加载和桌面显示浏览.BMP图像?

Is there a way to load and display browsed .bmp images from desktop?

感谢

推荐答案

BMPDe codeR从星火LIB类: 的http://www.libspark.org/svn/as3/BMPDe$c$cr/src/com/voidelement/images/BMPDe$c$cr.as

BMPDecoder class from Spark lib: http://www.libspark.org/svn/as3/BMPDecoder/src/com/voidelement/images/BMPDecoder.as

的使用示例: http://hi.baidu.com/leyhui /blog/item/d12be8b116ec915308230298.html

对于TIFFDe codeR,它的工作仍然在进行中,但非常有前途的:

Regarding TIFFDecoder, it is still work in progress, but very promising one:

HTTP://$c$c.google.com/p / windowsbitmapden codeR /