Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用BitMapRegionCoder从PNG条带加载26个字母的图像_Android_Android Bitmap_Bitmapregiondecoder - Fatal编程技术网

Android 使用BitMapRegionCoder从PNG条带加载26个字母的图像

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-没有合适的构造函数 考虑到我加

在中,我尝试从以下位置加载26个字母平铺:

在真正的设备(Moto G)上,这失败了(我猜是从
drawables xxhdpi
缩小了1.5倍):

OpenGLRenderer位图太大,无法上载到纹理(4137 x 160;最大值=4096x4096)

并且不显示字母图像(拖动的平铺显示为空):

因此,我想使用加载240 x 240位图,但作为一名Android编程新手(我也四处搜索过),我仍然有两个问题:

  • 如何加载一个
    R.drawable.big_english
    -没有合适的构造函数
  • 考虑到我加载了26个字母,我可以在这里使用
    isShareable
  • android的位图字体

    你也应该在谷歌上搜索位图字体。还有一些实现和示例

    对于gl,在libgdx中有一个实现

    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);