(Bitmap src, Bitmap dst, float left, float top, int alpha)
| 857 | } |
| 858 | |
| 859 | public static Bitmap overlay(Bitmap src, Bitmap dst, float left, float top, int alpha) |
| 860 | { |
| 861 | alpha = Math.min(Math.max(0, alpha), 255); |
| 862 | if(!dst.isMutable()) |
| 863 | throw new NullPointerException("cannot write to dst Bitmap"); |
| 864 | |
| 865 | // operations on Canvas, a preferable way! |
| 866 | Paint paint = new Paint(); |
| 867 | paint.setAntiAlias(true); |
| 868 | paint.setAlpha(255 - alpha); |
| 869 | |
| 870 | Canvas canvas = new Canvas(dst); |
| 871 | canvas.drawBitmap(dst, 0, 0, paint); |
| 872 | |
| 873 | paint.setAlpha(alpha); |
| 874 | canvas.drawBitmap(src, left, top, paint); |
| 875 | |
| 876 | return dst; |
| 877 | } |
| 878 | |
| 879 | public static Bitmap overlay(Bitmap src, Bitmap dst, Matrix matrix, int alpha) |
| 880 | { |
nothing calls this directly
no test coverage detected