| Reply | « Previous Thread | Next Thread » |
|
Hi !
I have a problem regarding updating the screen correctly. I have written an application which changes a fullscreen main-canvas frequently. Between two redraw cycles i display another canvas with setCurrent(). The problem (or interesting effect) now is, that after i re-set the modified main-canvas with setCurrent() , the canvas is painted in the old state first. Here is to say, that my drawing layouting is done in the paint() method and some time elapses here. What i want to know now: Why is this so ? Why is my Canvas painted out to the display before the paint() method has been invoked ? I have no chance to paint out, even a buffered image, because the platform copies some internal buffer out to the screen before i have the chance to draw on it. I thought about using serviceRepaints(). But even if i use this, System would render out the internal buffer first. So my question is: Is it possible that the underlying platform copies the internal buffer of canvas out to the screen (triggered by setCurrent() without invoking paint() before ? Yes, the answer would be know: thats the sense of buffering. But then i would like to know, what triggers my internal buffer to be drawn out. So far i thought a repaint() triggers a paint() to be invoked and then the buffer is rendered out. But somehow the buffer seems to be rendered out more often, independent of invocation of paint(). Maybe somebody has some documentation for the internal mechanism of painting. regards Michael |
| rosenholzer |
| View Public Profile |
| Find all posts by rosenholzer |
|
Hi Michael, There is nothing as such internal buffer in paint mechanism. And if u are using same canvas instance u dont have to call setCurrent() again and again, just call repaint(). And when ur paint() is called change ur draw states.
au revoir Prakash Raman |
| prakash.raman |
| View Public Profile |
| Find all posts by prakash.raman |
|
Hi !
I use two instances of canvas one containing the content and one containing a progress bar and change between them using the setCurrent method. regards |
| rosenholzer |
| View Public Profile |
| Find all posts by rosenholzer |
|
Quote:
Can you tell me why you are using two canvas ? If you do not have any specific requirement for two canvas then i will suggest you to go with one canvas because it will effect the performance on small device which has limited memory. From your description i found that you can display progressbar and other content one by one on same canvas. You just need to use some boolean variable to know in the paint method that what you need to draw. You might solve your problem in this matter. To be frank with you i could not understand the concept of buffer which you were talking about so if possible please explain in details because it never comes in front of me. |
| honest_success |
| View Public Profile |
| Find all posts by honest_success |
|
Hi !
Thanks. Thats the solution i will do. But i was quite interested in the experience of other users and in the question: When is the Graphics objects content really rendered out ? regards |
| rosenholzer |
| View Public Profile |
| Find all posts by rosenholzer |
|
hi, if u want to show progress bar on the content then u need to use same canvas and same graphics of paint to show both.
au revoir Prakash Raman |
| prakash.raman |
| View Public Profile |
| Find all posts by prakash.raman |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| my question is a question about the NOKIA MMSC EAIF EMULATOR. | tinduc | General Messaging | 1 | 2003-04-14 04:14 |
| i'm using the nokia mobile internet toolkit 3.1, and i have a question | tinduc | General Messaging | 0 | 2003-04-07 10:52 |
| Timer question! | iecomdev | Mobile Java General | 2 | 2003-04-04 10:41 |
| question deleted | kiokups | General Messaging | 1 | 2002-09-25 21:07 |