怎么实现android 实现心电图样式的曲线(有坐标)还请各位大侠给予指点,万分感谢。

解决方案 »

  1. 大概形式就是这样,画图就行了class GameView extends SurfaceView implements SurfaceHolder.Callback {
    @Override
            public void run() {
                while (mRun) {
                    Canvas c = null;
                    try {
                        c = mSurfaceHolder.lockCanvas(null);
                        synchronized (mSurfaceHolder) {
                            doDraw(c);
                        }
                    } finally {
                        // do this in a finally so that if an exception is thrown
                        // during the above, we don't leave the Surface in an
                        // inconsistent state
                        if (c != null) {
                            mSurfaceHolder.unlockCanvasAndPost(c);
                        }
                    }
                }
            } private void doDraw(Canvas canvas) {
                //draw
            }
    }
      

  2. 不是很清楚,有个drawpath好像,楼主试试可行否
      

aliyun

类似问题 »