Page 1 of 1

1. how to fit an image to a button and vv. 2.color

Posted: Wed Jul 16, 2014 11:50 am
by robm80
how to fit an image to a button and vv :?:
Is there a livecode script for: stretch the graphic to button and/or size the button to fit the graphic.
I hoped that formattedwidth could help me: nope.

How to colour a rectangle (f.i) from full blue to white, hor. or vert.
There must be an english word for it, but can't find it.

Re: 1. how to fit an image to a button and vv. 2.color

Posted: Wed Jul 16, 2014 12:46 pm
by Klaus
Dag Rob,

1. fit image -> button
...
set the rect of img "your image here" to the rect of btn "your button here"
...
2. Fit button -> image
...
set the rect of btn "your button here" to the rect of img "your image here"
...
Instead of setting the RECT you can of course also use WIDTH and HEIGHT of the image/button as reference!

3. GRADIENT is the magic word :D
Find the setting for this in the inspector for your graphic!


Best

Klaus

Re: 1. how to fit an image to a button and vv. 2.color

Posted: Wed Jul 16, 2014 2:00 pm
by robm80
Find the setting for this in the inspector for your graphic!
thanks so far :)

But could you be more specific with the gradient: in the dict.I see a fillgradient, but don't know how to use it.
Please tell me in steps how to colour a rectangle "try" from blue to white, using the gradient.
you write "the inspector for your graphic!"
Where do I find that graphic and its inspector, or better: where do I find those settings.

thanks again

Re: 1. how to fit an image to a button and vv. 2.color

Posted: Wed Jul 16, 2014 2:28 pm
by Klaus
robm80 wrote:Where do I find that graphic and its inspector
Come on, Rob, of course I mean your rectangle graphic and the PROPERTY inspector for that graphic,
what you see when you doubleclick your rectangle graphic! 8)

See my attached screenshot:
1. In the popup at the top of the inspector, select "Gradient".

2. Then make a doubleclick at one side of the (white) color bar to se tteh starting color.
Same for the other side of the color bar to set the end color for your gradients.

Select one of the little rect, a black triangle at their top will indocate which one is selected.
Then click the little color square "Color" to set the color for the selected color.

3. Play a bit with all the other options.


Best

Klaus

Re: 1. how to fit an image to a button and vv. 2.color

Posted: Wed Jul 16, 2014 9:32 pm
by robm80
what you see when you doubleclick your rectangle graphic!
This was a big surprise for me: the gradient by doubleclicking :!: :!:
All worked fine, but I had problems with the color. Whatever I choose, the color was always black, until I restarted the stack.

This also very OK:
set the rect of "appel.jpg" of stack "foto" to the rect of button "pict"
set the icon of button "pict" to "appel.jpg" of stack "foto"

Gute Nacht KLaus