It is currently March 28th, 2024, 3:26 pm

Percentual representation of RAM with Image meter

Get help with creating, editing & fixing problems with skins
Post Reply
cemmy
Posts: 3
Joined: December 31st, 2009, 3:34 pm

Percentual representation of RAM with Image meter

Post by cemmy »

I'm coming to you with an odd question. I'm working on a simple skin and for a specific reason (which is completely irrelevant to my question) I want to represent my used RAM as percentage using Meter=Image. I know it's simple with Bar, but that's not what I'm looking for. All I can think of is

Code: Select all

[MeasureRAM]
Measure=PhysicalMemory

[Show]
Meter=Image
H=16
Y=10R
W=[MeasureRAM]
Percentual=1
DynamicVariables=1
SolidColor=255,255,255
but it's not working. Putting Percentual under MeasureRAM doesn't work neither. Can someone provide a solution for this?
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm
Contact:

Re: Percentual representation of RAM with Image meter

Post by poiru »

Here ya go:

Code: Select all

[Show]
Meter=BAR
MeasureName=MeasureRAM
H=16
W=100
Y=10R
BarOrientation=Horizontal
BarColor=255,255,255
cemmy
Posts: 3
Joined: December 31st, 2009, 3:34 pm

Re: Percentual representation of RAM with Image meter

Post by cemmy »

Uhm...
cemmy wrote:I know it's simple with Bar, but that's not what I'm looking for.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Percentual representation of RAM with Image meter

Post by Alex2539 »

This will do it, just change "100" in the Calc to whatever you want the maximum width to be:

Code: Select all

[MeasureRAM]
Measure=PhysicalMemory

[MeasureTotalRAM]
Measure=PhysicalMemory
Total=1

[PercentRAM]
Measure=Calc
Formula=FLOOR((MeasureRAM/MeasureTotalRAM)*100)

[Show]
Meter=Image
H=16
Y=10R
W=[PercentRAM]
DynamicVariables=1
SolidColor=255,255,255
Although, I don't know why you don't want to use a Bar meter for this. All of that does exactly the same thing as this:

Code: Select all

[Bar]
Meter=Bar
MeasureName=MeasureRAM
W=100
H=16
Y=10R
BarColor=255,255,255
BarOrientation=HORIZONTAL
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm
Contact:

Re: Percentual representation of RAM with Image meter

Post by poiru »

cemmy wrote:Uhm...
Oops :Embarrassed: Already booked an appointment with an optician..
cemmy
Posts: 3
Joined: December 31st, 2009, 3:34 pm

Re: Percentual representation of RAM with Image meter

Post by cemmy »

Alex2539 wrote:

Code: Select all

[MeasureRAM]
Measure=PhysicalMemory

[MeasureTotalRAM]
Measure=PhysicalMemory
Total=1

[PercentRAM]
Measure=Calc
Formula=FLOOR((MeasureRAM/MeasureTotalRAM)*100)

[Show]
Meter=Image
H=16
Y=10R
W=[PercentRAM]
DynamicVariables=1
SolidColor=255,255,255
Thank you, that worked perfectly. The reason why I didn't want to use Bar is because I wanted the tip of the line rounded. I'm doing that by making a solid Roundline's X position follow the actual value, and that was impossible using Bar because whatever is filling the Bar's measurement value, it's not proportional to X. I hope that made sense. :D Here's what my desktop looks like now. I got the idea from Kenz0's Linear Clock.

Image
poiru wrote:Oops :Embarrassed: Already booked an appointment with an optician..
Best of luck with that. :D
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Percentual representation of RAM with Image meter

Post by Alex2539 »

cemmy wrote: The reason why I didn't want to use Bar is because I wanted the tip of the line rounded. I'm doing that by making a solid Roundline's X position follow the actual value, and that was impossible using Bar because whatever is filling the Bar's measurement value, it's not proportional to X. I hope that made sense.
It makes sense. Although there are two ways you caould have still used a Bar meter. The first would use the extra measures again to get the value as a percentage which the Roundline meter would use as its X (plus whatever offset might be necessary).

The second way would be to use an image for the bar by adding "BarImage=filename.png" instead of just letting Rainmeter fill it with a colour and add "BarBorder=N". This causes N pixels at the start and the end of the image to always be drawn. This way if you have an complicated image of a bar with stylized or rounded edges, you can preserve them.

That's just future reference though. The way you have it is no worse than those ways. It's all a matter of preference and exactly what you need to be done.

Oh, and that desktop is very slick. Well done. :thumbsu:
Post Reply