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

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

问题描述

对不起,如果问题标题有点混乱(不是非常有创意:)这是问题。

我从BitmapData中加载图像显示在图像控制。这个Image控件有dragEnabled,用户可以在它的顶部拖放小图像(从TileList中的一堆图像)。

从Bitmapdata加载的图像每次分辨率不同时都会有所不同,Image控件会缩小图像以适合其固定的高度。但在编辑后保存图像时,我将其原始宽度/高度保存。为此,我将原始Bitmapdata存储在一个临时对象中,并在保存之前对其进行编辑。



我的问题在于,我不知道如何创建一个图像,将大图像和小图像合并到一起。可能是我可以使用显示对象快照,但然后我想保存图像的原始与/高度,最好转换为Bitmapdata后。任何帮助如何去做这个?除了从前面的帖子合并方法(),你可以使用BitmapData :: draw()方法。
http ://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw%28%29



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


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

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.

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.

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?

解决方案

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

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

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

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