1.获取图片

public static Image getImage(String key) {
        Image img = getDefault().getImageRegistry().get(key);
        if (img == null) {
            getDefault().getImageRegistry().put(key,
                    getImageDescriptor(key).createImage());
            img = getDefault().getImageRegistry().get(key);
        }

        return img;
    }

    /**
     * Returns an image descriptor for the image file at the given plug-in
     * relative path
     *
     * @param path
     *            the path
     * @return the image descriptor
     */
    public static ImageDescriptor getImageDescriptor(String path) {
        return imageDescriptorFromPlugin(PLUGIN_ID, path);
    }
    

2.获取颜色
    public static Color getColor(RGB rgb) {
        if (color == null) {
            color = ColorCache.open();
        }
        return color.getColor(rgb);
    }

相关文章:

  • 2022-12-23
  • 2021-07-15
  • 2022-02-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-08-26
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案