CUR (.cur)

BackgroundBackground

    Microsoft Windows cursor.
    Raster image file format.
    Native cursor format on Windows.
    CUR is an acronym derived from cursor.
    Binary format.
    Can store multiple cursors at different color resolutions.
    Supports alpha channels.
    Similar to ICO format.

Import and ExportImport and Export

  • Import["file.cur"] imports a CUR file, returning all cursors stored in the file as a list of Image objects.
  • Import["file.cur",elem] imports the specified element from a CUR file.
  • Import["file.cur",{elem,suba,subb,}] imports a subelement.
  • Import["file.cur",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","CUR"] or Import["file",{"CUR",elem,}].
  • See the reference pages for full general information on Import.
  • ImportString supports the CUR format.

ElementsElements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Data"array of color values for each cursor
    "GraphicsList"list of graphics objects
    "HotSpot"pixel coordinates for each cursor's hot spot
    "ImageList"all cursors, given as a list of Image objects
    "RGBColorArray"array of RGBColor objects for each cursor
  • Import by default uses the element for CUR files.
  • Advanced Import elements:
  • "BitDepth"number of bits used to represent each color channel
    "ColorSpace"color encoding used in the file
    "ImageSize"raster dimensions
  • Export option:
  • "HotSpot"Automaticpixel coordinate of the cursor's hot spot
  • ICO supports a maximum of 256×256 pixel images. Export will scale down Image and Graphics larger than 256 pixels to fit.
  • Export by default places the hot spot at the top-left corner of the cursor.
  • The following settings for are supported:
  • Automatictop-left corner of the image with borders removed
    "TopLeft"top-left corner of the image with borders removed
    "TopRight"top-right corner of the image with borders removed
    "BottomLeft"bottom-left corner of the image with borders removed
    "BottomRight"bottom-right corner of the image with borders removed
    {x,y}explicit pixel coordinate

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Import a CUR file:

In[1]:=
Click for copyable input
Out[1]=

Get the hot spot coordinates of the first cursor image:

In[1]:=
Click for copyable input
Out[1]=

Export a cursor image to CUR, specifying the hot spot:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2007
(6.0)
| Updated in 2012
(9.0)