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!

How to insert a picture in Fox Pro 2.5

Status
Not open for further replies.

Vivianez

Programmer
Oct 10, 2001
25
BR
I have an aplication in FoxPro 2.5 that stores our products in SQL Server 2000. I would like to insert a picture of the product in the screen. Of course if I change the product, the picture should also change. How can I do that?
If I create the field (picture) like a file, I shoul point to the file and it does not change.
Somebody could help me?

Thanks,
 
Is this FP for Windows 2.5b? How are you displaying the image now?

Rick
 
Yes, it´s FP 2.5b.
The only thing I did was to create a screen picture field and select a picture from a file. But like this, the picture does not change. It is always the same file. I wanted the picture to change as I changed the products.
Thanks,
Vivi
 
I cannot say for sure about your version but in windows 2.6 foxpro I do this quite a bit. In your database create a field that is a memo field. Foxpro will create a .fpt file of same name to store images in. From a browse window you can double click on the contents of your new memo field (should say "gen") and then there are menu options to paste or copy a file in from a disk. Once the file is in there, you can reference it on a screen or on a report. Simple navigation and appropriate refreshes and you should get the desired result of the picture changing along with your navigation.

Good luck.
 
Could you help me, please?
I´ve created a database with a memo field.
But in Fox Pro, is it a radio button, checkbox, popup?
What kind of field is it in FP?
 
Vivianez,
If I understand your question you are asking how to use the memo field within FP?

Within a browse window, what I do is click on the field and then go to the menu and edit paste pictures in as bmp files. Then from reports/screens I can call up the pictures in the report or screen along with data from the databases.

Does this help?
 
Vivianez
Despite all the advice in this forum to the contrary, we used a general field for years in our application which worked fine to store and display images.

just add a general field to your product dbf e.g. product.photo

To add a photo use thye code
f_ile=""
f_ile=GETFILE("BMP;TIF","Locate the Photo file.")
IF !EMPTY(f_ile)
APPEND GENERAL PRODUCT.PHOTO FROM (f_ile) LINK
ENDIF

Then to display it
@ X,Y (in your window) SAY product.photo ;
SIZE A,B ; (whatever sizes you want)
CENTER ;
ISOMETRIC ;
STYLE ""



Bob Palmer
The most common solution is H2O!
 
Bob,
This does work fine as long as the system that inserts the data is running the same OS and OLE server defaults for the file type you store. You can run into problems when you switch configurations. (i.e. Store data in Win 3.x and try to view under Win XP.)

Rick
 
Correct Rick, hence the reason to restrict the pic type to bmp;tif which we found seemed to work on all installs we had at the time on over 50 sites.

However I believe from reading vivianez's question this is probably not a distibuted app anyway.


Bob Palmer
The most common solution is H2O!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top