TableView loading stream to bitmap issue

Hello

I've the same trouble loading an image from a SQLite DB query into a TableViewItem, the code is the next:

ResultadoStream := TMemoryStream.Create;
CopyToStream(Query.FieldByName('Foto').AsBytes, ResultadoStream);
Item.Bitmap.LoadFromStream(ResultadoStream);
ResultadoStream.Free;

Can you load it in a TImage?

No

Code above was used in FMXTableView without any trouble,

The code retrieve fields from a SQLiteDB then are copied to a TMemorystream and this last is loaded on the Bitmap property.

If it doesn't work in TImage then I suppose it's an issue in retrieving the stream, not in our TableView.

I put a TImage on my code and works without any trouble, here's the proof.

I tested with "CopyFromBitmap" method but it's not working.

ResultadoStream := TMemoryStream.Create;
CopyToStream(Query.FieldByName('Foto').AsBytes, ResultadoStream);
Image1.Bitmap.LoadFromStream(ResultadoStream);
Item.Bitmap.CopyFromBitmap(Image1.Bitmap);
ResultadoStream.Free;

We have no issues here loading the image in TTMSFNCTableViewItem.
Can you put ResultadoStream.Position := 0; before loading the stream?

Ready, that works

Thanks

Now that I've your attention, can you please tell me how to color part of the TableViewItem text property as image below please?

With HTML <font color="#FF0000">MyText</font>

Excellent Pieter, thanks a lot

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.