Using local URLs
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Using local URLs
I'm trying to create URLs to picture files on the local hard drive. A Image folder exists inside the same folder as the stack. I'm finding the RunRev user guide to be inscrutable about designating the path to the file. Using "./Images/filename.png" doesn't work. Putting file into the same folder and using just "filename.png" doesn't work either. I tried the "binary:" thing also without success. I tried copying the URL in the Inspector for that image when it is displayed without luck either. Why is this so hard? Would it be too much to ask for a file browser palette that allows drag and drop creation of URLs?
Re: Using local URLs
This stack should help you.
-how to select a JPEG or GIF file from hard disk
-how to display it into an image object
-and therefore, how to deal with path
-how to select a JPEG or GIF file from hard disk
-how to display it into an image object
-and therefore, how to deal with path
- Attachments
-
- SELIMAGE.zip
- (938 Bytes) Downloaded 251 times
Re: Using local URLs
Well, I had to disable part of the line that filtered the file type since it then greyed out all the possible images files in the file dialog:bangkok wrote:This stack should help you.
-how to select a JPEG or GIF file from hard disk
-how to display it into an image object
-and therefore, how to deal with path
answer file "Select a file " -- with filter "Web Graphics,*.jpg;*.gif;*.png"
Then it didn't show the relative file URL but the absolute URL (/Users/Peter/Projects/....icon.jpg). I'll keep working on this...
Re: Using local URLs
Not for sure this is what you are looking for based on your description...
I've attached a zip file containing a stack that should properly display an image who's location in a sub folder is always relative to the location of the stack file or executable.
HTH,
-Doc-
I've attached a zip file containing a stack that should properly display an image who's location in a sub folder is always relative to the location of the stack file or executable.
HTH,
-Doc-
- Attachments
-
- relative_image_path.zip
- (4.56 KiB) Downloaded 253 times
Re: Using local URLs
for relative paths, you need to make sure the defaultfolder is set to what you want. this can be tricky, as it is different on mac os standalones (because bundles are folders). theres some additional paths that the engine automatically checks for stacks, but i think that does not apply to images. maybe the filename of the stack plays into it?
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Using local URLs
That works!doc wrote:Not for sure this is what you are looking for based on your description...
I've attached a zip file containing a stack that should properly display an image who's location in a sub folder is always relative to the location of the stack file or executable.
HTH,
-Doc-
"Effective filename" is the secret. Thanks!!!