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 ?
那里有AS3类/库可以帮助我吗?
2 个解决方案
#1
11
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.
实际上,使用刚刚发布的Flash 10,您可以保存到HD!对于这种情况,它非常方便。它非常安全,因为它只允许您在用户单击文件对话框中的“保存”后保存文件,您不能只是无所事事地编写文件。此外,还有已编写的代码,允许您使用BitmapData拍摄快照,并压缩为PNG或JPEG。我推荐PNG,因为它是无损的,这对于你正在创作的艺术品来说很不错。
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()
创建JPEG并将其保存到本地硬盘的示例
关于加载和保存文件的视频教程
另一个例子,这次是文本文件
FileReference.save()的API文档
#2
0
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.
如果是硬盘驱动器,除非您愿意使用Air,否则您可能会遇到困难。由于Flash的安全沙箱,您无法将任意文件写入用户的硬盘。
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.
如果您绝对必须使用Flash而不是Air将其保存到用户的硬盘驱动器,您可能必须将位图数据发送到服务器端PHP(或类似)脚本,然后允许用户下载并保存图像在一个位置或另一个位置。
#1
11
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.
实际上,使用刚刚发布的Flash 10,您可以保存到HD!对于这种情况,它非常方便。它非常安全,因为它只允许您在用户单击文件对话框中的“保存”后保存文件,您不能只是无所事事地编写文件。此外,还有已编写的代码,允许您使用BitmapData拍摄快照,并压缩为PNG或JPEG。我推荐PNG,因为它是无损的,这对于你正在创作的艺术品来说很不错。
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()
创建JPEG并将其保存到本地硬盘的示例
关于加载和保存文件的视频教程
另一个例子,这次是文本文件
FileReference.save()的API文档
#2
0
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.
如果是硬盘驱动器,除非您愿意使用Air,否则您可能会遇到困难。由于Flash的安全沙箱,您无法将任意文件写入用户的硬盘。
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.
如果您绝对必须使用Flash而不是Air将其保存到用户的硬盘驱动器,您可能必须将位图数据发送到服务器端PHP(或类似)脚本,然后允许用户下载并保存图像在一个位置或另一个位置。