Code example for TextureView

Methods: getBitmap

0
        Button button = new Button(this);
        button.setText("Copy bitmap to /sdcard/textureview.png");
        button.setOnClickListener(new View.OnClickListener() {
            @Override 
            public void onClick(View v) {
                Bitmap b = mTextureView.getBitmap();
                try { 
                    FileOutputStream out = new FileOutputStream(
                            Environment.getExternalStorageDirectory() + "/textureview.png");
                    try { 
                        b.compress(Bitmap.CompressFormat.PNG, 100, out);
                    } finally { 
                        try { 
                            out.close();
                        } catch (IOException e) {
                            // Ignore 
                        } 
                    } 
                } catch (FileNotFoundException e) {
                    // Ignore 
                }