Package java.awt

Examples of java.awt.Image


        int width = image.getWidth();
        int height = image.getHeight();

        if (width > height) {
          Image newImage =
            image.getScaledInstance(w, -1, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            0,
            (h - newImage.getHeight(null)) / 2,
            null);
        } else {
          Image newImage =
            image.getScaledInstance(-1, h, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            (w - newImage.getWidth(null)) / 2,
            0,
            null);
        }

        ImageIO.write(myImage, "jpg", possibleCached);
View Full Code Here


        int width = image.getWidth();
        int height = image.getHeight();

        if (width > height) {
          Image newImage =
            image.getScaledInstance(w, -1, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            0,
            (h - newImage.getHeight(null)) / 2,
            null);
        } else {
          Image newImage =
            image.getScaledInstance(-1, h, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            (w - newImage.getWidth(null)) / 2,
            0,
            null);
        }

        ImageIO.write(myImage, "jpg", possibleCached);
View Full Code Here

      }
    });
  }

  private Image loadImage(String path) {
    Image pic = null;
    // Modified by Zerbetto
    //java.net.URL imageURL = ClassLoader.getSystemResource(path);
    java.net.URL imageURL = this.getClass().getClassLoader().getResource(path);

    // end modifications
View Full Code Here

        }
      }
     
      KnowledgeFlowApp.createSingleton(args);

      Image icon = Toolkit.getDefaultToolkit().
        getImage(m_knowledgeFlow.getClass().getClassLoader().getResource("weka/gui/weka_icon_new_48.png"));
      jf.setIconImage(icon);

      jf.getContentPane().add(m_knowledgeFlow, java.awt.BorderLayout.CENTER);
      jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
View Full Code Here

                } else if (arg instanceof FileObject) {
                    img = generator.createImage(((FileObject) arg).getFile().getAbsolutePath());
                } else if (arg instanceof InputStream) {
                    img = generator.createImage((InputStream) arg);
                } else {
                    Image image = null;
                    if (arg instanceof BufferedImage) {
                        // no need to wait for buffered images:
                        image = (Image) arg;
                    } else if (arg instanceof Image) {
                        // wait for all the other image types:
                        image = ImageWaiter.waitForImage((Image) arg);
                    }
                    if (image != null) {
                        img = new ImageWrapper(image, image.getWidth(null), image.getHeight(null), generator);
                    }
                }
            } else if (args.length == 2) {
                if (args[0] instanceof Number &&
                                   args[1] instanceof Number) {
View Full Code Here

       
        // Render the program
        if (panel != null) {
          int cellHeight = panel.getHeight();

          Image backImg = getBackgroundImageFor(panel.getProgram());
          fillImage(grp, x, y, columnWidth, cellHeight, backImg, clipBounds);
         
          // Move to the next row in this column
          y += cellHeight;
        }
View Full Code Here

    boolean toggleFlag = true;
    int minY;
    int maxY = -1;
    for (int i = 0; i < blockArr.length; i++) {
      // Get the image of this time block
      Image backImg;
      if (toggleFlag) {
        backImg = mBackgroundImage1;
      } else {
        backImg = mBackgroundImage2;
      }

      // Get the y positions of this time block
      minY = blockArr[i].mStartY;
      if ((i + 1) < blockArr.length) {
        maxY = blockArr[i + 1].mStartY;
      } else {
        maxY = tableHeight;
      }

      // Paint the background of this time block
      int x = minCol * columnWidth;
      for (int col = minCol; col <= maxCol; col++) {
        fillImage(grp, x, minY, columnWidth, (maxY - minY), backImg, clipBounds);

        x += columnWidth;
      }

      // Toggle the background
      toggleFlag = !toggleFlag;
    }

    // Paint the rest if needed
    if (maxY < tableHeight) {
      minY = maxY + 1;
      maxY = tableHeight;

      // Get the image of this time block
      Image backImg;
      if (toggleFlag) {
        backImg = mBackgroundImage1;
      } else {
        backImg = mBackgroundImage2;
      }
View Full Code Here

            // this piece is not visible at all
            continue;
          }

          // Get the image of this time block
          Image backImg;
          if (toggleFlag) {
            backImg = mTableWestImage1;
          } else {
            backImg = mTableWestImage2;
          }
View Full Code Here

   * @return Icon
   */
  private Icon createUserIcon() {
    Icon icon;
    if ((mIconFile != null) && (mIconFile.exists())) {
      Image img = ImageUtilities.createImageAsynchronous(mIconFile.getAbsolutePath());
      if (img != null) {
        icon = UiUtilities.createChannelIcon(new ImageIcon(img));
      } else {
        icon = UiUtilities.createChannelIcon(mChannel.getIcon());
      }
View Full Code Here

      macosxApplication.setEnabledPreferencesMenu(true);
     
      // Set application icon if program wasn't launch from bundle
      if (!"true".equalsIgnoreCase(System.getProperty("furniturelibraryeditor.bundle", "false"))) {
        try {
          Image icon = ImageIO.read(MacOSXConfiguration.class.getResource("swing/resources/aboutIcon.png"));
          macosxApplication.setDockIconImage(icon);
        } catch (NoSuchMethodError ex) {
          // Ignore icon change if setDockIconImage isn't available
        } catch (IOException ex) {
        }
View Full Code Here

TOP

Related Classes of java.awt.Image

Copyright © 2018 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.