Code example for ByteBuffer

Methods: rewind

0
    } 
 
    public void DrawByteBuffer() { 
        if(byteBuffer == null)
            return; 
        byteBuffer.rewind();
        bitmap.copyPixelsFromBuffer(byteBuffer);
        DrawBitmap(); 
    } 
 
    public void DrawBitmap() { 
        if(bitmap == null)
            return; 
 
        Canvas canvas = surfaceHolder.lockCanvas();
        if(canvas != null) {
            canvas.drawBitmap(bitmap, srcRect, dstRect, null);
            surfaceHolder.unlockCanvasAndPost(canvas);
        } 
    }