i display several pictures. i use a second image for each to display a border behind them. as the images have different aspect ratios i let them have a fixed height, get the width with a lua script and adjust the with of the image with the border.
Code: Select all
[Rainmeter]
Author=Alex Becherer
AppVersion=2003000
Update=1000
BackgroundMode=1
[Variables]
@Include="#ROOTCONFIGPATH#SETTINGS\variables.inc"
[MeasureGallery1]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="#GalleryPath#"
FileFilter=*.jpg;*.jpeg;*.gif;*.bmp
Subfolders=1
UpdateDivider=300
[MeasureGallery2]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="#GalleryPath#"
FileFilter=*.jpg;*.jpeg;*.gif;*.bmp
Subfolders=1
UpdateDivider=300
[MeasureGallery3]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="#GalleryPath#"
FileFilter=*.jpg;*.jpeg;*.gif;*.bmp
Subfolders=1
UpdateDivider=300
[MeasureGallery4]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="#GalleryPath#"
FileFilter=*.jpg;*.jpeg;*.gif;*.bmp
Subfolders=1
UpdateDivider=300
[MeasureLuaScript]
Measure=Script
ScriptFile=gallery.lua
[MeterBack]
Meter=Image
ImageName=back.png
X=0
Y=0
Hidden=0
[MeterImageBack3]
Meter=Image
ImageName=photo.png
X=83
Y=38
H=96
W=96
Antialias=1
ScaleMargins=10,10,15,15
[MeterImage3]
Meter=Image
MeasureName=MeasureGallery3
X=90
Y=45
Antialias=1
PreserveAspectRatio=1
H=80
[MeterImageBack1]
Meter=Image
ImageName=photo.png
X=23
Y=18
H=96
W=96
Antialias=1
ScaleMargins=10,10,15,15
[MeterImage1]
Meter=Image
MeasureName=MeasureGallery1
X=30
Y=25
Antialias=1
PreserveAspectRatio=1
H=80
[MeterImageBack4]
Meter=Image
ImageName=photo.png
X=46
Y=148
H=96
W=96
Antialias=1
ScaleMargins=10,10,15,15
[MeterImage4]
Meter=Image
MeasureName=MeasureGallery4
X=53
Y=155
Antialias=1
PreserveAspectRatio=1
H=80
[MeterImageBack2]
Meter=Image
ImageName=photo.png
X=93
Y=93
H=96
W=96
Antialias=1
ScaleMargins=10,10,15,15
[MeterImage2]
Meter=Image
MeasureName=MeasureGallery2
X=100
Y=100
Antialias=1
PreserveAspectRatio=1
H=80
Code: Select all
function Update()
Meter = SKIN:GetMeter('MeterImage1')
Width = Meter:GetW()
NewWidth = Width +14
SKIN:Bang('!SetOption', 'MeterImageBack1', 'W', NewWidth)
Meter = SKIN:GetMeter('MeterImage2')
Width = Meter:GetW()
NewWidth = Width +14
SKIN:Bang('!SetOption', 'MeterImageBack2', 'W', NewWidth)
Meter = SKIN:GetMeter('MeterImage3')
Width = Meter:GetW()
NewWidth = Width +14
SKIN:Bang('!SetOption', 'MeterImageBack3', 'W', NewWidth)
Meter = SKIN:GetMeter('MeterImage4')
Width = Meter:GetW()
NewWidth = Width +14
SKIN:Bang('!SetOption', 'MeterImageBack4', 'W', NewWidth)
end
this is all nice with images taken in landscape mode. but images in portrait mode are of course far to small.
i wonder would it be possible to execute different actions depending on the width of a meter. lets say if the width is higher than 80 just proceed as it does now, but if it is smaller then do something different?