Code example for Bitmap

Methods: getConfiggetHeightgetWidthrecycletexImage2D

0
         
        int level = 0;
        int newWidth = width;
        int newHeight = height;
        while(true) { 
            GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bitmap, 0);
            newWidth = newWidth / 2;
            newHeight = newHeight / 2;
            if(newWidth <= 0)
                break; 
            Bitmap newBitmap = Bitmap.createBitmap(newWidth, newHeight, bitmap.getConfig());
            Canvas canvas = new Canvas(newBitmap);
            canvas.drawBitmap(bitmap, 
                              new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()),
                              new Rect(0, 0, newWidth, newHeight),
                              null);             
            bitmap.recycle();
            bitmap = newBitmap;
            level++;
        } 
         
        gl.glBindTexture(GL10.GL_TEXTURE_2D, 0);        
        bitmap.recycle();
    } 
     
    public void reload() { 
        load(); 
        bind(); 
Connect your IDE to all the code out there  Get Codota for Java