Sub UDP_PacketArrived (Packet As UDPPacket)
imageview2.Initialize("imageview2")
msg = BytesToString(Packet.data, Packet.Offset, Packet.Length, "UTF8")', Packet.Offset, Packet.Length, "UTF8")
msg1 = helper.DecodeBase64(msg)
'msg = (Packet.Data)', Packet.Offset, Packet.Length)
'header = Regex.Split("~", msg) 'split incoming data at "~" and end up with 2 items
screenheight = 1024'header(0) 'extract first item of message = screenheight
screenwidth = 800' header(1) 'extract second item of message = screenwidth
phoney = lv.Height 'get phone's screen resolution = height
phonex = lv.Width 'get phone's screen resolution = width
scaley = screenheight / phoney 'calculate scale for y
scalex = screenwidth / phonex 'calculate scale for x
'label1.Text = msg'"H: " & screenheight & " W: " & screenwidth
'imageview2.Bitmap = GetBitmapFromByteArray.Initialize2(msg)
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length)
Dim bitmap1 As Bitmap
File.WriteString(File.DirRootExternal,"testimage.txt", msg)
Dim o As OutputStream
o.InitializeToBytesArray(msg1.length)
o.WriteBytes(msg1, 0, msg1.Length)
InputStream1.Close
'bitmap1.Initialize2(InputStream1)
'imageview2.SetBackgroundImage(bitmap1)
End Sub