Page 1 of 1

PostPosted: Mon Oct 07, 2002 9:01 pm
by design4use
I have a gadget on screen. The gadget owns a fairly large offscreen buffer created with Draw.create().

Here is what happens: When I populate the offscreen buffer with drawn objects, I can see the contents of the buffer drawn on to the screen instead of offscreen as was expected. It starts drawing visibly on the screen at (0,0) even before the gadget gets drawn and before the form draws it title widget on top of the drawings.
Obviously this is not expected, and I wonder where I can start to debug or plan a workaround?

FWIW, the buffer is fairly large at 150px wide * 990 px tall, as it needs to accomodate a list of drawn elements. Since the emulator is set to and the target machine will be at 16MB, there should be plenty of ram though...

PostPosted: Mon Oct 07, 2002 9:41 pm
by dewey
Does Draw.create() succeed?
Are you calling Draw.begin() first? This is generally the cause of this problem.

PostPosted: Mon Oct 07, 2002 10:22 pm
by design4use
You are right again, I checked whether create() succeeded and it didn't.
Now I am suspecting this might be due to running out of memory?
Is there a good way to estimate how much memory a buffer will need, and what factors determine when should get worried about the buffer size? (I am on a 16MB Treo in 12-/16-bit color mode)

PostPosted: Mon Oct 07, 2002 11:39 pm
by dewey
150 * 990 = 148500 pixels. If you are running in 8-bit mode, that's 148k, 2-4 times that in 12/16-bit mode (depending on the interal bitmap format. I think 4). Here's the catch: a Palm app only gets a small amount of RAM to run in, not the full 16MB. The amount varies by device, but is likely less than 200k on yours.

PostPosted: Tue Oct 08, 2002 3:09 pm
by design4use
ouch! back to the drawing board...:(