亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

解析:android 如何從JPEG生成BufferedImage

 更新時間:2013年06月17日 08:54:14   作者:  
本篇文章是對在android中,如何從JPEG生成BufferedImage的解決方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
如下所示:
復(fù)制代碼 代碼如下:

private void readImage(String filename)  throws FileNotFoundException, IOException {
        FileInputStream fIn = new FileInputStream(filename);

//需要替換這邊的兩句:
        JPEGImageDecoder jpeg_decode = JPEGCodec.createJPEGDecoder(fIn);
        BufferedImage image = jpeg_decode.decodeAsBufferedImage();
        width = image.getWidth();
        height = image.getHeight();
        int[] rgbdata = new int[width * height];
        image.getRGB(0,0,width,height,rgbdata,0,width);
        bytes = new byte[rgbdata.length];
        doubles = new double[rgbdata.length];
        for (int i = 0; i < bytes.length; i++) {
          bytes[i]    = (byte)  (rgbdata[i] & 0xFF);
          doubles[i]  = (double)(rgbdata[i]);
        }
    }

相關(guān)文章

最新評論