HI,
I have some problem when i try to write bitmap in instruction "imgdown.writetostream ..." :
java.lang.RuntimeException: Object should first be initialized (Bitmap).
I try every initialize but i can't resolve error.
I'm doing something wrong, can someone give me a help ? thank you
I have some problem when i try to write bitmap in instruction "imgdown.writetostream ..." :
java.lang.RuntimeException: Object should first be initialized (Bitmap).
I try every initialize but i can't resolve error.
I'm doing something wrong, can someone give me a help ? thank you
B4X:
Sub gestphoto(response)
Dim parser As JSONParser
parser.Initialize(response)
Dim root As Map = parser.NextObject
Dim response As String = root.Get("response")
If response == 0 Then
Return
End If
Dim filename As String = root.Get("filename")
Dim imgdown As Bitmap = root.Get("photo")
Dim TargetDir As String
If File.ExternalWritable Then TargetDir = File.DirDefaultExternal Else TargetDir = File.DirInternal
If File.Exists(TargetDir, filename) == True Then
File.delete(TargetDir, filename)
End If
Dim Out As OutputStream
Out = File.OpenOutput(TargetDir, filename, False)
imgdown.WriteToStream(Out, 100, "JPEG")
Out.Close