Cursor Hotspot?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Asfhy
Posts: 4
Joined: 2016-04-27T01:17:59-07:00
Authentication code: 1151

Cursor Hotspot?

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cursor Hotspot?

Post 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.
snibgo's IM pages: im.snibgo.com
Asfhy
Posts: 4
Joined: 2016-04-27T01:17:59-07:00
Authentication code: 1151

Re: Cursor Hotspot?

Post 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 :(
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cursor Hotspot?

Post 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.
snibgo's IM pages: im.snibgo.com
Asfhy
Posts: 4
Joined: 2016-04-27T01:17:59-07:00
Authentication code: 1151

Re: Cursor Hotspot?

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cursor Hotspot?

Post 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.
snibgo's IM pages: im.snibgo.com
Asfhy
Posts: 4
Joined: 2016-04-27T01:17:59-07:00
Authentication code: 1151

Re: Cursor Hotspot?

Post 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.
Post Reply