RleEncodingTest.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
private static void encodeRLE8Test() throws IOException {
    // create 8bpp image
    byte[] r = new byte[256];
    r[0] = (byte)0xff;
    byte[] g = new byte[256];
    g[1] = (byte)0xff;
    byte[] b = new byte[256];
    b[2] = (byte)0xff;
    IndexColorModel icm = new IndexColorModel(8, 256, r, g, b);

    BufferedImage bimg = new BufferedImage(100, 100,
                                           BufferedImage.TYPE_BYTE_INDEXED,
                                           icm);
    Graphics gr = bimg.getGraphics();
    gr.setColor(Color.green);
    gr.fillRect(0, 0, 100, 100);

    doTest(bimg, "BI_RLE8", ImageWriteParam.MODE_EXPLICIT);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号