I don't know why, there is little information on TIF operations on the Internet, including how many codeprojects are not found, and gdal is mostly used on the Internet. But this is a thing for the function that only wants to merge images, it is really cool, (9 dll should be full, quite scary) and there are quite a few descriptions of the completion of generation and reading TIF, which is generally used to deal with GIS.
Original download: http://download.csdn.net/detail/patizi/200992 but that write messy, I encapsulated into a class !!!
Using system; using system. collections. generic; using system. drawing; using system. drawing. imaging; using system. io; using system. runtime. interopservices; // using system. text; namespace savemultipagetiffarticle {public class creattiff {public bool create1_file (image [] IMG, string dstfile) {return get1_file (IMG, dstfile);} public bool add1_file (string srcfile, string dstfile) {image I1 = image. FR Omfile (srcfile); image LoadImage = new Bitmap (I1); // filestream Fr = file. open (dstfile, filemode. open, fileaccess. readwrite); image origionalfile = image. fromfile (dstfile); int pagenumber = getpagenumber (origionalfile); image [] IMG = new image [pagenumber + 1]; for (INT I = 0; I <pagenumber; I ++) {origionalfile. selectactiveframe (framedimension. page, I); IMG [I] = new Bitmap (origionalfile);} IMG [pagen Umber] = LoadImage; origionalfile. dispose (); i1.dispose (); Return getaskfile (IMG, dstfile);} private bool getaskfile (image [] IMG, string dstfile) {try {If (IMG = NULL) return false; If (IMG. length <2) return false; // if there is only one file, it can be saved as tiff directly. There is no need to process imagecodecinfo codecinfo = imagecodecinfo here. getimageencoders () [3]; If (codecinfo. formatdescription! = "Tiff") return false; For (INT I = 0; I threshold) {destinationvalue + = (byte) pixelvalue;} If (pixelvalue = 1) {destinationbuffer [destinationindex] = destinationvalue; destinationindex ++; destinationvalue = 0; pixelv Alue = 128;} else {pixelvalue >>=1;} sourceindex + = 4;} If (pixelvalue! = 128) {destinationbuffer [destinationindex] = destinationvalue ;}// copy binary image data to destination bitmap marshal. copy (destinationbuffer, 0, destinationdata. scan0, imagesize); // unlock destination bitmap destination. unlockbits (destinationdata); // return destination;} private int getpagenumber (image IMG) {guid objguid = IMG. framedimensionslist [0]; framedimension objdimension = new framedimension (objguid); // gets the total number of frames in. TIFF File int pagenumber = IMG. getframecount (objdimension); Return pagenumber ;}}}