本文整理汇总了Java中javax.imageio.ImageWriter.reset方法的典型用法代码示例。如果您正苦于以下问题:Java ImageWriter.reset方法的具体用法?Java ImageWriter.reset怎么用?Java ImageWriter.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.imageio.ImageWriter
的用法示例。
在下文中一共展示了ImageWriter.reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runTest
import javax.imageio.ImageWriter; //导入方法依赖的package包/类
public void runTest(Object ctx, int numReps) {
final Context ictx = (Context)ctx;
final ImageWriter writer = ictx.writer;
final BufferedImage image = ictx.image;
do {
try {
ImageOutputStream ios = ictx.createImageOutputStream();
writer.setOutput(ios);
writer.write(image);
writer.reset();
ios.close();
ictx.closeOriginalStream();
} catch (IOException e) {
e.printStackTrace();
}
} while (--numReps >= 0);
}
示例2: createTestImage
import javax.imageio.ImageWriter; //导入方法依赖的package包/类
private static Image createTestImage() throws IOException {
BufferedImage frame1 = createFrame(new int[] { 0xffff0000, 0xffff0000 });
BufferedImage frame2 = createFrame(new int[] { 0xff0000ff, 0xffff0000 });
ImageWriter writer = ImageIO.getImageWritersByFormatName("GIF").next();
ImageOutputStream ios = ImageIO.createImageOutputStream(new File("lut_test.gif"));
ImageWriteParam param = writer.getDefaultWriteParam();
writer.setOutput(ios);
writer.prepareWriteSequence(null);
writer.writeToSequence(new IIOImage(frame1, null, null), param);
writer.writeToSequence(new IIOImage(frame2, null, null), param);
writer.endWriteSequence();
writer.reset();
writer.dispose();
ios.flush();
ios.close();
return Toolkit.getDefaultToolkit().createImage("lut_test.gif");
}
示例3: main
import javax.imageio.ImageWriter; //导入方法依赖的package包/类
public static void main(String args[]) {
ImageWriter writer = new JPEGImageWriter(null);
try {
writer.reset();
} catch (OutOfMemoryError e) {
throw new RuntimeException("Got OutOfMemoryError!");
}
}