Applying transparency to only a part of a stack?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Applying transparency to only a part of a stack?
Hello,
Is there a way to apply transparency to only a part of a stack like the following demo (made with Photoshop) with LC Indy 9.04?
If the blendLevel of a stack is modified, all its controls will be transparent. On the other hand, if the blendLevel of an image is modified, the stack background is still visible.
Thank you.
Is there a way to apply transparency to only a part of a stack like the following demo (made with Photoshop) with LC Indy 9.04?
If the blendLevel of a stack is modified, all its controls will be transparent. On the other hand, if the blendLevel of an image is modified, the stack background is still visible.
Thank you.
Re: Applying transparency to only a part of a stack?
Hi Zax,
I think this may get you started:
https://lessons.livecode.com/m/4071/l/2 ... ks-windows
Best
Klaus
I think this may get you started:
https://lessons.livecode.com/m/4071/l/2 ... ks-windows
Best
Klaus
Re: Applying transparency to only a part of a stack?
Yes, it is possible (and fairly easy).
I recreated the look of the stack you posted, but I prefer cars to dogs. The settings and controls are included in the picture (Lc 6.5.2, will work in any version later I suspect).
I recreated the look of the stack you posted, but I prefer cars to dogs. The settings and controls are included in the picture (Lc 6.5.2, will work in any version later I suspect).
Re: Applying transparency to only a part of a stack?
Thanks for your answers.
@Klaus: I'm studying this lesson but I'm not sure it will help me.
@bogs: I don't understand because this is what I have with a default stack, only applying a 50% blendSrcIn effect of an image object :
Making the image transparent only reveals stack's background (default grey).
But you're right, cars are better than dogs
@Klaus: I'm studying this lesson but I'm not sure it will help me.
@bogs: I don't understand because this is what I have with a default stack, only applying a 50% blendSrcIn effect of an image object :
Making the image transparent only reveals stack's background (default grey).
But you're right, cars are better than dogs
Re: Applying transparency to only a part of a stack?
Heh, I dunno what to tell you there, I rarely venture higher than 6.5.x, and usually am far lower in version numbers (like Mc 2.5) as far as IDEs go, but since your test flopped, I dragged some of the newer IDEs out of storage to see what was going on.
What I found out (on linux) was -
- I couldn't get 9.6 to even resize the image, and changing blend levels for various inks did nothing. { This is no surprise to me, LOTS of things in 9.6 don't work here worth squat }
- 9.5 - was at least able to assemble a copy stack for demonstration and worked as far as the topic is concerned.
- I guess I didn't even try to download any versions between 8.1.2 and 9.5, 8.1.2 is iffy here, even 8.0.1 is no wonder shakes.
- 8.0.1 and 8.1.2 *were* able to do exactly that same trick, though.
The only way to know that would be to post your OS specs ( guessing OSX, but which one? ) and see if someone else using it in combination with LC 9.04 can duplicate the problem.
Likely suspects for testing would be Klaus, Richmond, or Jacque off the top of my head.
Alternately, make the stack in an earlier (or later) version of Lc, save it setup how you like, then open it in 9.04 and see if the transparency stuck while in that IDE or after building. I don't see why it shouldn't as long as it is properly set.
Re: Applying transparency to only a part of a stack?
OK, I finally understand the lesson linked by Klaus. It's very helpful, though it could be a little bit more accurate.
I still have a problem about the ink: I would like to a assign a "blendMultiply" ink to the process but it doesn't seem to work as intended.
(the red border is for development purpose)
@bogs: I'm using LC 9.04 on MacOS Sierra 10.12.6.
Maybe it depends on car model
I still have a problem about the ink: I would like to a assign a "blendMultiply" ink to the process but it doesn't seem to work as intended.
(the red border is for development purpose)
@bogs: I'm using LC 9.04 on MacOS Sierra 10.12.6.
Maybe it depends on car model
Re: Applying transparency to only a part of a stack?
No, it is almost certainly that the ink isn't being properly applied heh, but I'm sure you already know that@bogs: I'm using LC 9.04 on MacOS Sierra 10.12.6.
Maybe it depends on car model
You know, it also came to my mind that there is a (relatively) simple way to accomplish this outside of Lc, but I hesitate to mention it as some people don't care for windowShape.
WindowShape requires a bit more massaging as well, but the basic idea is, you take a picture of your stack in it's solid shape with all areas defined, make whatever area you want to be transparent more transparent in a paint program, and then set the window shape to that image after you import it as a control (or reference it, but then your dealing with file systems as well).
This would be an example of using windowShape and an image to define solid / non solid parts of the window.
I'll work up an example of some different ways to accomplish what I mean and post a link to it.
Re: Applying transparency to only a part of a stack?
Thanks bogs for your time
I would like to manage transparency from inside LC because I would like to adjust it with the scroller (shown at the topleft of my screenshot).
When my user interface (and my scripts) will work, I'll try to make more accurate ink transformation, like full transparency on white or black areas.
I would like to manage transparency from inside LC because I would like to adjust it with the scroller (shown at the topleft of my screenshot).
When my user interface (and my scripts) will work, I'll try to make more accurate ink transformation, like full transparency on white or black areas.
Re: Applying transparency to only a part of a stack?
This would be the brute force method, just using windowShape (and an image editor!). Mind you, for what your doing, I would just find out which vers. of Lc accomplishes what you want, and use that to make the stack initially.
**Edit - you posted as I was composing this ...
Some caveats to that would be that the region itself couldn't be resized, so the group's size would have to be locked at the size of that region.
- Here I blatantly ripped off your smug dog picture stack and imported it into a paint program (GIMP).
- I used the rectangle select tool and cut the area I want transparent.
*Note - make sure you put some kind of fill color with the opacity desired into that area, or you will see nothing. - Save the file as a .png and import it as a control to the stack you want this ultimately to wind up in.
- Set the windowShape of the stack to that image.
- Put another image control on top of that and set it's size appropriately...
As you can see, you have your semi transparent image at this point. - PROFIT !
**Edit - you posted as I was composing this ...
In the case of the above method, the only thing that would change is that you would group the image on top of the windowShape image, the group would provide scrollbars for you if the image is larger than the group.
Some caveats to that would be that the region itself couldn't be resized, so the group's size would have to be locked at the size of that region.
Re: Applying transparency to only a part of a stack?
I spent some time trying to make the picture resizable but finally it works
Thanks again for all your help.
As you can see, it works with cars and dogs. I didn't try with cats but it should work
Now ink effects remain rather mysterious for me... For example, is there a way to make transparency only for white, or only for black?
Thanks again for all your help.
As you can see, it works with cars and dogs. I didn't try with cats but it should work
Now ink effects remain rather mysterious for me... For example, is there a way to make transparency only for white, or only for black?
Re: Applying transparency to only a part of a stack?
Unfortunately, I don't have the answer to the question about black and white, we'll need someone that actually knows more about inks and blending to step up to answer for you
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Applying transparency to only a part of a stack?
Hi Zax,
If you want apply transparency to an image I think yes but i never did it.
From dictionary
Jean-Marc
Not sure I understand correctlyFor example, is there a way to make transparency only for white, or only for black?
If you want apply transparency to an image I think yes but i never did it.
From dictionary
Best regardsUse the alphaData property to control the transparency of the pixels in an image.
Each pixel is represented by 8 bits (1 byte) of alpha channel data, with pixels numbered from the top left corner of the image, left to right, then top to bottom.
A value of zero means the pixel is fully transparent; a value of 255 is fully opaque; and values in between indicate a level of partial translucency.
Jean-Marc
https://alternatic.ch
Re: Applying transparency to only a part of a stack?
Sorry, for a given image, I would like to make the darker parts more transparent than the brighter ones, and conversely. It can be done with softwares like Photoshop.
I tried to play with alphaData but didn't understand. In fact, I was wondering if there is a preset ink mode in LC that would do what I want.
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Applying transparency to only a part of a stack?
I can never remember what each ink does. I just select the image and click my way through them all. Sometimes twice.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Applying transparency to only a part of a stack?
That is my method usually as well, sometimes I see an effect that is more desirable than what I was shooting for to begin with