Skip to content

Instantly share code, notes, and snippets.

@imagejan
Created June 21, 2021 12:13
Show Gist options
  • Save imagejan/dc4dd660e8e98aa61e0647bcf81d6094 to your computer and use it in GitHub Desktop.
Save imagejan/dc4dd660e8e98aa61e0647bcf81d6094 to your computer and use it in GitHub Desktop.
/**
* This ImageJ script opens the icon from a given file
* (as displayed in the operating system) as an ij.ImagePlus
*/
#@ File iconFile
import sun.awt.shell.ShellFolder
import ij.ImagePlus
import ij.process.ColorProcessor
sf = ShellFolder.getShellFolder(iconFile)
new ImagePlus("Icon", new ColorProcessor(sf.getIcon(true)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment