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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button graphics and installation

Status
Not open for further replies.

mpgalvin

Programmer
Feb 5, 2001
119
IE
I'm a little unclear about how graphic files are handled by VFP7. I have a number of bitmaps I want to stick on the toolbar of my app. I've put these into a gfx directory hanging off the main project directory.

So when I add the picture, it's d:\My Projects\VFP7\Customer\Gfx\name.bmp. If I install this app on another user's machine, do I have to set up d:\My Projects\etc and manually copy the bitmaps there? Can I set it up so that the bitmaps are always in a directory called Gfx hanging off the main app directory, *no matter where that may be*? Does adding the bitmaps to the project make any sort of difference - can I reference the copies held in the project rather than the ones on my disk?

How do the rest of you guys do it?
 
HI
You can include them in the project, since you are going to use them as 'read' only. YOu can also have it in disk and distribute... then.. i would sujjest you keep them in a directory in the project .. just as you do to data files. Holds good if you are using them on the server. But imagine the load passing thru' the cables..So if you are distributing the application, you can either distribute them also and keep it in the EXE directory's sub directory, so that path issues dont nag you.

Hope this helps you :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Ramani, to be honest, I'm still confused.

If I put the bitmaps into the project directory, I'm still referencing them on the command buttons as "d:\My Projects\VFP7\Customer\name.bmp", all that has happened is that I've dropped the Gfx subfolder. Isn't it still the case that the .exe will look for the bitmaps in that folder when it is run.

At the moment, we have a dbf holding the path to the data files. Are you suggesting adding another record with the path to the bitmaps? That might work, but seems kinda overkill to me.

If I add the bitmaps to the project, how can I reference them?
 
If the images are in your path, it doesn't matter what the property sheet says. It stores the path relative anyhow (same goes for properties like classlibrary etc.)
What I usually do is:

Picture = "name.bmp", if your path settings are correct and you have added the grfx directory to it, VFP will find the images automatically.

HTH,

Weedz (Wietze Veld)
My private project:Download the CrownBase source code !!
 
Weedz, what do you mean by "path"? The standard DOS Autoexec path? Or something in VFP?
 
HI
Let us assume..
Project Directory is d:\MyProjects\MyClient
Let us create IMAGES directory within this directory...
SO the path for your images will be ...
d:\MyProjects\MyClient\Images

If you click open the finder (... button) in the property box, locate the image as your picture... the result in the box will be... the above path+image name..
Now remove the relative path to the above project, and keep the value as Images\MyImage.jpg or whatever.

This will make the software always look relative to your project directory.

Another way is as Weedz pointed out. Make sure that you set your default path (DOS PATH as you call it) to also have this image directory. VFP will search for the file all along the path.

Hope this helps you. :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
If you're still confused, here's what I do. I begin each project by creating a directory structure and modifying a generic 'Dave.prg' which is what actually runs when I click on the icon starting the project. One of the lines in it is:

Code:
SET PATH TO .\, data\, forms\, libs\, graphics\, ;
	include\, reports\, programs\, menus\, help

Another line (which is actually before the line above) is :

Code:
CD 'c:\my documents\VFoxPro\Some Project\'

Therefore FoxPro knows where to look for various sorts of files while I know where to look for them too without have a great jumble of files all in one directory. Now this is just for development, and you'll have other things to do in installing the project for someone else, but the same general principle is used. Install the various files in the same structure you used before and then issue 'CD' and 'SET PATH TO' statements.

Dave Dardinger
 
Your path settings are returned by SET('PATH').

As stated above, you can set your path by issuing SET PATH TO cPath where cPath is the directories that you would like in your path.

Since the path setting is a character string you can also issue:

SET PATH TO SET('PATH') + ",MyNewDir" etc.
(Directories are separated by ",").

I also apply what Dave mentioned. Before starting my app, I include all needed path settings for my project/runtime version. In this way VFP will always find files in the given directories.

HTH,

Weedz (Wietze Veld)
My private project:Download the CrownBase source code !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top