It is currently April 19th, 2024, 1:04 am

help substituting words or letters for images.

Get help with creating, editing & fixing problems with skins
Agelyk
Posts: 7
Joined: November 17th, 2015, 1:17 am

help substituting words or letters for images.

Post by Agelyk »

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. :welcome:
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help substituting words or letters for images.

Post by balala »

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. :welcome:
Probably it is:

Code: Select all

[MeasureAMPM]
Measure=Time
Format=%p
Substitute="AM":"#@#ImageForAM.png","PM":"#@#ImageForPM.png"

[MeterImage]
Meter=Image
MeasureName=MeasureAMPM
[MeterImage] will show up either the ImageForAM.png, or the ImageForPM.png image.
Agelyk
Posts: 7
Joined: November 17th, 2015, 1:17 am

Re: help substituting words or letters for images.

Post by Agelyk »

balala wrote:Probably it is:

Code: Select all

[MeasureAMPM]
Measure=Time
Format=%p
Substitute="AM":"#@#ImageForAM.png","PM":"#@#ImageForPM.png"

[MeterImage]
Meter=Image
MeasureName=MeasureAMPM
[MeterImage] will show up either the ImageForAM.png, or the ImageForPM.png image.
Thank you so much, u were very helpful :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help substituting words or letters for images.

Post by balala »

Glad to help.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: help substituting words or letters for images.

Post by xenium »

Hi,
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
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help substituting words or letters for images.

Post by balala »

xenium wrote:I try to replace the text with an image but it does not work.
What is wrong ?
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.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: help substituting words or letters for images.

Post by xenium »

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.
There is the image, but it is not displayed . :confused:
MOON.zip
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help substituting words or letters for images.

Post by balala »

xenium wrote:There is the image, but it is not displayed . :confused:
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.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: help substituting words or letters for images.

Post by xenium »

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.
Now is displayed! :17good
Thank you very much !
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help substituting words or letters for images.

Post by balala »

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.