Still digging but I have example code.  I am able to capture the
bitmap, but now the screen flickers.  The idea here is that the
refresh_background flag gets raised when I need to hold the
background.  Advice super appreciated (especially if I am on the
totally wrong track!).

        private boolean refresh_background = true;

        private void doDraw(Canvas canvas) {

                if (refresh_background || background == null) background =
refresh_background(canvas);
                canvas.drawBitmap(background, 0, 0, mPaint);
        }

        private Bitmap refresh_background(Canvas canvas){

                refresh_background = false;

                canvas.drawColor(Color.WHITE);
                canvas.drawCircle((float)200, (float)200, 50, mPaint);

                System.out.println ("draw background");

                return (getDrawingCache());
        }




On Mar 28, 6:05 pm, robotissues <[email protected]> wrote:
> I am unsure of the jargon so please bear with me, I am seeking advice
> on the best way to go about drawing the graphics for an app I am
> developing.
>
> Imagine you are creating a game of checkers, where you can drag/drop
> one piece at a time to a blank space on the board.   When the piece is
> being moved, it seems to me that you should not need to redraw all of
> the pieces that are not being moved.
>
> Using the LunarLander example, is there a way to store the background
> image and only draw the piece being moved over it?  I have been trying
> to figure out a way to capture the canvas as an bitmap that is
> occasionally refreshed.  Is there a way to do this?
--~--~---------~--~----~------------~-------~--~----~
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