Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing a .JPG
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01047155
Message ID:
01047176
Views:
9
Ruben,

...The record in the database will have a field called CASENO and I will rename the .jpg file to match the CASENO (making for a unique match) My question is how to go about calling it from the form.

No Problem. I guess, You have an Image-Object on the form. If so simply issue
lcImagesPath = "..\Images\"  && Directory where the images are located
lcPrefix     = "CASES_"      && in case You do have a prefix for ALL of these images
lcSuffix     = ""            && Maybe You also do have a suffix
lcExtension  = "jpg"         && OK, You will probably have jpg's only

lcThisImage  = addBS(lcImagesPath) + forceExt(lcPrefix + allt(<ALIAS>.CASENO) + lcSuffix, lcExtension)

*-- You might want to have some ErrorChecking
if ! file(lcThisImage)
    = MessageBox(....

else
    thisform.Image1.Picture = lcThisImage

endif
One other question. Within the same form, I have a command button for printing the data on the form. How do I link the .FRX to the .jpg and print the image on the sheet as well ?

Similar. I think You can have a variable as Source for the Picture.
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Previous
Reply
Map
View

Click here to load this message in the networking platform