开发者

How do I get the BitmapData from a local image in Flex?

开发者 https://www.devze.com 2023-03-14 14:02 出处:网络
The image is already held locally on the client PC and it is an Air application. The image is not embedded, it is in the Application Storage directory.

The image is already held locally on the client PC and it is an Air application. The image is not embedded, it is in the Application Storage directory.

I have seen this question: How can i get a BitmapData object out of a File object from a 开发者_StackOverflowlocal jpeg file in AIR? but it uses URLRequest which I don't think is what I need because the file is local.


Using file.url will give you a url you can use with a URLRequest even though the file is local.


Did you try reading the image file using FileStream class's readBytes() method? This will give you a ByteArray representation of the image. I think you can create a new BitmapData Object using this info. I haven't tested this myself.

0

精彩评论

暂无评论...
验证码 换一张
取 消