Public Sub BytesToImage(bytes() As Byte) As Bitmap
Dim In As InputStream
In.InitializeFromBytesArray(bytes, 0, bytes.Length)
Dim bmp As Bitmap
bmp.Initialize2(In)
Return bmp
End Sub
Sub Button1_Click
Dim cmd1 As DBCommand
cmd1.Initialize
cmd1.Name = "insert_animal"
' This is not working
cmd1.Parameters = Array As Object(TextField1.Text, ImageToBytes(ImageView1.Bitmap))
' This works
' cmd1.Parameters = Array As Object(TextField1.Text, Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "smiley.png")))
reqManager.ExecuteBatch(Array(cmd1), Null)
GetAnimal(TextField1.Text)
ActivityIndicator1.Visible = True
End Sub
Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
Dim p As Phone
If Success Then
If Image.IsInitialized Then
vv.View.Visible = False
ImageView1.Bitmap = Image
'p.AddImageToAlbum(Image)
Else
vv.View.Visible = True
vv.LoadVideo(VideoPath, "")
Log(p.AddVideoToAlbum(VideoPath, ""))
timer1.Enabled = True
End If
End If
End Sub