Creating my example with Bezier curves I noticed something very unusual with the XUI.
I call several times a Sub who redraws an image. Each time draws the image by modifying it with the new parameters.
To give an example, the sub could be like this:
If I did not insert this instruction:
The canvas does not give any results, the image remains the previous one.
Almost as if the image generated previously from the canvas was like a second panel hooked on.
If I release everything (with RemoveAllView), the effect of redrawing can be observed, otherwise it remains the same image.
Can someone enlighten me?
I call several times a Sub who redraws an image. Each time draws the image by modifying it with the new parameters.
To give an example, the sub could be like this:
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private PanelMain As B4XView
Dim xui As XUI 'ignore
End Sub
Private Sub Draw
PanelMain.RemoveAllViews ' Without this the Canvas does not draw anything, it draws only the first time.
Dim Can As B4XCanvas
Can.Initialize(PanelMain)
'Clear old graph
Dim R As B4XRect
R.Initialize(0,0,PanelMain.Width,PanelMain.Height)
Can.DrawRect(R,xui.Color_White,True,1dip)
Can.DrawCircle(PanelMain.Width/2, PanelMain.Heght/2,rnd(50,200)*1dip,xui.Color_Red,True,1dip)
End Sub
B4X:
PanelB4XView.RemoveAllView
Almost as if the image generated previously from the canvas was like a second panel hooked on.
If I release everything (with RemoveAllView), the effect of redrawing can be observed, otherwise it remains the same image.
Can someone enlighten me?
Last edited: