开发者

save screenshot image to file in Flex 4

I need the user of my Flex application to be able to save a snapshot of part of the UI to a local jpg file. I got the screenshot part down - can generate an image out of a开发者_JAVA百科ny given control. However, the only way I see to let the user save the image locally is to send to my server which would return it with the appropriate Content-Disposition.

I really hope I can avoid this silly round-trip to the server. Any ideas?


You can avoid this round trip if you are targeting only Flash player 10. The FileReference class FP10 has a save method that lets you save a file to local machine; of course you still need the user's confirmation to do it.


If you want to reuse the jpg file in your Flex application you could save it as Flash Cookie via SharedObject to the local filesystem and restore it later. In this case you must be aware of the Flash Cookie size limit which is typically set to 100KB.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