load canvas

I have a desktop app that I need to have the canvas’ backdrop change whenever the listbox selected row changes.

It’s stored as an image blob in the sqlite table, and when the app loads it loads the image blob from the first record but that’s it. It doesn’t load other image blobs when another record is selected from the listbox.

I’m stumped. I would be grateful for suggestions to resolve my issue.

  1. Do you actually have all the images as blobs in this table?

  2. How or where are you arranging for another image to be loaded?

Do you refresh the Canvas’ backdrop after setting the new image ?

Tim,

  1. Do you actually have all the images as blobs in this table?
    Yes. They are stored in a blob column in each record.
  2. How or where are you arranging for another image to be loaded?
    When I load the fields I also set the backdrop = the blob column.

Emile, I refresh the canvas in the listbox change event but it doesn’t change when I select another row.

Have-you checked what happens (if a new image is loaded) in the debugger ?

A Feedback bug report is near…

By “refresh” I assume you mean that you invalidate the canvas? Have you checked that the Paint event runs?

Tim,
I did use invalidate and tried refresh too.

I do not have the image in the listbox, rather it is set to image column in the database, as are the other columns to their respective fields. I thought that since each row in the listbox is set to the record columns that the canvas backdrop would change as the other records but I’m wrong because it doesn’t. I have reports associated with the app and the images show there with no problem.

I’m stumped. I don’t know how to get the canvas backdrop to change with listbox selection. My brain is fried.

The listbox is not directly connected to the record columns. You copy the values from the record into the database, they are not linked. On listbox Change, you have to extract the database row ID from the listbox and look up the record again to retrieve the blob column.

Thanks Tim. It’s resolved.