B4J Question mqtt image question

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I am successfully receiving and using images in B4J using

B4X:
...........
If topic = "image" Then
    Dim in As InputStream
    in.InitializeFromBytesArray(Payload, 0, Payload.Length)
    Dim bmp As Image
    bmp.Initialize2(in)
    in.Close
    ImageView1.SetImage(bmp)
...........

I was wondering. is there a way to check if the received bytes are an actual image or not? Does bmp.initialize2 return some kind of error if the inputstream is "just" a stream with no image content?
thanks
 
Top