Dim Buffer() As Byte = rs.GetBlob(colid)
Log(Buffer.Length)
Dim InputStream1 As InputStream
Dim bc As ByteConverter
Dim hex As String = bc.HexFromBytes(Buffer)
Log(hex)
Dim InputStream1 As InputStream
If hex.Contains("FFD8FF") Then ' jpg, jpeg
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
End If
If hex.Contains("424D") Then ' bmp
InputStream1.InitializeFromBytesArray(Buffer, 8, Buffer.Length)
End If
If hex.Contains("47494638") Then ' gif
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
End If
If hex.Contains("4D4D002A") Or hex.Contains("49492A00") Then ' tiff
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
End If
If hex.Contains("89504E470D0A1A0A") Then ' png
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
End If
Dim bmp As Bitmap
bmp.Initialize2(InputStream1)
InputStream1.Close
ivphotodialog.Bitmap = bmp
ivphotodialog.Gravity = Gravity.FILL
pnl.AddView(ivphotodialog,0dip,0dip,340dip,490dip)
Dim rsub1 As ResumableSub = photodialog.ShowCustom(pnl, "OK", "", "")
Wait For (rsub1) Complete (Result As Int)
If Result = xui.dialogResponse_Positive Then
'
End If