Guest User

Untitled

a guest
Jan 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. super.onCreate(savedInstanceState);
  2.  
  3. setContentView(R.layout.main);
  4. mPanel = (Panel) findViewById(R.id.yourID);
  5. mPanel.setBackgroundColor(Color.WHITE);
  6. mPanel.requestFocus();
  7.  
  8. private void prepareBitmaps() {
  9.  
  10.  
  11.  
  12. int a=255;
  13. int r=255;
  14. int g=255;
  15. int b=255;
  16.  
  17. if (mBitmap == null) {
  18.  
  19. tCanvas = getHolder().lockCanvas();
  20. mBitmap = Bitmap.createBitmap(350, 350, Bitmap.Config.ARGB_8888);
  21. mCanvas = new Canvas(mBitmap);
  22. tmpBitmap = Bitmap.createBitmap(350,350, Bitmap.Config.ARGB_8888);
  23. tmpCanvas = new Canvas(tmpBitmap);
  24. //tCanvas.getWidth(), tCanvas.getHeight()
  25. // tmpCanvas.drawColor(farba);
  26. tmpCanvas.drawARGB(a,r,g,b);
  27. mCanvas.drawARGB(a, r, g, b);
  28. // mCanvas.drawColor(farba);
  29. getHolder().unlockCanvasAndPost(tCanvas);
  30. tCanvas = null;
  31.  
  32. }
  33. }
Add Comment
Please, Sign In to add comment