SaveAs Example VB

Example 1

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

Private Sub cmdBurnIn_Click()
    Const ALL_MARKS = 0
    Const WINDOWS_DEFAULT = 2
    
    'If you wish to save color annotations on a black
    'and white image you must first convert the
    'image to a non black and white type
    ImgEdit1.ConvertPageType wiPageTypePal8, True
    'Save all marks in their original colors
    ImgEdit1.BurnInAnnotations ALL_MARKS, WINDOWS_DEFAULT
    'Color Burn in always converts to RGB24.  To save disk space,
    'save the image as an 8 bit palettized image
    ImgEdit1.SaveAs "C:\imgsave\annotate.tif", wiFileTypeTIFF, wiPageTypePal8
End Sub

Example 2

This example shows the options that are available for file linking/copying when performing a SaveAs of an Imaging 1x server document.

Private Sub cmdLink_Click()
    'An example of the options available for file linking/
    'copying when performing a SaveAs of a 1x server document.
    'These functions require both ImgEdit and Admin controls
    'to be utilized.

'Option 1
    'Request files associated with the document being
    'saved be copied to new files in a location to be
    'specified.  This is the default and in most cases
    'the preferred method to use.
    ImgAdmin1.ForceFileLinking1x = False
    
    'To specify location of the new files, use the Admin
    'control FileStgLoc1x property.
     ImgAdmin1.FileStgLoc1x = "Image://srvrname\new_images:"
    
    'Displayed 1x document is saved to a new document name
    'Associated image files will be copied to new randomly
    'generated file names in directory specified.
     ImgEdit1.SaveAs "Image://srvrname\doc_db:\CABNAME\DRAWER\FOLDER\NEW DOC"

'Option 2
    'Request files associated with the document being
    'saved reference the original files.  This results in
    'multiple documents accessing the same files -- could
    'be useful to prevent rewrites of optical disk files.
    ImgAdmin1.ForceFileLinking1x = True
    
    'Displayed 1x document is saved to a new document name
    'but original image files are linked to the new document.
    ImgEdit1.SaveAs "Image://srvrname\doc_db:\CABNAME\DRAWER\FOLDER\NEW DOC"
End Sub