It is currently May 8th, 2024, 12:57 pm

Scaling Images used for Bar meters

Report bugs with the Rainmeter application and suggest features.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Scaling Images used for Bar meters

Post by JpsCrazy »

Just as stated, I was suggesting the ability to scale images used as bar meters just as you can scale image meters just by defining an W and H.

Yes, Smurfiers work around for this works, but it's not perfect. The images jump while being cropped - it's just not as clean as the bar meter. Plus it would remove a few unnecessary measures which is always nice.

Code: Select all

[MainCrop]
Measure=Calc
Formula=ActualValue/MaxValue

[Crop]
Measure=Calc
Formula=OriginalWidth*MainCrop

[Bar]
Meter=Image
ImageName=Blah.jpg
ImageCrop=0,0,[Crop],OriginalHeight
H=NewHeight
W=(NewWidth*[MainCrop])
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Scaling Images used for Bar meters

Post by smurfier »

It was a small mention, but I did say something about this in here.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Scaling Images used for Bar meters

Post by jsmorley »

I have no idea if this makes sense or is even possible give how Meter=Bar is designed, but for sure we cannot just change the behavior of W and H as it is now. Those are used now to set the "bounds" within which the image is drawn based on the value being returned by a measure, and we cannot just change the behavior to also "scale" the image without adding a new parameter of some kind that defaults to "off". I personally like that it draws the meter by truncating the image rather than scaling it, and use it on 8 meters in my skins now.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Scaling Images used for Bar meters

Post by smurfier »

I still want it to truncate the image, just scale the image to the bounds of the bar meter before it does so. Otherwise you have to either use my workaround or separate images in order to scale a bar meter using an image to a different size.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Scaling Images used for Bar meters

Post by JpsCrazy »

@Smurfier - My bad, I only searched the forum in topic titles. And for your second post, that's what I want as well.

@JSMorley - Sorry, let me be more clear. I want a image as a bar to be able to be scaled AND THEN be truncated.
So like, you could have an image that's say 100px wide. In an image meter you can make it 200px wide - no problem, just make W=200.
For the bar, you can't do that. You'd need to make a new image that's 200px wide.
Now that's not a problem unless you have a width or height that can be changed.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Scaling Images used for Bar meters

Post by jsmorley »

I see. Yeah, I just use images I make that are the right size to begin with.

Maybe spx will spot this and weigh in. I have no idea what it would take.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Scaling Images used for Bar meters

Post by JpsCrazy »

jsmorley wrote:I see. Yeah, I just use images I make that are the right size to begin with.
Sometimes the size is variable, like for my iTunes Album Artwork Player skin the size is completely customizable. But I can't have an image for whatever size every user will have.
When I tested the skin, I tried the skin with a width of 250px, 500px, and then 750px. All image meters were scaled accordingly, but the bar meter could not be, so I have to use Smurfier's workaround.
It's not always as simple as making it the right size. ;)