> >FOR PageCounter = 1 TO SavePageCount > * Last parameter of 101 creates a tif file (used for first page only); 201 appends to an existing tif file (subsequent pages). > ReportListenerObj.OutputPage(PageCounter, fax_path + ALLTRIM(STR(PageCounter)) + '.bmp', 105) > > WITH _SCREEN.System.Drawing > LOCAL loMyBitmap AS xfcBitmap > LOCAL myEncoder AS xfcEncoder > LOCAL myEncoderParameters AS xfcEncoderParameters > > loMyBitmap = .Bitmap.New(fax_path + ALLTRIM(STR(PageCounter)) + '.bmp') > myEncoder = .Imaging.Encoder.Compression > myEncoderParameters = .Imaging.EncoderParameters.New(1) > > LOCAL loMonoChrBmp as xfcBitmap > loMonoChrBmp = loMyBitmap.GetMonochrome() > loMyBitmap = NULL > > myEncoderParameters.Param(1) = .Imaging.EncoderParameter.New(myEncoder, .Imaging.EncoderValue.CompressionCCITT4) > loMonoChrBmp.Save(fax_path + ALLTRIM(STR(PageCounter)) + '.tif', .Imaging.ImageFormat.Tiff, myEncoderParameters) > > DELETE FILE (fax_path + ALLTRIM(STR(PageCounter)) + '.bmp') > ENDWITH >ENDFOR>
>>>WITH _SCREEN.System.Drawing >>> LOCAL multif AS xfcBitmap >>> LOCAL page2 AS xfcBitmap >>> LOCAL page3 AS xfcBitmap >>> LOCAL myImageCodecInfo AS xfcImageCodecInfo >>> LOCAL myEncoder AS xfcEncoder >>> LOCAL myEncoderParameter AS xfcEncoderParameter >>> LOCAL myEncoderParameters AS xfcEncoderParameters >>> >>> && Create three Bitmap objects. >>> multif = .Bitmap.New(fax_path + '1.tif') >>> page2 = .Bitmap.New(fax_path + '2.tif') >>> >>> && Get an ImageCodecInfo object that represents the TIFF codec. >>> myImageCodecInfo = .Imaging.ImageFormat.Tiff >>> >>> && Create an Encoder object based on the GUID for the SaveFlag parameter category. >>> myEncoder = .Imaging.Encoder.SaveFlag >>> >>> && Create an EncoderParameters object An EncoderParameters object has an array of EncoderParameter >>> && objects. In this case, there is only one EncoderParameter object in the array. >>> myEncoderParameters = .Imaging.EncoderParameters.New(1); >>> >>> myEncoderParameter = .Imaging.EncoderParameter.New(myEncoder, .Imaging.EncoderValue.MultiFrame) >>> myEncoderParameters.Param[1] = myEncoderParameter >>> multif.Save(fax_path + file_copy + '.tif', myImageCodecInfo, myEncoderParameters) >>> >>> *!* Save the second page (frame). >>> myEncoderParameter = .Imaging.EncoderParameter.New(myEncoder, .Imaging.EncoderValue.FrameDimensionPage) >>> myEncoderParameters.Param[1] = myEncoderParameter >>> multif.SaveAdd(page2, myEncoderParameters) >>> >>> *!* Close the multiple-frame file. >>> myEncoderParameter = .Imaging.EncoderParameter.New(myEncoder, .Imaging.EncoderValue.Flush) >>> myEncoderParameters.Param[1] = myEncoderParameter >>> multif.SaveAdd(myEncoderParameters) >>>ENDWITH