Private Sub decodButton_Click
Dim myBitmap As B4XBitmap = ImageView1.GetBitmap
Dim m1b(), m2b() As Byte
Dim myStringa As String
Dim conv As ByteConverter
m1b = ImageToBytes(myBitmap)
myStringa = BytesToString(m1b, 0, m1b.Length, "utf16")
m2b = myStringa.GetBytes("utf16") 'convert to bytes
If m1b<>m2b Then
xui.MsgboxAsync("First bad conversion","!!!!!!!!!!")
End If
myStringa = conv.StringFromBytes (m1b,"UTF16")
m2b = conv.StringToBytes (myStringa,"UTF16")
If m1b<>m2b Then
xui.MsgboxAsync("Second bad conversion","!!!!!!!!!!")
End If
myBitmap = BytesToImage(m1b) ' OK only for m1b
toImageView.SetBitmap(myBitmap)
End Sub