Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mPanel = (Panel) findViewById(R.id.yourID);
- mPanel.setBackgroundColor(Color.WHITE);
- mPanel.requestFocus();
- private void prepareBitmaps() {
- int a=255;
- int r=255;
- int g=255;
- int b=255;
- if (mBitmap == null) {
- tCanvas = getHolder().lockCanvas();
- mBitmap = Bitmap.createBitmap(350, 350, Bitmap.Config.ARGB_8888);
- mCanvas = new Canvas(mBitmap);
- tmpBitmap = Bitmap.createBitmap(350,350, Bitmap.Config.ARGB_8888);
- tmpCanvas = new Canvas(tmpBitmap);
- //tCanvas.getWidth(), tCanvas.getHeight()
- // tmpCanvas.drawColor(farba);
- tmpCanvas.drawARGB(a,r,g,b);
- mCanvas.drawARGB(a, r, g, b);
- // mCanvas.drawColor(farba);
- getHolder().unlockCanvasAndPost(tCanvas);
- tCanvas = null;
- }
- }
Add Comment
Please, Sign In to add comment