Introduction

LEADTOOLS VCL consists of several packages. Each package contains one or more custom controls developed by LEAD Technologies, Inc. These packages and their contents are as follows:

LEADTOOLS VCL Main Package: The LEADTOOLS VCL Main Package contains the LEAD Main Control Module. The LEAD Main Control Module (32-bit) provides the custom controls for incorporating image compression, file format support, and image processing into your applications.

LEADTOOLS VCL Additional Package: The LEADTOOLS VCL Additional Package contains the LEAD ImageList Control Module, the LEAD ThumbnailBrowser Control Module and the LEAD Screen Capture Control. The LEAD ImageList Control Module provides the custom controls for displaying and manipulating image lists. The LEAD Thumbnail Browser Control Module provides custom controls for generating thumbnails of LEAD supported images from a directory. The LEAD Screen Capture Control Module provides custom controls for performing the following captures: entire screen, active window, selected menu, menu under cursor, selected window object (button, tool bar, icon, or client area), selected area (rectangle, ellipse, triangle, polygon or freehand), wallpaper, mouse pointer, and resource stored in EXE or DLL. Options include multi-capture, Hot Keys, and time interval. Please note that the Documentation for the LEAD Screen Capture Control Module can be found in the LEADTOOLS Screen Capture VCL help file, Ltscrvcln.hlp in the LEAD\Help directory. In addition, please note that the LEADTOOLS VCL Main Package must be installed on the system in order to install the LEADTOOLS VCL Additional Package.

LEADTOOLS VCL Scanning Package: The LEADTOOLS VCL Scanning Package contains the LEAD ISIS Control Module. LEAD ISIS Control Module provides custom controls for incorporating ISIS scanner control into your applications. In addition, please note that the LEADTOOLS VCL Main Package must be installed on the system in order to install the LEADTOOLS VCL Scanning Package.

LEADTOOLS VCL DICOM Package: The LEADTOOLS VCL DICOM Package contains the LEAD DICOM Control Module. The LEAD DICOM Control Module provides a custom control for incorporating DICOM image file format support into your applications. The LEAD DICOM Control Module is only available in the LEADTOOLS Medical toolkits. Please note that the LEADTOOLS VCL Main Package must be installed on the system in order to install the LEADTOOLS VCL DICOM Package.

LEADTOOLS VCL Annotation Package: The LEADTOOLS VCL Annotation Package contains the LEAD Annotation Control Module. The LEAD Annotation Control Module provides a custom control for incorporating annotation support into your applications. The LEAD Annotation Control Module is only available in the LEADTOOLS Document/Medical toolkits. Please note that the LEADTOOLS VCL Main Package must be installed on the system in order to install the LEADTOOLS VCL Annotation Package.

LEADTOOLS VCL MRC Package: The LEADTOOLS VCL MRC Package contains the LEAD MRC Control Module. The LEAD MRC Control Module provides a custom control to let you incorporate the ability to work with MRC (Mixed Raster Content) files in your applications. The LEAD MRC Control Module is only available in the LEADTOOLS Document/Medical toolkits. Please note that the Documentation for the LEAD MRC Control Module can be found in the LEADTOOLS MRC VCL help file, Ltmrcvcln.hlp in the LEAD\Help directory. In addition, please note that the LEADTOOLS VCL Main Package must be installed on the system in order to install the LEADTOOLS VCL MRC Package.

This help file contains only the documentation for the properties, methods and events in the LEAD MRC Control Module.

The toolkit comes in 32-bit Document/Medical and non-Document/Medical editions. You can use the LEADTOOLS VCL in:

Delphi 4.0

Delphi 5.0

Delphi 6.0

Delphi 7.0

C++ Builder 4.0

C++ Builder 5.0

C++ Builder 6.0

The toolkit comes in WIN32 editions so that it can support development of software applications for any of the following environments:

Windows 3.x
Windows NT 4.x
Windows NT
Windows 95
Windows 98
Windows 2000
Windows ME
XP

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

Introduction To Image Processing with LEADTOOLS

Compression Using LEAD and JPEG Formats

Summary of All Supported Image File Formats

Compression Quality Factors

Compression Quality Factors in the LEADMrc Control


Compression Quality Factors in the LEADMrc Control

It is possible to set one or more quality factors when saving an image file to the LEAD MRC, MRC, TIF LEAD MRC, or TIF MRC format. The quality factor (Q factor) is a number that determines the degree of loss in the compression process. Possible values range from 2 to 255, where 2 is the highest quality and 255 is the most compression.

When saving a file that has 8-bit grayscale segments in the LEAD MRC or TIF LEAD MRC format, use a Grayscale8BitQFactor property of 0 to produce lossless CMW or lossless JPEG files when selecting those as the Grayscale8BitCoder. Otherwise, set the Grayscale8BitQFactor property to a value from 2 to 255, where 2 is the highest quality and 255 the most compression.

When saving a file in the standard MRC or TIF MRC format, the only valid picture compression (PictureCoder property) is MRC_PICTURE_COMPRESSION_JPEG. Set the quality factor using the PictureQFactor property, setting a value from 2 to 255, where 2 is the highest quality and 255 the most compression.


Version History

Current version: | 14.5
Last update: | October 20, 2005

Changes from Version 14 to Version 14.5

Version 14


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS MRC VCL has not changed from Version 14.


Version 14

Version 14 is a complete rewrite and is based on version 14 of the LEADTOOLS MRC VCL..

The rest of this topic lists the new functions.

AutoSegment method

BaseBackColor property

BaseForeColor property

CombineFactor property

CombineFlags property

CombineSegments method

CopySegmentationData method

CreateNewSegment method

DeleteSegment method

EnableMethodErrors property

EnumSegments method

Error property

ErrorMsg property

GetPagesCount method

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

ImageType property

Load method

LoadSegmentation method

MaskCoder property

MRCPagesCount property

OnEnumSegments event

PictureCoder property

PictureQFactor property

Save method

SaveSegmentation method

SaveT44 method

Sensitivity property

SetSegmentData method

StartSegmentation method

StopSegmentation method

Text2BitCoder property


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL and DC120V154_32.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996.

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR Features and the help file for the OCR Features are ©Copyright Scansoft, Inc. 1995-2000. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.
Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.
OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
Home page: http://www.leadtools.com


Programming with LEADTOOLS Mixed Raster Content VCL

The following topics provide a systematic approach to understanding how to program with the LEADTOOLS MRC VCL:

Unlocking Special LEAD Features

Unlocking Mixed Raster Content (MRC) File Format Support

Working with MRC Bitmaps

Working with the LEADMrc Control

Example and Summary


Unlocking Special LEAD Features

LEAD offers a variety of features, such as Document support, Medical support, Vector support, etc., which are only available in certain toolkits and are locked. To use these features you must:

purchase a toolkit that supports the desired feature(s).

print the applicable runtime agreement from the help file. For information on the runtime agreements, go to Topic Selection and click on the LEAD Licensing button.

complete the Transmittal document and fax it and the runtime agreement to LEAD's Licensing Department at 704 – 372 – 3789. (To get a copy of the Transmittal document, you must contact LEAD.)

if prepaid licenses are desired, include the order form with payment information. You can fax this along with the Transmittal form and the runtime agreement. (To get a copy of the order form, you must contact LEAD.)

once we have received the signed agreement, we will send instructions for eliminating the license dialogs and the key(s) necessary for unlocking the appropriate features.

when you have received the instructions and the key(s) call the UnlockSupport method with the appropriate key.

For example, if you have purchased the LEADTOOLS Document Imaging toolkit:

