Examples of createImage()


Examples of javax.media.util.BufferToImage.createImage()

      assertEquals(f.getFlipped(), 0);
      final BufferToImage b2i = new BufferToImage(f);
      final Buffer buffer = new Buffer();
      buffer.setFormat(f);
      buffer.setData(new byte[] {(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10,(byte)11,(byte)12,(byte)13,(byte)14,(byte)15,(byte)16,(byte)17,(byte)18,(byte)19,(byte)20,(byte)21,(byte)22,(byte)23,(byte)24,(byte)25,(byte)26,(byte)27,(byte)28,(byte)29,(byte)30,(byte)31,(byte)32,(byte)33,(byte)34,(byte)35,(byte)36,(byte)37,(byte)38,(byte)39,(byte)40,(byte)41,(byte)42,(byte)43,(byte)44,(byte)45,(byte)46,(byte)47});
      final BufferedImage i = (BufferedImage) b2i.createImage(buffer);
      assertTrue(i != null);
      assertEquals(i.getWidth(), f.getSize().width);
      assertEquals(i.getHeight(), f.getSize().height);
      assertEquals(i.getColorModel().getColorSpace().getType(), ColorSpace.TYPE_RGB);
      assertEquals(i.getType(), BufferedImage.TYPE_INT_RGB);
View Full Code Here

Examples of javax.media.util.BufferToImage.createImage()

      assertEquals(f.getFlipped(), 0);
      final BufferToImage b2i = new BufferToImage(f);
      final Buffer buffer = new Buffer();
      buffer.setFormat(f);
      buffer.setData(new byte[] {(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10,(byte)11,(byte)12,(byte)13,(byte)14,(byte)15,(byte)16,(byte)17,(byte)18,(byte)19,(byte)20,(byte)21,(byte)22,(byte)23,(byte)24,(byte)25,(byte)26,(byte)27,(byte)28,(byte)29,(byte)30,(byte)31,(byte)32,(byte)33,(byte)34,(byte)35,(byte)36,(byte)37,(byte)38,(byte)39,(byte)40,(byte)41,(byte)42,(byte)43,(byte)44,(byte)45,(byte)46,(byte)47,(byte)48,(byte)49,(byte)50,(byte)51,(byte)52,(byte)53,(byte)54,(byte)55,(byte)56,(byte)57,(byte)58,(byte)59,(byte)60,(byte)61,(byte)62,(byte)63});
      final BufferedImage i = (BufferedImage) b2i.createImage(buffer);
      assertTrue(i != null);
      assertEquals(i.getWidth(), f.getSize().width);
      assertEquals(i.getHeight(), f.getSize().height);
      assertEquals(i.getColorModel().getColorSpace().getType(), ColorSpace.TYPE_RGB);
      assertEquals(i.getType(), BufferedImage.TYPE_INT_RGB);
View Full Code Here

Examples of javax.media.util.BufferToImage.createImage()

      assertEquals(f.getFlipped(), 1);
      final BufferToImage b2i = new BufferToImage(f);
      final Buffer buffer = new Buffer();
      buffer.setFormat(f);
      buffer.setData(new byte[] {(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10,(byte)11,(byte)12,(byte)13,(byte)14,(byte)15,(byte)16,(byte)17,(byte)18,(byte)19,(byte)20,(byte)21,(byte)22,(byte)23,(byte)24,(byte)25,(byte)26,(byte)27,(byte)28,(byte)29,(byte)30,(byte)31,(byte)32,(byte)33,(byte)34,(byte)35,(byte)36,(byte)37,(byte)38,(byte)39,(byte)40,(byte)41,(byte)42,(byte)43,(byte)44,(byte)45,(byte)46,(byte)47});
      final BufferedImage i = (BufferedImage) b2i.createImage(buffer);
      assertTrue(i != null);
      assertEquals(i.getWidth(), f.getSize().width);
      assertEquals(i.getHeight(), f.getSize().height);
      assertEquals(i.getColorModel().getColorSpace().getType(), ColorSpace.TYPE_RGB);
      assertEquals(i.getType(), BufferedImage.TYPE_INT_RGB);
View Full Code Here

Examples of javax.swing.JComponent.createImage()

            //get image information
            if (imageType.equalsIgnoreCase("gif")) {
                Rectangle rect = GlobalFunction.checkMinimumViewport(view);
                Dimension size = new Dimension(rect.width + 10, rect.height + 10);

                image = comp.createImage(size.width, size.height);

                g2d = (Graphics2D) image.getGraphics();
                g2d.setColor(new Color(TRANSPARENT_BG_COLOR));
                g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
View Full Code Here

Examples of javax.swing.JFrame.createImage()

  public void testImageDataSet()
  {
    JFrame frame = new JFrame();
    frame.setVisible(true);
    Image image = frame.createImage(10, 10);
    Graphics g = image.getGraphics();
    g.setColor(Color.BLACK);
    g.fillRect(0,0,10,10);
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, 5, 5);
View Full Code Here

Examples of javax.swing.JPanel.createImage()

                pcursor++;
                pmask++;
            }
        }
        JPanel jp = new JPanel();
        Image wincursor = jp.createImage(new MemoryImageSource(w, h, cursor, 0, w));
        return createCustomCursor(wincursor, p, "", cache_idx);
    }

    /**
     * Create an AWT Cursor from an image
View Full Code Here

Examples of org.ajax4jsf.resource.ImageRenderer.createImage()

  public void send(ResourceContext context) throws IOException {
    ImageData data = (ImageData) restoreData(context);
    ImageRenderer renderer = (ImageRenderer) getRenderer(context);
    FacesContext facesContext = FacesContext.getCurrentInstance();
    try {
      BufferedImage image = renderer.createImage(data._width,data._height);
      Graphics2D graphics = image.createGraphics();
     
      try {
        if (data._bgColor != 0) {
          Color color = new Color(data._bgColor);
View Full Code Here

Examples of org.apache.batik.refimpl.transcoder.ImageTranscoder.createImage()

        // Begin encoding to PNG image file
        ImageTranscoder transcoder
            = (ImageTranscoder)getTranscoder();

        Dimension size = painter.getSize();
        BufferedImage buf = transcoder.createImage(size.width, size.height);
        Graphics2D g = buf.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                           RenderingHints.VALUE_ANTIALIAS_ON);

        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
View Full Code Here

Examples of org.apache.batik.refimpl.transcoder.JpegTranscoder.createImage()

                BufferedImage buffer = canvas.getBuffer();
                // create a BufferedImage of the appropriate type
                int w = buffer.getWidth();
                int h = buffer.getHeight();
                final ImageTranscoder trans = new JpegTranscoder();
                final BufferedImage img = trans.createImage(w, h);
                // paint the buffer to the image
                Graphics2D g2d = img.createGraphics();
                g2d.drawImage(buffer, null, 0, 0);
                new Thread() {
                    public void run() {
View Full Code Here

Examples of org.apache.batik.refimpl.transcoder.PngTranscoder.createImage()

                BufferedImage buffer = canvas.getBuffer();
                // create a BufferedImage of the appropriate type
                int w = buffer.getWidth();
                int h = buffer.getHeight();
                final ImageTranscoder trans = new PngTranscoder();
                final BufferedImage img = trans.createImage(w, h);
                // paint the buffer to the image
                Graphics2D g2d = img.createGraphics();
                g2d.drawImage(buffer, null, 0, 0);
                new Thread() {
                    public void run() {
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.