动态获取位图数据

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了动态获取位图数据相关的知识,希望对你有一定的参考价值。

  1. public static function getBitmapData(target:DisplayObjectContainer) : BitmapData
  2. {
  3. var bounds : Rectangle = new Rectangle();
  4. bounds = target.getBounds(target);
  5. var matrix : Matrix = new Matrix(1, 0, 0, 1, 0 - bounds.x, 0 - bounds.y);
  6. matrix.scale(1, 1);
  7. //for png data set the transparent to true, otherwise just leave as false
  8. var bmd : BitmapData = new BitmapData(bounds.width, bounds.height, true);
  9. bmd.draw(target, matrix, null, null, null, true);
  10. return bmd;
  11. }

以上是关于动态获取位图数据的主要内容,如果未能解决你的问题,请参考以下文章

有时在获取文件缩略图时位图是颠倒的

将base64转换为图像是给出位图数据

SeekBar:从 Drawable 获取空位图,直到将其设置为 ImageView 或如何从 9patch 获取结果位图

android从onPreviewFrame获取像素数据转换为位图

太有用了,所以转:Delphi下16进制位图数据转位图

将视频帧捕获到位图数据(额外-将位图添加到PV3D材质)