Android 使用BitMapRegionCoder从PNG条带加载26个字母的图像
在中,我尝试从以下位置加载26个字母平铺: 在真正的设备(Moto G)上,这失败了(我猜是从Android 使用BitMapRegionCoder从PNG条带加载26个字母的图像,android,android-bitmap,bitmapregiondecoder,Android,Android Bitmap,Bitmapregiondecoder,在中,我尝试从以下位置加载26个字母平铺: 在真正的设备(Moto G)上,这失败了(我猜是从drawables xxhdpi缩小了1.5倍): OpenGLRenderer位图太大,无法上载到纹理(4137 x 160;最大值=4096x4096) 并且不显示字母图像(拖动的平铺显示为空): 因此,我想使用加载240 x 240位图,但作为一名Android编程新手(我也四处搜索过),我仍然有两个问题: 如何加载一个R.drawable.big_english-没有合适的构造函数 考虑到我加
drawables xxhdpi
缩小了1.5倍):
OpenGLRenderer位图太大,无法上载到纹理(4137 x
160;最大值=4096x4096)
并且不显示字母图像(拖动的平铺显示为空):
因此,我想使用加载240 x 240位图,但作为一名Android编程新手(我也四处搜索过),我仍然有两个问题:
R.drawable.big_english
-没有合适的构造函数isShareable
private Paint mPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
mStripe = BitmapFactory.decodeResource(
context.getResources(), R.drawable.big_english);
int h = mStripe.getHeight();
mSrc = new Rect(0, 0, h, h);
mDst = new Rect(0, 0, h, h);
canvas.drawBitmap(mStripe, mSrc, mDst, mPaint);