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 a new WinHelp session to review the License Agreements governing your use of the software.
	Click this button to start a new WinHelp session to review the full line of LEADTOOLS Products.
	Click this button to start a new WinHelp session to review the full line of LEADTOOLS Image Categories.


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 UnlockSupport.  To unlock these features, call UnlockSupport(L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

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 UnlockSupport.

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, 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 for color documents containing mixed image and text components. For more information, refer to the Main COM help file (Ltcomn.chm) in the Help directory.

 Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

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 andWordPerfect. 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 LEADTOOLS Products help file.


Copyright notice
Copyright Notices

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

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

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

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. 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.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

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
Technical support: (704) 372-9681 or Support@Leadtools.com
Home page: http://www.leadtools.com


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.


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
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

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


Syntax

This is the internal syntax of the property, method, or event. The external syntax depends on the development system you are using. Refer to the code example for your system, or for general information, refer to the following:

Visual Basic Syntax

Visual C++ 4.0 Syntax


Visual Basic Syntax

The syntax for the LEAD control's properties, methods, and events is the same as for other controls in Visual Basic.

Whenever you declare a variable as a data type, you need to know how the ActiveX data type is expressed in Visual Basic. Refer to the following table for the appropriate data type:

ActiveX Data Type	Visual Basic Data Type
boolean	Boolean
BSTR	String
IPictureDisp	Picture
long	Long
OLE_HANDLE	Integer on a 16-bit system; Long on a 32-bit system
OLE_COLOR	Long color value (such as the RGB return value)
OLE_XPOS_PIXELS	Long
OLE_YPOS_PIXELS	Long
short	Integer
float	Single


Visual C++ 4.0 Syntax

In Version 4.0 of Visual C++, the MicroSoft Foundation Class (MFC) library provides an ActiveX interface. This topic describes how to use the interface with the LEADTOOLS ActiveX.

Alternatively, to create an instance of the LEAD control at run time, use the Create function, which has the following prototype:

BOOL Create( LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT&rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL);

Provide parameters as follows:

lpszWindowName	Use "", because the control window does not need a name.
dwStyle	Use 0 for the default style.
&rect	Use the CRect function. For example: CRect(0,0,50,50).
pParentWnd	Use this to refer to the current window.
nID	Use 0 for the default ID.
pPersist	Use NULL.
bStorage	Use FALSE.
bstrLicKey	Use the LEADTOOLS license string, which is always the first line in the LTOCX14.LIC file. For example: "LEADTOOLS OCX Copyright (c) 2003 LEAD Technologies, Inc." If you do not specify this string correctly, the ActiveX will not work when you distribute your application.
For example, the following code comes from the EXAMPLES\OCX\MFC40\DEMO\MAINDEMO.CPP file:

static const WCHAR BASED_CODE _szLicString[] =
   L"LEADTOOLS OCX Copyright (c) 1991-2003 LEAD Technologies, Inc.";
     o
     o
     o
m_pLead = new CLead;
// pass the license string to the CLead::Create function.
// The CLead::Create expects a BSTR parameter and SysAllocString converts the
// WCHAR[] to a BSTR
BSTR lpLic = SysAllocString(_szLicString);
m_pLead->Create("", 0,CRect(0,0,50,50),this,0,NULL,FALSE,lpLic);
m_pLead->ShowWindow(SW_HIDE);
SysFreeString(lpLic);

When getting or setting a property value, you must use a function that is created by adding a prefix to the property name.

To set a property value, the syntax is as follows:

m_controlname.Setpropertyname(value);

For example:

m_Lead1.SetRubberBandVisible(FALSE);

To get a property value, the syntax is as follows:

value = m_controlname.Getpropertyname();

For example:

HeightFactor = m_Lead1.GetBitmapHeight();

To set a property array value, the syntax is as follows:

m_controlname.Setpropertyname(index, value);

For example:

m_Lead1.SetRemapTable(MyIndex, (255 * Offset) / CurrentRange);

To get a property array value, the syntax is as follows:

value = m_controlname.Getpropertyname(index);

For example:

m_Lead1.SetBitmap(m_Lead1.GetColorPlanes(3)); // Copy the K plane


Files To Be Included With Your Application

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.  The following subdirectory is created:

REDIST\	Redistributable Toolbar files.
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 distribute the header files with your application, and you may not provide software development capabilities in your application.
The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions. Most files in the table are optional. 32-bit DLLs are listed. These files are referred to as "Redistributables" in the License Agreement.

Please note that LTKRN, LTDIS, LTEFX, LTIMG, and LTFIL are required for ALL OCX applications. For more information on LTKRN, LTDIS, LTEFX, LTIMG, LTFIL or any other files for the Main OCX, 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:
LTTLB	LEADTOOLS Toolbar Control and support DLL.	DLL: LTTLB14N.DLL OCX: LTTLB14N.OCX	DLL: LTTLB14E.DLL OCX: LTTLB14E.OCX


Tutorial for Visual C++ 4.0 Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Toolbar ActiveX.

For tutorials that display the use of the LEADTOOLS Toolbar OCX, refer to the following Automation tutorials included in the Vector OCX help file:

Implementing Vector Automation for Visual C++

Adding The Automation Container for Visual C++

Setting Vector Automation Properties for Visual C++

The Undo/Redo Capabilities for Visual C++

Miscellaneous Examples


Miscellaneous Examples (Visual C++ 4.0)
Miscellaneous Examples (C++ 4.0 and later)

You can test any of the following examples by adding a command button and pasting the sample code in the Click procedure.

AddButton example for C++ 4.0 and later

Button Example for C++ 4.0 and later

ButtonBitmapWidth example for C++ 4.0 and later

Button.Checked example for C++ 4.0 and later

Button.Enabled example for C++ 4.0 and later

Button.UserTag example for C++ 4.0 and later

EnableMethodErrors example for C++ 4.0 and later

RemoveButton Example for C++ 4.0 and later

ToolBarButton.event Example for C++ 4.0 and later

UnlockSupport Example for C++ 4.0 and later


AddButton Example for C++ 4.0 and later

short nRet;
   nRet = m_LEADToolBar1.AddButton(999,
                                   BUTTON_ID_TOOL_VECTOR_LINE,
                                   TOOLBAR_ADD_BEFORE | TOOLBAR_ADD_TOOL);
   if(nRet == 0)
   {
      m_LEADToolBar1.GetButton(999).SetVisible (TRUE);
      m_LEADToolBar1.GetButton(999).SetEnabled (TRUE);
   }


Button example for C++ 4.0 and later

//toggle visible
   if(m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).GetVisible())
      m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetVisible(FALSE);
   else
      m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetVisible(TRUE);


