I am trying to draw bitmap on canvas of its size (fullscreen), thus I wrote below code:
Bitmap bm= BitmapFactory.decodeResource(getContext().getResources(), R.drawable.level_bg);
Rect dest = new Rect(0, 0, getWidth(), getHeight());
canvas.drawBitmap(bm, null, dest, paint);
but I am getting some horizontal lines over the image as shown in picture. screenshot
I also tried below code:
BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false;
options.inDither = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bm = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.level_bg, options);
Paint paint = new Paint();
paint.setFilterBitmap(true);
canvas.drawBitmap(bm, null, dest, paint);
Any help ?