2014-02-17 28 views
0

我想打印我需要的内容以打印JPanel的内容,这就是我将内容保存为BufferedImage的图像的原因。如何打印该图像?a JLabel,并将其保存在BufferedImage中。如何使用Java打印BufferedImage?

+1

定义“打印”...如果你正在谈论打印到打印机,你可以看看[这个例子](https://stackoverflow.com/questions/12764634/printing-a-jframe-和它的组件/ 12765916#12765916)和[这个答案](https://stackoverflow.com/questions/18327234/i-have-proplem-in-java-i-cant-print-all-swing-compont/ 18327287)和[本示例](https://stackoverflow.com/questions/17904518/fit-scale-jcomponent-to-page-being-printed/17961911#17961911)[只是为了好玩](https:/ /stackoverflow.com/questions/18460008/printable-prints-bufferedimage-with-incorrect-size/18466550#18466550) – MadProgrammer

回答

0

希望这是你正在寻找的。 (),你的图像(0,0,null);