It is currently April 27th, 2024, 7:49 pm

Bar Meter in odd shapes?

Get help with creating, editing & fixing problems with skins
Gobble45
Posts: 18
Joined: January 10th, 2012, 2:38 am

Bar Meter in odd shapes?

Post by Gobble45 »

Hello,
Sorry if this question has already been asked. I did a quick search and couldnt find anything.
If there is a similar thread, a link to it is enough for me :)

anyways;
What i want is a way to make a CPU/RAM meter, but instead of the metre being in a standard bar, i was thinking some odd shapes, like a lightning bolt? or a Heart? star? etc.
OR
If its possible, make the bar fill a transparent image that i would create myself.

So for example.

CPU: 39% [INSERT LIGHTNING BOLT HERE - ON ITS SIDE]

Any ideas? or is this way out of the capabilities of RainMeter?

Regards
Gobble45

EDIT:
Transparent Image = Outline of shape, and the inside of shape and outside of the shape are transparent.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter in odd shapes?

Post by jsmorley »

Using a shape as the "bar" is certainly possible.

Skin:

Code: Select all

[Rainmeter]
Update=1000

[MeasureCPU]
Measure=CPU

[MeterCPUBarBack]
Meter=Image
ImageName=Images\Key.png
Greyscale=1
ImageAlpha=150

[MeterCPUBar]
Meter=Bar
MeasureName=MeasureCPU
BarOrientation=Horizontal
Flip=0
BarImage=Images\Key.png
W=400
H=149
Image I used:
key.png
Result:
1-9-2012 10-26-59 PM.jpg
What my example does above is to have any image you like used as the "bar", where it will "show" as much of the bar as the value indicates. I placed a colorless copy of the image behind, to give the "fill" effect.

What is not easily possible is to have an irregularly shaped image that has a transparent "middle", and have the bar meter "fill in" the inside of the image. Rainmeter does not have that capability. However, you can get a pretty close effect with how I did it above.
You do not have the required permissions to view the files attached to this post.
Gobble45
Posts: 18
Joined: January 10th, 2012, 2:38 am

Re: Bar Meter in odd shapes?

Post by Gobble45 »

WOW, This is like EXACTLY what i wanted!!

Thanks heaps! Once i finish this first skin (basic CPU meter) i will upload for you to look :D
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter in odd shapes?

Post by jsmorley »

Glad to help.
Gobble45
Posts: 18
Joined: January 10th, 2012, 2:38 am

Re: Bar Meter in odd shapes?

Post by Gobble45 »

Just tested, and my image still shows a "greyscale" background.
My picture's background is transparent though :/

EDIT:
The image wasnt transparent.. the background was a very feint color, looking as if it was transparent -.-

Sorry :(
Gobble45
Posts: 18
Joined: January 10th, 2012, 2:38 am

Re: Bar Meter in odd shapes?

Post by Gobble45 »

Okay, i just realised that i still had
BackgroundMode=2
In my code (copy+pasted from another file).
it now works.

Here is my finished code:
[Rainmeter]
Update=1000
Author=Gobble45
BackgroundMode=2

[MeasureCPUCore1]
Measure=CPU
Processor=1

[MeterCPUCore1Back]
Meter=Image
ImageName=lightningbolt.png
Greyscale=1
ImageAlpha=150

[MeterCPUCore1Front]
Meter=Bar
MeasureName=MeasureCPUCore1
BarOrientation=Horizontal
Flip=0
BarImage=lightningbolt.png
W=144
H=79
You do not have the required permissions to view the files attached to this post.