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. Rotating Camera Preview

Hi All,

I have a camera preview in a portion of the main screen of my app.  I
want it to work in both lanscape and portrait mode.  Is there any way
to get a preview working in portrait mode which doesnt rotate the
image 90 degrees?

The only successful method I have tried so far is forcing the app into
landscape mode but then I have the problem that all my other widgets
on screen are rotated too.

I also have seen some references to the camera or preview properties
and a rotate proprty.  I have tried this and didnt get an error but
equally didn't get a correctly rotated preview.

Has anyone  managed to get this to work?

Regards,

Fin
--~--~---------~--~----~------------~-------~--~----~

2. Thanks.

Can I get one please ??
sungjin.par...@gmail.com

--~--~---------~--~----~------------~-------~--~----~

3. Paste phone number into dialler

4. Strange behavior when loading images from SDCard

5. Change widget size at run-time

6. Show map in calendar events

7. Error in the project, unable to track