Circle doesnt draw on panel

sanduro

Member
Licensed User
Longtime User
IGNORE IT. CANVAS INIT SHOULD BE IN SetContext method , not in Initialize

I have a class which creates a panel and I want to draw circle on that panel.

Panel draws but circle is not visible.

debugging shows that it is running correctly the DrawCircle command.

Thx for help

B4X:
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize (ax As Int ,ay As Int, aName As String, aParent As Activity)
 px = ax
 py = ay
 pName = aName
 pParent = aParent
'*********DRAW PANEL
 mPanel.Initialize( "pict")


pParent.AddView(mPanel, (px-1) * Main.px, (py-1) * Main.py,  Main.px * 6, Main.py * 2)
pCvs.Initialize(mPanel)    
''pCvs.DrawCircle(100dip, 100dip, 50dip, Colors.Green, True, 1) 
''mPanel.Invalidate
End Sub

Sub setContext(  aValue As String,aLabel As String)
''pLabel.Text = aLabel
''pValue.Text = aValue
  Dim cd As ColorDrawable

  cd.Initialize ( Colors.ARGB( 255, 128, 0, 0) ,8dip )
 mPanel.Background = cd

pCvs.DrawCircle(100dip, 150dip, 20dip, Colors.Green, True, 1) 
mPanel.Invalidate

End Sub
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…