当前位置: 首页>>代码示例>>Java>>正文


Java Image.dispose方法代码示例

本文整理汇总了Java中org.eclipse.swt.graphics.Image.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java Image.dispose方法的具体用法?Java Image.dispose怎么用?Java Image.dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.graphics.Image的用法示例。


在下文中一共展示了Image.dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawShadowImage

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
public static void drawShadowImage(GC gc, Image image, int x, int y,
    int alpha) {
  Display display = Display.getCurrent();
  Point imageSize = new Point(image.getBounds().width,
      image.getBounds().height);
  //
  ImageData imgData = new ImageData(imageSize.x, imageSize.y, 24,
      new PaletteData(255, 255, 255));
  imgData.alpha = alpha;
  Image img = new Image(display, imgData);
  GC imgGC = new GC(img);
  imgGC.drawImage(image, 0, 0);
  gc.drawImage(img, x, y);
  imgGC.dispose();
  img.dispose();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:17,代码来源:SWTX.java

示例2: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void dispose(TableCell cell) {
	// only dispose of image here, this method is reused in other methods
	Graphic graphic = cell.getGraphic();
	if (graphic instanceof UISWTGraphic)
	{
		final Image img = ((UISWTGraphic) graphic).getImage();
		if (img != null && !img.isDisposed()){
			img.dispose();

				// see http://forum.vuze.com/thread.jspa?threadID=117243
				// could it be that it isn't being marked as disposed after disposal and
				// being double-disposed?
			((UISWTGraphic) graphic).setImage( null );
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:18,代码来源:ProgressGraphItem.java

示例3: resizeImage

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private Image resizeImage(Image image, int width, int height) {
    Image scaled = new Image(Display.getDefault(), width, height);
    GC gc = new GC(scaled);
    gc.setAntialias(SWT.ON);
    gc.setInterpolation(SWT.HIGH);
    gc.drawImage(image, 0, 0,image.getBounds().width, image.getBounds().height, 0, 0, width, height);
    gc.dispose();
    image.dispose();
    return scaled;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:11,代码来源:PluginDialog.java

示例4: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
 */
public void dispose() {
	for (Image cachedImage : imagesCache.values()) {
		cachedImage.dispose();
	}
	eLabelProvider.dispose();
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:12,代码来源:DSLDebugModelPresentation.java

示例5: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void dispose() {
	DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
	breakpointEnabled.dispose();
	breakpointDisabled.dispose();
	for (Image cachedImage : imagesCache.values()) {
		cachedImage.dispose();
	}
	super.dispose();
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:11,代码来源:DSLLabelDecorator.java

示例6: clearCoverArt

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private void clearCoverArt() {
    Image i = imageLabel.getImage();
    if (i != null && i != cover) {
        imageLabel.setImage(null);
        i.dispose();
    }

    imageLabel.setImage(cover);

}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:11,代码来源:BookInfoPanel.java

示例7: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void dispose() {
	super.dispose();
	
   	for (Image image : icons.values()) {
           if (image != null)
           	image.dispose();
       }
   	icons.clear();
	
	if (handCursor != null)
		handCursor.dispose();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:14,代码来源:CustomAdditionsWizardPage.java

示例8: disposeImages

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private void disposeImages() {
	for (Image beanIcon : icons.values()) {
        if (beanIcon != null)
        	beanIcon.dispose();
    }
	icons.clear();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:8,代码来源:ConvertigoPlugin.java

示例9: saveEditorContentsAsImage

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private static void saveEditorContentsAsImage(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format) {

		ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) viewer.getEditPartRegistry().get(LayerManager.ID);
		IFigure rootFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS);// rootEditPart.getFigure();
		Rectangle rootFigureBounds = rootFigure.getBounds();

		Control figureCanvas = viewer.getControl();
		GC figureCanvasGC = new GC(figureCanvas);

		Image img = new Image(null, rootFigureBounds.width, rootFigureBounds.height);
		GC imageGC = new GC(img);
		imageGC.setBackground(figureCanvasGC.getBackground());
		imageGC.setForeground(figureCanvasGC.getForeground());
		imageGC.setFont(figureCanvasGC.getFont());
		imageGC.setLineStyle(figureCanvasGC.getLineStyle());
		imageGC.setLineWidth(figureCanvasGC.getLineWidth());
		imageGC.setXORMode(figureCanvasGC.getXORMode());
		Graphics imgGraphics = new SWTGraphics(imageGC);

		rootFigure.paint(imgGraphics);

		ImageData[] imgData = new ImageData[1];
		imgData[0] = img.getImageData();

		ImageLoader imgLoader = new ImageLoader();
		imgLoader.data = imgData;
		imgLoader.save(saveFilePath, format);

		figureCanvasGC.dispose();
		imageGC.dispose();
		img.dispose();
	}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:33,代码来源:ImageSaveUtil.java

示例10: paintFigure

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics g) {
	Rectangle r = getBounds();
	if(valid) {
		ImageData data = getImageData();
		Image img = new Image(Display.getDefault(), data);
		g.drawImage(img, 0, 0, width, height, r.x+1, r.y+1, width, height);
		img.dispose();
	}
	else {
		g.drawText("Invalid matrix", r.getLocation().translate(5, 15));
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:14,代码来源:ImageFigure.java

示例11: saveToImageFile

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
void saveToImageFile() {
	Dimension size = rootFig.getPreferredSize();
	Image image = new Image(Display.getDefault(), size.width, size.height);
	GC gc = new GC(image);
	SWTGraphics graphics = new SWTGraphics(gc);
	rootFig.paint(graphics);
	Clipboard clipboard = new Clipboard(Display.getDefault());
	clipboard.setContents(new Object[]{image.getImageData()}, new Transfer[]{ ImageTransfer.getInstance()}); 
	image.dispose();
	gc.dispose();
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:12,代码来源:RuntimeViewer.java

示例12: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
/**
 * Dispose of resources.
 */
public void dispose() {
	for (int i=0; i<imageNames.length; i++) {
		String imageName = imageNames[i];
		Image image = (Image) images.get(imageName);
		image.dispose();
		images.remove(imageName);
	}
}
 
开发者ID:marvinmalkowskijr,项目名称:applecommander,代码行数:12,代码来源:ImageManager.java

示例13: resize

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private Image resize(Image image, int width, int height) {
	Image scaled = new Image(display, width, height);
	GC gc = new GC(scaled);
	gc.setAntialias(SWT.ON);
	gc.setInterpolation(SWT.HIGH);
	gc.drawImage(image, 0, 0, image.getBounds().width, image.getBounds().height,
			0, 0, width, height);
	gc.dispose();
	image.dispose();
	return scaled;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:12,代码来源:SimpleToolBarEx.java

示例14: close

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
public boolean close() {
	// dispose all images
	for (int i = 0; i < images.size(); ++i) {
		Image image = (Image) images.get(i);
		image.dispose();
	}

	return super.close();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:CustomAboutDialog.java

示例15: stop

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
public void stop(BundleContext context) throws Exception {
	plugin = null;
	super.stop(context);
	for(Image img:imageMap.values()){
		img.dispose();
	}
	imageMap.clear();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:Activator.java


注:本文中的org.eclipse.swt.graphics.Image.dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。