Android中的ZigZags线条画是绘制点

时间:2014-06-06 05:08:01

标签: android canvas paint

绘制曲折线时,这是绘制点而不是附加图像enter image description here

switch (selected_drawing_option) 
{ 

//此代码用于绘制直线并且运行良好

**case OPTION_DRAW_LINE:**
currentShape = new LineShape(new Paint(paint), x, y, x + 10, y);
listOfShapesToBeDrawn.add(currentShape);
break;


// this code is for drawing circle and working well    

    **case OPTION_DRAW_CIRCLE:**
        currentShape = new CircleShape(new Paint(paint), x, y, 5);
        listOfShapesToBeDrawn.add(currentShape);
        break;

    **case OPTION_DRAW_RECTANGLE:**
    // this code is for drawing rectangle and working well
    currentShape = new RectangleShape(new Paint(paint), x, y,x + 5, y + 5);
    listOfShapesToBeDrawn.add(currentShape);
    break;

    **case OPTION_DRAW_FREESTYLE:**
    //Here is bug this code should draw freestyle line(Similar to signature) but drawing pixels 
    if (path != null) {
        }
    pp = new PathPaint();
    path.moveTo(x, y);
    path.lineTo(x, y);

    currentShape = new FreestyleShape(new Paint(paint), x, y);
    pp.setPathPaint(path, getPaint());
    listOfShapesToBeDrawn.add(currentShape);
    break;

0 个答案:

没有答案