Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button to quickly change the interpolation #2042

Closed
mario-b00 opened this issue Nov 16, 2024 · 5 comments
Closed

Button to quickly change the interpolation #2042

mario-b00 opened this issue Nov 16, 2024 · 5 comments

Comments

@mario-b00
Copy link

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 added a commit that referenced this issue Nov 16, 2024
@d2phap d2phap added this to the v9.2 milestone Nov 16, 2024
@d2phap
Copy link
Owner

d2phap commented Nov 16, 2024

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:

  • Create a custom button: Open Settings > Toolbar, click "Create a custom button"
  • Paste the JSON:
{
  "Type": "Button",
  "Id": "btn_custom_1",
  "Text": "Zoom > 100%: NearestNeighbor",
  "DisplayStyle": "Image",
  "CheckableConfigBinding": "",
  "Alignment": "Left",
  "Image": "C:\\path\\to\\icon.svg",
  "OnClick": {
    "Executable": "IG_ApplySettings",
    "Arguments": [
      "{ \"ImageInterpolationScaleUp\": \"NearestNeighbor\" }"
    ]
  }
}

You can change the Id, Text, Image as you want.

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

@d2phap
Copy link
Owner

d2phap commented Nov 30, 2024

Updated: You can assign hotkeys to the toolbar buttons using Hotkeys property, too!

{
  "Type": "Button",
  "Id": "btn_custom_1",
  "Text": "Zoom > 100%: NearestNeighbor",
  "DisplayStyle": "Image",
  "CheckableConfigBinding": "",
  "Alignment": "Left",
  "Image": "C:\\path\\to\\icon.svg",
  "OnClick": {
    "Executable": "IG_ApplySettings",
    "Arguments": [
      "{ \"ImageInterpolationScaleUp\": \"NearestNeighbor\" }"
    ]
  },
  "Hotkeys": ["Alt+1"]
}

@mario-b00
Copy link
Author

Hi, therefore in the current version 9.1 it is not possible to do what I asked, but it will be possible with the new version 9.2. Right?
The Hotkeys addition also refers to ver 9.2. Right?
Thanks for your availability and many compliments, ImageGlass is a beautiful program.

@d2phap
Copy link
Owner

d2phap commented Dec 1, 2024

@mario-b00 Yes, only for v9.2.
You can try it out in this build: https://drive.google.com/file/d/12ibBt7giHU1ZDC56yX1jVqz8lYMF7w0Q/view?usp=sharing

@d2phap
Copy link
Owner

d2phap commented Dec 8, 2024

Published ImageGlass 9.2.0.1208 - Maroon 4

@d2phap d2phap closed this as completed Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants