Following is my test code, but it can't drawable.

public class testCanvas extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Canvas canvas = new Canvas();
        Drawable draw = getResources().getDrawable(R.drawable.bg);

        Bitmap bitmap = Bitmap.createBitmap(draw.getIntrinsicWidth(),
                                            draw.getIntrinsicWidth(),
                                            Bitmap.Config.RGB_565);
        Paint paint = new Paint();
        paint.setColor(30);
        canvas.setBitmap(bitmap);
        canvas.drawBitmap(bitmap, bitmap.getHeight(), bitmap.getWidth(), paint);
    }

2011/3/21 Marcin Orlowski <webnet.andr...@gmail.com>:
> On 21 March 2011 09:48, a a <harvey.a...@gmail.com> wrote:
>>
>>   How can i write a tag like string "Dog" on the picture.
>
> Use Canvas to paint on your bitmap.
> http://developer.android.com/reference/android/graphics/Canvas.html
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to