It is currently August 18th, 2019, 12:08 pm

Invert container?

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

Invert container?

Virginityrocks » May 27th, 2019, 5:46 pm

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: 3478
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Invert container?

eclectic-tech » May 28th, 2019, 1:40 am

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: 510
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Virginityrocks » 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.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3478
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Invert container?

eclectic-tech » May 28th, 2019, 4:40 pm

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: 510
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Virginityrocks » May 29th, 2019, 5:02 pm

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: 510
Joined: February 26th, 2011, 10:22 pm

Re: Invert container?

Virginityrocks » May 29th, 2019, 9:48 pm

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