be specified as a parameter; however, the default position here of (0,
0) is sufficient. The result of the Place method is the drawing object
that Canvas created for the placed file. A reference to this DrawOb-
ject object is stored as Canvas.DrawObject.
Dim obj as Canvas.DrawObject
...
Set obj = doc.Place(srcFile.Path)
You then check to see whether the placed object is a CVImage
object. If it is, then you keep a reference to it.
Dim img As Canvas.CVImage
...
Set img = obj.Image
One property of CVImage objects is their resolution. Accordingly
you compare the value of the Resolution property to 72ppi. If it
is larger, then you set it to 72ppi by calling the SetResolution
method of the CVImage object. The second parameter of SetRes-
olution is set as False in order to keep the dimensions of the
image fixed. Setting it to True would keep the file size of the image
fixed and, therefore, change the dimensions of the image.
If (img.Resolution > 72) Then
img.SetResolution 72, False
...
End If
The modified images now have to be saved back to the destination
folder. Enter the prefix ds_ in front of the file name. ds_ stands
for downsampled. Appending the destination file name to the desti-
nation folder yields the full destination path, which is passed as the
first parameter to the SaveAs method of the Document object. The
second parameter indicates to save the image as a JPEG file.
dstPath = DstDir.Path + "\" + "ds_" + src-
File.Name
doc.SaveAs dstPath, cvsJPEGFormat
Before continuing to downsample the next file in the source folder,
delete the CVImage object that just got downsampled.
obj.Delete