Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Store/print/display graphic images in VFP
Message
 
À
08/04/2000 16:56:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00357233
Message ID:
00357531
Vues:
12
> 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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform