예제 #1
0
 void drawOneWord(Canvas canvas, float fScale) {
   ArrayList pplist = pathDrawing.getPointList();
   for (int i = 0; i < pplist.size(); i++) {
     drawOneStroke(canvas, i, fScale);
   }
   pathDrawing.ResetPointList();
   nWordCount++;
 }
예제 #2
0
  void drawOneStroke(Canvas canvas, int nStroke, float fScale) {
    ArrayList pplist = pathDrawing.getPointList();
    List<PathLine.point> list = (List) pplist.get(nStroke);
    path.reset();
    point p = new point(((PathLine.point) list.get(0)).x, ((PathLine.point) list.get(0)).y);
    p.x = (p.x - (float) l);
    p.y = (p.y - (float) t);
    if (p.x < 0x0) {
      Log.d("error", "posx exception");
    }
    if (p.y < 0) {
      Log.d("error", "posy exception");
    }
    p.x = (p.x * fScale);
    p.y = (p.y * fScale);
    if (sHWRate < 0.1f) {
      p.y = 10.0f;
    }
    p.x = (p.x + (float) nstartx);
    p.y = (p.y + (float) nstarty);
    path.moveTo(p.x, p.y);
    float mX = p.x;
    float mY = p.y;
    for (int i = 0x1; i < list.size(); i = i + 0x1) {

      p.setXY(
          (((PathLine.point) list.get(i)).x - (float) l),
          (((PathLine.point) list.get(i)).y - (float) t));
      p.x = (p.x * fScale);
      p.y = (p.y * fScale);
      if (sHWRate < 0.1f) {
        p.y = 10.0f;
      }
      if (p.x < 0x0) {
        Log.d("error", "pos exception");
      }
      if (p.y < 0) {
        Log.d("error", "posy exception");
      }
      p.x = (p.x + (float) nstartx);
      p.y = (p.y + (float) nstarty);
      path.quadTo(mX, mY, ((p.x + mX) / 2.0f), ((p.y + mY) / 2.0f));
      mX = p.x;
      mY = p.y;
    }
    try {
      canvas.drawPath(path, thinPen);
      return;
    } catch (Exception e) {
      e.printStackTrace();
    }
  }