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