当前位置: 首页>>代码示例>>Java>>正文


Java BufferedImage.TYPE_INT_ARGB属性代码示例

本文整理汇总了Java中java.awt.image.BufferedImage.TYPE_INT_ARGB属性的典型用法代码示例。如果您正苦于以下问题:Java BufferedImage.TYPE_INT_ARGB属性的具体用法?Java BufferedImage.TYPE_INT_ARGB怎么用?Java BufferedImage.TYPE_INT_ARGB使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.image.BufferedImage的用法示例。


在下文中一共展示了BufferedImage.TYPE_INT_ARGB属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ImageGenerator

public ImageGenerator(int _width, int _height, Color bgColor)
{
      width = _width;
      height = _height;
      bi = new BufferedImage(
          width,
          height,
          BufferedImage.TYPE_INT_ARGB);
      Graphics gr = bi.getGraphics();
      if(null==bgColor){
          bgColor = Color.WHITE;
      }
      gr.setColor(bgColor);
      gr.fillRect(0, 0, width, height);
      paint(gr);
      gr.dispose();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:ImageGenerator.java

示例2: makeTexturePaint

private TexturePaint makeTexturePaint(int size, boolean alpha) {
    int s2 = size / 2;
    int type =
        alpha ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB;
    BufferedImage img = new BufferedImage(size, size, type);
    Color[] colors = makeGradientColors(4, alpha);
    Graphics2D g2d = img.createGraphics();
    g2d.setComposite(AlphaComposite.Src);
    g2d.setColor(colors[0]);
    g2d.fillRect(0, 0, s2, s2);
    g2d.setColor(colors[1]);
    g2d.fillRect(s2, 0, s2, s2);
    g2d.setColor(colors[3]);
    g2d.fillRect(0, s2, s2, s2);
    g2d.setColor(colors[2]);
    g2d.fillRect(s2, s2, s2, s2);
    g2d.dispose();
    Rectangle2D bounds = new Rectangle2D.Float(0, 0, size, size);
    return new TexturePaint(img, bounds);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:RenderTests.java

示例3: resizeToBig

private Image resizeToBig(Image originalImage, int biggerWidth, int biggerHeight) {
    final BufferedImage resizedImage = new BufferedImage(biggerWidth, biggerHeight,
        BufferedImage.TYPE_INT_ARGB);
    final Graphics2D g = resizedImage.createGraphics();

    g.setComposite(AlphaComposite.Src);
    g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    g.drawImage(originalImage, 0, 0, biggerWidth, biggerHeight, this);
    g.dispose();

    return resizedImage;
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:16,代码来源:FInfoDialog.java

示例4: paintComponent

/**
 * Paint the component using the Nimbus Table Header Background Painter
 */
@Override protected void paintComponent(Graphics g) {
    @SuppressWarnings("unchecked")
    Painter<JComponent> painter = (Painter) UIManager.get(
        "TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter");
    if (painter != null){
        if (g instanceof Graphics2D){
            painter.paint((Graphics2D)g,this,getWidth()+1,getHeight());
        } else {
            // paint using image to not Graphics2D to support
            // Java 1.1 printing API
            BufferedImage img =  new BufferedImage(getWidth(),getHeight(),
                    BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = (Graphics2D)img.getGraphics();
            painter.paint(g2,this,getWidth()+1,getHeight());
            g2.dispose();
            g.drawImage(img,0,0,null);
            img = null;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:TableScrollPaneCorner.java

示例5: paintComponent

/**
 * Paint the component using the Nimbus Table Header Background Painter
 */
@Override protected void paintComponent(Graphics g) {
    Painter painter = (Painter) UIManager.get(
        "TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter");
    if (painter != null){
        if (g instanceof Graphics2D){
            painter.paint((Graphics2D)g,this,getWidth()+1,getHeight());
        } else {
            // paint using image to not Graphics2D to support
            // Java 1.1 printing API
            BufferedImage img =  new BufferedImage(getWidth(),getHeight(),
                    BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = (Graphics2D)img.getGraphics();
            painter.paint(g2,this,getWidth()+1,getHeight());
            g2.dispose();
            g.drawImage(img,0,0,null);
            img = null;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:TableScrollPaneCorner.java

示例6: getBufferedImage

/**
 * Resize and return the image passing the new height and width
 * @param height
 * @param width
 * @return
 */
public BufferedImage getBufferedImage(int width, int height)
{
	// using the new approach of Java 2D API 
	BufferedImage buf = new BufferedImage(width,height, BufferedImage.TYPE_INT_ARGB);
	Graphics2D g2d = (Graphics2D) buf.getGraphics();
	g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
	g2d.drawImage(image,0,0,width,height,null);
	g2d.dispose();
	return(buf);
}
 
开发者ID:Betalord,项目名称:BHBot,代码行数:16,代码来源:MarvinImage.java

示例7: getImage

public Image getImage() {
	BufferedImage image =
           new BufferedImage(getIconWidth(), getIconHeight(),
                   BufferedImage.TYPE_INT_ARGB);
   	Graphics2D g = image.createGraphics();
   	paintIcon(null, g, 0, 0);
   	g.dispose();
   	return image;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:9,代码来源:LeftArrowIcon.java

示例8: toBufferedImage

private BufferedImage toBufferedImage(Image source) {
    if (source instanceof BufferedImage) {
        return (BufferedImage) source;
    }

    // Create a buffered image with transparency
    BufferedImage dest = new BufferedImage(source.getWidth(null), source.getHeight(null), BufferedImage.TYPE_INT_ARGB);

    // Draw the image on to the buffered image
    Graphics2D g = dest.createGraphics();
    g.drawImage(source, 0, 0, null);
    g.dispose();

    return dest;
}
 
开发者ID:defano,项目名称:jmonet,代码行数:15,代码来源:CanvasTransferHandler.java

示例9: makeIcon

private static Image makeIcon(long hIcon, boolean getLargeIcon) {
    if (hIcon != 0L && hIcon != -1L) {
        // Get the bits.  This has the side effect of setting the imageHash value for this object.
        int size = getLargeIcon ? 32 : 16;
        int[] iconBits = getIconBits(hIcon, size);
        if (iconBits != null) {
            BufferedImage img = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
            img.setRGB(0, 0, size, size, iconBits, 0, size);
            return img;
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Win32ShellFolder2.java

示例10: drawCentered

protected void drawCentered(Component c, Graphics graphics, Icon icon,
                        int x, int y) {
    int w = icon.getIconWidth();
    int h = icon.getIconHeight();
    image[0] = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    super.drawCentered(c, image[0].getGraphics(), icon, w / 2, h / 2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:ProfilerTreeTable.java

示例11: prepareTileset

private BufferedImage prepareTileset(ROM rom, ROMData data, BlockRenderer renderer, MapData mapData, boolean complete) {
    Tileset global = TilesetCache.get(rom, data, mapData.getGlobalTilesetPtr());
    Tileset local = TilesetCache.get(rom, data, mapData.getLocalTilesetPtr());

    renderer.setTilesets(global, local);

    Dimension dimension = getDimension(data);

    if (complete && rom.getGame().isGem()) {
        dimension.height = 3048;
    }

    return new BufferedImage(dimension.width, dimension.height, BufferedImage.TYPE_INT_ARGB);
}
 
开发者ID:hugmanrique,项目名称:PokeData,代码行数:14,代码来源:MapTileData.java

示例12: toBufferedImage

public static BufferedImage toBufferedImage(final ImageIcon icon) {
    if (icon == null) return null;
    final int w = icon.getIconWidth(), h = icon.getIconHeight();
    final BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); 
    final Graphics g = bi.createGraphics();
    icon.paintIcon(null, g, 0,0);
    g.dispose();
    return bi;
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:9,代码来源:DataLoader.java

示例13: resizeImageSmooth

public static BufferedImage resizeImageSmooth(BufferedImage image, int wantedWidth, int wantedHeight) {
    Image scaledImage = image.getScaledInstance(wantedWidth, wantedHeight, Image.SCALE_SMOOTH);
    BufferedImage imageBuff = new BufferedImage(wantedWidth, wantedHeight, BufferedImage.TYPE_INT_ARGB);
    Graphics g = imageBuff.createGraphics();
    g.drawImage(scaledImage, 0, 0, null, null);
    g.dispose();

    return imageBuff;
}
 
开发者ID:trebonius0,项目名称:Photato,代码行数:9,代码来源:ImageHelper.java

示例14: createWindowImage

private Image createWindowImage() {
   int iw = (int) (sw + 0.99);
   int ih = (int) (sh + 0.99);
   BufferedImage image = new BufferedImage(iw, ih,
                                           BufferedImage.TYPE_INT_ARGB);
   Graphics2D g = image.createGraphics();
   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                      RenderingHints.VALUE_ANTIALIAS_ON);
   g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                      RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
   fillBackground(g);
   drawTitleBar(g);
   drawWindowBody(g);
   return image;
}
 
开发者ID:eric-roberts,项目名称:JavaPPTX,代码行数:15,代码来源:PPWindowImage.java

示例15: getImgARGB

public static BufferedImage getImgARGB(final String name) {
    try {
        BufferedImage img = ImageIO.read(new File(name));
        if (img != null) {
            BufferedImage img2 = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = (Graphics2D) img2.getGraphics();
            g2.drawImage(img, null, 0, 0);
            g2.dispose();
            return img2;
        }
    } catch (IOException ex) {
        Logger.getLogger(DataLoader.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:15,代码来源:DataLoader.java


注:本文中的java.awt.image.BufferedImage.TYPE_INT_ARGB属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。