Package java.awt.image

Examples of java.awt.image.BufferedImage


            if(new File("imgs/TrayIcon.png").isFile()) {
              mTrayIcon = new TrayIcon(ImageIO.read(new File("imgs/TrayIcon.png")), tooltip);
            }
            else {
              Dimension trayIconSize = getTrayIconSize();
              BufferedImage trayIconImage = null;
              Color backgroundColor = null;

              if(trayIconSize.height > 16 && trayIconSize.height <= 32 && new File("imgs/tvbrowser32.png").isFile()) {
                trayIconImage = UiUtilities.scaleIconToBufferedImage(ImageIO.read(new File("imgs/tvbrowser32.png")),
                    trayIconSize.width, trayIconSize.height, BufferedImage.TYPE_INT_ARGB, backgroundColor);
View Full Code Here


        response.getOutputStream().write(buffer);
        response.getOutputStream().flush();
        response.getOutputStream().close();
      } else {

        BufferedImage image = ImageIO.read(tfile);

        BufferedImage myImage =
          new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics g = myImage.getGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h);

        int width = image.getWidth();
        int height = image.getHeight();
View Full Code Here

           int levelThreshold = MAX_TREE_DEPTH;
           // create a BufferedImage of only 1 pixel height for fetching the rows
           // of the image in the correct format (ARGB)
           // This speeds up things by more than factor 2, compared to the standard
           // BufferedImage.getRGB solution
           BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
           Graphics2D g2d = row.createGraphics();
           int pixels[] = ((DataBufferInt) row.getRaster().getDataBuffer()).getData();
           // make sure alpha values do not add up for each row:
           g2d.setComposite(AlphaComposite.Src);
           // calculate scanline by scanline in order to safe memory.
           // It also seems to run faster like that
           for (y = 0; y < height; y++) {
View Full Code Here

           } else {
               icm = new IndexColorModel(depth, numColors, colorMap[0], colorMap[1], colorMap[2], colorMap[3]);
           }

           // create the indexed BufferedImage:
           BufferedImage dest = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED, icm);

           if (dither)
               new DiffusionFilterOp().filter(image, dest);
           else {
               ClosestColor closest = new ClosestColor();
               // convert to indexed color
               byte[] dst = ((DataBufferByte) dest.getRaster().getDataBuffer()).getData();

               // create a BufferedImage of only 1 pixel height for fetching
               // the rows of the image in the correct format (ARGB)
               // This speeds up things by more than factor 2, compared to the
               // standard BufferedImage.getRGB solution
               BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
               Graphics2D g2d = row.createGraphics();
               int pixels[] = ((DataBufferInt) row.getRaster().getDataBuffer()).getData();
               // make sure alpha values do not add up for each row:
               g2d.setComposite(AlphaComposite.Src);
               // calculate scanline by scanline in order to safe memory.
               // It also seems to run faster like that
               Node node;
View Full Code Here

   * @throws IOException
   */
  protected boolean rotate(HttpContext ctx, String imgURL, int orient) throws IOException{
    PhotoSaver saver = this.getPhotoSaver();
    InputStream inImg = saver.read(ctx, imgURL);
    BufferedImage old_img = (BufferedImage)ImageIO.read(inImg)
    int width = old_img.getWidth();
    int height = old_img.getHeight();
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_RGB);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
    double radian = 0;
View Full Code Here

     
    }
  }
 
  private static WritableRenderedImage toImage(RgbImage rgb) {
    WritableRenderedImage im = new BufferedImage(
        rgb.getWidth(),
        rgb.getHeight(),
        BufferedImage.TYPE_INT_RGB);
    DataBufferInt dbi = new DataBufferInt(
        rgb.getData(),
        rgb.getHeight() * rgb.getWidth());
    Raster r = Raster.createRaster(
        im.getSampleModel(),
        dbi,
        null);
    im.setData(r);
    return im;
  }
View Full Code Here

    }
   
    //��ȡͼƬ�Ļ�����Ϣ�������С�ߴ����ص�
    File fOrigionalImage = new File(origionalPath);
    photo.setSize((int)fOrigionalImage.length());
    BufferedImage oldImage = (BufferedImage)ImageIO.read(fOrigionalImage);
    int old_width = oldImage.getWidth();
    int old_height = oldImage.getHeight();
    photo.setWidth(old_width);
    photo.setHeight(old_height);
    photo.setColorBit(oldImage.getColorModel().getPixelSize());
    photo.setFileName(imgFile.getFileName());
   
    {
      //��ԭͼƬ�޶���1024*768�ķ�Χ��
      int ori_width = MAX_WIDTH, ori_height = MAX_HEIGHT;
View Full Code Here

        response.getOutputStream().write(buffer);
        response.getOutputStream().flush();
        response.getOutputStream().close();
      } else {

        BufferedImage image = ImageIO.read(tfile);

        BufferedImage myImage =
          new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics g = myImage.getGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h);

        int width = image.getWidth();
        int height = image.getHeight();
View Full Code Here

  public void setStandardColor(Color color) {
    mStandardColor = color;
  }

  private Icon createIcon() {
    BufferedImage img = new BufferedImage(25, 15, BufferedImage.TYPE_INT_RGB);

    Graphics2D g = GraphicsEnvironment.getLocalGraphicsEnvironment().createGraphics(img);

    g.setColor(Color.WHITE);
    g.fillRect(1, 1, 23, 13);
View Full Code Here

    String path = "D:\\Documents and Settings\\Administrator\\����\\2006������\\IMG_4737.JPG";
    File img = new File(path);
    showEXIF(img);
   
    BufferedImage old_img = (BufferedImage)ImageIO.read(img)
    int width = old_img.getWidth();
    int height = old_img.getHeight();
   
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_BGR);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
        double xRot = width/2.0;
View Full Code Here

TOP

Related Classes of java.awt.image.BufferedImage

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.