print the Document Imaging Agreement (or the Document Imaging with OCR Agreement if you have also purchased the LEADTOOLS OCR Module).

complete the Transmittal document and fax it and the Document Imaging Agreement (or the Document Imaging with OCR Agreement) to LEAD's Licensing Department.

if you want prepaid licenses, print a copy of the order form, fill it out and send the order form and payment information to LEAD.

once we have received the signed Document Imaging Agreement (or Document Imaging with OCR Agreement), we will send the instructions for eliminating the license dialogs and any necessary keys.

when you receive the instructions and the key(s), call UnlockSupport method (L_SUPPORT_DOCUMENT, "Document Key") to unlock the Document features. Please note that "Document Key" represents the actual key you will receive from LEAD. Also note that if you also purchased the LEADTOOLS OCR Module, the OCR features will have to be unlocked separately, using the appropriate key.

For information on products and the features available in each product, or for information on licensing, refer to Topic Selection.

To determine if a certain feature is locked, call the IsSupportLocked method .


Unlocking Mixed Raster Content (MRC) File Format Support

Support for the TIF (MRC), TIF (LEAD MRC), MRC and LEAD MRC file formats is provided with the LEADMrc control available in the LEADTOOLS Document toolkits. This support is unlocked when the document features are unlocked by calling UnlockSupport method (L_SUPPORT_DOCUMENT, "Document Key"). The Document key is provided when a LEADTOOLS Document toolkit is purchased.


Working with MRC Bitmaps

The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44, and is defined in the proposed standard, RFC-2301, File Format for Internet Fax. The MRC model divides a page into strips and up to 3 layers: consisting of Mask, Foreground and Background layers. Each layer can be coded and compressed independently. Subsequently, these layers can be uncompressed and combined to restore the original image.

The advantage of the MRC model is that optimal compression methods can be selected for the various image and text components of documents, resulting in both high compression factors and high detail retention. Image and text components may be mixed on the same page.

A foreground layer contains color data for the text and line art, and may also contain photographic or continuous tone color data. The background layer generally contains low-resolution color image data, such as a background image, a wash or other pattern that would have text overlaid on it. The mask layer or the selector layer that controls the process of image regeneration contains binary image data that is high spatial resolution, such as text and line art. This layer is used for drawing the corresponding foreground layer where the selector value is 1 and drawing the corresponding background layer where the selector value is 0. (For example: a high-resolution color font can be represented using significantly less space, since the color information is stored at a lower resolution.)

LEADTOOLS offers the LEADMrc Control to handle mixed raster content files, which contain mixed image and text components. For more information, refer to Working with the LEADMrc Control


Working with the LEADMrc Control

LEADTOOLS offers the LEADMrc Control to handle mixed raster content files. This control enhances LEADTOOLS input/output functionality by adding support for color documents containing mixed image and text components. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44, and is defined in the proposed standard, RFC-2301, File Format for Internet Fax. The MRC model divides a page into strips and up to 3 layers: consisting of Mask, Foreground and Background layers. Each layer can be coded and compressed independently. Subsequently, these layers can be uncompressed and combined to restore the original image.

The LEADTOOLS implementation of the MRC model involves dividing an object into segments. 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.

LEADTOOLS offers two methods for saving files: the Save method and the SaveT44 method. With these methods it is possible to save an MRC bitmap in any of the following modes:

MRC: This mode uses the Standard T44 file format. The default extension is *.MRC. Please note that multipage files using this format can be loaded, but only one page can be saved. Use the SaveT44 method to save a file in this format.

LEAD MRC: This mode uses the LEAD proprietary T44 file format. The default extension is *.MRC. Please note that this is a single page file format. Use the Save method to save a file in this format.

TIF-MRC: This mode uses the Tagged Image Format and the Standard T44 format as a subtype. The default extension is *.TIF. Multipage files using this format can be loaded and can also be saved. Use the SaveT44 method to save a file in this format.

TIF-LEAD-MRC: This mode uses the Tagged Image Format and the LEAD proprietary T44 format as a subtype. The default extension is *.TIF. Multipage files using this format can be loaded and can also be saved. Use the Save method to save a file in this format.

The Standard T44 format file uses two different segment types: 1-bit Text and picture. The 1-bit text segments can be compressed using Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression and picture segments can be compressed using JPEG compression. Some of these compression schemes use a quality factor that allows the amount of compression to be controlled.

The LEAD proprietary MRC format uses the following segment types: 1-bit text, 2-bit text, 2-bit picture grayscale, 8-bit grayscale, and picture. The 1-bit text segments can be compressed using Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression. The 2 bit grayscale segments can be compressed using JBIG compression. The 8-bit grayscale segments can be compressed using JPEG, LEAD CMP or LEAD CMW compression, and pictures can be compressed using JPEG, LEAD CMP or LEAD CMW compression. Some of these compression schemes use a quality factor that allows the amount of compression to be controlled.

The following properties can be used to set the default colors for a file:

BaseForeColor property

BaseBackColor property

Loading Capabilities

To load a Mixed Raster Content (MRC) bitmap call the Load method. This method loads a single page from a MRC file. When loading from a multi-page document, specify the page number as one of the input parameters. To get the total pages in the MRC file call the GetPagesCount method, which fills the MRCPagesCount property with the number of pages in the file.

Saving Capabilities

The LEAD proprietary T44 format used by the Save method differs from the Standard T44 format used by the SaveT44 method in the following ways:

when using the LEAD Proprietary T44 format, segments can be 1-bit black and white, 1-bit color, 2-bit color, 2-bit grayscale, 8-bit grayscale, or picture. When using the standard T44 format, segments can be 1-bit black and white, 1-bit color, or picture.

while any application that supports the T44 standard can open a file saved in those formats, only an application with LEADMrc support can open a file saved in the LEAD proprietary T44 format.

saving a given bitmap in the LEAD proprietary T44 format creates a smaller file than saving the same bitmap in the Standard T44 format.

saving a given bitmap in the LEAD proprietary T44 format creates a higher quality file than saving the same bitmap in the Standard T44 format.

when saving a multipaged file as a Standard T44 format (MRC), only one page can be saved. The LEAD Proprietary T44 format (LEAD-MRC) is a single page file format.

Note:

The characteristics of individual images differ greatly and not every image compresses well as mixed raster content.

The LEADTOOLS implementation of the MRC model involves dividing an object into segments. 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. Segmentation can be performed automatically, manually, or internally. Different types of compression are available, depending upon which save method is being used as well as which segment type is being compressed.

The following properties may be used to specify compression and quality characteristics used when saving an MRC file:

MaskCoder property

PictureCoder property

PictureQFactor property

In addition, when saving a bitmap in one of the LEAD Proprietary T44 formats, the following properties can be used to specify compression and quality for the additional segment types available to that format:

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

Text2BitCoder property

With LEADTOOLS it is easy to handle the segmentation process, whether performing segmentation automatically or manually.

General Segmentation

A segment is a rectangular area on the bitmap. The segmentation process classifies the segments of a bitmap as text, grayscale or picture. Call the StartSegmentation method to initialize the segmentation process, before calling any of the segmentation methods. To end the segmentation process call the StopSegmentation method, which frees any memory associated with the segmentation process. Each call to the StartSegmentation method requires a corresponding call to the StopSegmentation method.

Auto-Segmentation

Calling the AutoSegment method will perform automatic segmentation using the LEADTOOLS MRC engine. LEADTOOLS segments the bitmap, classifying the segments as text, grayscale or picture. An OnEnumSegments event is fired for each segment generated. Set the following properties to control the segmentation process:

CombineFactor property

CombineFlags property

ImageType property

Sensitivity property

