Flex- Bitmapdata from multiple images (drag & dropped)

吃可爱长大的小学妹 提交于 2019-12-25 15:04:29

问题


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?


回答1:


Maybe this will help: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#merge()




回答2:


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.



来源:https://stackoverflow.com/questions/6167715/flex-bitmapdata-from-multiple-images-drag-dropped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!