It is currently April 28th, 2024, 4:33 am

Fast changing PNG's with transparencies

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

Here is the bare bones of how I would attack getting the images and the animation:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureAniImages]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/IDR023.loop.shtml
RegExp="(?siU)theImageNames =.*\[0\] = "(.*)".*\[1\] = "(.*)".*\[2\] = "(.*)".*\[3\] = "(.*)".*\[4\] = "(.*)".*\[5\] = "(.*)""

[MeasureAniImage1]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=1
Download=1
DownloadFile=Image1.png

[MeasureAniImage2]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=2
Download=1
DownloadFile=Image2.png

[MeasureAniImage3]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=3
Download=1
DownloadFile=Image3.png

[MeasureAniImage4]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=4
Download=1
DownloadFile=Image4.png

[MeasureAniImage5]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=5
Download=1
DownloadFile=Image5.png

[MeasureAniImage6]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=6
Download=1
DownloadFile=Image6.png

[MeasureBackImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/IDR023.background.png
Download=1

[MeasureLocImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/IDR023.locations.png
Download=1

[MeasureRangeImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/IDR023.range.png
Download=1

[MeasureTopoImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/IDR023.topography.png
Download=1

[MeterBackImage]
Meter=Image
MeasureName=MeasureBackImage

[MeterTopoImage]
Meter=Image
MeasureName=MeasureTopoImage

[MeterLocImage]
Meter=Image
MeasureName=MeasureLocImage

[MeterRangeImage]
Meter=Image
MeasureName=MeasureRangeImage

[MeasureCounter]
Measure=Calc
Formula=(MeasureCounter % 6) + 1

[MeterAniImage]
Meter=Image
ImageName=DownloadFile\Image[MeasureCounter].png
DynamicVariables=1
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:Here is the bare bones of how I would attack getting the images and the animation
That's awesome, you make it look so easy!

Is there a simple control (Measure/Bang?) I can put on the main weather skin to unload/load the Radar skin. I'm thinking of an image that I could toggle as the Radar is only really useful when it's actually raining (or about to).
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

kanine wrote: That's awesome, you make it look so easy!

Is there a simple control (Measure/Bang?) I can put on the main weather skin to unload/load the Radar skin. I'm thinking of an image that I could toggle as the Radar is only really useful when it's actually raining (or about to).
I would put the radar stuff in its own skin (.ini) in a different folder:

Skins\MyWeather\MainWeather\MainWeather.ini
Skins\MyWeather\Radar\Radar.ini

Then in the MainWeather.ini you can create an image meter or whatever you want that will use:

LeftMouseUpAction=!ToggleConfig MyWeather\Radar Radar.ini
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:Then in the MainWeather.ini you can create an image meter or whatever you want that will use:

LeftMouseUpAction=!ToggleConfig MyWeather\Radar Radar.ini
Awesome, I've made some minor mods to the skin and put some variables in for the radar size and perspective (ie the radars position), reduced the frequency of polling to 20 minutes which should be sufficient as each poll covers a 30 minute period.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
RadarImageSize=350
RadarPerspective=IDR023

[MeasureAniImages]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/#RadarPerspective#.loop.shtml
RegExp="(?siU)theImageNames =.*\[0\] = "(.*)".*\[1\] = "(.*)".*\[2\] = "(.*)".*\[3\] = "(.*)".*\[4\] = "(.*)".*\[5\] = "(.*)""
UpdateRate=1200

[MeasureAniImage1]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=1
Download=1
DownloadFile=Image1.png

[MeasureAniImage2]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=2
Download=1
DownloadFile=Image2.png

[MeasureAniImage3]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=3
Download=1
DownloadFile=Image3.png

[MeasureAniImage4]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=4
Download=1
DownloadFile=Image4.png

[MeasureAniImage5]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=5
Download=1
DownloadFile=Image5.png

[MeasureAniImage6]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au[MeasureAniImages]
StringIndex=6
Download=1
DownloadFile=Image6.png

[MeasureLegend]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/IDR.legend.0.png
Download=1

[MeasureBackImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/#RadarPerspective#.background.png
Download=1

[MeasureLocImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/#RadarPerspective#.locations.png
Download=1

[MeasureRangeImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/#RadarPerspective#.range.png
Download=1

[MeasureTopoImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/#RadarPerspective#.topography.png
Download=1

[MeterBackLegend]
Meter=Image
MeasureName=MeasureLegend
PreserveAspectRatio=1
W=#RadarImageSize#

[MeterBackImage]
Meter=Image
MeasureName=MeasureBackImage
PreserveAspectRatio=1
W=#RadarImageSize#

[MeterTopoImage]
Meter=Image
MeasureName=MeasureTopoImage
PreserveAspectRatio=1
W=#RadarImageSize#

[MeterLocImage]
Meter=Image
MeasureName=MeasureLocImage
PreserveAspectRatio=1
W=#RadarImageSize#

[MeterRangeImage]
Meter=Image
MeasureName=MeasureRangeImage
PreserveAspectRatio=1
W=#RadarImageSize#

[MeasureCounter]
Measure=Calc
Formula=(MeasureCounter % 6) + 1
PreserveAspectRatio=1
W=#RadarImageSize#

[MeterAniImage]
Meter=Image
ImageName=DownloadFile\Image[MeasureCounter].png
DynamicVariables=1
PreserveAspectRatio=1
W=#RadarImageSize#
I will experiment with pulling in the radar perspective from the settings that are made in the general weather skin and then I think this is a wrap. For now.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

[MeasureCounter]
Measure=Calc
Formula=(MeasureCounter % 6) + 1
PreserveAspectRatio=1
W=#RadarImageSize#


Those option have no effect or purpose on a Calc measure.
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote: Those option have no effect or purpose on a Calc measure.
Ooops...

This is the finished product, the toggle is next to the Last Update Text.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

Looking good.
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:Looking good.
Hit a snag with the config subsitutions though for example this combination isn't returning anything...

Code: Select all

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
CodePage=1252
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>.*"
StringIndex=1

[MeasureBackImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies/[MeasureRadarLocation].background.png
Download=1

[MeterBackImage]
Meter=Image
MeasureName=MeasureBackImage
PreserveAspectRatio=1
W=#RadarImageSize#

The relevant part of the calculations file is.

Code: Select all

<RadarLocation>IDR023</RadarLocation>
<LastUpdate>3/07/2012 11:35:33 PM</LastUpdate>
I've confirmed that MeasureRadarLocation gets set to IDR023
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

I've confirmed that MeasureRadarLocation gets set to IDR023
So what is the snag?
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote: So what is the snag?
For some reason MeasureRadarLocation is getting set to :<RadarLocation>IDR023</RadarLocation>

So the URLs for the background images aren't resolving

Code: Select all

[MeasureRadarConfig]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>"

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRadarConfig]
String=1
Got to be something simple