To enumerate the segments, call the EnumSegments method. This method provides the segment coordinates and their IDs. To modify a segment type or its coordinates, use the SetSegmentData method. This method updates only one segment’s data each time it is called. To delete a segment, call the DeleteSegment method. To combine two segments, call the CombineSegments method. To copy the segmentation data, call the CopySegmentationData method.

Save the segmentation data to a file by calling the SaveSegmentation method. To load the saved segmentation data from a file, call the LoadSegmentation method.

Manual Segmentation

To use manual segmentation, call the CreateNewSegment method to add a new segment and customize the segment coordinates and type. An OnEnumSegments event is fired for each segment generated. Set the following properties to control the segmentation process:

CombineFactor property

CombineFlags property

To modify a segment type or its coordinates, use the SetSegmentData method. The SetSegmentData method updates only one segment’s data each time it is called. To delete a segment, call the DeleteSegment method. To combine two segments, call the CombineSegments method. To copy the segmentation data, call the CopySegmentationData method.

Save the segmentation data to a file by calling the SaveSegmentation method. To load the saved segmentation data from a file, call the LoadSegmentation method.

Auxiliary Elements

To control generating run-time exceptions with method error conditions, use:

EnableMethodErrors property

Error Property

ErrorMsg Property


Example and Summary

A scenario for using the above functions in order to save a page as MRC is as follows:

1. | Start up the segmentation process by calling the StartSegmentation method.
2. | Set the following properties used to control the automatic segmentation process:

CombineFactor property

CombineFlags property

ImageType property

Sensitivity property

3. | Perform automatic segmentation by calling the AutoSegment method.
4. | Change some properties of the segments by calling the SetSegmentData and the EnumSegments methods.
5. | Delete some segments by calling the DeleteSegment and the EnumSegments methods.
6. | Combine segments by calling the CombineSegments and the EnumSegments methods.
7. | Call the SaveSegmentation method to save the resulting segments to a file. To load segments that have been saved to a file, call the LoadSegmentation method.
8. | Call the SaveT44 method to save the page as a Standard T44 file OR call the Save method to save the page using the LEAD Proprietary T44 Format.
9. | End the segmentation process by calling the StopSegmentation method.

The functionality provided by this module can be broken into the following categories:

1.

Start up and end the segmentation process:

StartSegmentation method

StopSegmentation method

2.

Automatic segmentation of a page:

AutoSegment method

3.

Manual segmentation of a page:

CreateNewSegment method

4.

Manipulating segments:

SetSegmentData method

CombineSegments method

CopySegmentationData method

DeleteSegment method

EnumSegments method

LoadSegmentation method

SaveSegmentation method

5.

Saving a page as MRC:

SaveT44 method

Save method

6.

Loading an MRC file:

Load method

GetPagesCount method

MRCPagesCount property


Files To Be Included With Your Application

The following summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions:

Note: | You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.
Note: | You may not provide software development capabilities in your application. In particular, this means that you must not distribute the LTOCX14.LIC license file.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions on a WIN32 system. (\REDIST subdirectory contains copies of these files.)

Please note that LTKRN, LTDIS, LTEFX, LTIMG, and LTFIL are required for ALL VCL applications. For more information on LTKRN, LTDIS, LTEFX, LTIMG, LTFIL and other files for the Main VCL, refer to Files To Be Included With Your Application .

Redistributables | Explanation: | If you are using a standard release, the files to use are: | If you are using an evaluation release, the files to use are:
LTSGM | T44 support. | DLL: LTSGM14N.DLL Library: LTSGM_N.LIB | DLL: LTSGM14E.DLL Library: LTSGM_E.LIB


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\VCL | One subdirectory for each example VCL program.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
USES | Pascal user uses and includes files.
LIB | Library files.
LIB\VCL\DELPHI6 | The LEADTOOLS VCL Delphi 6.0 package and unit files.
LIB\VCL\DELPHI7 | The LEADTOOLS VCL Delphi 7.0 package and unit files.
LIB\VCL\BUILDER5 | The LEADTOOLS VCL Builder 5.0 package, LIB and header files.
LIB\VCL\BUILDER6 | The LEADTOOLS VCL Builder 6.0 package, LIB and header files.


Tutorial for C++ Builder Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Mixed Raster Content VCL.

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Miscellaneous Examples


Miscellaneous Examples (C++ Builder)

AutoSegment Example for C++ Builder

EnableMethodErrors Example for C++ Builder

Load Example for C++ Builder

Save Example for C++ Builder


AutoSegment Example for C++ Builder

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int nSegID;

LEADMrc1->BaseBackColor = RGB(200, 255, 255);
LEADMrc1->BaseForeColor = RGB(0, 80, 0);
LEADMrc1->CombineFactor = 20;
LEADMrc1->CombineFlags = COMBINE_TRY;
LEADMrc1->Sensitivity = 25;
LEADMrc1->ImageType = IMAGETYPE_SCANNED;
LEADMrc1->AutoSegment(LEADImage1, 60, 60);
LEADMrc1->EnumSegments();
LEADMrc1->CombineFlags = COMBINE_FORCE;
LEADMrc1->CombineSegments(0, 1);
LEADMrc1->SaveSegmentation("C:\\segments.sgm");
LEADMrcDst->LoadSegmentation(LEADImage1, "C:\\segments.sgm");
LEADMrc1->StopSegmentation();
LEADMrc1->StartSegmentation(LEADImage1);
nSegID = LEADMrc1->CreateNewSegment(LEADImage1, 10, 10, 100, 100, SEGTYPE_PICTURE);
LEADMrc1->SetSegmentData(LEADImage1, nSegID, 0, 0, 10, 10, SEGTYPE_TEXT_1BIT_BW);
LEADMrcDst->StopSegmentation();
LEADMrcDst->CopySegmentationData(LEADMrc1);
LEADMrc1->EnumSegments();
LEADMrc1->DeleteSegment(nSegID);
LEADMrcDst->StopSegmentation();
LEADMrc1->StopSegmentation();
}

void __fastcall TForm1::LEADMrc1EnumSegments(int SegmentID, int SegmentLeft, int SegmentTop, int SegmentRight, int SegmentBottom, DWORD SegmentType)
{
LEADImage1->DrawPenWidth = 2;
LEADImage1->DrawFillStyle = bsClear;
LEADImage1->DrawMode = pmCopy;

if(SegmentType == SEGTYPE_TEXT_1BIT_BW)
LEADImage1->DrawPenColor = clBlack;
else if(SegmentType == SEGTYPE_TEXT_1BIT_COLOR)
LEADImage1->DrawPenColor= clYellow;
else if(SegmentType == SEGTYPE_TEXT_2BIT_COLOR)
LEADImage1->DrawPenColor= clGreen;
else if(SegmentType == SEGTYPE_GRAYSCALE_2BIT)
LEADImage1->DrawPenColor= clBlue;
else if(SegmentType == SEGTYPE_GRAYSCALE_8BIT)
LEADImage1->DrawPenColor= clWhite;
else if(SegmentType == SEGTYPE_PICTURE)
LEADImage1->DrawPenColor= clRed;;

LEADImage1->DrawRectangle
 (SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom - SegmentTop);
}


EnableMethodErrors Example for C++ Builder

LEADMrc1->EnableMethodErrors = True;
try
{
LEADMrc1->Load(LEADImage1, "c:\\testT44.mrc", 1);
}
catch (ELEADMRCError* ex)
{
ShowMessage("File load failed\nError No " + IntToStr(LEADMrc1->Error, ErrorMsg) + "\n" + LEADMrc1->ErrorMsg);
}


Load Example for C++ Builder

int nPages;