ButtonBitmapWidth Example for C++ 4.0 and later

   m_LEADToolBar1.SetButtonBitmapWidth(25);
   m_LEADToolBar1.SetButtonBitmapHeight(25);


Button.Checked Example for C++ 4.0 and later

void CBarTutorDlg::OnRead()
//set the selected tool
   if(!m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).GetChecked ())
      m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetChecked(TRUE);


Button.Enabled example for Visual C++ 4.0
Button.Enabled example for C++ 4.0 and later

//toggle enabled
   if(m_LEADToolBar1. GetButton(BUTTON_ID_TOOL_VECTOR_LINE).GetEnabled())
      m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetEnabled(FALSE);
   else
      m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetEnabled(TRUE);


Button.UserTag example for Visual C++ 4.0
Button.UserTag example for C++ 4.0 and later

CString csOut;
   m_LEADToolBar1. GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetUserTag(999);
   csOut.Format("%d",
                m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).GetUserTag());
   AfxMessageBox(csOut);
   m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetToolTipText("Testing");
   AfxMessageBox(m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).GetToolTipText());
   m_LEAD1.Load("d:\\temp\\tt.bmp", 0, 1, 1);
   CPicture p(m_LEAD1.GetPicture());
   m_LEADToolBar1.GetButton(BUTTON_ID_TOOL_VECTOR_LINE).SetPicture(p);


EnableMethodErrors Example for C++ 4.0 and later

m_LEADToolBar1.SetEnableMethodErrors(FALSE);
   m_LEADToolBar1.SetRowCount(3);
   m_LEADToolBar1.SetXPosition(0);
   m_LEADToolBar1.SetYPosition(0);
   m_LEADToolBar1.CreateToolbar((long)this->m_hWnd, "Tools", TOOLBAR_VECTOR);
   m_LEADToolBar1.SetVisible(TRUE);


RemoveButton example for Visual C++ 4.0
RemoveButton example for C++ 4.0 and later

m_LEADToolBar1.RemoveButton(BUTTON_ID_TOOL_VECTOR_LINE);


ToolBarButton.event Example for C++ 4.0 and later

void CMfctbDlg::OnToolBarButtonLeadtoolbarctrl1(LPDISPATCH Button, long nButtonID, long dwData)
{
   CString csOut;
   CLTToolBarButton TBButton(Button);
   csOut.Format("Button with ID: %d was selected", TBButton.GetId());
   AfxMessageBox(csOut);
   TBButton.ReleaseDispatch();
}


UnlockSupport example for Visual C++ 4.0
UnlockSupport example for C++ 4.0 and later

m_LEADToolBar1.UnlockSupport(L_SUPPORT_VECTOR, "XXXXXX");
   if(m_LEADToolBar1.IsSupportLocked(L_SUPPORT_VECTOR))
      AfxMessageBox("Support is locked!");


Data Types

ILTToolBarButton


ILTToolBarButton

The ILTToolBarButton serves as a handle to a button on the toolbar, providing properties that describe the button.

TRUE	The button is selected (checked).
Properties:

