Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MultiPage Tiff Compression
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01153672
Message ID:
01154253
Views:
14
Mike,
This worked great! But I ran into an issue with releasing the idiviual tiff files. The problem is after I call the procedure "CreateFromFile(lcSource" the program is keeping lcSource open and I don't have the capablity to delete the file. Any help would be great..


>Check your email.
>
>>Mike,
>>
>>Here is how I'm creating the individual tiff images with compression 4. Now I need to take these individual tiff images and append them into a multi-page tiff image, with compression 4. I'm trying to append the images together with the code below but that isn't working. Maybe there is an easier way to do this and any help would be appreciated...
>>
>>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
>>
>>Thanks,
>>
>>Jennifer
>>
>>
>>>Pass the through Cesar's monochrome function, it is possible they are not 100% monochrome, which would alter the compression level to accomodate the shades of gray.
>>>
>>>>>>Does anybody know how to create a multipage tiff in compression 4 (CCITT4) from individual tiffs with compression 4.
>>>>>
>>>>>In this month's edition of UTMAG you'll find an article on this subject
>>>>>http://www.utmag.com/Index.asp
>>>>>
>>>>>HTH
>>>>>
>>>>>Cesar
>>>>
>>>>Cesar,
>>>>
>>>>The article is really helpful that is what I've been using. Below is my code '1.tif' and '2.tif' they are both compression 4 tiff files but when I combine them with the code below, I'm getting my multi-page tiff file but it is in the LZW compression and I need the compression 4 format. Any help would be appreciated.
>>>>
>>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform