0

I want to implement a zoom in and zoom out an image using seek bar. If I go to right in Seek Bar image should be zoom in and vice versa.

help me.

URAndroid
  • 6,177
  • 6
  • 30
  • 40
  • Yes we can do it by seek bar too ! ! look at my answer ! http://stackoverflow.com/questions/17106202/android-program-for-zoom-in-and-out-with-help-of-seekbar/17108967#17108967 – Mohan Raj Jun 14 '13 at 13:16

2 Answers2

0

you can take look here. http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-6-implementing-the-pinch-zoom-gesture/1847

EDITED:

checkout this how-can-i-get-zoom-functionality-for-images.

Community
  • 1
  • 1
Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
0

Here pos is the selected image since i have more than one image to zoom in and zoom out.

public  void zoomImage(int pos)
        {

            if(pos==1) {
                seekbar.setMax((int) 60.0f);
                seekbar.setProgress(seekvalue4 * 10);
                System.out.println("--------seekvalue is :" + seekvalue4 * 10);

                seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

                    @Override
                    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {



                        float scale = (progress / 10.0f);
    //                         
                        if (scale <= 0.1f) {
                            return;
                        }
                        iv1.setZoom(scale);

                        seekvalue4 = (int) scale;

                    }

                    @Override
                    public void onStartTrackingTouch(SeekBar seekBar) {

                    }

                    @Override
                    public void onStopTrackingTouch(SeekBar arg0) {
                        // TODO Auto-generated method stub


                    }


                });
            }
Saurav Prakash
  • 588
  • 1
  • 5
  • 26