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. why my getCheckedRadioButtonId() always return a wrong value.

btnok.setOnClickListener(new View.OnClickListener(){

                        public void onClick(View v) {
                                // TODO Auto-generated method stub
                                int checkedId=group.getCheckedRadioButtonId();
                                scencechange(checkedId);
                        }

        });


    }

        //
    private void scencechange(int checkId){
        Intent intent=new Intent(Ring.this,AlarmReceiver.class);
        PendingIntent pi=PendingIntent.getBroadcast(Ring.this,0,intent,
0);
        intent.putExtra("checkedId", checkId);
        PendingIntent alarmIntent = PendingIntent.getBroadcast(this,
                                0,
                                intent,
                                0);
        alarms.set(AlarmManager.RTC_WAKEUP, getTime(), alarmIntent);
    }

public class AlarmReceiver extends BroadcastReceiver{

        @Override
        public void onReceive(Context context, Intent intent) {
                // TODO Auto-generated method stub
                AudioManager audio = (AudioManager) context.getSystemService
(Context.AUDIO_SERVICE);

                //Intent€checkedId
                int checkedId=intent.getIntExtra("checkedId",0);

                switch(checkedId){
                case R.id.ring:ring(audio);break;
                case R.id.ring_vibrate:ring_vibrate(audio);break;
                case R.id.silence:silence(audio);break;
                default:vibrate(audio);break;
                }

        }


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

2. connecting internet through Android Emulator

Hi,

Does anybody know how to connect internet from Android Emulator
browser?

Thanks
--~--~---------~--~----~------------~-------~--~----~

3. Calendar only syncs one way

4. How often are download stats updated for apps in Android Market

5. no classfiles specified and Conversion to Dalvik format failed with error 1

6. Set the theme from the application: the background doesn't change

7. Video Capturing