Property name	Data type	Description	Examples
Checked	VARIANT_BOOL	Indicates whether the button is selected (checked). Possible values are:	Visual Basic Example  Visual C++ 4.0 Example
		Value	Meaning
		TRUE	The button is selected (checked).
		FALSE	The button is not selected (checked).
Enabled	VARIANT_BOOL	Indicates whether the button is enabled for mouse input.  Possible values are:	Visual Basic Example  Visual C++ 4.0 Example
		Value	Meaning
		TRUE	The specified button is enabled.
		FALSE	The specified button is disabled.
ID	long	Identifier for the button. If a DigitalPaint or Vector toolbar was created for use with the Automation mode, the possible ID values may be seen under the CreateToolbar method. Otherwise, the ID values are user defined.	Visual Basic Example  Visual C++ 4.0 Example
Picture	LPPICTUREDISP	The Cold bitmap of the button. The toolbar will automatically create the hot and the disabled bitmaps.	Visual Basic Example  Visual C++ 4.0 Example
ToolTipText	BSTR	A null terminated array of characters that will become the button tool tip. The maximum length of this string is TOOLBAR_TOOLTIP_MAX_TEXT.	Visual Basic Example  Visual C++ 4.0 Example
UserTag	long	User-defined tag.	Visual Basic Example  Visual C++ 4.0 Example
Visible	VARIANT_BOOL	Indicates whether the button is visible or hidden.  Possible values are:	Visual Basic Example  Visual C++ 4.0 Example
		Value	Meaning
		TRUE	The specified button is visible.
		FALSE	The specified button is hidden.
Comments

Buttons on a toolbar may have the same ID number without the toolkit complaining. If a function is called that uses a button ID, such as AddButton method, then the toolkit will function and will act on the first button found with the specified ID.

This is the bitmap that is displayed on the button when the button is in its normal, enabled state. This is the "cold" state. When the user places the cursor over the button, the bitmap changes slightly to its "hot" state. This changed bitmap is generated automatically by the toolkit. Similarly, when the button is disabled, the bitmap is again changed. This change is also generated automatically by the toolkit. Consequently, the user only has to provide one bitmap to the toolkit and the toolkit modifies that bitmap, as needed, to generate either the "hot" or "disabled" bitmap.


Introduction

The LEADTOOLS Toolbar Control is a custom control for incorporating a toolbar in your applications. Support for this control is included in the LEADTOOLS Vector Imaging Pro toolkit.  The Toolbar control provides the ability to create and modify toolbars, as well as process events generated within a toolbar.

Executable demos are included in all LEADTOOLS products.  The executable demos provide a quick and easy way to evaluate the Toolbar features and performance.

You can use the LEADTOOLS Toolbar control in any programming environment that supports OLE custom controls, including the following:

Visual Basic
Visual C++ 4.0 and later (32-bit)

Summary of All Supported Image File Formats

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.


Error Codes

For a list of all possible error codes for LEADTOOLS Toolbar OCX functions, refer to LEADTOOLS OCX Error Codes in the Main OCX help file (Ltocxn.hlp).


Programming with the LEADTOOLS Toolbar ActiveX

The following topics provide a systematic approach to understanding and using the LEAD Toolbar control's properties, methods, and events:

Registering and Unregistering the ActiveX Controls.

Working with the Toolbar

General Support


Working with the Toolbar

The LEADTOOLS Toolbar OCX provides a means of adding either predefined or custom designed toolbars to an application. Adding toolbars to applications provides a quick and convenient way of drawing or performing other functions.

A toolbar consists of one or more tools and each tool has one or more buttons associated with it. Information about the toolbar and buttons within the toolbar is contained in the ILTToolBarButton interface. The Button property provides ready access to this information.

The CreateToolbar method creates the toolbar based on the value of the nFlags parameter. By passing the proper value a Vector toolbar, a DigitalPaint toolbar or an empty toolbar can be created. Please note that the Vector and DigitalPaint toolbars are Automation toolbars. When using the Automation mode in addition to the Toolbar OCX, these toolbars automatically handle the buttons and the necessary low-level calls.

Several properties can be used to modify the characteristics of the toolbar or obtain information about the toolbar. To obtain or modify the position of the toolbar, use the XPosition and YPosition properties. The RowCount property contains the number of rows of buttons in the toolbar. The size of the bitmaps displayed for the toolbar buttons can be accessed through the ButtonBitmapHeight and ButtonBitmapWidth properties. The toolbar can be hidden or made visible using the Visible property.

Adding or removing a button can also modify the toolbar. To add a button, use the AddButton method. To remove a button from the toolbar, use the RemoveButton method.

When any action is taken in a toolbar, such as pressing a button, a ToolBarButton event is fired. This event allows the user to customize button processing. Each time the event is fired it receives information about the ID of the button that fired the event and a pointer to an interface that contains information about the button.


General Support

