Fit backgroundPattern image to a smaller stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Fit backgroundPattern image to a smaller stack
Developing for mobile.
I've important an image in a substack that I want to use as a background in my normal stack. Because the imported image is bigger than the stack, the background now looks strange (too big - because my image is 1.4 times bigger) when I use it as backgroundPattern.
Is there any way to resize the image used for backgroundPattern to fit a slightly smaller stack? I use a bigger image because I don't want the background image to have bad quality if someone uses an iPhone Plus for example.
The alternative seems to be to use an image control with Layer 1, but then it's not possible to tap outside the input fields to remove the keyboard toggle.
Any ideas?
Thanks,
Tom
I've important an image in a substack that I want to use as a background in my normal stack. Because the imported image is bigger than the stack, the background now looks strange (too big - because my image is 1.4 times bigger) when I use it as backgroundPattern.
Is there any way to resize the image used for backgroundPattern to fit a slightly smaller stack? I use a bigger image because I don't want the background image to have bad quality if someone uses an iPhone Plus for example.
The alternative seems to be to use an image control with Layer 1, but then it's not possible to tap outside the input fields to remove the keyboard toggle.
Any ideas?
Thanks,
Tom
Re: Fit backgroundPattern image to a smaller stack
Hi Tom,
do something like this, maybe "on preopenstack":
...
## In any case set the LOCLOCK of the image to true first in the inspector!
## First resize the image:
set the rect of img "you image here..." to the rect of this stack
## Or set width and height as you wish...
## NOW set the backgroundpattern via script:
set the backgroundpattern of this stack to xxx
##(the id of that image)
...
Best
Klaus
do something like this, maybe "on preopenstack":
...
## In any case set the LOCLOCK of the image to true first in the inspector!
## First resize the image:
set the rect of img "you image here..." to the rect of this stack
## Or set width and height as you wish...
## NOW set the backgroundpattern via script:
set the backgroundpattern of this stack to xxx
##(the id of that image)
...
Best
Klaus
Re: Fit backgroundPattern image to a smaller stack
Alternately, you could just resize the image in any image editor, then use it in the program. However, if your stack size changes a lot, what Klaus said.tomsve wrote: ↑Fri Oct 27, 2017 2:39 pmI've important an image in a substack that I want to use as a background in my normal stack. Because the imported image is bigger than the stack, the background now looks strange (too big - because my image is 1.4 times bigger) when I use it as backgroundPattern.
Re: Fit backgroundPattern image to a smaller stack
Great, thanks both of you. I'll try it.
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Fit backgroundPattern image to a smaller stack
If I remember right a background pattern will only use its native size, but try it. If that doesn't work, use a second image instead and disable it. That will allow taps to go through to the card normally and dismiss the keyboard.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Fit backgroundPattern image to a smaller stack
I tried a little bit back and forth and eventually I got it to work with Klaus method, but in the preOpenCard.
That's also a suggestion jacque, thanks. I'll have that in mind. I was thinking that might be a solution to a problem I just posted now about the datagrid borders, but I think not.
Thanks for quick help. Hopefully I'll have my next app in the store soon
That's also a suggestion jacque, thanks. I'll have that in mind. I was thinking that might be a solution to a problem I just posted now about the datagrid borders, but I think not.
Thanks for quick help. Hopefully I'll have my next app in the store soon