Package java.awt

Examples of java.awt.Image


            if (Debug.debugging("beanbox"))
                Debug.output("No beanInfo found for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
        }

        Image img = beanInfo.getIcon(BeanInfo.ICON_COLOR_32x32);

        if (img == null) {
            if (Debug.debugging("beanbox"))
                Debug.output("No image found in beanInfo for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
View Full Code Here


   * @return FontMetrics for a font
   */
  public FontMetrics getFontMetrics(Font font) {
    Frame dummy = new Frame();
    dummy.addNotify();
    Image image = dummy.createImage(100, 100);
    if (image == null) {
      System.err.println("getFontMetrics: image is null");
    }
    Graphics graphics = image.getGraphics();
    return graphics.getFontMetrics(font);

  }
View Full Code Here


  private void doFirstPage(Graphics pdfGraphics) {
    Dimension d = documentDimension;
    // Get the graphics object for screen drawing
    Image img = drawingArea.createImage((int)d.getWidth(),
                                        (int)d.getHeight());
    if (img == null) {
      System.out.println("Error!! - drawing image is null");
      System.exit(1);
    }

    drawingArea.setImage(img);
    Graphics javaGraphics = img.getGraphics();   

    // Now we have two Graphics objects - one for java Graphics to
    // draw to the screen , another to write
    // to the pdf file.  We'll use the same methods to act on both
    // objects, and (theoretically) the results should be identical.
View Full Code Here

   * @param d a <code>Dimension</code> value
   */
  private void drawSampleImage(Graphics g, Dimension d) {
    try {
      Toolkit toolkit = Toolkit.getDefaultToolkit();
      Image img = toolkit.createImage(sampleImageFile);
      MediaTracker tracker = new MediaTracker(drawingArea);
      tracker.addImage(img, 0);
      try {
        tracker.waitForID(0);
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      /* bazsoft
      g.drawImage(img, 300, 300,
                  img.getWidth(drawingArea),
                  img.getHeight(drawingArea),
                  Color.green,
                  drawingArea);
                  */
      g.drawImage(img, 10, 10,
                  img.getWidth(drawingArea),
                  img.getHeight(drawingArea),
                  Color.green,
                  drawingArea);
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  private void doSecondPage() {

    Dimension d = documentDimension;
    // Get the graphics object for screen drawing
    Image img = drawingArea.createImage((int)d.getWidth(),
                                        (int)d.getHeight());
    if (img == null) {
      System.out.println("Error!! - drawing image is null");
      System.exit(1);
    }

    drawingArea.setImage(img);
    Graphics javaGraphics = img.getGraphics();   
  
    doSecondPageTest(javaGraphics);
    javaGraphics.dispose();

    currentPage = 2;
View Full Code Here

                                 final Object hintValue,
                                 final boolean higherQuality)
  {
    final int type = BufferedImage.TYPE_INT_ARGB;

    Image ret = img;
    int w;
    int h;
    do
    {

      if (higherQuality)
      {
        final int imageWidth = ret.getWidth(null);
        final int imageHeight = ret.getHeight(null);
        if (imageWidth < targetWidth)
        {
          // This is a up-scale operation.
          w = Math.min(imageWidth << 1, targetWidth);
        }
View Full Code Here

    {
      return null;
    }

    final double scale = RenderUtility.getNormalizationScale(metaData);
    final Image image = ImageUtils.createTransparentImage((int) (imageWidth * scale), (int) (imageHeight * scale));
    final Graphics2D g2 = (Graphics2D) image.getGraphics();

    final Object attribute =
        box.getStyleSheet().getStyleProperty(ElementStyleKeys.ANTI_ALIASING);
    if (attribute != null)
    {
View Full Code Here

      }
      if (resource != null)
      {
        final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
        final Resource loadedResource = resManager.createDirectly(resource, Image.class);
        final Image image = (Image) loadedResource.getResource();
        return new ReportDrawableImage(image);
      }
    }
    catch (Exception e)
    {
View Full Code Here

                        DcObject o,
                        boolean applyTemplate) {

        super("", null);
       
        Image icon = o.getModule().getIcon32() != null ? o.getModule().getIcon32().getImage() :
                     o.getModule().getIcon16() != null ? o.getModule().getIcon16().getImage() :
                     IconLibrary._icoMain.getImage();
       
        setIconImage(icon);
        this.applyTemplate =  applyTemplate && !update;
View Full Code Here

        if (file == null)
            return;
       
        try {
            byte[] bytes = Utilities.readFile(file);
            Image image = Utilities.getScaledImage(bytes, size.width, size.height);
            setIcon(new DcImageIcon(image));
            image = null;
            changed = true;
        } catch (Exception exp) {
            DcSwingUtilities.displayErrorMessage(exp.toString());
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.