這只是我誰時(shí)遇到誰時(shí)記錄的,以后有新的內(nèi)容會(huì)誰時(shí)更新
1 .
Image.win32_new (Display.getDefault(), SWT.ICON, 65545)
Image org.eclipse.swt.graphics.Image.win32_new(Device device, int type, inthandle)
Invokes platform specific functionality to allocate a new image.
IMPORTANT: This method is not part of the public API forImage
. It is marked public only so that it can be shared within thepackages provided by SWT. It is not available on all platforms, and should neverbe called from application code.
- 參數(shù):
- device the device on which to allocate the color
- type the type of the image (
SWT.BITMAP
orSWT.ICON
) - handle the OS handle for the image
- 返回:
- a new image object containing the specified device, type andhandle
2 .
Display.getDefault().getSystemImage(SWT.ICON_WORKING)
Image org.eclipse.swt.widgets.Display.getSystemImage(int id)
Returns the matching standard platform image for the given constant, whichshould be one of the icon constants specified in class SWT
. Thisimage should not be free‘d because it was allocated by the system, not theapplication. A value of null
will be returned either if thesupplied constant is not an swt icon constant or if the platform does not definean image that corresponds to the constant.
- 參數(shù):
- id the swt icon constant
- 返回:
- the corresponding image or
null
- 拋出:
- SWTException
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- 另請參閱:
- SWT.ICON_ERROR
- SWT.ICON_INFORMATION
- SWT.ICON_QUESTION
- SWT.ICON_WARNING
- SWT.ICON_WORKING
- @since
- 3.0
3。
AbstractUIPlugin.imageDescriptorFromPlugin(Application.ID,"icons/types.gif")
ImageDescriptor org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin(String pluginId, String imageFilePath)
Creates and returns a new image descriptor for an image file located within the specified plug-in.
This is a convenience method that simply locates the image file in within the plug-in (no image registries are involved). The path is relative to the root of the plug-in, and takes into account files coming from plug-in fragments. The path may include $arg$ elements. However, the path must not have a leading "." or path separator. Clients should use a path like "icons/mysample.gif" rather than "./icons/mysample.gif" or "/icons/mysample.gif".
- 參數(shù):
- pluginId the id of the plug-in containing the image file;
null
is returned if the plug-in does not exist - imageFilePath the relative path of the image file, relative to the root of the plug-in; the path must be legal
- 返回:
- an image descriptor, or
null
if no image could be found
注 :Application.ID:插件ID
4。
static final Image
UNCHECKED = createImage("images/checkboxenabledoff.gif"), //$NON-NLS-1$
CHECKED = createImage("images/checkboxenabledon.gif"); //$NON-NLS-1$
private static Image createImage(String name) {
InputStream stream = CheckBox.class.getResourceAsStream(name);
Image image = new Image(null, stream);
try {
stream.close();
} catch (IOException ioe) {
}
return image;
}
5。
ImageRegistry reg = JFaceResources.getImageRegistry();
reg.put(CELL_EDITOR_IMG_DOTS_BUTTON, ImageDescriptor.createFromFile(
DialogCellEditor.class, "images/dots_button.gif"));