0
フレームを印刷できるコードはすでに書かれていますが、今はprintJobを使用したいのは、 。 BufferedImageをPrintableに変換してコードにprintjobを使用する方法はありますか? THXBufferedImageをPrintableに変換してprintJobを使用する方法
if(command.equals("Print")){
//saves image as temp and then prints it
File out = new File("temp.jpg");
BufferedImage myImage = new BufferedImage((int) frame.getWidth(),
(int) frame.getHeight(),
BufferedImage.TYPE_INT_RGB);
frame.paintAll(myImage.createGraphics());
try{
ImageIO.write(myImage, "jpg", out);
PrintImage.printImage("temp.jpg");
}catch (IOException exception){
exception.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
}