Code example for Picture

Methods: beginRecording, endRecording

0
     * Creates a new Picture that records drawing a provided bitmap. 
     * Will return an empty Picture if the Bitmap is null. 
     */ 
    @CalledByNative 
    private static Picture recordBitmapIntoPicture(Bitmap bitmap) {
        Picture picture = new Picture();
        if (bitmap != null) {
            Canvas recordingCanvas = picture.beginRecording(bitmap.getWidth(), bitmap.getHeight());
            drawBitmapIntoCanvas(bitmap, recordingCanvas);
            picture.endRecording();
        } 
        return picture;
    } 
 
    // Should never be instantiated. 
    private JavaBrowserViewRendererHelper() { 
    } 
}