Examples of BufferedImage


Examples of java.awt.image.BufferedImage

      radian = 270.0;
      break;
    default:
      return false;
    }
    BufferedImage old_img = (BufferedImage)ImageIO.read(new File(img_fn))
    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 xRot = 0;
View Full Code Here

Examples of java.awt.image.BufferedImage

    return s_fn.endsWith("bmp");
  }
 
  public static String BMP_TO_JPG(String imgPath) throws IOException{
    File fOrigionalImage = new File(imgPath);
    BufferedImage oldImage = (BufferedImage)ImageIO.read(fOrigionalImage);
    String jpgName = imgPath+".jpg";
    FileOutputStream newimage = new FileOutputStream(jpgName);
    try{
      if(ImageIO.write(oldImage, "jpg", newimage))
        return jpgName;
View Full Code Here

Examples of java.awt.image.BufferedImage

      setDocument(loadDocument(sourceDocument), sourceDocumentBase, new XhtmlNamespaceHandler());

      layout(this.width);

      height = this.height == -1 ? root.getHeight() : this.height;
      BufferedImage outputImage = createBufferedImage(this.width, height);
      outputDevice = new Java2DOutputDevice(outputImage);
      Graphics2D newG = (Graphics2D) outputImage.getGraphics();
      if ( renderingHints != null ) {
        newG.getRenderingHints().putAll(renderingHints);
      }

      RenderingContext rc = sharedContext.newRenderingContextInstance();
View Full Code Here

Examples of java.awt.image.BufferedImage

   * @param width target width
   * @param height target height
   * @return new BI
   */
  protected BufferedImage createBufferedImage(int width, int height) {
    BufferedImage image = ImageUtil.createCompatibleBufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    ImageUtil.clearImage(image);
    return image;
  }
View Full Code Here

Examples of java.awt.image.BufferedImage

  }

  private void init(float dotsPerPoint, int dotsPerPixel) {
    this.dotsPerPoint = dotsPerPoint;

    BufferedImage outputImage = ImageUtil.createCompatibleBufferedImage(DEFAULT_DOTS_PER_POINT, DEFAULT_DOTS_PER_POINT);
    outputDevice = new Java2DOutputDevice(outputImage);

    UserAgentCallback userAgent = new NaiveUserAgent();
        sharedContext = newSharedContext(dotsPerPixel, userAgent);
        layoutContext = newLayoutContext();
View Full Code Here

Examples of java.awt.image.BufferedImage

            - raPath.y);
        mGhostRect.setRect(ptOffset.x, ptOffset.y,
            lbl2.getPreferredSize().width, lbl2.getPreferredSize().height);

        lbl2.setSize(lbl2.getPreferredSize());
        mGhostImage = new BufferedImage(lbl2.getWidth(), lbl2
            .getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);

        mTreeImage = new BufferedImage(this.getWidth(), this.getHeight(),
            BufferedImage.TYPE_INT_ARGB_PRE);
        Graphics2D g2t = mTreeImage.createGraphics();
        this.paint(g2t);
        g2t.dispose();
View Full Code Here

Examples of java.awt.image.BufferedImage

                .getWidth(), mGhostImage.getHeight());

            Rectangle2D target = (Rectangle2D) old.clone();
            target.add(mGhostRect);

            BufferedImage bf = new BufferedImage((int) target.getWidth(),
                (int) target.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
            Graphics2D g2b = bf.createGraphics();

            int width = ((int) (mTreeImage.getWidth() - (target.getX() + target
                .getWidth()))) > 0 ? (int) target.getWidth()
                : (int) (mTreeImage.getWidth() - (target.getX()));
            int height = ((int) (mTreeImage.getHeight() - (target.getY() + target
View Full Code Here

Examples of java.awt.image.BufferedImage

        if(!img_dir.mkdirs())
          throw new IOException("Cannot make directory: " + img_dir.getParent());
      }
    }
    //�ж�ͼ��Ĵ�С��������Ҫ���е���
    BufferedImage orig_portrait = (BufferedImage)ImageIO.read(pFile.getInputStream());
    int preview_width = Math.min(PORTRAIT_WIDTH, orig_portrait.getWidth());
    int preview_height= Math.min(PORTRAIT_HEIGHT,orig_portrait.getHeight());
    if(preview_width != orig_portrait.getWidth() || preview_height!=orig_portrait.getHeight()){
      ImageUtils.createPreviewImage(pFile.getInputStream(), img_path,
          preview_width, preview_height);
    }
    else{
      ImageUtils.writeToFile(pFile, img_path);
View Full Code Here

Examples of java.awt.image.BufferedImage

          }

          String text = node.getNodeFormatter().format((ProgramItem)node.getUserObject());

          // use an image to be able to display HTML content on the node
          BufferedImage textImage = getImage(bounds);
          Graphics lg = textImage.getGraphics();

          mProgramLabel.setFont(tree.getFont());
          mProgramLabel.setForeground(g.getColor());
          mProgramLabel.setBackground(UIManager.getColor("Tree.background"));
          mProgramLabel.setText(text);
View Full Code Here

Examples of java.awt.image.BufferedImage

     * @param bounds
     * @return BufferedImage
     */
    private BufferedImage getImage(Rectangle bounds) {
      GraphicsConfiguration gc = getGraphicsConfiguration();
      BufferedImage textImage = gc.createCompatibleImage(bounds.width, bounds.height, Transparency.TRANSLUCENT);
      return textImage;
    }
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.