d2phap / ImageGlass

🏞 A lightweight, versatile image viewer
https://imageglass.org
Other
7.88k stars 501 forks source link

Button to quickly change the interpolation #2042

Open mario-b00 opened 1 week ago

mario-b00 commented 1 week ago

I want to create a button that sets interpolation "when zoom>100%" on the "nearest neighbor" value. And then a second button that sets interpolation "when zoom>100%" on "multi-sample linear" value. Thank you

d2phap commented 1 week ago

In the version 9.2, you will be able to apply any settings in the ImageGlass Settings by the API: IG_ApplySettings(string json).

Here is the example how to add 2 custom toolbar buttons to do your request:

image

This adds a button Zoom > 100%: NearestNeighbor to the toolbar: image

You can repeat those steps to create another button for "when zoom>100%" on "multi-sample linear", using this value for the Arguments:

"Arguments": [
  "{ \"ImageInterpolationScaleUp\": \"MultiSampleLinear\" }"
]

image