Description
Saves overlay ink to a file or blob from an InkPicture control.
Applies to
Syntax
PowerBuilder
integer dwcontrol.SaveInk ( string name, long rownumber, blob blob ) integer dwcontrol.SaveInk ( string name, long rownumber, string filename {, inkpersistenceformat format {, inkcompressionmode mode } } )
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control. |
name |
The name of the InkPicture control from which you want to save the ink. |
rownumber |
The number of the row that contains the ink to be saved. |
blob |
The name of a blob passed by reference that will hold the ink in the control. |
filename |
A string containing the name and location of a file that will hold the ink in 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:
|
mode (optional) |
A value of the InkCompressionMode enumerated variable that specifies the compression mode in which you want to save the ink. Values are:
|
Return value
Integer.
Returns 1 for success and -1 for failure.
Usage
Use the SaveInk method to save annotations made to an image in an InkPicture control in a DataWindow to a separate file or blob.
When you save ink to a blob, it is saved in Ink Serialized Format (ISF). Saving ink to a blob provides the best performance because the ink is read directly from the ink data cache.
InkSerializedFormat! 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
The following example saves the ink in an InkPicture control in row 3 of a DataWindow object 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 = dw_1.SaveInk("inkpic_1", 3, ls_pathname)
The following example saves the ink in an InkPicture control in row 5 of a DataWindow object 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 = dw_1.SaveInk("inkpic_1", 5, & ls_pathname, GIFFormat!, MaximumCompression!)
The following example saves the ink in an InkPicture control in the current row of a DataWindow object into a blob:
int li_return blob lb_blob li_return = dw_1.SaveInk("inkpic_1", & dw_1.GetRow(), lb_blob)
See also