Package java.awt.image

Examples of java.awt.image.BufferedImage


     * @param scaledWidth the desired pixel width of the image.
     * @param scaledHeight the desired pixel height of the image.
     * @return byte[] representing the image.
     */
    public byte[] getScaledImageBytes(int scaledWidth, int scaledHeight) {
        BufferedImage bi = getScaledBufferedImage(scaledWidth, scaledHeight);
        if (bi == null) {
            return new byte[0];
        } else {
            Debug.message("formatter",
                    "Formatter: creating formatted image bytes...");
View Full Code Here


     * @param pixels the array of pixels in RGB directcolor
     * @exception IOException an error occured in encoding the image
     */
    public static byte[] encodeGif(int w, int h, int[] pixels)
            throws IOException {
        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
        bi.setRGB(0, 0, w, h, pixels, 0, w);
        pixels = null;
        return encodeGif(bi);
    }
View Full Code Here

     */
    public void view() {
        int height = 256;
        int width = 256;

        BufferedImage bigImage = new BufferedImage(width * 6, height * 6, BufferedImage.TYPE_INT_RGB);
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Graphics g = ge.createGraphics(bigImage);
        Toolkit tk = Toolkit.getDefaultToolkit();

        for (int x = 0; x < 6; x++) {
View Full Code Here

     *
     * @return DEFAULT_SYMBOL_IMAGE
     */
    public static ImageIcon getNotFoundImageIcon() {
        if (DEFAULT_SYMBOL_IMAGE == null) {
            BufferedImage bi = new BufferedImage(DEFAULT_ICON_DIMENSION, DEFAULT_ICON_DIMENSION, BufferedImage.TYPE_INT_RGB);
            Graphics g = bi.getGraphics();
            g.setColor(Color.LIGHT_GRAY);
            g.fillRect(0, 0, DEFAULT_ICON_DIMENSION, DEFAULT_ICON_DIMENSION);
            DEFAULT_SYMBOL_IMAGE = new ImageIcon(bi);
        }
        return DEFAULT_SYMBOL_IMAGE;
View Full Code Here

                createImageFileButton.setEnabled(false);
                return;
            }

            try {
                BufferedImage bi = BufferedImageHelper.getBufferedImage(ii.getImage(),
                        0,
                        0,
                        (int) d.getWidth(),
                        (int) d.getHeight(),
                        BufferedImage.TYPE_INT_ARGB);
View Full Code Here

     *        directions for other versions.
     */
    public ImageIcon createArrowIcon(BasicStroke stroke, int width, int height,
                                     int arrowHeadType) {

        BufferedImage bigImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = (Graphics2D) bigImage.getGraphics();

        int middleY = height / 2;

        g.setBackground(OMColor.clear);
        g.setPaint(OMColor.clear);
View Full Code Here

    public static BufferedImage getJAIBufferedImage(String opName,
                                                    Object param, int x, int y,
                                                    int w, int h)
            throws InterruptedException {

        BufferedImage bi = getJAIBufferedImage(opName, param);

        // If the whole image isn't wanted, do another operation...
        if (bi != null && (x != 0 || y != 0 || w > 0 || h > 0)) {

            int imageType = BufferedImage.TYPE_INT_RGB;
            if (bi.getColorModel().hasAlpha()) {
                imageType = BufferedImage.TYPE_INT_ARGB;
            }

            return getBufferedImage(bi, x, y, w, h, imageType);
        }
View Full Code Here

        if (url == null) {
            return null;
        }
       
        BufferedImage bi = getJAIBufferedImage("url", url, x, y, w, h);

        if (bi != null) {
            return bi;
        }
View Full Code Here

     */
    public static BufferedImage getBufferedImage(String path, int x, int y,
                                                 int w, int h)
            throws InterruptedException {

        BufferedImage bi = getJAIBufferedImage("file", path, x, y, w, h);

        if (bi != null) {
            return bi;
        }

View Full Code Here

                    y,
                    w,
                    h,
                    imageType);
        } else {
            BufferedImage bufferedImage = new BufferedImage(w, h, imageType);
            Graphics2D g2d = bufferedImage.createGraphics();
            g2d.drawImage(image, x, y, null);
            g2d.dispose();
            return bufferedImage;
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.image.BufferedImage

Copyright © 2015 www.massapicom. 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.