CUR (.cur)

Background & Context

    • 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 & 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.
  • The import format can be specified with Import["file","CUR"] or Import["file",{"CUR",elem,}].
  • Export["file.cur",expr] exports an image, graphics, or a list of them to a CUR file.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • 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
  • Import by default uses the "ImageList" element for CUR files.
  • Advanced Import elements:
  • "BitDepth"number of bits used to represent each color channel
    "Channels"the number of color channels used in the file
    "ColorSpace"color encoding used in the file
    "ImageSize"raster dimensions
    "Summary"summary of the file
    "SummarySlideView"summary of all images in the file
    "ImageCount"number of images stored in the file
  • ICO supports a maximum of 256×256 pixel images. Export will scale down Image and Graphics larger than 256 pixels to fit.

Options

  • Export option:
  • "HotSpot"Automaticpixel coordinate of the cursor's hot spot
  • Export by default places the hot spot at the top-left corner of the cursor.
  • The following settings for "HotSpot" 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

Examples

open allclose all

Basic Examples  (3)

Import a CUR file:

Summary of the image:

Export a cursor image to CUR:

Export Options  (1)

"HotSpot"  (1)

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