Bitmap isMutable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bitmap isMutable method.

This code example shows how to use the following methods:copy, getConfig, isMutable, recycle
	// =========================================================== 
	// Methods 
	// =========================================================== 
 
	private Bitmap ensureLoadedBitmapIsMutable(final Bitmap pBitmap) {
		if(pBitmap.isMutable()) {
			return pBitmap;
		} else { 
			final Bitmap mutableBitmap = pBitmap.copy(pBitmap.getConfig(), true);
			pBitmap.recycle();
			return mutableBitmap;
		} 
	} 
 
	// =========================================================== 
	// Inner and Anonymous Classes 
	// =========================================================== 
 
	public static class TextureSourceDecoratorOptions { 
		// =========================================================== 
7
CodeRank
This code example shows how to use the following methods:copy, getConfig, getHeight, getWidth, isMutable
        if (mScaledBitmap == null) return;
 
        // Make a fresh (mutable) copy of the scaled-down photo Bitmap, 
        // and render the desired text into it. 
 
        Bitmap.Config config = mScaledBitmap.getConfig();
        Log.i(TAG, "  - mScaledBitmap config = " + config);
 
        mWorkingBitmap = mScaledBitmap.copy(config, true /* isMutable */);
        Log.i(TAG, "  ===> mWorkingBitmap: " + mWorkingBitmap
              + "  dimensions: " + mWorkingBitmap.getWidth()
              + " x " + mWorkingBitmap.getHeight());
        Log.i(TAG, "       isMutable = " + mWorkingBitmap.isMutable());
 
        Canvas canvas = new Canvas(mWorkingBitmap);
        Log.i(TAG, "- Canvas: " + canvas
              + "  dimensions: " + canvas.getWidth() + " x " + canvas.getHeight());
 
        Paint textPaint = new Paint();
        textPaint.setAntiAlias(true);
6
CodeRank
This code example shows how to use the following methods:isMutable
        return true; 
    } 
 
    @Override 
    public boolean isWritable() { 
        return iBitmap.isMutable();
    } 
} 
5
CodeRank
This code example shows how to use the following methods:isMutable
	 *  
	 * @return true if the image is mutable, false otherwise 
	 */ 
	public boolean isMutable() 
	{ 
		return this.bitmap.isMutable();
	} 
 
	/** 
	 * Creates an immutable image from decoded image data obtained from an 
	 * <code>InputStream</code>.  This method blocks until all image data has 
	 * been read and decoded.  After this method completes (whether by 
	 * returning or by throwing an exception) the stream is left open and its 
	 * current position is undefined. 
	 *  
	 * @param stream - the name of the resource containing the image data in one of the supported image formats 
	 * @return the created image 
	 * @throws NullPointerException - if stream is null 
	 * @throws IOException - if an I/O error occurs, if the image data cannot be loaded, or if the image data cannot be decoded 
	 * @since  MIDP 2.0 
4
CodeRank

Related Bitmap isMutable Questions & Answers:

isMutable Method Overview
Returns true if the bitmap is marked as mutable (i.e. can be drawn into)
See Code Examples for other Android Bitmap Methods: