I am getting a nullpointerexception. Only thing is, it doesn't appear to be there at all devices, so is rather strange to me.. anyway, does anybody know what is causing this, an idea is that it would be Bitmap, but since I declare it myself I guess this is not correct? Since it is not happening on my own device I just have to be sure...
[HIGH]Bitmap bm = BitmapFactory.decodeResource(C.getResources(), resId);
Bitmap result = mark(bm);
public static Bitmap mark(Bitmap src) {
int w = src.getWidth();
// int w = 150;
int h = src.getHeight();
// int h = 150;
Bitmap result = Bitmap.createBitmap(w, h, src.getConfig());
Canvas canvas = new Canvas(result);
canvas.drawBitmap(src, 0, 0, null);
Paint paint = new Paint();
paint.setColor(Color.GRAY);
paint.setTypeface(font);
paint.setTextSize(15);
paint.setAntiAlias(true);
canvas.drawText("Hi", 10, 15, paint);
return result;
}[/HIGH]
[HIGH]Bitmap bm = BitmapFactory.decodeResource(C.getResources(), resId);
Bitmap result = mark(bm);
public static Bitmap mark(Bitmap src) {
int w = src.getWidth();
// int w = 150;
int h = src.getHeight();
// int h = 150;
Bitmap result = Bitmap.createBitmap(w, h, src.getConfig());
Canvas canvas = new Canvas(result);
canvas.drawBitmap(src, 0, 0, null);
Paint paint = new Paint();
paint.setColor(Color.GRAY);
paint.setTypeface(font);
paint.setTextSize(15);
paint.setAntiAlias(true);
canvas.drawText("Hi", 10, 15, paint);
return result;
}[/HIGH]