I am setting this bitmap on canvas and getting this IllegalArgumentException while using getPixels() method:
java.lang.IllegalArgumentException: x + width must be <= bitmap.width() in the line
bitmap.getPixels(pixels, 0,bitmap.getWidth(), 1, 1, bitmap.getWidth(), bitmap.getHeight());
How to fix this?