flash AS3 有没有办法拍摄帧快照然后将其保存为 jpeg
有没有办法让 Flash AS3 拍摄帧快照,然后将其保存为 jpeg 而不使用类
is there a way for flash AS3 to take a snapshot of the frame and then save it as jpeg with out using classes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然...尝试在谷歌上搜索...有很多方法。这是假设您对标准 Flash 课程没问题。如果您的意思是完全不上课,那么祝您好运。
这是一种方法。 flash-php-upload
基本上关键点是你创建的一个 JPEG 编码器,它将您的图像编码为 JPEG(如果您愿意,也可以编码为 PNG),如下所示:
接下来,您可以通过首先将其数据绘制到位图来对舞台进行编码,然后对其进行编码:
现在取决于您使用的闪光灯你可以执行以下操作以提示用户保存:
或者,如果您想将其保存到服务器,您可以执行以下操作:
然后您需要一个包含以下内容的 PHP 文件:
请注意,我尚未测试此代码的错误,但总体思路是正确的,您应该能够使用它并对程序进行所需的更改。
Sure... try searching on google... there are tons of ways. That is assuming you are ok with the standard flash classes. If you literally mean no classes at all then good luck to you.
Here is one way of doing it. flash-php-upload
Basically the key points are you create a JPEG Encoder that will encode your image a JPEG (you could do a PNG if you want also) like this:
Next you encode the stage by first drawing its data to a bitmap, then ecoding that:
Now depending on what flash you are using you can do the following to prompt the user to save:
Or if you want to save it to the server you can do the following:
And then you need a PHP file with the following:
Please be aware that I have not tested this code for errors but the general idea is correct and you should be able to use it and make the changes you need for your program.