LEADMrc1->EnableMethodErrors = True;
LEADMrc1->GetPagesCount("c:\\testT44.mrc");
nPages = LEADMrc1->MRCPagesCount;
Caption = "File has " + IntToStr(nPages) + " pages";
// load last page
LEADMrc1->Load(LEADImage1, "c:\\testT44.mrc", nPages);


Save Example for C++ Builder

LEADMrc1->MaskCoder = MRC_MASK_COMPRESSION_JBIG;
LEADMrc1->PictureCoder = MRC_PICTURE_COMPRESSION_JPEG;
LEADMrc1->PictureQFactor = 2;
LEADMrc1->Grayscale2BitCoder = MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT;
LEADMrc1->Grayscale8BitCoder = MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_JPEG_8BIT;
LEADMrc1->Grayscale8BitQFactor = 2;
LEADMrc1->Text2BitCoder = MRC_TEXT_COMPRESSION_JBIG_2BIT;
LEADMrc1->Save (LEADImage1, "c:\\test.mrc", FILE_LEAD_MRC, 0, SAVE_OVERWRITE);
LEADMrc1->SaveT44 (LEADImage1, "c:\\testT44.mrc", FILE_MRC, 0, SAVE_OVERWRITE);


Tutorial for Delphi Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Mixed Raster Content VCL.

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Miscellaneous Examples


Miscellaneous Examples (Delphi)

AutoSegment Example for Delphi

EnableMethodErrors Example for Delphi

Load Example for Delphi

Save Example for Delphi


AutoSegment Example for Delphi

procedure TForm1.Button1Click(Sender: TObject);
var
nSegID: Integer;
begin
LEADMrc1.BaseBackColor := RGB(200, 255, 255);
LEADMrc1.BaseForeColor := RGB(0, 80, 0);
LEADMrc1.CombineFactor := 20;
LEADMrc1.CombineFlags := COMBINE_TRY;
LEADMrc1.Sensitivity := 25;
LEADMrc1.ImageType := IMAGETYPE_SCANNED;
LEADMrc1.AutoSegment(LEADImage1, 60, 60);
LEADMrc1.EnumSegments();
LEADMrc1.CombineFlags:= COMBINE_FORCE;
LEADMrc1.CombineSegments(0, 1);
LEADMrc1.SaveSegmentation('C:\segments.sgm');
LEADMrcDst.LoadSegmentation(LEADImage1, 'C:\segments.sgm');
LEADMrc1.StopSegmentation();
LEADMrc1.StartSegmentation(LEADImage1);
nSegID:= LEADMrc1.CreateNewSegment(LEADImage1, 10, 10, 100, 100, SEGTYPE_PICTURE);
LEADMrc1.SetSegmentData(LEADImage1, nSegID, 0, 0, 10, 10, SEGTYPE_TEXT_1BIT_BW);
LEADMrcDst.StopSegmentation();
LEADMrcDst.CopySegmentationData(LEADMrc1);
LEADMrc1.EnumSegments();
LEADMrc1.DeleteSegment(nSegID);
LEADMrcDst.StopSegmentation();
LEADMrc1.StopSegmentation();
end;

procedure TForm1.LEADMrc1EnumSegments(SegmentID, SegmentLeft, SegmentTop, SegmentRight, SegmentBottom: Integer; SegmentType: Cardinal);
begin
LEADImage1.DrawPenWidth := 2;
LEADImage1.DrawFillStyle := bsClear;
LEADImage1.DrawMode := pmCopy;

if (SegmentType = SEGTYPE_TEXT_1BIT_BW) then
LEADImage1.DrawPenColor := clBlack
else if (SegmentType = SEGTYPE_TEXT_1BIT_COLOR) then
LEADImage1.DrawPenColor:= clYellow
else if (SegmentType = SEGTYPE_TEXT_2BIT_COLOR) then
LEADImage1.DrawPenColor:= clGreen
else if (SegmentType = SEGTYPE_GRAYSCALE_2BIT) then
LEADImage1.DrawPenColor:= clBlue
else if (SegmentType = SEGTYPE_GRAYSCALE_8BIT) then
LEADImage1.DrawPenColor:= clWhite
else if (SegmentType = SEGTYPE_PICTURE) then
LEADImage1.DrawPenColor:= clRed;

LEADImage1.DrawRectangle
 (SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom - SegmentTop);
end;


EnableMethodErrors Example for Delphi

LEADMrc1.EnableMethodErrors := True;
try
LEADMrc1.Load(LEADImage1, 'c:\testT44.mrc', 1);
except
ShowMessage('File load failed'#10'Error No ' + IntToStr(LEADMrc1.Error) + #10 + LEADMrc1.ErrorMsg);
end;


Load Example for Delphi

var
nPages: Integer;
begin
LEADMrc1.EnableMethodErrors := True;
LEADMrc1.GetPagesCount('c:\testT44.mrc');
nPages := LEADMrc1.MRCPagesCount;
Caption := 'File has ' + IntToStr(nPages) + ' pages';
// load last page
LEADMrc1.Load(LEADImage1, 'c:\testT44.mrc', nPages);
end;


Save Example for Delphi

LEADMrc1.MaskCoder := MRC_MASK_COMPRESSION_JBIG;
LEADMrc1.PictureCoder := MRC_PICTURE_COMPRESSION_JPEG;
LEADMrc1.PictureQFactor := 2;
LEADMrc1.Grayscale2BitCoder := MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT;
LEADMrc1.Grayscale8BitCoder := MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_JPEG_8BIT;
LEADMrc1.Grayscale8BitQFactor := 2;
LEADMrc1.Text2BitCoder := MRC_TEXT_COMPRESSION_JBIG_2BIT;
LEADMrc1.Save(LEADImage1, 'c:\test.mrc', FILE_LEAD_MRC, 0, SAVE_OVERWRITE);
LEADMrc1.SaveT44(LEADImage1, 'c:\testT44.mrc', FILE_MRC, 0, SAVE_OVERWRITE);


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

Before calling technical support, please look in the online documentation and the example programs for an answer to your question.


Properties, Methods, and Events

MRC Bitmap Functionality

Performing Automatic Segmentation

Loading a Page

Manipulating Segments

Manual Segmentation

Saving a Page

Starting/Stopping Segmentation

General Segmentation

Auxiliary Elements


MRC Bitmap Functions: Performing Automatic Segmentation

MRC Bitmap Functions:
Performing Automatic Segmentation (Document/Medical only)

AutoSegment method

CombineFactor property

CombineFlags property

ImageType property

Sensitivity property

StartSegmentation method

StopSegmentation method


MRC Bitmap Functions: Loading a Page

MRC Bitmap Functions:
Loading a Page (Document/Medical only)

GetPagesCount method

Load method

MRCPagesCount property


MRC Bitmap Functions: Manipulating Segments

MRC Bitmap Functions:
Manipulating Segments (Document/Medical only)

CombineFactor property

CombineFlags property

CombineSegments method

CopySegmentationData method

DeleteSegment method

EnumSegments method

LoadSegmentation method

SaveSegmentation method

SetSegmentData method

StartSegmentation method

StopSegmentation method

OnEnumSegments event


MRC Bitmap Functions: Manual Segmentation

MRC Bitmap Functions:
Manual Segmentation (Document/Medical only)

CreateNewSegment method

StartSegmentation method

StopSegmentation method

CombineFactor property

CombineFlags property

CombineSegments method

CopySegmentationData method

DeleteSegment method

EnumSegments method

SaveSegmentation method

SetSegmentData method

OnEnumSegments event


MRC Bitmap Functions: Saving a Page

MRC Bitmap Functions:
Saving a Page (Document/Medical only)

Save method

SaveT44 method

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

MaskCoder property

PictureCoder property

PictureQFactor property

Text2BitCoder property


MRC Bitmap Functions: Starting/Stopping Segmentation

MRC Bitmap Functions:
Starting/Stopping Segmentation (Document/Medical only)

StartSegmentation method

StopSegmentation method


MRC Bitmap Functions: General Segmentation

MRC Bitmap Functions:
General Segmentation (Document/Medical only)

BaseBackColor property

BaseForeColor property

CombineFlags property

CombineFactor property

ImageType property

Sensitivity property

StartSegmentation method

StopSegmentation method

CreateNewSegment method

CombineSegments method

CopySegmentationData method

DeleteSegment method

EnumSegments method

SaveSegmentation method

SetSegmentData method

OnEnumSegments event


MRC Bitmap Functions: Auxiliary Elements

MRC Bitmap Functions:
Auxiliary Elements (Document/Medical only)

EnableMethodErrors property

Error Property

ErrorMsg Property


Error Codes

For a list of all possible error codes for LEADTOOLS Mixed Raster Content VCL, refer to LEADTOOLS VCL Error Codes in the Main VCL help file.


BaseBackColor property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned BaseBackColor
Delphi Syntax | BaseBackColor: COLORREF
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates the default base background color for the LEADMrc Bitmap. The default value is RGB(255, 255, 255). For more information on color values, refer to Using Color Values in LEADTOOLS .

See Also

Elements | BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg 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: General Segmentation


BaseForeColor property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned BaseForeColor
Delphi Syntax | BaseForeColor: COLORREF
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates the default base foreground color for the LEADMrc Bitmap. The default value is RGB(0, 0, 0). For more information on color values, refer to Using Color Values in LEADTOOLS .

See Also

Elements | BaseBackColor 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: General Segmentation


CombineFactor property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned CombineFactor
Delphi Syntax | CombineFactor: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) A percentage value that represents the acceptable difference between the two segments being combined. This property is used only when the CombineFlags property is COMBINE_TRY. Possible values are between 0 and 100. A value of 0 indicates that only segments that are an exact match can be combined. A value of 100 indicates that any two segments of the same type can be combined. Large values cause very different segments to be joined, which causes considerable quality loss. The default value is 30.

