Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting image to binary data???
Message
De
03/12/2004 14:13:20
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:
00966798
Vues:
10
>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").

That's exactly what I had in mind when I said "pick the image from the subdirectory" - IOW, get it as a file, store into a binary memo, erase the 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.

You may need only to get the URL of the image by manipulating the browser object, then get the image using a httpget() (can be found in Rick Strahl's WWIpStuff package). The image is downloaded as a string, which you can then directly put into a memo 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.

Using this integration to just get the url of the selected image, and then httpget()ing the image seems to be the simplest way to me.

>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.

And general fields are general PITA to start with. I've used them in some cursors sometimes, but never in a table. Not worth the trouble.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform