Best code examples for Android Canvas class (android.graphics.Canvas)

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

Android Canvas examples from Open Source projects
This code example shows how to use the following methods: drawPath, restore, save, scale, translate
67:	canvas.save(); 
68:	canvas.scale(w,h); 
-
70:	canvas.translate(1, 0); 
-
76:	canvas.drawPath(path, p); 
-
83:	canvas.drawPath(path, p); 
84:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawRGB, drawRect, restore, rotate, save
53:	canvas.save(); 
54:	canvas.translate(dipToPx(getContext(), 400), dipToPx(getContext(), 200)); 
55:	canvas.rotate(45.0f); 
56:	canvas.drawRGB(255, 255, 255); 
-
58:	canvas.drawRect(-80.0f, -80.0f, 80.0f, 80.0f, mPaint); 
59:	canvas.drawRect(0.0f, 0.0f, 220.0f, 220.0f, mPaint); 
60:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawBitmap, translate
70:	canvas.translate(120.0f, 50.0f); 
71:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
-
73:	canvas.translate(0.0f, mBitmap1.getHeight()); 
74:	canvas.translate(0.0f, 25.0f); 
75:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, null); 
-
77:	canvas.translate(0.0f, mBitmap2.getHeight()); 
78:	canvas.translate(0.0f, 25.0f); 
79:	canvas.drawBitmap(mBitmap3, 0.0f, 0.0f, null); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawBitmap, drawRect
185:	Canvas c = new Canvas(mMapPin); 
186:	c.drawRect(0, 0, mMapPin.getWidth(), mMapPin.getHeight(), sClearerPaint); 
-
189:	c.drawBitmap(mBase, 0, 0, null); 
-
192:	c.drawBitmap(mPin, 0, 0, mPaint); 
-
195:	c.drawBitmap(mDot, 0, 0, mPaint); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawRect, restore, save, translate
58:	canvas.translate(100.0f, 100.0f); 
-
61:	canvas.save(); 
-
64:	canvas.translate(0.0f, 100.0f); 
-
67:	canvas.translate(0.0f, 100.0f); 
-
70:	canvas.translate(0.0f, 100.0f); 
-
73:	canvas.translate(0.0f, 100.0f); 
-
77:	canvas.restore(); 
-
79:	canvas.translate(100.0f, 0.0f); 
-
82:	canvas.save(); 
-
85:	canvas.translate(0.0f, 100.0f); 
-
88:	canvas.translate(0.0f, 100.0f); 
-
91:	canvas.translate(0.0f, 100.0f); 
-
94:	canvas.translate(0.0f, 100.0f); 
-
98:	canvas.restore(); 
-
100:	canvas.translate(100.0f, 0.0f); 
-
103:	canvas.save(); 
-
106:	canvas.translate(0.0f, 100.0f); 
-
110:	canvas.translate(0.0f, 100.0f); 
-
113:	canvas.drawRect(0.0f, 0.0f, 50.0f, 50.0f, mBluePaint); 
-
115:	canvas.translate(0.0f, 100.0f); 
-
119:	canvas.drawRect(0.0f, 0.0f, 50.0f, 50.0f, mBluePaint); 
-
124:	canvas.restore(); 
-
128:	canvas.drawRect(0.0f, 0.0f, 50.0f, 50.0f, mBluePaint); 
-
130:	canvas.save(); 
131:	canvas.translate(25.0f, 25.0f); 
-
133:	canvas.drawRect(0.0f, 0.0f, 50.0f, 50.0f, mRedPaint); 
134:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawBitmap, drawColor, setBitmap
182:	final Canvas dest = new Canvas(result); 
-
184:	dest.drawColor(0, PorterDuff.Mode.CLEAR); 
-
189:	dest.drawBitmap(mask, xy[0], xy[1], 
-
194:	dest.drawBitmap(src, 0, 0, mPaint); 
195:	dest.setBitmap(null); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawBitmap
38:	canvas = new Canvas(rounded); 
39:	canvas.drawBitmap(source, 0, 0, null); 
40:	canvas.drawBitmap(clipped, 0, 0, paint); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawBitmap, drawColor, drawPath
65:	final Canvas canvas = new Canvas(mBitmap); 
-
79:	canvas.drawColor(0, PorterDuff.Mode.CLEAR); 
-
86:	canvas.drawPath(fillPath, mPaint); 
-
90:	canvas.drawBitmap(bitmap, cropRect, circleRect, mPaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: clipRect, drawARGB, getHeight, getWidth
157:	can.clipRect(0, 0, mVertical ? size : can.getWidth(), mVertical ? can.getHeight() : size); 
-
159:	can.drawARGB((int) (frac * 0xFF), 0xDD, 0xEE, 0xAA); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: clipRect, getMatrix, restore, save, setMatrix
253:	canvas.save(); 
-
262:	canvas.clipRect(mClipBounds); 
263:	mMatrix.set(canvas.getMatrix()); 
-
267:	canvas.setMatrix(mMatrix); 
-
271:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawCircle, drawText, restore, save, translate
84:	canvas.save(); 
85:	canvas.translate(getScrollX()+getWidth()-(mCounterSize)-(mCounterPadding), getScrollY()+(mCounterSize)-(fm.top/2)); 
-
87:	canvas.drawCircle(0, -mRect2.height()/2, mCounterSize+1, mTextPaint); 
88:	canvas.drawCircle(0, -mRect2.height()/2, mCounterSize, mStrokePaint); 
-
90:	canvas.drawText(mCounter, 0, 0, mTextPaint); 
91:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, restore, save, scale, translate
65:	canvas.save(); 
66:	canvas.scale(0.3f, 0.3f); 
67:	canvas.drawBitmap(mBitmap1, 0, 0, mBitmapPaint); 
68:	canvas.restore(); 
-
70:	canvas.save(); 
71:	canvas.translate(mBitmap1.getWidth() * 0.3f + 96.0f, 0.0f); 
72:	canvas.scale(0.3f, 0.3f); 
73:	canvas.drawBitmap(mBitmap2, 0, 0, mBitmapPaint); 
74:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawRGB, getMatrix, restore, save, translate
44:	canvas.drawRGB(255, 255, 255); 
-
46:	Log.d("Matrix", "m1=" + canvas.getMatrix()); 
-
48:	canvas.save(); 
49:	canvas.translate(10.0f, 10.0f); 
50:	Log.d("Matrix", "m2=" + canvas.getMatrix()); 
51:	canvas.translate(20.0f, 20.0f); 
52:	Log.d("Matrix", "m3=" + canvas.getMatrix()); 
53:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getMaximumBitmapHeight, getMaximumBitmapWidth, isHardwareAccelerated
53:	Log.d("Bitmap", "Hw         = " + canvas.isHardwareAccelerated()); 
54:	Log.d("Bitmap", "Max width  = " + canvas.getMaximumBitmapWidth()); 
55:	Log.d("Bitmap", "Max height = " + canvas.getMaximumBitmapHeight()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawArc, drawLine
149:	Canvas canvas = new Canvas(mBitmap); 
150:	canvas.drawArc(mRect, -90, 360, true, mPaintBackground); 
-
152:	canvas.drawLine(mRect.width() / 2, mRect.height() / 2, mRect.width() / 2, 0, mPaintForeground); 
-
155:	canvas.drawArc(mRect, -90, angle, true, mPaintForeground); 
-
157:	canvas.drawArc(mRectInner, -90, 360, true, mPaintErase); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawColor, restore, save, setBitmap
95:	canvas.setBitmap(b); 
96:	canvas.save(); 
-
98:	canvas.restore(); 
99:	canvas.drawColor(mHighlightColor, PorterDuff.Mode.SRC_IN); 
100:	canvas.setBitmap(null); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getSaveCount, restoreToCount, rotate, scale, translate
125:	int saveCount = canvas.getSaveCount(); 
-
131:	canvas.scale(ratio, ratio, width / 2.0f, height / 2.0f); 
-
133:	canvas.translate(left + width / 2, top + height / 2); 
134:	canvas.rotate(-mCurrentDegree); 
135:	canvas.translate(-w / 2, -h / 2); 
-
137:	canvas.restoreToCount(saveCount); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: clipRect, drawBitmap, drawColor, restore, save
422:	c.translate(x, y); 
-
424:	c.save(Canvas.CLIP_SAVE_FLAG); 
425:	c.clipRect(0, 0, mBackground.getWidth(), mBackground.getHeight(), 
-
427:	c.drawColor(0xff000000); 
428:	c.restore(); 
-
431:	c.drawBitmap(mBackground, 0, 0, null); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawRect, getHeight, getWidth
127:	canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: restore, restoreToCount, save, scale, translate
222:	int saveCount = canvas.save(); 
-
243:	canvas.drawBitmap(child.getDrawingCache(), rl1, rl2, mLabelPaint); 
-
248:	canvas.save(); 
249:	canvas.translate(x+xx, y+child.getPaddingTop()); 
250:	canvas.scale(scale, scale); 
251:	tmp[1].draw(canvas); 
252:	canvas.restore(); 
-
258:	canvas.drawBitmap(child.getDrawingCache(), child.getLeft(), child.getTop(), mPaint); 
-
260:	canvas.save(); 
261:	canvas.translate(child.getLeft(), child.getTop()); 
-
263:	canvas.restore(); 
-
268:	canvas.save(); 
269:	canvas.translate(child.getLeft()+xx, child.getTop()+child.getPaddingTop()); 
270:	tmp[1].draw(canvas); 
271:	canvas.restore(); 
-
274:	canvas.restoreToCount(saveCount); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawARGB, drawBitmap, drawRoundRect
55:	Canvas canvas = new Canvas(bmOut); 
-
64:	canvas.drawARGB(0, 0, 0, 0); 
65:	canvas.drawRoundRect(rectF, cornerRadiusPx, cornerRadiusPx, paint); 
-
68:	canvas.drawBitmap(bm, rect, rect, paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawCircle, drawText, restore, save, translate
84:	canvas.save(); 
85:	canvas.translate(getScrollX()+getWidth()-(mCounterSize)-(mCounterPadding), getScrollY()+(mCounterSize)-(fm.top/2)); 
-
87:	canvas.drawCircle(0, -mRect2.height()/2, mCounterSize+1, mTextPaint); 
88:	canvas.drawCircle(0, -mRect2.height()/2, mCounterSize, mStrokePaint); 
-
90:	canvas.drawText(mCounter, 0, 0, mTextPaint); 
91:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap
248:	canvas = new Canvas(rounded); 
249:	canvas.drawBitmap(source, 0, 0, null); 
250:	canvas.drawBitmap(clipped, 0, 0, paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, drawBitmapMesh, drawColor, translate
78:	canvas.drawColor(0xffffffff); 
79:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
-
84:	canvas.drawBitmap(mBitmap1, matrix, mBitmapPaint); 
-
89:	canvas.drawBitmap(mBitmap1, src, dst, mBitmapPaint); 
-
91:	canvas.translate(0.0f, mBitmap1.getHeight() * 4); 
92:	canvas.drawBitmapMesh(mBitmap1, 3, 3, mVertices, 0, null, 0, mBitmapPaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawColor
51:	Canvas c = new Canvas(b); 
52:	c.drawColor(0, PorterDuff.Mode.CLEAR); 
53:	gamma.draw(c); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: clipPath, drawPaint, drawPath, restore, save
253:	canvas.save(); 
-
258:	if (!Platform.isCanvasHardwareAccelerated(canvas)) { 
259:	canvas.clipPath(mOutlinePath, Region.Op.DIFFERENCE); 
260:	canvas.drawPaint(mFocusPaint); 
-
263:	canvas.restore(); 
-
265:	canvas.drawPath(mOutlinePath, mOutlinePaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, translate
70:	canvas.translate(120.0f, 50.0f); 
71:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
-
73:	canvas.translate(0.0f, mBitmap1.getHeight()); 
74:	canvas.translate(0.0f, 25.0f); 
75:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, null); 
-
77:	canvas.translate(0.0f, mBitmap2.getHeight()); 
78:	canvas.translate(0.0f, 25.0f); 
79:	canvas.drawBitmap(mBitmap3, 0.0f, 0.0f, null); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, drawRect, translate
82:	canvas.translate(120.0f, 50.0f); 
83:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
-
85:	canvas.translate(0.0f, mBitmap1.getHeight()); 
86:	canvas.translate(0.0f, 25.0f); 
87:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, null); 
-
90:	canvas.translate(0.0f, mBitmap2.getHeight()); 
91:	canvas.translate(0.0f, 25.0f); 
92:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
-
95:	canvas.translate(0.0f, mBitmap1.getHeight()); 
96:	canvas.translate(0.0f, 25.0f); 
-
98:	canvas.drawRect(0.0f, 0.0f, mBitmap2.getWidth(), mBitmap2.getHeight(), mBitmapPaint); 
-
100:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mBitmapPaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, drawColor, drawPath
86:	final Canvas canvas = new Canvas(mBitmap); 
-
100:	canvas.drawColor(0, PorterDuff.Mode.CLEAR); 
-
107:	canvas.drawPath(fillPath, mPaint); 
-
111:	canvas.drawBitmap(icon, cropRect, circleRect, mPaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawARGB, drawBitmap, restore, save, translate
72:	canvas.drawARGB(255, 255, 255, 255); 
-
74:	canvas.save(); 
75:	canvas.translate(120.0f, 50.0f); 
76:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mColorMatrixPaint); 
-
78:	canvas.translate(0.0f, 50.0f + mBitmap1.getHeight()); 
79:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mLightingPaint); 
-
81:	canvas.translate(0.0f, 50.0f + mBitmap1.getHeight()); 
82:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBlendPaint); 
83:	canvas.restore(); 
-
85:	canvas.save(); 
86:	canvas.translate(120.0f + mBitmap1.getWidth() + 120.0f, 50.0f); 
87:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mColorMatrixPaint); 
-
89:	canvas.translate(0.0f, 50.0f + mBitmap2.getHeight()); 
90:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mLightingPaint); 
-
92:	canvas.translate(0.0f, 50.0f + mBitmap2.getHeight()); 
93:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mBlendPaint); 
94:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: clipRegion, restore, save
70:	canvas.save(); 
-
78:	canvas.clipRegion(mRegion); 
-
81:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: concat, drawARGB, drawBitmap, restore, save
55:	canvas.drawARGB(255, 255, 255, 255); 
-
79:	canvas.save(); 
80:	canvas.translate(offset, 0.0f); 
81:	canvas.concat(matrix); 
82:	canvas.drawBitmap(mBitmap1, centerX, centerY, null); 
83:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap
186:	canvas = new Canvas(rounded); 
187:	canvas.drawBitmap(source, 0, 0, null); 
188:	canvas.drawBitmap(clipped, 0, 0, paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, rotate, scale, translate
72:	Canvas canvas = new Canvas(target); 
73:	canvas.translate(sStackPhotoWidth / 2, sStackPhotoHeight / 2); 
74:	canvas.rotate(rotation); 
75:	canvas.scale(scale, scale); 
-
77:	canvas.drawBitmap(bitmap, -w / 2, -h / 2, paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawRGB, drawRect, restore, save, translate
71:	canvas.drawRGB(255, 255, 255); 
-
73:	canvas.save(); 
74:	canvas.translate(130.0f, 100.0f); 
-
78:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
80:	canvas.translate(400.0f, 000.0f); 
-
84:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
86:	canvas.translate(400.0f, 000.0f); 
-
90:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
92:	canvas.translate(-800.0f, 300.0f); 
-
96:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
98:	canvas.translate(400.0f, 000.0f); 
-
102:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
104:	canvas.translate(400.0f, 000.0f); 
-
108:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
111:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawRGB, drawRect, restore, save, translate
103:	canvas.drawRGB(255, 255, 255); 
-
105:	canvas.save(); 
106:	canvas.translate(40.0f, 40.0f); 
-
109:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
111:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
113:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
115:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
117:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
119:	canvas.restore(); 
-
121:	canvas.save(); 
122:	canvas.translate(40.0f + mDrawWidth + 40.0f, 40.0f); 
-
125:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
127:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
129:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
131:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
133:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
135:	canvas.restore(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawPath, drawRect, drawText
63:	canvas.drawRect(0, 0, getWidth(), getHeight(), paint); 
-
72:	canvas.drawPath(path, paint); 
-
77:	canvas.drawText(Integer.toString(end), getWidth() / 2, getHeight() / 2, paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawPath, drawRGB, translate
59:	canvas.drawRGB(255, 255, 255); 
-
63:	canvas.translate(100.0f, 300.0f); 
-
66:	canvas.translate(0.0f, 400.0f); 
-
74:	canvas.drawPath(path, mHugePaint); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: drawLine, drawRect, drawText, getClipBounds
66:	canvas.drawLine(20, 10, 140, 20, paint); 
-
69:	canvas.drawText("Android", 40, 50, paint); 
-
74:	canvas.drawText(String.valueOf(id), 2.0F, 12.0F, paint); 
-
77:	canvas.drawRect(canvas.getClipBounds(), paint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: restore, save, translate
81:	canvas.save(); 
82:	canvas.translate(0.0f, -height * 2 - 20.0f); 
-
87:	canvas.restore(); 
-
92:	canvas.save(); 
93:	canvas.translate(0.0f, height + 20.0f); 
-
98:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: restore, save, scale, translate
131:	canvas.save(Canvas.MATRIX_SAVE_FLAG); 
132:	canvas.translate(mX, mY); 
133:	canvas.scale(mScaleX, mScaleY); 
134:	canvas.translate(-0.5f*getWidth(), -0.5f*getHeight()); 
-
137:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawBitmap, skew, translate
51:	canvas.translate(120.0f, 50.0f); 
52:	canvas.skew(0.2f, 0.3f); 
53:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawARGB, drawBitmap, restore, save, translate
72:	canvas.drawARGB(255, 255, 255, 255); 
-
74:	canvas.save(); 
75:	canvas.translate(120.0f, 50.0f); 
76:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mColorMatrixPaint); 
-
78:	canvas.translate(0.0f, 50.0f + mBitmap1.getHeight()); 
79:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mLightingPaint); 
-
81:	canvas.translate(0.0f, 50.0f + mBitmap1.getHeight()); 
82:	canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBlendPaint); 
83:	canvas.restore(); 
-
85:	canvas.save(); 
86:	canvas.translate(120.0f + mBitmap1.getWidth() + 120.0f, 50.0f); 
87:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mColorMatrixPaint); 
-
89:	canvas.translate(0.0f, 50.0f + mBitmap2.getHeight()); 
90:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mLightingPaint); 
-
92:	canvas.translate(0.0f, 50.0f + mBitmap2.getHeight()); 
93:	canvas.drawBitmap(mBitmap2, 0.0f, 0.0f, mBlendPaint); 
94:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawRGB, drawRect, restore, save, translate
71:	canvas.drawRGB(255, 255, 255); 
-
73:	canvas.save(); 
74:	canvas.translate(130.0f, 100.0f); 
-
78:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
80:	canvas.translate(400.0f, 000.0f); 
-
84:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
86:	canvas.translate(400.0f, 000.0f); 
-
90:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
92:	canvas.translate(-800.0f, 300.0f); 
-
96:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
98:	canvas.translate(400.0f, 000.0f); 
-
102:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
104:	canvas.translate(400.0f, 000.0f); 
-
108:	canvas.drawRect(0.0f, 0.0f, 200.0f, 200.0f, mPaint); 
-
111:	canvas.restore(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: drawRGB, drawRect, restore, save, translate
103:	canvas.drawRGB(255, 255, 255); 
-
105:	canvas.save(); 
106:	canvas.translate(40.0f, 40.0f); 
-
109:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
111:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
113:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
115:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
117:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
119:	canvas.restore(); 
-
121:	canvas.save(); 
122:	canvas.translate(40.0f + mDrawWidth + 40.0f, 40.0f); 
-
125:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
127:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
129:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
131:	canvas.translate(0.0f, 40.0f + mDrawHeight); 
-
133:	canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint); 
-
135:	canvas.restore(); 
Full Snippet Info
8
CodeRank
Related Android Canvas Questions & Answers:
See Code Examples for Android Canvas Methods: