Page 1 of 1

Cursor Hotspot?

Posted: 2016-04-27T01:23:46-07:00
by Asfhy
Hello, I'm using ImageMagick to convert some PNG files to CUR ones. The generated files are correctly formatted and can be readed on my windows machine, but I haven't found the command parameter needed to set the hotspot of the cursor, so they appear a bit out of place when used.

I'm trying to copy my Linux appearance on the Windows machine, so I installed a "GTK looking theme" for windows, a set of Icons similar to the one I use on Linux and now I downloaded the "source" of the cursor theme I like. I'm trying to recreate de cursors in Windows format to create a new Cursor theme that looks the same that the Linux one does.

So the quoestion is: It is supported to specify the hotspot on command line calling convert? If it is, what's the parameter and how I need to use it when using convert to create the CUR file?

Re: Cursor Hotspot?

Posted: 2016-04-27T01:50:49-07:00
by snibgo
Setting the hotspot from the canvas x,y settings ("-repage") would seem logical but doesn't work.

From a couple of tests and looking at the source code (coders\icon.c), it seems that IM always writes CUR files identically to ICO files, with hard-coded values for the hotspot.

Re: Cursor Hotspot?

Posted: 2016-04-27T01:58:18-07:00
by Asfhy
Oh, well, if that's true I need to find other way to generate de cur files. I've been able to run AniTuner2 on wine to create the ANI for animated cursors from the source images, but AniTuner does not export to CUR, so I need other software to convert static cursors to CUR files setting the hotspot :(

Re: Cursor Hotspot?

Posted: 2016-04-27T02:49:40-07:00
by snibgo
Sorry, I forgot to paste a relevant link: https://en.wikipedia.org/wiki/.cur

Yes, unless I've misunderstood, IM can't set the hotspot. It doesn't look like a difficult change to make.

If you can find an ICO (icon) to CUR converter, that should do the job.

Re: Cursor Hotspot?

Posted: 2016-04-27T02:53:20-07:00
by Asfhy
Well, I used a web service (cursor.cc) to import PNG files (from the source XCursor Theme) set a Hotspot and download a CUR file with the correct settings, but it would be easier if IM supports the hotspot settings so I could make a script to convert some XCursor Themes to Windows Cursor themes XDD.

Thanks.

Re: Cursor Hotspot?

Posted: 2016-04-27T03:06:13-07:00
by snibgo
As shown in Wikipedia and here https://gist.github.com/RyanBalfanz/2371463 , a ICO to CUR converter for single images simply changes three bytes in the file. Doubtless that could be done in bash or Cygwin or Powershell or certainly in C.

Re: Cursor Hotspot?

Posted: 2016-04-27T03:08:41-07:00
by Asfhy
Sounds interesting ^_^ I will see if I can create a script for that and convert first to an icon and then convert from ico to cur with the correct hotspot.