android如何获得图像blob的宽度和高度?
答
得到的答案从
http://apachejava.blogspot.com/2011/01/get-width-and-height-of-image-blob.html
public Bitmap convertBlobToBitmap(byte[] blobByteArray) {
Bitmap tempBitmap=null;
if(blobByteArray!=null)
tempBitmap = BitmapFactory.decodeByteArray(blobByteArray, 0, blobByteArray.length);
return tempBitmap;
}
Bitmap temp_bitmapImg = convertBlobToBitmap(BitmapArrayOfImage());
int height = temp_bitmapImg .getHeight();
int width = temp_bitmapImg .getWidth();
答
Bitmap bitmap=BitmapFactory.decodeResource(getResources(), R.drawable.img); int WIDTH=bitmap.getWidth(); int HEIGHT=bitmap.getHeight(); bitmap.recycle();
其中img
将在drawable
你的形象。
不要问同样的问题两次,会有人接听时,他们可以。 – 2011-01-13 10:51:55