How to add jpeg image to ImageWell

Dear All,

I am creating a form for product master items entry. During the execution of the form , I would like to add an image to Imagewell box from any folder path and save the image the in database. I created the field in prod_mstr table as Image with type as Blob. Kindly let me know if it not advisable to store in database. Can the images stored in some directory be accessed during the form entry and displayed. Can someone please help me how to do this.

Regards,
Sriram

Store the images in a separate table along with the primary key value from prod_mstr. That way they don’t get in the way of your normal sql operations.

Use Picture.Open() to read the image from disk.

Use Picture.GetData() to pull the data from the image as a string you can store in the database.

Use Picture.FromData() to convert the string you stored in the database back to an image.

Thank you so much Tim . Will try and confirm.

Hi Tim,

Store the images in a separate table along with the primary key value from prod_mstr. That way they don’t get in the way of your normal sql operations.
Sriram- I understood the above first point

For the below 3 points, I am not sure how to implement, Would appreciate if you can give an example code here. Thank you.

Use Picture.Open() to read the image from disk.

Use Picture.GetData() to pull the data from the image as a string you can store in the database.

Use Picture.FromData() to convert the string you stored in the database back to an image.

This answers my question
Like

Hi Tim,

With the tips from you and further exploring of our forum, I got the solution and it worked.
I put the following code in Action event of a push button. Thank you so much.
///////////////////////
Dim picFile As FolderItem
picFile = GetOpenFolderItem("")

If picFile <> Nil Then
Dim pic As Picture
pic = Picture.Open(picFile)
ImageWell2.Image = pic
End If
///////////////