LEADTOOLS provides two methods and a property for general support capability. The EnableMethodErrors property lets you enable or disable the generation of runtime exceptions. IsSupportLocked will determine whether certain features are locked or unlocked. The UnlockSupport method will let you unlock support for specific features.


AddButton method (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	short AddButton (long nButtonID, long nButtonRefID, long nFlags);
Overview	Refer to Working with the Toolbar.
Remarks

Adds a new button to the toolbar.

As an example, if nFlags is set to TOOLBAR_ADD_BEFORE | TOOLBAR_ADD_TOOL, then a new tool will be added before the button specified by nButtonRefID. If nFlags is set to TOOLBAR_ADD_BEFORE, then the new button will be added before the button specified by nButtonRefID and it will become part of the same tool as the button specified by nButtonRefID.

See Also

Elements:	RemoveButton method


nButtonID Parameter For AddButton
nButtonID

ID of the button to be added.


AddButton Parameter For AddButton
nButtonRefID

Reference to use for positioning the new button inside the toolbar. The new button will be placed either before or after the button with this ID.


nFlags Parameter For AddButton
nFlags

Flag that indicates where to add the new button, with respect to the button specified in nButtonRefID. Possible values are:

Flag	Meaning
TOOLBAR_ADD_BEFORE	Add this button before the button specified by nButtonRefID in the toolbar.
TOOLBAR_ADD_AFTER	Add this button after the button specified by nButtonRefID in the toolbar.
TOOLBAR_ADD_TOOL	If this flag is specified, the toolkit will create a new tool and make this button the first button of the new tool. If this flag is not specified, the toolkit will add the new button to the same tool as nButtonRefID.
Note:	If the toolbar contains no buttons, both nButtonRefID and nFlags will be ignored and the new tool and button will be added to the toolbar.


Return For AddButton
Return Value

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


Button property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	ILTToolBarButton Button (long nButtonID);
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets information about the specified button.

See Also

Elements:	AddButton method, RemoveButton method, ToolBarButton event


ButtonBitmapHeight property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	long ButtonBitmapHeight;
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets the bitmap height for the toolbar buttons.

See Also

Elements:	ButtonBitmapWidth property, RowCount property, XPosition property, YPosition property, Visible property


ButtonBitmapWidth property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	long ButtonBitmapWidth;
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets the bitmap width for the toolbar buttons.

See Also

Elements:	ButtonBitmapHeight property, RowCount property, XPosition property, YPosition property, Visible property


CreateToolbar method (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	short CreateToolbar(long hWndParent, BSTR pszTitle, long nFlags);
Overview	Refer to Working with the Toolbar.
Remarks

Creates a toolbar.

The toolbar is created as a child window to the window specified in hWndParent.

Note:	The Vector and DigitalPaint toolbars are Automation toolbars. When using the Automation mode in addition to the Toolbar Control, these toolbars automatically handle the buttons and the necessary low-level calls. If automation is not used, then it is the user's responsibility to create buttons, assign ID numbers, process the events and handle all necessary low-level calls.
The DigitalPaint toolbar contains the following buttons:

Description	Button ID
Paintbrush tool	BUTTON_ID_TOOL_PAINT_BRUSH
Line shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_LINE
Rectangle shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_RECT
Rounded rectangle shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_ROUNDRECT
Ellipse shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_ELLIPSE
Polygon shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_POLYGON
Bezier shape tool	BUTTON_ID_TOOL_PAINT_SHAPE_BEZIER
Region rectangle tool	BUTTON_ID_TOOL_PAINT_REGION_RECT
Rounded rectangle region tool	BUTTON_ID_TOOL_PAINT_REGION_ROUNDRECT
Ellipse region tool	BUTTON_ID_TOOL_PAINT_REGION_ELLIPSE
Polygon region tool	BUTTON_ID_TOOL_PAINT_REGION_POLYGON
Surface region tool	BUTTON_ID_TOOL_PAINT_REGION_SURFACE
Border region tool	BUTTON_ID_TOOL_PAINT_REGION_BORDER
Color region tool	BUTTON_ID_TOOL_PAINT_REGION_COLOR
Surface fill tool	BUTTON_ID_TOOL_PAINT_FILL_SURFACE
Border fill tool	BUTTON_ID_TOOL_PAINT_FILL_BORDER
Color replace tool	BUTTON_ID_TOOL_PAINT_FILL_COLORREPLACE
Text tool	BUTTON_ID_TOOL_PAINT_TEXT
Zoom tool	BUTTON_ID_TOOL_PAINT_ZOOM
Border color picker tool	BUTTON_ID_TOOL_PAINT_BORDERCOLORPICKER
Mover tool	BUTTON_ID_TOOL_PAINT_MOVER
The vector toolbar contains the following buttons:

Description	Button ID
Neutral (No tool selected)	BUTTON_ID_TOOL_VECTOR_NONE
Select object(s)	BUTTON_ID_TOOL_VECTOR_SELECT
Vertex	BUTTON_ID_TOOL_VECTOR_VERTEX
Line	BUTTON_ID_TOOL_VECTOR_LINE
Rectangle	BUTTON_ID_TOOL_VECTOR_RECTANGLE
Polyline	BUTTON_ID_TOOL_VECTOR_POLYLINE
Polybezier	BUTTON_ID_TOOL_VECTOR_POLYBEZIER
Polygon	BUTTON_ID_TOOL_VECTOR_POLYGON
Ellipse	BUTTON_ID_TOOL_VECTOR_ELLIPSE
Circle	BUTTON_ID_TOOL_VECTOR_CIRCLE
Arc	BUTTON_ID_TOOL_VECTOR_ARC
Text	BUTTON_ID_TOOL_VECTOR_TEXT
Pie	BUTTON_ID_TOOL_VECTOR_PIE
Chord	BUTTON_ID_TOOL_VECTOR_CHORD
Raster	BUTTON_ID_TOOL_VECTOR_RASTER
Rotate	BUTTON_ID_TOOL_VECTOR_ROTATE
Pan	BUTTON_ID_TOOL_VECTOR_PAN
See Also

Elements:	XPosition property, YPosition property, RowCount property, ButtonBitmapHeight property, ButtonBitmapWidth property, AddButton method, RemoveButton method, ToolBarButton event, Button property, Visible property


hWndParent Parameter For CreateToolbarh
hWndParent

Window handle to the toolbar's parent window.


pszTitle Parameter For CreateToolbarh
pszTitle

String that contains the title for the toolbar window.


nFlags Parameter For CreateToolbarh
nFlags

Flags that will indicate the type of the toolbar to be created. Possible values are:

Value	Meaning
TOOLBAR_PAINT	Creates a DigitalPaint toolkit toolbar.
TOOLBAR_VECTOR	Creates a vector toolkit toolbar.
TOOLBAR_EMPTY	Create an empty toolbar.


Return For CreateToolbarh
Return Value

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


EnableMethodErrors property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	VARIANT_BOOL EnableMethodErrors.
Overview	Refer to General Support.
Remarks

(Persistent property, available at design time) Specifies whether LEADTOOLS generates system error events (in addition to error return codes).

Setting	Description
TRUE	Generate system error events.
FALSE	Do not generate system error events.
See Also

Elements:	IsSupportLocked method, UnlockSupport method


IsSupportLocked method (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	VARIANT_BOOL IsSupportLocked (short iType);
Overview	Refer to General Support.
Remarks

Indicates whether support is locked for an optional feature, such as LEADTOOLS Document/Medical capabilities.

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

To unlock a feature, use the UnlockSupport method.

See Also

Elements:	UnlockSupport method, EnableMethodErrors property


iType Parameter For IsSupportLocked
iType

The optional feature to be checked.

Value	Meaning
L_SUPPORT_BARCODES_1D	Support for reading and writing Linear bar codes. This is available in the LEADTOOLS 1D Module.
L_SUPPORT_BARCODES_PDF_READ	Support for reading PDF bar codes. This is available in the LEADTOOLS 2D PDF Module (read).
L_SUPPORT_BARCODES_PDF_WRITE	Support for writing PDF bar codes. This is available in the LEADTOOLS 2D PDF Module (write).
L_SUPPORT_BARCODES_DATAMATRIX_READ	Support for reading Data Matrix bar codes. This is available in the LEADTOOLS 2D Data Matrix Module (read).
L_SUPPORT_BARCODES_DATAMATRIX_WRITE	Support for writing Data Matrix bar codes. This is available in the LEADTOOLS 2D Data Matrix Module (write).
L_SUPPORT_BITONAL	Support for Scale to Gray and Favor Black processing.
L_SUPPORT_CMW	Support for the CMW file format, which uses Wavelet CMP compression.
L_SUPPORT_DICOM	DICOM file format support, but not the DICOM Communication support.
L_SUPPORT_DOCUMENT	LEADTOOLS Document features . A LEADTOOLS Document license is required
L_SUPPORT_EXTGRAY	Support for 12 bit grayscale, 16-bit grayscale, 48-bit color and 64-bit color image creation and manipulation.
L_SUPPORT_ICR	Support for the ICR Module within the OCR engine. This supports the recognition of handwritten text. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_J2K	Unlocks support for JPEG2000 images. The support needs to be unlocked to read and write both types of JPEG 2000 images (JPEG 2000 stream and JP2 files).
L_SUPPORT_LTPRO	Support for advanced image processing functions only available in the Raster Pro and above toolkits.
L_SUPPORT_MEDICAL	Support for the capabilities unlocked by L_SUPPORT_DICOM and L_SUPPORT_EXTGRAY, plus all Medical features.
L_SUPPORT_MEDICAL_NET	Support for everything unlocked by L_SUPPORT_MEDICAL, plus support for the unsecure DICOM Network Communication for Message Exchange.
L_SUPPORT_OCR	Support for the OCR features. (Document/Medical).
L_SUPPORT_OCR_ASIAN	Support for the OCR engine to recognize Asian text. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_OCR_PDF_OUTPUT	Support for saving OCR results as a PDF file. This license is in addition to the cost of the OCR Plugin or Document Imaging Suite.
L_SUPPORT_OMR	Support for the OMR Module within the OCR engine. This supports the recognition of check boxes. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_PDF	Support for the PDF, PS and EPS file formats. Available only in the LEADTOOLS PDF Plug in. If this support is locked, the PDF, PS and EPS files will not be loaded or saved.
L_SUPPORT_PDF_SAVE	Support for saving raster images as a PDF file. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_VECTOR	Support for the Vector Features and Vector file formats. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selection.


Return For IsSupportLocked
Return Value

Return	Meaning
TRUE	The optional feature is locked.
FALSE	The optional feature is available in your toolkit.


RemoveButton method (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	short RemoveButton (long nButtonID);
Overview	Refer to Working with the Toolbar.
Remarks

Removes the button with the specified ID from the toolbar.

To add a button to a toolbar, call the AddButton method.

See Also

Elements:	AddButton method, CreateToolbar method, Button property


nButtonID Parameter For RemoveButton
nButtonID

Button identifier that indicates the button to be removed. Note if this button is the only remaining button in its tool, the whole tool is removed too.


Return For RemoveButton
Return Value

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


RowCount property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	long RowCount;
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets the number of button rows in the toolbar.

See Also

Elements:	XPosition property, YPosition property, Visible property, ButtonBitmapHeight property, ButtonBitmapWidth property


UnlockSupport method (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	void UnlockSupport (short iType, BSTR pszKey);
Overview	Refer to General Support.
Remarks

Unlocks support for an optional feature, such as LEADTOOLS Document/Medical capabilities.

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

Note:	UnlockSupport can be replaced by entering the appropriate keys in LTOCX14.LIC. Edit the LTOCX14.LIC file and append at the end of a line, and on the same line, one or more pairs in the form |L_SUPPORT_xxx=key. The keys that can be specified are:
L_SUPPORT_BARCODES_1D
L_SUPPORT_BARCODES_PDF_READ
L_SUPPORT_BARCODES_PDF_WRITE
L_SUPPORT_BARCODES_DATAMATRIX_READ
L_SUPPORT_BARCODES_DATAMATRIX_WRITE
L_SUPPORT_BITONAL
L_SUPPORT_CMW
L_SUPPORT_DICOM
L_SUPPORT_DOCUMENT
L_SUPPORT_EXTGRAY
L_SUPPORT_J2K
L_SUPPORT_MEDICAL
L_SUPPORT_MEDICAL_NET
L_SUPPORT_OCR
L_SUPPORT_VECTOR
L_SUPPORT_LTPRO

For example, if you wanted to unlock DOCUMENT and OCR support, you would include the following at the end of a line:

|L_SUPPORT_DOCUMENT=dockey|L_SUPPORT_OCR=ocrkey

See Also

Elements:	IsSupportLocked method, EnableMethodErrors property


iType Parameter For UnlockSupport
iType

The optional feature to unlock.

Value	Meaning
L_SUPPORT_BARCODES_1D	Support for reading and writing Linear bar codes. This is available in the LEADTOOLS 1D Module.
L_SUPPORT_BARCODES_PDF_READ	Support for reading PDF bar codes. This is available in the LEADTOOLS 2D PDF Module (read).
L_SUPPORT_BARCODES_PDF_WRITE	Support for writing PDF bar codes. This is available in the LEADTOOLS 2D PDF Module (write).
L_SUPPORT_BARCODES_DATAMATRIX_READ	Support for reading Data Matrix bar codes. This is available in the LEADTOOLS 2D Data Matrix Module (read).
L_SUPPORT_BARCODES_DATAMATRIX_WRITE	Support for writing Data Matrix bar codes. This is available in the LEADTOOLS 2D Data Matrix Module (write).
L_SUPPORT_BITONAL	Support for Scale to Gray and Favor Black processing.
L_SUPPORT_CMW	Support for the CMW file format, which uses Wavelet CMP compression.
L_SUPPORT_DICOM	DICOM file format support, but not the DICOM Communication support.
L_SUPPORT_DOCUMENT	LEADTOOLS Document features . A LEADTOOLS Document license is required
L_SUPPORT_EXTGRAY	Support for 12 bit grayscale, 16-bit grayscale, 48-bit color and 64-bit color image creation and manipulation.
L_SUPPORT_ICR	Support for the ICR Module within the OCR engine. This supports the recognition of handwritten text. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_J2K	Unlocks support for JPEG2000 images. The support needs to be unlocked to read and write both types of JPEG 2000 images (JPEG 2000 stream and JP2 files).
L_SUPPORT_LTPRO	Support for advanced image processing functions only available in the Raster Pro and above toolkits.
L_SUPPORT_MEDICAL	Support for the capabilities unlocked by L_SUPPORT_DICOM and L_SUPPORT_EXTGRAY, plus all Medical features.
L_SUPPORT_MEDICAL_NET	Support for everything unlocked by L_SUPPORT_MEDICAL, plus support for the unsecure DICOM Network Communication for Message Exchange.
L_SUPPORT_OCR	Support for the OCR features. (Document/Medical).
L_SUPPORT_OCR_ASIAN	Support for the OCR engine to recognize Asian text. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_OCR_PDF_OUTPUT	Support for saving OCR results as a PDF file. This license is in addition to the cost of the OCR Plugin or Document Imaging Suite.
L_SUPPORT_OMR	Support for the OMR Module within the OCR engine. This supports the recognition of check boxes. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_PDF	Support for the PDF, PS and EPS file formats. Available only in the LEADTOOLS PDF Plug in. If this support is locked, the PDF, PS and EPS files will not be loaded or saved.
L_SUPPORT_PDF_SAVE	Support for saving raster images as a PDF file. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
L_SUPPORT_VECTOR	Support for the Vector Features and Vector file formats. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selection.


pszKey Parameter For UnlockSupport
pszKey

The key to unlock the feature.


Return For UnlockSupport
Return Value

None.


Visible property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	VARIANT_BOOL Visible;
Overview	Refer to Working with the Toolbar.
Remarks

(Runtime only) Shows or hides the toolbar. Possible values are:

Value	Meaning
TRUE	Show the toolbar.
FALSE	Hide the toolbar.
See Also

Elements:	XPosition property, YPosition property, RowCount property, ButtonBitmapHeight property, ButtonBitmapWidth property, CreateToolbar method


XPosition property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	long XPosition;
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets the X coordinate of the origin of the toolbar. This value is expressed in screen coordinates (pixels).

See Also

Elements:	YPosition property, RowCount property, ButtonBitmapHeight property, ButtonBitmapWidth property, CreateToolbar method, Visible property


YPosition property (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	long YPosition;
Overview	Refer to Working with the Toolbar.
Remarks

Gets or sets the Y coordinate of the origin of the toolbar. This value is expressed in screen coordinates (pixels).

See Also

Elements:	XPosition property, RowCount property, ButtonBitmapHeight property, ButtonBitmapWidth property, CreateToolbar method, Visible property


ToolBarButton event (Toolbar Control)

Visual Basic example	Visual C++ 4.0 example
Syntax	void ToolBarButton (ILTToolBarButton *Button, long nButtonID, long dwData);
Overview	Refer to Working with the Toolbar.
Remarks

This event is generated for each action taken in the toolbar.

See Also

Elements:	Button property


Button Parameter For ToolBarButton
Button

Pointer to an interface that contains information about the button responsible for firing the event.


NButtonID Parameter For ToolBarButton
nButtonID

Identifier of the button responsible for firing the event.


DwData Parameter For ToolBarButton
dwData

Reserved for future use. Use 0.


Properties, Methods, and Events

Toolbar Functions

Toolbar Functions: Creating Toolbars

Toolbar Functions: Toolbar Characteristics

Toolbar Functions: General Support

Toolbar Functions: Events


Toolbar Properties, Methods and Events: Creating Toolbars

CreateToolbar method


Toolbar Properties, Methods and Events: Toolbar Characteristics
Toolbar Functions: Toolbar Characteristics

AddButton method

Button property

ButtonBitmapHeight property

ButtonBitmapWidth property

RemoveButton method

RowCount property

Visible property

XPosition property

YPosition property


Toolbar Properties, Methods and Events: General Support
Toolbar Functions: General Support

EnableMethodErrors property

IsSupportLocked method

UnlockSupport method


Toolbar Properties, Methods and Events: Events
Toolbar Functions: Events

ToolBarButton event


Tutorial for Visual Basic Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Toolbar features ActiveX.

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.
For tutorials that display the use of the LEADTOOLS Toolbar OCX, refer to the following Automation tutorials included in the Vector OCX help file:

Implementing Vector Automation for Visual Basic

Adding The Automation Container for Visual Basic

Setting Vector Automation Properties for Visual Basic

The Undo/Redo Capabilities for Visual Basic

Miscellaneous Examples


Miscellaneous Examples (Visual Basic)

You can test the following examples by either adding a command button and pasting the sample code in the Click procedure, or by cutting and pasting event code into the appropriate event in a lesson.

AddButton example for Visual Basic

Button example for Visual Basic

ButtonBitmapWidth example for Visual Basic

Button.Checked example for Visual Basic

Button.Enabled example for Visual Basic

Button.UserTag example for Visual Basic

EnableMethodErrors example for Visual Basic

RemoveButton example for Visual Basic

ToolBarButton example for Visual Basic

UnlockSupport example for Visual Basic


AddButton example for Visual Basic

    Dim nRet As Integer
    nRet = LEADToolBar1.AddButton(999, BUTTON_ID_TOOL_VECTOR_LINE, TOOLBAR_ADD_BEFORE Or
TOOLBAR_ADD_TOOL)
    If (nRet = 0) Then
        LEADToolBar1.Button(999).Visible = True
        LEADToolBar1.Button(999).Enabled = True
    End If


Button example for Visual Basic

    'toggle visible
    If (LEADToolBar1.Button (BUTTON_ID_TOOL_VECTOR_LINE).Visible = True) Then
        LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Visible = False
    Else
        LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Visible = True
    End If


ButtonBitmapWidth example for Visual Basic

    LEADToolBar1.ButtonBitmapWidth = 25
    LEADToolBar1.ButtonBitmapHeight = 25


Button.Checked example for Visual Basic

    'set the selected tool
    If (LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Checked = False) Then
        LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Checked = True
    End If


Button.Enabled example for Visual Basic

    'toggle enabled
    If (LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Enabled = True) Then
        LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Enabled = False
    Else
        LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Enabled = True
    End If


Button.UserTag example for Visual Basic

    LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).UserTag = 999
    MsgBox CStr(LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).UserTag)
    LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).ToolTipText = "Testing"
    MsgBox LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).ToolTipText
    LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Picture = LoadPicture("d:\temp\tt.bmp")
    LEAD1.SetPicture LEADToolBar1.Button(BUTTON_ID_TOOL_VECTOR_LINE).Picture


EnableMethodErrors example for Visual Basic

    LEADToolBar1.EnableMethodErrors = False
    LEADToolBar1.RowCount = 3
    LEADToolBar1.XPosition = 0
    LEADToolBar1.YPosition = 0
    LEADToolBar1.CreateToolbar Me.hWnd, "Tools", TOOLBAR_VECTOR
    LEADToolBar1.Visible = True


RemoveButtons example for Visual Basic
RemoveButton example for Visual Basic

    LEADToolBar1.RemoveButton BUTTON_ID_TOOL_VECTOR_LINE


ToolbarButton example for Visual Basic

Private Sub LEADToolBar1_ToolBarButton(ByVal Button As LTTLBLibCtl.ILTToolBarButton, ByVal nButtonID As Long, ByVal dwData As Long)
    Dim Out$
    Out$ = "Button with ID: " & CStr(Button.ID) & " was selected"
    MsgBox Out$
End Sub


UnlockSupport example for Visual Basic

    LEADToolBar1.UnlockSupport L_SUPPORT_VECTOR, "XXXXXX"
    If (LEADToolBar1.IsSupportLocked(L_SUPPORT_VECTOR) = True) Then
        MsgBox "Support is locked!"
    End If


Version History

Current version:	14.5
Last update:	October 13, 2005
Changes from Version 14 to Version 14.5.

Changes from Version 13 to Version 14.

Changes from Version 12.1 to Version 13.

Changes from Version 12 to Version 12.1

Version 12


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Toolbar ActiveX has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Toolbar ActiveX has not changed from Version 13.


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS Toolbar ActiveX has not changed from Version 12.1.


Changes from Version 12 to Version 12.1

Version 12.1 of the LEADTOOLS Toolbar ActiveX has changed from Version 12 as follows:

 LEADTOOLS now supports toolbar functionality for the LEADTOOLS DigitalPaint toolkits.


Version 12

Version 12 is the first version of the LEADTOOLS Toolbar OCX.

The rest of the topic lists the new functions:

AddButton method

Button property

ButtonBitmapHeight property

ButtonBitmapWidth property

CreateToolbar method

EnableMethodErrors property

IsSupportLocked method

RemoveButton method

RowCount property

ToolBarButton event

UnlockSupport method

Visible property

XPosition property

YPosition property


Example Programs

Note:	You can run some of the example programs on your system by clicking the appropriate buttons in online help. An error message will appear if you try to run an example program that is not on your system, or if you try to run a Delphi example without Delphi on your system.
The executable files for these examples were compiled with Document/Medical capabilities and.  To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical toolkit.  To get Toolbar capabilities, you must buy one of the toolkits that includes the Toolbar features.

Visual C++ 4.0

VECTOR Demo	EXAMPLES\OCX\MFC40\VECTOR contains a sample application that demonstrates most of the Toolbar capabilities in the Visual C++ 4.0 environment. You can open the project in Visual C++; then compile and run it.
Visual Basic

VECDEM32 Demo	EXAMPLES\OCX\VB\VECDEM32 contains a sample application that demonstrates most of the Toolbar capabilities in the Visual Basic 5.0 environment. To run the 32-bit sample application, you can run the EXE file in LEAD's BIN directory.