本文整理匯總了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;
}