Home
last modified time | relevance | path

Searched refs:canvas (Results 1 – 25 of 68) sorted by relevance

123

/development/samples/ApiDemos/src/com/example/android/apis/graphics/
DClipping.java50 private void drawScene(Canvas canvas) { in drawScene() argument
51 canvas.clipRect(0, 0, 100, 100); in drawScene()
53 canvas.drawColor(Color.WHITE); in drawScene()
56 canvas.drawLine(0, 0, 100, 100, mPaint); in drawScene()
59 canvas.drawCircle(30, 70, 30, mPaint); in drawScene()
62 canvas.drawText("Clipping", 100, 30, mPaint); in drawScene()
65 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
66 canvas.drawColor(Color.GRAY); in onDraw()
68 canvas.save(); in onDraw()
69 canvas.translate(10, 10); in onDraw()
[all …]
DPolyToPoly.java42 private void doDraw(Canvas canvas, float src[], float dst[]) { in doDraw() argument
43 canvas.save(); in doDraw()
45 canvas.concat(mMatrix); in doDraw()
49 canvas.drawRect(0, 0, 64, 64, mPaint); in doDraw()
50 canvas.drawLine(0, 0, 64, 64, mPaint); in doDraw()
51 canvas.drawLine(0, 64, 64, 0, mPaint); in doDraw()
60 canvas.drawText(src.length/2 + "", x, y, mPaint); in doDraw()
62 canvas.restore(); in doDraw()
76 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
79 canvas.drawColor(Color.WHITE); in onDraw()
[all …]
DRegions.java50 private void drawOriginalRects(Canvas canvas, int alpha) { in drawOriginalRects() argument
54 drawCentered(canvas, mRect1, mPaint); in drawOriginalRects()
57 drawCentered(canvas, mRect2, mPaint); in drawOriginalRects()
63 private void drawRgn(Canvas canvas, int color, String str, Region.Op op) { in drawRgn() argument
66 canvas.drawText(str, 80, 24, mPaint); in drawRgn()
77 canvas.translate(0, 30); in drawRgn()
80 canvas.drawRect(r, mPaint); in drawRgn()
82 drawOriginalRects(canvas, 0x80); in drawRgn()
94 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
95 canvas.drawColor(Color.GRAY); in onDraw()
[all …]
DRoundRects.java64 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
70 canvas.save(); in onDraw()
71 canvas.translate(10, 10); in onDraw()
74 mDrawable.draw(canvas); in onDraw()
75 canvas.restore(); in onDraw()
77 canvas.save(); in onDraw()
78 canvas.translate(10 + mRect.width() + 10, 10); in onDraw()
81 mDrawable.draw(canvas); in onDraw()
82 canvas.restore(); in onDraw()
84 canvas.translate(0, mRect.height() + 10); in onDraw()
[all …]
DScaleToFit.java77 private void drawSrcR(Canvas canvas, int index) { in drawSrcR() argument
79 canvas.drawOval(mSrcR, mPaint); in drawSrcR()
82 private void drawFit(Canvas canvas, int index, Matrix.ScaleToFit stf) { in drawFit() argument
83 canvas.save(); in drawFit()
87 canvas.concat(mMatrix); in drawFit()
88 drawSrcR(canvas, index); in drawFit()
90 canvas.restore(); in drawFit()
92 canvas.drawRect(mDstR, mHairPaint); in drawFit()
95 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
98 canvas.drawColor(Color.WHITE); in onDraw()
[all …]
DPathFillTypes.java52 private void showPath(Canvas canvas, int x, int y, Path.FillType ft, in showPath() argument
54 canvas.save(); in showPath()
55 canvas.translate(x, y); in showPath()
56 canvas.clipRect(0, 0, 120, 120); in showPath()
57 canvas.drawColor(Color.WHITE); in showPath()
59 canvas.drawPath(mPath, paint); in showPath()
60 canvas.restore(); in showPath()
63 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
66 canvas.drawColor(0xFFCCCCCC); in onDraw()
68 canvas.translate(20, 20); in onDraw()
[all …]
DTextAlign.java91 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
92 canvas.drawColor(Color.WHITE); in onDraw()
102 canvas.drawLine(x, y, x, y+DY*3, p); in onDraw()
105 canvas.translate(0, DY); in onDraw()
107 canvas.drawText(TEXT_L, x, y, p); in onDraw()
109 canvas.translate(0, DY); in onDraw()
111 canvas.drawText(TEXT_C, x, y, p); in onDraw()
113 canvas.translate(0, DY); in onDraw()
115 canvas.drawText(TEXT_R, x, y, p); in onDraw()
117 canvas.translate(100, DY*2); in onDraw()
[all …]
DPictures.java42 static void drawSomething(Canvas canvas) { in drawSomething() argument
46 canvas.drawCircle(50, 50, 40, p); in drawSomething()
50 canvas.drawText("Pictures", 60, 60, p); in drawSomething()
65 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
66 canvas.drawColor(Color.WHITE); in onDraw()
68 canvas.drawPicture(mPicture); in onDraw()
70 canvas.drawPicture(mPicture, new RectF(0, 100, getWidth(), 200)); in onDraw()
73 mDrawable.draw(canvas); in onDraw()
78 canvas.translate(0, 300); in onDraw()
79 canvas.drawPicture(Picture.createFromStream(is)); in onDraw()
DMeasureText.java72 private void showText(Canvas canvas, String text, Paint.Align align) { in showText() argument
83 canvas.drawRect(bounds, mPaint); in showText()
85 canvas.drawText(text, 0, 0, mPaint); in showText()
99 canvas.drawLine(0, 0, w, 0, mPaint); in showText()
101 canvas.drawPoints(pts, 0, (count + 1) << 1, mPaint); in showText()
104 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
105 canvas.drawColor(Color.WHITE); in onDraw()
107 canvas.translate(mOriginX, mOriginY); in onDraw()
109 showText(canvas, "Measure", Paint.Align.LEFT); in onDraw()
110 canvas.translate(0, 80); in onDraw()
[all …]
DLayers.java50 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
51 canvas.drawColor(Color.WHITE); in onDraw()
53 canvas.translate(10, 10); in onDraw()
55 canvas.saveLayerAlpha(0, 0, 200, 200, 0x88, LAYER_FLAGS); in onDraw()
58 canvas.drawCircle(75, 75, 75, mPaint); in onDraw()
60 canvas.drawCircle(125, 125, 75, mPaint); in onDraw()
62 canvas.restore(); in onDraw()
DPictureLayout.java109 private void drawPict(Canvas canvas, int x, int y, int w, int h, in drawPict() argument
111 canvas.save(); in drawPict()
112 canvas.translate(x, y); in drawPict()
113 canvas.clipRect(0, 0, w, h); in drawPict()
114 canvas.scale(0.5f, 0.5f); in drawPict()
115 canvas.scale(sx, sy, w, h); in drawPict()
116 canvas.drawPicture(mPicture); in drawPict()
117 canvas.restore(); in drawPict()
121 protected void dispatchDraw(Canvas canvas) { in dispatchDraw() argument
129 canvas.drawPicture(mPicture); in dispatchDraw()
[all …]
DVertices.java85 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
86 canvas.drawColor(0xFFCCCCCC); in onDraw()
87 canvas.save(); in onDraw()
88 canvas.concat(mMatrix); in onDraw()
90 canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0, in onDraw()
93 canvas.translate(0, 240); in onDraw()
94 canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0, in onDraw()
97 canvas.restore(); in onDraw()
DUnicodeChart.java83 private void drawChart(Canvas canvas, int base) { in drawChart() argument
89 canvas.drawText(Integer.toHexString(unichar), in drawChart()
92 canvas.drawPosText(chars, 0, 256, mPos, mBigCharPaint); in drawChart()
95 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
96 canvas.drawColor(Color.WHITE); in onDraw()
98 canvas.translate(0, 1); in onDraw()
99 drawChart(canvas, mBase * 256); in onDraw()
DAnimateDrawable.java56 public void draw(Canvas canvas) { in draw() argument
59 int sc = canvas.save(); in draw()
65 canvas.concat(mTransformation.getMatrix()); in draw()
67 dr.draw(canvas); in draw()
68 canvas.restoreToCount(sc); in draw()
DWindowSurface.java209 Canvas canvas = mSurface.lockCanvas(); in run() local
210 if (canvas == null) { in run()
218 mPoint1.init(canvas.getWidth(), canvas.getHeight(), mMinStep); in run()
219 mPoint2.init(canvas.getWidth(), canvas.getHeight(), mMinStep); in run()
222 mPoint1.step(canvas.getWidth(), canvas.getHeight(), in run()
224 mPoint2.step(canvas.getWidth(), canvas.getHeight(), in run()
234 canvas.drawColor(mBackground.getColor()); in run()
241 canvas.drawLine(mOld[p], mOld[p+1], mOld[p+2], mOld[p+3], mForeground); in run()
251 canvas.drawLine(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y, mForeground); in run()
266 mSurface.unlockCanvasAndPost(canvas); in run()
DArcs.java90 private void drawArcs(Canvas canvas, RectF oval, boolean useCenter, in drawArcs() argument
92 canvas.drawRect(oval, mFramePaint); in drawArcs()
93 canvas.drawArc(oval, mStart, mSweep, useCenter, paint); in drawArcs()
96 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
97 canvas.drawColor(Color.WHITE); in onDraw()
99 drawArcs(canvas, mBigOval, mUseCenters[mBigIndex], in onDraw()
103 drawArcs(canvas, mOvals[i], mUseCenters[i], mPaints[i]); in onDraw()
DColorFilters.java128 private void drawSample(Canvas canvas, ColorFilter filter) { in drawSample() argument
134 mDrawable.draw(canvas); in drawSample()
135 canvas.drawText("Label", x+1, y+1, mPaint2); in drawSample()
136 canvas.drawText("Label", x, y, mPaint); in drawSample()
140 dr.draw(canvas); in drawSample()
144 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
145 canvas.drawColor(0xFFCCCCCC); in onDraw()
147 canvas.translate(8, 12); in onDraw()
156 drawSample(canvas, filter); in onDraw()
157 canvas.translate(0, 55); in onDraw()
DDrawPoints.java63 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
66 canvas.translate(10, 10); in onDraw()
68 canvas.drawColor(Color.WHITE); in onDraw()
72 canvas.drawLines(mPts, paint); in onDraw()
76 canvas.drawPoints(mPts, paint); in onDraw()
DCompass.java97 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
100 canvas.drawColor(Color.WHITE); in onDraw()
106 int w = canvas.getWidth(); in onDraw()
107 int h = canvas.getHeight(); in onDraw()
111 canvas.translate(cx, cy); in onDraw()
113 canvas.rotate(-mValues[0]); in onDraw()
115 canvas.drawPath(mPath, mPaint); in onDraw()
DTypefaces.java46 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
47 canvas.drawColor(Color.WHITE); in onDraw()
50 canvas.drawText("Default", 10, 100, mPaint); in onDraw()
52 canvas.drawText("Custom", 10, 200, mPaint); in onDraw()
DCreateBitmap.java111 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
112 canvas.drawColor(Color.WHITE); in onDraw()
115 canvas.drawBitmap(mBitmaps[i], 0, 0, null); in onDraw()
116 canvas.drawBitmap(mJPEG[i], 80, 0, null); in onDraw()
117 canvas.drawBitmap(mPNG[i], 160, 0, null); in onDraw()
118 canvas.translate(0, mBitmaps[i].getHeight()); in onDraw()
122 canvas.drawBitmap(mColors, 0, STRIDE, 0, 0, WIDTH, HEIGHT, in onDraw()
124 canvas.translate(0, HEIGHT); in onDraw()
125 canvas.drawBitmap(mColors, 0, STRIDE, 0, 0, WIDTH, HEIGHT, in onDraw()
DXfermodes.java118 @Override protected void onDraw(Canvas canvas) { in onDraw() argument
119 canvas.drawColor(Color.WHITE); in onDraw()
127 canvas.translate(15, 35); in onDraw()
135 canvas.drawRect(x - 0.5f, y - 0.5f, in onDraw()
141 canvas.drawRect(x, y, x + W, y + H, paint); in onDraw()
144 int sc = canvas.saveLayer(x, y, x + W, y + H, null, in onDraw()
150 canvas.translate(x, y); in onDraw()
151 canvas.drawBitmap(mDstB, 0, 0, paint); in onDraw()
153 canvas.drawBitmap(mSrcB, 0, 0, paint); in onDraw()
155 canvas.restoreToCount(sc); in onDraw()
[all …]
/development/samples/ApiDemos/src/com/example/android/apis/os/
DSensors.java106 protected void onDraw(Canvas canvas) { in onDraw() argument
126 canvas.drawBitmap(mBitmap, 0, 0, null); in onDraw()
134 canvas.save(Canvas.MATRIX_SAVE_FLAG); in onDraw()
135 canvas.translate(x, w*0.5f + 4.0f); in onDraw()
136 canvas.save(Canvas.MATRIX_SAVE_FLAG); in onDraw()
138 canvas.scale(w, w); in onDraw()
139 canvas.drawOval(mRect, paint); in onDraw()
140 canvas.restore(); in onDraw()
141 canvas.scale(w-5, w-5); in onDraw()
143 canvas.rotate(-values[i]); in onDraw()
[all …]
/development/samples/CrossCompatibility/src/com/example/android/touchexample/
DTouchExampleView.java56 public void onDraw(Canvas canvas) { in onDraw() argument
57 super.onDraw(canvas); in onDraw()
59 canvas.save(); in onDraw()
60 canvas.translate(mPosX, mPosY); in onDraw()
61 canvas.scale(mScaleFactor, mScaleFactor); in onDraw()
62 mIcon.draw(canvas); in onDraw()
63 canvas.restore(); in onDraw()
/development/samples/BrowserPlugin/jni/paint/
DPaintPlugin.cpp105 ANPCanvas* canvas = gCanvasI.newCanvas(&bitmap); in getCanvas() local
116 gCanvasI.clipRect(canvas, &clipR); in getCanvas()
119 return canvas; in getCanvas()
133 void PaintPlugin::releaseCanvas(ANPCanvas* canvas) { in releaseCanvas() argument
138 gCanvasI.deleteCanvas(canvas); in releaseCanvas()
141 void PaintPlugin::drawCleanPlugin(ANPCanvas* canvas) { in drawCleanPlugin() argument
146 if (!canvas) in drawCleanPlugin()
147 canvas = getCanvas(); in drawCleanPlugin()
149 if (!canvas) in drawCleanPlugin()
158 gCanvasI.drawColor(canvas, 0xFFCDCDCD); in drawCleanPlugin()
[all …]

123