摘要: This example demonstrates how to set a clipping area using a shape. The example sets an oval for the clipping area and then draws and image. Only thos 阅读全文
posted @ 2018-09-02 22:02 borter 阅读(155) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates how to convert between a color value in RGB (three integer values in the range 0 to 255 representing red, green, and blue) a 阅读全文
posted @ 2018-09-02 22:02 borter 阅读(142) 评论(0) 推荐(0) 编辑
摘要: To draw on the screen, it is first necessary to subclass a JComponent and override its paint() method. The paint() method is automatically called by t 阅读全文
posted @ 2018-09-02 22:01 borter 阅读(151) 评论(0) 推荐(0) 编辑
摘要: This is the simplest application to animate an array of images. 阅读全文
posted @ 2018-09-02 22:00 borter 阅读(107) 评论(0) 推荐(0) 编辑
摘要: // See e575 The Quintessential Drawing Program public void paint(Graphics g) { // Retrieve the graphics context; this object is used to paint shapes Graphics2D g2d = (Graphics2D)g;... 阅读全文
posted @ 2018-09-02 22:00 borter 阅读(134) 评论(0) 推荐(0) 编辑
摘要: The print dialog allows the user to change the default printer settings such as the default printer, number of copies, range of pages, etc. 阅读全文
posted @ 2018-09-02 21:58 borter 阅读(137) 评论(0) 推荐(0) 编辑
摘要: PrinterJob pjob = PrinterJob.getPrinterJob(); PageFormat pf = pjob.defaultPage(); if (portrait) { pf.setOrientation(PageFormat.PORTRAIT); } else { pf.setOrientation(... 阅读全文
posted @ 2018-09-02 21:58 borter 阅读(323) 评论(0) 推荐(0) 编辑
摘要: A Book object is used when printing pages with different page formats. This example prints the first page in landscape and five more pages in portrait 阅读全文
posted @ 2018-09-02 21:57 borter 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Note that (0, 0) of the Graphics object is at the top-left of the actual page, which is outside the printable area. 阅读全文
posted @ 2018-09-02 21:56 borter 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Note that (0, 0) of the Graphics object is at the top-left of the actual page, outside the printable area. In this example, the Graphics object is tra 阅读全文
posted @ 2018-09-02 21:55 borter 阅读(213) 评论(0) 推荐(0) 编辑
摘要: The page format dialog allows the user to change the default page format values such as the orientation and paper size. 阅读全文
posted @ 2018-09-02 21:55 borter 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Images in accelerated memory are much faster to draw on the screen. This example demonstrates how to take an image and make an accelerated copy of it 阅读全文
posted @ 2018-09-02 21:54 borter 阅读(178) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates a 3x3 kernel that sharpens an image. 阅读全文
posted @ 2018-09-02 21:53 borter 阅读(234) 评论(0) 推荐(0) 编辑
摘要: ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY); ColorConvertOp op = new ColorConvertOp(cs, null); bufferedImage = op.filter(bufferedImage, null); Related Examples 阅读全文
posted @ 2018-09-02 21:53 borter 阅读(247) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates how to convert a byte array of pixel values that are indices to a color table into a BufferedImage. In particular, the examp 阅读全文
posted @ 2018-09-02 21:52 borter 阅读(191) 评论(0) 推荐(0) 编辑
摘要: // Get a pixel int rgb = bufferedImage.getRGB(x, y); // Get all the pixels int w = bufferedImage.getWidth(null); int h = bufferedImage.getHeight(null); int[] rgbs = new ... 阅读全文
posted @ 2018-09-02 21:51 borter 阅读(266) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates how to convert a byte array of pixel values that are indices to a color table into an Image. In particular, the example gene 阅读全文
posted @ 2018-09-02 21:51 borter 阅读(135) 评论(0) 推荐(0) 编辑
摘要: An Image object cannot be converted to a BufferedImage object. The closest equivalent is to create a buffered image and then draw the image on the buf 阅读全文
posted @ 2018-09-02 21:50 borter 阅读(145) 评论(0) 推荐(0) 编辑
摘要: This example demonstrates a 3x3 kernel that blurs an image. 阅读全文
posted @ 2018-09-02 21:50 borter 阅读(182) 评论(0) 推荐(0) 编辑
摘要: // This method returns true if the specified image has transparent pixels public static boolean hasAlpha(Image image) { // If buffered image, the color model is readily available ... 阅读全文
posted @ 2018-09-02 21:49 borter 阅读(165) 评论(0) 推荐(0) 编辑