NILKAMAL


hi!

i get software from dosadi but i get some problem to get image in my image field

here is the detail i create form with fiel , ( name , address etc and one field for image ( data type i put (memo (binary))

and i also create one button called take image here is the code for button

DO [C:\Program Files\EZTwain\VFP\EZTwain.prg]
TWAIN_SelectImageSource(0)
* Get list of devices into memory
TWAIN_GetSourceList()

LOCAL lcFile, lnImageHandle, lnReply
lcFile = "C:\Documents and Settings\sony\My Documents\New Folder (2)\IMAGES\"
* Get the image
lnImageHandle = TWAIN_AcquireNative(0,0)
* Write the image to a disk file
lnReply = ;
TWAIN_WriteNativeToFilename(lnImageHandle,lcFile)

* Release the image handle
TWAIN_FreeNative(lnImageHandle)

* Check for errors
IF lnReply = 0
* image successfully written to file
ELSE
* something went wrong
ENDIF

now problem is when i click button everything work good but i don't get the image in my imagefield now what i need when i click get image image comes in image field and it save for this record

thanks




Re: how do i get image

Naomi Nosonovsky


1. It looks to me that lcFile holds just a directory name rather than file name.

2. Assuming that lcFile is the file name (with a path), you just need to do

replace myMemo with m.lcFile (now the file name is saved in the memo).

And when you need to retrive the file, you do:

lcFile = myTable.MyMemo

thisform.Image1.Picture = m.lcFile

See, if this would work for you.






Re: how do i get image

NILKAMAL

thanks for your reply

but one more question

i get error " variable memo is not found"

and also when i click cmd button it open new windo to select camera option can i skip this window

thanks






Re: how do i get image

Naomi Nosonovsky

I'm sorry, I'm not familiar with EZTwain, though I can make some research, if needed. I think there should be a way to supress the dialog window, but you need to dig into its documentation.

As for the error, what is your table's memo field name All I suggested was to save the file name in the memo field using replace command (assuming you're on the right record in your table already).





Re: how do i get image

Naomi Nosonovsky

I'm not sure what happened, but my reply just disappeared Sad Some problems with the forum, I'm afraid.

I'm not familiar with EZTwain, you need to check its documentation to see how to supress the dialog window.

All I was suggesting is to save the file name in the memo field using replace command. Make sure to use your actual field name in the replace myMemo [here you should put your field name instead] with m.lcFile

UPDATE. And now both replies are here <g> Sorry, I didn't meant to repeat, it was not there when I checked.





Re: how do i get image

Naomi Nosonovsky

One last time I try to reply - somehow I do not see my replies and they disappear.

Please make sure to use your actual field name in the replace command. I just posted an example.





Re: how do i get image

dni

You may try to store image path(lcFile) in a string field.

If you don't like to select source you may not use TWAIN_SelectImageSource(0) .

Yoy may check again (it is exact what you need):

http://www.ml-consult.co.uk/foxst-29.htm