1

My end goal here is to be able to add two (or more) images to a view/canvas, then turn that canvas into a single bitmap. I've seen many similar SO posts about dragging images around on a view, however, none of them cover dragging multiple images.

I am currently using the matrix commands to rotate and zoom, which work fine but only for one image. The code I am using is similar to this post. The issue here is that using fill_parent on the image will only allow for one image to be dragged because it is on top of the other image. Using wrap_content will only allow the image to be dragged within the confines of how big the image currently is, producing a cropped looking image.

So, is there anyway to edit this code (or use fresh code) to allow multiple images to be dragged and/or zoomed? As I've mentioned, there are many other SO posts about this but none have any solid answers.

Community
  • 1
  • 1
Nick
  • 6,375
  • 5
  • 36
  • 53

1 Answers1

1

Check out the demo app from the project Android Multitouch Controller, pretty much everything is done for you already. It lets you drag, rotate, and scale many images on a custom View. I've used this in the past for a custom image cropper, and it worked out great.

As for turning the resulting Canvas into a Bitmap, I've got a modified version of the Android Multitouch Controller project to do exactly that. You can see that project on GitHub.

wsanville
  • 37,158
  • 8
  • 76
  • 101
  • Thanks, I've noticed this library as well but was looking for more of a custom solution since I'll need to do a lot of tweaking. I'll give this library a shot and see if it will meet my needs. – Nick Dec 12 '12 at 21:09
  • I'd use it again, I found it pretty easy to adapt for my purposes, and it works reasonably well. – wsanville Dec 12 '12 at 21:12