Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store/print/display graphic images in VFP
Message
 
 
To
08/04/2000 16:56:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00357233
Message ID:
00357531
Views:
11
> Thank you for the information. Would you happen to have an example of that.

Here is one way. You pass to the function the primary key of the item you want to display. In this case my image name is the primary id. Example 123.JPG . The function returns the path and name of the image file. If no image file exists then I display an image called 'nophoto.jpg' that has the words 'No Photo Available'.
FUNCTION getphoto()
PARAMETERS tnid

IF file(alltrim(gcAppPath)+"\photo\" + alltrim(str(tnid))+".jpg")
   lcImagePathName = "\photo\" + alltrim(str(tnid))+".jpg"
ELSE
   lcImagePathName = "\photo\nophoto.jpg")
ELSE

RETURN lcImagePathName
One problem with using the primary key like I did, is that if the primary id changes you loose which photo belongs to which records. You have want to name the photo something more recognizable.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform