求Java打印bmp格式图片代码

解决方案 »

  1.   

    http://www.ibm.com/developerworks/cn/java/l-javaprint/
      

  2.   

    http://www.chinaitpower.com/A/2002-04-15/19940.html这里有,不过挺复杂的。
      

  3.   


            ret = (ret << 8) | ((int) in[offset + 1] & 0xff);        ret = (ret << 8) | ((int) in[offset + 0] & 0xff);        return (ret);    }
            int npalette[] = new int[nNumColors];        byte bpalette[] = new byte[nNumColors * 4];        fs.read(bpalette, 0, nNumColors * 4);        int nindex8 = 0;        for (int n = 0; n < nNumColors; n++)        {            npalette[n] = constructInt3(bpalette, nindex8);            nindex8 += 4;        }        // Read the image data (actually indices into the palette)        // Scan lines are still padded out to even 4-byte        // boundaries.        int npad8 = (bh.nsizeimage / bh.nheight) - bh.nwidth;        //    System.out.println("nPad is:"+npad8);        int ndata8[] = new int[bh.nwidth * bh.nheight];        byte bdata[] = new byte[(bh.nwidth + npad8) * bh.nheight];