如何截取 Flex Spark VideoDisplay 的屏幕截图?
我想构建一个组件,用户可以在其中在 Flex Spark VideoDisplay 中播放视频。会有一个按钮,每当按下该按钮时,我想保存 VideoDisplay 的当前时间以及屏幕截图。屏幕截图需要以某种方式保存,因为我想在 DataGrid 中显示所有时间和屏幕截图(当用户将鼠标悬停在 DataGrid 中的某个时间时,应该出现屏幕截图)。
那么,如何截取 Spark VideoDisplay 的屏幕截图并保存/显示它们?
I want to build a component, where the user can play a video in a Flex Spark VideoDisplay. There will be a button and whenever the button is pressed, I want to save the current time of the VideoDisplay plus a screenshot. The screenshot needs to be someway saved, because I want to display all times and screenshots in a DataGrid (screenshots should appear when the user hovers a time in the DataGrid).
So, how can I take screenshots of the Spark VideoDisplay and save/display them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过多种方式拍摄快照,这种方式仅使用 ImageSnapshot 类,但如果您愿意,您可以通过手动绘制视频显示的位图来完成。这是一个示例:
渲染器
示例应用程序
要准确完成您所描述的内容(拍摄快照并保存快照),您可以将它们存储在
takeSnapshot< 中的数组中/code> 方法,或者您可以循环遍历
list.dataProvider
来获取位图。然后您只需将它们传递给后端语言(ruby、python、php...)即可保存。希望有帮助,
槊
You can take snapshots a few ways, this way just uses the ImageSnapshot class, but you could do it by manually drawing the bitmap of the video display if you'd like. Here's a sample:
Renderer
Sample App
To accomplish exactly what you were describing (take snapshot and save snapshot), you could store those in an array in that
takeSnapshot
method, or you could loop through thelist.dataProvider
do get the bitmaps. Then you'd just need to pass them to a backend language (ruby, python, php...) to save.Hope that helps,
Lance
使用flex中的JPEGEncoder将其转换为bytearray,然后使用b64encoder对字节数组进行编码,如下所示:
现在您可以通过HTTP post方法将b64String传递到您的服务器:)
use the JPEGEncoder in flex to convert it to bytearray, and then encode the byte array using the b64encoder as follow:
Now you can pass your b64String to your server via HTTP post method :)