Package java.awt

Examples of java.awt.Graphics.drawImage()


        final int height = firstIcon.getIconHeight() + secondIcon.getIconHeight();

        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), (width - firstIcon.getIconWidth()) / 2,
            height - firstIcon.getIconHeight(), null);
        graphics.drawImage(secondIcon.getImage(), (width - secondIcon.getIconWidth()) / 2, 0, null);

        return new ImageIcon(bi);
      }
View Full Code Here


        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), (width - firstIcon.getIconWidth()) / 2,
            height - firstIcon.getIconHeight(), null);
        graphics.drawImage(secondIcon.getImage(), (width - secondIcon.getIconWidth()) / 2, 0, null);

        return new ImageIcon(bi);
      }
      case LEFT:
      {
View Full Code Here

        final int height = Math.max(firstIcon.getIconHeight(), secondIcon.getIconHeight());

        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), 0, (height - firstIcon.getIconHeight()) / 2, null);
        graphics.drawImage(secondIcon.getImage(), firstIcon.getIconWidth(), (height - secondIcon.getIconHeight()) / 2,
            null);

        return new ImageIcon(bi);
      }
View Full Code Here

        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), 0, (height - firstIcon.getIconHeight()) / 2, null);
        graphics.drawImage(secondIcon.getImage(), firstIcon.getIconWidth(), (height - secondIcon.getIconHeight()) / 2,
            null);

        return new ImageIcon(bi);
      }
      case RIGHT:
View Full Code Here

        final int height = Math.max(firstIcon.getIconHeight(), secondIcon.getIconHeight());

        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), secondIcon.getIconWidth(), (height - firstIcon.getIconHeight()) / 2,
            null);
        graphics.drawImage(secondIcon.getImage(), 0, (height - secondIcon.getIconHeight()) / 2, null);

        return new ImageIcon(bi);
      }
View Full Code Here

        final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        final Graphics graphics = bi.getGraphics();

        graphics.drawImage(firstIcon.getImage(), secondIcon.getIconWidth(), (height - firstIcon.getIconHeight()) / 2,
            null);
        graphics.drawImage(secondIcon.getImage(), 0, (height - secondIcon.getIconHeight()) / 2, null);

        return new ImageIcon(bi);
      }
    }
View Full Code Here

                          final boolean encodeAlpha) throws IOException, UnsupportedEncoderException
  {
    final BufferedImage bimage = new BufferedImage(image.getWidth(null), image.getHeight(null),
        BufferedImage.TYPE_INT_RGB);
    final Graphics g = bimage.createGraphics();
    g.drawImage(image, 0, 0, Color.WHITE, null);
    g.dispose();


    //// This is what we try to do via reflection. Yes, reflection is ugly, but it guarantees that
    //// we dont run into strange errors just because a non-Sun-JDK is used.
View Full Code Here

            final Graphics g = img.getGraphics();
            for (int x = 0; x <= w / 32; x++)
            {
                for (int y = 0; y <= h / 32; y++)
                {
                    g.drawImage(bgImage, x * 32, y * 32, null);
                }
            }
            if (g instanceof Graphics2D)
            {
                final Graphics2D gg = (Graphics2D) g;
View Full Code Here

                    pixels = new int[w*h];
                }

                BufferedImage buf = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
                Graphics g = buf.getGraphics();
                g.drawImage(image, 0, 0, w, h, null);
               
                long start = System.currentTimeMillis();
                long blitTime, putImageTime, write;
                GC gc = x11.XCreateGC(dpy, win, new NativeLong(0), null);
                long gcTime = System.currentTimeMillis();
View Full Code Here

            HANDLE oldBitmap = null;
           
            try {
                BufferedImage buf = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
                Graphics g = buf.getGraphics();
                g.drawImage(image, 0, 0, w, h, null);
               
                BITMAPINFO bmi = new BITMAPINFO();
                bmi.bmiHeader.biWidth = w;
                bmi.bmiHeader.biHeight = h;
                bmi.bmiHeader.biPlanes = 1;
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.