SurfaceView clears Canvas how to operate

public void < span class="hljs-title">ClearDraw(){ Canvas canvas = null; try{ canvas = surfaceHolder.lockCanvas(null); canvas.drawColor(Color.WHITE); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);} catch(Exception e){ }finally{ if(canvas != null){ surfaceHolder.unlockCanvasAndPost(canvas);}} }

Call this method before drawing to clear the canvas .

public void< /span> ClearDraw(){ Canvas canvas = null;  try{ canvas = surfaceHolder.lockCanvas(null); canvas.drawColor(Color.WHITE); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode. SRC); }catch(Exception e){ }finally{ if(canvas != null){ surfaceHolder.unlockCanvasAndPost(canvas);}} }

Call this method before drawing You can clear the canvas.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1507 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.