Hi
Is it possible to center align an image around an x,y coordinate? Or can you only set the coordinate of the top-left corner of the image?
Thanks in advance!
It is currently April 25th, 2024, 4:22 pm
Center aligning an image
-
- Posts: 24
- Joined: August 20th, 2020, 8:49 pm
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Center aligning an image
Yes, it's possible, you just have to use formulas for X and Y:bravo-lemur wrote: ↑August 23rd, 2020, 3:25 pm Hi
Is it possible to center align an image around an x,y coordinate? Or can you only set the coordinate of the top-left corner of the image?
Thanks in advance!
Code: Select all
X=(#X#-([Image:W]/2))
Y=(#Y#-([Image:H]/2))
-
- Posts: 24
- Joined: August 20th, 2020, 8:49 pm
Re: Center aligning an image
Ah that's great, thanks!
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Center aligning an image
Do ensure that the values you set for #X# and #Y# are large enough that when 1/2 of the image is moved up and to the left of those values, the image will still fit in the context of the entire skin. Rainmeter cannot expand a skin window up or to the left, and you don't want to truncate the image.