2
已经我一个图像,图像宽度是290和高度是330.when我用位图工厂转换成位图的宽度和高度是increasing.My代码是,使用位图工厂图像后宽度和高度是否增加?
mILearnBitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.capital_a_1);
mILearnBitmap = mILearnBitmap.copy(Bitmap.Config.ARGB_8888, true);
mILearnPixelsArry = new int[mILearnBitmap.getWidth() * mILearnBitmap.getHeight()];
mILearnBitmap.getPixels(mILearnPixelsArry, 0, mILearnBitmap.getWidth(), 0, 0,mILearnBitmap.getWidth(), mILearnBitmap.getHeight());
Log.d("mILearnPixelsArry", "---" + mILearnPixelsArry.length);
Log.d("Width", "---" + mILearnBitmap.getWidth());
Log.d("Height", "---" + mILearnBitmap.getHeight());
使用这个代码后宽度增加至435身高增加到495.请告诉我犯了一些错误,请帮助我。
嗨Ramesh谢谢你的答复。这里newWidth和newHeight意味着图像的实际尺寸正确 – 2012-02-03 07:14:43
不管你想要什么新的尺寸。意味着如果你想调整图像到500x300,然后调整图像大小newheight = 500,newwidth = 300好吗? – 2012-02-03 07:16:56
我在这里调用这个方法,我的意思是在bitmapfactory或after.please帮助我之后 – 2012-02-03 07:24:12