當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。