Package javax.media.jai

Examples of javax.media.jai.TiledImage.createGraphics()


    public void testFlipTranslated() throws Exception {
        // build a translated image
        SampleModel sm = RasterFactory.createPixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, 256, 256, 3);
        ColorModel cm = PlanarImage.createColorModel(sm);
        TiledImage ti = new TiledImage(-10, -10, 5, 5, 0, 0, sm, cm);
        Graphics2D g = ti.createGraphics();
        g.setColor(Color.GREEN);
        g.fillRect(-10, -10, 5, 5);
        g.dispose();
       
        // build a coverage around it
View Full Code Here


 
    @Test
    public void testTranslatedImage() throws Exception {
      BufferedImage bi = new BufferedImage(256, 256, BufferedImage.TYPE_BYTE_GRAY);
        TiledImage image = new TiledImage(0, 0, 256, 256, 1, 1, bi.getSampleModel().createCompatibleSampleModel(256, 256), bi.getColorModel());
        Graphics g = image.createGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, 20, 20);
        g.setColor(new Color(20, 20, 20)); // A dark gray
        g.fillRect(20, 20, 20, 20);
        g.setColor(new Color(200, 200, 200)); // A light gray
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.