How to store and retrieve images

Hi Folks,

Could anyone please point me in the right direction to a tutorial or guidance on the following:

  1. How to store images in a TPS file
  2. How to display those images on a form
  3. How to display and update an image each time a new selection in the browse list box is made.

I’ve had a look at storing an image in a BLOB from the help file topic but I’m clearly doing something wrong as I can’t confirm whether the image is being stored in the file. I am able to use the DosFileLookup to update an Image control, but it seems the passing of the image into the BLOB and subsequent retrieval is where I’m going wrong.

I did also take a look on YouTube to see if there was anything there but couldn’t find anything relevant on the search results.

Many thanks,

Al

If you have StringTheory from Capesoft, you could use the ToBlob() and FromBlob() methods to populate and retrieve the blobs.

1 Like

Did you look at the “ImageBlob” subject in the help? Also, check out “PrintMode”.

Thanks I’ll take another look.

1 Like

I used BLOB’s many years ago to store images but I discovered quickly that managing images size (size in bytes) became very important due to TPS file size limitations. I used, and still use, Clarion FreeImage to resize images just in case the user tries to upload a huge file. Anyway, just something to consider.

1 Like

One of the big decisions one makes is whether or not to store the image itself in a blob or simply a filename to an image. Big images definitely will impact the data file size.

Just depends on the intended use and expectations.

https://duckduckgo.com/?q=store+image+path+or+blob&atb=v164-1&ia=web

1 Like

See help for The clarion language utilities. That has BlobToFile() and FileToBlob() procedures.