Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Different transformations in android using Seekbar.

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 354
    Comment on it

    Some of the basic 2-D Geometrical transformations which we can perform in android.

    1. Translation:- Translation is the moving of object from one place to another.
    2. Rotation:- If we wish to rotate an object in a certain angle/degree.
    3. Scaling:- Scaling transformation in which size of the object is changed.

      image = (ImageView) findViewById(R.id.image);
              seekBar = (SeekBar) findViewById(R.id.seekBar);
      
              seekBar.setMax(360);
      
              seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
                      public void onStopTrackingTouch(SeekBar seekBar) {
                      }
      
                      public void onStartTrackingTouch(SeekBar seekBar) {
                      }
      
                      public void onProgressChanged(SeekBar seekBar, int progress,
                                                    boolean fromUser) {
                          image.setRotationX((float)progress);
                      }
                  });
      

      Similarly we can perform other operations like Scaling and Translation.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: