It is currently March 28th, 2024, 8:18 am

Making Alpha Layer Masking?

Get help with creating, editing & fixing problems with skins
User avatar
FreezyJackalope
Posts: 11
Joined: March 11th, 2021, 11:01 am

Making Alpha Layer Masking?

Post by FreezyJackalope »

Is there a way of making some sort of alpha layer masking? Just to be clear, here's what I want to do:

Let's say the following image is a full bar:
Image

If I simply hide it with the background color, it'd look like this...:
Image

When I want it to look like this:
Image

I understand this problem would be easily fixed on bars, the problem is that I'm using custom graphics and images, and I need it to curve at some point, so I need some way of doing this in a RoundLine meter. Or in some other way, if possible. Any help is appreciated, and thank you in advance!
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Making Alpha Layer Masking?

Post by CodeCode »

You can do it in GIMP, just google the instructions.

Then something similar - but granted not very exactly the same - as this, does not require that sort of skillset per se:

Code: Select all

[Container1]
Meter=Shape
Shape=Rectangle 79,78,418,418,207
DynamicVariables=1
Hidden=0

[Cover]
Meter=Image
MeasureName=mCover
Container=Container1
AntiAlias=1
Y=77
X=77
W=423
H=423
LeftMouseUpAction=["#MediaPlayerPath#"]
MouseScrollUpAction=[!WriteKeyValue Variables MyLogoImage "((#MyLogoImage#+1)%10)" "#@#RoundVariables.inc"][!RefreshGroup BigTunes]
MouseScrollDownAction=[!WriteKeyValue Variables MyLogoImage "((#MyLogoImage#=0)?9:(#MyLogoImage#-1))" "#@#RoundVariables.inc"][!RefreshGroup BigTunes]
DynamicVariables=1
You can use any shape as the container mask. Just keep in mind the juxtaposition rules of every measure and meter graphics stack first on the 'bottom', and the last; 'masking' the previous meters essentially.
User avatar
FreezyJackalope
Posts: 11
Joined: March 11th, 2021, 11:01 am

Re: Making Alpha Layer Masking?

Post by FreezyJackalope »

CodeCode wrote: April 26th, 2021, 10:40 am You can do it in GIMP, just google the instructions.

Then something similar - but granted not very exactly the same - as this, does not require that sort of skillset per se:

Code: Select all

[Container1]
Meter=Shape
Shape=Rectangle 79,78,418,418,207
DynamicVariables=1
Hidden=0

[Cover]
Meter=Image
MeasureName=mCover
Container=Container1
AntiAlias=1
Y=77
X=77
W=423
H=423
LeftMouseUpAction=["#MediaPlayerPath#"]
MouseScrollUpAction=[!WriteKeyValue Variables MyLogoImage "((#MyLogoImage#+1)%10)" "#@#RoundVariables.inc"][!RefreshGroup BigTunes]
MouseScrollDownAction=[!WriteKeyValue Variables MyLogoImage "((#MyLogoImage#=0)?9:(#MyLogoImage#-1))" "#@#RoundVariables.inc"][!RefreshGroup BigTunes]
DynamicVariables=1
You can use any shape as the container mask. Just keep in mind the juxtaposition rules of every measure and meter graphics stack first on the 'bottom', and the last; 'masking' the previous meters essentially.
Sorry, I'm not sure I understand this? From what I'm seeing, you're using it with an action, when I want it to happen through a measure reading (in this case, blue would be disk usage and the yellow would be disk space). That's my main problem, since, as far as I know, RoundLine is the only meter that can dynamically change in a circle through a measure.

This is a practical example of what I already have:
Image

The green bar is no problem, I already have it set up and it works perfectly fine with my method of just putting the background color over it, since it has nothing else inside its "gauge", but the blue bar is the problem...
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Making Alpha Layer Masking?

Post by CodeCode »

Well, my suggestion remains the same but in your case an image mask with the transparent bits between the black bits.

Roundline can navigate a 270 degree clockwise movement and then at the right time a bar would take its place for the straight bit.

Some sort of conditional could make the switch when the prescribed amount (75% of a full circle), then the bar kicks in.

I have thought about doing something similar, but due to latency the arc and the bar may not always line up, unless you tack in an overlap between the two shapes.
User avatar
FreezyJackalope
Posts: 11
Joined: March 11th, 2021, 11:01 am

