Images in buttons

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
glpunzi
Posts: 57
Joined: Sun Nov 28, 2010 5:50 pm
Contact:

Images in buttons

Post by glpunzi »

Hi all,

It's possible to resize an image inside a button?

For example, I have an image of 256x256, and I want to put it in 64x64, or 32x32 without touiching the image with gimp for example.

It's possible to have the image at the left of the text button? ot must be up in the text?
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Images in buttons

Post by Klaus »

Hola Guiseppe,
glpunzi wrote:Hi all,
It's possible to resize an image inside a button?
No. Since the images inside of buttons are referenced in fact, you need to modify the original and referenced image.
It's possible to have the image at the left of the text button? ot must be up in the text?
Sure, set the "textalign" of the button to left (or right or center) in the Inspector -> Text Formatting for the button.

Best

Klaus
glpunzi
Posts: 57
Joined: Sun Nov 28, 2010 5:50 pm
Contact:

Re: Images in buttons

Post by glpunzi »

Klaus wrote:Hola Guiseppe,
glpunzi wrote:Hi all,
It's possible to resize an image inside a button?
No. Since the images inside of buttons are referenced in fact, you need to modify the original and referenced image.
It's possible to have the image at the left of the text button? ot must be up in the text?
Sure, set the "textalign" of the button to left (or right or center) in the Inspector -> Text Formatting for the button.

Best

Klaus
Thanks a lot, I will check ;)
BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Images in buttons

Post by BvG »

Yes it is possible.

All you need to do is to set the width and height of the image, for example:

Code: Select all

on mouseUp
   set the rect of image 1 to 0,0,100,100
   set the icon of me to the id of image 1
end mouseUp
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Images in buttons

Post by Klaus »

Of course Björnke is right!

I meant that one can not scale an image inside a buttton
by changing any property of the button, sorry for the confusion!


Best

Klaus
Post Reply