java - How to move right, left,top and bottom for zoom Image in android? -
i uploading image in screen. there have zoom-in zoom-out buttons. have done zoom-in , zoom-out functions. working fine. need is, want drag , see image completely. happens is, image not moving. have 4 butons here. leftbutton,rightbutton,topbutton , bottombutton. if click 'leftbutton', image should move left side. other functions. not having idea, need write inside button clicks. please guide me this? appreciated..
here code:
selectedpicture imagelayout
case r.id.zoominctrl: float x = selectedpicture.getscalex(); float y = selectedpicture.getscaley(); selectedpicture.setscalex((float) (x + 0.5)); selectedpicture.setscaley((float) (y + 0.5)); return true; case r.id.zoomoutctrl: x = selectedpicture.getscalex(); y = selectedpicture.getscaley(); selectedpicture.setscalex((float) (x - 0.5)); selectedpicture.setscaley((float) (y - 0.5)); return true; case r.id.leftctrl: /* code move left */ return true; case r.id.rightctrl: /* code move right */ return true; case r.id.topctrl: /* code move top */ return true; case r.id.bottomctrl: /* code move bottom */ return true;
i think settranslationx , settranslationy methods of view best fit want.
Comments
Post a Comment