String myFileUrl =new URL("
http://i778.photobucket.com/albums/yy65/amyjayne10/Flowers/6d2b25051.gif";);

try
{
HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
conn.setDoInput(true);
conn.connect();
int length = conn.getContentLength();
int[] bitmapData =new int[length];
byte[] bitmapData2 =new byte[length];
InputStream is = conn.getInputStream();

Bitmap  bmImg = BitmapFactory.decodeStream(is);
myButton.setImageBitmap(bmImg);
 }
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
this is my sample code

On Fri, Jan 27, 2012 at 10:58 AM, aparna rani <[email protected]> wrote:

> hiii all
>
> i am implementing image button in android. problem is my image button area
> is small but my image is larger than the screen. i am taking image from
> URL. I know only one method resize image and fit into the image button. Is
> there any other solution for this....please help me....
>
> thanks in advance
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to