B4X FEED Problem with B4XBitmap and image as array

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: Problem with B4XBitmap and image as array است. این موضوع تا کنون 135 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Problem with B4XBitmap and image as array
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
135
پسندها
0
آخرین ارسال توسط PracticalSoft
وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.
Jun 6, 2020
11,517
4,383
Hi,
i am new with B4A and try to store a bitmap into a sqlite table.
The storage code seems to work corrrectly.

>>
Dim b() As Byte = ImageToBytes(xui.LoadBitmap(File.DirAssets, "bmw_bild_icon.png"))
SQL_1.ExecNonQuery2("INSERT INTO kfz VALUES (1, 'BMW 316 i compact')", Array As Object(b,1))
<<<


But when i try to get the image from the db, an error occurs .

>>
Dim puffer As Byte = Cursor.GetBlob("image")
Dim bild As B4XBitmap = BytesToImage(puffer) ---> Error: Types does not match


img_1.Background = bild
<<<

I use the given Sub:

>>>
Public Sub BytesToImage(bytes() As Byte) As B4XBitmap
Dim In As InputStream
In.InitializeFromBytesArray(bytes, 0, bytes.Length)
#if B4A or B4i
Dim bmp As Bitmap
bmp.Initialize2(In)
#else
Dim bmp As Image
bmp.Initialize2(In)
#end if
Return bmp
End Sub
<<<

What is wrong??

thanks in advance..

 

وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.
عقب
بالا