It is currently April 16th, 2024, 7:50 am

update in BITMAP Meter

Get help with creating, editing & fixing problems with skins
Darth Weber
Posts: 6
Joined: October 5th, 2017, 6:28 am

update in BITMAP Meter

Post by Darth Weber »

Dear Forum,

i am using the BITMAP Meter to display a multiframe (animated) image file. I set update to 100 only to get a smooth animation. It works perfect.

The multiframe image itself changes every 10 Minutes - how can i settup the meter to read the whole image again every 10 min ? I have often older images and need to refresh manually !

Many Thanks,
Darth Weber
User avatar
balala
Rainmeter Sage
Posts: 16141
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: update in BITMAP Meter

Post by balala »

You probably would need a !SetOption bang, to set up again the image assigned to the Bitmap meter, through its BitmapImage option. This should be done once per 10 minutes, if the image changes so.
Probably the following solution is not the best one, but not knowing your code, this is everything I could imagine. Add the following measure to your code:

Code: Select all

[MeasureMinutes]
Measure=Time
Format=%M
IfCondition=(#CURRENTSECTION#%10=0)
IfTrueAction=[!SetOption MeterBitmap BitmapImage "ADD HERE THE PATH OF THE IMAGE, AS SAME AS YOU HAVE IT IN THE BITMAPIMAGE OPTION OF THE METERBITMAP METER"][!UpdateMeter "MeterBitmap"][!Redraw]
Take care the followings:
  • In the above measure, modify the MeterBitmap parameter to the name of your Bitmap meter.
  • In the BitmapMeter meter you have a BitmapImage option, where you can find the path and name of the file used in the animation. Add the same value (the same path and image name) as the last (third) parameter of the above !SetOption bang.
The basic idea is the following: when the amount of current minutes changes to a value divisible with 10, the measure executes the IfTrueAction. The !SetOption bang of this option will set again the same, but in the meantime changed, image to the Bitmap meter, so the image will be re-read and you'll see the animation of the new image.
Darth Weber
Posts: 6
Joined: October 5th, 2017, 6:28 am

Re: update in BITMAP Meter

Post by Darth Weber »

Thanks, that helps a lot. SInce my images are build by an extra program on a different server: Is there any way to trigger that refresh by an http request ?

The building of images takes a while - a refresh during the builing of the images leads to currepted images in rainmeter.

My idea is now that my external program triggers rainmeter to refresh - if there is any way ?
User avatar
balala
Rainmeter Sage
Posts: 16141
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: update in BITMAP Meter

Post by balala »

Darth Weber wrote:My idea is now that my external program triggers rainmeter to refresh - if there is any way ?
Yeah, I think there is. According to the help
Bangs can also be used from the Windows command line as a parameter to the Rainmeter.exe executable. Example: "C:\Program Files\Rainmeter\Rainmeter.exe" !RefreshApp.
So, this is what you should use for a refresh, in your program.
Darth Weber
Posts: 6
Joined: October 5th, 2017, 6:28 am

Re: update in BITMAP Meter

Post by Darth Weber »

:jawdrop Many Thanks, thats what i was looking for :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16141
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: update in BITMAP Meter

Post by balala »

Glad to help.