Following is my test code

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);
    }

-- 
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