I'm writing an app were I want to overlay several bitmaps before I display it. BufferedBitmap seems the way to go. I got something to work but not the way described in the documentation. Here is a code snippet in onLayout(dc) of what I am doing:
// set up buffer for the court
offscreenBuffer = new Graphics.BufferedBitmap(
{:width=>200,
:height=>140,
// :bitmapRescource=>court // for some reason this doesn't work ???
} ); // create an off-screen buffer to update the court
bufdc = offscreenBuffer.getDc();
court.draw(bufdc); // works successfully
// bufdc.drawBitmap(20, 85, Ones2); for some reason this doesn't work
Ones2.setLocation(20, 85); // set the location
Ones2.draw(bufdc); //overlays successfully ???
1st issue I have is defining the bitmapResource in the BufferedBitmap. It doesn't display, however if I define it with out the resource and then do a draw() function, it works.
2nd issue I have is I can't get drawBitmap() to work. When I set the x, y locations and the resource nothing displays. When I use the setLocation() and draw() functions, it works!
I must not be understanding some underling principle here, any help would be appreciated.