ERASE image between drawing pointsDifferences between HashMap and Hashtable?What is the difference between public, protected, package-private and private in Java?Difference between StringBuilder and StringBufferLazy load of images in ListViewWhat is the difference between “px”, “dip”, “dp” and “sp”?What is the difference between match_parent and fill_parent?What's the difference between @Component, @Repository & @Service annotations in Spring?Image Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionBest way to determine screen dimensions for signature capture stroke width?Undo/Redo not working in android Canvas

What can we do about our 9-month-old putting fingers down his throat?

Can you mark a new target with the Hunter's Mark spell if the original target shifts to a different plane?

Are professors obligated to accept supervisory role? If not, how does it work?

A question regarding Buddhist world view and sense organs and their objects

Short story: Interstellar inspector senses "off" nature of planet hiding aggressive culture

How invisible hand adjusts stock prices if company is listed on multiple exchanges, under multiple currencies, and one of the currencies plunges?

How should we understand "unobscured by flying friends" in this context?

What is the purpose of the rotating plate in front of the lock?

Does the word voltage exist in academic engineering?

Problem with listing a directory to grep

Is future tense in English really a myth?

Word for something that used to be popular but not anymore

Strategies for dealing with chess burnout?

Why did Tony's Arc Reactor do this?

How there are 3 possible tautomers of 2,2,4-trimethylheptane-3,5-dione?

How to find eigenvalues of the matrix

The meaning of "offing" in "an agreement in the offing"

More than three domains hosted on the same IP address

Is mountain bike good for long distances?

Proving a result by making discriminant zero

Galilean transformation vs simple translation

What explains the Genie's fate?

Is there a way to deal with desistance in a off-chain game?

Owner keeps cutting corners and poaching workers for his other company



ERASE image between drawing points


Differences between HashMap and Hashtable?What is the difference between public, protected, package-private and private in Java?Difference between StringBuilder and StringBufferLazy load of images in ListViewWhat is the difference between “px”, “dip”, “dp” and “sp”?What is the difference between match_parent and fill_parent?What's the difference between @Component, @Repository & @Service annotations in Spring?Image Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionBest way to determine screen dimensions for signature capture stroke width?Undo/Redo not working in android Canvas






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















In my app i want to play video on image. user draw a path from finger when they finished i join last point to first point. so the problem is i want to remove/delete all the point between starting and ending point.





Now i want this want this





below here is my code
and then second how to customize video view. i want to play video in that white area.



public class CanvasView extends View 

public int width;
public int height;
private Bitmap mBitmap,workingBitmap;
private Canvas mCanvas;
static Path mPath;
private Paint mPaint;
private Paint mBitmapPaint;
private float mX, mY,startingpoint,endingpoint;
private static final float TOLERANCE = 5;
Context context;



public CanvasView(Context c, AttributeSet attrs)
super(c, attrs);
context = c;
mPaint = new Paint(Paint.DITHER_FLAG);
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(Color.parseColor("#37A1D1"));
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(2);
mPath = new Path();
mPaint.setStrokeWidth(4f);
mBitmapPaint = new Paint(Paint.DITHER_FLAG);




@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh)
super.onSizeChanged(w, h, oldw, oldh);
mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
mCanvas = new Canvas(mBitmap.copy(Bitmap.Config.ARGB_8888, true));


@Override
protected void onDraw(Canvas canvas)
super.onDraw(canvas);
canvas.drawBitmap(mBitmap,0,0,mBitmapPaint);
canvas.drawPath(mPath, mPaint);



private void startTouch(float x, float y)
mPath.reset();
mPath.moveTo(x, y);
startingpoint = x;
endingpoint = y;
mX = x;
mY = y;



