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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

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

Post by robm80 » Wed Jul 16, 2014 11:50 am

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.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Wed Jul 16, 2014 12:46 pm

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

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

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

Post by robm80 » Wed Jul 16, 2014 2:00 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Wed Jul 16, 2014 2:28 pm

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
Attachments
gradients.jpg

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

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

Post by robm80 » Wed Jul 16, 2014 9:32 pm

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

Post Reply