[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gif and program in one save file?



Renata McCoy <renata@atmos.colostate.edu> wrote:
> I'd like to include gif image in the distribution of a widget program to
> be saved with save procedure. I want it to be platform independent.
> Is there any way of avoiding using path to read gif file?
> Can I somehow save the routines together with image variables in one
> save file?
> The idea is to distribute only one file that someone can double click on
> and see gif image and have routines restored.

I don't really know about saving the GIF (as an array and a LUT, say) along
with your code in a single .SAV file.  Perhaps if you compiled your program
as a "main level" program (one that executes when you just type .run) you
could do this, but it's not an elegant way to go about things, in my opinion.
 Do you also have to consider runtime IDL?  (I have too little experience
with RT to guess if it would be even remotely possible with RT.)

A tantalysing alternative is to keep the gif image as a file and insist that
it be installed in the same directory as your program, then to use
ROUTINE_INFO() from within your program to find out where it lives. 
Unfortunately this ** DOESN'T WORK ** for .SAV files.  (Hello, RSI, I would
really like it if this DID work, or if there was a functionally similar
alternative.)

Or... Insist that your program and its files be kept together but also insist
that their directory be put into IDL's search path.  (This is reasonable.  In
fact it's necessary.)  Then you can use the following rather messy little
piece of work to find your file (Unix and Windows only):
ftp://demsyd.syd.dem.csiro.au/pub/mmtg/idl/huntfile.pro (We're renaming our
FTP server soon, but the above address should still be good for a couple of
days.)

By this time I must be starting to get on the nerves of one or two regulars
out there by being so undecided.  Only one more suggestion to go...  This
one's quite popular, and it has the considerable advantage that it leaves
little to chance.  First of all, absolutely insist that your program and
files be stored in a specific directory (you dictate its name) under IDL's
lib directory. e.g., Call it "mystuff".  Then from within your program you
can set up the path to your file "mygif.gif", say, with
FILEPATH('mygif.gif',subdir=['lib','mystuff']) (BTW, FILEPATH() just dresses
up a path for the current platform.  It doesn't verify anything.)


Peter Mason

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own