java - Dynamically resize the line drawn on canvas using touch -


in android application have image webview , add annotations on it. so, far have sucessfully been able achieve that. problem not find solution how dynamically scale them once particular annotation drawn. insatance straight line,a circle etc.

private void setupdrawing() {     // drawing area setup interaction     log.d("oncreate", "" + "setupdrawing");     drawpath = new path();     drawrect = new rect();     drawpaint = new paint();     drawpaint.setcolor(paintcolor);     drawpaint.setantialias(true);     drawpaint.setstrokewidth(5);     drawpaint.setstyle(paint.style.stroke);     drawpaint.setstrokejoin(paint.join.round);     drawpaint.setstrokecap(paint.cap.round);     canvaspaint = new paint(paint.dither_flag); }  public boolean ontouchevent(motionevent event) {     // detect user touch     log.d("event", "ontouchevent");     if (candrawfreehand == true) {         log.d("", "candrawfreehand true");          log.d("fag", "got free hand flag " + currentflag);         float touchx = event.getx();         float touchy = event.gety();         switch (event.getaction()) {         case motionevent.action_down:             // log.d("freehand", "draw");             drawpath.moveto(touchx, touchy);             break;         case motionevent.action_move:             // log.d("freehand", "drawing..");             drawpath.lineto(touchx, touchy);             break;         case motionevent.action_up:             log.d("freehand", "drawn");             drawcanvas.drawpath(drawpath, drawpaint);             drawpath.reset();             break;         default:             return false;         } 

}

i want scale them in such way after annotation draw, when user clicks on drawing. ready scaled.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -