get View of current panel to use canvas on that

selvamurali

Active Member
Licensed User
Longtime User
dear team

i am going to develope sliding panels app. in that app the users can write text,drawline,circle on the current panel.


sorry for my english
 

klaus

Expert
Licensed User
Longtime User
If you want to draw onto the Panel.
You should initialize a Canvas for that Panel.
B4X:
Dim Panel1 As Panel
Dim Canvas1 As Canvas
'
'
'
Canvas1.Initialize(Panel1)
Did you have a look at chapter 15 Graphics / Drawing in the Beginner's Guide ?

Best regards.
 
Upvote 0

selvamurali

Active Member
Licensed User
Longtime User
get current panel view

hi Kalus

Thanks for ur reply.

i am using multiple panles then how to initialize current panel to canvas/

here i am attach my project. in that

Sub Panels_Touch (Action As Int, X As Float, Y As Float)
cvstest.Initialize()
cvstest.DrawLine(X,Y,100,Y,Colors.Black,2dip)
End Sub

in the above code how to initialize cvstest to current panel view

any help.
 

Attachments

  • eslate.zip
    7.5 KB · Views: 157
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached two modified versions.
In the first you can use an array of canvases one for each panel.
In the second a canvas is initialized in the Touch event routine for the current panel.
As you have only 3 panels I would suggest the first one.

I haven't tested it because there are no image files in your project.

Best regards.
 

Attachments

  • eslate1.zip
    7.6 KB · Views: 175
  • eslate2.zip
    7.6 KB · Views: 162
Upvote 0
Top