Loading and displaying image
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Loading and displaying image
Hi all,
It's been a while since I've needed help, but you guys are incredible. Here's my dilemma (and I did search for the solution first, but to no avail). I have an experiment where I need to load and display .gif files. There will be different version of this, but I will usually display 2 or 4 and the participant will choose 1 (of 2) or rank the 4 in a particular order. What I can't figure out is how to get the card to load and display the .gif file. I've tried a bunch of methods like:
get URL "binfile:/P1D16C2.gif"
put URL "binfile:/P1D16C2.gif" into image "pic1"
show pic1
as a start (obviously I'll need to tweak size and location). But I can't even get the file to load and display. If anyone can help, I'd immensely appreciate it. FWIW, I will be keeping all the files in the same folder/directory as the program, so identifying the location is a non-issue.
Thanks again,
Josh
It's been a while since I've needed help, but you guys are incredible. Here's my dilemma (and I did search for the solution first, but to no avail). I have an experiment where I need to load and display .gif files. There will be different version of this, but I will usually display 2 or 4 and the participant will choose 1 (of 2) or rank the 4 in a particular order. What I can't figure out is how to get the card to load and display the .gif file. I've tried a bunch of methods like:
get URL "binfile:/P1D16C2.gif"
put URL "binfile:/P1D16C2.gif" into image "pic1"
show pic1
as a start (obviously I'll need to tweak size and location). But I can't even get the file to load and display. If anyone can help, I'd immensely appreciate it. FWIW, I will be keeping all the files in the same folder/directory as the program, so identifying the location is a non-issue.
Thanks again,
Josh
Re: Loading and displaying image (progress, but still stuck)
Update:
This works for loading and displaying the image:
import paint from file "P1D16C2.gif"
However, it's huge and seems to be a card all by itself. I need it to be smaller and displayed on the same card as another gif file.
Thanks,
Josh
This works for loading and displaying the image:
import paint from file "P1D16C2.gif"
However, it's huge and seems to be a card all by itself. I need it to be smaller and displayed on the same card as another gif file.
Thanks,
Josh
Re: Loading and displaying image
Try setting the filename of your image.
Best wishes,
Curry Kenworthy
LiveCode Development, Training & Consulting
http://livecodeconsulting.com/
WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/
Curry Kenworthy
LiveCode Development, Training & Consulting
http://livecodeconsulting.com/
WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/
Re: Loading and displaying image
Okay,
It's probably overly cumbersome and clunky, but on the bright side, I'll know exactly what it'll look like.
Here is my "solution" for posterity:
1. Object-->New Control-->Image
2. Size image as I want.
3. Insert image into image control
4. Ensure ration and appearance is good
5. Repeat for the rest of images
6. Hide and display images as code specifies
It'll take some extra time, but I think it's my best bet as I do want to ensure appropriate ratios and appearances.
Feel free to post additional thoughts, but I'm good now. Thanks all for being here (and Curry for your reply!).
It's probably overly cumbersome and clunky, but on the bright side, I'll know exactly what it'll look like.
Here is my "solution" for posterity:
1. Object-->New Control-->Image
2. Size image as I want.
3. Insert image into image control
4. Ensure ration and appearance is good
5. Repeat for the rest of images
6. Hide and display images as code specifies
It'll take some extra time, but I think it's my best bet as I do want to ensure appropriate ratios and appearances.
Feel free to post additional thoughts, but I'm good now. Thanks all for being here (and Curry for your reply!).
Re: Loading and displaying image
How do you do make a new image from a button:
Mentioned above in the thread as:
Object-->New Control-->Image
This does not work.
On MouseUp
create control image
End MouseUp
???
Mentioned above in the thread as:
Object-->New Control-->Image
This does not work.
On MouseUp
create control image
End MouseUp
???
Re: Loading and displaying image
try:
Code: Select all
create image "whateveryouwanttonametheimage"
Re: Loading and displaying image
you also have to set lockLoc to true for all images where you set the rectangle, width, height, or any other geometry-type property besides locations. This is because by default, images will resize to their "default", unless you do set lockLoc.
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