DLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2012
04:07 AM
layer.Clear()
Hello,
Just a simple question on roImageCanvas, in the doc you can find :
Do these functions also delete the layer itself? In my app, the number of layers is dynamic and I sometimes face weird behavior. For example, I have lines of text that appear where they shouldn't, i have rectangles that are supposed to be separate and that are not. It is just like if what i had drawn before was not really cleared and remained on the screen.
I tried using AllowUpdates() and put some Sleep() to be sure to let the time to the box to clear everything before drawing again, but it didn't change.
Any idea of what can cause this? A function I have forgotten maybe?
Thank you.
Denis
Just a simple question on roImageCanvas, in the doc you can find :
Void ClearLayer(Integer zOrder)
Clear all content from a layer (see SetLayer for the layer definition)
Void Clear(Void)
Clear all content from all layers.
Do these functions also delete the layer itself? In my app, the number of layers is dynamic and I sometimes face weird behavior. For example, I have lines of text that appear where they shouldn't, i have rectangles that are supposed to be separate and that are not. It is just like if what i had drawn before was not really cleared and remained on the screen.
I tried using AllowUpdates() and put some Sleep() to be sure to let the time to the box to clear everything before drawing again, but it didn't change.
Any idea of what can cause this? A function I have forgotten maybe?
Thank you.
Denis
6 REPLIES 6
DLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2012
08:37 AM
Re: layer.Clear()
Does someone faced unexpected behavior with those two functions? I tried removing them from my code and i don't have problems anymore. I just create my layers without clearing the ones already created and it is ok. Looks like they are bugged, or maybe it is the roImageCanvas that has a problem? Or maybe there is still something I am missing but I really don't see what.
Any idea?
Denis
Any idea?
Denis
MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2012
08:47 AM
Re: layer.Clear()
I've run into a problem where I overwrite a specific file using roUrlTransfer and roImageCanvas caches the previous image.
In that case, the workaround is to call PurgeCachedImages() BEFORE you clear the layer or AFTER you reset the layer because the purge only happens to the images referenced in the layer at time of the call to purge.
That could lead to what you describe, but it doesn't sound like that is quite the issue you've found.
It might help if you created a function that replicated the problem.
In that case, the workaround is to call PurgeCachedImages() BEFORE you clear the layer or AFTER you reset the layer because the purge only happens to the images referenced in the layer at time of the call to purge.
That could lead to what you describe, but it doesn't sound like that is quite the issue you've found.
It might help if you created a function that replicated the problem.
DLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2012
02:54 AM
Re: layer.Clear()
Ok i'll try it.
Thanks.
Thanks.
DLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
08:22 AM
Re: layer.Clear()
Well I've been working on it till you propose that and it works fine now, though the screen needs one second to show each time i click on one of the remote button. It is a bit disappointed but i will do with it.
Thank you very much.
Thank you very much.
MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
09:25 AM
Re: layer.Clear()
No problem. If there are speed issues, you may want to consider re-implementing that particular screen using an roScreen, which has its own usage requirements on what you can and can't do, but in general roScreen is much faster but less convenient/less easy to use.
DLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012
02:23 AM
Re: layer.Clear()
I tried using roScreen a few weeks ago and i gave up, though i can't remember why :oops: ... Maybe i'll take another look.
Thanks.
Thanks.