Image on card repeats
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Image on card repeats
Hi Everyone,
I added an image to a sub stack and referenced this image on a card and noticed that the images repeats several times.
Can you tell me what I need to do so there is only 1 image with no repeats?
Thanks.
I added an image to a sub stack and referenced this image on a card and noticed that the images repeats several times.
Can you tell me what I need to do so there is only 1 image with no repeats?
Thanks.
Re: Image on card repeats
HI rleiman,
Where did you do the reference of the image ?
Your picture let me think you have used the backgroundpattern of the card and there is not an image object. Right ?
To add an image you can use: -- myPathImg is a valid path for a image file
or
Use the second way if you want paint the image
Best regards
Jean-Marc
Where did you do the reference of the image ?
Your picture let me think you have used the backgroundpattern of the card and there is not an image object. Right ?
To add an image you can use:
Code: Select all
new image
set the filename of last image to MyPathImg
or
Code: Select all
import paint from file MyPathImg
Best regards
Jean-Marc
https://alternatic.ch
Re: Image on card repeats
Hi rleiman,
how did you "reference" the image from the substack?
Looks like you set the background pattern of your card/stack to that image!
This way it will be "repeated" if there is still room in the card
To display the image only ONCE, create a button in the size of that image (no name, no border,
maybe even disabled) and set its ICON to the ID of that image.
Et voila: ONE representation of the image!
Best and a happy 2013
Klaus
how did you "reference" the image from the substack?
Looks like you set the background pattern of your card/stack to that image!
This way it will be "repeated" if there is still room in the card

To display the image only ONCE, create a button in the size of that image (no name, no border,
maybe even disabled) and set its ICON to the ID of that image.
Et voila: ONE representation of the image!

Best and a happy 2013
Klaus
Re: Image on card repeats
Thanks for the reply.
I will try that.
I will try that.

Re: Image on card repeats
I agree with Klaus, it looks like you've set the backgroundPattern of either a card or the stack to use the image. LiveCode will tile the image if it is smaller than the card. If you don't want to add an additional button, you can just set the size of the image to the size of the card before the card is drawn.
Generally you only need to do that on preOpenStack or preOpenCard if the stack can't be resized by the user. If it can be resized, then you'd do that in a resizeStack handler.
Code: Select all
set the width of img "myImg" to the width of this cd
set the height of img "myImg" to the height of this cd
set the backgroundPattern of this cd to "myImg"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Image on card repeats
Hi,
That's what I was looking for.
Yes, I was using the image as the background by referencing it's I'd from the image file in the substack.
Thanks so much for the help.
That's what I was looking for.
Yes, I was using the image as the background by referencing it's I'd from the image file in the substack.
Thanks so much for the help.
Re: Image on card repeats
This will be my first app with LiveCode. 
