It is currently April 19th, 2024, 1:39 pm

[Solved] How to achieve solid 1px border around histograms and barmeters?

Get help with creating, editing & fixing problems with skins
User avatar
Dany Gee
Posts: 33
Joined: July 11th, 2012, 8:32 am

[Solved] How to achieve solid 1px border around histograms and barmeters?

Post by Dany Gee »

Hi,

what is the best way to achieve solid 1px border around histograms and barmeters?
For now my borders are created with shapemeter, but It doesn't create real solid 1px border when I enter StrokeWidth 1 - it gets transparent. Strokewidth 2 makes it solid, but too thick.
Code for the border:

Code: Select all

[BorderCpuGraph]
Meter=Shape
Shape=Rectangle 126,321,173,19,0 | Fill Color 255,255,255,0 | StrokeWidth 2| Stroke Color 63,69,81,255
You do not have the required permissions to view the files attached to this post.
Last edited by Dany Gee on April 3rd, 2017, 3:50 pm, edited 1 time in total.
SYSTEM: Windows 11 Pro 64bit|MOBO: ASUS Z170 Deluxe|CPU: i7-6700K @ 4.3Ghz|GPU: Asus GTX1080 Strix|RAM: 64GB Gskill Trident Z RGB (2400Mhz CL15)
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to achieve solid 1px border around histograms and barmeters?

Post by kyriakos876 »

jsmorley wrote: Strokes are not "borders", they are the "drawing stroke" of the shape. So in a sense the stroke is "half inside" and "half outsde" the boundary of the shape. The way Windows / D2D handles an odd-numbered StrokeWidth, like the default "1", is that it actually draws "half pixels" by aliasing the outside and inside edge of the stroke.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to achieve solid 1px border around histograms and barmeters?

Post by kyriakos876 »

User avatar
Dany Gee
Posts: 33
Joined: July 11th, 2012, 8:32 am

Re: How to achieve solid 1px border around histograms and barmeters?

Post by Dany Gee »

OK, I get it. So, is Rainmeter capable of drawing solid 1px border somehow?
SYSTEM: Windows 11 Pro 64bit|MOBO: ASUS Z170 Deluxe|CPU: i7-6700K @ 4.3Ghz|GPU: Asus GTX1080 Strix|RAM: 64GB Gskill Trident Z RGB (2400Mhz CL15)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to achieve solid 1px border around histograms and barmeters?

Post by jsmorley »

You might try StrokeWidth 1.5 and see if that isn't more pleasing.

Code: Select all

[MeterShape]
Meter=Shape
Shape=Rectangle 1,1,300,150 | StrokeWidth 1.5 | Stroke Color 255,255,255,255 | Fill Color 47,47,47,255
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to achieve solid 1px border around histograms and barmeters?

Post by kyriakos876 »

Dany Gee wrote:OK, I get it. So, is Rainmeter capable of drawing solid 1px border somehow?
If you want Rainmeter to draw this, one way could be having 4 image meters.

Code: Select all

[Top]
Meter=Image
SolidColor=0,0,0
W=100
H=1

[Left]
Meter=Image
SolidColor=0,0,0
W=1
H=10
X=R

[Right]
Meter=Image
SolidColor=0,0,0
W=1
H=10


[Bottom]
Meter=Image
SolidColor=0,0,0
W=100
H=1
Y=-1R
This is one "border".

I don't like this method very much though but you might find it helpful.

You can always use an image made on photoshop and use one meter instead of 4, but you asked if Rainmeter could draw it, so yeah...
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to achieve solid 1px border around histograms and barmeters?

Post by jsmorley »

Another approach might be:

Code: Select all

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,302,152 | StrokeWidth 0 | Fill Color 255,255,255,255
Shape2=Rectangle 1,1,300,150 
Shape3=Combine Shape | Exclude Shape2
Shape4=Rectangle 1,1,300,150 | StrokeWidth 0 | Fill Color 47,47,47,255
1.jpg
I did it this way, so if you want to have the shape itself, the dark rectangle, have some transparency, you can, while keeping the "border" solid.
2.jpg
Note that this approach creates a "border". A "stroke" is NOT a border. ;-)
You do not have the required permissions to view the files attached to this post.
User avatar
Dany Gee
Posts: 33
Joined: July 11th, 2012, 8:32 am

Re: How to achieve solid 1px border around histograms and barmeters?

Post by Dany Gee »

Perfect! This is what I was looking for and what nobody asked in the shapemeter thread.
Thanks for the tips and for the Rainmeter!
SYSTEM: Windows 11 Pro 64bit|MOBO: ASUS Z170 Deluxe|CPU: i7-6700K @ 4.3Ghz|GPU: Asus GTX1080 Strix|RAM: 64GB Gskill Trident Z RGB (2400Mhz CL15)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to achieve solid 1px border around histograms and barmeters?

Post by jsmorley »

Dany Gee wrote:Perfect! This is what I was looking for and what nobody asked in the shapemeter thread.
Thanks for the tips and for the Rainmeter!
Glad to help. BTW, "which" was perfect?
User avatar
Dany Gee
Posts: 33
Joined: July 11th, 2012, 8:32 am

Re: How to achieve solid 1px border around histograms and barmeters?

Post by Dany Gee »

This one:
[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,302,152 | StrokeWidth 0 | Fill Color 255,255,255,255
Shape2=Rectangle 1,1,300,150
Shape3=Combine Shape | Exclude Shape2
Shape4=Rectangle 1,1,300,150 | StrokeWidth 0 | Fill Color 47,47,47,255
SYSTEM: Windows 11 Pro 64bit|MOBO: ASUS Z170 Deluxe|CPU: i7-6700K @ 4.3Ghz|GPU: Asus GTX1080 Strix|RAM: 64GB Gskill Trident Z RGB (2400Mhz CL15)