I would like to replace some text with a specific image. For example in the "CLOCK", when the text AM or PM is replaced by an image instead of the text respectively.
Or replace the climate temperature numbers with some image.
This is possible? , Thanks in advance.
It is currently April 24th, 2024, 4:33 pm
help substituting words or letters for images.
-
- Posts: 7
- Joined: November 17th, 2015, 1:17 am
-
- Rainmeter Sage
- Posts: 16166
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: help substituting words or letters for images.
Probably it is:Agelyk wrote:I would like to replace some text with a specific image. For example in the "CLOCK", when the text AM or PM is replaced by an image instead of the text respectively.
Or replace the climate temperature numbers with some image.
This is possible? , Thanks in advance.
Code: Select all
[MeasureAMPM]
Measure=Time
Format=%p
Substitute="AM":"#@#ImageForAM.png","PM":"#@#ImageForPM.png"
[MeterImage]
Meter=Image
MeasureName=MeasureAMPM
-
- Posts: 7
- Joined: November 17th, 2015, 1:17 am
Re: help substituting words or letters for images.
Thank you so much, u were very helpfulbalala wrote:Probably it is:[MeterImage] will show up either the ImageForAM.png, or the ImageForPM.png image.Code: Select all
[MeasureAMPM] Measure=Time Format=%p Substitute="AM":"#@#ImageForAM.png","PM":"#@#ImageForPM.png" [MeterImage] Meter=Image MeasureName=MeasureAMPM
-
- Rainmeter Sage
- Posts: 16166
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 866
- Joined: January 4th, 2018, 9:52 pm
Re: help substituting words or letters for images.
Hi,
I try to replace the text with an image but it does not work.
What is wrong ?
I try to replace the text with an image but it does not work.
What is wrong ?
Code: Select all
[Rainmeter]
Update=1000
[Variables]
Updaterate=600
[MeasureMoonPercent]
Measure=WebParser
Url=http://iohelix.net/moon/moonlite.xml
RegExp=(?siU)<moon>.*<elongationToSun>.*</elongationToSun>.*<percentIlluminated>(.*)</percentIlluminated>.*<age>.*</age>.*<phase>(.*)</phase>.*<length>.*</length>
UpdateRate=#Updaterate#
StringIndex=1
[MeasureMoonPhase]
Measure=WebParser
Url=[MeasureMoonPercent]
StringIndex=2
[MeasureMoonIcon]
Measure=WebParser
Url=[MeasureMoonPercent]
StringIndex=2
Substitute="Waxing Crescent":"#@#Moon\1.png"
[MeterMoonPhase]
Meter=String
MeasureName=MeasureMoonPhase
X=100
Y=0
W=150
H=14
FontSize=10
FontColor=255,255,255,190
StringStyle=Bold
StringEffect=SHADOW
FontFace=arial
StringAlign=left
FontEffectColor=0,0,0,50
AntiAlias=1
Text="%1"
[MeterMoonIlluminated]
Meter=String
MeasureName=MeasureMoonPercent
X=100
Y=50r
W=150
H=14
FontSize=10
FontColor=255,255,255,190
StringStyle=Bold
StringEffect=SHADOW
FontFace=arial
StringAlign=left
FontEffectColor=0,0,0,50
AntiAlias=1
Text="illuminated: %1 %"
[MeterMoonImage]
Meter=Image
MeasureName=MeasureMoonIcon
X=100
Y=100
-
- Rainmeter Sage
- Posts: 16166
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: help substituting words or letters for images.
Nothing. The requested substitution is made. If the Moon phase is "Waxing Crescent" this is substituted by #@#Moon\1.png. The [MeterMoonImage] Image meter shows up this image, IF IT EXISTS into the Moon folder within the @Resources folder. Make sure you have that image there.xenium wrote:I try to replace the text with an image but it does not work.
What is wrong ?
-
- Posts: 866
- Joined: January 4th, 2018, 9:52 pm
Re: help substituting words or letters for images.
There is the image, but it is not displayed .balala wrote:Nothing. The requested substitution is made. If the Moon phase is "Waxing Crescent" this is substituted by #@#Moon\1.png. The [MeterMoonImage] Image meter shows up this image, IF IT EXISTS into the Moon folder within the @Resources folder. Make sure you have that image there.
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16166
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: help substituting words or letters for images.
It definitely is. But its position makes it invisible, because the image is set up by the value returned by a WebParser measure. In the very first moment when the skin is refreshed the Image meter doesn't have yet an image to show. When the WebParser measure gets its value, the Image meter shows up the appropriate image, but this is outside of the skin's initial surface and that's why it's not visible.xenium wrote:There is the image, but it is not displayed .
To fix just add a DynamicWindowSize=1 option to the [Rainmeter] section.
-
- Posts: 866
- Joined: January 4th, 2018, 9:52 pm
Re: help substituting words or letters for images.
Now is displayed!balala wrote:It definitely is. But its position makes it invisible, because the image is set up by the value returned by a WebParser measure. In the very first moment when the skin is refreshed the Image meter doesn't have yet an image to show. When the WebParser measure gets its value, the Image meter shows up the appropriate image, but this is outside of the skin's initial surface and that's why it's not visible.
To fix just add a DynamicWindowSize=1 option to the [Rainmeter] section.
Thank you very much !
-
- Rainmeter Sage
- Posts: 16166
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: help substituting words or letters for images.
You're welcome.
The missing DynamicWindowSize=1 option is very common mistake on skins working with WebParser measures. These skins usually require this option, because their size changes when the measures get their values.
The missing DynamicWindowSize=1 option is very common mistake on skins working with WebParser measures. These skins usually require this option, because their size changes when the measures get their values.