Erel, thanks for the tips, I am new to the forum.
My problem is the fact that my SQLite table is accessed by other applications, such as C # or PHP and the image stored in the BLOB field works perfectly, but when I use B4A to access them from error ...
follows the code that accesses the field that contains the image:
c = s.ExecQuery("SELECT myPhoto FROM catalog WHERE pk_produto = 1")
c.Position = 0
Dim Buffer() As Byte 'declare an empty byte array
Buffer = c.GetBlob("myPhoto")
If Buffer <> Null And Buffer.Length >1 Then
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
Dim Bitmap1 As Bitmap
Bitmap1.Initialize2(InputStream1) 'ERROR HERE
InputStream1.Close
ListView1.AddTwoLinesAndBitmap("test","teste",Bitmap1)
End If
c.Close
Log(Buffer.Length) = 11717
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
11717
main_readblob (java line: 414)
java.lang.RuntimeException: Error loading bitmap.
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:521)
at com.manoelneto.texana.main._readblob(main.java:414)
at com.manoelneto.texana.main._activity_create(main.java:341)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at com.manoelneto.texana.main.afterFirstLayout(main.java:102)
at com.manoelneto.texana.main.access$000(main.java:17)
at com.manoelneto.texana.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)