It is currently April 20th, 2024, 12:39 am

|help| Changing image using hwinfo data

Get help with creating, editing & fixing problems with skins
RicardoTM
Posts: 253
Joined: December 28th, 2022, 9:30 pm
Location: México

|help| Changing image using hwinfo data

Post by RicardoTM »

Hi, Im pretty new to rainmeter and I'm trying to make a skin that lets me use the gauge I designed to use in Aida64. In Aida64 you can make an image with 15 states to use it as a gauge, I want to do the same but here in rainmeter using hwinfo. So far I've been able to load the 15 states but with no luck to make it functional.

To clarify, I want the skin to change the image according to a temperature from 0 to 100 degrees being state0.png = 0 degrees and state15.png =100 degrees.

The gauge will have the actual temperature at the center and the meter will be increasing at the same time.

I couldn't even make the text to change, I tried using the hwinfo tutorial but no luck either

If someone could point me to the right direction I would extremely appreciate, I'm super new to coding.

Thank you.

Edit:

Here's the code I have so far:

Code: Select all

[Rainmeter]	
Update=1000
AccurateText=1
DynamicWindowSize=1

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]

CPUNameIndex=0
CPU0SpeedIndex=1
CPUUsageIndex=0
CPUTempIndex=5
CPUFanIndex=7
GPUNameIndex=9
GPUTempIndex=9
GPUFanIndex=10

[MeasureGPUTempValue]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#GPUTempIndex#

fontName=HelveticaNeueLT Std
textSize=20
colorBar=235,170,0,0
colorText=255,255,255,

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,
FontColor=#colorText#
FontFace=#fontName#
FontSize=40
AntiAlias=1

[MeterGauge0]
Meter=Image
ImageName=#@#Images\states\0.png
W=340
H=340
X=0	
Y=0

[MeterGauge1]
Meter=Image
ImageName=#@#Images\states\1.png
W=340
H=340
X=0	
Y=0

[MeterGauge2]
Meter=Image
ImageName=#@#Images\states\2.png
W=340
H=340
X=0	
Y=0

[MeterGauge3]
Meter=Image
ImageName=#@#Images\states\3.png
W=340
H=340
X=0	
Y=0

[MeterGauge4]
Meter=Image
ImageName=#@#Images\states\4.png
W=340
H=340
X=0	
Y=0

[MeterGauge5]
Meter=Image
ImageName=#@#Images\states\5.png
W=340
H=340
X=0	
Y=0

[MeterGauge6]
Meter=Image
ImageName=#@#Images\states\6.png
W=340
H=340
X=0	
Y=0

[MeterGauge7]
Meter=Image
ImageName=#@#Images\states\7.png
W=340
H=340
X=0	
Y=0

[MeterGauge8]
Meter=Image
ImageName=#@#Images\states\8.png
W=340
H=340
X=0	
Y=0

[MeterGauge9]
Meter=Image
ImageName=#@#Images\states\9.png
W=340
H=340
X=0	
Y=0

[MeterGauge10]
Meter=Image
ImageName=#@#Images\states\10.png
W=340
H=340
X=0	
Y=0

[MeterGauge11]
Meter=Image
ImageName=#@#Images\states\11.png
W=340
H=340
X=0	
Y=0

[MeterGauge12]
Meter=Image
ImageName=#@#Images\states\12.png
W=340
H=340
X=0	
Y=0

[MeterGauge13]
Meter=Image
ImageName=#@#Images\states\13.png
W=340
H=340
X=0	
Y=0

[MeterGauge14]
Meter=Image
ImageName=#@#Images\states\14.png
W=340
H=340
X=0	
Y=0

[MeterGauge15]
Meter=Image
ImageName=#@#Images\states\15.png
W=340
H=340
X=0	
Y=0

[MeterGpuTemp]
Meter=String
MeterStyle=styleTitle
MeasureName=MeasureGPUTemp
X=168
Y=135
AnchorX=50%
AnchorY=50%
Text=%1
DynamicVariables=1

[meterTitle1]
Meter=String
MeterStyle=styleTitle
X=170
Y=237
AnchorX=50%
AnchorY=50%
Text=GPU
FontSize=25
Here is how it looks like:
SharedScreenshot2.jpg
Here is how I want it to look like (this is from Aida64):
SharedScreenshot.jpg
As you can tell, I couldn't even make the text to change according to the hwinfo values.