private void moveTouch(float x, float y)
float dx = Math.abs(x - mX);
float dy = Math.abs(y - mY);
if (dx >= TOLERANCE
private void upTouch()
mPath.lineTo(mX, mY);
mPath.lineTo(startingpoint,endingpoint);
mCanvas.drawPath(mPath, mPaint);



//override the onTouchEvent
@Override
public boolean onTouchEvent(MotionEvent event)
float x = event.getX();
float y = event.getY();

switch (event.getAction())
case MotionEvent.ACTION_DOWN:
startTouch(x, y);
invalidate();
break;
case MotionEvent.ACTION_MOVE:
moveTouch(x, y);
invalidate();
break;
case MotionEvent.ACTION_UP:
upTouch();
invalidate();
break;

return true;













share|improve this question
































    0















    In my app i want to play video on image. user draw a path from finger when they finished i join last point to first point. so the problem is i want to remove/delete all the point between starting and ending point.





    Now i want this want this





    below here is my code
    and then second how to customize video view. i want to play video in that white area.



    public class CanvasView extends View 

    public int width;
    public int height;
    private Bitmap mBitmap,workingBitmap;
    private Canvas mCanvas;
    static Path mPath;
    private Paint mPaint;
    private Paint mBitmapPaint;
    private float mX, mY,startingpoint,endingpoint;
    private static final float TOLERANCE = 5;
    Context context;



    public CanvasView(Context c, AttributeSet attrs)
    super(c, attrs);
    context = c;
    mPaint = new Paint(Paint.DITHER_FLAG);
    mPaint.setAntiAlias(true);
    mPaint.setDither(true);
    mPaint.setColor(Color.parseColor("#37A1D1"));
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    mPaint.setStrokeWidth(2);
    mPath = new Path();
    mPaint.setStrokeWidth(4f);
    mBitmapPaint = new Paint(Paint.DITHER_FLAG);




    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh)
    super.onSizeChanged(w, h, oldw, oldh);
    mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
    mCanvas = new Canvas(mBitmap.copy(Bitmap.Config.ARGB_8888, true));


    @Override
    protected void onDraw(Canvas canvas)
    super.onDraw(canvas);
    canvas.drawBitmap(mBitmap,0,0,mBitmapPaint);
    canvas.drawPath(mPath, mPaint);



    private void startTouch(float x, float y)
    mPath.reset();
    mPath.moveTo(x, y);
    startingpoint = x;
    endingpoint = y;
    mX = x;
    mY = y;



    private void moveTouch(float x, float y)
    float dx = Math.abs(x - mX);
    float dy = Math.abs(y - mY);
    if (dx >= TOLERANCE
    private void upTouch()
    mPath.lineTo(mX, mY);
    mPath.lineTo(startingpoint,endingpoint);
    mCanvas.drawPath(mPath, mPaint);



    //override the onTouchEvent
    @Override
    public boolean onTouchEvent(MotionEvent event)
    float x = event.getX();
    float y = event.getY();

    switch (event.getAction())
    case MotionEvent.ACTION_DOWN:
    startTouch(x, y);
    invalidate();
    break;
    case MotionEvent.ACTION_MOVE:
    moveTouch(x, y);
    invalidate();
    break;
    case MotionEvent.ACTION_UP:
    upTouch();
    invalidate();
    break;

    return true;













    share|improve this question




























      0












      0








      0








      In my app i want to play video on image. user draw a path from finger when they finished i join last point to first point. so the problem is i want to remove/delete all the point between starting and ending point.





      Now i want this want this





      below here is my code
      and then second how to customize video view. i want to play video in that white area.



      public class CanvasView extends View 

      public int width;
      public int height;
      private Bitmap mBitmap,workingBitmap;
      private Canvas mCanvas;
      static Path mPath;
      private Paint mPaint;
      private Paint mBitmapPaint;
      private float mX, mY,startingpoint,endingpoint;
      private static final float TOLERANCE = 5;
      Context context;



      public CanvasView(Context c, AttributeSet attrs)
      super(c, attrs);
      context = c;
      mPaint = new Paint(Paint.DITHER_FLAG);
      mPaint.setAntiAlias(true);
      mPaint.setDither(true);
      mPaint.setColor(Color.parseColor("#37A1D1"));
      mPaint.setStyle(Paint.Style.STROKE);
      mPaint.setStrokeJoin(Paint.Join.ROUND);
      mPaint.setStrokeCap(Paint.Cap.ROUND);
      mPaint.setStrokeWidth(2);
      mPath = new Path();
      mPaint.setStrokeWidth(4f);
      mBitmapPaint = new Paint(Paint.DITHER_FLAG);




      @Override
      protected void onSizeChanged(int w, int h, int oldw, int oldh)
      super.onSizeChanged(w, h, oldw, oldh);
      mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
      mCanvas = new Canvas(mBitmap.copy(Bitmap.Config.ARGB_8888, true));


      @Override
      protected void onDraw(Canvas canvas)
      super.onDraw(canvas);
      canvas.drawBitmap(mBitmap,0,0,mBitmapPaint);
      canvas.drawPath(mPath, mPaint);



      private void startTouch(float x, float y)
      mPath.reset();
      mPath.moveTo(x, y);
      startingpoint = x;
      endingpoint = y;
      mX = x;
      mY = y;



      private void moveTouch(float x, float y)
      float dx = Math.abs(x - mX);
      float dy = Math.abs(y - mY);
      if (dx >= TOLERANCE
      private void upTouch()
      mPath.lineTo(mX, mY);
      mPath.lineTo(startingpoint,endingpoint);
      mCanvas.drawPath(mPath, mPaint);



      //override the onTouchEvent
      @Override
      public boolean onTouchEvent(MotionEvent event)
      float x = event.getX();
      float y = event.getY();

      switch (event.getAction())
      case MotionEvent.ACTION_DOWN:
      startTouch(x, y);
      invalidate();
      break;
      case MotionEvent.ACTION_MOVE:
      moveTouch(x, y);
      invalidate();
      break;
      case MotionEvent.ACTION_UP:
      upTouch();
      invalidate();
      break;

      return true;













      share|improve this question
















      In my app i want to play video on image. user draw a path from finger when they finished i join last point to first point. so the problem is i want to remove/delete all the point between starting and ending point.





      Now i want this want this





      below here is my code
      and then second how to customize video view. i want to play video in that white area.



      public class CanvasView extends View 

      public int width;
      public int height;
      private Bitmap mBitmap,workingBitmap;
      private Canvas mCanvas;
      static Path mPath;
      private Paint mPaint;
      private Paint mBitmapPaint;
      private float mX, mY,startingpoint,endingpoint;
      private static final float TOLERANCE = 5;
      Context context;



      public CanvasView(Context c, AttributeSet attrs)
      super(c, attrs);
      context = c;
      mPaint = new Paint(Paint.DITHER_FLAG);
      mPaint.setAntiAlias(true);
      mPaint.setDither(true);
      mPaint.setColor(Color.parseColor("#37A1D1"));
      mPaint.setStyle(Paint.Style.STROKE);
      mPaint.setStrokeJoin(Paint.Join.ROUND);
      mPaint.setStrokeCap(Paint.Cap.ROUND);
      mPaint.setStrokeWidth(2);
      mPath = new Path();
      mPaint.setStrokeWidth(4f);
      mBitmapPaint = new Paint(Paint.DITHER_FLAG);




      @Override
      protected void onSizeChanged(int w, int h, int oldw, int oldh)
      super.onSizeChanged(w, h, oldw, oldh);
      mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
      mCanvas = new Canvas(mBitmap.copy(Bitmap.Config.ARGB_8888, true));


      @Override
      protected void onDraw(Canvas canvas)
      super.onDraw(canvas);
      canvas.drawBitmap(mBitmap,0,0,mBitmapPaint);
      canvas.drawPath(mPath, mPaint);



      private void startTouch(float x, float y)
      mPath.reset();
      mPath.moveTo(x, y);
      startingpoint = x;
      endingpoint = y;
      mX = x;
      mY = y;



      private void moveTouch(float x, float y)
      float dx = Math.abs(x - mX);
      float dy = Math.abs(y - mY);
      if (dx >= TOLERANCE
      private void upTouch()
      mPath.lineTo(mX, mY);
      mPath.lineTo(startingpoint,endingpoint);
      mCanvas.drawPath(mPath, mPaint);



      //override the onTouchEvent
      @Override
      public boolean onTouchEvent(MotionEvent event)
      float x = event.getX();
      float y = event.getY();

      switch (event.getAction())
      case MotionEvent.ACTION_DOWN:
      startTouch(x, y);
      invalidate();
      break;
      case MotionEvent.ACTION_MOVE:
      moveTouch(x, y);
      invalidate();
      break;
      case MotionEvent.ACTION_UP:
      upTouch();
      invalidate();
      break;

      return true;










      java android image-processing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 8:30









      I am a Student

      9352 gold badges14 silver badges29 bronze badges




      9352 gold badges14 silver badges29 bronze badges










      asked Mar 28 at 7:29









      secure solutionssecure solutions

      11 bronze badge




      11 bronze badge

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392217%2ferase-image-between-drawing-points%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392217%2ferase-image-between-drawing-points%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해