Examples of createCompatibleWritableRaster()


Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

        if (cmt == null) {
            // awt.18=Transparency is not supported.
            throw new IllegalArgumentException(Messages.getString("awt.18")); //$NON-NLS-1$
        }

        return new BufferedImage(cmt, cmt.createCompatibleWritableRaster(width, height), false, null);
    }

    @Override
    public ColorModel getColorModel() {
        return cm;
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (gc == null) {
                return null;
            }
            ColorModel cm = gc.getColorModel(Transparency.OPAQUE);
            WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
            Image image = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
            fillImageBackground(image, width, height);
            return image;
        } finally {
            toolkit.unlockAWT();
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            int w = argbWR.getWidth();
            int h = argbWR.getHeight();
            int minX = argbWR.getMinX();
            int minY = argbWR.getMinY();
            WritableRaster srcWR =
                imgCM.createCompatibleWritableRaster(w, h);
            srcWR = srcWR.createWritableTranslatedChild(minX, minY);
            img.copyData(srcWR);

            /**
             * If the source data is not a ComponentColorModel using a
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            int w = argbWR.getWidth();
            int h = argbWR.getHeight();
            int minX = argbWR.getMinX();
            int minY = argbWR.getMinY();
            WritableRaster srcWR =
                imgCM.createCompatibleWritableRaster(w, h);
            srcWR = srcWR.createWritableTranslatedChild(minX, minY);
            img.copyData(srcWR);

            /**
             * If the source data is not a ComponentColorModel using a
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

    else
    {
      final ColorModel cm = img.getColorModel();
      final int width = img.getWidth();
      final int height = img.getHeight();
      final WritableRaster raster = cm.createCompatibleWritableRaster(width, height);
      final boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
      final Hashtable properties = new Hashtable();
      final String[] keys = img.getPropertyNames();
      if (keys != null)
      {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

    else
    {
      final ColorModel cm = img.getColorModel();
      final int width = img.getWidth();
      final int height = img.getHeight();
      final WritableRaster raster = cm.createCompatibleWritableRaster(width, height);
      final boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
      final Hashtable properties = new Hashtable();
      final String[] keys = img.getPropertyNames();
      if (keys != null)
      {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

      int targetWidth = srcImg.getWidth();
      int targetHeight = srcImg.getHeight()+EXIF_SIZE_FOOT;
      int type = srcImg.getType();
          if (type == BufferedImage.TYPE_CUSTOM) {
              ColorModel cm = srcImg.getColorModel();
              WritableRaster raster = cm.createCompatibleWritableRaster(targetWidth,
                      targetHeight);
              boolean alphaPremultiplied = cm.isAlphaPremultiplied();
              targetImg = new BufferedImage(cm, raster, alphaPremultiplied, null);
          } else {
              targetImg = new BufferedImage(targetWidth, targetHeight, type);
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

      int targetWidth = srcImg.getWidth();
      int targetHeight = srcImg.getHeight()+EXIF_SIZE_HEAD+EXIF_SIZE_FOOT;
      int type = srcImg.getType();
          if (type == BufferedImage.TYPE_CUSTOM) {
              ColorModel cm = srcImg.getColorModel();
              WritableRaster raster = cm.createCompatibleWritableRaster(targetWidth,
                      targetHeight);
              boolean alphaPremultiplied = cm.isAlphaPremultiplied();
              targetImg = new BufferedImage(cm, raster, alphaPremultiplied, null);
          } else {
              targetImg = new BufferedImage(targetWidth, targetHeight, type);
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

      int type = srcImg.getType();
      //create new BufferedImage instance to draw more elements
          BufferedImage targetImg = null;
          if (type == BufferedImage.TYPE_CUSTOM) {
              ColorModel cm = srcImg.getColorModel();
              WritableRaster raster = cm.createCompatibleWritableRaster(targetWidth,
                      targetHeight);
              boolean alphaPremultiplied = cm.isAlphaPremultiplied();
              targetImg = new BufferedImage(cm, raster, alphaPremultiplied, null);
          } else {
              targetImg = new BufferedImage(targetWidth, targetHeight, type);
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

    }
        
        BufferedImage target = null;
        if (type == BufferedImage.TYPE_CUSTOM) {  
            ColorModel cm = image.getColorModel();   
            WritableRaster raster = cm.createCompatibleWritableRaster(tw,   
                    th);   
            boolean alphaPremultiplied = cm.isAlphaPremultiplied();   
            target = new BufferedImage(cm, raster, alphaPremultiplied, null);   
        } else
            target = new BufferedImage(tw, th, type)
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.