我尝试在图像上绘制文本,但它不起作用。这是我的代码:
ImageView image = (ImageView) findViewById(R.id.imageView1);
Uri uri = Uri.parse("android.resource://mms.first/"+R.drawable.girl);
Bitmap bitmap;
try {
ContentResolver cr = getContentResolver();
bitmap = android.provider.MediaStore.Images.Media.getBitmap(cr, uri);
//drawTextImage(bitmap);
Canvas c = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColor(Color.BLUE);
paint.setStyle(Paint.Style.FILL);
paint.setAntiAlias(true);
paint.setTextSize(20);
c.drawText("Golden Stag", 30, 200, paint);
image.setImageBitmap(bitmap);