SaveInk

Description

Saves ink to a file or blob from an InkPicture control.

Applies to

InkPicture controls

Syntax

inkpicname.SaveInk ( t | b {, format {, mode } } )

Argument

Description

inkpicname

The name of the InkPicture control from which you want to save ink.

t

A string containing the name and location of a file that will hold the ink you want to save from the control.

b

The name of a blob passed by reference that will hold the ink you want to save from the control.

format (optional)

A value of the InkPersistenceFormat enumerated variable that specifies the format in which you want to save the ink. Values are:

  • Base64GIFFormat!

  • Base64InkSerializedFormat!

  • GIFFormat!

  • InkSerializedFormat! (default)

mode (optional)

A value of the InkCompressionMode enumerated variable that specifies the compression mode in which you want to save the ink. Values are:

  • DefaultCompression! (default)

  • MaximumCompression!

  • NoCompression!

Returns

Integer. Returns 1 for success and -1 for failure.

Usage

Use the SaveInk function to save annotations made to an image in an InkPicture control to a separate file or blob.

InkSerializedFormat! (ISF) provides the most compact persistent ink representation. This format can be embedded inside a binary document format or added to the clipboard. Base64InkSerializedFormat! encodes the ISF format as a base64 stream, which allows the ink to be encoded in an XML or HTML file.

GIFFormat! saves the image in a Graphics Interchange Format (GIF) file in which ISF is embedded as metadata. This format can be viewed in applications that are not ink enabled. Base64GIFFormat! is persisted by using a base64 encoded fortified GIF. Use this format if the ink is to be encoded directly in an XML or XHTML file and will be converted to an image at a later time. It supports XSLT transformations to HTML.

Examples

Example 1

The following example saves the ink in an InkPicture control into an ISF file with default compression:

int li_return
string ls_pathname, ls_filename

GetFileSaveName("Save As", ls_pathname, ls_filename, "ISF")
li_return = ip_1.SaveInk(ls_pathname)

Example 2

The following example saves the ink in an InkPicture control into a GIF file with maximum compression:

int li_return
string ls_pathname, ls_filename

GetFileSaveName("Save As", ls_pathname, ls_filename, "GIF")
li_return = ip_1.SaveInk(ls_pathname, GIFFormat!, MaximumCompression!)

See also