This property may be used when performing automatic segmentation using the AutoSegment method, or it may be used when combining two segments using the CombineSegments method.

See Also

Elements | BaseBackColor property, BaseForeColor 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 |


CombineFlags property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned CombineFlags
Delphi Syntax | CombineFlags: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Flag that indicates how segments are to be combined. The default value is COMBINE_TRY. Possible values are:

Value | Description
COMBINE_FORCE | [0x00] Always combine segments of any type.
COMBINE_FORCESIMILAR | [0x01] Always combine similar segments.
COMBINE_TRY | [0x02] Use the CombineFactor property to determine similarity, and combine similar segments.

For the COMBINE_FORCESIMILAR value, similar means either identical or one of the following:

SEGTYPE_TEXT_1BIT_BW, SEGTYPE_TEXT_1BIT_COLOR or SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_TEXT_1BIT_COLOR or SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_GRAYSCALE_2BIT or SEGTYPE_GRAYSCALE_8BIT

SEGTYPE_GRAYSCALE_8BIT or SEGTYPE_PICTURE

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, Error property, ErrorMsg 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 |


EnableMethodErrors property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | bool EnableMethodErrors
Delphi Syntax | EnableMethodErrors: Boolean
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). The default value is True. Possible values are:

Setting | Description
TRUE | Generate runtime exceptions.
FALSE | Do not generate runtime exceptions.

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: Auxiliary Elements


ErrorMsg property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | System::AnsiString ErrorMsg
Delphi Syntax | ErrorMsg: String
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Read only) (Document/Medical only) Gives the description corresponding to the error resulting from the last method called or property set. If the last operation was successful, the value is an empty string.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, EnableMethodErrrors property, Error 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: Auxiliary Elements


Error property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int Error
Delphi Syntax | Error: L_INT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Read Only) (Document/Medical only) Gives the error code of the last method called or property set by the LEADMrc control. If the last operation performed was successful, the value is SUCCESS. Use the ErrorMsg property to get the description corresponding to the error.

For a list of error codes, refer to Error Codes.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, ErrorMsg 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: Auxiliary Elements


Grayscale2BitCoder property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned Grayscale2BitCoder
Delphi Syntax | Grayscale2BitCoder: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates which grayscale 2-bit compression type is to be used when saving a T44 file. The default value is MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT. This property is only used when saving in the LEAD Proprietary T44 format using the Save method (when using the SaveT44 method, all 2-bit grayscale segments are treated as picture segments). Possible values are:

Setting | Description
MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT | [0x00] Use 2 bpp grayscale JBIG compression.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg 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


Grayscale8BitCoder property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned Grayscale8BitCoder
Delphi Syntax | Grayscale8BitCoder: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates which grayscale 8-bit compression type is to be used when saving a T44 file. This property is used only when saving in the LEAD Proprietary T44 format using the Save method (when using the SaveT44 method, all 8-bit grayscale segments are treated as picture segments). The default value is MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_JPEG_8BIT. Possible values are:

Setting | Description
MRC_GRAYSCALE_COMPRESSION_LOSSLESS_CMW_8BIT | [0x00] Use 8 bpp Lossless grayscale LEAD CMW compression.
MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT | [0x01] Use 8 bpp grayscale LEAD CMW compression.
MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMP_8BIT | [0x02] Use 8 bpp grayscale LEAD CMP compression.
MRC_GRAYSCALE_COMPRESSION_LOSSLESS_JPEG_8BIT | [0x03] Use 8 bpp Lossless grayscale JPEG compression.
MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_JPEG_8BIT | [0x04] Use 8 bpp grayscale JPEG compression.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg property, Grayscale2BitCoder 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


Grayscale8BitQFactor property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned Grayscale8BitQFactor
Delphi Syntax | Grayscale8BitQFactor: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates the compression quality to be used if JPEG, CMP or CMW compression is being used. This property is used only when saving in the LEAD Proprietary T44 format using the Save method (when using the SaveT44 method, all 8-bit grayscale segments are treated as picture segments).

If the Grayscale8BitCoder property is CMW lossless or JPEG lossless compression, the Grayscale8BitQFactor property should be 0. Otherwise, possible values are between 2 and 255, where 2 represents the highest quality and 255 the most compression. The default value is 2.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg property, Error property, ErrorMsg property, Grayscale2BitCoder property, Grayscale8BitCoder 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


ImageType property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned ImageType
Delphi Syntax | ImageType: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates whether the image has been scanned, or is computer-generated. The default value is IMAGETYPE_SCANNED. Possible values are:

Setting | Description
IMAGETYPE_SCANNED | [0x00] The image is a scanned image. Noise will be removed before segmentation.
IMAGETYPE_COMPUTERGENERATED | [0x01] The image is computer-generated. It will not be cleaned before segmentation.

This property is used when automatically segmenting a bitmap using the AutoSegment method.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg property, Grayscale2BitCoder property, Grayscale8BitCoder property, Grayscale8BitQFactor 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: Performing Automatic Segmentation


MaskCoder property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned MaskCoder
Delphi Syntax | MaskCoder: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates which mask compression is to be used when saving a LEAD proprietary T44 file or a Standard T44 file. The default value is MRC_MASK_COMPRESSION_FAX_G4. Possible values are:

