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

后端 未结 2 703
既然无缘
既然无缘 2021-01-03 09:01

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 on

相关标签:
2条回答
  • 2021-01-03 09:40

    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.

    0 讨论(0)
  • 2021-01-03 09:52

    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()
    0 讨论(0)
提交回复
热议问题