Drawing on Forelayer

merli

Member
Licensed User
I am quite new to B4PPC, I am trying to create some isometric engine and I found problems. I am using drawing like this

Form.Forelayer=True
Form.Color=cBlack
SetTransparentColor=cBlack
...
and drawing isometric objects with
Form.Fline and
Form.Fpolygon then

1) I don't need redraw form and drawing shows. Is it OK? I would expect to use Form.Refresh to show graphics
2) When I redraw some objects all screen i flashing so redrawing is visible ... it is not good for moving objects. How to fix it?
3) When I use Form.Line and Form.Polygon instead Fline and Fpolygon, everything is ok, but there is no transparent background and with movement I will need to redraw everything which is really no good on winmobile platform.
4) Should I draw on bitmap using drawer and ImageLibEx? I cannot use ImageLib because of missing draw polygon

Similar problem is shown here with no reply:
http://www.b4x.com/forum/basic4ppc-wishlist/709-forelayer-drawing-flashing-jumping.html

thnx
 

derez

Expert
Licensed User
Longtime User
Do the drawing (back and fore layers) on another form (for this you dont need any special library) or on a bitmap, and when all drawing is done - copy the form or the bitmap to your display form.
This way you have only one refresh of the form, with all image at once. The copying is quick: formx.image = formy.image.
 
Last edited:

merli

Member
Licensed User
Thanks I'll try. Does Form1.Image=Form2.Image copy all image, Background and ForeLayer?
 

derez

Expert
Licensed User
Longtime User
both layers are copied but I never checked if they are copied to the background or each to its corresponding layer.

I guess they are copied to the background, but you'll have to check (try to erase form1 forelayer and see what is the result).
 
Top