Value | Meaning
MRC_MASK_COMPRESSION_JBIG | [0x00] Use JBIG compression.
MRC_MASK_COMPRESSION_FAX_G4 | [0x01] Use Fax group 4 compression.
MRC_MASK_COMPRESSION_FAX_G3_1D | [0x02] Use Fax group 3 (1D) compression.
MRC_MASK_COMPRESSION_FAX_G3_2D | [0x03]. Use Fax group 3 (2D) compression.

See Also

Elements | BaseBackColor property, BaseForeColor property, CombineFactor property, CombineFlags property, Error property, ErrorMsg property, Grayscale2BitCoder property, Grayscale8BitCoder property, Grayscale8BitQFactor property, ImageType 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


MRCPagesCount property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int MRCPagesCount
Delphi Syntax | MRCPagesCount: L_INT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Read only) (Document/Medical only) Gets the number of pages in the MRC file. Call the GetPagesCount method to fill this property.

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: Loading a Page


PictureCoder property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned PictureCoder
Delphi Syntax | PictureCoder: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates which picture compression type is to be used when saving a LEAD proprietary T44 file or a Standard T44 file. The default value is MRC_PICTURE_COMPRESSION_JPEG. Possible values are:

Setting | Description
MRC_PICTURE_COMPRESSION_CMW | [0x00] Use LEAD Wavelet (CMW) compression
MRC_PICTURE_COMPRESSION_LOSSLESS_CMW | [0x01] Use LEAD Lossless Wavelet (CMW) compression
MRC_PICTURE_COMPRESSION_CMP | [0x02] Use LEAD CMP compression.
MRC_PICTURE_COMPRESSION_JPEG | [0x03] Use JPEG compression.
MRC_PICTURE_COMPRESSION_LOSSLESS_JPEG | [0x04] Use Lossless JPEG compression.

When saving to the Standard T44 format using the SaveT44 method, the only valid PictureCoder property is MRC_PICTURE_COMPRESSION_JPEG.

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


PictureQFactor property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int PictureQFactor
Delphi Syntax | PictureQFactor: L_INT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates which compression quality factor is to be used when compressing picture segments using JPEG, CMP or CMW compression. The default value is 2.

If the PictureCoder property is MRC_PICTURE_COMPRESSION_LOSSLESS_CMW or MRC_PICTURE_COMPRESSION_LOSSLESS_JPEG, the PictureQFactor property should be 0.

If the PictureCoder property is MRC_PICTURE_COMPRESSION_JPEG, MRC_PICTURE_COMPRESSION_CMP, or MRC_PICTURE_COMPRESSION_CMW, possible values are between 2 and 255, where 2 represents the highest quality and 255 the most compression.

When saving a file using the SaveT44 method, the only valid PictureCoder property is MRC_PICTURE_COMPRESSION_JPEG.

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


Sensitivity property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int Sensitivity
Delphi Syntax | Sensitivity: L_INT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Threshold value that is used to determine a segment's type. This is a control parameter used internally by the AutoSegment method to determine whether a certain segment should be considered as text, grayscale or an image. Higher values mean more segments are considered as text. Lower values mean more segments are considered as images. This property is used only when calling the AutoSegment method. Possible values are between 1 and 100. The default value is 2.

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, 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: Performing Automatic Segmentation


Text2BitCoder property (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | unsigned Text2BitCoder
Delphi Syntax | Text2BitCoder: L_UINT
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Persistent property, available at design time) (Document/Medical only) Indicates the type of text 2-bit compression to be used when saving a T44 file. The default value is MRC_TEXT_COMPRESSION_JBIG_2BIT. This value is valid only when saving in the LEAD Proprietary T44 format using the Save method. Possible values are:

Setting | Description
MRC_TEXT_COMPRESSION_JBIG_2BIT | [0x00] JBIG 2-bit compression
MRC_TEXT_COMPRESSION_GIF_2BIT | [0x01] GIF 2-bit compression

When saving in standard T44 format using the SaveT44 method, the only valid picture compression is MRC_PICTURE_COMPRESSION_JPEG.

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, 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


