It is currently March 29th, 2024, 5:06 am

How to auto-resize images to screen?

Get help with creating, editing & fixing problems with skins
hpgbproductions
Posts: 10
Joined: June 12th, 2018, 7:18 am

How to auto-resize images to screen?

Post by hpgbproductions »

I'm trying out creating a skin that overlays certain images on top of a specific desktop wallpaper. How do I automatically resize the overlay images to fit all zoom levels?

I've tried using the SysInfo plugin but the overlays don't appear when I define the W and H values with section variables or MeasureName. (Maybe more information on how W and H works with the image scale mode?)

Also, I'll want to scale the hitbox shapes for mouse actions. I can let people resize the images themselves but the hitboxes will remain...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to auto-resize images to screen?

Post by eclectic-tech »

hpgbproductions wrote:I'm trying out creating a skin that overlays certain images on top of a specific desktop wallpaper. How do I automatically resize the overlay images to fit all zoom levels?

I've tried using the SysInfo plugin but the overlays don't appear when I define the W and H values with section variables or MeasureName. (Maybe more information on how W and H works with the image scale mode?)
I do not know of any way to determine which zoom the end user selects for his wallpaper. Besides knowing if it is Fit, Fill, Stretch, Span, Tile, or Center, you will also need to know the initial resolution then try to come up with a formula to match each of the 6 zoom! I feel this will be a fruitless exercise that will never match the way it should. The resizing action is probably also going to "bring Rainmeter to it's knees", killing the functioning of all skins. :uhuh:
hpgbproductions wrote:Also, I'll want to scale the hitbox shapes for mouse actions. I can let people resize the images themselves but the hitboxes will remain...
Really need more information of this... what are your "hitboxes"? Perhaps some code would help explain this for us... 8-)
hpgbproductions
Posts: 10
Joined: June 12th, 2018, 7:18 am

Re: How to auto-resize images to screen?

Post by hpgbproductions »

eclectic-tech wrote:I do not know of any way to determine which zoom the end user selects for his wallpaper. Besides knowing if it is Fit, Fill, Stretch, Span, Tile, or Center, you will also need to know the initial resolution then try to come up with a formula to match each of the 6 zoom! I feel this will be a fruitless exercise that will never match the way it should. The resizing action is probably also going to "bring Rainmeter to it's knees", killing the functioning of all skins. :uhuh:
I guess the main problem I have is that my SysInfo SCREEN_WIDTH and SCREEN_HEIGHT readings aren't accepted as W and H values.
eclectic-tech wrote:Really need more information of this... what are your "hitboxes"? Perhaps some code would help explain this for us... 8-)
Hitboxes are the sections of the image you can click on to run certain bangs, which will show/hide the overlay images. Typically shape meters with mouse actions. The hitbox only aligns with the wallpaper at 1280x720 screen size; it will be off if the screen size is different.

The 1280x720 size is only because I'm running it on my screen, plus the wallpaper image and my overlays are conveniently the same size so I can take pixel readings from GIMP
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to auto-resize images to screen?

Post by balala »

hpgbproductions wrote:I guess the main problem I have is that my SysInfo SCREEN_WIDTH and SCREEN_HEIGHT readings aren't accepted as W and H values.
To be honest I still don't entirely understand the essence of your request, however I'd say that maybe you don't even need to use the SysInfo plugin. I mean that maybe you could use the #SCREENAREAWIDTH# and #SCREENAREAHEIGHT# built-in variables. These variables are returning the accordingly the width and the height of the screen.