Best code examples for Android BitmapDrawable class (android.graphics.drawable.BitmapDrawable)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BitmapDrawable class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android BitmapDrawable examples from Open Source projects
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, getPaint, setBounds
55:	mDrawable.getPaint().setAntiAlias(true); // Force AA 
56:	mDrawable.setBounds(0, 0, mDrawable.getIntrinsicWidth(), mDrawable.getIntrinsicHeight()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, setTargetDensity
170:	final BitmapDrawable d = new BitmapDrawable(getResources(), bitmap); 
171:	if (!scale) d.setTargetDensity(getResources().getDisplayMetrics()); 
-
174:	view.setLayoutParams(new LinearLayout.LayoutParams(d.getIntrinsicWidth(), 
175:	d.getIntrinsicHeight())); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: draw, setAlpha
109:	image.setAlpha(alpha); 
110:	image.draw(canvas); 
111:	image.setAlpha(0xFF); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
184:	Drawable d = new BitmapDrawable(); 
-
186:	rpm.addActivityIcon(i, d); 
-
188:	assertThat(rpm.getActivityIcon(i)).isSameAs(d); 
189:	assertThat(rpm.getActivityIcon(i.getComponent())).isSameAs(d); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth
126:	BitmapDrawable drawable = new BitmapDrawable(Robolectric.application.getResources(), bitmap); 
127:	assertEquals(5, drawable.getIntrinsicWidth()); 
128:	assertEquals(10, drawable.getIntrinsicHeight()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
159:	Drawable d = new BitmapDrawable(); 
-
161:	rpm.addActivityIcon(i, d); 
-
163:	assertThat(rpm.getActivityIcon(i)).isSameAs(d); 
164:	assertThat(rpm.getActivityIcon(i.getComponent())).isSameAs(d); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
146:	this.background = new BitmapDrawable(backgroundImage); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
24:	setBackgroundDrawable(banner != null ? new BitmapDrawable(getResources(), banner) : null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap, setTargetDensity
125:	Bitmap bitmap = bitmapDrawable.getBitmap(); 
-
127:	bitmapDrawable.setTargetDensity(mDisplayMetrics); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap
278:	: name == null ? new BitmapDrawable(mView.getResources(), getHandleBitmap(3)) : null; 
-
282:	int width = ImageCache.getWidth(drawable); 
283:	int height = ImageCache.getHeight(drawable); 
-
292:	mCanvas.drawBitmap(b.getBitmap(), mat, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, getPaint, setBounds
55:	mDrawable.getPaint().setAntiAlias(true); // Force AA 
56:	mDrawable.setBounds(0, 0, mDrawable.getIntrinsicWidth(), mDrawable.getIntrinsicHeight()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, setTargetDensity
140:	final BitmapDrawable d = new BitmapDrawable(getResources(), bitmap); 
141:	if (!scale) d.setTargetDensity(getResources().getDisplayMetrics()); 
-
144:	view.setLayoutParams(new LinearLayout.LayoutParams(d.getIntrinsicWidth(), 
145:	d.getIntrinsicHeight())); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds
41:	final BitmapDrawable resultDrawable = new BitmapDrawable(app.getResources(), result); 
42:	resultDrawable.setBounds(new Rect(0, 0, width, height)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap
55:	canvas.drawBitmap(realBitmapDrawable.getBitmap(), 0, 0, paint); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
16:	return new BitmapDrawable(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
22:	setImageDrawable(new BitmapDrawable(imageBitmap)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, setTargetDensity
170:	final BitmapDrawable d = new BitmapDrawable(getResources(), bitmap); 
171:	if (!scale) d.setTargetDensity(getResources().getDisplayMetrics()); 
-
174:	view.setLayoutParams(new LinearLayout.LayoutParams(d.getIntrinsicWidth(), 
175:	d.getIntrinsicHeight())); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
104:	BitmapDrawable bitmapDrawable = new BitmapDrawable(); 
-
107:	assertThat((BitmapDrawable) popupWindow.getBackground()).isSameAs(bitmapDrawable); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds
234:	BitmapDrawable drawable = new BitmapDrawable( 
-
236:	drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
31:	Drawable drawable = new BitmapDrawable(processedBitmap); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: draw, getBitmap, setBounds
22:	BitmapDrawable bd = new BitmapDrawable(b); 
23:	bd.setBounds(0, 0, w, h); 
24:	bd.draw(c); 
25:	return bd.getBitmap(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap
14:	Bitmap b = value.getBitmap(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
86:	dialog.setIcon(new BitmapDrawable(context.getResources(), getColorPreviewBitmap(context, color))); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAlpha
44:	Drawable d = new BitmapDrawable(getResources(), bitmapWallpaper); 
45:	d.setAlpha((int) (wallpaperAlpha * 255)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
40:	BitmapDrawable drawable = new BitmapDrawable(Robolectric.newInstanceOf(Bitmap.class)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getIntrinsicHeight, getIntrinsicWidth, getOpacity, setBounds
28:	BitmapDrawable bd= new BitmapDrawable(path); 
29:	if(bd.getIntrinsicWidth()==width && bd.getIntrinsicHeight() == height){ 
-
34:	bd.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888  : Bitmap.Config.RGB_565); 
-
36:	bd.setBounds(0,0,width,height); 
37:	bd.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAlpha
32:	mDrawable.setAlpha(alpha); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap, setTargetDensity
85:	Bitmap bitmap = bitmapDrawable.getBitmap(); 
-
87:	bitmapDrawable.setTargetDensity(context.getResources().getDisplayMetrics()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
31:	setImageDrawable(new BitmapDrawable(imageBitmap)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
39:	Drawable d = new BitmapDrawable(getResources(), bitmapWallpaper); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setTileModeXY, setBackgroundDrawable
87:	BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap); 
88:	bitmapDrawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); 
89:	activity.findViewById(view).setBackgroundDrawable(bitmapDrawable); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBitmap, setTargetDensity
125:	Bitmap bitmap = bitmapDrawable.getBitmap(); 
-
127:	bitmapDrawable.setTargetDensity(mDisplayMetrics); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTileModeXY
95:	d.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); 
96:	ab.setBackgroundDrawable(d); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
50:	return new BitmapDrawable(bitmap); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTileModeXY
64:	d.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); 
65:	ab.setSplitBackgroundDrawable(d); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
311:	d = new BitmapDrawable(b); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
68:	mThemeDrawable = new BitmapDrawable(b); 
Full Snippet Info
7
CodeRank
Related Android BitmapDrawable Questions & Answers:
See Code Examples for Android BitmapDrawable Methods: