It is currently May 25th, 2019, 2:21 pm

Transparent shape with different corner radius

General topics related to Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 8208
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Transparent shape with different corner radius

balala » April 19th, 2019, 1:52 pm

ikarus1969 wrote:
April 19th, 2019, 5:57 am
Just try the following for SkinHeight:
define a variable that holds the code for your desired skin-height, let's call it SKIN.H and use that single variable. That way i got it working.

Code: Select all

[Rainmeter]
...
SkinHeight=#SKIN.H#
...

[Variables]
SKIN.H=((118 + (%NUMBER_OF_PROCESSORS% - 1) * 12)*#Scale#+39*#Scale#*Clamp(#SkinState#,0,1))
...
%NUMBER_OF_PROCESSORS% is an environment variable that holds the same number as the result of your measure MeasureRun but is automatically resolved by Rainmeter (see documentation https://docs.rainmeter.net/manual-beta/variables/?#EnvironmentVariables).
I think you've mistakenly posted this reply here, it should have to go to the background image scaling topic.
User avatar
Pul53dr1v3r
Posts: 164
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Pul53dr1v3r » April 19th, 2019, 3:36 pm

ikarus1969 wrote:
April 19th, 2019, 5:57 am
Thx for the post ikarus and your trying to help.

I tried it, but didn't make anything work. It does work even without scaling up with completely removed SkinHeight when the Scale factor is 1. Increasing the Scale value there is a cut at the bottom at any SkinState. So, did you try it with changed Scale?
Last edited by Pul53dr1v3r on April 19th, 2019, 3:58 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 8208
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Transparent shape with different corner radius

balala » April 19th, 2019, 3:50 pm

Pul53dr1v3r wrote:
April 19th, 2019, 3:36 pm
I tried it, but didn't make anything work. It does work even without scaling up with completely removed SkinHeight when the Scale factor is 1. Increasing the Scale value there is a cut at the bottom at any SkinState. So, did you try it with changed Scale?
I think it does work, using the following SkinHeight into the [Rainmeter] section: SkinHeight=((118+(%NUMBER_OF_PROCESSORS%-1)*12)*#Scale#+39*#Scale#*Clamp(#SkinState#,0,1)). For me it definitely does, even if the skin is scaled.
User avatar
Pul53dr1v3r
Posts: 164
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Pul53dr1v3r » April 19th, 2019, 4:19 pm

balala wrote:
April 19th, 2019, 3:50 pm
I think it does work, using the following SkinHeight into the [Rainmeter] section: SkinHeight=((118+(%NUMBER_OF_PROCESSORS%-1)*12)*#Scale#+39*#Scale#*Clamp(#SkinState#,0,1)). For me it definitely does, even if the skin is scaled.
Yes, it works directly but won't over the Variable for some reason. Thanks balala!
ikarus1969 wrote:
April 19th, 2019, 5:57 am
Made it working not using variable. Viele danke freund! :bow:
User avatar
balala
Rainmeter Sage
Posts: 8208
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Transparent shape with different corner radius

balala » April 19th, 2019, 5:15 pm

Pul53dr1v3r wrote:
April 19th, 2019, 4:19 pm
Yes, it works directly but won't over the Variable for some reason. Thanks balala!
You're welcome, however not me was who helped you with this, but ikarus1969.
User avatar
Pul53dr1v3r
Posts: 164
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Pul53dr1v3r » April 19th, 2019, 5:45 pm

balala wrote:
April 19th, 2019, 5:15 pm
You're welcome, however not me was who helped you with this, but ikarus1969.
His GREAT help on your foundation.
To both of you: :bow:
User avatar
balala
Rainmeter Sage
Posts: 8208
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Transparent shape with different corner radius

balala » April 19th, 2019, 5:52 pm

:thumbup: :great:
User avatar
Pul53dr1v3r
Posts: 164
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Pul53dr1v3r » April 22nd, 2019, 7:29 pm

Here is an issue where a transparent line appears at any Scale values apart from the whole and n.50 ones. Not sure is it about the inner strokes (they are 0 though) or the shape's body.
So, at any whole or half numbers it disappears, but comes up if not so, for example if the scale value is 3.51 as currently.

Image

Code: Select all

[Rainmeter]
Update=1000
SkinHeight=(120*#Scale#)
SkinWidth=(210*#Scale#)
AccurateText=1

[MeterBackground]
Meter=Shape
; The "frame"
Shape=Rectangle 6,7,196,104,5 | StrokeWidth 1 | Stroke Color 160,160,160,255 | Fill Color 0,0,0,0
; The "top" shape
Shape2=Rectangle 6.5,7.5,195.5,25,5 | StrokeWidth 0 | Fill Color #ShapeTopColor#,#ShapeTopOpacity#
Shape3=Rectangle 6.5,15,195.5,20
Shape4=Combine Shape2 | Union Shape3
; The "bottom" shape
Shape5=Rectangle 6.5,35,195.5,75.5,5 | StrokeWidth 0 | Fill Color #ShapeBodyColor#,#ShapeBodyOpacity#
Shape6=Rectangle 6.5,35,195.5,20
Shape7=Combine Shape5 | Union Shape6
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[Variables]
ShapeTopColor=0,0,0
ShapeTopOpacity=150
ShapeBodyColor=0,0,0
ShapeBodyOpacity=150
Scale=3.51
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3336
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Transparent shape with different corner radius

eclectic-tech » April 23rd, 2019, 2:17 pm

Pul53dr1v3r wrote:
April 22nd, 2019, 7:29 pm
Here is an issue where a transparent line appears at any Scale values apart from the whole and n.50 ones. Not sure is it about the inner strokes (they are 0 though) or the shape's body.
So, at any whole or half numbers it disappears, but comes up if not so, for example if the scale value is 3.51 as currently.
I think you are seeing the result of strokes being drawn 1/2 pixels inside and outside, so depending on the positioning created by #Scale# the effect is visible when using the same colors to fill both the top and bottom shapes.

You will not notice this effect as much if you use different colors for the fills (at least I didn't), and since you designed the shapes so two different colors could be used to fill the top and bottom shapes, in most cases I do not see this as a problem.

Click to animate scaling...
shape.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Pul53dr1v3r
Posts: 164
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Pul53dr1v3r » April 23rd, 2019, 5:58 pm

eclectic-tech wrote:
April 23rd, 2019, 2:17 pm
Hi electic. I've also noticed myself that the line is almost invisible (but still there) using 2 different colors and one could live with it in that case. But it's up to someone's taste what the colors to choose. It takes all sorts to make a world, doesn't it. Seems this is a Rainmeter's "shortage" that shouldn't appear under "ideal" circumstances. Am i right?

It's also seems very hard to find a solution for this "small" issue using this method to get the two colored bg. Probably a solution could be jsmorleys' idea with the curves but i've no clue to work with it, fpr now.