Sub DrawLine
Dim realheight,realwidth As Float
photo.Clear
photo.Bitmap=LoadBitmap(File.DirAssets, spn.SelectedItem)
l=lbl.Width
t=lbl.Top+lbl.Height
w=100%x-lbl.Width-lbl.Width
h=100%y-lbl.Top-lbl.Height-lbl.Height
photo.mBase.SetLayoutAnimated(0,l,t,w,h)
photo.Update
Dim ratio As Double=photo.Bitmap.width/photo.mBase.Width - photo.Bitmap.Height/photo.mBase.Height
If ratio>0 Then
realheight=photo.Bitmap.Height*w/photo.Bitmap.Width
top=t+h/2-realheight/2+realheight
l=l+w
Else
realheight=t+h
top=realheight
realwidth=photo.Bitmap.width*h/photo.Bitmap.Height
l=l+w/2-realwidth/2+realwidth
End If
cvs.DrawColor(Colors.White)
cvs.DrawLine(0,top,100%x,top, Colors.red, 1dip)
cvs.DrawLine(l,0,l,100%y, Colors.Blue, 1dip)
End Sub