Image Meter


Meter=Image displays either an image defined by a measure value, or any named image. If W and/or H are included in the meter options, the image will be scaled to fit the meter size.

Note:Supported image formats are .png, .jpg, .bmp, .gif (no animation supported), .tif, .webP and .ico. If no file extension is included, .png is assumed.

Options

General meter options

All general meter options are valid.

General image options

All general image options are valid for ImageName.

MeasureName, MeasureName2, ..., MeasureNameN

Name(s) of the measure(s) bound to the meter. The value of a measure or measures will define the image file to be used in the meter. The value can define a full path and name of any supported image file, or just the name if the ImagePath option is used or the image file is in the current skin folder.

ImageName Default: %1.png

Name of an image file. This can be a full path and name of any supported image file, or just the name of the file if the ImagePath option is used or the image file is in the current skin folder.

Note: If a MeasureNameN option is defined, it will override any named file in the ImageName option. Generally, MeasureNameN and ImageName will not be used together in the same meter.

The exceptions are when MeasureName returns a file name with no extension, and the default .png is not desired, or when ImageName is being used to define an image based on the combined values of the measures in MeasureNameN and uses the %N syntax as follows:

MeasureName=SomeMeasure
MeasureName2=SomeMeasure2
ImageName=%1-%2.png
; %1 and %2 will be replaced by the string values of SomeMeasure and
; SomeMeasure2, respectively.

Note: When ImageName is hard-coded with an image file name, the image will be loaded and "cached", to avoid reloading the image from disk on every meter update. If there is an external process that is changing the image file, while leaving the name the same, use DynamicVariables=1 on the meter to force the image to be reloaded from disk on every meter update.

PreserveAspectRatio Default: 0

Controls how W and H scale the image when Tile=0. Valid values are:

  • 0: The image is scaled to exactly fit the bounds specified by W and H without regard to aspect ratio.
  • 1: The image is scaled to fit within the bounds specified by W and/or H while preserving the aspect ratio.
  • 2: The image is scaled and cropped to fill the bounds specified by W and/or H while preserving the aspect ratio.

Note: If only one of either W or H is defined, then PreserveAspectRatio will default to 1.

ScaleMargins Format: Left, Top, Right, Bottom

Margins of the image to exclude from scaling when Tile=0 and PreserveAspectRatio=0.

Example: ScaleMargins=10, 50, 10, 50

Tile Default: 0

If set to 1, the image is tiled (repeated) within the bounds defined by W and H.

Hint: Using the SolidColor option, along with W and H options, an image meter may be used to draw squares, rectangles or lines without needing any ImageName or MeasureName.

However, no manipulations can be done to the resulting square, rectangle or line with any general image options. Only actual images loaded from a file can be manipulated. (e.g. ImageRotate)

Deprecated Features

The following options have been deprecated and should not be used. They are still supported, but may be removed in future versions.

Example

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Metadata]
Name=ExampleMeterImage
Author=The Rainmeter Team
Information=Example of the Image meter
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.0

[MeterBackground]
Meter=Image
ImageName=#@#Images\Background.jpg
W=200
H=200
GreyScale=1
ImageTint=171,54,3,150

[MeasureMyPictures]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#\Pictures
Subfolders=0
FileFilter=*.jpg;*.gif;*.bmp;*.png
UpdateDivider=10

[MeterShowPicture]
Meter=Image
MeasureName=MeasureMyPictures
X=25
Y=25
W=150
H=150
PreserveAspectRatio=1
LeftMouseUpAction=[!Refresh]

An example skin demonstrating an Image meter.

Mask Image

Note: This MaskImage functionality is better done with the far more powerful and flexible Container option. MaskImage will continue to be supported, but is no longer recommended.

MaskImageName Default: None

Name of an image file to use as a mask for the primary image defined with MeasureName or ImageName. The size and shape of MaskImageName will be used to mask and define the size and shape of the primary image.

MaskImageName can be a full path and name of any supported image file, or just the name of the file if the MaskImagePath option is used, or the image file is in the current skin folder.

If MaskImageName is defined, then W and H define the size of the mask image, and the size of the meter. Whatever is defined as the primary image with ImageName or MeasureName is then masked into the mask image, displaying in any non-transparent areas of MaskImageName using a "fill" method that sizes and crops the image to fit while preserving the aspect ratio.

If either the primary image or mask image has areas of transparency or partial transparency, those "alpha channel" values are applied to the final image. When both images have a shared area with full or partial transparency, the "most transparent" value is applied.

Notes:

MaskImageName cannot be bound to the meter from a measure with MeasureNameN and %1, %2 etc.

If MaskImageName is defined, then ScaleMargins and Tile options cannot be used on the meter.

MaskImagePath Default: None

Folder path where an image is located. (e.g. MaskImagePath=#@#Images\).

MaskImageFlip Default: None

Flips the image. Valid values are None, Horizontal, Vertical or Both.

MaskImageRotate Default: 0.0

Rotates the image by the specified angle in degrees. Negative angles can be used for counter-clockwise rotation.