Yeah I see. That's why designing the image exactly as I need it to be with Photoshop will ease the job. Then Rainmeter will add movement and positionning and actions.balala wrote: ↑May 12th, 2020, 7:53 pm Depends on what you want to use it for. A Shape meter can easily be modified by Rainmeter code, while an image can't be. On the other hand a shape meter which represents an image can be extremely large, as you saw on the posted link, jsmorley's avatar image created as Shape meter requires 10,000 lines. Way too much.
It is currently May 4th, 2024, 3:31 pm
Help: Switching wallpapers with a button
-
- Posts: 231
- Joined: April 24th, 2020, 7:39 pm
- Location: France
Re: Help: Switching wallpapers with a button
-
- Rainmeter Sage
- Posts: 16198
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help: Switching wallpapers with a button
Yep, creating the image through an image manipulation software (such as Photoshop) is definitely easier. But as said, creating a Shape meter has a completely different reason.Mino_el_Nukenin wrote: ↑May 12th, 2020, 7:58 pm Yeah I see. That's why designing the image exactly as I need it to be with Photoshop will ease the job. Then Rainmeter will add movement and positionning and actions.
-
- Rainmeter Sage
- Posts: 7198
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help: Switching wallpapers with a button
Mino_el_Nukenin wrote: ↑May 12th, 2020, 7:22 pm This what I have so far :I can't manage to have the right fitting for the arc, I want it to be perfectly against the stroke then i'll adapt the depth of it.Code: Select all
[MeterShapes] Meter=Shape Shape=Ellipse 90,90,89 | Fill Color 0,0,0 | StrokeWidth 2 | Stroke Color 255,255,255 Shape2=Arc 14,90,90,14,75,75,360,0,0,0 | StrokeWidth 15 | Stroke Color 255,255,255 AntiAlias=1
I strongly disagree - you basically do the same thing in photoshop as in Rainmeter, as you have to create the shape in either program. It's equally "easy" or equally "hard", depending on the shape's complexity.Mino_el_Nukenin wrote: ↑May 12th, 2020, 7:46 pmEDIT : Nevermind the shapes and my actual code, I'll design the shapes I need on Photoshop, that's easier.
This code will do the job you want to, although it might need some small adjustments (mainly due to rounding an odd value divided by 2):
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
---Meters---
[MeterShapes]
Meter=Shape
Shape=Ellipse 90,90,89 | Fill Color 0,0,0 | StrokeWidth 2 | Stroke Color 255,255,255
Shape2=Arc 9,90,90,9,81,81,360,0,0,0 | StrokeWidth 15 | Stroke Color 255,0,0
AntiAlias=1
EDIT: Replaced my initial code after making the needed adjustments. Changed the color to better see the result. So in the end, I had to consider both (15/2)px of the arc outside the shape, but also the (2/2)px of the ellipse inside the shape. That amounted for 7.5+1=8.5px to add or subtract to 0 (for StartX and EndY values) and from 89 (for RadiusX and RadiusY values).
-
- Posts: 231
- Joined: April 24th, 2020, 7:39 pm
- Location: France
Re: Help: Switching wallpapers with a button
Well yeah, now that I'm designing it on Photoshop you right.Yincognito wrote: ↑May 12th, 2020, 8:21 pm I strongly disagree - you basically do the same thing in photoshop as in Rainmeter, as you have to create the shape in either program. It's equally "easy" or equally "hard", depending on the shape's complexity.
Oh yeah the stroke... I took it into account when creating the circle, but forgot it for the arc.This code will do the job you want to, although it might need some small adjustments (mainly due to rounding an odd value divided by 2):
The reason why your attempt didn't produce the expected results is that strokes are drawn one half outside the shape and one half inside. This is why you have to place the arc at about half the size of the stroke width from the ellipse, in order for them to "touch" each other.
Now having an arc of a 1/4 of a circle is easy.
The hard part is to have arcs smaller or bigger than circle 1/4 : to find the X and Y that would be on the same radius.
-
- Rainmeter Sage
- Posts: 7198
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help: Switching wallpapers with a button
It's a bit harder, yes. But using sin() and cos() should help in finding out the right values. If you put everything in a formula and use variables, Rainmeter will do the calculations for you, no need to worry about it.Mino_el_Nukenin wrote: ↑May 12th, 2020, 8:44 pm Well yeah, now that I'm designing it on Photoshop you right.
Oh yeah the stroke... I took it into account when creating the circle, but forgot it for the arc.
Now having an arc of a 1/4 of a circle is easy.
The hard part is to have arcs smaller or bigger than circle 1/4 : to find the X and Y that would be on the same radius.
-
- Posts: 231
- Joined: April 24th, 2020, 7:39 pm
- Location: France
Re: Help: Switching wallpapers with a button
Yes... I just don't remember at all, all these formulas I used to know back in highschool..Yincognito wrote: ↑May 12th, 2020, 8:56 pm It's a bit harder, yes. But using sin() and cos() should help in finding out the right values. If you put everything in a formula and use variables, Rainmeter will do the calculations for you, no need to worry about it.
-
- Rainmeter Sage
- Posts: 7198
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help: Switching wallpapers with a button
Maybe this will help in picturing the whole thing:Mino_el_Nukenin wrote: ↑May 12th, 2020, 9:04 pm Yes... I just don't remember at all, all these formulas I used to know back in highschool..
Multiply the Cos(angle) (for the X) and Sin(angle) (for the Y) by the value of the radius (81 in this case, if I'm not mistaken) and add it to the CenterX and CenterY (90 and 90, i.e. the center of the ellipse) and you're done.
-
- Posts: 231
- Joined: April 24th, 2020, 7:39 pm
- Location: France
Re: Help: Switching wallpapers with a button
Okay this is reactivating some math memories.Yincognito wrote: ↑May 12th, 2020, 9:14 pm Maybe this will help in picturing the whole thing:
Multiply the Cos(angle) (for the X) and Sin(angle) (for the Y) by the value of the radius (81 in this case, if I'm not mistaken) and add it to the CenterX and CenterY (90 and 90, i.e. the center of the ellipse) and you're done.
Let's see if I can come up with a formula in Rainmeter.
EDIT : If I create the formula, it will only will be for one shape. But I'll have several shapes... I don't get how it will work for all of them since they will be relative to each others.
Last edited by Mino_el_Nukenin on May 12th, 2020, 9:43 pm, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 7198
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help: Switching wallpapers with a button
Ok, because I'm already playing with the result of that formula, LOL - and it's really nice.Mino_el_Nukenin wrote: ↑May 12th, 2020, 9:22 pm Okay this is reactivating some math memories.
Let's see if I can come up with a formula in Rainmeter.
Just an advice: try to put things in variables first - it will be much clearer for you (or anybody, for that matter) that way. Then, in the Shape2 option, just devise a formula using the previously created variables.
P.S. I like the created sample so much that I think of adding it into my Rainmeter samples "library". I just love trigonometry, always did. And that again reminds me of my fu... math teacher from high school, who thought I was no good at it.
-
- Posts: 231
- Joined: April 24th, 2020, 7:39 pm
- Location: France
Re: Help: Switching wallpapers with a button
Nice !Yincognito wrote: ↑May 12th, 2020, 9:42 pm Ok, because I'm already playing with the result of that formula, LOL - and it's really nice.
Just an advice: try to put things in variables first - it will be much clearer for you (or anybody, for that matter) that way. Then, in the Shape2 option, just devise a formula using the previously created variables.
P.S. I like the created sample so much that I think of adding it into my Rainmeter samples "library". I just love trigonometry, always did. And that again reminds me of my fu... math teacher from high school, who thought I was no good at it.
Just realized how the arc shape works. It's actually expanding in and out of the ellipse line. I thought it was only expanding out of it. I'm so confused now...