Hi There,
I've made an example code (http://smartandroidians.blogspot.com/
2009/10/rotating-bitmap-in-android.html) on rotating Bitmap from
resouce on the CustomView (derived from SurfaceView) and it works as
long as I use:
setContentView(new MySurfaceView(this));

But when I put the view info to layout XML<com.test.MySurfaceView
{attribs....} /> and get a handler by findViewById it correctly draws
my Bitmap but no rotating.

my main drawing method in MySurfaceView looks like this:

   public void onDraw(Canvas canvas) {
                Bitmap img = BitmapFactory.decodeResource(getResources(),
R.drawable.image);
                canvas.drawColor(Color.GRAY);
                canvas.drawBitmap(img, 100, 100, null);

                canvas.save();
                canvas.rotate(mDeg, 80, 80);
                mDeg++;
                canvas.restore();
    }

I've checked in the debugger and the onDraw is called continuously
which is what I expect. Also the mDeg increases and is passed to
canvas.rotate() properly.

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

Reply via email to