当前位置: 首页>>代码示例>>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;未经允许,请勿转载。