开发者

Composing multiple images - direction needed

My customer wants to develop a feature in his Android application which allows the user to compose images. The idea is that he has a region of the page onto which he can drag and drop an image taken from the image library on the device, or even from the device's camera. This image forms his background. Onto that background, he wants to be able to drop another image from his library. It should be possible to move, resize or even rotate this second image on the background of the first. Once he's completed his composition - and this process might happen more than once - he wants to save the resulting composite image in a form which can be uploaded to a web application.

I need to research the techniques and technologie开发者_开发百科s I need to be able to do this. Any pointers, suggestions, or assistance would be very welcome.

Thanks

Peter Hornby


For the interactive editing, I would keep track of the pictures, their coordinates and their rotations, and use the canvas drawing routines to render them in real time in your onDraw method.

Canvas#drawBitmap(Bitmap, Matrix, Paint) will allow you to pass a rotational matrix as you draw.

Bitmap.createBitmap(int, int, Bitmap.Config) (among other methods) will give you a "mutable" Bitmap, or one whose contents can be overwritten with new data. One of the Canvas constructors takes a Bitmap, allowing you to draw to your mutable bitmap in the same way as you do in your onDraw method. Then, you can save that bitmap to the SD card or upload it to your web server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