Hi, I use a web service, and SOAP to communicate with it. There is a specific function that give me an image in string format.
I wrote the code below:
but on the line:
I take this exception:
Where is the problem? Thanks a lot.
I wrote the code below:
B4X:
Dim byteConv As ByteConverter
Dim imageBuffer() As Byte
imageBuffer = byteConv.StringToBytes(Logo,"UTF-8") 'Logo is the string image
Dim i_s As InputStream
i_s.InitializeFromBytesArray(imageBuffer,0,imageBuffer.Length)
Dim bmp As Bitmap
bmp.Initialize2(i_s)
i_s.Close
B4X:
bmp.Initialize2(i_s)
B4X:
bmp.Initialize2(i_s)
java.lang.RuntimeException: Error loading bitmap.
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:521)
at it.cbsita.pos.app.menu._create_relativelayout(menu.java:730)
at it.cbsita.pos.app.menu._set_layout(menu.java:1601)
at it.cbsita.pos.app.menu._activity_create(menu.java:269)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at it.cbsita.pos.app.menu.afterFirstLayout(menu.java:89)
at it.cbsita.pos.app.menu.access$100(menu.java:16)
at it.cbsita.pos.app.menu$WaitForLayout.run(menu.java:74)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5696)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
java.lang.RuntimeException: Error loading bitmap.
Where is the problem? Thanks a lot.