public void Fax4Encode(byte[] data, int offset, int size) { dataBp = data; offsetData = offset; sizeData = size; while (sizeData > 0) { Fax3Encode2DRow(); Array.Copy(dataBp, offsetData, refline, 0, rowbytes); offsetData += rowbytes; sizeData -= rowbytes; } }
/** * Encodes a full image. * @param data the data to encode * @param width the image width * @param height the image height * @return the encoded image */ public static byte[] Compress(byte[] data, int width, int height) { CCITTG4Encoder g4 = new CCITTG4Encoder(width); g4.Fax4Encode(data, 0, g4.rowbytes * height); return(g4.Close()); }