MCPcopy Create free account
hub / github.com/GcsSloop/AndroidNote / onDraw

Method onDraw

CustomView/Advance/Code/SetPolyToPoly.java:103–121  ·  view source on GitHub ↗
(Canvas canvas)

Source from the content-addressed store, hash-verified

101 }
102
103 @Override
104 protected void onDraw(Canvas canvas) {
105 canvas.translate(100,100);
106
107 // 绘制坐标系
108 CanvasAidUtils.setCoordinateLen(900, 0, 1200, 0);
109 CanvasAidUtils.drawCoordinateSpace(canvas);
110
111 // 根据Matrix绘制一个变换后的图片
112 canvas.drawBitmap(mBitmap, mPolyMatrix, null);
113
114 float[] dst = new float[8];
115 mPolyMatrix.mapPoints(dst,src);
116
117 // 绘制触控点
118 for (int i=0; i<testPoint*2; i+=2 ) {
119 canvas.drawPoint(dst[i], dst[i+1],pointPaint);
120 }
121 }
122
123 public void setTestPoint(int testPoint) {
124 this.testPoint = testPoint > 4 || testPoint < 0 ? 4 : testPoint;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected