I am attempting to capture images via a Foxpro form and save those images to a Foxpro field. I have a blob field defined in my table. Once I have those images captured I want to be able to display them on the same form.
I have users who want to be able to paste screen prints directly into a Foxpro form or edit box so that others using the system can then view those screen prints. Since I'm pretty new to this, I thought a blob field would be the best way to go. Basically there will be a command button on a form. When the user clicks it, if there is already a screen print present in the table, I want to show that screen print. If there is currently no screen print present, I want to allow them to paste a new screen print.
Is it possible to display multiple screen prints (images) on the same form? Would I have to have multiple blob fields defined to do this?
Is there a better way to do this? Currently the users must save the screen prints in a Word doc and I have an 'Attach' button with a memo field that saves the file location. The users think this is too much work so I am trying to come up with alternatives.
Here is the code I currently have (courtesy of the web) that opens a new form and displays the jpeg file. I would like to already have the form defined in my project (ie not create a new one like this code) and have that form display the image stored in the table if it exists or capture a new image if one is pasted on the form. I don't want to get the image from a file directory location.
SELECT ;
CAST( ;
FILETOSTR( 'I:\c3\logowatermark\logo.
jpg' ) ;
AS BLOB ) AS 'PIC' FROM ;
tasklist ;
into cursor blobtemp
PUBLIC goForm
goForm = NEWOBJECT( 'Form' )
WITH goForm AS FORM
.ADDOBJECT( 'IMG1', 'Image' )
.Img1.PICTUREVAL = BlobTemp.PIC
.WIDTH = .Img1.WIDTH + 30
.MINWIDTH = .WIDTH
.MINHEIGHT = .HEIGHT
.AUTOCENTER = .T.
.CAPTION = 'Picture and Raw BLOB Data'
.SETALL( 'VISIBLE', .T. )
ENDWITH
goForm.SHOW(1)
Any help/suggestions are very much appreciated. Thank you.