I want to add custom cursors to the project with Avalonia and struggle to make the custom cursor invert the color of its pixels relative to the background color as the IBeam text cursor does. The cur file of cursors with this behavior has an icon with zero alpha channel in Windows and works fine in WPF. As I understood Avalonia doesn't support cur format so I use a png file. I tried to use it in the same way and just made visible pixels of the cursor white with a transparent alpha channel. However, it renders as just a gray square. If leave alpha channel 255 for the white-colored pixels the cursor looks fine but it is always white, with no color inversion in this case. So it isn't visible on the white background of the application window. I need it to work as a regular IBeam text cursor which always has a color inverted to the background.
Is it possible to make it in Avalonia for the custom cursors?
Here is how it looks with the png icon in Avalonia:
Here is how it looks with the cur icon in WPF:
Here is cur icon and its png equivalent: cursor_icons.zip
If you'll try to see the png icon in the image editor you will not see anything because of the alpha channel. The alpha channel is zero. It is the same as in the cur icon that works in WPF. You can invert the alpha channel of the picture to be sure it isn't empty.
I'll be glad for any help.


