display an image preview in an ImageButton

All your problems with Audio, Video and Images.

display an image preview in an ImageButton

Postby gauss4 » Sun May 29, 2011 5:52 pm

Hi all, i'd like to display a little preview of an image from the Gallery using an ImageButton, but using the ImageButton.setImageURI(Uri uri) it shows the image too big....i'd like to display the preview of the photo and if it's possible, to open the image clicking on the button. ... thanks very much for the help!
gauss4
Freshman
Freshman
 
Posts: 2
Joined: Sun May 29, 2011 5:43 pm

Top

Re: display an image preview in an ImageButton

Postby raj_J2ME » Wed Jun 01, 2011 7:15 am

Welcome to the Android Forums :)

Well you need to scale the image in such a suitable size so that it gets fit the button. And in order to open the image attach the listener to the button and open the image as per the selection of the preview.

Check and revert.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: display an image preview in an ImageButton

Postby gauss4 » Fri Jun 03, 2011 9:49 pm

Thanks for the welcome and the answer!
But how can i resize the photo in order to fit it to the button? Because I tried to create a bitmpa from the uri of the photo, but the app crash....
gauss4
Freshman
Freshman
 
Posts: 2
Joined: Sun May 29, 2011 5:43 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 10 guests