BufferedImage.setRGB(int startX,int startY,int w,int h,int[] rgbArray,int offset,int scansize)的用法

http://www.javadocexamples.com/java/awt/image/BufferedImage/setRGB(int%20startX,int%20startY,int%20w,int%20h,int[]%20rgbArray,int%20offset,int%20scansize).html  

1: public class ColorPan extends JComponent {
   2:   BufferedImage image;
   3: 
   4:         ...
   5:     }
   6:     image = new BufferedImage(width, height,
   7:         ...
   8:         BufferedImage.TYPE_INT_RGB);
   9:         ...
  10:     image.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.util.Arrays;
   4:         ...
   5: 
   6:   public static BufferedImage createTransparentImage (final int width, final int height)
   7:   {
   8:         ...
   9:     final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:     final int[] data = img.getRGB(0, 0, width, height, null, 0, width);
  11:         ...
  12:     Arrays.fill(data, 0x00000000);
  13:     img.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.util.Arrays;
   4:         ...
   5: 
   6:   public static BufferedImage createTransparentImage (final int width, final int height)
   7:   {
   8:         ...
   9:     final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:     final int[] data = img.getRGB(0, 0, width, height, null, 0, width);
  11:         ...
  12:     Arrays.fill(data, 0x00000000);
  13:     img.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: import javax.imageio.stream.ImageInputStream;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.Dimension;
   4:         ...
   5: 
   6:     public BufferedImage decode(ImageInputStream in) throws IOException, BMPException {
   7:     skipToImage(in);
   8:         ...
   9:     int w = (int)d.getWidth();
  10:     BufferedImage image = new BufferedImage(w, h, 
  11:                         BufferedImage.TYPE_INT_RGB);
  12:         ...
  13:     }
  14:     image.setRGB(0, 0, w, h, data, 0, w);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:   public BufferedImage setRecord (final MfRecord record)
   7:           throws IOException
   8:         ...
   9: 
  10:   public BufferedImage setRecord (final MfRecord record, final int offset)
  11:           throws IOException
  12:         ...
  13:     final BufferedImage retval = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  14:     retval.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1:     private Image logo;
   2:     private BufferedImage bi;
   3:     private int[] original;
   4:         ...
   5:         if ((modifier & InputEvent.BUTTON2_MASK) != 0) {
   6:             bi.setRGB(0, 0, w, h, original, 0, w);
   7:             repaint();
   8:         ...
   9:         }
  10:         bi.setRGB(0, 0, w, h, rgb, 0, w);
  11:         repaint();

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5:       long time = System.currentTimeMillis();
   6:       BufferedImage image;
   7:       int transferSize;
   8:         ...
   9:          {
  10:             image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
  11:          }
  12:         ...
  13:          int[] img = (int[]) server.getImage(ID, RemoteImageServer.FAST_CONNECTION);
  14:          image.setRGB(0, 0, w, h, img, 0, w);

View Full Code Here
   1:     long duration;
   2:     BufferedImage im = null;
   3:     running = true;
   4:         ...
   5: 
   6:   private void analyzeImage(BufferedImage im)
   7:   {
   8:         ...
   9: 
  10:     im.setRGB(0, 0, imWidth, imHeight, pixels, 0, imWidth);

View Full Code Here
   1: import java.awt.event.KeyEvent;
   2: import java.awt.image.BufferedImage;
   3: import java.lang.reflect.Field;
   4:         ...
   5: 
   6:     private BufferedImage createTransparentImage(final int width, final int height) {
   7: #if USE_ORIGINAL_CODE
   8:         ...
   9:         final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:         final int[] data = img.getRGB(0, 0, width, height, null, 0, width);
  11:         ...
  12:         Arrays.fill(data, 0x00000000);
  13:         img.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值