当前位置: 首页>>代码示例>>Java>>正文


Java ImageWriterSpi.createWriterInstance方法代码示例

本文整理汇总了Java中javax.imageio.spi.ImageWriterSpi.createWriterInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ImageWriterSpi.createWriterInstance方法的具体用法?Java ImageWriterSpi.createWriterInstance怎么用?Java ImageWriterSpi.createWriterInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.imageio.spi.ImageWriterSpi的用法示例。


在下文中一共展示了ImageWriterSpi.createWriterInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: next

import javax.imageio.spi.ImageWriterSpi; //导入方法依赖的package包/类
public ImageWriter next() {
    ImageWriterSpi spi = null;
    try {
        spi = iter.next();
        return spi.createWriterInstance();
    } catch (IOException e) {
        // Deregister the spi in this case, but only as a writerSpi
        theRegistry.deregisterServiceProvider(spi, ImageWriterSpi.class);
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:ImageIO.java

示例2: next

import javax.imageio.spi.ImageWriterSpi; //导入方法依赖的package包/类
public ImageWriter next()
{
  try
    {
      ImageWriterSpi spi = it.next();
      return (writerExtension == null
          ? spi.createWriterInstance()
          : spi.createWriterInstance(writerExtension));
    }
  catch (IOException e)
    {
      return null;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:ImageIO.java

示例3: Context

import javax.imageio.spi.ImageWriterSpi; //导入方法依赖的package包/类
Context(TestEnvironment env, Result result, int testType) {
    super(env, result);

    String content = (String)env.getModifier(contentList);
    if (content == null) {
        content = CONTENT_BLANK;
    }
    // REMIND: add option for non-opaque images
    image = createBufferedImage(size, size, content, false);

    result.setUnits(size*size);
    result.setUnitName("pixel");

    if (testType == TEST_IMAGEIO || testType == TEST_IMAGEWRITER) {
        ImageWriterSpi writerspi =
            (ImageWriterSpi)env.getModifier(imageioWriteFormatList);
        format = writerspi.getFileSuffixes()[0].toLowerCase();
        if (testType == TEST_IMAGEWRITER) {
            try {
                writer = writerspi.createWriterInstance();
            } catch (IOException e) {
                System.err.println("error creating writer");
                e.printStackTrace();
            }
            if (env.isEnabled(installListenerTog)) {
                writer.addIIOWriteProgressListener(
                    new WriteProgressListener());
            }
        }
        if (format.equals("wbmp")) {
            // REMIND: this is a hack to create an image that the
            //         WBMPImageWriter can handle (a better approach
            //         would involve checking the ImageTypeSpecifier
            //         of the writer's default image param)
            BufferedImage newimg =
                new BufferedImage(size, size,
                                  BufferedImage.TYPE_BYTE_BINARY);
            Graphics g = newimg.createGraphics();
            g.drawImage(image, 0, 0, null);
            g.dispose();
            image = newimg;
        }
    } else { // testType == TEST_JPEGCODEC
        format = "jpeg";
    }

    initOutput();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:OutputImageTests.java


注:本文中的javax.imageio.spi.ImageWriterSpi.createWriterInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。