FLASH save frame, to image (tiff, bmp, jpg, gif, png)

微笑、不失礼 提交于 2019-12-30 05:26:08

问题


The title sort of explains itself. I am making some 'genrative' artwork in flash. Now I want to save the frame without making a screenshot so-on and sofort. And perhaps one day i would like to save a batch of frames.

Is there an AS3 class/library out there that could help me out ?


回答1:


Actually, using the just released Flash 10, you CAN save to the HD! It's very handy, for just this situation. It's perfectly secure, because it only lets you save a file after the user clicks 'Save' in the file dialog, you can't just go writing files willy-nilly. Also, there is code out there already written that allows you to take snapshots using BitmapData, and compress to PNG or JPEG. I'd recommend PNG because it's lossless, which is nice for artwork you're creating.

Here's a few relevant links:

  • Example creating and saving a JPEG to local harddrive
  • Video tutorial about loading & saving files
  • Another example, this time with text files
  • API docs for FileReference.save()



回答2:


Do you want to save the file to a hard-drive or to a website?

If to a hard-drive, you might have a hard time unless you're open to using Air. Because of the security sandbox of Flash, you can't write arbitrary files to the user's hard disk.

If you absolutely must save it to a user's hard-drive using Flash and not Air, you'll probably have to send the bitmap data to a server-side PHP (or similar) script which will then allow the user to download and save the image in one location or another.



来源:https://stackoverflow.com/questions/273221/flash-save-frame-to-image-tiff-bmp-jpg-gif-png

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!