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

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

问题描述

对不起,如果问题标题有点令人困惑(不是很创意),这就是问题所在.

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加载的图像可能会有所不同,并且Image控件会按比例缩小图像以使其固定为高度/高度.但是在编辑后保存图像时,我将其保存为原始宽度/高度.为此,我将原始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/zh_CN/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-Bitmapdata(拖放)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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