AutoSegment method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int AutoSegment(TLEADImage* LEADImg, int nMinWidth, int nMinHeight);
Delphi Syntax | Function AutoSegment(LEADImg: TLEADImage; nMinWidth: L_INT; nMinHeight: L_INT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Automatically segments the given LEADImage's bitmap.

Call this method to segment the bitmap automatically. LEADTOOLS segments the bitmap into blocks nMinWidth wide by nMinHeight long. Segments are assigned a type according to the number of colors they have (those with a few colors become text segments and those with many colors become picture segments). Segments with the same type are combined.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

Set the following properties before calling the AutoSegment method to control the segmentation process:

CombineFactor property

CombineFlags property

ImageType property

Sensitivity property

If the AutoSegment method is called with the ImageType property set to IMAGETYPE_SCANNED (the default value), noise is removed from the image before segmenting it. Set the ImageType property to IMAGETYPE_COMPUTERGENERATED if noise does not need to be removed from the image.

The following properties are used solely by the AutoSegment method:

Sensitivity property

ImageType property

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, 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: Performing Automatic Segmentation


CombineSegments method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int CombineSegments(int nSegId1, int nSegId2);
Delphi Syntax | Function CombineSegments(nSegId1: L_INT; nSegId2: L_INT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Combines two segments. This method is used to combine two specific segments. The two segments must be in the same row or column to be combined. Use the CombineFlags property and the CombineFactor property to control which segments are combined and how those segments are combined.

This method can be used when performing automatic or manual segmentation.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, 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: Manipulating Segments


CopySegmentationData method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int CopySegmentationData(TLEADMrc* LEADMrc);
Delphi Syntax | Function CopySegmentationData(LEADMrc: TLEADMrc): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Copies the MRC object Data referenced in LEADMrc to this TLEADMrc object. This method copies the MRC segmentation data. Call StopSegmentation to free the new LEAD MRC object.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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: Manipulating Segments


CreateNewSegment method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int CreateNewSegment(TLEADImage* LEADImg, int nSegmentLeft, int nSegmentTop, int nSegmentRight, int nSegmentBottom, unsigned uSegType);
Delphi Syntax | Function CreateNewSegment(LEADImg: TLEADImage; nSegmentLeft: L_INT; nSegmentTop: L_INT; nSegmentRight: L_INT; nSegmentBottom: L_INT; uSegType: L_UINT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Manually adds a new segment.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, 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: Manual Segmentation


DeleteSegment method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int DeleteSegment(int nSegId);
Delphi Syntax | Function DeleteSegment(nSegId: L_INT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Deletes a specific segment from the object. This method can be used when performing either automatic or manual segmentation.

When performing manual segmentation, use the CreateNewSegment method to obtain the segment IDs.

When performing automatic segmentation using the AutoSegment method, call the EnumSegments method to obtain segment information and associated IDs.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, 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: Manipulating Segments


EnumSegments method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int EnumSegments();
Delphi Syntax | Function EnumSegments(): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Enumerates the segments created by automatic or manual segmentation. An OnEnumSegments event is fired once for each segment, which provides the segment coordinates and their IDs.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, GetPagesCount method, Load method, LoadSegmentation method, Save method, SaveSegmentation method, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Manipulating Segments


GetPagesCount method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int GetPagesCount(AnsiString strFileName);
Delphi Syntax | Function GetPagesCount(strFileName: String): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Fills the MRCPagesCount property with the number of pages in a Mixed Raster Content (MRC) file.

Call the MRCPagesCount property after calling this method to get the number of pages in an MRC file.

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, Load method, LoadSegmentation method, Save method, SaveSegmentation method, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Loading a Page


Load method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int Load(TLEADImage* LEADImg, AnsiString strFileName, int nPageNo);
Delphi Syntax | Function Load(LEADImg: TLEADImage; strFileName: String; nPageNo: L_INT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Loads Mixed Raster Content (MRC) files that were saved using either the LEAD Proprietary T44 Format or the Standard T44 Format. If the file is a multipaged file, pass the number of the page to be loaded to nPageNo. Use 1 to load a single paged file.

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, LoadSegmentation method, Save method, SaveSegmentation method, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Loading a Page


LoadSegmentation method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int LoadSegmentation(TLEADImage* LEADImg, AnsiString strFileName);
Delphi Syntax | Function LoadSegmentation(LEADImg: TLEADImage; strFileName: String): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Loads segments from a file. This method loads the segments from a file to this LEADImage object.

Call the EnumSegments method to enumerate the segments.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, Save method, SaveSegmentation method, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Manipulating Segments


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:

Take advantage of the greater number of different segment types available when using the proprietary format.

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

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


SaveSegmentation method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int SaveSegmentation(AnsiString strFileName);
Delphi Syntax | Function SaveSegmentation(strFileName: String): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Saves the segments from this LEAD MRC object to the specified file in a binary file format.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, SaveT44 method, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Manipulating Segments


SaveT44 method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int SaveT44(TLEADImage* LEADImg, AnsiString strFileName, int nFormat, int nPage, int nModify);
Delphi Syntax | Function SaveT44(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 LEADImage bitmap in one of the standard T44 Formats: as a Standard T44 format file (if the nFormat value is FILE_MRC) or as a TIF file with a MRC subtype format (if the nFormat value is FILE_TIF_MRC). When an nFormat value of FILE_MRC is used, *.MRC is the default file extension. When an nFormat value of FILE_TIF_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 SaveT44 method maps the text and picture segments into layers (mask, background and foreground layers) as defined in the NLS* model of the T.44 standard. If segmentation has been performed, when the SaveT44 method is called any 2-bit text, 2-bit grayscale, and 8-bit grayscale segments are treated as 24-bit image segments. If a text segment contains text over a background, when it is saved using the SaveT44 method the background color is lost. For more information on Mixed Raster Content (MRC) formats, refer to Working with MRC Bitmaps.

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.

Use the Save method to save a file in the LEAD Proprietary T44 format to:

Take advantage of the greater number of different segment types available when using the proprietary format.

Create smaller files than would be possible by saving them to the standard T44 format.

Create higher quality files than would be possible by saving them to the standard T44 format.

Please note that when creating a Standard T44 format file (calling the SaveT44 method using an nFormat value of FILE_MRC), only one page can be saved.

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

SEGTYPE_TEXT_1BIT_BW

SEGTYPE_TEXT_1BIT_COLOR

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. Note that when using the SaveT44 method all segments that have been classified through segmentation as 2-bit text, 2-bit grayscale, or 8-bit grayscale segments will be treated as 24-bit image segments. Set the compression for pictures by setting the PictureCoder property. JPEG compression can be used. Set the quality factor for pictures by setting the PictureQFactor property.

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 SaveT44 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 SaveT44 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 segments using a CombineFactor property of 30, and an ImageType of scanned. The SaveT44 function can recognize two different segment types: 1-bit text and picture. The compression for 1-bit schemes can be Fax G3 1D, Fax G3 2D, Fax G4 or JBIG. Use the MaskCoder property to set the compression for the 1-bit schemes. The default is Fax G4. The compression for pictures can be JPEG, and can be set using the PictureCoder property and the PictureQFactor property. The default is JPEG compression with a PictureQFactor of 2.

*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, SetSegmentData method, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Saving a Page


SetSegmentData method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int SetSegmentData(TLEADImage* LEADImg, int nSegId, int nSegmentLeft, int nSegmentTop, int nSegmentRight, int nSegmentBottom, unsigned uSegType);
Delphi Syntax | Function SetSegmentData(LEADImg: TLEADImage; nSegId: L_INT; nSegmentLeft: L_INT; nSegmentTop: L_INT; nSegmentRight: L_INT; nSegmentBottom: L_INT; uSegType: L_UINT): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Updates the segment information. The LEADTOOLS engine will update the segments using the new segment data passed to this method. This process may create or delete segments.

The user can enumerate all segments using the EnumSegments method to get segment IDs and segment information.

The method will return an error if the updated segment exceeds its image boundaries. The method will update the segments so they remain within the bitmap width and height.

Call the StartSegmentation method before using any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method.

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, StartSegmentation method, StopSegmentation method, OnEnumSegments event
Topics | MRC Bitmap Functions: Manipulating Segments


StartSegmentation method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int StartSegmentation(TLEADImage* LEADImg);
Delphi Syntax | Function StartSegmentation(LEADImg: TLEADImage): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Initializes the segmentation process. Call this method before using any of the segmentation methods. When the LEADMrc object is no longer needed, it should be freed by calling the StopSegmentation method.

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, StopSegmentation method, OnEnumSegments event
Topics |


StopSegmentation method (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | int StopSegmentation(void);
Delphi Syntax | Function StopSegmentation(): L_INT;
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Ends the bitmap segmentation and frees all data variables and buffers allocated by the StartSegmentation method.

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, OnEnumSegments event
Topics |


OnEnumSegments event (LEADMrc Control)

C++ Builder Example

Delphi Example

Builder Syntax | TEnumSegments OnEnumSegments(int SegmentID, int SegmentLeft, int SegmentTop, int SegmentRight, int SegmentBottom, unsigned SegmentType);
Delphi Syntax | OnEnumSegments(SegmentID: L_INT; SegmentLeft: L_INT; SegmentTop: L_INT; SegmentRight: L_INT; SegmentBottom: L_INT; SegmentType: L_UINT): TEnumSegments
Overview | Refer to Working with the LEADMrc Control.

Remarks

(Document/Medical only) Triggered during the enumeration process for either automatically generated or manually generated segments.

The OnEnumSegments event is fired once for each segment.

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
Topics | MRC Bitmap Functions: Manipulating Segments


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock support for L_SUPPORT_LTPRO, using the UnlockSupport method . L_KEY_LTPRO can be found in LTLckKey.inc.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling the UnlockSupport method.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical]. LEADTOOLS supports the Mixed Raster Content format, adding support for color documents containing mixed image and text components.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase and WordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

Congratulations! You have licensed one of the LEADTOOLS Document/Medical software products, the most comprehensive imaging toolkits on the market, enabling you to create powerful imaging applications. The license terms for LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite require runtime licensing based on the number of copies of your application that you deploy (i.e., distribute or install and use internally).

By paying the initial box price for the applicable LEADTOOLS product, you have obtained a development license, which entitles you to develop your application and test it. Once completed, if you wish to distribute the application or deploy it internally on multiple machines, you are required to enter into a duplication and distribution agreement with LEAD. You have the ability to choose from several licensing options depending on your volume needs.

The product you are installing is a fully functional working version and includes support for all features in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. (Depending on which product you have licensed, some of the features may ultimately not be available to you. See the on-line help file for a product feature comparison.) Until you sign and return the correct licensing agreement, your application will display a "nag" message. Once LEAD receives the executed contract, we will provide you a password that will permit you to terminate the "nag" message for the product that you have licensed. In addition to providing the password, you must also use the no nag version of the LTKRN14N.DLL, found in the REDIST\NONAGLTKRN directory. This is also the version you must redistribute.

Duplication and Distribution Agreements

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.


Return for AutoSegment

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for AutoSegment

LEADImg

ILEADRaster object that contains the image to be segmented.


nMinHeight Parameter for AutoSegment

nMinHeight

Minimum segment height, in pixels. This should be at least 10. The default value is 60.


nMinWidth Parameter for AutoSegment

nMinWidth

Minimum segment width, in pixels. This should be at least 10. The default value is 60.


Return for CombineSegments

Return Value

Return | Meaning
SUCCESS | The method was successful.
<=0 | An error occurred. Refer to Error Codes.


nSegId1 Parameter for CombineSegments

nSegId1

ID of the first segment to be combined.


nSegId2 Parameter for CombineSegments

nSegId2

ID of the second segment to be combined.


Return for CopySegmentationData

Return Value

Return | Meaning
SUCCESS | The method was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADMrc Parameter for CopySegmentationData

LEADMrc

TLEADMrc object that contains the source MRC Segmentation Data.


Return for CreateNewSegment

Return Value

Return | Meaning
>= 0 | Index of the newly added segment. The method was successful.
< 0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for CreateNewSegment

LEADImg

TLEADImage object that contains the image in which the segment will be created.


nSegmentBottom Parameter for CreateNewSegment

nSegmentBottom

Bottom segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentLeft Parameter for CreateNewSegment

nSegmentLeft

Left segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentRight Parameter for CreateNewSegment

nSegmentRight

Right segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentTop Parameter for CreateNewSegment

nSegmentTop

Top segment boundary, in pixels and relative to the origin of the bitmap.


uSegType Parameter for CreateNewSegment

uSegType

Flag that indicates the type of segment. Possible values are:

Value | Meaning
SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLOR | [0x02] Segment is 1 bit colored text.
SEGTYPE_TEXT_2BIT_COLOR | [0x03] Segment is 2 bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.


Return for DeleteSegment

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


nSegId Parameter for DeleteSegment

nSegId

Target segment identifier to be deleted


Return for EnumSegments

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


Return for GetPagesCount

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


strFileName Parameter for GetPagesCount

strFileName

Character string containing the name of the MRC file.


Return for Load

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for Load

LEADImg

TLEADImage object to receive the loaded image.


nPageNo Parameter for Load

nPageNo

The number of the page to be loaded from the file.


Return for LoadSegmentation

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for LoadSegmentation

LEADImg

TLEADImg object that contains size information used to clip the segments.


strFileName Parameter for LoadSegmentation

strFileName

Character string containing the input file name.


strFileName Parameter for Load

strFileName

Character string containing the name of the image file to load.


SegmentBottom Parameter for OnEnumSegments

SegmentBottom

Bottom segment boundary from the original bitmap.


SegmentID Parameter for OnEnumSegments

SegmentID

Segment Identifier


SegmentLeft Parameter for OnEnumSegments

SegmentLeft

Left segment boundary from the original bitmap.


SegmentRight Parameter for OnEnumSegments

SegmentRight

Right segment boundary from the original bitmap.


SegmentTop Parameter for OnEnumSegments

SegmentTop

Top segment boundary from the original bitmap.


SegmentType Parameter for OnEnumSegments

SegmentType

Flag that indicates the type of segment. Possible values are:

Value | Meaning
SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLOR | [0x02] Segment is 1 bit colored text.
SEGTYPE_TEXT_2BIT_COLOR | [0x03] Segment is 2 bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.


Return for Save

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for Save

LEADImg

TLEADImage object that contains the image to be saved.


nFormat Parameter for Save

nFormat

Value that indicates the file format to be used when saving. Possible values are:

Value | Meaning
FILE_LEAD_MRC | Use the LEAD proprietary T44 format. The default file extension is *.MRC.
FILE_TIF_LEAD_MRC | Use a TIF format with the LEAD proprietary T44 format as a subtype. The default file extension is *.TIF.


nModify Parameter for Save

nModify

Value that indicates which page insertion and replacement option to use when that feature is supported. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] Do not insert/replace/append. Overwrite any existing file.
SAVE_APPEND | [1] or [-1] Append the page if the file exists.
SAVE_REPLACE | [2] Replace the page specified in the nPage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the nPage parameter.


nPage Parameter for Save

nPage

Value that represents a page number in a multi-page MRC file. This parameter is used only if the nModify parameter is SAVE_REPLACE or SAVE_INSERT.

If nModify is SAVE_REPLACE, nPage represents the number of the page to be replaced (the first page is page 1).

If nModify is SAVE_INSERT, nPage represents the number of the page in front of which the new page will be inserted. For example, if nPage is 1 and nModify is SAVE_INSERT, then the page being saved becomes the first page in the file.


Return for SaveSegmentation

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


strFileName Parameter for SaveSegmentation

strFileName

Character string containing the output file name.


strFileName Parameter for Save

strFileName

Character string that contains the output file name.


Return for SaveT44

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for SaveT44

LEADImg

TLEADImage object that contains the image to be saved.


nFormat Parameter for SaveT44

nFormat

Value that indicates the file format to be used when saving. Possible values are:

Value | Meaning
FILE_MRC | Use the Standard T44 format. The default file extension is *.MRC.
FILE_TIF_MRC | Use a TIF format with the Standard T44 format as a subtype. The default file extension is *.TIF.


nModify Parameter for SaveT44

nModify

Value that indicates which page insertion and replacement option to use when that feature is supported.

This value is ignored when saving using an nFormat of FILE_MRC. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] Do not insert/replace/append. Overwrite any existing file.
SAVE_APPEND | [1] or [-1] Append the page if the file exists.
SAVE_REPLACE | [2] Replace the page specified in the nPage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the nPage parameter.


nPage Parameter for SaveT44

nPage

Value that represents a page number in a multi-page MRC file.

When saving using an nFormat of FILE_MRC (where only one page can be saved), use nPage to designate the page number to be saved. The nModify parameter will be ignored.

When saving using an nFormat of FILE_TIF_MRC, this parameter is used only if the nModify parameter is SAVE_REPLACE or SAVE_INSERT. In this situation, nPage is used as follows:

If nModify is SAVE_REPLACE, nPage represents the number of the page to be replaced (the first page is page 1).

If nModify is SAVE_INSERT, nPage represents the number of the page in front of which the new page will be inserted. For example, if nPage is 1 and nModify is SAVE_INSERT, then the page being saved becomes the first page in the file.


strFileName Parameter for SaveT44

strFileName

Character string that contains the output file name.


Return for SetSegmentData

Return Value

Return | Meaning
SUCCESS | The function was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for SetSegmentData

LEADImg

TLEADRaster object that contains the image in which the segment will be updated.


nSegId Parameter for SetSegmentData

nSegId

ID of the segment to be updated.


nSegmentBottom Parameter for SetSegmentData

nSegmentBottom

Bottom segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentLeft Parameter for SetSegmentData

nSegmentLeft

Left segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentRight Parameter for SetSegmentData

nSegmentRight

Right segment boundary, in pixels and relative to the origin of the bitmap.


nSegmentTop Parameter for SetSegmentData

nSegmentTop

Top segment boundary, in pixels and relative to the origin of the bitmap.


uSegType Parameter for SetSegmentData

uSegType

Flag that indicates the type of segment. Possible values are:

Value | Meaning
SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLOR | [0x02] Segment is 1-bit colored text.
SEGTYPE_TEXT_2BIT_COLOR | [0x03] Segment is 2-bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.


Return for StartSegmentation

Return Value

Return | Meaning
SUCCESS | The method was successful.
<=0 | An error occurred. Refer to Error Codes.


LEADImg Parameter for StartSegmentation

LEADImg

TLEADImage object that contains the image to be segmented.


Return for StopSegmentation

Return Value

Return | Meaning
SUCCESS | The method was successful.
<=0 | An error occurred. Refer to Error Codes.