當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageUtils類代碼示例

本文整理匯總了Java中org.insightech.er.util.ImageUtils的典型用法代碼示例。如果您正苦於以下問題:Java ImageUtils類的具體用法?Java ImageUtils怎麽用?Java ImageUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ImageUtils類屬於org.insightech.er.util包,在下文中一共展示了ImageUtils類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createImageInfoSet

import org.insightech.er.util.ImageUtils; //導入依賴的package包/類
private ImageInfoSet createImageInfoSet(final ProgressMonitor monitor) throws Exception {
    final String mainFileName = exportImageSetting.getOutputFilePath();

    final int format = ImageUtils.getFormatType(mainFileName);

    if (mainFileName != null && format == -1) {
        throw new InputException("dialog.message.export.image.not.supported");
    }

    ImageInfoSet imageInfoSet = null;
    final Display display = ERDiagramActivator.getDisplay();

    try {
        final ImageInfo diagramImageInfo = this.outputImage(monitor, display, exportImageSetting.getCategory(), format, exportImageSetting.getOutputFilePath());
        imageInfoSet = new ImageInfoSet(diagramImageInfo);

        if (exportImageSetting.isWithCategoryImage()) {
            for (final Category category : categoryList) {
                final ImageInfo imageInfo = this.outputImage(monitor, display, category, format, getFileNameForCategoryImage(imageInfoSet, category));

                imageInfoSet.addImageInfo(category, imageInfo);
            }
        }

    } catch (final Exception e) {
        if (e.getCause() instanceof OutOfMemoryError) {
            throw new InputException("dialog.message.export.image.out.of.memory");
        }

        throw e;
    }

    return imageInfoSet;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:35,代碼來源:ExportToImageManager.java

示例2: writePNGByAnotherWay

import org.insightech.er.util.ImageUtils; //導入依賴的package包/類
private static void writePNGByAnotherWay(final Image image, final String saveFilePath, final int format) throws IOException, InterruptedException {

        // BufferedImage bufferedImage = new BufferedImage(
        // image.getBounds().width, image.getBounds().height,
        // BufferedImage.TYPE_INT_RGB);
        //
        // ImageUtils.drawAtBufferedImage(bufferedImage, image, 0, 0);

        final BufferedImage bufferedImage = ImageUtils.convertToBufferedImage(image);

        final String formatName = ImageUtils.toFormatName(format);

        ImageIO.write(bufferedImage, formatName, new File(saveFilePath));
    }
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:15,代碼來源:ExportToImageManager.java

示例3: writePNGByAnotherWay

import org.insightech.er.util.ImageUtils; //導入依賴的package包/類
private static void writePNGByAnotherWay(Image image, String saveFilePath,
		int format) throws IOException, InterruptedException {

	// BufferedImage bufferedImage = new BufferedImage(
	// image.getBounds().width, image.getBounds().height,
	// BufferedImage.TYPE_INT_RGB);
	//
	// ImageUtils.drawAtBufferedImage(bufferedImage, image, 0, 0);

	BufferedImage bufferedImage = ImageUtils.convertToBufferedImage(image);

	String formatName = ImageUtils.toFormatName(format);

	ImageIO.write(bufferedImage, formatName, new File(saveFilePath));
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:16,代碼來源:ExportToImageManager.java

示例4: createImageInfoSet

import org.insightech.er.util.ImageUtils; //導入依賴的package包/類
private ImageInfoSet createImageInfoSet(ProgressMonitor monitor)
		throws Exception {
	String mainFileName = this.exportImageSetting.getOutputFilePath();

	int format = ImageUtils.getFormatType(mainFileName);

	if (mainFileName != null && format == -1) {
		throw new InputException(
				"dialog.message.export.image.not.supported");
	}

	ImageInfoSet imageInfoSet = null;
	Display display = ERDiagramActivator.getDisplay();

	try {
		ImageInfo diagramImageInfo = this.outputImage(monitor, display,
				this.exportImageSetting.getCategory(), format,
				this.exportImageSetting.getOutputFilePath());
		imageInfoSet = new ImageInfoSet(diagramImageInfo);

		if (this.exportImageSetting.isWithCategoryImage()) {
			for (Category category : this.categoryList) {
				ImageInfo imageInfo = this.outputImage(monitor, display,
						category, format, this.getFileNameForCategoryImage(
								imageInfoSet, category));

				imageInfoSet.addImageInfo(category, imageInfo);
			}
		}

	} catch (Exception e) {
		if (e.getCause() instanceof OutOfMemoryError) {
			throw new InputException(
					"dialog.message.export.image.out.of.memory");
		}

		throw e;
	}

	return imageInfoSet;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:42,代碼來源:ExportToImageManager.java


注:本文中的org.insightech.er.util.ImageUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。