Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在eclipse插件中访问图像_Java_Eclipse_Eclipse Plugin - Fatal编程技术网

Java 在eclipse插件中访问图像

Java 在eclipse插件中访问图像,java,eclipse,eclipse-plugin,Java,Eclipse,Eclipse Plugin,我正在尝试使用 canvas.setBackgroundImage(image); 如何使用存储在插件图像子目录中的*.png文件设置图像 大概是这样的: PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK) 但是我想使用我的图像文件而不是共享图像 对于plugin.xml中未声明的图像,如: (类似于“”) 另请参见访问插件中声明的资源。@treeno谢谢。我已经恢复了这种

我正在尝试使用

canvas.setBackgroundImage(image);
如何使用存储在插件图像子目录中的*.png文件设置图像

大概是这样的:

PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK)

但是我想使用我的图像文件而不是共享图像

对于plugin.xml中未声明的图像,如:

(类似于“”)


另请参见访问插件中声明的资源。

@treeno谢谢。我已经恢复了这种联系。
 public Image createImage(String path) {
   Image image = getImageRegistry().get(path);
   if (image == null) {
     getImageRegistry().put(path, AbstractUIPlugin.
       imageDescriptorFromPlugin(ID, path));
     image = getImageRegistry().get(path);
   }
   return image;
 }