How to simulate a disabled image button, but with events firing.

I like the look of an disabled (greyscaled) image button, but the problem for me is that all events are disabled as well. I use mouse events to generate a tool-tip of sorts with information and I want them still to show up.

An alternative for disabling the button, would be changing the graphic to a greyscaled version.
Disadvantage with this is that I need to keep 2 versions of the same image and I have too many images already, so I don’t want to have double the amount.
Would it be possible to generate the disabled image on the fly from the original?

Can you upload an ODF type sample file here?

Thanks for responding.
Sure. Here is a sample with 2 image buttons and a label. Clicking one image button will disable/enable the other. Also, hovering over a button will set the label to the name of the button.
You can see that disabling will turn the button’s image to grey and make the events turn off.
IBtest.ods

What I would like to see is basically the same visual effect, but with events staying active (especially mouse in/out) on the control.
In the real application I have currently about ~80 image buttons in enabled/disabled situation.

This here looks interesting (Duotone), but I have no idea how to make use of it: LibreOffice: XGraphicTransformer Interface Reference

In the application I set the images on the buttons with something like:

Dim sBitmapName As String
sBitmapName = "GraphicName"
Dim oBitmaps as Object
oBitmaps = ThisComponent.createInstance("com.sun.star.drawing.BitmapTable")
Set oControl.Graphic = oBitmaps.getByName(sBitmapName)

“Disadvantage with this is that I need to keep 2 versions of the same image and I have too many images already, so I don’t want to have double the amount.”

Try to link the images instead of embedding them:

https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=82454

It’s a possibility, but I was hoping for a solution which minimized the resources. And with the convenience of a single file.
It wouldn’t be possible to copy and alter an embedded image?

There are functions named .uno:GraphicFilterRelief and .uno:GraphicFilterInvert for the graphics. I do not know if they are available from the API and if they are, then how they are available.

I just tried to record a macro but the line of the function are greyed (REM-ed) in the recorded code.

rem dispatcher.executeDispatch(document, ".uno:GraphicFilterRelief", "", 0, Array())

I’m doing some testing with a com.sun.star.drawing.GraphicObjectShape placed on the same spot as the button (under it as controls are always on top).
If you remove the Graphic from the Image button then the underlying GraphicObjectShape will become visible and the button is still clickable etc.

The GraphicObjectShape can be assigned the same embedded Graphic, but also has the property GraphicColorMode which can be set to com.sun.star.drawing.ColorMode.GREYS (and has also other color modification properties).

I’ve come so far as this: IBtest2.ods

The annoying thing is that the resulting sizes are not exactly the same, even when assigning both the same size to be sure…