Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean
Dim size As CameraSize = camEx.GetPreviewSize
Dim ratio As Double = size.Width / size.Height
Dim pw, ph As Int
If 100%y * ratio > 100%x Then
pw = 100%x
ph = pw / ratio
Else
ph = 100%y
pw = ph * ratio
End If
Panel1.SetLayout(50%x - pw / 2, 50%y - ph / 2, pw, ph)
Return True
End Sub