Maybe you are suffering a dip to absolute pixel scaling problem. See if there is a constant scaling between what you expect and what you see.
What's constant is that the X value reported by the touch is related to the screen's x coordinate, not the panel's. Whereas, the Y coordinate reported IS related (somewhat) to the panel.
I made a simple little activity to demonstrate the problem:
Sub Globals
Dim Panel1 As Panel
Private ImageView1 As ImageView 'the image here is just a white box to show me the area on the screen where the panel will be located and onto which bitmaps drawn later will be placed
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("TestPanel") 'The layout has only the ImageView1 located at 10,100 and width = 300, height = 30
End Sub
Sub Activity_Resume
Panel1.Initialize("p1")
Panel1.Color = Colors.Transparent
Activity.AddView(Panel1,10dip,100dip, 300dip, 30dip)
End Sub
Sub p1_Touch(Action As Int, X As Float, Y As Float)
Log("X = " & x & ", y = " & Y)
End Sub
Now, if I touch the panel in it's approximate center, it should log X as approximately 150, or if I touch near the right end, X should be around 300, right?
Instead, touching the panel near the center I get values like X = 233.48233032226563, y = 7.0416259765625 and if I touch the panel near the right edge I get
X = 434.064453125, y = 35.6397705078125.
X = 434 is WAY outside of the panel's width of 300!
Maybe my phone is just weird or messed up? But when I draw with Bitmap Creator and place the drawing into the imageview there's no problem with scaling???