Save screenshot of image to file in Flex 4

I need a user of my Flex application to be able to save a snapshot of part of the user interface in a local jpg file. I got a screenshot - it can generate an image from any given control. However, the only way a user can save the image locally is to send it to my server, which will return it with the appropriate Content-Disposition.

I really hope that I can avoid this stupid round trip to the server. Any ideas?

+3
source share
2 answers

You can avoid this round trip if you only target the Flash player 10. The FileReferenceFP10 class has a save method that allows you to save the file to your local computer; Of course, you still need user confirmation to do this.

+2
source

If you want to reuse the jpg file in your Flex application, you can save it as a Flash Cookie via SharedObjectto the local file system and restore it later. In this case, you should be aware of the Flash cookie size limit, which is usually set to 100 KB.

+1
source

Source: https://habr.com/ru/post/1751156/


All Articles