It is currently September 16th, 2024, 10:06 pm
Thread for help with the Shape meter
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Thread for help with the Shape meter
Please use this thread, or start a new one here in "Help Rainmeter Skins" if you have questions about or need help with the new Shape Meter.
-
- Posts: 588
- Joined: February 28th, 2011, 3:20 pm
- Location: Vienna, Austria
Re: Thread for help with the new Shape meter
Hi!
I just started with a very basic shape - a 10x10 square with this code:
and got this picture (magnified):
I see a 11x11 square. What's the gray area on the right and at the bottom?
Is it ok to be there?
regards,
ikarus1969
I just started with a very basic shape - a 10x10 square with this code:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Meter_Shape]
Meter=SHAPE
Shape=Rectangle #WORKAREAX#, #WORKAREAY#, 10, 10 | Fill Color 128, 0, 0
Is it ok to be there?
regards,
ikarus1969
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
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. I'm sure that is what you are seeing.ikarus1969 wrote:Hi!
I just started with a very basic shape - a 10x10 square with this code:and got this picture (magnified):Code: Select all
[Rainmeter] Update=1000 AccurateText=1 [Meter_Shape] Meter=SHAPE Shape=Rectangle #WORKAREAX#, #WORKAREAY#, 10, 10 | Fill Color 128, 0, 0
Screenshot Shape very basic.png
I see a 11x11 square. What's the gray area on the right and at the bottom?
Is it ok to be there?
regards,
ikarus1969
The reason you are getting that on the "right" and "bottom", and not the "top"and "left", is that you have your meter, and thus the skin, set to the far left and top of the workarea. In fact, the stroke is being "truncated" by half a pixel on the top and left... If you set it to be (#WORKAREAX# + 1) or use X=1 on the meter itself, you should see the aliasing all the way around it.
Try it with StrokeWidth=2 and see if that doesn't go away.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
Code: Select all
[MeterShape]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,100,100 | StrokeWidth 1 | Fill Color 255,0,0,255
Code: Select all
[MeterShape]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,100,100 | StrokeWidth 2 | Fill Color 255,0,0,255
You do not have the required permissions to view the files attached to this post.
-
- Posts: 826
- Joined: November 20th, 2012, 11:58 pm
Re: Thread for help with the new Shape meter
So jsmorley, is it normal to have a small space between a meter=shape and a meter=image?
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Meter_Shape]
Meter=SHAPE
Shape=Rectangle #WORKAREAX#, #WORKAREAY#, 500, 500 | Fill Color 128, 0, 0
[MeterImage]
Meter=Image
X=0R
Y=0
W=500
H=500
SolidColor=128,0,0,255
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
I'm sure that is related to D2D doing those "half pixels" on odd-numbered StrokeWidth, which while they display fine, Rainmeter, that only understands "full pixels" doesn't quite know what to do with half a pixel.FreeRaider wrote:So jsmorley, is it normal to have a small space between a meter=shape and a meter=image?shape.png
Code: Select all
[Rainmeter] Update=1000 AccurateText=1 [Meter_Shape] Meter=SHAPE Shape=Rectangle #WORKAREAX#, #WORKAREAY#, 500, 500 | Fill Color 128, 0, 0 [MeterImage] Meter=Image X=0R Y=0 W=500 H=500 SolidColor=128,0,0,255 AntiAlias=1
Again, if you use even-numbered StrokeWidth's this TINY issue shouldn't be there.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
Code: Select all
[MeterShape]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,100,100 | StrokeWidth 2 | Fill Color 255,0,0,255
[MeterImage]
Meter=Image
X=0R
W=100
H=100
SolidColor=255,0,0,255
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
It's important to wrap your head around the fact that a "stroke" is not in any way a "border", inside or outside the shape. It IS the shape. The "red" color in those examples are a "fill" of the shape defined by the "stroke".
The stroke is "centered" on the pixel(s) you are drawing on. That is why with a StrokeWidth of 1 or 3 or 5, D2D says:
"Ok, I need half of the stroke inside the singularity that defines the drawing line, and half outside. Wait! If I can't divide the StrokeWidth evenly by "2", it can't evenly be half in and half out. Ah, I know, I'll do a half-pixel inside, and a half-pixel outside". Hm..How to do that... I know, I'll "alias" the edge of the pixels, and then just lie to the application and tell it the stroke is 1 or 3 or 5. It will never know the difference."
That is why you are getting what "looks like" a half-pixel gap in your image. It's really a full pixel just half-aliased.
The stroke is "centered" on the pixel(s) you are drawing on. That is why with a StrokeWidth of 1 or 3 or 5, D2D says:
"Ok, I need half of the stroke inside the singularity that defines the drawing line, and half outside. Wait! If I can't divide the StrokeWidth evenly by "2", it can't evenly be half in and half out. Ah, I know, I'll do a half-pixel inside, and a half-pixel outside". Hm..How to do that... I know, I'll "alias" the edge of the pixels, and then just lie to the application and tell it the stroke is 1 or 3 or 5. It will never know the difference."
That is why you are getting what "looks like" a half-pixel gap in your image. It's really a full pixel just half-aliased.
-
- Posts: 826
- Joined: November 20th, 2012, 11:58 pm
Re: Thread for help with the new Shape meter
The problem is that from your picture, it is clear that the rectangle on the left has a greater height of the rectangle to the right (and I image the same thing for the width).
P.S.:I do not want to be controversial, I really appreciate your work.
P.S.:I do not want to be controversial, I really appreciate your work.
You do not have the required permissions to view the files attached to this post.
Last edited by FreeRaider on November 7th, 2016, 10:13 pm, edited 1 time in total.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Thread for help with the new Shape meter
Yep. the half of the StrokeWidth that is "outside" the drawing line will increase the overall size of the result.FreeRaider wrote:The problem is that from your picture, it is clear that the rectangle on the left has a greater height of the rectangle to the right (and I image the same thing for the width).
height.png
I have StrokeWidth=2, so with half the stroke in and half the stroke out, that means the overall size of the result is 2 pixels larger. 1 on the left and one on the right... One on the top and one on the bottom.
Do it with StrokeWidth=0, and you will see that the shapes are the same size.
Code: Select all
[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,100,100 | StrokeWidth 0 | Fill Color 255,0,0,255
[MeterImage]
Meter=Image
X=0R
W=100
H=100
SolidColor=255,0,0,255