Sub boarding
btndata.Visible=True
If switch = 0 Then
i.Initialize("")
imgload.Bitmap = LoadBitmap(File.DirAssets,"ticket.jpg")
b.Initialize(File.DirAssets, "ticket.jpg")
brect.Initialize(0,0,imgload.Width, imgload.Height)
c.Initialize(imgload)
c.DrawColor(Colors.White)
c.DrawBitmap(b, Null, brect)
c.DrawText(txtdate.Text, 12%x,imgload.Height-51%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtnumberfly.Text, 14%x,imgload.Height-36%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtclockgates.Text, 15%x,imgload.Height-20%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
c.DrawText(txtseatnumber.Text, 15%x,imgload.Height-5%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtfrom.Text, 32%x,imgload.Height-50%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtto.Text, 32%x,imgload.Height-35%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
c.DrawText(txtclok.Text, 43%x,imgload.Height-21%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtpassenger.Text, 32%x,imgload.Height-5%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
i.Invalidate
'shared = rp.GetSafeDirDefaultExternal("")
rp.CheckAndRequest ( rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult ( Permission As String, Result As Boolean)
If Result Then
Dim out As OutputStream
'Dim testfolder As String
'testfolder = rp.GetSafeDirDefaultExternal("ticket")
rp.GetSafeDirDefaultExternal(File.DirDefaultExternal)
out = File.OpenOutput(File.DirDefaultExternal, "ticket.jpg", False)
c.Bitmap.WriteToStream(out, 100, "JPEG")
out.Close
b = ResizeBitmap(LoadBitmap(File.DirDefaultExternal, "ticket.jpg"), 800, 500)
Else
End If
txtdate.Text=""
txtnumberfly.Text=""
txtclockgates.Text=""
txtseatnumber.Text=""
txtfrom.Text=""
txtto.Text=""
txtclok.Text=""
txtpassenger.Text=""
share.sharebinary ("file://" & File.DirDefaultExternal & "/" & "ticket.jpg", "image/jpg", "CONDIVIDI xxxx con:", "Ti Piace? Condividila con i tuoi amici")
else if switch = 1 Then
i.Initialize("")
imgload.Bitmap = LoadBitmap(File.DirAssets,"ticket2.jpg")
b.Initialize(File.DirAssets, "ticket2.jpg")
brect.Initialize(0,0,imgload.Width, imgload.Height)
c.Initialize(imgload)
c.DrawColor(Colors.White)
c.DrawBitmap(b, Null, brect)
c.DrawText(txtdate.Text, 12%x,imgload.Height-51%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtnumberfly.Text, 14%x,imgload.Height-36%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtclockgates.Text, 15%x,imgload.Height-20%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
c.DrawText(txtseatnumber.Text, 15%x,imgload.Height-5%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtfrom.Text, 32%x,imgload.Height-50%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtto.Text, 32%x,imgload.Height-35%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
c.DrawText(txtclok.Text, 43%x,imgload.Height-21%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black , "LEFT")
c.DrawText(txtpassenger.Text, 32%x,imgload.Height-5%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Black, "LEFT")
i.Invalidate
rp.CheckAndRequest ( rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult ( Permission As String, Result As Boolean)
If Result Then
Dim out As OutputStream
rp.GetSafeDirDefaultExternal(File.DirDefaultExternal)
out = File.OpenOutput(File.DirDefaultExternal, "ticket2.jpg", False)
c.Bitmap.WriteToStream(out, 100, "JPEG")
out.Close
b = ResizeBitmap(LoadBitmap(File.DirDefaultExternal, "ticket2.jpg"), 800, 500)
Else
End If
txtdate.Text=""
txtnumberfly.Text=""
txtclockgates.Text=""
txtseatnumber.Text=""
txtfrom.Text=""
txtto.Text=""
txtclok.Text=""
txtpassenger.Text=""
share.sharebinary ("file://" & File.DirDefaultExternal & "/" & "ticket2.jpg", "image/jpg", "CONDIVIDI APP CON:", "Ti Piace Quest'App? Condividila con i tuoi amici")
End If
End Sub