Save method (LEADMrc Control)

C++ Builder Example

Delphi Example

 

Builder Syntax

int Save(TLEADImage* LEADImg, AnsiString strFileName, int nFormat, int nPage, int nModify);

Delphi Syntax

Function Save(LEADImg: TLEADImage; strFileName: String; nFormat: L_INT; nPage: L_INT; nModify: L_INT): L_INT;

Overview

Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Saves the given bitmap in one of the LEAD Proprietary T44 formats: as a LEAD proprietary T44 format file (if the nFormat value is FILE_LEAD_MRC) or as a TIF file with a LEAD MRC subtype format (if the nFormat value is FILE_TIF_LEAD_MRC). When an nFormat value of FILE_LEAD_MRC is used, *.MRC is the default file extension. When an nFormat value of FILE_TIF_LEAD_MRC is used, *.TIF is the default file extension. Use nModify and nPage to control page insertion and replacement operations when working with new pages in multi-page files.

The Save method maps the text, grayscale and picture segments into layers (mask, background and foreground layers) as defined in the NLS* model of the T.44 standard. A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44. For more information on Mixed Raster Content (MRC) formats, refer to Working with MRC Bitmaps.

Use the Save method to save a file in the LEAD proprietary T44 format if you want to:

image\sqrblit.gif Take advantage of the greater number of different segment types available when using the proprietary format.

image\sqrblit.gif Create smaller files than would be possible by saving them to the Standard T44 format.

image\sqrblit.gif Create higher quality files than would be possible by saving them to the Standard T44 format.

Please note that the LEAD proprietary T44 format file is a single-page file format, while the TIF file with a LEAD MRC subtype format is a multi-paged file format.

Use the SaveT44 method to save a file if it is necessary that the file be readable by any application that supports the T44 standard.

Before saving, set the default base background color property by setting the BaseBackColor property, and the default base foreground color property by setting the BaseForeColor property.

It is best to perform segmentation before calling the Save method. Segmentation can be performed automatically by calling the AutoSegment method, or performed manually by calling the CreateNewSegment method. Call the StartSegmentation method before calling any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method. For more information on segmentation, refer to Working with the LEADMrc Control. Control the segmentation process by setting the following properties:

CombineFactor property

CombineFlags property

ImageType property (If using the AutoSegment method)

Sensitivity property (If using the AutoSegment method)

If segmentation has not been performed before the Save method is called, segmentation is performed internally. The StartSegmentation and AutoSegment methods are called, in that order. The image is segmented into blocks 60 pixels wide and 60 pixels high, and the function tries to combine similar functions using a CombineFactor property of 30, an ImageType property of scanned, and a Text2BitCoder property for JBIG 2-bit. The Save function will use Fax G4 for the MaskCoder property, JPEG compression for the PictureCoder property and 2 for the PictureQFactor property, JPEG compression for the Grayscale8BitCoder property and 2 for the Grayscale8BitQFactor property, and JBIG compression for the Grayscale2BitCoder segments.

When using the Save method, segments can be any of the following types:

SEGTYPE_TEXT_1BIT_BW

SEGTYPE_TEXT_1BIT_COLOR

SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_GRAYSCALE_2BIT

SEGTYPE_GRAYSCALE_8BIT

SEGTYPE_PICTURE

Set the compression for 1-bit text segments by setting the MaskCoder property. Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression can be used. Set the compression for 2 bit grayscale segments by setting the Grayscale2BitCoder property. JBIG compression can be used. Set the compression for the 8-bit grayscale segments by setting the Grayscale8BitCoder property. JPEG, LEAD CMP or LEAD CMW compression can be used. Set the quality factor for 8-bit grayscale segments by setting the Grayscale8BitQFactor property. Set the compression for pictures by setting the PictureCoder property. JPEG, LEAD CMP or LEAD CMW compression can be used. Set the quality factor for pictures by setting the PictureQFactor property. Set the compression for 2-bit text segments by setting the Text2BitCoder property. JBIG or GIF compression can be used.

Note that the Grayscale2BitCoder property, the Grayscale8BitCoder property, the Grayscale8BitQFactor property, and the Text2BitCoder property are used only with the Save method.

*NLS (N-Layer stripe) means that each stripe may contain one or more mask layers, foreground layers, and background layers.

See Also

Elements

BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg property, Grayscale2BitCoder property, Grayscale8BitCoder property, Grayscale8BitQFactor property, ImageType property, MaskCoder property, MRCPagesCount property, PictureCoder property, PictureQFactor property, Sensitivity property, Text2BitCoder property, AutoSegment method, CombineSegments method, CopySegmentationData method, CreateNewSegment method, DeleteSegment method, EnumSegments method, GetPagesCount method, Load method, LoadSegmentation method, Save method, SaveSegmentation method, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event

Topics

MRC Bitmap Functions: Saving a Page