本文整理汇总了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;
}
示例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));
}
示例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));
}
示例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;
}