Flex- 来自多个图像的位图数据(拖放) [英] Flex- Bitmapdata from multiple images (drag & dropped)

查看:26
本文介绍了Flex- 来自多个图像的位图数据(拖放)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉,如果问题标题有点令人困惑(不是很有创意:)问题就在这里.

Sorry, if the question title is little confusing (not very creative at it :) Here's the problem .

我在 Image 控件中显示了从 BitmapData 加载的图像.这个 Image 控件有 dragEnabled 并且用户可以在它上面拖放小图像(来自 TileList 中的一堆图像).

I have an image loaded from BitmapData displayed in an Image control. This Image control has dragEnabled and user can drag and drop small images (from a bunch of images in a TileList) on top of it.

从 Bitmapdata 加载的图像每次都可能因不同的分辨率而不同,并且图像控件将其缩小以适应其固定的高度/高度.但是在编辑后保存图像时,我将其保存为原始宽度/高度.为此,我将原始 Bitmapdata 存储在临时对象中,并在保存之前在其中应用任何编辑.

The image loaded from the Bitmapdata can be different every time with different resolution and the Image control scales it down to fit its fixed with/height. But while saving the image after editing I am saving it with its original width/height. For this purpose I am storing the original Bitmapdata in a temp object and applying any edits there before saving.

我的问题是我不知道如何创建结合大图像和放入其中的小图像的图像.可能是我可以使用显示对象快照,但随后我想保存图像及其原始高度/高度,最好在将其转换为 Bitmapdata 之后.有关如何解决此问题的任何帮助?

My problem here is that I have no clue on how to create an image combining the Large image and the small images dropped into it. May be I can use display object snapshot but then I want to save the image with its original with/height and preferably after converting it to Bitmapdata. Any help on how to go about this?

推荐答案

除了上一篇文章中的 merge method() 之外,您还可以使用 BitmapData::draw() 方法.http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw%28%29

In addition to merge method() from the previous post you can use BitmapData::draw() method. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw%28%29

该方法允许您合并缩放的位图,而 merge() 仅适用于原始大小的位图.

The method allows you to combine scaled bitmaps while merge() works only with original sizes of bitmaps.

这篇关于Flex- 来自多个图像的位图数据(拖放)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