Page 1 of 1

Loading and displaying image

Posted: Mon Jul 12, 2010 4:34 am
by Josh
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

Re: Loading and displaying image (progress, but still stuck)

Posted: Mon Jul 12, 2010 4:48 am
by Josh
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

Re: Loading and displaying image

Posted: Mon Jul 12, 2010 5:25 am
by Curry
Try setting the filename of your image.

Re: Loading and displaying image

Posted: Mon Jul 12, 2010 8:38 am
by Josh
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!).

Re: Loading and displaying image

Posted: Mon May 27, 2013 12:48 am
by Rauterkus
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

???

Re: Loading and displaying image

Posted: Mon May 27, 2013 12:55 am
by sturgis
try:

Code: Select all

create image "whateveryouwanttonametheimage"

Re: Loading and displaying image

Posted: Mon May 27, 2013 7:52 am
by BvG
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.