Import snapshot and use as icon of button

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
et_phone_home
Posts: 13
Joined: Wed Jun 08, 2011 10:54 pm

Import snapshot and use as icon of button

Post by et_phone_home » Wed Jun 08, 2011 11:39 pm

HI

How can i copy a potion of an image and set that copy as the icon of a button?

I'm starting using Livecode:(

I use "import snapshot from rectangle 0,0,50,50 of image ID 1500" and i get a 50x50 image in the center of the screen. How can i set that image as an icon of a button?

THX

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Import snapshot and use as icon of button

Post by bn » Wed Jun 08, 2011 11:45 pm

Hi et_phone_home,

have a look at this lesson:

http://lessons.runrev.com/spaces/lesson ... con-images

it explains it very well and you can adapt it to your snapshot image if you take the id of the snapshot image. Better yet you could change the id of the snapshot image to a range that is not used by Livecode (e.g. > 6000) and then set the icon of the button to that id.

Kind regards

Bernd

Post Reply