Package java.awt

Examples of java.awt.Image


    // finish with this ImageObserver
    if (state == STATE_DONE) return false;

    // if image frame is ready to be drawn and is currently not being painted
    if (flag == ImageObserver.FRAMEBITS && !painting) {
      Image buffer;

      // select which buffer to fill
      if (img == logo) buffer = logoBuffer;
      else buffer = progressbarBuffer;

      Graphics g = buffer.getGraphics();

      // clear background on buffer
      g.setColor(bgColor);
      g.fillRect(0, 0, buffer.getWidth(null), buffer.getHeight(null));

      // buffer background is cleared, so draw logo under progressbar
      if (img == progressbar && logo != null) {
        g.drawImage(logoBuffer, progressbar.getWidth(null)/2-logo.getWidth(null)/2,
                    progressbar.getHeight(null)/2-logo.getHeight(null)/2, null);
View Full Code Here


   * @param s location of the image
   * @return the Image file
   */
  protected Image getImage(String s) {
   
    Image image = null;
   
    try {
      image = getImage(new URL(getCodeBase(), s));
    } catch (Exception e) {
      /* */
 
View Full Code Here

   * @param url location of the image
   * @return the Image file
   */
  public Image getImage(URL url) {
    try {
      Image image = super.getImage(url);

      // wait for image to load
      MediaTracker tracker = new MediaTracker(this);
          tracker.addImage(image, 0);
          tracker.waitForAll();
View Full Code Here

        final ResourceManager manager = context.getResourceManager();
        try
        {
          final ResourceKey key = createKeyFromString(manager, contentBase, backgroundImage);
          final Resource resource = manager.create(key, null, Image.class);
          final Image image = (Image) resource.getResource();
          plot.setBackgroundImage(image);
          plotImageCache = image;
        }
        catch (Exception e)
        {
View Full Code Here

        }

        // due to an issue with ImageIO and mixed signed code
        // we are now using good oldfashioned ImageIcon to load
        // images and the paint it on top of a new BufferedImage
        Image img = new ImageIcon(url).getImage();
        BufferedImage bufferedImage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
        Graphics g = bufferedImage.getGraphics();
        g.drawImage(img, 0, 0, null);
        g.dispose();

        return bufferedImage;
View Full Code Here

      drawDrawable(content, g2, d);
    }
    else if (o instanceof LocalImageContainer)
    {
      final LocalImageContainer imageContainer = (LocalImageContainer) o;
      final Image image = imageContainer.getImage();
      drawImage(content, image);
    }
    else if (o instanceof URLImageContainer)
    {
      final URLImageContainer imageContainer = (URLImageContainer) o;
      if (imageContainer.isLoadable() == false)
      {
        LogicalPageDrawable.logger.info("URL-image cannot be rendered, as it was declared to be not loadable.");
        return;
      }

      final ResourceKey sourceURL = imageContainer.getResourceKey();
      if (sourceURL == null)
      {
        LogicalPageDrawable.logger.info("URL-image cannot be rendered, as it did not return a valid URL.");
      }

      try
      {
        final Resource resource = resourceManager.create(sourceURL, null, Image.class);
        final Image image = (Image) resource.getResource();
        drawImage(content, image);
      }
      catch (ResourceException e)
      {
        LogicalPageDrawable.logger.info("URL-image cannot be rendered, as the image was not loadable.", e);
View Full Code Here

                                    final long clipHeight,
                                    final double deviceScaleFactor)
      throws IOException, UnsupportedEncoderException
  {

    Image image = null;
    // The image has an assigned URL ...
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImage = (URLImageContainer) reference;
      final ResourceKey url = urlImage.getResourceKey();
View Full Code Here

  }

  private int loadImage(final Workbook workbook, final ImageContainer reference)
      throws IOException, UnsupportedEncoderException
  {
    Image image = null;
    // The image has an assigned URL ...
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImage = (URLImageContainer) reference;
      final ResourceKey url = urlImage.getResourceKey();
View Full Code Here

    if (image instanceof LocalImageContainer)
    {
      // Check, whether the imagereference contains an AWT image.
      // if so, then we can use that image instance for the recoding
      final LocalImageContainer li = (LocalImageContainer) image;
      Image awtImage = li.getImage();
      if (awtImage == null)
      {
        if (url != null)
        {
          try
View Full Code Here

              instance = com.lowagie.text.Image.getInstance(data.getResource(resourceManager));
              imageCache.put(resource, instance);
            }

            final Resource imageWrapped = resourceManager.create(resource, null, Image.class);
            final Image image = (Image) imageWrapped.getResource();

            if (drawImage(content, image, instance))
            {
              drawImageMap(content);
            }
            return;
          }
          catch (InvalidReportStateException re)
          {
            throw re;
          }
          catch (Exception e)
          {
            PdfLogicalPageDrawable.logger.info("URL-image cannot be rendered, as the image was not loadable.", e);
          }
        }
      }
    }

    if (o instanceof LocalImageContainer)
    {
      final LocalImageContainer imageContainer = (LocalImageContainer) o;
      final Image image = imageContainer.getImage();
      if (drawImage(content, image))
      {
        drawImageMap(content);
      }
    }
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.