Re: Making Alpha Layer Masking?

Post by FreezyJackalope »

Jeez, I'm sorry, I'm not exactly sure I understand... I've never really used the !WriteKeyValue bang before, so I have positively no clue how to use it, much less what it does. Any way you could walk me through the code you wrote? And, again, I apologize.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Making Alpha Layer Masking?

Post by balala »

FreezyJackalope wrote: April 26th, 2021, 1:30 pm And, again, I apologize.
Don't apologize at all. Better please give us a few deatils on what exactly would you like to achieve, because I definitely didn't understand. Here is what I mean:
FreezyJackalope wrote: April 26th, 2021, 7:19 am Just to be clear, here's what I want to do:

Let's say the following image is a full bar:
Image
What in your screenshot is the full bar? The blue or the yellow section?
FreezyJackalope wrote: April 26th, 2021, 7:19 am If I simply hide it with the background color, it'd look like this...:
Image
Not sure what do you mean by hide the bar with the background color. If you're adding a background color to a bar meter, the background color doesn't hide the bar. It is visible below the bar. For instance if the bar should show 50%, on the left half of the bar's width you see the color of the bar, while on the right half, the background, set through the BackgroundColor option.
FreezyJackalope wrote: April 26th, 2021, 7:19 am When I want it to look like this:
Image
So again: the bar is the blue or the yellow part of the image?
Please come back with a few details.
User avatar
FreezyJackalope
Posts: 11
Joined: March 11th, 2021, 11:01 am

Re: Making Alpha Layer Masking?

Post by FreezyJackalope »

balala wrote: April 26th, 2021, 3:52 pm Don't apologize at all. Better please give us a few deatils on what exactly would you like to achieve, because I definitely didn't understand. Here is what I mean:

What in your screenshot is the full bar? The blue or the yellow section?

Not sure what do you mean by hide the bar with the background color. If you're adding a background color to a bar meter, the background color doesn't hide the bar. It is visible below the bar. For instance if the bar should show 50%, on the left half of the bar's width you see the color of the bar, while on the right half, the background, set through the BackgroundColor option.

So again: the bar is the blue or the yellow part of the image?
Please come back with a few details.
Okay, so, with practical examples from what I already have:

Picture this as the full bar (only the blue and the yellow matter here):
Image

What I want to do is for the yellow to disappear without affecting the blue bar depending on the measure being read (in this case, disk space used), like such:
Image

However, with the method I'm using right now for both the blue and the green bar, which is simply using a RoundLine meter with the same color as the background, it will overlap with the blue and make it "disappear", like so:
Image

What I'm looking for is a way to make the black bar (mimicking the background) obscuring the blue bar a sort of alpha mask, where it "deletes" the yellow bar but keeps every other layer below it intact. I hope that clears it up! Also to note: these are both images, not solid colors, which, unlike the Bar meter, the RoundLine meter doesn't let me use as the bar itself.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Making Alpha Layer Masking?

Post by balala »

FreezyJackalope wrote: April 26th, 2021, 4:46 pm Okay, so, with practical examples from what I already have:
What I'd do is the following: would create the blue background, would add the yellow roundline, then a bar. Those have to be properly joined, but I think it's achievable. Interested?
User avatar
FreezyJackalope
Posts: 11
Joined: March 11th, 2021, 11:01 am

Re: Making Alpha Layer Masking?

Post by FreezyJackalope »

balala wrote: April 26th, 2021, 5:23 pm What I'd do is the following: would create the blue background, would add the yellow roundline, then a bar. Those have to be properly joined, but I think it's achievable. Interested?
The thing is... The blue bar is ALSO a meter! I should have probably mentioned that earlier, my bad. That's what's giving me so much trouble. They're two different overlayed bars with different functions.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Making Alpha Layer Masking?

Post by balala »

FreezyJackalope wrote: April 26th, 2021, 5:35 pm The thing is... The blue bar is ALSO a meter! I should have probably mentioned that earlier, my bad. That's what's giving me so much trouble. They're two different overlayed bars with different functions.
Ok, this is not a problem. But for first I'd work with only one, just to see how can this be done. Me personally never joined a Roundline and a Bar meter this way. Would be much easier to work with one single pair for the first. Then, if it works as expected, adding the second pair would be much easier.
Just my opinion...
Post Reply