SU 2016 x64Win #create_cursor hot point Issue

I just installed SU 2016 x64Win on Windows 7. I’m having a problem with a personal toolbar of mine that uses large 64x64 pixel PNG files for tool cursors.

The “UI.create_cursor” second and third arguments are the “hot point” pixel X and Y values respectively. The tool’s class “initialization” method includes:

@cursor_id = UI.create_cursor(cursor_path, 0, 63)

Then of course, the class method to select that cursor is:

def onSetCursor
  UI.set_cursor(@cursor_id)
end

Sketchup does display the correct PNG image. The hot point is working laterally (left to right), but it doesn’t look like a consistent vertical error. My plugin has worked on many Windows versions of Sketchup to make the bottom left pixel the hot point. Now it isn’t working with the 64x64 size icon. I switched to a 32x32 size PNG file and updated the code and it worked.
I had a similar issue with SU 2015 on a Mac this year. I wrote code to check for Mac specifically.
API:
http://www.sketchup.com/intl/en/developer/docs/ourdoc/ui#create_cursor

I think it’ll only work with 32x32 size.
I’ve tried with bigger than 32 and had the same problem with SU 2015.

the important note from your link

Since SketchUp 2016 it is possible to provide vector images for the cursors. SVG format for Windows and PDF format for OS X.

SU v16 has been optimised for .these…

if your writing or updating you should include vector cursors…

john

I’m having to drop my PNG cursors to 32x32, which really affects the usability of them. It seems a step backwards to have separate file types for the two operating systems. SVG and PDF can be quite scalable for tool bar buttons. The API doesn’t have arguments to scale the API objects resulting from the “create_cursor” method and to provide hot points data for SVG or PDF. Is the assumption that Sketchup will scale them based on monitor resolution?

Does anyone have example code and images with SVG and PDF for cursors (not tool buttons)? Cursors aren’t very useful without some transparency and PDFs with transparency are not common.

I usually create my vector icons/cursor with Illustrator, exporting to SVG. Then I use a little script to batch convert to PDF and PNG using Inkscape’s console commands. (Some times I create the SVGs directly in Inkscape.) Both illustrator and inkscape give you full control over transparency. (PDFs with transparency is simply not having any objects filled for the background.)