//使用方法: 【扩展信息:javascript控制页面控件隐藏显示】
// bmpsafe.exe /file2bmp (input bmp) (input file to hide) [output file] //bmpsafe.exe /bmp2file (data bmp) [output file] using system; using system.io; using system.drawing;public class bitmap24writer
{ protected bitmap bmp; protected int curx, cury, irgb; protected uint bitsleft, bitstotal; protected byte r, g, b;public bitmap24writer(bitmap bmp)
{ if (bmp.pixelformat != system.drawing.imaging.pixelformat.format24bpprgb) throw new argumentexception(); // assign vars curx = cury = irgb = 0; this.bmp = bmp; bitsleft = bitstotal = (uint)bmp.height * (uint)bmp.width * 3; }public uint getunusedbitcount()
{ return bitsleft; }public uint getmaxbitstoragecount()
{ return bitstotal; }public bitmap getbitmap()
{ return bmp; }public bool writebyte(byte by)
{ if (bitsleft < 8) return false;uint bits2do = 8;
for (; curx < bmp.width; curx++)
{ if (cury >= bmp.height) cury = 0;for (; cury < bmp.height; cury++)
{ if (bits2do == 0) return true;color col = bmp.getpixel(curx, cury);
r = col.r; g = col.g; b = col.b;for ( ; ; )
{ byte curbit = (byte)(by & 1);... 下一页