求Java打印bmp格式图片代码

老高IT路 2009-09-15 11:43:47
求Java打印bmp格式图片代码
...全文
157 5 打赏 收藏 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodmrning 2009-09-16
  • 打赏
  • 举报
回复
学习!
999朵玫瑰 2009-09-16
  • 打赏
  • 举报
回复
学习了
唐小新 2009-09-15
  • 打赏
  • 举报
回复

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];

config_man 2009-09-15
  • 打赏
  • 举报
回复
http://www.chinaitpower.com/A/2002-04-15/19940.html

这里有,不过挺复杂的。
diggywang 2009-09-15
  • 打赏
  • 举报
回复
http://www.ibm.com/developerworks/cn/java/l-javaprint/

62,620

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