"opaque pixels"

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Sun Jan 23, 2022 7:38 pm

I should apologise because this:
graphic objects WILL behave like the images they have as backGroundPatterns insofar as whether
mouseDown/Up clicks get a reaction out of transparent areas.
is NOT true.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Sun Jan 23, 2022 7:49 pm

I wonder why this does not work:
-
SShot 2022-01-23 at 20.48.56.png

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "opaque pixels"

Post by Samuele » Mon Jan 24, 2022 1:16 pm

richmond62 wrote:
Sun Jan 23, 2022 7:38 pm
I should apologise because this:
graphic objects WILL behave like the images they have as backGroundPatterns insofar as whether
mouseDown/Up clicks get a reaction out of transparent areas.
is NOT true.
:? so that's not the aswer?
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 1:17 pm

No, I am afraid it isn't.

One answer might be to convert your PNG images with transparency to GIF images: they should get much smaller.

Samuele
Posts: 267
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: "opaque pixels"

Post by Samuele » Mon Jan 24, 2022 1:23 pm

allright, i thoght GIFs were much bigger
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 1:31 pm

8Ball.gif
8Ball.gif (12.58 KiB) Viewed 1473 times
-
GIF = 13 KB

-
8Ball.png
8Ball.png (54.2 KiB) Viewed 1473 times
-
PNG = 54 KB

stam
Posts: 1179
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: "opaque pixels"

Post by stam » Mon Jan 24, 2022 1:45 pm

Alternatively, if you are concerned that the stack size will increase because you have multiple copies of the same image on multiple cards, make the image a group and set it to be a background group. The same image will appear in the same place on all new cards (you can place it on existing cards with the place object menu item). That way you will have just the one image on multiple cards.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 2:10 pm

Alternatively
I don't know about Samuele, Stam, but I would like to thank you for telling me something
I did not know about after 20 odd years of working with RunRev/LiveCode. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8316
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: "opaque pixels"

Post by dunbarx » Mon Jan 24, 2022 4:50 pm

What is all this hoopla??

The "mouseColor" returns the color of the pixel the cursor is over. If it is "blank", or "empty", assuming an "ordinary' card, the function will return "255,255,255". If not, that is, if there is something "there", you will get another value.

Is this not what the OP wanted?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 5:45 pm

What is all this hoopla??
I think the topic has drifted somewhat since that question was (at least partly) answered.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: "opaque pixels"

Post by jacque » Mon Jan 24, 2022 6:50 pm

Samuele wrote:
Mon Jan 24, 2022 1:23 pm
allright, i thoght GIFs were much bigger
JPEG is the smallest format, particularly because you can set the compression to the smallest size that will still display correctly on the screen.

Edit: It doesn't support transparency though, so not suitable here.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8316
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: "opaque pixels"

Post by dunbarx » Mon Jan 24, 2022 8:16 pm

Richmond
I think the topic has drifted somewhat since that question was (at least partly) answered.
Indeed, but to my mind the use of these extra gadgets is a kludge. I assert that LC can do the job without one. :wink:
Certainly, if the backColor of the card is something in particular, then that would be the "empty" value.

The only reason I can see for these other image-heavy solutions is if the "backColor" of the card is itself an image, or a pattern or color of some kind.

Craig
Last edited by dunbarx on Mon Jan 24, 2022 9:39 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 8:24 pm

The only reason I can see for these other image-heavy solutions is if the "backColor" of the card is itself an image, or a pattern of some kind.
I suspect you are right. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7169
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: "opaque pixels"

Post by richmond62 » Mon Jan 24, 2022 8:53 pm

So, taking advice from Craig, and advice from myself about displaying an image as
a backGroundPattern in a Graphic Rectangle:
-
SShot 2022-01-24 at 21.50.57.png
Attachments
Multiple usage X.livecode.zip
Here's the stack.
(71.7 KiB) Downloaded 19 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”