码迷,mamicode.com
首页 > 其他好文 > 详细

e671. 在缓冲图像中存取像素

时间:2018-09-03 00:03:16      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:缓冲   add   body   table   cin   像素   pixel   null   example   

 

    // Get a pixel
    int rgb = bufferedImage.getRGB(x, y);
    
    // Get all the pixels
    int w = bufferedImage.getWidth(null);
    int h = bufferedImage.getHeight(null);
    int[] rgbs = new int[w*h];
    bufferedImage.getRGB(0, 0, w, h, rgbs, 0, w);
    
    // Set a pixel
    rgb = 0xFF00FF00; // green
    bufferedImage.setRGB(x, y, rgb);

 

Related Examples

e671. 在缓冲图像中存取像素

标签:缓冲   add   body   table   cin   像素   pixel   null   example   

原文地址:https://www.cnblogs.com/borter/p/9575554.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!