First, here is the documentation for both meter types:
Bar meter
Histogram meter
Bar Meter
A Bar meter uses the current value of any measure that returns a percentage, displaying a horizontal or vertical rectangle that is "filled" to the percentage value of the measure. The size of the meter is generally set with the W and H general meter options, and the color of the "bar" is set with BarColor.
So we might use code like this:
Code: Select all
[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1
[MeasureInc]
Measure=Calc
Formula=(MeasureInc + 1) % 101
MinValue=0
MaxValue=100
[MeterBar1]
Meter=Bar
Y=250
MeasureName=MeasureInc
BarColor=95,189,79,255
W=300
H=50
SolidColor=47,47,47,150
BarOrientation=Horizontal
That is nice, but if we use an image, we can get something that is a lot more informative, and is only limited by your creativity and artistic talent.
First, let's create an image to use. You can create this in PhotoShop, or Gimp, or Paint.NET, or any other image editing software you like.
Then we can use BarImage in our code like this:
Code: Select all
[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1
[MeasureInc]
Measure=Calc
Formula=(MeasureInc + 1) % 101
MinValue=0
MaxValue=100
[MeterBar1]
Meter=Bar
Y=250
MeasureName=MeasureInc
BarImage=#@#Images\300x50HorBar.jpg
SolidColor=47,47,47,150
BarOrientation=Horizontal
What the Bar meter does is "reveal" the portion of the image that corresponds to the percentage of the total the Measure you defined in MeasureName is currently at.
The only caveat, is that when you use an image in a Bar meter, you can't define the size of the image (or the meter) using the W and H options for the meter. The bar, and the meter will be the size of the actual image file you are using. So to keep that meter above to the 300 x 50 size the first example was, I created an image with a size of 300 x 50.
It's that simple. You can use any image you want. Something creative you make yourself, or something interesting you find on the internet. Up to you.
Histogram Meter
The same thing will work in a Histogram meter as well. What happens in this case is that the image is again "revealed" to correspond to the percentage value of the measure bound to the meter.
Let's create a slightly different image:
And use PrimaryImage in our code like this:
Code: Select all
[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1
[MeasureRandom]
Measure=Calc
Formula=Random
UpdateRandom=1
UniqueRandom=1
LowBound=0
HighBound=100
MinValue=0
MaxValue=100
UpdateDivider=2
[MeterHist1]
Meter=Histogram
MeasureName=MeasureRandom
PrimaryImage=#@#Images\300x50VerBar.jpg
SolidColor=47,47,47,150
Again, the only caveat, is that when you use an image in a Histogram meter, you can't define the size of the image (or the meter) using the W and H options for the meter. The meter will be the size of the actual image file you are using. So to have that meter be 300 x 50, I created an image with a size of 300 x 50.
Other Notes
In both cases, Bar and Histogram, while you can't use W and H to change the "size" of the meter or image, you can use other general image options to change how the image looks and behaves. Be aware that most of these options have their own variants in the Histogram meter, due to the fact that the meter optionally supports two graphs at once in the meter.
Example Skin
Let's put it all together and use a couple of those image options:
Code: Select all
[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1
[MeasureInc]
Measure=Calc
Formula=(MeasureInc + 1) % 101
MinValue=0
MaxValue=100
[MeasureRandom]
Measure=Calc
Formula=Random
UpdateRandom=1
UniqueRandom=1
LowBound=0
HighBound=100
MinValue=0
MaxValue=100
UpdateDivider=2
[MeterHist1]
Meter=Histogram
MeasureName=MeasureRandom
PrimaryImage=#@#Images\300x50VerBar.jpg
SolidColor=47,47,47,150
[MeterHist2]
Meter=Histogram
MeasureName=MeasureRandom
Y=125
PrimaryImage=#@#Images\300x50VerBar.jpg
PrimaryImageRotate=180
SolidColor=47,47,47,150
Flip=1
[MeterBar1]
Meter=Bar
Y=250
MeasureName=MeasureInc
BarImage=#@#Images\300x50HorBar.jpg
SolidColor=47,47,47,150
BarOrientation=Horizontal
[MeterBar2]
Meter=Bar
MeasureName=MeasureInc
X=310
BarImage=#@#Images\300x50HorBar.jpg
ImageRotate=-90
SolidColor=47,47,47,150
BarOrientation=Vertical

Requires at least the 3.0 release of Rainmeter from http://rainmeter.net.