TIF IMAGE FILE SAVE with LZW MODE ON . . .
2018-11-14-110830
All --
Is there a way to control TIF IMAGE FILE COMPRESSION via CODE?
Background . . .
When saving a TIF IMAGE in IMAGE-PRO, there are three options for compression. They are:
- NONE
- LZW
- LZW AND DIFFERNENCING
I have a customer that saves their TIF IMAGES with LZW.
I have written an APP for them that needs to maintain their ORIGINAL TIFF (with LZW) IMAGE FILE but I would like to create a WORKING COPY TIFF (with LZW) IMAGE FILE.
It seems that when IMAGE-PRO saves a TIF IMAGE FILE, the COMPRESSION OPTION that is used is only controllable via the SAVE AS DIALOG BOX.
If CODE does a SAVE AS, the COMPRESSION OPTION that will be used is the last one that was used via the SAVE AS DIALOG BOX.
I have recorded saving TIF IMAGES using each COMPRESSION OPTION but no difference is shown in the RECORDED CODE.
So . . .
Is there a way to control TIF IMAGE FILE COMPRESSION via CODE?
Thanks.
-- Matt
0
Answers
Here is a macro to do that:
Public Function SaveLZWDiff() As SimpleScript SaveLZWDiff = New SimpleScript Dim image1 With Application.DocumentCommands.ActiveImage(SaveLZWDiff) .Run(image1) End With With Automate.ScriptingCommands.CodeCommand(SaveLZWDiff) If .Run() Then ' User Code Here Dim image As McImage = image1 image.File.Compression=MediaCy.IQL.IO.mcscCompression.mcscLZWDiff End If End With With Application.DocumentCommands.SaveAs(SaveLZWDiff) .Filename = ThisApplication.Path(mcPathType.mcptWritableImages) & "Test.tif" .Run(image1) End With End Function
Public Sub SaveLZWDiff2 With ThisApplication.ActiveImage .File.Compression=MediaCy.IQL.IO.mcscCompression.mcscLZWDiff .SaveAs(ThisApplication.Path(mcPathType.mcptWritableImages) & "Test.tif") End With End Sub
Pierre