Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old October 30th, 2012, 02:14 AM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: May 2011
Location: New Delhi
Posts: 27
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 1 Time in 1 Post
Default Incorrect height and width of bitmap

Hi all,

I am using following code to get the Bitmap

Code:
try {
			Log.e("src", imageURL);
			URL url = new URL(imageURL);
			// Create an http connection
			HttpURLConnection connection = (HttpURLConnection) url.openConnection();
			connection.setDoInput(true);
			connection.connect();
			InputStream input = connection.getInputStream();
			
			BitmapFactory.Options options = new BitmapFactory.Options();
			
			
			Bitmap myBitmap = BitmapFactory.decodeStream(input);
			Log.d("SPen", "Bitmap height: " + myBitmap.getHeight() + ", Weight: " + myBitmap.getWidth());
		} catch (IOException e) {
			e.printStackTrace();
			Log.d("Exception", e.getMessage());
		}
I am getting the height and width of the Bitmap as 683 and 323. but the actual size of image is 3507 and 2480. is there any problem in the code.

manvinder is offline  
Reply With Quote
Sponsors
Old October 30th, 2012, 07:59 PM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,938
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 469 Times in 290 Posts
Default

Is the bitmap scaled on the page you are taking it from? If it isn't full size on the page, then it won't be full size on the way in.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is online now  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.