It is currently April 20th, 2024, 3:03 am

Invert container?

Report bugs with the Rainmeter application and suggest features.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Invert container?

Post by Virginityrocks »

Maybe a neat low hanging fruit feature?

I'd like to invert a container, so that rather than a meter only existing inside of a container, the parts of said meter are only visible outside of its boundary. Is this possible?

I have a solid image that I'd like to use to cutout bits of another image -- Essentially like a mask, but inverted. So the solid bits of the mask are the cutout, and the transparent bits act like the solid bits.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Invert container?

Post by eclectic-tech »

May miss your desire altogether, but why not use an inversion of your shape meter as your container; set the star as a solid color and the rectangle fill to 0,0,0,0.

Code: Select all

[MeterShapePath]
Meter=Shape
X=1
Y=1
Shape=Path MyPath | StrokeWidth 2 | Stroke Color 41,4,2,255 | Fill Color 87,149,212,255

MyPath=225,125 | LineTo 254,185 | LineTo 320,194 | LineTo 273,240 | LineTo 284,306 | LineTo 225,275 | LineTo 166,306 | LineTo 177,240 | LineTo 130,194 | LineTo 196,185 | ClosePath 1

Shape2=Rectangle 0,0,440,440,10 | StrokeWidth 0 | Fill Color 0,0,0,0
Shape3=Combine Shape | Intersect Shape2

[MeterImage]
Meter=Image
ImageName=shutterstock_373568860.jpg
Container=MeterShapePath
starmask.png
shutterstock_373568860.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Post by Virginityrocks »

The thing is, I don't want to fill in the space within the star, I want to use the image to cutout parts of another meter entirely, leaving it empty/blank/transparent.

The pink in my image represents transparency.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Invert container?

Post by eclectic-tech »

Virginityrocks wrote: May 28th, 2019, 4:01 pm The thing is, I don't want to fill in the space within the star, I want to use the image to cutout parts of another meter entirely, leaving it empty/blank/transparent.

The pink in my image represents transparency.
With a few changes you can get that as a mask container. The transparency of the container meter determines what is visible i another meter when applied as a container.

Code: Select all

[MeterShapePath]
Meter=Shape
X=1
Y=1
Shape=Path MyPath | StrokeWidth 2 | Stroke Color 41,4,2,255 | Fill Color 0,0,0,0

MyPath=225,125 | LineTo 254,185 | LineTo 320,194 | LineTo 273,240 | LineTo 284,306 | LineTo 225,275 | LineTo 166,306 | LineTo 177,240 | LineTo 130,194 | LineTo 196,185 | ClosePath 1

Shape2=Rectangle 0,0,440,440,10 | StrokeWidth 0 | Fill Color 87,149,212,255
Shape3=Combine Shape2 | Exclude Shape

[MeterImage]
Meter=Image
ImageName=shutterstock_373568860.jpg
Container=MeterShapePath
starmask2.png
I may still not understand what you hope to achieve... So I'm going fishing!
You do not have the required permissions to view the files attached to this post.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Post by Virginityrocks »

I see. Still not exactly. The cutout would need to change dynamically based on the image used.

Even if the mask meter had some kind of invert option, reversing the solid and transparent bits of an image for the mask.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Post by Virginityrocks »

Here's an example of what I mean:
You do not have the required permissions to view the files attached to this post.