0

I'm trying to overlay several images[to form a building plan with possible zoom]. The point is to choose which images to averlay each time depending on selected filters[staff, equipements ...].

After doing researches, I implemented the zoom using a WebView but I didn't find a way to make this webview take different images at once [which is possible with ImageView using LayerDrawable].

Is there any way to achieve this ? or should I just stick the ImageViews and find a way to implement Zoom in it ?? I hope my question is clear and not too stupid since I'm just a beginner :).

Thanks for your help!!

Ahamza
  • 15
  • 4

2 Answers2

1

Use a RelativeLayout for starters.

You could use the ViewGroup.addView(View child, int index, ViewGroup.LayoutParams params) or a variant along with ViewGroup.removeView(View view) or ViewGroup.removeViewAt(int index).

This would obviously require you to inflate the views manually using LayoutInflater but you could keep a global reference to each after inflating and just flip between the two

j0ntech
  • 1,158
  • 3
  • 13
  • 27
Furqi
  • 2,403
  • 1
  • 26
  • 32
  • I've already seen this answer here [link](http://stackoverflow.com/questions/4901408/in-android-how-to-display-one-view-as-overlay-on-top-of-another-view) but I guess it's not what I'm trying to do.. I don't want to pick an image each time but to display many images at once...Sorry if I misundestood your answer and thanks anyway.. – Ahamza Mar 19 '13 at 14:03
1

While you can stack several ImageViews on top of each other, if you want to make this efficient and feature rich (pinch zoon, panning) you need to create your own component, either based on View or based on SurfaceView.

Personally I think SurfaceView is an overkill here, subclassing simple view should be sufficient. You need to manually draw your layers from bitmaps on canvas on onDraw() method of the view.

Then you can use GestureDetector or ScaleGestureDetector to add zoom by scaling your canvas via affine transformations.

EvilDuck
  • 4,386
  • 23
  • 32
  • Thanks for the advice... I started digging that way too and I guess that's the best thing to do for now ... I would apreciate it if you have some tutorials on how to do this .. – Ahamza Mar 19 '13 at 14:56
  • thanks for your concern ! I've already managed to do this with some kind of transparent sliding menus :D I have a POT to present for now so I'll just leave the details for the POC :D – Ahamza Mar 21 '13 at 09:03