Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting image to binary data???
Message
 
À
03/12/2004 11:06:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00966671
Message ID:
00966779
Vues:
8
You said:
------------
"I've done something similar using Office automation - saved the document as html, and it exports the images into a *_files subdirectory, then I copy them from there. In my case, I had a series of spreadsheets with images in them. In your case, I'd create a new document, do a paste, save the document (which contains just the image) as HTML, and pick the image from the subdirectory, most probably using Word."
-------------

I'm able to copy binary data from picture files on my hard drive into memo fields. I use the APPEND MEMO command for that (example: APPEND MEMO "name of memo field" FROM "file name" OVERWRITE). I'm also able to easily access the binary data in the memo field, and convert it back into a picture file on my hard drive, using the COPY MEMO command (example: COPY MEMO "name of memo field" TO "new picture file").

However, I would like to run the same process as above, but using picture files (jpg, gif, bmp)located on web pages on the Internet. The catch is that I want the ability to selectively/manually choose a photo on a web page (while online), and capture it's binary data into a memo field. The only way I can think of doing this, is through right clicking the photo on the web page, selecting copy, and then capturing the image from the clipboard (which it was copied into). This is easy to do if I paste the clipboard data into a general field. However, the general field does not store the image in an accessible binary data format(can only access a preview of the rendered image), and general fields tend to bloat the fpt file in an extreme way. This is why I want to store the images as raw binary data in a memo field, since that doesn't seem to bloat the memo field beyond the size of the original picture file.

I'm also open to capturing the binary data from the image stored in the clipboard, and directly creating a new picture file from it on my hard drive (instead of storing it in a the memo field). However, I would still need to access the binary data of the image stored in the clipboard, and I don't know if that is possible.

I realize that I could just right click and save the picture through the browser, but I would need a program that "automatically" creates a table record which references the location of the saved picture file (at the same time that I saved the image to the hard drive). I would probably need to build some integration with a browser control to accomplish that, but I really don't want to do that.

There is an on old article in FoxPro advisor (online version), which states that it is possible to extract an image from a general field, and reconvert it back into a picture file format (jpg, gif, bmp). FoxPro advisor states that Jonathan Finch wrote a program called GENTOFIL.PRG, which supposedly accomplishes this. However, the program is on that specific issue's Professional Resource CD, which I don't have. Oh well.

Dave
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform