Ah good, that's my favorite too.Dany Gee wrote:This one:
It is currently April 20th, 2024, 6:12 am
[Solved] How to achieve solid 1px border around histograms and barmeters?
-
- 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?
-
- Posts: 100
- Joined: April 30th, 2017, 11:51 am
Re: [Solved] How to achieve solid 1px border around histograms and barmeters?
Although this one is already solved, I was wondering: wouldn't it be easier solution to use stroke with half-pixel offset? Like this:
Despite stroke with 1 pixel width is usually drawn on 2 real pixels we have set upper left coordinates of shape to half-pixel position so we see exactly one-pixel border around 98*48 pixels area.
For thicker borders we can also use strokes:
This solution is less customizable since we can't change stroke width on only one side but for border we usually don't need it.
Code: Select all
[MeterTest]
Meter=Shape
Shape=Rectangle 0.5,0.5,99,49 | Fill Color 00000000 | StrokeWidth 1
Shape2=Rectangle 1,1,98,48 | Fill Color 00000032 | StrokeWidth 0
For thicker borders we can also use strokes:
Code: Select all
Shape=Rectangle (#stroke_width# / 2),(#stroke_width# / 2),(100 - #stroke_width#),(50 - #stroke_width#) | Fill Color 00000000 | StrokeWidth #stroke_width#
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Solved] How to achieve solid 1px border around histograms and barmeters?
Yeah, that seems to work pretty nice. I'm still getting used to the idea of "half-pixels" that DIP introduces...rxtd wrote:Although this one is already solved, I was wondering: wouldn't it be easier solution to use stroke with half-pixel offset? Like this:2017-05-01_19-03-41.pngCode: Select all
[MeterTest] Meter=Shape Shape=Rectangle 0.5,0.5,99,49 | Fill Color 00000000 | StrokeWidth 1 Shape2=Rectangle 1,1,98,48 | Fill Color 00000032 | StrokeWidth 0
Despite stroke with 1 pixel width is usually drawn on 2 real pixels we have set upper left coordinates of shape to half-pixel position so we see exactly one-pixel border around 98*48 pixels area.
For thicker borders we can also use strokes:This solution is less customizable since we can't change stroke width on only one side but for border we usually don't need it.Code: Select all
Shape=Rectangle (#stroke_width# / 2),(#stroke_width# / 2),(100 - #stroke_width#),(50 - #stroke_width#) | Fill Color 00000000 | StrokeWidth #stroke_width#
I think this is the best / correct answer. You win a gold star!
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeterTest1]
Meter=Shape
Shape=Rectangle 0.5,0.5,300,150 | Fill Color 47,47,47,200 | StrokeWidth 1.5 | Stroke Color 255,255,255,255
[MeterTest2]
Meter=Shape
Y=10R
Shape=Rectangle 1,1,300,150 | Fill Color 47,47,47,200 | StrokeWidth 1 | Stroke Color 255,255,255,255
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Solved] How to achieve solid 1px border around histograms and barmeters?
This solution actually looks a lot better than the "aliased" 1px strokes.
Code: Select all
[MeterAllBackground]
Meter=Shape
Shape=Rectangle 0.5,0.5,169,124,12 | Fill Color #BackgroundColor# | StrokeWidth 1.5 | Stroke Color #LabelColor#
W=170
H=125
UpdateDivider=-1
You do not have the required permissions to view the files attached to this post.