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
|
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.
|
|
|