Edit2:

So I ended up rewriting it and now it measures the temp, but I still don't have any idea of how to make the images change lol

The code looks like this now

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
GPUTempIndex=9

[StyleText]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,
AntiAlias=1

[MeasureGPUTempValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWINFO64\VSB
RegValue=ValueRaw#GPUTempIndex#

[MeterString]
Meter=String

[MeterGauge0]
Meter=Image
ImageName=#@#Images\states\0.png
W=340
H=340
X=0	
Y=0

[MeterGauge1]
Meter=Image
ImageName=#@#Images\states\1.png
W=340
H=340
X=0	
Y=0

[MeterGauge2]
Meter=Image
ImageName=#@#Images\states\2.png
W=340
H=340
X=0	
Y=0

[MeterGauge3]
Meter=Image
ImageName=#@#Images\states\3.png
W=340
H=340
X=0	
Y=0

[MeterGauge4]
Meter=Image
ImageName=#@#Images\states\4.png
W=340
H=340
X=0	
Y=0

[MeterGauge5]
Meter=Image
ImageName=#@#Images\states\5.png
W=340
H=340
X=0	
Y=0

[MeterGauge6]
Meter=Image
ImageName=#@#Images\states\6.png
W=340
H=340
X=0	
Y=0

[MeterGauge7]
Meter=Image
ImageName=#@#Images\states\7.png
W=340
H=340
X=0	
Y=0

[MeterGauge8]
Meter=Image
ImageName=#@#Images\states\8.png
W=340
H=340
X=0	
Y=0

[MeterGauge9]
Meter=Image
ImageName=#@#Images\states\9.png
W=340
H=340
X=0	
Y=0

[MeterGauge10]
Meter=Image
ImageName=#@#Images\states\10.png
W=340
H=340
X=0	
Y=0

[MeterGauge11]
Meter=Image
ImageName=#@#Images\states\11.png
W=340
H=340
X=0	
Y=0

[MeterGauge12]
Meter=Image
ImageName=#@#Images\states\12.png
W=340
H=340
X=0	
Y=0

[MeterGauge13]
Meter=Image
ImageName=#@#Images\states\13.png
W=340
H=340
X=0	
Y=0

[MeterGauge14]
Meter=Image
ImageName=#@#Images\states\14.png
W=340
H=340
X=0	
Y=0

[MeterGauge15]
Meter=Image
ImageName=#@#Images\states\15.png
W=340
H=340
X=0	
Y=0

[MeterText]
Meter=String
MeterStyle=StyleText
x=170
y=140
MeasureName=MeasureGPUTempValueRaw
Text=%1 
FontSize=40
FontColor=255,255,255
fontName=HelveticaNeueLT Std

[MeterTextGpu]
Meter=String
MeterStyle=StyleText
x=170
y=240
Text=GPU
FontSize=28
FontColor=255,255,255
fontName=HelveticaNeueLT Std
It now looks like this:
SharedScreenshot3.jpg
Any idea of how can I make it to avoid using decimals?
You do not have the required permissions to view the files attached to this post.
Last edited by RicardoTM on December 29th, 2022, 7:45 pm, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: |help| Changing image using hwinfo data

Post by eclectic-tech »

To set the number of decimals in your display, you can use a Section Variable rather than a 'Measurename' bound to the string meter. Note DynamicVariables=1 is required on a meter using Section Variables.

Code: Select all

[MeterText]
Meter=String
MeterStyle=StyleText
x=170
y=140
; MeasureName=MeasureGPUTempValueRaw
Text=[MeasureGPUTempValueRaw:0]
FontSize=40
FontColor=255,255,255
fontName=HelveticaNeueLT Std
DynamicVariables=1

To look at your image gauge, we would need a skin package (code, image, etc.) posted here to test.
To create one to post here, follow the steps in Distributing skins.
RicardoTM
Posts: 253
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: |help| Changing image using hwinfo data

Post by RicardoTM »

eclectic-tech wrote: December 29th, 2022, 5:58 am To set the number of decimals in your display, you can use a Section Variable rather than a 'Measurename' bound to the string meter. Note DynamicVariables=1 is required on a meter using Section Variables.

Code: Select all

[MeterText]
Meter=String
MeterStyle=StyleText
x=170
y=140
; MeasureName=MeasureGPUTempValueRaw
Text=[MeasureGPUTempValueRaw:0]
FontSize=40
FontColor=255,255,255
fontName=HelveticaNeueLT Std
DynamicVariables=1

To look at your image gauge, we would need a skin package (code, image, etc.) posted here to test.
To create one to post here, follow the steps in Distributing skins.
Thank you so much, that worked!

Sure, here's the package:
Gauge_.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: |help| Changing image using hwinfo data

Post by eclectic-tech »

You do not show how you determine the 15 levels of temperature.
You will need to create a calc measure with a formula that generates a value of 0 to 15 based on your GPU temperature range.
Once you have that, use that value in the image meter to display the corresponding level.

A rough example:

Code: Select all

; Returns 0 to 15 as its value
[MeasureGPUTempValueOf15]
Measure=Calc
Formula=(?)
DynamicVariables=1

[MeterGauge0]
Meter=Image
ImageName=#@#Images\states\[MeasureGPUTempValueof15:0].png
W=340
H=340
X=0	
Y=0
DynamicVariables=1

It is getting late, so I will look at this again tomorrow if you still need help.
RicardoTM
Posts: 253
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: |help| Changing image using hwinfo data

Post by RicardoTM »

eclectic-tech wrote: December 29th, 2022, 6:52 am You do not show how you determine the 15 levels of temperature.
You will need to create a calc measure with a formula that generates a value of 0 to 15 based on your GPU temperature range.
Once you have that, use that value in the image meter to display the corresponding level.

A rough example:

Code: Select all

; Returns 0 to 15 as its value
[MeasureGPUTempValueOf15]
Measure=Calc
Formula=(?)
DynamicVariables=1

[MeterGauge0]
Meter=Image
ImageName=#@#Images\states\[MeasureGPUTempValueof15:0].png
W=340
H=340
X=0	
Y=0
DynamicVariables=1

It is getting late, so I will look at this again tomorrow if you still need help.
After some thinking I come up with the formula
([MeasureGPUTempValueRaw]/(100/16))
and now it works as intented! Thank you very much! Now I can go to sleep in peace lol

here's the final code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
GPUTempIndex=9

[StyleText]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,
AntiAlias=1

[MeasureGPUTempValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWINFO64\VSB
RegValue=ValueRaw#GPUTempIndex#

[MeasureGPUTempValueOf15]
Measure=Calc
Formula=([MeasureGPUTempValueRaw]/(100/16))
DynamicVariables=1


[MeterGauge0]
Meter=Image
ImageName=#@#Images\states\[MeasureGPUTempValueof15:0].png
W=340
H=340
X=0	
Y=0
DynamicVariables=1

[MeterText]
Meter=String
MeterStyle=StyleText
x=170
y=140
Text=[MeasureGPUTempValueRaw:0]
FontSize=40
FontColor=255,255,255
fontName=HelveticaNeueLT Std
DynamicVariables=1

[MeterTextGpu]
Meter=String
MeterStyle=StyleText
x=170
y=240
Text=GPU
FontSize=28
FontColor=255,255,255
fontName=HelveticaNeueLT Std
Thank you again, it looks nice now!
SharedScreenshot3.jpg
Now I'll investigate how to make it resizable, but that will be tomorrow.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: |help| Changing image using hwinfo data

Post by eclectic-tech »

Happy to help.
If you need more help, this forum has many knowledgeable members willing to suggest solutions. :welcome:
RicardoTM
Posts: 253
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: |help| Changing image using hwinfo data

Post by RicardoTM »

eclectic-tech wrote: December 29th, 2022, 12:04 pm Happy to help.
If you need more help, this forum has many knowledgeable members willing to suggest solutions. :welcome:
Thank you bro, you were really helpful, now I'll investigate about doing it resizable, I found a skin that has the functionality I want, so I'll check the code and see what I can do with reverse engineering. If any problem surges sure I'll create another thread for that topic.

Thank you again!