Graphic takes on look of image below.

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
windowsLC
Posts: 26
Joined: Sat Dec 16, 2017 5:58 am

Graphic takes on look of image below.

Post by windowsLC »

this one is killing me because I know there is a great demo stack of this out there but cant find it again. :x

I am placing a regular polygon graphic over an image and I want the polygon to take on the the look of the section of image below it. I cant remember if it was Ink, imagedata or background pattern that was the key do this.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Graphic takes on look of image below.

Post by richmond62 »

switch.jpg
Better version available lower down!

Code: Select all

on mouseUp
   if the backGroundPattern of grc "PG" is the id of img "GG" then
      set the backGroundPattern of grc "PG" to the id of img "BB"
      else
         set the backGroundPattern of grc "PG" to the id of img "GG"
         end if
end mouseUp
Last edited by richmond62 on Sat Dec 30, 2017 9:44 am, edited 1 time in total.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic takes on look of image below.

Post by Klaus »

Maybe you mean "backgroundpattern"?

Code: Select all

...
set the BackGroundPattern of grc "your graphic here..." to 1003
## Or what ID your image may have.
...
The image itself does not need to be visible for this.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic takes on look of image below.

Post by Klaus »

I really need to type faster! :D
windowsLC
Posts: 26
Joined: Sat Dec 16, 2017 5:58 am

Re: Graphic takes on look of image below.

Post by windowsLC »

Yes! backgroundpattern thanks, that is what I was trying to remember.
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Graphic takes on look of image below.

Post by bogs »

Klaus wrote: Fri Dec 29, 2017 10:30 pm I really need to type faster! :D
I thought typing speeds were capped by the theory of relativity :twisted:
Image
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic takes on look of image below.

Post by Klaus »

Sorry, you know how it is, I could tell you, but then I would have to kill you! :twisted:
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Graphic takes on look of image below.

Post by richmond62 »

Lost control of my own enthusiasm:

Code: Select all

on mouseUp
   if the backGroundPattern of grc "PG" is the id of img "GG" then
      set the polySides of grc "PG" to 5
      set the backGroundPattern of grc "PG" to the id of img "BB"
   else
      set the polySides of grc "PG" to 7
         set the backGroundPattern of grc "PG" to the id of img "GG"
         end if
end mouseUp
https://www.dropbox.com/s/1nnpsxnqy0bmx ... e.zip?dl=0
PolyBlob.jpg
Post Reply