It is currently April 26th, 2024, 6:14 pm

how to apply an image to a shape

Get help with creating, editing & fixing problems with skins
kalterstahl20
Posts: 1
Joined: September 5th, 2021, 10:13 am

how to apply an image to a shape

Post by kalterstahl20 »

this is my current shape ini file and i want to add an image that fits into this shape

Code: Select all

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

[FavTile]
Meter=Shape
Shape=Rectangle 0,0,340,340 | Fill Color 50,50,50 | StrokeWidth 0 | Stroke Color 0
my image ini file looks like this but i want it to be in the shape ini file and not having to create an extra ini file

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Bild]
Meter=Image
ImageName=#@#Images\MadMaxCover.png
H=340
W=340
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: how to apply an image to a shape

Post by jsmorley »

kalterstahl20 wrote: September 5th, 2021, 10:16 am this is my current shape ini file and i want to add an image that fits into this shape

Code: Select all

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

[FavTile]
Meter=Shape
Shape=Rectangle 0,0,340,340 | Fill Color 50,50,50 | StrokeWidth 0 | Stroke Color 0
my image ini file looks like this but i want it to be in the shape ini file and not having to create an extra ini file

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Bild]
Meter=Image
ImageName=#@#Images\MadMaxCover.png
H=340
W=340
Have you looked at using Container?

https://docs.rainmeter.net/manual/meters/general-options/container/
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: how to apply an image to a shape

Post by jsmorley »

Code: Select all

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

[MeterShapeAsContainer]
Meter=Shape
; Meters used as a container will not be drawn. They are used as a "mask".
; Be careful that shapes are not drawn outside their meter, or they will
; be truncated when masked. Content is only drawn inside the confines of 
; the container meter's W and H.
Shape=Ellipse 100,100,100 | Fill Color 255,255,255,255 | StrokeWidth 0
Shape2=Ellipse 100,100,20
Shape3=Combine Shape | Exclude Shape2

[MeterImage]
Meter=Image
; This meter will be relative to the starting X and Y of its container.
; Use X and Y to position the image in the container.
X=-43
Y=-85
ImageName=#@#Images\Abbey.jpg
Container=MeterShapeAsContainer

[MeterTitle]
Meter=String
X=100
Y=25
StringAlign=Center
FontSize=12
FontColor=255,255,255,255
FontWeight=600
AntiAlias=1
Text=The Beatles#CRLF#Abbey Road
Container=MeterShapeAsContainer

1.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to apply an image to a shape

Post by balala »

kalterstahl20 wrote: September 5th, 2021, 10:16 am my image ini file looks like this but i want it to be in the shape ini file and not having to create an extra ini file
What jsmorley wanted to say is that you have to add a Container=FavTile option to the [Bild] meter. Unfortnately in your case this doesn1t make too much sense, because the size of the image and the size of the container (in this case the [FavTile] meter) are the same and accordingly you won't see a difference between the two cases (the applied and the not-applied container).
To see such a difference you either have to remove the size options of the [Bild] meter (so remove the H=340 and W=340 options, supposing that the image is larger than 340x340 pixles), or modify slightly the container. For instance apply the following Shape option: Shape=Rectangle 0,0,340,340,100 | Fill Color 50,50,50 | StrokeWidth 0 | Stroke Color 0. In this case the rectangle of the container is rounded a little bit.