It is currently May 17th, 2024, 5:15 am

A basic "?" and a "...did I do this right"?

Get help with creating, editing & fixing problems with skins
CybOrSpasm
Posts: 146
Joined: January 8th, 2011, 7:12 pm
Location: Tennessee

A basic "?" and a "...did I do this right"?

Post by CybOrSpasm »

First of all, was wondering from a CPU standpoint, is it more efficient on a simple meter to use Update=30000 or Update=1000 and then an UpdateDivider=30 on the Measure?

Secondly, the following code does work as intended. However, there is a very disturbing flicker if the mouse is moved at all while over the displayed image ([MeterPicture])... In other words, The mouse enters the picture area, the picture disappears, the text for the memory readout appears fine, but the slightestmovement of the mouse causes the underlying picture to flash through for each pixel you cross over, until you stop moving the mouse. };] I am not ruling out a very crappy on board video card, but thought I would have you code monkeys look and see if I was doing something stupid as usual! };]

Code: Select all

[Rainmeter]
Update=1000

####################################

[Variables]
Path1=H:\
Path2=C:\Graphics\Pics\
Frame=#@#\Frame1Horizontal-5-3-250x150.png

####################################

[ImageStyle]
X=59
Y=47
W=250
H=150
SolidColor=0,0,0
PreserveAspectRatio=1

[TextStyle]
Font=Arial
FontSize=14
FontColor=0,255,255
SolidColor=0,0,0

####################################

[MeasureGetImage]
Measure=Plugin
Plugin=QuotePlugin
PathName=#Path1#
FileFilter=*.jpg;*.png
UpdateDivider=10

[MeasurePhysMemTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=3600

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasurePhysMemFree]
Measure=PhysicalMemory
InvertMeasure=1
UpdateDivider=2

####################################

[MeterBackground]
Meter=IMAGE
MeterStyle=ImageStyle

[MeterMemText]
Meter=String
MeasureName=MeasurePhysMemTotal
MeasureName2=MeasurePhysMemUsed
MeasureName3=MeasurePhysMemFree
NumOfDecimals=1
AutoScale=1
MeterStyle=TextStyle | ImageStyle
Text="RAM Total: %1B#CRLF#RAM Used: %2B#CRLF#RAM Free: %3B"
Hidden=1

[MeterPicture]
Meter=Image
MeasureName=MeasureGetImage
MeterStyle=ImageStyle
MouseOverAction=[!HideMeter MeterPicture][!ShowMeter MeterMemText][!Redraw]
MouseLeaveAction=[!ShowMeter MeterPicture][!HideMeter MeterMemText][!Redraw]

[MeterFrame]
Meter=IMAGE
ImageName=#Frame#
W=379
H=253
MiddleMouseUpAction=[!WriteKeyValue "Variables" "Path1" "#Path2#"][!WriteKeyValue "Variables" "Path2" "#Path1#"][!Refresh]
LeftMouseUpAction=!Refresh
DynamicVariables=1
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: A basic "?" and a "...did I do this right"?

Post by Kaelri »

CybOrSpasm wrote:First of all, was wondering from a CPU standpoint, is it more efficient on a simple meter* to use Update=30000 or Update=1000 and then an UpdateDivider=30 on the Measure?
Technically, Update=30000 would be better for your CPU. With Update=1000, the skin still performs the "update" procedure once per second, even if no meters or measures are actually being updated. This includes fully redrawing the skin, so if you have any large images, a higher Update is worth considering. However, for most skins, you will not perceive any difference between the two methods. I tend to prefer keeping Update at 1000 and setting UpdateDividers where needed, because it reduces the amount of code that I have to change in case I want to add or remove some part of the skin.

CybOrSpasm wrote:Secondly, the following code does work as intended. However, there is a very disturbing flicker if the mouse is moved at all while over the displayed image ([MeterPicture])... In other words, The mouse enters the picture area, the picture disappears, the text for the memory readout appears fine, but the slightestmovement of the mouse causes the underlying picture to flash through for each pixel you cross over, until you stop moving the mouse. };] I am not ruling out a very crappy on board video card, but thought I would have you code monkeys look and see if I was doing something stupid as usual! };]
This is happening because you have your MouseLeaveAction on the same meter that you are hiding with your MouseOverAction. Every time you move your mouse, Rainmeter detects that the mouse has "left" the meter, which causes it to show the meter; then, it detects that the mouse is "over" the meter, which causes it to hide again. This cycle is repeated with each movement your mouse makes, and it happens so quickly that it appears to be a "flicker."

A better solution would be to have your MouseOverAction hide [MeterPicture] and show [MeterBackground], and have a MouseLeaveAction on [MeterBackgroud] that does the opposite. That way, there is never a conflict.
CybOrSpasm
Posts: 146
Joined: January 8th, 2011, 7:12 pm
Location: Tennessee

Re: A basic "?" and a "...did I do this right"?

Post by CybOrSpasm »

Okay, thank you Kaelri for the explanation. I appreciate your time!