General information
Category:
Third party products
Title:
RE: Extracting .PIC File from General Field in FoxPro Table
Hello all!
Synopsis: I have been presented the task of extracting embedded file information from the General field in a FoxPro table. The format of the embedded (NOT linked) file is .PIC (graphic file). The table holds over 16,000 records. The goal is to extract the PIC files into their own directory, where a new table will be created, and the PIC graphic will be LINKED to the General field.
I am aware that one could use the Windows Clipboard to copy from the General field and then paste into a graphics program, where it could then be saved to disk. However, due to the size of the table, this is the absolute LAST option.
I have located an interesting bit of code, originally written to extract an embedded .BMP image into a file. Check it out:
1 COPY TO temp FIELDS picture NEXT 1 && general field w/BMP
2 handlein = FOPEN("temp.fpt")
3 handleout = FCREATE("test.bmp")
4 gnEnd = FSEEK(handlein, 0, 2)
5 gnTop = FSEEK(handlein, 0)
6 str1 = FREAD(handlein, gnEnd)
7 str2 = RIGHT(str21, LEN(str1)-599) && notice the "599"
8 n=FWRITE(handleout,str2)
9 FCLOSE(handlein)
10 FCLOSE(handleout)
The "599" is the key, here. This number is the offset taken from the General field to isolate only those bits that comprise the BMP. This snippet would work for me if I knew the offset to use for a PIC file.
The only other lead I still have is through a company named "Espia", who is unfortunately on "Summer Vacation" this week. They have what appears to be a fairly flexible graphics utility package for Fox. I left my name/email with them and hope to hear something.
Well, if anyone has any bright ideas for cracking this nut, I would turn cartwheels!
I'm going to grab a hex-editor and start cracking open these files to see if I can determine the offset I need to use.
Hope to hear something
Thanks!
David
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only