Package java.awt

Examples of java.awt.Image


    public GetPictureResponse GetPicture(GetPicture req)
    {
        GetPictureResponse response = new GetPictureResponse();
        try
        {
            Image image = ImageIO.read(getTestFile("src/test-resources/xfire.jpg"));
            response.setImage(image);
        }
        catch (IOException e)
        {
            e.printStackTrace();
View Full Code Here



      // set the application icon
      java.net.URL oUrl;
      oUrl = this.getClass().getResource("AppIcon.gif");
      Image img = null;
      if (oUrl != null)
         img = java.awt.Toolkit.getDefaultToolkit().getImage(oUrl);
      if(img != null)
      {
        this.setIconImage(img);
        System.out.println(img.toString());
      }
      else
      {
        System.out.println("AppIcon.gif not found");
      }
View Full Code Here

public ImageIcon loadIcon(String filename){
  ImageIcon icon = null;
  java.net.URL oUrl;
  oUrl = this.getClass().getResource(filename);
  Image img;
  img = java.awt.Toolkit.getDefaultToolkit().getImage(oUrl);
  if(img != null)
  {
    icon = new ImageIcon(img);
  }
View Full Code Here

  }


  protected void setPageImage()
  {
    Image image;
    if (pageError)
    {
      image = getPageErrorImage();
    }
    else
View Full Code Here

    lblPage.setIcon(imageIcon);
  }

  protected Image getPageErrorImage()
  {
    Image image = new BufferedImage(
        (int) (jasperPrint.getPageWidth() * realZoom) + 1,
        (int) (jasperPrint.getPageHeight() * realZoom) + 1,
        BufferedImage.TYPE_INT_RGB
        );
   
    Graphics2D grx = (Graphics2D) image.getGraphics();
    AffineTransform transform = new AffineTransform();
    transform.scale(realZoom, realZoom);
    grx.transform(transform);

    drawPageError(grx);
View Full Code Here

    }
  }

  protected void setPageImage()
  {
    Image image;
    if (pageError)
    {
      image = getPageErrorImage();
    }
    else
View Full Code Here

    lblPage.setIcon(imageIcon);
  }

  protected Image getPageErrorImage()
  {
    Image image = new BufferedImage(
        (int) (viewerContext.getJasperPrint().getPageWidth() * realZoom) + 1,
        (int) (viewerContext.getJasperPrint().getPageHeight() * realZoom) + 1,
        BufferedImage.TYPE_INT_RGB
        );
   
    Graphics2D grx = (Graphics2D) image.getGraphics();
    AffineTransform transform = new AffineTransform();
    transform.scale(realZoom, realZoom);
    grx.transform(transform);

    drawPageError(grx);
View Full Code Here

   */
  public Image getImage() throws JRException
  {
    if (awtImageRef == null || awtImageRef.get() == null)
    {
      Image awtImage = JRImageLoader.loadImage(getImageData());
      awtImageRef = new SoftReference(awtImage);
    }
    return (Image) awtImageRef.get();
  }
View Full Code Here

  /**
   *
   */
  public Dimension2D getDimension() throws JRException
  {
    Image img = getImage();
    return new Dimension(img.getWidth(null), img.getHeight(null));
  }
View Full Code Here

  /**
   *
   */
  public void render(Graphics2D grx, Rectangle2D rectangle) throws JRException
  {
    Image img = getImage();

    grx.drawImage(
      img,
      (int)rectangle.getX(),
      (int)rectangle.getY(),
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.