Bind the pushpin on image

by Beena » Fri, 06 Aug 2010 14:05:11 GMT


Sponsored Links
 Hi all,
I have an image of 600x600. Which is scrollable horizontally and
vertically.
And then I have to add the pushpin at particular point.
I can plot the pushpin on it, but as I scroll horizontally then the
images are not stay at their position.
How can i bind pushpin at the particular pixel of the image?
Like google map, where images are clickable.

Any suggestion will help full.

--



Bind the pushpin on image

by Beena » Thu, 12 Aug 2010 14:21:14 GMT


 hi
Is there any one who can guide?




--


Sponsored Links


Bind the pushpin on image

by Frank Weiss » Fri, 13 Aug 2010 01:28:36 GMT


 I suppose you need to scroll the pushpin as well.

--



Bind the pushpin on image

by Farjad Habib » Fri, 13 Aug 2010 06:23:30 GMT


 use map layout...

I hope it can help...





>



Bind the pushpin on image

by Beena » Fri, 13 Aug 2010 17:52:08 GMT


 @Frank Weiss

I cant scroll the pushpin.

@Farjad Habib

I am not using any map api. This is image of building which shows
rooms/shop, where I can plot the small images on the main image of
building.

Hope you can understand.

Any suggestion?





> >



Bind the pushpin on image

by Frank Weiss » Sat, 14 Aug 2010 00:38:27 GMT


 >

I must be missing something then. You did say that the underlying
image is scrollable.

--



Bind the pushpin on image

by Beena » Sat, 14 Aug 2010 11:48:08 GMT


 Yes main image of size 600x600 is scrolling, but pushpin not.
Pushpin are plotted at their own point on the main image, so as I
scroll the main image the pushpin should stay at their position. Which
is not happening.
And I am not able to plot the pushpin on outside of the canvas. Eg. on
600x500, outside the canvas.
I want to bind pushpin at the particular point.
As I have mention earlier :
This is image of building which shows
rooms/shop, where I can plot the pushpin on the main image(scrollable
image) of
building.
Here the pushpin shows the rooms/shop and main image is of building.

Thanks.




--



Bind the pushpin on image

by Frank Weiss » Sat, 14 Aug 2010 12:26:54 GMT


 Perhaps you can give a sample of the code used to draw the image and
the pushpins?

--



Bind the pushpin on image

by Beena » Sat, 14 Aug 2010 16:41:05 GMT


 Here is the code:
==============

                        ScrollView sv = new ScrollView(this);
                        sv.setBackgroundColor(Color.WHITE);

                        AbsoluteLayout abl = new AbsoluteLayout(this);

                        HorizontalScrollView layout = new 
HorizontalScrollView(this);
                        LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(
                                       LinearLayout.LayoutParams.FILL_PARENT,
                                       LinearLayout.LayoutParams.FILL_PARENT);



                        String url ="Url of Main Image";// Take any big image
                        Bitmap bm = getImage(url);

                        ImageView iv = new ImageView(this);
                        iv.setImageBitmap(bm);
                        layout.addView(iv);

                        abl.addView(layout);

                        Bitmap bmp = 
BitmapFactory.decodeResource(getResources(),
R.drawable.pushpin); // Take any small image
                        final int bitmapWidth = bmp.getWidth();
                        final int bitmapHeight = bmp.getHeight();

                        for(int i=0;i<hashtable.size();i++){

                                Information information =  (Information) 
hashtable.get(i+"");

                                ImageView iv1 = new ImageView(this);
                                iv1.setAdjustViewBounds(true);
                                iv1.setImageBitmap(bmp);

                                AbsoluteLayout.LayoutParams alp = new
AbsoluteLayout.LayoutParams(20,20,x,y);
                                abl.addView(iv1,alp);
                        }

                        sv.addView(abl);

                        setContentView(sv);

Thanks,
Beena




--



Bind the pushpin on image

by Frank Weiss » Sun, 15 Aug 2010 01:52:28 GMT


 I think I see the problem in your code. The view hierarchy is:

sv (abl (layout(iv), iv1))

where sv is a ScrollView and layout is a HorizontalScrollView. Which
one actually does the scrolling? Have you tried this view hierarchy:

sv (abl (layout(iv, iv1)))

--



Bind the pushpin on image

by Beena » Mon, 16 Aug 2010 12:39:20 GMT


 Thanks Frank.

I just forgot basic thing.
How can I forgot this.
At last its done

Thanks for the help.
Its working fine now.

Thanks,
Beena






--



Bind the pushpin on image

by Frank Weiss » Mon, 16 Aug 2010 12:55:06 GMT


 It's gratifying to hear that I helped you. Thanks!

--



Other Threads

1. Ask custom rom Donut

Guys,

Ada yg punya link utk rom custom donut (1.6) utk dream
Eclair 2.1 udah ok, apalagi 3D Galery nya ......maknyussss
Tp ya itu gak bisa video :(
Juga spt FX Camera or Camera Pro gak support

Nah krn sdcard dah ext4 ,so custom rom donut apa yg support ext4

Thx

| Rgds,
Jus |
~  send using dream eclair  ~

-- 
"Indonesian Android Community [id-android]" 

2. showing media volume controller

Hi All,

how to show media volume controller on my screen in android?

Thanks
kavitha

-- 

3. EditText hides Text

4. Narsis pagi-pagi

5. Saving/Restoring List<CustomClass>

6. Weather app di android

7. Need custom arc shape for seek bar