alpha channel

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
rushvan
Posts: 10
Joined: Mon Oct 15, 2007 8:50 pm

alpha channel

Post by rushvan » Fri Oct 26, 2007 6:40 pm

is there a way to paste an image on a background so just the image appears on the background?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Oct 27, 2007 10:07 am

Hi rushvan,

Why did you give your question the topic name Alpha Channel?

To paste an image, you can just press command-V (control-V on PC) or execute the paste command.

If you want to use the image as a background for all cards, open the property inspeector of the stack (or card). Go to the Colors and Patterns pane of the property inspector. Click on the box for the backgrounPattern and choose the image you pasted.

You can also execute the line

set the backgroundPattern of this stack to <id of your image>

or

set the backgroundPattern of this cd to <id of your image>

Now set the visible of the image to false and you're done.

If you want the picture to automatically appear on new cards but don't want to use it as a background for the stack, you can group the image and set its backgroundBehavior to true.

Make sure to read the entry for backgroundPattern in the docs.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Post by Klaus » Sat Oct 27, 2007 11:14 am

Hi rushvan,

do you want to place an image with transparency (alpha channel)?

If yes then you need to save you image WITH transparencies as a PNG file.
Rev will interpret the "alpha channel" correctly and show the image exactly as you want to.


Best

Klaus

rushvan
Posts: 10
Joined: Mon Oct 15, 2007 8:50 pm

alpha channel

Post by rushvan » Sun Oct 28, 2007 10:31 pm

klaus , thanx,

that works for 'file control as image'. the image pasts with transparent background on a new card.

but i need to paste a transparent image as an image so i can then script 'move image'. but the image paste shows the original background and covers the background i want to show.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Oct 28, 2007 10:56 pm

Hi Rushvan,

If your original background is not transparent, you will have to find out what part of the image is background and use a mask to make that part transparent.

It is probably easier to do this in a good image editor, which can save the picture in PNG format.

I'm sure we can help you better if you explain why you need this.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rushvan
Posts: 10
Joined: Mon Oct 15, 2007 8:50 pm

alpha channel

Post by rushvan » Mon Oct 29, 2007 7:56 pm

that's what i'm doing. in an image editor i create the mask color that will become transparent. that works when i paste that image over a background as a 'control as image' on a new card.

but then i can't script 'move card'. it won't move a card. i need to edit 'paste image' over an existing background so i can script 'move image'. an image will move with script 'move image.'

but when i paste as an image the background on that should be transparent shows . it blocks out the card background that i want to show.

in other words the png transparancy works for 'control as image' but not 'edit, paste' image.
]
thanx everyone

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

Post by Klaus » Fri Nov 09, 2007 11:31 am

Ah, NOW I get it :-)

This is a known bug in Rev and will be fixed for 2.9.


Best

Klaus

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Mon Dec 10, 2007 5:20 pm

Hello,

I know I'm more than a day late and a dollar short in this response, but considering that only recently I was doing a similar thing, I thought it might be appropriate to put my two cent's worth into the old discussion:

What about using the blendLevel setting? It's certainly an easy way to create transparency on a scale of 1 to 100 (just pull the slider along and watch the results), and I find that it made a couple of great backgrounds for two of my splash screens recently.

Cheers, deeverd

Post Reply