Actionscript 3.0 内的屏幕转储是否可能?

发布于 2024-08-08 08:11:50 字数 350 浏览 3 评论 0原文

我们现在有 Bitmap 和 Bitmapdata 对象。当使用网络摄像头时,我们可以从中获取原始像素数据输出。但是,我们能否以某种方式从“stage”或“swf”对象获取原始像素数据?

我想用它来制作 Actionscript 应用程序某些部分的“小缩略图”,这些缩略图可能是同时由动态文本、位图图形和影片剪辑组成的复杂组合。所以最好进行“快速快照”并将当前组合像素放入一个位图中,然后能够“保存以供以后使用”。

这可能吗?是不是太容易了?我只是在 Adob​​e Docs 中查找了错误的位置吗?

舞台上同时有图像、矢量等,所以我需要获取“舞台”对象位图数据???

We have Bitmap and Bitmapdata objects now. And when using the webcam, we can get raw-pixeldata output from it. But, can we get raw-pixeldata from the "stage" or "swf" object somehow?

I would like to use this to make "small thumbnails" of certain parts of Actionscript applications and these could be complex compositions of dynamic text, bitmap graphics and movieclips at the same time. So it would be nice to make a "quick snap" and just get the current combined pixels into one bitmap and then be able to "save that for later use".

Is that possible? is it too easy? am I just looking the wrong place in the Adobe Docs?

We have images, vectors etc at the same time on stage, so I need to grab the "stage" objects bitmapdata???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水中月 2024-08-15 08:11:50

创建一个 BitmapData 并调用其 draw() 方法与相应的DisplayObject

var bmpData:BitmapData = new BitmapData(sprite.width, sprite.height, true);
bmpData.draw(sprite);

如果你想让缩略图更小,创建一个Matrix并调用它具有所需缩放参数的 createBox 方法,并将其传递给 draw 方法。

var bmpData:BitmapData = new BitmapData(thumbW, thumbH, true);
var mat:Matrix = new Matrix();
mat.createBox(thumbW / sprite.width, thumbH / sprite.height);
bmpData.draw(sprite, mat);

Create a BitmapData and call its draw() method with the corresponding DisplayObject

var bmpData:BitmapData = new BitmapData(sprite.width, sprite.height, true);
bmpData.draw(sprite);

If you want to make thumbnails smaller, create a Matrix and call its createBox method with required scaling parameters and pass it to the draw method.

var bmpData:BitmapData = new BitmapData(thumbW, thumbH, true);
var mat:Matrix = new Matrix();
mat.createBox(thumbW / sprite.width, thumbH / sprite.height);
bmpData.draw(sprite, mat);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文