Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting jpeg files into general fields

Status
Not open for further replies.

marcfree

Programmer
Jul 4, 2002
31
BR
Hi
Is it possible to insert jpeg files into general fields?
If so, how to do?

Thanks for any help.
 
You can put just about anything into general field, but it's usually not a good idea. Binary fields tend to "bloat" Memo files and unless each user has the exact same OLE provider to extract the data, you may not be able to get at it. In addition, since FPW is serverly limited in the data (especially graphics) that it can display internally, you'd need to depend on external viewers. (VFP 8.0 can handle this situation much better, but still suffers from the memo file bloat!)

Instead, consider just storing the path and file name in your memo field and keep the (jpeg) files external to your data tables.

Rick
 
Thank you Rick.

My client needs to show only 5 photos(jpeg)of his products, so that I have a table with 5 registers. Which is the OLE provider for jpegs? When I try to insert the file I get the message: error creating OLE object. How can I configure his windows to know the right OLE server?

Tahnk you
 
Well my memory "failed" me, and it appears that FPW will only allow certain file types to be stored directly into General fields. All the help file information assumes you are running Win 3.x, and the terminology is "dated". I wasn't able to directly store JPEG files to a FPW table. I did manage to get pictures into the table two different ways.

1) I first converted the JPEG file to a BMP file, and then used:
Code:
APPEND GENERAL mytable.mypict FROM c:\dummy.bmp CLASS PBRUSH
2) I opened the JPEG file in PaintShop Pro, and did a Copy, and then in FPW 2.6a, I opened the table, appended a blank record, did a BROWSE, double-clicked on the General field, and then chose menu -> Edit -> Paste Special ... -> chose Picture -> Paste. I'm not sure what its stored as internally, but it does display using the Picture control on a screen.

Rick
 
I read this article about pictures , I have the same problem knowing so far that FPW2.6 will alow only BMP files , my question is can I find a program which converts JPG files into BMP automaticly with out going into PSP or others , I have a large amount of product pictures in JPG format , If converting them one by one to BMP it will take ages.

Thanks
 
there is a command line utility called topng that converts an image format to another. google it up for several reviews. i also foundthis out in one of the vfp threads here in tek-tips. credit to sir mike for the idea.

also, you may want to batch convert your jpeg's to bmp's using free image viewers. i found mine in snapfiles page.

hope this helps. peace! [peace]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
I was able to find a freeware program that does batch conversions from BMP to JPEG, so you might be able to find a freeware program that does the inverse.

There is a way to take care of the "bloat" problem.

If you convert the field (you have to do each record one by one) into static then the size is about the same as the actual file. The only set back (if it is one) is that you won't be able to doulble click on the image to edit it (invoke the OLE), so if you want to get the image out you just have to do a copy/paste into into paint brush. But the image will show up in the dbf and you screens which have a picture box in it.

You also won't be able to un-static the record (at least to my knowledge).

Also, there is no way to automate it (to my knowledge). Wish it did though. You can only use the menu option.

B"H
Brak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top