Introduction

All LEADTOOLS Vector features are included in the LEADTOOLS Vector Imaging Pro toolkits. The Vector features provide the ability to load, modify and save vector images.

LEAD also offers the LEADTOOLS Vector View Plug in, which can be added to any LEADTOOLS Raster product. The LEADTOOLS Vector View Plug in provides only the LEADTOOLS Vector Viewing Features. These features provide the ability to load vector images and perform limited vector image manipulation.

Please note that functions available only in the LEADTOOLS Vector Imaging Pro toolkits are designated "This function is available in the LEADTOOLS Vector Imaging Pro Toolkit." in the documentation.

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

The Vector features are shipped with the LEADTOOLS products listed above, however they are locked. For information on unlocking support for the Vector features, refer to Unlocking Support for the Vector Features.

The Vector features come in a WIN32 edition so that it can support development of software applications for any of the following environments:

Windows 3.x NT
Windows 4.x NT
Windows 95/98
Windows 2000

Summary of All Supported Image File Formats

Summary of All Supported Vector File Formats


Example Programs

The following example programs are in separate EXAMPLES subdirectories (such as C:\LEAD14\EXAMPLES\DLL\COLOR). The executable files for these examples were compiled with Document/Medical capabilities. To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical toolkit. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical capabilities.

Note:

You can run the example programs on your system by clicking the appropriate buttons in online help. If you try to run an example program that is not on your system, an error message will appear.

VECTOR DEMO

Vector Demo is the main vector example program. It uses pull-down menus to demonstrate most of the LEADTOOLS Vector features in one application.


Version History

Current version: | 14.5
Last update: | October 19, 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

Changes from Version 11.5 to Version 12

Changes from Version 11 to Version 11.5

Version 11


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Vector API has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Vector API has changed from Version 13 as follows:

LEADTOOLS Vector API now supports UNICODE.

The Vector toolkit now provides Unicode support, including support for the Unicode text object.

Changed structures:

The following structures have been modified:

VECTORBRUSH

VECTORPEN

New structures:

The following structures have been added:

VECTORHPOLYBEZIER

VECTORSPLINE

GRADIENTBRUSH

HATCHBRUSH

PATTERNBRUSH

STANDARDBRUSH

The rest of this topic lists the new functions in version 14.

L_VecSetFontMapper

L_VecGetFontMapper


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS Vector API has changed from Version 12.1 as follows:

Changed functions:

The following functions take extra parameters:

L_VecConvertToEMF

L_VecConvertToWMF

L_VecDlgEditAllGroups

L_VecDlgEditAllLayers

L_VecDlgEditGroup

L_VecDlgEditLayer

L_VecDlgEditObject

L_VecDlgHitTest

L_VecDlgNewGroup

L_VecDlgNewLayer

L_VecDlgNewObject

L_VecDlgRender

L_VecDlgRotate

L_VecDlgScale

L_VecDlgTranslate

L_VecDlgViewMode

The following data structures have been added since version 12.1:

VECTORLINKHANDLING

VECTOR_TEXTRENDER

VECTORLINKDESC

VECTORLINKFILEINFO

VECTORTOOLTIPDESC

VECTOR_DISPLAY_OPTIONS

VECTOR_ANTIALIASING

The rest of this topic lists the new functions in version 13.

L_VecAddHyperlink

L_VecGetDisplayOptions

L_VecGetHyperlinkCount

L_VecGetHyperlink

L_VecGetObjectDescription

L_VecGetObjectTooltip

L_VecGetObjectViewContext

L_VecGotoHyperlink

L_VecHideObjectTooltip

L_VecInvertColors

L_VecRemoveObjectViewContext

L_VecSetDisplayOptions

L_VecSetHyperlink

L_VecSetObjectDescription

L_VecSetObjectTooltip

L_VecSetObjectViewContext

L_VecShowObjectTooltip

LVCOMMDLGHELPCB


Changes from Version 12 to Version 12.1

Version 12.1 of the LEADTOOLS Vector API has changed from Version 12 as follows:

The L_VecExplodeObject function now supports a new flag that explodes objects into lines.

Vector support can now be unlocked for viewing only. Please note that if vector viewing support is unlocked using L_SUPPORT_VECTOR_VIEW, vector editing functions will return ERROR_VECTOR_LOCKED.

The Vector toolkit now supports faster loading for DWF, DWG, DXF and HPGL files.

The Vector toolkit now supports more entities for DWG and DXF files.


Changes from Version 11.5 to Version 12

Version 12 of the LEADTOOLS Vector API has changed from version 11.5 as follows:

Saving vector images as a DXF inside a TIFF file is now supported in LEADTOOLS Vector Imaging Pro.

Uses L_DOUBLE instead of L_FLOAT through out the toolkit.

Supports copying and pasting into the Windows clipboard.

Added new functions to add, edit and delete layers.

Added new functions to provide a means for grouping objects into layers.

Provides new functions for adding, editing and deleting objects.

Supports vector groups for grouping vector objects.

Now supports the following object types:

VECTOR_ARC

VECTOR_CHORD

VECTOR_CIRCLE

VECTOR_ELLIPSE

VECTOR_ELLIPTICALARC

VECTOR_LINE

VECTOR_PIE

VECTOR_POLYBEZIER

VECTOR_POLYDRAW

VECTOR_POLYGON

VECTOR_POLYLINE

VECTOR_RASTER

VECTOR_RECTANGLE

VECTOR_STOCK

VECTOR_TEXT

VECTOR_VERTEX

Supports new common dialogs for adding/editing objects and layers.

Changed or removed functions:

The following functions have been removed since version 11.5:

L_VecDlg3DOptions

L_VecSetEngine

The following functions have changed since version 11.5:

L_VecAttachToWindow (takes 2 extra parameters)

L_VecConvertToEMF (takes an extra parameter)

L_VecConvertToWMF (takes an extra parameter)

L_VecCopy (takes an extra parameter)

L_VecDeleteObject (uses flags instead of boolean for flags)

L_VecDlgRotate (takes an extra parameter)

L_VecDlgScale (takes an extra parameter)

L_VecDlgTranslate (takes an extra parameter)

L_VecEnumObjects (takes an extra parameter)

L_VecEnumVertices (takes an extra parameter)

L_VecGetEngine (takes an extra parameter)

L_VecGetObjectParallelogram (uses flags instead of boolean for flags)

L_VecGetObjectRect (uses flags instead of boolean for flags)

L_VecHitTest (takes an extra parameter, return type is changed as well)

L_VecIsObjectInsideParallelogram (takes an extra parameter)

L_VecIsObjectInsideRect (takes an extra parameter)

L_VecSetRotation (uses flags instead of boolean for flags)

L_VecSetScale (uses flags instead of boolean for flags)

L_VecSetTranslation (uses flags instead of boolean for flags)

Changed structures:

The following structures have changed since version 11.5

VECTORCAMERA (New members added)

VECTOROBJECT (bSelected flag is now dwFlags)

New Data Structures

The following data structures have been added since version 11.5:

VECTORARC

VECTORBITMAP

VECTORBRUSH

VECTORCHORD

VECTORCIRCLE

VECTORCLONE

VECTORELLIPSE

VECTORELLIPTICALARC

VECTORFONT

VECTORGROUP

VECTORGROUPDESC

VECTORHITTEST

VECTORLAYER

VECTORLAYERDESC

VECTORLINE

VECTORMARKER

VECTORPEN

VECTORPIE

VECTORPOLYBEZIER

VECTORPOLYDRAW

VECTORPOLYGON

VECTORPOLYLINE

VECTORRASTER

VECTORRECTANGLE

VECTORSTOCK

VECTORTEXT

VECTORVERTEX

New Error Codes

The following error codes have been added since version 11.5:

ERROR_VECTOR_BITMAP_NOT_FOUND

ERROR_VECTOR_BRUSH_NOT_FOUND

ERROR_VECTOR_CANT_ADD_TEXT

ERROR_VECTOR_CANT_READ_WMF

ERROR_VECTOR_CLIPBOARD

ERROR_VECTOR_CLIPBOARD_IS_EMPTY

ERROR_VECTOR_ENGINE_NOT_FOUND

ERROR_VECTOR_FONT_NOT_FOUND

ERROR_VECTOR_GROUP_NOT_FOUND

ERROR_VECTOR_GROUP_ALREADY_EXISTS

ERROR_VECTOR_INVALID_ENGINE

ERROR_VECTOR_INVALID_OBJECT_TYPE

ERROR_VECTOR_IS_EMPTY

ERROR_VECTOR_LAYER_ALREADY_EXISTS

ERROR_VECTOR_LAYER_IS_LOCKED

ERROR_VECTOR_LAYER_NOT_FOUND

ERROR_VECTOR_OBJECT_NOT_FOUND

ERROR_VECTOR_PEN_NOT_FOUND

ERROR_VECTOR_POINT_NOT_FOUND

The rest of this topic lists the new functions in version 12.

L_VecAddGroup

L_VecAddLayer

L_VecAddObject

L_VecAddObjectToGroup

L_VecClipboardReady

L_VecCopyFromClipboard

L_VecCopyGroup

L_VecCopyLayer

L_VecCopyObject

L_VecCopyToClipboard

L_VecDeleteGroup

L_VecDeleteGroupClones

L_VecDeleteLayer

L_VecDlgEditAllGroups

L_VecDlgEditAllLayers

L_VecDlgEditGroup

L_VecDlgEditLayer

L_VecDlgEditObject

L_VecDlgGetString

L_VecDlgGetStringLen

L_VecDlgHitTest

L_VecDlgNewGroup

L_VecDlgNewLayer

L_VecDlgNewObject

L_VecDlgRender

L_VecDlgSetFont

L_VecDlgSetString

L_VecDlgViewMode

L_VecEmpty

L_VecEmptyGroup

L_VecEmptyLayer

L_VecEnumGroups

L_VecEnumLayers

L_VecEnumObjectsInGroup

L_VecEnumObjectsInLayer

L_VecExplodeObject

L_VecFreeGroup

L_VecFreeLayer

L_VecFreeObject

L_VecGetActiveLayer

L_VecGetGroup

L_VecGetGroupByIndex

L_VecGetGroupByName

L_VecGetGroupCount

L_VecGetHitTest

L_VecGetLayer

L_VecGetLayerByIndex

L_VecGetLayerByName

L_VecGetLayerCount

L_VecGetMarker

L_VecGetObject

L_VecGetObjectAttributes

L_VecGetOrigin

L_VecGetParallelogram

L_VecHideObject

L_VecInitObject

L_VecIsEmpty

L_VecIsLocked

L_VecIsObjectHidden

L_VecSetActiveLayer

L_VecSetGroup

L_VecSetHitTest

L_VecSetLayer

L_VecSetLocked

L_VecSetMarker

L_VecSetObject

L_VecSetObjectAttributes

L_VecSetOrigin

L_VecSetParallelogram

L_VecZoomRect


Changes from Version 11 to Version 11.5

Version 11.5 of the LEADTOOLS Vector API has changed from version 11 as follows:

The following new formats are supported:

FILE_CLP

FILE_XWD10

FILE_XWD11

FILE_ANI

FILE_FLC

FILE_DRW

FILE_CGM

FILE_PCT (Vector)

FILE_PLT

FILE_INTERGRAPH_VECTOR


Version 11

Version 11 is the first version of the LEADTOOLS Vector API.

The rest of this topic lists the new functions in version 11.

Vector File Format Support

L_VecApplyTransformation (refer to Ltvecdll.hlp)

L_VecAttachToWindow (refer to Ltvecdll.hlp)

L_VecConvertFromEMF (refer to Ltvecdll.hlp)

L_VecConvertFromWMF (refer to Ltvecdll.hlp)

L_VecConvertToEMF (refer to Ltvecdll.hlp)

L_VecConvertToWMF (refer to Ltvecdll.hlp)

L_VecCopy (refer to Ltvecdll.hlp)

L_VecDeleteObjects (refer to Ltvecdll.hlp)

L_VecDlg3DOptions (refer to Ltvecdll.hlp)

L_VecDlgCamera (refer to Ltvecdll.hlp)

L_VecDlgRotate (refer to Ltvecdll.hlp)

L_VecDlgScale (refer to Ltvecdll.hlp)

L_VecDlgTranslate (refer to Ltvecdll.hlp)

L_VecEnumObjects (refer to Ltvecdll.hlp)

L_VecEnumVertices (refer to Ltvecdll.hlp)

L_VecFree (refer to Ltvecdll.hlp)

L_VecGetAmbientLight (refer to Ltvecdll.hlp)

L_VecGetBackgroundColor (refer to Ltvecdll.hlp)

L_VecGetBindVerticesMode (refer to Ltvecdll.hlp)

L_VecGetCamera (refer to Ltvecdll.hlp)

L_VecGetEngine (refer to Ltvecdll.hlp)

L_VecGetObjectParallelogram (refer to Ltvecdll.hlp)

L_VecGetObjectRect (refer to Ltvecdll.hlp)

L_VecGetPalette (refer to Ltvecdll.hlp)

L_VecGetPan (refer to Ltvecdll.hlp)

L_VecGetPolygonMode (refer to Ltvecdll.hlp)

L_VecGetRotation (refer to Ltvecdll.hlp)

L_VecGetScale (refer to Ltvecdll.hlp)

L_VecGetTranslation (refer to Ltvecdll.hlp)

L_VecGetUseLights (refer to Ltvecdll.hlp)

L_VecGetViewMode (refer to Ltvecdll.hlp)

L_VecGetViewport (refer to Ltvecdll.hlp)

L_VecHitTest (refer to Ltvecdll.hlp)

L_VecInit (refer to Ltvecdll.hlp)

L_VecIs3D (refer to Ltvecdll.hlp)

L_VecIsObjectInsideParallelogram (refer to Ltvecdll.hlp)

L_VecIsObjectInsideRect (refer to Ltvecdll.hlp)

L_VecIsObjectSelected (refer to Ltvecdll.hlp)

L_VecLoadFile (refer to Ltvecdll.hlp)

L_VecLoadMemory (refer to Ltvecdll.hlp)

L_VecLogicalToPhysical (refer to Ltvecdll.hlp)

L_VecPaint (refer to Ltvecdll.hlp)

L_VecRealize (refer to Ltvecdll.hlp)

L_VecSaveFile (refer to Ltvecdll.hlp)

L_VecSaveMemory (refer to Ltvecdll.hlp)

L_VecSelectObject (refer to Ltvecdll.hlp)

L_VecSetAmbientLight (refer to Ltvecdll.hlp)

L_VecSetBackgroundColor (refer to Ltvecdll.hlp)

L_VecSetBindVerticesMode (refer to Ltvecdll.hlp)

L_VecSetCamera (refer to Ltvecdll.hlp)

L_VecSetEngine (refer to Ltvecdll.hlp)

L_VecSetPalette (refer to Ltvecdll.hlp)

L_VecSetPan (refer to Ltvecdll.hlp)

L_VecSetPolygonMode (refer to Ltvecdll.hlp)

L_VecSetRotation (refer to Ltvecdll.hlp)

L_VecSetScale (refer to Ltvecdll.hlp)

L_VecSetTranslation (refer to Ltvecdll.hlp)

L_VecSetUseLights (refer to Ltvecdll.hlp)

L_VecSetViewMode (refer to Ltvecdll.hlp)

L_VecSetViewport (refer to Ltvecdll.hlp)


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, 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
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
CompuServe: 71333,2237 or GO LEADTECH
Home page: http://www.leadtools.com


Programming with LEADTOOLS Vector API

The following topics provide a systematic approach to understanding how to program with the LEADTOOLS Vector API.

Getting Started

Unlocking Support for the Vector Features

Unlocking Special LEAD Features

Overview of the Vector Structures

Getting Started

Working with Vectors

Viewing a Vector Image

Using the Clipboard

Working with Vector Handles

Working with Vector Layers

Working with Vector Groups

Working with Vector Objects

Cloning a Vector Group

Working with EMF and WMF Files

Vector Dialogs

Vector Handle Events

Saving Vectors

Stock Objects Libraries

Hyperlink Objects

Working with Tooltips

Working with View Context

Mapping Fonts


Unlocking Support for the Vector Features

All LEADTOOLS Vector Features are included in the LEADTOOLS Vector Imaging Pro toolkits. The Vector features are shipped with the LEADTOOLS products listed above, however they are locked. To use the Vector functions, L_UnlockSupport must be called with the key found on the Vector Features Unlock Certificate, included in your product packaging. L_UnlockSupport(L_SUPPORT_VECTOR, "Vector Features Unlock Certificate key") tells the package to unlock support for the Vector functions and passes the key for verification. For information on unlocking support for the Vector functions, refer to L_UnlockSupport.

Unlocking support for the Vector Features also unlocks support for the following file formats: DXF, DWF, DWG, PCT, PLT, DRW, DGN, WMF, EMF and CGM. In addition,


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 view the transmittal document you must have Adobe® Acrobat® installed.)

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 view the order form you must have Adobe® Acrobat® installed.)

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 L_UnlockSupport function 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 L_UnlockSupport (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 L_IsSupportLocked function.


Overview of the Vector Structures

A vector image (or drawing) is referenced in LEADTOOLS by a VECTORHANDLE structure. This VECTORHANDLE structure is maintained internally. For a description of the entire structure, refer to the LVKRN.H header file.

Within the VECTORHANDLE that references the vector image there are one or more VECTORLAYERS. Again, the VECTORLAYER structure is maintained internally by LEADTOOLS. However, information about vector layers can be obtained or set using a VECTORLAYERDESC structure. LEADTOOLS provides several functions for working with vector layers. For more information, refer to Working with Vector Layers.

Each vector layer may contain 0 or more VECTOROBJECTS. LEADTOOLS supports the following vector objects:

VECTORARC

VECTORCHORD

VECTORCIRCLE

VECTORELLIPSE

VECTORELLIPTICALARC

VECTORLINE

VECTORPIE

VECTORPOLYBEZIER

VECTORPOLYDRAW

VECTORPOLYLINE

VECTORPOLYGON

VECTORRASTER

VECTORRECTANGLE

VECTORSTOCK

VECTORTEXT

VECTORVERTEX

There is certain information that is common to all vector objects. This is contained in the Object member (type VECTOROBJECT) of each object's respective structure. Information specific to certain types of vector objects is included in that object's specific structure. For example, a VECTORRECTANGLE structure contains information about the pen and brush used to draw the rectangle, as well as an array of points that define the rectangle.

LEADTOOLS provides numerous functions for creating and manipulating vector objects. In addition, functions are provided for obtaining information about vector objects. For more information, refer to Working with Vector Objects.

When displaying vector objects, the user can modify the way the objects are displayed by setting anti-aliasing options, setting text rendering characteristics, providing a tool tip, or other display options. LEADTOOLS provides the following structures to help in modifying the display:

VECTOR_ANTIALIASING

VECTOR_DISPLAY_OPTIONS

VECTOR_TEXTRENDER

VECTORTOOLTIPDESC

A vector object may be hyperlinked with one or more targets, allowing the user to run a program, access a Web page, open a document, or focus the toolkit to a specific vector object. LEADTOOLS provides the following structures for working with hyperlinked vector objects:

VECTORLINKDESC

VECTORLINKFILEINFO

VECTORLINKHANDLING


Getting Started

A vector handle must have a vector engine associated with it for vector images to be rendered. The L_VecAttachToWindow function associates a vector engine with a vector handle and attaches the vector handle to a window. Attaching the vector handle to a window allows the use of double buffering for flicker-free screen updates. An image can be drawn on the surface of any window using L_VecPaint, but double buffering is only available if the vector handle is attached to a window. To display any vector, at any size, to any device context (screen, printer, or memory dc), use L_VecPaintDC.

To get the current vector engine, call L_VecGetEngine.

Once the vector handle, with the associated vector engine, is attached to a window, vector images loaded using L_VecLoadFile or L_VecLoadMemory can be rendered.

When your program no longer needs the vector data accessed through a vector handle, call L_VecFree to free the storage allocated for the vector handle.


Viewing a Vector Image

Once an image has been loaded and a vector engine has been associated with a vector handle, the vector image can be rendered. The way an image is viewed depends on a number of viewing characteristics. LEADTOOLS provides the following functions for modifying these viewing characteristics:

L_VecGetAmbientColor

L_VecGetBackgroundColor

L_VecGetCamera

L_VecGetDisplayOptions

L_VecGetObjectViewContext

L_VecGetPan

L_VecGetPolygonMode

L_VecGetUseLights

L_VecGetViewMode

L_VecGetViewport

L_VecInvertColors

L_VecLogicalToPhysical

L_VecPhysicalToLogical

L_VecRemoveObjectViewContext

L_VecSetAmbientColor

L_VecSetBackgroundColor

L_VecSetCamera

L_VecSetObjectViewContext

L_VecSetPan

L_VecSetPolygonMode

L_VecSetUseLights

L_VecSetViewMode

L_VecSetViewport

L_VecZoomRect

To allow proper drawing of vector image colors in a palettized system, use the palette associated with the vector handle. To get this palette, call L_VecGetPalette. To set the palette for a vector handle, use L_VecSetPalette.

To draw a specific vector into a LEAD bitmap handle, use the L_VecRealize function.


Using the Clipboard

The clipboard is a standard Windows object for copying data from one application to another. LEADTOOLS provides L_VecCopyToClipboard to copy vector data from a vector handle to the clipboard. To copy vector data from the clipboard to a vector handle, call L_VecCopyFromClipboard. To determine whether the clipboard contains valid vector data for copying, call L_VecClipboardReady.


Working with Vector Handles

LEADTOOLS references vector images through an internal VECTORHANDLE structure. Several functions are provided that let you get or set information that pertains to the vector handle itself.

L_VecEmpty deletes all vector layers and vector objects from the specified vector handle. To determine whether a vector handle is empty, call L_VecIsEmpty.

A vector handle can be locked to prevent any changes from being made. L_VecSetLocked locks or unlocks the specified vector handle. Locking a vector handle has precedence over locking vector layers within the vector handle. Therefore, if a vector handle is locked, the layers within that vector handle cannot be edited, even if the vector layers are not locked. To determine whether a vector handle is locked, use L_VecIsLocked.

Each vector handle has an origin point. To get the current origin, call L_VecGetOrigin. To set the origin, call L_VecSetOrigin. The origin may change when new vector objects are added. To center the vector image around its origin, call L_VecSetOrigin(pVector, NULL) after adding new objects.

When a vector object is selected in a vector handle, a marker is used to indicate that the object is selected. The marker settings that indicate how the marker will look can be obtained using L_VecGetMarker. To change these settings call L_VecSetMarker.

A vector handle may contain three-dimensional objects. To determine whether a vector handle does contain 3D objects, call L_VecIs3D.

For each vector handle a bounding parallelogram exists for the vector objects contained in the vector handle. To get the current bounding parallelogram, call L_VecGetParallelogram. To set the bounding parallelogram, call L_VecSetParallelogram. After adding new vector objects to a vector handle the logical size of the image might change. Call L_VecSetParallelogram with either pMin or pMax set to NULL to have the function calculate the bounding rectangle for the vector handle based on the objects contained in the vector handle.

To copy one vector handle to another vector handle call L_VecInit and then L_VecCopy.

The display options for a vector handle determine how the vector objects in that vector handle will be displayed. These display characteristics include the clip mode, anti-aliasing and text rendering options. To determine the current display options, call L_VecGetDisplayOptions. To set or change the display options, use the L_VecSetDisplayOptions function.

In addition to modifying the display options, the appearance of the objects within the vector handle may also be changed by inverting the colors. This is done using the L_VecInvertColors function.


Working with Vector Layers

LEADTOOLS provides a number of functions for working with the vector layers within a vector handle. Several functions provide a means of obtaining information about vector layers, while other functions provide a means of actually modifying vector layers.

Getting Information about Vector Layers

A vector handle may contain multiple vector layers. The L_VecGetLayerCount returns the number of layers present in a vector handle. Once the number of layers present is known, each layer can be obtained using L_VecGetLayerByIndex. If the name of a layer is known, that layer can be obtained using L_VecGetLayerByName. L_VecEnumLayers actually enumerates all the layers present in a vector handle. The VECTORENUMLAYERSPROC callback function used by L_VecEnumLayers lets you process each enumerated layer.

Within a vector handle one layer is active. L_VecGetActiveLayer obtains a handle to the active vector layer. L_VecSetActiveLayer lets you set the active layer within a vector handle.

Once a handle to a vector layer is obtained, information about that vector layer can be obtained using L_VecGetLayer. This vector layer information can then be modified using L_VecSetLayer. L_VecGetLayer fills a VECTORLAYERDESC structure with the information about the specified vector layer. The information within the VECTORLAYERDESC structure can then be modified and the vector layer information updated using L_VecSetLayer. Once this VECTORLAYERDESC structure is no longer needed, it should be freed using L_VecFreeLayer.

Manipulating Vector Layers

LEADTOOLS provides a number of functions for manipulating vector layers. L_VecSetActiveLayer and L_VecSetLayer let you set the active layer in a vector handle and modify information about a specific vector layer. For more information, refer to Getting Information About Vector Layers above, or the functions themselves.

L_VecEmptyLayer removes all vector objects from a vector layer. L_VecDeleteLayer actually removes a vector layer from a vector handle.

The contents of one layer can be copied to another layer using L_VecCopyLayer.

L_VecAddLayer lets you add a new layer to a vector handle.


Working with Vector Groups

Vector groups can be used to group vector objects. A vector object is added to a group using object descriptor information. Therefore, once a vector object is added to a group. There is no relationship between the object in the group and the original object in the vector handle. The original object can be changed without affecting the corresponding object in the vector group, and vice versa.

Vector groups can also be cloned and added to a vector handle. However, if an object within a vector group is modified, all clones of that group will also be modified.

LEADTOOLS provides a number of functions for working with the vector groups within a vector handle. Several functions provide a means of obtaining information about vector groups, while other functions provide a means of actually modifying vector groups.

Getting Information about Vector Groups

A vector handle may contain multiple vector groups. The L_VecGetGroupCount returns the number of groups present in a vector handle. Once the number of groups present is known, each group can be obtained using L_VecGetGroupByIndex. If the name of a group is known, that group can be obtained using L_VecGetGroupByName. L_VecEnumGroups actually enumerates all the groups present in a vector handle. The VECTORENUMGROUPSPROC callback function used by L_VecEnumGroups lets you process each enumerated group.

Once a handle to a vector group is obtained, information about that vector group can be obtained using L_VecGetGroup. This vector group information can then be modified using L_VecSetGroup. L_VecGetGroup fills a VECTORGROUPDESC structure with the information about the specified vector group. The information within the VECTORGROUPDESC structure can then be modified and the vector group information updated using L_VecSetGroup. Once this VECTORGROUPDESC structure is no longer needed, it should be freed using L_VecFreeGroup.

Manipulating Vector Groups

LEADTOOLS provides a number of functions for manipulating vector groups. L_VecSetGroup lets you modify information about a specific vector group. For more information, refer to Getting Information About Vector Groups above, or the functions themselves.

L_VecEmptyGroup removes all vector objects from a vector group. L_VecDeleteGroup actually removes a vector group from a vector handle.

The contents of one group can be copied to another group using L_VecCopyGroup.

L_VecAddGroup lets you add a new group to a vector handle.

L_VecDeleteGroupClones lets you delete clones of the specified group, within a specific vector handle.

Vector groups can also be modified by modifying the objects within them. A new object can be added using the L_VecAddObjectToGroup function.

L_VecEnumObjectsInGroup lets you enumerate all the objects contained within a specified group. This function generates a call to the VECTORENUMOBJECTSPROC callback function for each object enumerated. This provides the means for processing each object within a group.


Working with Vector Objects

LEADTOOLS provides numerous functions for working with vector objects within vector layers. Several functions provide a means of obtaining information about vector objects, while other functions provide a means of actually modifying vector objects.

Getting Information About Vector Objects

A vector handle may contain multiple vector layers and each vector layer may contain many objects. LEADTOOLS provides a number of functions for obtaining information about one or more objects present in a vector handle or a vector layer. The information that can be obtained includes the number of objects present, the location of objects, the boundaries of one or more objects, etc.

L_VecEnumObjectsInLayer actually enumerates the vector objects within a specific vector layer. L_VecEnumObjects enumerates the objects present within an entire vector handle. Both L_VecEnumObjects and L_VecEnumObjectsInLayer use the VECTORENUMOBJECTSPROC callback function. This callback function lets you process each enumerated vector object.

Once a handle to a vector object is obtained, information about that vector object can be obtained using L_VecGetObject. This object information can then be modified using L_VecSetObject. L_VecGetObject fills a vector object structure with information about the specified vector object. The information within the structure can then be modified and the vector object information updated using L_VecSetObject. Once the information in the vector object structure is no longer needed, L_VecFreeObject should be called.

Object information can also be retrieved and set using L_VecGetObjectAttributes and L_VecSetObjectAttributes. These functions provide a means of getting and setting object information without having to get an object descriptor, inspect the object type, set new attributes and then free the object descriptor.

L_VecEnumVertices enumerates the vertices of objects within a vector handle. The VECTORENUMVERTICESPROC callback function lets you process each enumerated vertex.

Several functions provide information on the location and boundaries of one or more vector objects. L_VecGetObjectParallelogram and L_VecGetObjectRect determine the bounding parallelogram and bounding rectangle for one or more vector objects in a vector handle. L_VecIsObjectInsideParallelogram and L_VecIsObjectInsideRect determine whether the specified object(s) is(are) within the specified parallelogram and rectangle. L_VecHitTest determines which object, if any, in a vector handle is present at a specified point. The options that control the hit test procedure can be obtained and modified using L_VecGetHitTest and L_VecSetHitTest.

L_VecIsObjectSelected determines whether or not an object is currently selected.

To determine whether or not a specific object is hidden, call L_VecIsObjectHidden.

Manipulating Vector Objects

LEADTOOLS provides many functions for manipulating vector objects. L_VecSetObject lets you modify vector object information. For more information, refer to Getting Information About Vector Objects above, or the L_VecSetObject function.

Vector objects can be modified by scaling, rotation and translation. LEADTOOLS provides L_VecGetRotation, L_VecGetScale and L_VecGetTranslation to obtain the current rotation, scaling and translation values. One or more vector objects may be modified by setting new values using L_VecSetRotation, L_VecSetScale and L_VecSetTranslation. Once the rotation, scale or translation values have been set, calling the L_VecApplyTransformation function will apply the current transformation to the vector image. The vector image objects will be changed.

Occasionally, vector objects will share vertices. When a vector object is modified, the object with which it shares one or more vertices may or may not be modified, depending on the "bind vertices mode" value. L_VecGetBindVerticesMode gets the current setting for the bind vertices mode. L_VecSetBindVerticesMode lets you change the "bind vertice mode" setting.

Some vector objects can be exploded into simpler vector objects using L_VecExplodeObject.

L_VecDeleteObject deletes the specified vector object(s).

L_VecSelectObject selects or unselects the specified vector object.

A vector object can be copied within the same layer, from one layer to another layer within the same vector handle, or from a layer in one vector handle to a layer in another vector handle using L_VecCopyObject.

An object can be hidden by calling the L_VecHideObject with the bHide parameter set to TRUE. A hidden object may be shown by calling the same function with bHide set to FALSE. To determine whether or not an object is hidden, use the L_VecIsObjectHidden function.

L_VecAddObject lets you add a new vector object to a vector layer. Before adding the new object however, it must be initialized using L_VecInitObject.

A vector object may contain a description string giving you some information about the object itself. To get the description for a vector object, call L_VecGetObjectDescription. To set or change the object description, use the L_VecSetObjectDescription function.

A vector object may also have a tool tip associated with it. For more information on tooltips, refer to Working with Tooltips.

In addition, vector objects may also be hyperlinked. For more information about hyperlinking vector objects, refer to Hyperlink Objects.

How an object is displayed may be affected by its view context. For more information on this, refer to Working with View Context.


Cloning a Vector Group

A group of vector objects can be cloned and added to a vector handle as a clone object. The steps used to accomplish this are as follows:

1. | Create and add a new group in the current vector handle.
2. | Create and add any new objects of the desired type into the group.
3. | Create an empty layer.
4. | Create a clone of the group.
5. | Add the clone object to the layer in the vector handle.

The following is an example that shows this process:

void CreateClone( pVECTORHANDLE pVector )
{
L_INT nRet;
VECTORPOINT Min, Max;
VECTORGROUPDESC GroupDesc;
VECTORGROUP Group;
VECTORLINE Line;
VECTORLAYERDESC LayerDesc;
VECTORLAYER Layer;
VECTORCLONE Clone;

// setup the vector
Min.x = 0.0;
Min.y = 0.0;
Min.z = 0.0;
Max.x = 5.0;
Max.y = 5.0;
Max.z = 0.0;
L_VecSetParallelogram( pVector, &Min, &Max );

L_VecSetOrigin( pVector, NULL );
L_VecSetCamera( pVector, NULL );

ZeroMemory( &GroupDesc, sizeof( GroupDesc ) );
GroupDesc.nSize = sizeof( GroupDesc );
lstrcpy( GroupDesc.szName, TEXT("My Group"));
GroupDesc.dwTag = 0L;

nRet = L_VecAddGroup( pVector, &GroupDesc, &Group, 0L );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Add Group!"), NULL, 0 );
return;
}

// add a new object
ZeroMemory( &Line, sizeof( Line ) );
L_VecInitObject( &Line.Object );
Line.Object.nSize = sizeof( Line );
Line.Object.nType = VECTOR_LINE;
Line.Point[ 0 ].x = 0.0;
Line.Point[ 0 ].y = 0.0;
Line.Point[ 0 ].z = 0.0;
Line.Point[ 1 ].x = 1.0;
Line.Point[ 1 ].y = 1.0;
Line.Point[ 1 ].z = 0.0;

Line.Pen.nSize = sizeof( Line.Pen );
Line.Pen.bExtPen = FALSE;
Line.Pen.NewPen.LogPen.lopnColor = RGB( 255, 0, 0 );
Line.Pen.NewPen.LogPen.lopnWidth.x = 1;
Line.Pen.NewPen.LogPen.lopnWidth.y = 0;
Line.Pen.NewPen.LogPen.lopnStyle = PS_SOLID;

nRet = L_VecAddObjectToGroup( pVector, &Group, VECTOR_LINE, &Line,
 NULL );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Insert Object!"), NULL, 0 );
return;
}

Line.Point[ 0 ].x = 1.0;
Line.Point[ 0 ].y = 0.0;
Line.Point[ 0 ].z = 0.0;
Line.Point[ 1 ].x = 0.0;
Line.Point[ 1 ].y = 1.0;
Line.Point[ 1 ].z = 0.0;

nRet = L_VecAddObjectToGroup( pVector, &Group, VECTOR_LINE, &Line,
 NULL );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Insert Object!"), NULL, 0 );
return;
}

// create an empty layer
ZeroMemory( &LayerDesc, sizeof( LayerDesc ) );
LayerDesc.nSize = sizeof( LayerDesc );
lstrcpy( LayerDesc.szName, TEXT("My Layer"));
LayerDesc.bVisible = TRUE;
LayerDesc.bLocked = FALSE;
LayerDesc.dwTag = 0L;

nRet = L_VecAddLayer( pVector, &LayerDesc, &Layer, 0L );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Add Layer!"), NULL, 0 );
return;
}

// now, clone the group
ZeroMemory( &Clone, sizeof( Clone ) );
L_VecInitObject( &Clone.Object );
Clone.Object.nSize = sizeof( Clone );
Clone.Object.nType = VECTOR_CLONE;

memcpy( &Clone.Group, &Group, sizeof( Group ) );

Clone.Point.x = 2.0;
Clone.Point.y = 2.0;
Clone.Point.z = 0.0;

Clone.Scale.x = 2.0;
Clone.Scale.y = 2.0;
Clone.Scale.z = 2.0;

Clone.Rotation.x = 0.0;
Clone.Rotation.y = 0.0;
Clone.Rotation.z = 0.0;

Clone.Pen.nSize = sizeof( Clone.Pen );
Clone.Pen.bExtPen = FALSE;
Clone.Pen.NewPen.LogPen.lopnColor = RGB( 255, 0, 0 );
Clone.Pen.NewPen.LogPen.lopnWidth.x = 1;
Clone.Pen.NewPen.LogPen.lopnWidth.y = 0;
Clone.Pen.NewPen.LogPen.lopnStyle = PS_SOLID;

Clone.Brush.nSize = sizeof( Clone.Brush );
Clone.Brush.VectorBrushStyle = VECTORBRUSH_STANDARD;
Clone.Brush.BrushType.StandardBrush.LogBrush.lbColor = RGB( 255, 0, 0 );
Clone.Brush.BrushType.StandardBrush.LogBrush.lbStyle = BS_SOLID;
Clone.Brush.BrushType.StandardBrush.LogBrush.lbHatch = 0;

Clone.dwFlags = 0L;     // use original settings

nRet = L_VecAddObject( pVector, &Layer, VECTOR_CLONE, &Clone, NULL );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Insert Object!"), NULL, 0 );
return;
}

// now, clone the group again
Clone.Point.x = 4.0;
Clone.Point.y = 1.0;
Clone.Point.z = 0.0;

Clone.Scale.x = 1.0;
Clone.Scale.y = 1.0;
Clone.Scale.z = 1.0;

Clone.Rotation.x = 0.0;
Clone.Rotation.y = 0.0;
Clone.Rotation.z = 45.0;

Clone.dwFlags = VECTOR_CLONE_USE_PEN;
Clone.Pen.NewPen.LogPen.lopnColor = RGB( 0, 0, 255 );  // this clone will be blue

nRet = L_VecAddObject( pVector, &Layer, VECTOR_CLONE, &Clone, NULL );
if( nRet != SUCCESS )
{
MessageBox( NULL, TEXT("Can't Insert Object!"), NULL, 0 );
return;
}
}


Working with EMF and WMF Files

When working with EMF and/or WMF files, the following functions allow for conversion between vector handles and EMF or WMF files:

L_VecConvertFromEMF

L_VecConvertFromWMF

L_VecConvertToEMF

L_VecConvertToWMF


Vector Dialogs

The vector libraries provide a set of common dialog boxes that combine Window Common Dialog functionality with vector functionality contained in LEADTOOLS. For a list of required DLL's, refer to Files To Be Included With Your Application. Vector Common Dialogs are provided for Vector Scaling, Vector Rotation, Vector Translation, Camera settings, View mode, Hit testing, Vector layer creation, Vector layer editing, Vector object creation, Vector object editing, and Dialog string modification. For more information, refer to the Vector Dialog functions listed below:

L_VecDlgCamera

L_VecDlgEditAllGroups

L_VecDlgEditAllLayers

L_VecDlgEditGroup

L_VecDlgEditLayer

L_VecDlgEditObject

L_VecDlgGetString

L_VecDlgGetStringLen

L_VecDlgHitTest

L_VecDlgNewGroup

L_VecDlgNewLayer

L_VecDlgNewObject

L_VecDlgRender

L_VecDlgRotate

L_VecDlgScale

L_VecDlgSetFont

L_VecDlgSetString

L_VecDlgTranslate

L_VecDlgViewMode


Mapping Fonts

A font mapper is a VECTORFONTMAPPERCALLBACK callback function, defined by the user, which is used to set the font characteristics for any text added to the vector handle after calling L_VecSetFontMapper. If the font mapper callback function returns an error, then the changes to the LogFont will be ignored.

For example, consider the situation in which the user is loading a CGM file that contains text of font Arial. If a font mapper callback function has not been added using L_VecSetFontMapper, the user has no control over the font of the text, and it will be added to the vector drawing as Arial. If a font mapper callback function is added using the L_VecSetFontMapper function, before the CGM file is loaded, the user can catch the font of the text and change it to something such as Courier New. When the text that is part of the CGM file is added to the vector drawing, the text will appear as Courier New instead of Arial.

To get the current font mapper assigned to a vector handle, call L_VecGetFontMapper.


Vector Handle Events

Certain events that occur within a vector handle generate calls to the VECTOREVENTPROC callback function. This callback function receives information on the calling event in a VECTOREVENT structure received as a parameter. For information on the types of events that the vector handle can generate, refer to the VECTOREVENT structure.

To set the callback function to receive the vector handle events, call L_VecSetEventCallback.

LEADTOOLS also provides the L_VecEvent for implementing a user-defined event. This function also lets you group several operations into one event. To do this you must call L_VecEvent with the Status member of the pEvent parameter set to VECTOR_EVENT_STATUS_BEFORE. This identifies the beginning of the event. Once all the operations you wish to include have been completed, call L_VecEvent with the Status member of the pEvent parameter set to VECTOR_EVENT_STATUS_AFTER. This notifies the toolkit that the operation(s) have been completed successfully.


Saving Vectors

LEADTOOLS provides the following two functions for saving vectors:

L_VecSaveFile

L_VecSaveMemory


Stock Objects Libraries

LEAD VECTOR Toolkit 14 supports Stock objects libraries. These are Dynmaic Link Libraries that contain user-defined objects.

The VECOFICE Library comes with more than 100 pre-defined object shapes for multiple purposes such as arrows, flowchart symbols, etc.

The following example adds all the objects in the VECOFICE library to the default layer of a vector handle:

#include "lvkrn.h"
#include "vecofice.h"

void LoadVecOficeLibrary( pVECTORHANDLE pVector )
{
VECTORSTOCK Stock;
L_INT i;
L_DOUBLE X, Y;
const L_DOUBLE SIZE = 2.0;

// Initiate a new VECTOR_STOCK object.
L_VecInitObject( &Stock.Object );
Stock.Object.nType = VECTOR_STOCK;
Stock.Object.nSize = sizeof( VECTORSTOCK );

// Load the VECOFICE library.
Stock.hInstDLL = LoadLibrary(TEXT("VecOfice.dll"));

// Tell the toolkit to load the stock object using the hInstDLL member.
Stock.pszDLLName = NULL;

// Fill in default pen, brush and font.
Stock.Pen.nSize = sizeof( VECTORPEN );
Stock.Pen.bExtPen = FALSE;
Stock.Pen.NewPen.LogPen.lopnStyle = PS_SOLID;
Stock.Pen.NewPen.LogPen.lopnWidth.x = 1;
Stock.Pen.NewPen.LogPen.lopnWidth.y = 0;
Stock.Pen.NewPen.LogPen.lopnColor = RGB( 0xFF, 0x00, 0x00 );

Stock.Brush.VectorBrushStyle = VECTORBRUSH_STANDARD;
Stock.Brush.nSize = sizeof( VECTORBRUSH );
Stock.Brush.BrushType.StandardBrush.LogBrush.lbStyle = PS_SOLID;
Stock.Brush.BrushType.StandardBrush.LogBrush.lbHatch = 0;
Stock.Brush.BrushType.StandardBrush.LogBrush.lbColor = RGB( 0x00, 0xFF, 0x00 );

X = 0.0;
Y = 0.0;

// Add all objects, use a grid of 10 horizontal objects
for( i = 0; i < VECOFICE_OBJECT_COUNT; i++ )
{
// Set object ID.
Stock.nId = i;

Stock.Point[ 0 ].x = X;
Stock.Point[ 0 ].y = Y;
Stock.Point[ 0 ].z = 0.0;

Stock.Point[ 1 ].x = X + SIZE;
Stock.Point[ 1 ].y = Y + SIZE;
Stock.Point[ 1 ].z = 0.0;

// We want to have random colors for each object.
Stock.Pen.NewPen.LogPen.lopnColor = RGB( rand() % 256, rand() % 256, rand() % 256 );
Stock.Brush.BrushType.StandardBrush.LogBrush.lbColor = RGB( rand() % 256, rand() % 256, rand() % 256 );

// Add the object to the default layer.
L_VecAddObject( pVector, NULL, VECTOR_STOCK, &Stock, NULL );

// Update position for next object.
if( !( ( i + 1 ) % 10 ) )
{
Y -= SIZE * 3.0 / 2.0;
X = 0.0;
}
else
{
X += SIZE * 3.0 / 2.0;
}
}
}


Hyperlink Objects

A vector object may be hyperlinked to run a program, access a Web page, open a document or focus the view of the toolkit on a particular vector object within the scene. This is done by hyperlinking the vector object with one or more "targets". Each vector object that is hyperlinked maintains a target list. To open a document or run an application, the target should be set to the file name of the document to open or the program to run. To access a Web page, the target should be set to the URL to access. To focus the toolkit on a specific vector object, the target should be set to that vector object.

To add a new target to a vector object and make it a hyperlinked vector object, or to add an additional target to a vector object that already has one or more other hyperlink targets, call L_VecAddHyperlink. Once a target has been added to a vector object's target list, the target can be changed by calling the L_VecSetHyperlink function.

To retrieve information about a specific target, call the L_VecGetHyperlink function. To determine how many targets the hyperlinked vector object is maintaining, the function L_VecGetHyperlinkCount can be used. L_VecGetHyperlinkCount will retrieve the number of items in the target list.

When the hyperlinked vector object is clicked, the L_VecGotoHyperlink must be called with the chosen target in the target list. This activates the target.


Working with Tooltips

A tooltip may be used to provide a small amount of information about a vector object. This is generally displayed when the cursor moves over the object. To use a tool tip, first the function L_VecSetObjectTooltip should be called to set the tool tip string. The tool tip can then be displayed by calling L_VecShowObjectTooltip.

To hide a displayed tool tip, such as when the cursor moves off the vector object, the function L_VecHideObjectTooltip should be called.

An object's too ltip can also be changed using the L_VecSetObjectTooltip function. To determine the current tool tip, call the L_VecGetObjectTooltip function. Make the necessary changes to the string and then call L_VecSetObjectTooltip.


Working with View Context

The view context space is a vector space assigned to a vector object. The context space is the area to be displayed when the object is the target of a hyperlinked vector object.

To set a view context of an object use the function L_VecSetObjectViewContext. To retrieve the view context of an object, use the function L_VecGetObjectViewContext.

When the view context of an object is no longer required the function L_VecRemoveObjectViewContext should be used to remove the view context.


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:

ACROBAT | LEADTOOLS manuals in the PDF format, which you can view and print using Adobe Acrobat. These files are optional and are available when installing from the CD-ROM.
BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\OCX | One subdirectory for each example ActiveX program.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
INCLUDE\CLASSLIB | Header files for the Class Library
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


Formats of Vector Input Files

This topic has been replaced. Refer to Summary of All Supported Image File Formats.


Formats of Vector Output Files

This topic has been replaced. Refer to Summary of All Supported Image File Formats.


Summary of All Supported Image File Formats

Color and Grayscale

Compressed Windows Metafile Format (WMZ)

Computer Graphics Metafile (CGM)

Corel Presentation Exhange (CMX)

DGN (DGN)

DRaWing (DRW)

Drawing Interchange Format (DXF)

DWF Format (DWF)

DWG Format (DWG)

ESRI Shape (SHP) Format

Gerber Format (GBR)

Macintosh Pict Format (PCT)

PLT (PLT)

Printer Command Language Format (PCL)

Scalable Vector Graphics Format (SVG)

Windows Metafile Formats (WMF and EMF)

WordPerfect Format (WPG)


File Formats: Compressed Windows Metafile Format (WMZ)

Compressed Windows Metafile Format (WMZ)

The Compressed Windows Metafile format is a vector file format that represents primarily Group 3 fax documents. It contains information concerning the page structure and the compressed line data of the fax document. This format was developed by Microsoft and is supported by Microsoft Office 2000 and Microsoft Word 2000.

The default extension used by this format is: WMZ.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Background color and mode | Supported | Supported
Chord | Supported | Supported
Circle | Supported | Supported
Color | Supported | Supported
Ellipse | Supported | Supported
HPolyBezier | Supported | Supported
Lines | Supported | Supported
Pie | Supported | Supported
PolyBezier | Supported | Supported
PolyDraw | Supported | Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Raster | Supported | Supported
Rectangle | Supported | Supported
Round Rectangle | Restricted Support | Restricted Support
Spline | Supported | Supported
Text | Supported | Supported
Text(Color and Font Type) | Supported | Supported
Vertex | Supported | Supported

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_WMZ | Yes | Yes | [307] Compressed Windows Metafile Format

When WMZ files are rasterized, they are 24 BPP.

Required DLL: LFWMZ. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

NOTE: This format does not support LEAD's redirected IO feature.

Related Formats: EMF - Windows Metafile Formats, Computer Graphics Metafile (CGM), Corel Presentation Exchange (CMX), DGN (DGN), DRaWing (DRW), Drawing Interchange Format (DXF), DWF Format (DWF), DWG Format (DWG), ESRI Shape (SHP), Gerber Format (GBR), Macintosh Pict (PCT), PLT (PLT), Printer Command Language (PCL), Scalable Vector Graphics (SVG), Windows Metafile Format (WMF), WordPerfect Graphics Format (WPG and VWPG).


File Formats: Computer Graphics Metafile (CGM)

Computer Graphics Metafile (CGM)

Computer Graphics Metafile is a format used for the exchange of vector and bitmap data. This file format is supported by Autovue and Corel. LEADTOOLS supports versions 1, 2, 3 and 4 of CGM, as well as the Binary data-encoding format of CGM.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Circle | Supported | Not Supported
Circular Arc Center | Supported | Not Supported
Ellipse | Supported | Supported
Elliptical Arc | Supported | Not Supported
Font | Supported | Supported
Lines | Supported | Supported
PolyBezier | Supported | Not Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Rectangle | Supported | Supported
Text | Supported | Supported

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The default extension used by this file format is: CGM.

This file format does not support layers.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CGM | Yes | Yes | [62] Computer Graphics Metafile.

When CGM files are rasterized, they are 24 BPP.

Required DLL: LFCGM. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Corel Presentation Exchange (CMX)

Corel Presentation Exchange Format (CMX)

The Corel Presentation Exchange file format is the presentation format of the CorelSuite applications. It is a recording of the display primitives of an application to a display interface. The CMX format supports Intel and Motorola binary formats.

CMX adopts the Resource Interchange File Format (RIFF). The entire CMX file is enclosed within either the RIFF or RIFX form, depending on the platform.

This file format is not supported in the non-vector toolkits. Read support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The default extension used by this format is: CMX.

This file format is supported by CorelDraw.

LEAD supports versions 5, 6, 7, and 8 of this format.

This file format does support layers. LEAD does not support RImage.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CMX | Yes | No | [261] Corel Presentation Exchange Format.

When CMX files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Ellipse | Supported | Not Supported
PolyDraw | Supported | Not Supported
Raster | Supported | Not Supported
Rectangle | Supported | Not Supported
Text | Supported | Not Supported

Required DLL: LFCMX. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: DGN (DGN)

DGN (DGN)

DGN (also RDL) is a file format common to Intergraph's MicroStation and Interactive Graphics Design System (IGDS) CAD applications running on Intergraph workstations and PCs.

This file format is not supported in the non-vector toolkits. Read support for this format is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

LEADTOOLS supports DGN versions 1, 2 and 3.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_INTERGRAPH_VECTOR | Yes | Yes | [123] Intergraph MicroStation and Interactive Graphics Design.

When DGN files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Not Supported
Ellipse | Supported | Not Supported
Lines | Supported | Not Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Raster | Supported | Supported
Text | Supported | Not Supported

Required DLL: LFDGN. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: DRaWing (DRW)

DRaWing (DRW)

DRW (DRaWing) is a native format used in the popular Micrografx Designer CAD/CAM/CAE application for the Windows operating system.

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

LEADTOOLS supports versions 1, 2, 3, 4 and 5 of the DRW file format.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DRW | Yes | Yes | [136] Micrografx Designer CAD drawing.

When DRW files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Not Supported
Lines | Supported | Supported
Pie | Supported | Not Supported
Point | Supported | Supported
PolyDraw | Supported | Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Raster | Supported | Not Supported
Text | Supported | Supported

Required DLL: LFDRW. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

NOTE: This format does not support LEAD's redirected IO feature, therefore it cannot be used with L_LoadBitmapMemory , L_SaveBitmapMemory , or L_FeedLoad .

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Drawing Interchange Format (DXF)

Drawing Interchange Format (DXF)

DXF (Drawing Interchange Format) was first introduced by AutoDesk AutoCAD, and is one of the most widely used CAD/CAM/CAE applications in the world. DXF is very popular and is supported by most 3D formats on PC platforms.

A DXF file is an ASCII file containing 2D and 3D components representing a drawing. Those components are known as Entities. The DXF file can represent almost any CAD drawing using those entities, and can connect a group of entities together (such as windows, doors, etc.) and use them later in the file. The DXF file has seen many changes through the years, from version 2.6 to the latest release version 14. However, the latest release of AutoCAD still manages to open files created with any of the earlier versions.

LEADTOOLS supports all current variations of the DXF format (versions 2.6, 9, 10, 11, 12, 13, 14).

You can load any of the DXF files as either vector images or raster images. Users can load a DXF file, and save it to any of file formats supported by LEADTOOLS.

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DXF | Yes | Yes | [58] AutoDesk AutoCAD ASCII format Release 12.
FILE_DXF_R12 | Yes | Yes | Same as FILE_DXF
FILE_DXF_R13 | Yes | Yes | [290] AutoDesk AutoCAD ASCII format Release 13.
When DXF files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Attdef | Supported | Not Supported
Attrib | Supported | Not Supported
Circle | Supported | Supported
Clone | Supported | Supported
Ellipse | Supported | Supported
Elliptical Arc | Supported | Not Supported
Insert | Supported | Not Supported
Leader | Supported | Not Supported
Lines | Supported | Supported
MText | Supported | Supported
Polygons | Supported | Supported
PolyLine | Supported | Supported
Raster | Supported | Not Supported
Solid | Supported | Not Supported
Spline | Supported | Not Supported
Text | Supported | Supported
Tolerance | Supported | Not Supported
Vertex | Supported | Supported
WPolyLine | Supported | Not Supported
3DFace | Supported | Not Supported

Required DLL: LFDXF. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

NOTE: This format does not support LEAD's redirected IO feature, therefore it cannot be used with L_LoadBitmapMemory , L_SaveBitmapMemory , or L_FeedLoad .

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: DWF Format (DWF)

DWF Format (DWF)

DWF is a binary file format used by AutoDesk AutoCAD for storing DWG files on the World Wide Web. DWF is a 2D, vector-based description of drawings and illustrations.

LEADTOOLS supports DWF versions .4, .5, .55 and .6.

This file format is not supported in the non-vector toolkits. Read and write support for this format is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DWF | Yes | Yes | [145] AutoDesk AutoCAD for storing DWG files on the World Wide Web.
FILE_DWF_TEXT_AS_POLYLINE | N/A | Yes | [297] AutoDesk AutoCAD for storing DWG files on the World Wide Web. Use this format to save DWF and have Text objects converted to Polyline objects in the output file.

When DWF files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Not Supported
Attdef | Supported | Not Supported
Attrib | Supported | Not Supported
BoundaryPolydraw | Supported | Not Supported
Circle | Supported | Supported
Dimension | Supported | Not Supported
Ellipse | Supported | Supported
Hatch | Supported | Not Supported
Insert | Supported | Not Supported
Leader | Supported | Not Supported
Lines | Supported | Supported
Mline | Supported | Not Supported
Mtext | Supported | Not Supported
Polygons | Supported | Not Supported
Polyline | Supported | Supported
PureLine | Supported | Not Supported
PurePolygon | Supported | Not Supported
PurePolyline | Supported | Not Supported
Segment | Supported | Not Supported
Spline | Supported | Not Supported
Text | Supported | Supported
Vertex | Supported | Not Supported
Wpolyline | Supported | Not Supported
3DFace | Supported | Not Supported
3DSolid | Supported | Not Supported

LEADTOOLS also supports text and embedded raster objects.

Required DLL: LFDWF. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: DWG Format (DWG)

DWG Format (DWG)

DWG is a binary file format used by AutoDesk AutoCAD. It can contain 2D or 3D objects and offers compression and a CRC check for internal data.

LEADTOOLS supports DWG 13, 14 and 15 files.

This file format is not supported in the non-vector toolkits. Read support for this format is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The default extension used by this format is: DWG.

LEAD supports the object types listed above, as well as, layers and the grouping of objects. Embedded raster objects are not supported.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DWG | Yes | No | [124] AutoDesk AutoCAD binary format.
When DWG files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Not Supported
Attdef | Supported | Not Supported
Attrib | Supported | Not Supported
BoundaryPolydraw | Supported | Not Supported
Circle | Supported | Not Supported
Dimension | Supported | Not Supported
Ellipse | Supported | Not Supported
Hatch | Supported | Not Supported
Insert | Supported | Not Supported
Leader | Supported | Not Supported
Lines | Supported | Not Supported
Mline | Supported | Not Supported
Mtext | Supported | Not Supported
Polygons | Supported | Not Supported
Polyline | Supported | Not Supported
PureLine | Supported | Not Supported
PurePolygon | Supported | Not Supported
PurePolyline | Supported | Not Supported
Segment | Supported | Not Supported
Spline | Supported | Not Supported
Text | Supported | Not Supported
Vertex | Supported | Not Supported
Wpolyline | Supported | Not Supported
3DFace | Supported | Not Supported
3DSolid | Supported | Not Supported

Required DLL: LFDWG. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: ESRI Shape (SHP)

ESRI Shape Format (SHP)

The ESRI Shape format is a vector format created by the Environmental System Research Institute. The SHP file can support point, multi-point, polygon, polyline and multi-patches. This file format has a much faster drawing speed and more editing capabilities than other data sources. It is supported by the ARC Explorer 2.0 and ARCView.

This file format contains three files:

Main file: *.shp

Index file: *.shx

DBase file: *.dbf

This file format is not supported in the non-vector toolkits. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The default extension used by this format is: SHP.

This file format does not support layers, grouping objects or embedded raster objects.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SHP | Yes | Yes | [255] ESRI Shape – Environmental System Research Institute.

When SHP files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
PolyDraw | Supported | Not Supported
Polyline | Supported | Supported
Vertex | Supported | Not Supported

Required DLL: LFSHP. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Gerber Format (GBR)

Gerber Format (GBR)

The Gerber file format is a vector – based format used by GerbTools, ViewMate and CamTastic as a simple way of transferring printed circuit board information to a wide variety of devices. The Extended Gerber Format (RS-274X) handles information for defining shapes and sizes of lines and other features. This format supports Polygons, Circles, Ovals, Outlines, Arcs, Lines, Rectangles, Moire and Thermal.

This file format is not supported in the non-vector toolkits. Read and write support for this format is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection.

The default extension used by this format is: GBR.

This file format does support layers.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_GERBER | Yes | Yes | [169] Gerber Vector.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Chord | Supported | Supported
Circle | Supported | Supported
Lines | Supported | Supported
Polygons | Supported | Supported
Rectangle | Supported | Not Supported

Required DLL: LFGBR. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Macintosh Pict (PCT)

Macintosh Pict Format (PCT)

Macintosh Pict (PCT) files are produced using Macintosh QuickDraw, and are used in desktop publishing and imaging applications.

PCT Vector files can be read and written as raster images in the non-vector toolkits. LEADTOOLS supports multiple page files when reading and writing PCT images as raster images. Vector read/write support for these formats is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

File constants associated with this file format are:

Constant | Raster Read Support | Raster Write Support | Vector Read Support | Vector Write Support | Description
FILE_PCT | 1, 4, 8, 16, 24 BPP | 1, 4, 8, 16, 24 BPP | Yes | Yes | [56] Macintosh QuickDraw

When PCT files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Background | Supported | Supported
Ellipse | Supported | Not Supported
Foreground | Supported | Supported
Lines | Supported | Supported
Point | Supported | Supported
Polygons | Supported | Not Supported
Rectangle | Supported | Not Supported
Text | Supported | Supported

Required DLL: LFPCT. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: PLT (PLT)

PLT (PLT)

PLT (also HPGL) is the standard language for printing line drawings created by Hewlett-Packard. HPGL is supported by many CAD programs, charting programs and word processors.

LEADTOOLS supports HPGL and HPGL/2.

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PLT | Yes | Yes | [137] PLT.

When PLT files are rasterized, they are 4 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Circle | Supported | Supported
Lines | Supported | Supported
Pie | Supported | Supported
PolyDraw | Supported | Not Supported
Polygons | Supported | Not Supported
Polyline | Supported | Not Supported
Rectangle | Supported | Supported
Text | Supported | Not Supported

Required DLL: LFPCL. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

NOTE: This format does not support LEAD's redirected IO feature, therefore it cannot be used with L_LoadBitmapMemory , L_SaveBitmapMemory , or L_FeedLoad .

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Printer Command Language (PCL)

Printer Command Language Format (PCL)

The Printer Command Language vector format was developed by Hewlett-Packard, specifically to provide a means of communication between computers and printers. The PCL files contain the commands and the HP printers parse and decode those commands. This format also includes HPGL. For more information about HPGL, refer to PLT.

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

LEAD supports version 3.0 and 5.0 of this file format.

The default extensions used by this format are: PRN, PRT and PCL.

This format is used by Visual PCL, PCLTOOLS, redtitan EscapE and AutoVue.

This file format does not support layers or grouping, but it does support embedded raster objects.

PCL filter supports many features such as:

Support for Raster, text and rectangular area.

Support for Macros.

Enhanced performance of the filter.

Support for HPGL mode in PCL

Raster fonts

RTL Raster data

Support for all compression methods (RLE, TIFF, Delta, Adaptive and Unencoded).

Support for old versions of PCL v.3, besides v.5.

Viewing PJL with POSTSCRIPT data (requires the PDF filter)

Support for user-defined and pre-defined patterns

Support for Unicode symbols

Detecting non-standard PCL/HPGL files that lack a correct header

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PCL | Yes | Yes | [251] Printer Command Language – Hewlett Packard.
FILE_PLT | Yes | Yes | [137] HPGL – Hewlett-Packard.

When PCL files are rasterized, they are 24 BPP.
When PLT files are rasterized, they are 4 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Circle | Supported | Supported
Lines | Supported | Supported
Pie | Supported | Supported
Point | Supported | Supported
PolyBezier | Supported | Not Supported
PolyDraw | Supported | Not Supported
Polygons | Supported | Not Supported
Polyline | Supported | Not Supported
Raster | Supported | Supported
Rectangle | Supported | Supported
Text | Supported | Supported

Required DLL: LFPCL. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Scalable Vector Graphics (SVG)

Scalable Vector Graphics Format (SVG)

The Scalable Vector Graphics file format is an Internet standard vector format for describing two-dimensional graphics in XML. SVG supports vector graphic shapes, images, and text. For more information about this format please refer to the World Wide Web Consortium (W3C) website http://www.w3c.org.

This file format is not supported in the non-vector toolkits. Read support and write support for this format are provided in the LEADTOOLS Vector toolkits and are unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

The default extension used by this format is: SVG.

This file format is supported by Adobe SVG Viewer, CorelDraw! 10.0, JASC WebDraw and Apache Batik SVG browser.

This file format does not support layers, but it will save embedded raster objects.

When saving SVG files, the images are stored externally and a reference to the image(s) is added to the file. Use FILE_SVG_EMBED_IMAGES to save raster images embedded inside the SVG file.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SVG | Yes | Yes | [247] Scalable Vector Graphics Format.
FILE_SVG_EMBED_IMAGES | Yes | Yes | [289] Scalable Vector Graphics Format with embedded raster images.

When SVG files are rasterized, they are 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Rectangle | Supported | Supported
Circle | Supported | Supported
Ellipse | Supported | Supported
Lines | Supported | Supported
Polyline | Supported | Supported
Polygons | Supported | Supported
PolyDraw | Supported | Supported
Raster | Supported | Supported
Vertex | Not Supported | Supported
PolyBezier | Not Supported | Supported
Spline | Not Supported | Supported
HPolyBezier | Not Supported | Supported
Text | Supported | Supported
Filling,Stroking, and Marker | Supported | Supported
Gradients and Patterns | Not Supported | Not Supported
Color | Supported | Supported
Clipping, Masking, and Compositing | Not Supported | Not Supported
Filter Effects | Not Supported | Not Supported
Interactivity | Not Supported | Not Supported
Linking | Not Supported | Not Supported
Animation | Not Supported | Not Supported
Fonts | Supported | Supported

Required DLL: LFSVG. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, VEC - LEADTOOLS Vector Dump Format,VPG - WordPerfect Vector Format, WMF - Windows Metafile Formats, WMZ - Compressed Windows Metafile Format .


File Formats: Windows Metafile Format (WMF)

Windows Metafile Formats (WMF and EMF)

The Windows Metafile (WMF and EMF) formats are vector formats that may or may not also contain a raster image.

EMF/WMF Vector files can be read and written as raster images in the non-vector toolkits. Vector read/write support for these formats is provided in the LEADTOOLS Vector toolkits and is unlocked when the Vector features are unlocked. For more information on available LEADTOOLS products, refer to Topic Selection or contact LEAD.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_WMF | Yes | Yes | [15] Windows Metafile.
FILE_EMF | Yes | Yes | [116] Windows Enhanced Metafile.

When WMF and EMF files are rasterized, they are either 8 or 24 BPP.

The following table indicates which objects LEAD can load and which objects it can save:

Object: | Load: | Save:
Arc | Supported | Supported
Background color and mode | Supported | Supported
Chord | Supported | Supported
Circle | Supported | Supported
Color | Supported | Supported
Ellipse | Supported | Supported
HPolyBezier | Supported | Supported
Lines | Supported | Supported
Pie | Supported | Supported
PolyBezier | Supported | Supported
PolyDraw | Supported | Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Raster | Supported | Supported
Rectangle | Supported | Supported
Round Rectangle | Restricted Support | Restricted Support
Spline | Supported | Supported
Text | Supported | Supported
Text(Color and Font Type) | Supported | Supported
Vertex | Supported | Supported

Required DLL: LFWMF. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Note:

When working with LEADTOOLS annotations (rather than image files), you can save the annotations as WMF or EMF files containing vector graphics that can be used in other applications.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format , PLT - PLT / HPGL Format, PS - PostScript Document Format , RTF - Rich Text Format , SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format, VPG - WordPerfect Vector Format, WMZ - Compressed Windows Metafile Format .


File Formats: WordPerfect Graphics Format (WPG and VWPG)

WordPerfect Graphics Format (WPG and VWPG)

The WordPerfect (WPG) format can contain vectored or raster images. LEADTOOLS handles both the raster images and the vector images.

Raster Images

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_WPG | 1, 4, 8 BPP | 1, 4, 8 BPP | [54] WordPerfect Graphics Format.

Required DLL: LFWPG. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Vector Images

VWPG (Vector Word Perfect Graphics) is a vector format created by COREL. There are two versions (version1 and version2) of the VWPG file format. Each has its own format and specifications. LEAD supports only version2 of this format. This file format is supported by COREL DRAW 8.0.

The default extension used by this format is: WPG.

This file format does support layers and embedded raster objects, but not grouping.

LEAD can load the following objects: Poly Curve, Rect, Vertical Line, Horizontal Line, Poly Line, Text, and Image.

LEAD can save the following objects: Line, Polyline, Rect, Polygon, Ellipse, Circle, Arc, Elliptical arc, Pie, Chord, Text, Polydraw, Polybezier, and Image.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_VWPG | Yes | Yes | [260] WordPerfect Graphics Format (vector).

When vector WPG files are rasterized, they are 24 BPP.

Required DLL: LFVPG. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format, PLT - PLT / HPGL Format, PS - PostScript Document Format, RTF - Rich Text Format, SHP - ESRI Shape Format, SVG - Scalable Vector Graphics Format, VEC - LEADTOOLS Vector Dump Format,WMF - Windows Metafile Formats,WMZ - Compressed Windows Metafile Format.


Vector 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 Vector features files.

Note: | The Vector features are provided for evaluation purposes only. 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 Vector features functions on a WIN32 system. (\REDIST\ subdirectory contains copies of these files.)

Please note that LTKRN is required for ALL API applications. For more information on LTKRN and other files for the Main API, refer to Files To Be Included With Your Application.

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LVKRN LVDLG LVGL | Vector Features Support. LVKRN14_N.DLL is the LEADTOOLS Vector Support DLL. LVDLG14N.DLL is required for Vector Common Dialog support. LVGL14N.DLL is required for OpenGL support. | DLL: LVKRN14N.DLL LVDLG14N.DLL LVGL14N.DLL Library: LVKRN_N.LIB LVDLG_N.LIB | DLL: LVKRN14NU.DLL LVDLG14NU.DLL LVGL14NU.DLL Library: LVKRN_NU.LIB LVDLG_NU.LIB | DLL: LVKRN14E.DLL LVDLG14E.DLL LVGL14E.DLL Library: LVKRN_E.LIB LVDLG_E.LIB | DLL: LVKRN14EU.DLL LVDLG14EU.DLL LVGL14EU.DLL Library: LVKRN_EU.LIB LVDLG_EU.LIB


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
CompuServe ID: | 71333,2237 or GO LEADTECH
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.


Vector Features API Function Groups

Loading and Saving Vector Files

Viewing a Vector Image

Vector Handle Functions

Getting Vector Layer Information

Modifying Vector Layers

Using Vector Groups

Modifying Vector Object Characteristics

Obtaining Object Information

Getting Vector Object Information

Using the Clipboard

Converting/Changing Metafiles

Copying a Vector

Realizing a Vector To a Bitmap

Vector Dialogs

Callbacks

Version and License Information

Hyperlink Object

Tooltips

Handling Font Mappers


Callbacks

Detecting the progress of a function:

LVCOMMDLGHELPCB

VECTORENUMGROUPSPROC

VECTORENUMLAYERSPROC

VECTORENUMOBJECTSPROC

VECTORENUMVERTICESPROC

VECTORFONTMAPPERCALLBACK


Converting/Changing Metafiles

L_VecConvertFromEMF

L_VecConvertFromWMF

L_VecConvertToEMF

L_VecConvertToWMF


Copying a Vector

Copying a Vector Handle

L_VecInit

L_VecCopy


Getting Vector Layer Information

L_VecEnumLayers

L_VecGetActiveLayer

L_VecGetLayer

L_VecGetLayerByIndex

L_VecGetLayerByName

L_VecGetLayerCount


Obtaining Object Information

Getting Vector Object Information

L_VecEnumObjects

L_VecEnumObjectsInLayer

L_VecEnumVertices

L_VecGetHitTest

L_VecGetDisplayOptions

L_VecGetObject

L_VecGetObjectAttributes

L_VecGetObjectDescription

L_VecGetObjectParallelogram

L_VecGetObjectRect

L_VecGetObjectViewContext

L_VecHitTest

L_VecIs3D

L_VecIsObjectHidden

L_VecIsObjectInsideParallelogram

L_VecIsObjectInsideRect

L_VecIsObjectSelected


Handling Font Mappers

L_VecGetFontMapper

L_VecSetFontMapper


Loading and Saving Vector Files

L_VecLoadFile

L_VecLoadMemory

L_VecSaveFile

L_VecSaveMemory


Modifying Vector Layers

L_VecAddLayer

L_VecCopyLayer

L_VecDeleteLayer

L_VecEmptyLayer

L_VecFreeLayer

L_VecSetActiveLayer

L_VecSetLayer


Modifying Vector Object Characteristics

Modifying Vector Objects

L_VecAddObject

L_VecApplyTransformation

L_VecCopyObject

L_VecDeleteObject

L_VecDlgRotate

L_VecDlgScale

L_VecDlgTranslate

L_VecExplodeObject

L_VecFreeObject

L_VecGetBindVerticesMode

L_VecGetRotation

L_VecGetScale

L_VecGetTranslation

L_VecHideObject

L_VecInitObject

L_VecInvertColors

L_VecRemoveObjectViewContext

L_VecSelectObject

L_VecSetBindVerticesMode

L_VecSetDisplayOptions

L_VecSetHitTest

L_VecSetObject

L_VecSetObjectAttributes

L_VecSetObjectDescription

L_VecSetObjectViewContext

L_VecSetRotation

L_VecSetScale

L_VecSetTranslation


Realizing a Vector to a Bitmap

L_VecRealize


Using the Clipboard

L_VecClipboardReady

L_VecCopyFromClipboard

L_VecCopyToClipboard


Using Vector Groups

L_VecAddGroup

L_VecAddObjectToGroup

L_VecCopyGroup

L_VecDeleteGroup

L_VecDeleteGroupClones

L_VecDlgEditAllGroups

L_VecDlgEditGroup

L_VecDlgNewGroup

L_VecEmptyGroup

L_VecEnumGroups

L_VecEnumObjectsInGroup

L_VecFreeGroup

L_VecGetGroup

L_VecGetGroupByIndex

L_VecGetGroupByName

L_VecGetGroupCount

L_VecSetGroup


Vector Dialogs

L_VecDlgCamera

L_VecDlgEditAllGroups

L_VecDlgEditAllLayers

L_VecDlgEditGroup

L_VecDlgEditLayer

L_VecDlgEditObject

L_VecDlgGetString

L_VecDlgGetStringLen

L_VecDlgHitTest

L_VecDlgNewGroup

L_VecDlgNewLayer

L_VecDlgNewObject

L_VecDlgRender

L_VecDlgRotate

L_VecDlgScale

L_VecDlgSetFont

L_VecDlgSetString

L_VecDlgTranslate

L_VecDlgViewMode


Vector Handle Functions

Getting/Setting the Vector Engine

L_VecAttachToWindow

L_VecGetEngine

Locking a Vector Handle

L_VecIsLocked

L_VecSetLocked

Emptying a Vector Handle

L_VecEmpty

L_VecIsEmpty

Getting/Setting the Point of Origin

L_VecGetOrigin

L_VecSetOrigin

Marker Settings

L_VecGetMarker

L_VecSetMarker

Vector Handle Boundaries

L_VecGetParallelogram

L_VecSetParallelogram

L_VecZoomRect

Copying a Vector Handle

L_VecInit

L_VecCopy

Freeing a Vector Handle

L_VecFree

Vector Events

L_VecEvent

L_VecSetEventCallback


Version and License Information

L_IsSupportLocked

L_UnlockSupport

L_VersionInfo


Viewing a Vector Image

L_VecDlgCamera

L_VecGetAmbientColor

L_VecGetBackgroundColor

L_VecGetCamera

L_VecGetDisplayOptions

L_VecGetPalette

L_VecGetPan

L_VecGetPolygonMode

L_VecGetUseLights

L_VecGetViewMode

L_VecGetViewport

L_VecSetAmbientColor

L_VecSetBackgroundColor

L_VecSetCamera

L_VecSetDisplayOptions

L_VecSetPalette

L_VecSetPan

L_VecSetPolygonMode

L_VecSetUseLights

L_VecSetViewMode

L_VecSetViewport

L_VecAttachToWindow

L_VecLogicalToPhysical

L_VecPhysicalToLogical

L_VecPaint

L_VecPaintDC

L_VecZoomRect


Hyperlink Object

L_VecAddHyperlink

L_VecSetHyperlink

L_VecGetHyperlink

L_VecGetHyperlinkCount

L_VecGotoHyperlink


Tooltips

L_VecSetObjectTooltip

L_VecShowObjectTooltip

L_VecHideObjectTooltip

L_VecGetObjectTooltip


Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Vector Structures

GRADIENTBRUSH

HATCHBRUSH

PATTERNBRUSH

STANDARDBRUSH

VECTORARC

VECTORBITMAP

VECTORBRUSH

VECTORCAMERA

VECTORCIRCLE

VECTORCLONE

VECTOR_DISPLAY_OPTIONS

VECTORELLIPSE

VECTORELLIPTICALARC

VECTORFONT

VECTORGROUP

VECTORGROUPDESC

VECTORHANDLE

VECTORHITTEST

VECTORHPOLYBEZIER

VECTORLAYER

VECTORLAYERDESC

VECTORLINE

VECTORMARKER

VECTOROBJECT

VECTORPEN

VECTORPIE

VECTORPOINT

VECTORPOLYDRAW

VECTORPOLYGON

VECTORPOLYLINE

VECTORRASTER

VECTORRECTANGLE

VECTORSPLINE

VECTORSTOCK

VECTORTEXT

VECTORTOOLTIPDESC

VECTORVERTEX

Hyperlink Structures

VECTOR_ANTIALIASING

VECTORLINKFILEINFO

VECTORLINKDESC

VECTOR_TEXTRENDER

VECTORLINKHANDLING

Structures Used with Input and Output Functions

WINDOWS Structures


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type | Definition and Usage
L_BITFIELD | Defined as L_UINT; used as a bit field.
L_BOOL | Defined as L_UINT; used as a boolean value.
L_CHAR | Defined as char; used as a signed 8-bit integer.
L_DOUBLE | Defined as double; used as a double precision floating point number.
L_FLOAT | Defined as float; used as a floating point number.
L_INT | Defined as int; used as a signed integer, 16-bits or larger.
L_INT16 | Defined as short; used as a signed 16-bit integer.
L_INT32 | Defined as long; used as a signed 32-bit integer.
L_UCHAR | Defined as unsigned char; used as an unsigned 8-bit integer.
L_UINT | Defined as unsigned; used as an unsigned integer, 16-bits or larger.
L_UINT16 | Defined as unsigned short; used as an unsigned 16-bit integer.
L_UINT32 | Defined as unsigned long; used as an unsigned 32-bit integer.
L_VOID | Defined as void; used as a void.
L_COMP | Defined as L_UINT; used as a handle to a computer
L_MEDIA | Defined as L_VOID L_FAR *; used as a void pointer
L_TCHAR | Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and datatypes:

Keyword | Definition and Usage
L_FAR | Defined as nothing; used as a placeholder.
L_HUGE | Defined as nothing; used as a placeholder.
L_EXPORT | Defined as nothing; used as a placeholder.
L_PASCAL | Defined as nothing; used as a placeholder.
EXT_FUNCTION | Defined as WINAPI; used as an attribute for all toolkit functions.
pEXT_FUNCTION | Defined as EXT_FUNCTION L_FAR *; used as an attribute when defining pointers to toolkit functions.
EXT_CALLBACK | Defined as _cdecl L_FAR; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK L_FAR *; used as an attribute when defining pointers to toolkit callback functions.


GRADIENTBRUSH

typedef struct _GRADIENTBRUSH
{
COLORREF crStartColor;
COLORREF crEndColor;
L_INT uGradientSteps;
GRADIENTBRUSHSTYLE GradientStyle;
}GRADIENTBRUSH, *pGRADIENTBRUSH;

The GRADIENTBRUSH structure contains information Used to fill a closed area with a gradient of colors, using a specific style.

Member | Description
crStartColor | COLORREF value that specifies the starting color
crEndColor | COLORREF value that specifies the ending color
uGradientSteps | Number of gradient color steps. Valid values are from 2 to 256
GradientStyle | Gradient style. For valid values, refer to Effect Gradient Styles

Comments

Examples of filling styles can be seen below:

Gradient Filling:

Hatch Filling:

Pattern Filling:


HATCHBRUSH

typedef struct _HATCHBRUSH
{
HATCHBRUSHSTYLE HatchBrushStyle;
LOGPEN LogPen;
LOGBRUSH LogBrush;
L_INT nStepSize;
L_DOUBLE dLineRotAngle;
L_UINT32 dwFlags;
L_INT nPointCount;
LPPOINT pEntryPoints;
}HATCHBRUSH, *pHATCHBRUSH;

The HATCHBRUSH structure contains information for creating patterns that can be repeated to fill a closed area. This is called the hatch unit and it can be one of several predefined primary types, or it can be user defined. The primary types are: Rectangle, Circle, Triangle and Line.

Member | Description
HatchBrushStyle | Value that indicates the hatch brush style. Possible values are:
 | Value | Meaning
 | HATCH_RECTANGLE | Rectangular hatches
 | HATCH_CIRCLE | Circular hatches
 | HATCH_TRIANGLE | Triangular hatched
 | HATCH_LINE | Linear hatches
 | HATCH_CUSTOM | User defined hatches
LogPen | Windows LOGPEN structure that defines the pen properties used to draw the outlines of the filling units. For more information about this data type, please refer to Microsoft documentation of the structure LOGPEN.
LogBrush | Windows LOGBRUSH structure that defines the brush properties. used to fill the hatch units. For more information about this data type, please refer to Microsoft documentation of the structure LOGBRUSH. NOTE: the data in this structure is invalid in the case of linear hatches.
nStepSize | The hatch unit size (in device units)
dLineRotAngle | Rotation angle of the hatch lines, in degrees. This field is valid only in the case of linear hatches.
dwFlags | Flags used to control the hatch filling. Possible values are:
 | Value | Meaning
 | HATCH_BRUSH_CUSTOM_CLOSED | Close the user defined hatch. When this flag is set, the LogBrush attributes will be used to fill the user defined area.
 | HATCH_BRUSH_CUSTOM_OPEN | The user defined path is not closed. No filling will be applied to the hatch units and the LogBrush member will be ignored.
nPointCount | Number of points that specify the user defined path to be used as the hatch unit.
pEntryPoints | The user defined path points which specify the hatch units. This member should contain nPointCount elements.


PATTERNBRUSH

PATTERNHBRUSH

typedef  struct  _PATTERNBRUSH
{
BITMAPHANDLE

  PtrnBitmap;
}
PATTERNBRUSH,  *pPATTERNBRUSH;

The PATTERNBRUSH structure contains a bitmap that can be used to fill a closed area. Depending on the size of the bitmap and the size of the area to be filled, one or more instances of this bitmap may be used to fill the area.

Member | Description
PtrnBitmap | Handle to the bitmap to use to fill the area. L_LoadBitmap can be used to load an image. The bitmap handle that is used should be freed using L_FreeBitmap . The toolkit will use its own copy of the bitmap for the internal processing.


STANDARDBRUSH

typedef struct _STANDARDBRUSH
{
LOGBRUSH LogBrush;
}STANDARDBRUSH, *pSTANDARDBRUSH;

The STANDARDBRUSH structure contains information on the most commonly required filling types.

Member | Description
LogBrush | Windows LOGBRUSH structure defining the brush properties. For more information, please refer to Microsoft documentation regarding the LOGBRUSH structure.


VECTOR_ANTIALIASING

typedef struct _VECTOR_ANTIALIASING
{
L_UINT uThreshold;
L_UINT uDim;
L_UINT uFilter;

}VECTOR_ANTIALIASING, *pVECTOR_ANTIALIASING;

The VECTOR_ANTIALIASING structure is used in the vector display options to apply the anti-aliasing effect to the vector image being displayed.

Member | Description
uThreshold | Threshold value that indicates which pixels to smooth. The application of the anti-aliasing filter on the image associates a value with each pixel. Only pixels with values above this threshold are smoothed.
uDim | Value that indicates the size of the anti-aliasing mask. For example, a value of three indicates an anti-aliasing mask of 3 X 3.
uFilter | Flag that indicates the type of anti-aliasing filter to use. Possible values are:
 | Value | Meaning
 | ANTIALIAS_1 | [0x0000] Anti-alias the bitmap vertically and horizontally.
 | ANTIALIAS_2 | [0x0001] Anti-alias the bitmap in all directions.
 | ANTIALIAS_3 | [0x0002] Anti-alias the bitmap in all directions. The filter used for this option is different from the filter used for the ANTIALIAS_2 option.
 | ANTIALIAS_DIAG | [0x0003] Anti-alias the bitmap diagonally.
 | ANTIALIAS_HORZ | [0x0004] Anti-alias the bitmap horizontally.
 | ANTIALIAS_VERT | [0x0005] Anti-alias the bitmap vertically.

Comments

pVECTOR_ANTIALIASING is a pointer to a VECTOR_ANTIALIASING structure. Where the function parameter type is pVECTOR_ANTIALIASING, you can declare a VECTOR_ANTIALIASING variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTOR_ANTIALIASING variable is necessary only if your program requires a pointer.

This structure uses the data members the same way as the function L_AntiAliasBitmap . For more information about using L_AntiAliasBitmap, please refer to the LEADTOOLS Main API Help File, Ltdlln.hlp.

The VECTOR_ANTIALIASING structure is used with the VECTOR_DISPLAY_OPTIONS structure.


VECTOR_DISPLAY_OPTIONS

typedef  struct  _VECTOR_DISPLAY_OPTIONS
{
VECTOR_TEXTRENDER
  TextRender;
VECTOR_ANTIALIASING
  AntiAliasing;
L_INT  nClipMode;
L_DOUBLE  dwReserved;

}VECTOR_DISPLAY_OPTIONS,  *pVECTOR_DISPLAY_OPTIONS;

The VECTOR_DISPLAY_OPTIONS structure has the display settings for the vector toolkit. Some or all of the members can be set to apply some effects or filters to the output.

Member | Description
TextRender | Text rendering options.
AntiAliasing | Anti-aliasing setting. VECTOR_ANTIALIASING structure that contains the anti-aliasing information.
nClipMode | Flag that describes how the toolkit applies the clipping when two or more clipping polydraw objects exist. Possible values are:
 | Value | Meaning
 | VECTOR_CLIPMODE_COPY | Overwrite the old clipping region with this one.
 | VECTOR_CLIPMODE_AND | Generates a new clipping region from the intersection of the old and current regions.
 | VECTOR_CLIPMODE_DIFF | Generates a new clipping region in the area between the old and current regions.
 | VECTOR_CLIPMODE_OR | Generates a new clipping region from the area represented by both the old and current regions.
 | VECTOR_CLIPMODE_XOR | Generates a clipping region from XORing the two clipping regions (the old one and the current).
 | The "old region" refers to the region specified by a clipping polydraw that was added previously to the vector space and the "current region" is a new region that is about to be drawn.
dwReserved | Reserved for future expansion. Use 0.

Comments

pVECTOR_DISPLAY_OPTIONS is a pointer to a VECTOR_DISPLAY_OPTIONS structure. Where the function parameter type is pVECTOR_DISPLAY_OPTIONS, you can declare a VECTOR_DISPLAY_OPTIONS variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTOR_DISPLAY_OPTIONS variable is necessary only if your program requires a pointer.

The VECTOR_DISPLAY_OPTIONS structure is used with the L_VecGetDisplayOptions and L_VecSetDisplayOptions functions.

A clipping polydraw sets a clipping region that is applied to any vector object added after the clipping polydraw is added. For example, if the user adds object #1, then adds a clipping polydraw, and then adds objects #2 and #3, the toolkit will draw object #1 without modification. It will then render the clipping polydraw, which will set a clipping region. the toolkit will then draw objects #2 and #3, which will be clipped according to the clipping polydraw and the clip mode specified in nClipMode.

If nClipMode is set to 0, no clipping will be performed.


VECTOR_TEXTRENDER

typedef enum _VECTOR_TEXTRENDER
{
VECTOR_TEXTRENDER_ASTEXT = 0, // try always to render the text as text object
VECTOR_TEXTRENDER_ASCURVES // render the text always as curves and lines

} VECTOR_TEXTRENDER, *pVECTOR_TEXTRENDER;

The VECTOR_TEXTRENDER enumeration allows the user to control how the vector toolkit renders text objects.

Comments

pVECTOR_TEXTRENDER is a pointer to a VECTOR_TEXTRENDER enumeration. Where the function parameter type is pVECTOR_TEXTRENDER, you can declare a VECTOR_TEXTRENDER variable, update the enumeration’s fields, and pass the variable's address in the parameter. Declaring a pVECTOR_TEXTRENDER variable is necessary only if your program requires a pointer.

Setting the text rendering in the display options to VECTOR_TEXTRENDER_ASTEXT (default) means that the toolkit will draw the text objects as one unit. It can be useful when a text object with non-TT font is being used. VECTOR_TEXTRENDER_ASCURVES on the other hand forces the toolkit to break the text object into pieces and try to show it as a drawing.

IMPORTANT: Nothing guarantees that the toolkit will always apply this setting. Some situations should be handled in a way different from that specified by the user, so the toolkit handles them as needed, taking the user's settings into consideration.

This enumeration is used with the VECTOR_DISPLAY_OPTIONS structure.


VECTORARC

typedef struct tagVECTORARC
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
L_DOUBLE Radius;
L_DOUBLE StartAngle;
L_DOUBLE SweepAngle;
} VECTORARC, L_FAR * pVECTORARC;

The VECTORARC structure holds information about a vector arc object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the vertex of a vector arc object, about which the arc sweeps.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector arc object.
Radius | Length of the radius of the vector arc object. This value is in logical units.
StartAngle | The angle at which to begin the vector arc. Values should be between 0 and 360 degrees. Values less than 0 and greater than 360 will be modified internally.
SweepAngle | The angle through which to sweep the vector arc. Values should be between –360 and +360 degrees. Positive angles will be drawn in a counter-clockwise direction from StartAngle. Negative angles will be drawn in a clockwise direction.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_ARC.

pVECTORARC is a pointer to a VECTORARC structure.

The diagram below gives a graphical representation of of the Point, Radius, StartAngle and SweepAngle parameters.


VECTORBITMAP

typedef struct tagVECTORBITMAP
{
L_INT nSize;
BITMAPHANDLE Bitmap;
} VECTORBITMAP, L_FAR * pVECTORBITMAP;

The VECTORBITMAP structure holds information about a bitmap used to draw vector raster objects.

Member | Description
nSize | Size of this structure. Used for versioning.
Bitmap | LEADTOOLS bitmap handle.

Comments

pVECTORBITMAP is a pointer to a VECTORBITMAP structure.


VECTORBRUSH

typedef struct _VECTORBRUSH
{
L_INT nSize;
VECTORBRUSHSTYLE VectorBrushStyle;
union
{
STANDARDBRUSH StandardBrush;
HATCHBRUSH HatchBrush;
PATTERNBRUSH PatternBrush;
GRADIENTBRUSH GradientBrush;
}BrushType;
}VECTORBRUSH, L_FAR *pVECTORBRUSH;

The VECTORBRUSH structure holds information about the brush used to draw a vector object.

Member | Description
nSize | Size of this structure. Used for versioning.
VectorBrushStyle | Value that indicates the brush style. Possible values are:
 | Value | Meaning
 | VECTORBRUSH_STANDARD | Standard brush
 | VECTORBRUSH_PATTERN | Pattern brush
 | VECTORBRUSH_GRADIENT | Gradient brush
 | VECTORBRUSH_HATCH | Hatched brush
BrushType | Union of structures. The type of structure in this member depends on the value of the VectorBrushStyle member.
 | if VectorBrushStyle is: | BrushType contains a structure of type:
 | VECTORBRUSH_STANDARD | STANDARDBRUSH
 | VECTORBRUSH_PATTERN | PATTERNBRUSH
 | VECTORBRUSH_GRADIENT | GRADIENTBRUSH
 | VECTORBRUSH_HATCH | HATCHDBRUSH


VECTORCAMERA

typedef struct tagVECTORCAMERA
{
L_INT nSize;
L_DOUBLE Theta;
L_DOUBLE Phi;
VECTORPOINT LookAt;
L_DOUBLE Distance;
L_BOOL bPerspective;
} VECTORCAMERA, L_FAR * pVECTORCAMERA;

The VECTORCAMERA structure holds information about the camera.

Member | Description
nSize | Size of this structure. Used for versioning.
Theta | Rotation angle around the Z axis.
Phi | Rotation angle off the Z axis.
LookAt | Point on which the camera is focused.
Distance | Distance between the camera and the object.
bPerspective | Flag that indicates the type of projection. Possible values are:
Value | Meaning
TRUE | Perspective projection is used.
FALSE | Parallel projection is used.

Comments

The camera object is used along with the viewport to project the vector image into a 2D plane.

L_VecSetCamera and L_VecGetCamera are the functions used for manipulating the camera object.

The camera can be used with either 2D or 3D vector images.

pVECTORCAMERA is a pointer to a VECTORCAMERA object.


VECTORCIRCLE

typedef struct tagVECTORCIRCLE
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
VECTORBRUSH Brush;
L_DOUBLE Radius;
} VECTORCIRCLE, L_FAR * pVECTORCIRCLE;

The VECTORCIRCLE structure holds information about a vector circle object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the center of a vector circle object in space.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector circle object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector circle object.
Radius | Length of the radius of the vector circle object. This value is in logical units

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_CIRCLE.

pVECTORCIRCLE is a pointer to a VECTORCIRCLE structure.


VECTORCLONE

typedef  struct  tagVECTORCLONE
{
VECTOROBJECT
  Object;
VECTORPOINT  Point;
VECTORGROUP  Group;
L_UINT32  dwFlags;
VECTORPEN  Pen;
VECTORBRUSH  Brush;
VECTORPOINT  Scale;
VECTORPOINT  Rotation;
}  VECTORCLONE,  L_FAR  *
  pVECTORCLONE;

The VECTORCLONE structure holds information about a vector clone object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the center of a vector clone object in space.
Group | A VECTORGROUP structure that contains the group this clone will be using.
dwFlags | Flag that indicates how to draw this clone object. Possible values are:

 | Value | Meaning
 | VECTOR_CLONE_USE_PEN | Use the Pen member of this structure to draw the clone. If this flag is not specified, the clone will use the same pen colors and styles as the original objects inside the group.
 | VECTOR_CLONE_USE_BRUSH | Use the Brush member of this structure to draw the clone. If this flag is not specified, the clone will use the same brush colors and styles as the original objects inside the group.
 | VECTOR_CLONE_USE_POINT_AS_ORIGIN | Use the Point member as the origin point when performing Scaling and Rotation. If this flag is not specified, the Scaling and Rotation will be performed around the accumulative center of all objects inside the group.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector clone object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector clone object.
Scale | A VECTORPOINT structure that contains the scaling factor to use when drawing this clone object.
Rotation | A VECTORPOINT structure that contains the rotation values to use when drawing this clone object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_CLONE.

When drawing a clone object, the toolkit will first rotate the group around its origin using the values in Rotation, scale it around its origin using the values in Scale and finally translate it to the position specified in Point.

pVECTORCLONE is a pointer to a VECTORCLONE structure.


VECTORELLIPSE

typedef struct tagVECTORELLIPSE
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
VECTORBRUSH Brush;
L_DOUBLE xRadius;
L_DOUBLE yRadius;
} VECTORELLIPSE, L_FAR * pVECTORELLIPSE;

The VECTORELLIPSE structure holds information about a vector ellipse object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the center of a vector ellipse object in space.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector ellipse object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector ellipse object.
xRadius | Length of the radius of the x- axis. This value is in logical units.
yRadius | Length of the radius of the y- axis. This value is in logical units.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_ELLIPSE.

pVECTORELLIPSE is a pointer to a VECTORELLIPSE structure.


VECTORELLIPTICALARC

typedef struct tagVECTORELLIPTICALARC
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
L_DOUBLE xRadius;
L_DOUBLE yRadius;
L_DOUBLE StartAngle;
L_DOUBLE SweepAngle;
} VECTORELLIPTICALARC, L_FAR * pVECTORELLIPTICALARC;

The VECTORELLIPTICALARC structure holds information about a vector elliptical arc object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the vertex of a vector elliptical arc object, about which the arc sweeps.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector elliptical arc object.
xRadius | Length of the radius of the x- axis. This value is in logical units.
yRadius | Length of the radius of the y- axis. This value is in logical units.
StartAngle | The angle at which to begin the vector elliptical arc. Values should be between 0 and 360 degrees. Values less than 0 and greater than 360 will be modified internally.
SweepAngle | The angle through which to sweep the vector elliptical arc. Values should be between –360 and +360 degrees. Positive angles will be drawn in a counter-clockwise direction from StartAngle. Negative angles will be drawn in a clockwise direction.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_ELLIPTICALARC.

pVECTORELLIPTICALARC is a pointer to a VECTORELLIPTICALARC structure.


VECTOREVENT

typedef  struct  tagVECTOREVENT
{
L_INT  nSize;
L_UINT  uType;
VECTOR_ENUM_STATUS  Status;
L_INT  nErrorCode;
pVECTOROBJECT  pObject;
L_VOID  L_FAR
  *pObjectDesc;
pVECTORLAYER  pLayer;
pVECTORLAYERDESC
  pLayerDesc;
pVECTORGROUP  pGroup;
pVECTORGROUPDESC
  pGroupDesc;
pVECTORPOINT  pPoint1;
pVECTORPOINT  pPoint2;
L_UINT32  dwFlags;
L_VOID  L_FAR
  *pUserData;
}  VECTOREVENT,  L_FAR  *
  pVECTOREVENT;

The VECTOREVENT structure holds information about an event.

Member | Description
nSize | Size of this structure. Used for versioning.
uType | The type of event that was generated. For a list of possible values, refer to the Comments section below.
Status | Status of the event. Possible values are:
 | Value | Meaning
 | VECTOR_EVENT_STATUS_BEFORE | The action that generated the event is about to be taken.
 | VECTOR_EVENT_STATUS_AFTER | The action that generated the event was just completed.
nErrorCode | Error code associated with the event. For a list of possible values, refer to the Return Codes.
pObject | Pointer to the vector object associated with the event. This structure member is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pObjectDesc | Pointer to an object descriptor. This structure is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pLayer | Pointer to the vector layer associated with the event. This structure member is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pLayerDesc | Pointer to a layer descriptor. This structure is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pGroup | Pointer to the vector group associated with the event. This structure member is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pGroupDesc | Pointer to a group descriptor. This structure is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pPoint1 | Pointer to a general point 1. This structure is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pPoint2 | Pointer to a general point 2. This structure is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
dwFlags | Flag that provides processing information. This member is only valid for certain event types. For a list of the events for which this member is valid, refer to the table in the Comments section below.
pUserData | User defined data.

Comments

The uType member will correspond to the vector function called, for example if you call L_VecSetObject, an event of type VECTOR_EVENT_SETOBJECT will be fired.

The following table lists all the defined event types plus values for the structure variables, when defined. Not all structure members are defined for every event. For example, the Object pObject member is not defined for a VECTOR_EVENT_FREE event, but it is defined for the VECTOR_EVENT_TRANSLATION event. The pObject structure member is the same as the L_VecSetTranslation function.

Event (uType)

Function

pObject

pObjectDesc

pLayer

pLayerDesc

pGroup

pGroupDesc

pPoint1

pPoint2

dwFlags

VECTOR_EVENT_FREE

L_VecFree

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_EMPTY

L_VecEmpty

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_COPY

L_VecCopy

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_VIEWPORT

L_VecSetViewport

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_PAN

L_VecSetPan

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_LOCKED

L_VecSetLocked

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

bLocked

VECTOR_EVENT_BACKGROUND

L_VecSetBackground

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Color

VECTOR_EVENT_PALETTE

L_VecSetPalette

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_VIEWMODE

L_VecSetViewMode

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

nViewMode

VECTOR_EVENT_TRANSLATION

L_VecSetTranslation

pObject

Not used

Not used

Not used

Not used

Not used

pTranslation

Not used

dwFlags

VECTOR_EVENT_ROTATION

L_VecSetRotation

pObject

Not used

Not used

Not used

Not used

Not used

pRotation

pOrigin

dwFlags

VECTOR_EVENT_SCALE

L_VecSetScale

pObject

Not used

Not used

Not used

Not used

Not used

pScale

pOrigin

dwFlags

VECTOR_EVENT_ORIGIN

L_VecSetOrigin

Not used

Not used

Not used

Not used

Not used

Not used

pOrigin

Not used

Not used

VECTOR_EVENT_APPLYTRANSFORMATION

L_VecApplyTransformation

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_BINDVERTICESMODE

L_VecBindVertices

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

nBindMode

VECTOR_EVENT_PARALLELOGRAM

L_VecSetParallelogram

Not used

Not used

Not used

Not used

Not used

Not used

pMin

pMax

Not used

VECTOR_EVENT_CAMERA

L_VecSetCamera

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_METAFILE

L_VecConvertFromEMF

L_VecConvertFromWMF

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_ATTACHTOWINDOW

L_VecAttachToWindow

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_MARKER

L_VecSetMarker

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_HITTEST

L_VecSetHitTest

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_POLYGONMODE

L_VecSetPolygonMode

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

nPolygonMode

VECTOR_EVENT_USELIGHTS

L_VecSetUseLights

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

bUseLights

VECTOR_EVENT_AMBIENTCOLOR

L_VecSetAmbientColor

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Color

VECTOR_EVENT_COPYFROMCLIPBOARD

L_VecCopyFromClipboard

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_ADDLAYER

L_VecAddLayer

Not used

Not used

pLayer

pLayerDesc

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_DELETELAYER

L_VecDeleteLayer

Not used

Not used

pLayer

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_EMPTYLAYER

L_VecEmptyLayer

Not used

Not used

pLayer

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_COPYLAYER

L_VecCopyLayer

Not used

Not used

pLayerDst

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_SETLAYER

L_VecSetLayer

Not used

Not used

pLayer

pLayerDesc

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_SETACTIVELAYER

L_VecSetActiveLayer

Not used

Not used

pLayer

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_ADDGROUP

L_VecAddGroup

Not used

Not uesd

Not uesd

Not used

pGroup

pGroupDesc

Not used

Not used

dwFlags

VECTOR_EVENT_DELETEGROUP

L_VecDeleteGroup

Not used

Not used

Not used

Not used

pGroup

Not used

Not used

Not used

Not uesd

VECTOR_EVENT_DELETEGROUPCLONES

L_VecDeleteGroupClones

Not used

Not used

Not used

Not uesd

pGroup

Not uesd

Not used

Not used

dwFlags

VECTOR_EVENT_EMPTYGROUP

L_VecEmptyGroup

Not uesd

Not uesd

Not used

Not used

pGroup

Not used

Not used

Not used

Not uesd

VECTOR_EVENT_COPYGROUP

L_VecCopyGroup

Not uesd

Not used

Not used

Not used

pGroupDst

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_SETGROUP

L_VecSetGroup

Not used

Not used

Not used

Not used

pGroup

pGroupDesc

Not used

Not used

Not used

VECTOR_EVENT_ADDOBJECT

L_VecAddObject

pObject

pObjectDesc

pLayer

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_DELETEOBJECT

L_VecDeleteObject

pObject

Not used

Not used

Not used

Not used

Not used

Not used

Not used

DwFlags

VECTOR_EVENT_COPYOBJECT

L_VecCopyObject

pObjectDst

Not used

Not used

pLayerDst

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_SETOBJECT

L_VecSetObject

pObject

pObjectDesc

Not used

Not used

Not used

Not used

Not used

Not used

nType

VECTOR_EVENT_EXPLODEOBJECT

L_VecExplodeObject

pObject

Not used

Not used

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_SELECTOBJECT

L_VecSelectObject

pObject

Not used

Not used

Not used

Not used

Not used

Not used

Not used

bSelect

VECTOR_EVENT_OBJECTATTRIBUTES

L_VecSetObjectAttributes

pObject

Not used

Not used

Not used

Not used

Not used

Not used

Not used

dwFlags

VECTOR_EVENT_LOADFILE

L_VecLoadFile

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_ADDOBJECTTOGROUP

L_VecAddObjectToGroup

pObject

pObjectDesc

Not used

Not used

pGroup

Not used

Not used

Not used

Not used

VECTOR_EVENT_CREATENEWWINDOW

L_VecGotoHyperlink

Not used

pObjectDesc

Not used

Not used

Not used

Not used

Not used

Not used

Not used

VECTOR_EVENT_INVERTCOLORS

L_VecInvertColors

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

Not used

The events VECTOR_EVENT_USER to (VECTOR_EVENT_RESRVED-1) are user-defined. You can use any of these values when implementing your own events using L_VecEvent.

Note that when using Vector automation, dwFlags should be ORed with VECTOR_FLAGS_ADD_UNDO_NODE in order for the event to add an undo node.

pVECTOREVENT is a pointer to a VECTOREVENT structure.


VECTORFONT

typedef struct tagVECTORFONT
{
L_INT nSize;
LOGFONT LogFont;
} VECTORFONT, L_FAR * pVECTORFONT;

The VECTORFONT structure holds information about the font used to draw vector text objects.

Member | Description
nSize | Size of this structure. Used for versioning.
LogFont | Windows LOGFONT structure that defines the font properties.

Comments

pVECTORFONT is a pointer to a VECTORFONT structure.


VECTORGROUP

The VECTORGROUP structure serves as a working area for vector groups. LEADTOOLS functions use this structure as a vector group handle for accessing a vector group within a vector handle.

Note:

All fields of this structure are intended for internal use. If necessary, you can refer to the LVKRN.H header file, which describes the entire structure.

pVECTORGROUP is a pointer to a VECTORGROUP structure.

In all cases, the values of the fields in the VECTORGROUP structure are maintained by LEADTOOLS functions.

The following functions use the VECTORGROUP structure:

L_VecAddGroup

L_VecAddObjectToGroup

L_VecCopyGroup

L_VecDeleteGroup

L_VecDeleteGroupClones

L_VecDlgEditAllGroups

L_VecDlgEditGroup

L_VecDlgNewGroup

L_VecEmptyGroup

L_VecEnumGroups

L_VecEnumObjectsInGroup

L_VecFreeGroup

L_VecGetGroup

L_VecGetGroupByIndex

L_VecGetGroupByName

L_VecGetGroupCount

L_VecSetGroup


VECTORGROUPDESC

typedef struct tagVECTORGROUPDESC
{
L_INT nSize;
L_TCHAR szName[VECTOR_MAX_NAME];
L_UINT32 dwTag;
} VECTORGROUPDESC, L_FAR * pVECTORGROUPDESC;

The VECTORGROUPDESC structure holds descriptive information about a vector group in a vector handle.

Member | Description
nSize | Size of this structure. Used for versioning.
szName | Character string that contains the name of the group.
dwTag | User-defined tag.

Comments

pVECTORGROUPDESC is a pointer to a VECTORGROUPDESC structure.

The following functions use a VECTORGROUPDESC structure:

L_VecAddGroup

L_VecDlgEditGroup

L_VecDlgNewGroup

L_VecFreeGroup

L_VecGetGroup

L_VecSetGroup


VECTORHANDLE

The VECTORHANDLE structure serves as a working area for vector image manipulation and conversion. LEADTOOLS functions use this structure as a vector image handle for accessing the drawing in memory and for maintaining the characteristics of the vector image.

Note:

All fields of this structure are intended for internal use. If necessary, you can refer to the LVKRN.H header file which describes the entire structure.

pVECTORHANDLE is a pointer to a VECTORHANDLE structure. Generally, where a function parameter type is pVECTORHANDLE, you can declare a VECTORHANDLE variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTORHANDLE variable is necessary only if your program requires a pointer.

In all cases, the values of fields in the VECTORHANDLE structure are maintained by LEADTOOLS functions.


VECTORHITTEST

typedef  struct  tagVECTORHITTEST
{
L_INT  nSize;
L_INT  nDistance;
L_UINT32  dwFlags;
}  VECTORHITTEST,  L_FAR  *
  pVECTORHITTEST;

The VECTORHITTEST structure holds information about hit test options.

Member | Description
nSize | Size of this structure. Used for versioning.
nDistance | Distance from the point, in pixels. This value indicates how close the point must be to an object in order to "hit" the object.
dwFlags | Flag that determines which objects to consider when hit testing. Possible values are:
 | Value | Meaning
 | VECTOR_HITTEST_CLOSEDFIGURES | Determine whether the hit test point is inside closed objects.
 | VECTOR_HITTEST_IGNORESELECTED | Do not test objects that are already selected.

Comments

L_VecGetHitTest and L_VecSetHitTest get and set the current hit test options. L_VecHitTest actually performs the hit test.

The hit test options must be set before calling L_VecHitTest.

pVECTORHITTEST is a pointer to a VECTORHITTEST structure.


VECTORLAYER

The VECTORLAYER structure serves as a working area for vector layers. LEADTOOLS functions use this structure as a vector layer handle for accessing a vector layer within a vector handle.

Note:

All fields of this structure are intended for internal use. If necessary, you can refer to the LVKRN.H header file which describes the entire structure.

pVECTORLAYER is a pointer to a VECTORLAYER structure.

In all cases, the values of fields in the VECTORLAYER structure are maintained by LEADTOOLS functions.

The following functions use the VECTORLAYER structure:

L_VecAddLayer

L_VecAddObject

L_VecCopyLayer

L_VecCopyObject

L_VecDlgEditLayer

L_VecDlgNewLayer

L_VecDlgNewObject

L_VecEmptyLayer

L_VecEnumObjectsInLayer

L_VecGetActiveLayer

L_VecGetLayer

L_VecGetLayerByIndex

L_VecGetLayerByName

L_VecSetActiveLayer

L_VecSetLayer


VECTORLAYERDESC

typedef struct tagVECTORLAYERDESC
{
L_INT nSize;
L_TCHAR szName[VECTOR_MAX_NAME];
L_BOOL bVisible;
L_BOOL bLocked;
L_UINT32 dwTag;
} VECTORLAYERDESC, L_FAR * pVECTORLAYERDESC;

The VECTORLAYERDESC structure holds descriptive information about about a vector layer in a vector handle.

Member | Description
nSize | Size of this structure. Used for versioning.
szName | Character string that contains the name of the layer.
bVisible | Flag that indicates whether or not the layer is visible. Possible values are:
 | Value | Meaning
 | TRUE | The layer is visible.
 | FALSE | The layer is not visible.
bLocked | Flag that indicates whether or not the layer is locked. A layer cannot be edited if it is locked. Possible values are:
 | Value | Meaning
 | TRUE | The layer is locked.
 | FALSE | The layer is not locked.
dwTag | User-defined tag.

Comments

pVECTORLAYERDESC is a pointer to a VECTORLAYERDESC structure.

The following functions use a VECTORLAYERDESC structure:

L_VecAddLayer

L_VecDlgEditLayer

L_VecDlgNewLayer

L_VecFreeLayer

L_VecGetLayer

L_VecSetLayer


VECTORLINE

typedef struct tagVECTORLINE
{
VECTOROBJECT Object;
VECTORPOINT Point[2];
VECTORPEN Pen;
} VECTORLINE, L_FAR * pVECTORLINE;

The VECTORLINE structure holds information about a vector line object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the beginning and ending points of a line in space.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector line object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_LINE.

pVECTORLINE is a pointer to a VECTORLINE structure.


VECTORLINKDESC

typedef struct _VECTORLINKDESC
{
L_BOOL bObject; // TRUE means the link points to a vector object

union
{
struct
{
VECTOROBJECT target; // the target object if bObject is TRUE
VECTORLINKHANDLING handling; // specifys how the toolkit will handle link activation
}vectorobject;

struct
{
VECTORLINKFILEINFO target; // information about the target file if bObject is FALSE
HWND hwndParent; // Parent window if ( handling ) is VECTORLINKHANDLING_NEWWINDOW or if target is a file
}fileobject;
}tar;

}VECTORLINKDESC, *pVECTORLINKDESC;

The VECTORLINKDESC structure is required to set the target type of a hyperlink object in the Vector toolkit.

Member | Description
bObject | Flag that indicates whether the Vector object will be displayed or information about the target will be activated when the hyperlinked vector object is clicked. Possible values are:
 | Value | Meaning
 | TRUE | A vector object will be displayed when the hyperlinked vector object is clicked. This vector object is contained in the target member of the vectorobject struct.
 | FALSE | Only information about the target will be displayed when the hyperlinked vector object is clicked. This information is contained in the VECTORLINKFILEINFO member of the fileobject struct.
target | Vector object that will be displayed when the hyperlinked vector object is clicked. Valid if bObject is TRUE.
handling | VECTORLINKHANDLING value that indicates how the link activation will be handled. Valid if bObject is TRUE.
target | Information about the target that will be activated when the hyperlinked vector object is clicked. Valid if bObject is FALSE.
hwndParent | Handle to the parent window which will host the new application that will start when the hyperlinked vector object is clicked.

Comments

pVECTORLINKDESC is a pointer to a VECTORLINKDESC structure. Where the function parameter type is pVECTORLINKDESC, you can declare a VECTORLINKDESC variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTORLINKDESC variable is necessary only if your program requires a pointer.

The VECTORLINKDESC structure is used with the following functions:

L_VecAddHyperlink

L_VecGetHyperlink

L_VecSetHyperlink


VECTORLINKFILEINFO

typedef struct _VECTORLINKFILEINFO
{
L_TCHAR szPath[L_MAXPATH]; // path to the file

}VECTORLINKFILEINFO, *pVECTORLINKFILEINFO;

The VECTORLINKFILEINFO structure contains the path of the target file assigned to a hyperlinked vector object.

Member | Description
szPath | Character string that contains the URL for the file that will be opened when the hyperlinked vector object is clicked.

Comments

pVECTORLINKFILEINFO is a pointer to a VECTORLINKFILEINFO structure. Where the function parameter type is pVECTORLINKFILEINFO, you can declare a VECTORLINKFILEINFO variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTORLINKFILEINFO variable is necessary only if your program requires a pointer.

A hyperlinked vector object can be assigned a target file. The vector toolkit opens the specified file whenever the end-user clicks on the hyperlinked vector object. Currently, clicking an object is the only event available.

The VECTORLINKFILEINFO structure is used with the VECTORLINKDESC structure.


VECTORLINKHANDLING

typedef enum _VECTORLINKHANDLING
{
VECTORLINKHANDLING_CURRENTWINDOW = 0, // open in the current window
VECTORLINKHANDLING_NEWWINDOW // open in a new window

} VECTORLINKHANDLING, *pVECTORLINKHANDLING;

This enumeration determines where to show the target of the hyperlinked vector object.

Comments

pVECTORLINKHANDLING is a pointer to a VECTORLINKHANDLING structure. Where the function parameter type is pVECTORLINKHANDLING, you can declare a VECTORLINKHANDLING variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTORLINKHANDLING variable is necessary only if your program requires a pointer.

The vector toolkit will display the target object in the current window if the type VECTORLINKHANDLING_CURRENTWINDOW is used. Otherwise, it will send an event VECTOR_EVENT_CREATENEWWINDOW to the VECTOREVENTPROC callback function, which should be handled by the user to create a new window and display the required object inside it.

This enumeration is used with the VECTORLINKDESC structure.


VECTORMARKER

typedef  struct  tagVECTORMARKER
{
L_INT  nSize;
L_UINT32  dwFlags;
VECTORPEN  Pen;
VECTORBRUSH  Brush;
}  VECTORMARKER,  L_FAR  *
  pVECTORMARKER;

The VECTORMARKER structure holds information about marker settings.

Member | Description
nSize | Size of this structure. Used for versioning.
dwFlags | Flag that determines the brush and pen characteristics to use for the marker. Possible values are:
 | Value | Meaning
 | VECTOR_MARKER_PEN_STYLE | Use the style member of Pen.
 | VECTOR_MARKER_PEN_WIDTH | Use the width member of Pen.
 | VECTOR_MARKER_PEN_COLOR | Use the color member of Pen.
 | VECTOR_MARKER_BRUSH_STYLE | Use the style member of Brush.
 | VECTOR_MARKER_BRUSH_COLOR | Use the color member of Brush.
Pen | VECTORPEN structure that contains information about the pen to use when drawing markers. The actual parameters used depends on dwFlags.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing markers. The actual parameters used depends on dwFlags.

Comments

Markers are used to indicate which objects have been selected in a vector handle.

pVECTORMARKER is a pointer to a VECTORMARKER structure.


VECTOROBJECT

typedef  struct  tagVECTOROBJECT
{
L_INT  nSize;
L_INT  nType;
L_INT  nId;
L_INT  nLayerId;
L_INT  nGroupId;
L_INT  nROP;
L_UINT32  dwFlags;
L_UINT32  dwTag;
}  VECTOROBJECT,  L_FAR  *
  pVECTOROBJECT;

The VECTOROBJECT structure is an abstract data type that acts as the base of all 2D/3D objects in the toolkit.

Member | Description
nSize | Size of this structure. Used for versioning.
nType | Type of vector object. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
 | VECTOR_SPLINE | Spline object.
 | VECTOR_HPOLYBEZIER | Heterogeneous Poly Bezier
nId | Object ID. Reserved for internal use.
nLayerId | Layer ID. Reserved for internal use.
nGroupId | Group ID. Reserved for internal use.
nROP | The object's ROP mode. For more information on valid ROP2 codes, refer to your SDK.
dwFlags | Flag that indicates the status of the object, can be a combination of the following:
 | Value | Meaning
 | VECTOR_OBJECT_SELECTED | The object is currently selected.
 | VECTOR_OBJECT_HIDDEN | The object is currently hidden.
 | VECTOR_OBJECT_COMPOSITE | This object is part of a group.
 | VECTOR_OBJECT_2STAGE_RENDERING | Forces two-stage rendering for objects. This flag is valid only for VECTORCIRCLE, VECTORELLIPSE, VECTORPIE, VECTORTEXT and VECTORPOLYDRAW, if used in any other object type; it will be ignored by the toolkit.
 | VECTOR_OBJECT_CLIP | Sets the object as a clipping object. Valid only for VECTORPOLYDRAW object.
 | VECTOR_POLYDRAW_FILL_WINDING | Use non-zero mode for filling the polydraw, Valid only for VECTORPOLYDRAW object.
 | VECTOR_POLYDRAW_FILL_ALTERNATE | Use odd-even mode for filling the polydraw, Valid only for VECTORPOLYDRAW object.
dwTag | User-defined tag.

Comments

pVECTOROBJECT is a pointer to a VECTOROBJECT structure.


VECTORPEN

typedef  struct  _VECTORPEN
{
L_INT  nSize;
union
{
LOGPEN
  LogPen;
EXTLOGPEN
  ExtLogPen;
}NewPen;
DWORD  elpStyleEntry[7];
L_BOOL  bExtPen;
}VECTORPEN,  L_FAR  *pVECTORPEN;

The VECTORPEN structure holds information about a pen used to draw a vector object.

Member | Description
nSize | Size of this structure. Used for versioning.
NewPen | Union of LOGPEN and EXTLOGPEN structures. THe type of structure in this member depends on the values of the bExtPen member. For more information about the LOGPEN and EXTLOGPEN structures, please refer to the Microsoft documentation.
elpStyleEntry | Valid only if bExtPen is TRUE. ExtLogPen allows the user to draw customized hatched lines. Using the elpStyleEntry element defined in ExtLogPen, the user can fill up to 8 dash elements. Please refer to Microsoft documentation regarding the EXTLOGPEN for more information about this.
bExtPen | Boolean flag that indicates the type of pen to use and the type of structure in the NewPen member. Possible values are: TRUE: the vector pen describes a EXTLOGPEN structure. FALSE: the vector pen describes a LOGPEN structure.
 | Value | Meaning
 | TRUE | The vector pen is an ExtLogPen and the NewPen member contains an EXTLOGPEN structure.
 | FALSE | The vector pen is an LogPen and the NewPen member contains a LOGPEN structure.


VECTORPIE / VECTORCHORD

typedef struct tagVECTORPIE
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
VECTORBRUSH Brush;
L_DOUBLE Radius;
L_DOUBLE StartAngle;
L_DOUBLE SweepAngle;
} VECTORPIE, L_FAR * pVECTORPIE, VECTORCHORD, L_FAR * pVECTORCHORD;

The VECTORPIE structure holds information about a vector arc object.

The VECTORCHORD structure holds information about a vector chord object.

Member | Description
Object | Abstract object.
Point | A VECTORPOINT structure that contains the vertex of a vector pie object, about which the pie section or chord sweeps.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector pie or vector chord object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector pie or vector chord object.
Radius | Length of the radius of the vector pie or vector chord object. This value is in logical units.
StartAngle | The angle at which to begin the vector pie or vector chord. Values should be between 0 and 360 degrees. Values less than 0 and greater than 360 will be modified internally.
SweepAngle | The angle through which to sweep the vector pie or vector chord. Values should be between –360 and +360 degrees. Positive angles will be drawn in a counter-clockwise direction from StartAngle. Negative angles will be drawn in a clockwise direction.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_PIE or VECTOR_CHORD.

pVECTORPIE is a pointer to a VECTORPIE structure.

pVECTORCHORD is a pointer to a VECTORCHORD structure.

The diagram below gives a graphical representation of of the Point, Radius, StartAngle and SweepAngle parameters.


VECTORPOINT

typedef struct tagVECTORPOINT
{
L_DOUBLE x;
L_DOUBLE y;
L_DOUBLE z;
L_INT32 lTag;
} VECTORPOINT, L_FAR * pVECTORPOINT;

The VECTORPOINT structure holds information about a point in 3D space.

Member | Description
x | X coordinate of the point.
y | Y coordinate of the point.
z | Z coordinate of the point.
lTag | User-defined data. In the toolkit this member is used for reference count. Reserved for internal use.

Comments

This is the primitive data type in the toolkit.

pVECTORPOINT is a pointer to a VECTORPOINT structure.


VECTORPOLYBEZIER

VECTORHPOLYBEZIER

typedef struct _VECTORHPOLYBEZIER
{
VECTOROBJECT Object;
VECTORPOINT *Point;
L_INT nSecCount;
VECTORPEN Pen;
L_UINT *puDegree;
}VECTORHPOLYBEZIER, L_FAR *pVECTORHPOLYBEZIER;

The VECTORHPOLYBEZIER structure holds information about the heterogeneous polybezier or HPolyBezier for short. The HPolyBezier is a group of polybeziers with different degrees drawn together as a single entity.

Member | Description
Object | Abstract object.
Point | Pointer to an array of points. The number of points should be: ( puDegree[ 0 ] + puDegree[ 1 ] + … + puDegree[ nSecCount – 1 ] ) + 1
nSecCount | Number of sections in the HPolyBezier
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector polybezier object.
puDegree | Pointer to an array of PolyBezier degrees.


VECTORPOLYDRAW

typedef  struct  tagVECTORPOLYDRAW
{
VECTOROBJECT  Object;
VECTORPOINT  *  Point;
L_INT  nPointCount;
L_UCHAR  L_FAR
  *pbyType;
VECTORPEN  Pen;
VECTORBRUSH  Brush;
}  VECTORPOLYDRAW,  L_FAR  *
  pVECTORPOLYDRAW;

The VECTORPOLYDRAW structure holds information about a vector polydraw object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the points that define a vector polydraw object in space.
nPointCount | Number of points in the array.
pbyType | Pointer to an array that specifies how each point in the Point array is used. The values given below behave like the PT_MOVETO, PT_LINETO, PT_BEZIERTO and PT_CLOSEFIGURE values under PolyDraw in the Microsoft SDK. For a more detailed explanation, refer to the Microsoft SDK documentation. Possible values are:
 | Value | Meaning
 | VECTOR_PT_MOVETO | Beginning of a disjoint figure. This will be the new current position.
 | VECTOR_PT_LINETO | Draw a line from the current position to this point. This point becomes the new current position.
 | VECTOR_PT_BEZIERTO | Control point or end point for a Bézier curve. These occur in threes. The first two are control points and the third is the end point. For more information, refer to the Microsoft SDK documentation.
 | VECTOR_PT_CLOSEFIGURE | Automatically close the figure after VECTOR_PT_LINETO or VECTOR_PT_BEZIERTO is done. This can be combined with VECTOR_PT_LINETO or VECTOR_PT_BEZIERTO using a bitwise OR.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector polydraw object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector polydraw object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_POLYDRAW.

pVECTORPOLYDRAW is a pointer to a VECTORPOLYDRAW structure.


VECTORPOLYGON

typedef  struct  tagVECTORCURVECLOSED
{
VECTOROBJECT  Object;
VECTORPOINT  *  Point;
L_INT  nPointCount;
VECTORPEN  Pen;
VECTORBRUSH  Brush;
L_INT  nPolyFillMode;
}  VECTORCURVECLOSED,  L_FAR
  *  pVECTORCURVECLOSED,  VECTORPOLYGON,  L_FAR
  *  pVECTORPOLYGON;

The VECTORPOLYGON structure holds information about a vector polygon object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the points that define a vector polygon object in space.
nPointCount | Number of points in the array.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector polygon object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector polygon object.
nPolyFillMode | Flag that indicates how to handle complex crossing lines. The following are valid values, which are illustrated below:
 | Value | Meaning
 | VECTOR_POLY_WINDING | [0] All pixels that are inside the resulting exterior lines are in the region.
 | VECTOR_POLY_ALTERNATE | [1] The region includes the area between odd-numbered and even-numbered polygon sides on each scan line.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_POLYGON.

pVECTORPOLYGON is a pointer to a VECTORPOLYGON structure.


VECTORPOLYLINE / POLYBEZIER

VECTORPOLYLINE / VECTORPOLYBEZIER

typedef struct tagVECTORCURVEOPENED
{
VECTOROBJECT Object;
VECTORPOINT * Point;
L_INT nPointCount;
VECTORPEN Pen;
} VECTORCURVEOPENED, L_FAR * pVECTORCURVEOPENED, VECTORPOLYLINE, L_FAR * pVECTORPOLYLINE, VECTORPOLYBEZIER, L_FAR * pVECTORPOLYBEZIER;

The VECTORPOLYLINE structure holds information about a vector polyline object.

The VECTORPOLYBEZIER structure holds information about a vector poly Bezier curve object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the points that define a polyline or polybezier curve in space.
nPointCount | Number of points in the array.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector polyline or polybezier object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_POLYLINE or VECTOR_POLYBEZIER.

pVECTORPOLYLINE is a pointer to a VECTORPOLYLINE structure.

pVECTORPOLYBEZIER is a pointer to a VECTORPOLYBEZIER structure.


VECTORRASTER

typedef struct tagVECTORRASTER
{
VECTOROBJECT Object;
VECTORPOINT Point[2];
VECTORBITMAP Bitmap;
} VECTORRASTER, L_FAR * pVECTORRASTER;

The VECTORRASTER structure holds information about a raster object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the defining points of a bounding rectangle. Point[0] contains the top left position and Point[1] contains the bottom right position.
Bitmap | VECTORBITMAP structure that contains the bitmap image to draw.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_RASTER.

The OpenGL and DirectX engines give optimal performance when working with 3D raster images.

For more information about setting the vector engine, refer to L_VecAttachToWindows.

For more information about vector objects, refer to Working with Vector Objects.

pVECTORRASTER is a pointer to a VECTORRASTER structure.


VECTORRECTANGLE

typedef struct tagVECTORRECTANGLE
{
VECTOROBJECT Object;
VECTORPOINT Point[2];
VECTORPEN Pen;
VECTORBRUSH Brush;
} VECTORRECTANGLE, L_FAR * pVECTORRECTANGLE;

The VECTORRECTANGLE structure holds information about a vector rectangle object.

Member | Description
Object | Abstract object.
Point | An array of VECTORPOINT structures that contain the beginning and ending points of the diagonal of a rectangle in space.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector line object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector line object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_RECTANGLE.

pVECTORRECTANGLE is a pointer to a VECTORRECTANGLE structure.


VECTORSPLINE

typedef struct _VECTORPOLYBEZIERSPLINE
{
VECTOROBJECT Object;
VECTORPOINT *Point;
L_INT nPointCount;
VECTORPEN Pen;
L_UINT32 dwFlags;
} VECTORSPLINE, L_FAR *pVECTORSPLINE;

The VECTORSPLINE structure holds information about the spline object.

Member | Description
Object | Abstract object.
Point | Pointer to an array of points which controls the spline’s path depnding on the spline type. The number of points should be: ( puDegree[ 0 ] + puDegree[ 1 ] + … + puDegree[ nSecCount – 1 ] ) + 1
nPointCount | Number of points in the points
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector spline object
dwFlags | Flag that indicates the mode in which to draw the spline. Possible values are:
 | Value | Meaning
 | VECTOR_SPLINE_FITPOINTS | Sets the spline mode to Fit Points. This is the default.
 | VECTOR_SPLINE_CONTROLPOINTS | Sets the spline mode to Control Points.

Comments

The spline can be drawn in two modes:

Fit Points: The spline path MUST pass through each and every point specified.

Control Points: The points are used to control the spline path, but not necessarily pass through all of them.


VECTORSTOCK

typedef struct tagVECTORSTOCK
{
VECTOROBJECT Object;
L_INT nId;
HINSTANCE hInstDLL;
L_CHAR L_FAR * pszDLLName;
VECTORPOINT Point[2];
VECTORPEN Pen;
VECTORBRUSH Brush;
} VECTORSTOCK, L_FAR * pVECTORSTOCK;

The VECTORSTOCK structure holds information about a vector stock object.

Member | Description
Object | Abstract object.
nId | Stock object ID in its DLL. The documentation for the stock object DLL should include valid object IDs.
hInstDLL | Instance handle of the stock object DLL. This can be NULL only if pszDLLName is not NULL.
pszDLLName | Character string that contains the name of the stock object DLL. This can be NULL only if hInstDLL is not NULL.
Point | Array of VECTORPOINT structures that contains the vertices of the bounding parallelogram.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector stock object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector stock object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_STOCK.

Either hInstDLL or pszDLLName can be NULL. They cannot both be NULL. If hInstDLL is not NULL, the toolkit will load the requested object from this DLL handle. If hInstDLL is NULL, the toolkit will assume that pszDLLName indicates the complete path to the requested library.

pVECTORSTOCK is a pointer to a VECTORSTOCK structure.


VECTORTEXT

typedef  struct  tagVECTORTEXT
{
VECTOROBJECT  Object;
VECTORPOINT  Point;
L_TCHAR  L_FAR
  *  pszText;
L_UINT32  dwFlags;
L_DOUBLE  CharHeight;
L_DOUBLE  CharWidth;
VECTORPEN  Pen;
VECTORBRUSH  Brush;
VECTORFONT  Font;
}  VECTORTEXT,  L_FAR  *
  pVECTORTEXT;

The VECTORTEXT structure holds information about a vector text object.

Member | Description
Object | Abstract object.
Point | Insertion point for the text.
pszText | Character string that contains the text to insert.
dwFlags | Flag that indicates how to position the text and how to handle text when hit testing. Possible values are:
 | Value | Meaning
 | VECTOR_TEXT_LEFT | Align text to the left of the insertion point.
 | VECTOR_TEXT_RIGHT | Align text to the right of the insertion point.
 | VECTOR_TEXT_HCENTER | Center text horizontally on the insertion point.
 | VECTOR_TEXT_TOP | Align text to the top of the insertion point.
 | VECTOR_TEXT_BOTTOM | Align text to the bottom of the insertion point.
 | VECTOR_TEXT_VCENTER | Center text vertically on the insertion point.
 | VECTOR_TEXT_HITTESTRECT | Perform hit text on the bounding rectangle, not just the text characters.
CharHeight | Height in physical units of a single charcater. Note if this parameter is 0, the toolkit will use the height of the font used instead.
CharWidth | Width in physical units of a single character. Note if this parameter is 0, the toolkit will use a suitable width for the given height.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector text object.
Brush | VECTORBRUSH structure that contains information about the brush to use when drawing the vector text object.
Font | VECTORFONT structure that contains information about the font to use when drawing the vector text object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_TEXT.

pVECTORTEXT is a pointer to a VECTORTEXT structure.


VECTORTOOLTIPDESC

typedef struct _VECTORTOOLTIPDESC
{
POINT Point;
LOGPEN Pen;
LOGBRUSH Brush;
LOGFONT Font;

} VECTORTOOLTIPDESC, *pVECTORTOOLTIPDESC;

The VECTORTOOLTIPDESC structure is used to control how the tool tip will be displayed for an object, which has a tool tip.

Member | Description
Point | This is the point where the tool tip will be placed.
Pen | Windows LOGPEN structure that defines the pen properties for the tooltip.
Brush | Windows LOGBRUSH structure that defines the brush properties for the tool tip.
Font | Windows LOGFONT structure that defines the font properties that will be used to display the tool tip.

Comments

pVECTORTOOLTIPDESC is a pointer to a VECTORTOOLTIPDESC structure. Where the function parameter type is pVECTORTOOLTIPDESC, you can declare a VECTORTOOLTIPDESC variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pVECTORTOOLTIPDESC variable is necessary only if your program requires a pointer.

The VECTORTOOLTIPDESC structure will be used by the vector toolkit to determine how and where to show the tool tip for a specific object. The Pen, Brush and Font members should be set according to the LOGPEN, LOGBRUSH and LOGFONT mentioned in the Microsoft Windows GDI documentation. This structure used with the L_VecShowObjectTooltip function.


VECTORVERTEX

typedef struct tagVECTORVERTEX
{
VECTOROBJECT Object;
VECTORPOINT Point;
VECTORPEN Pen;
} VECTORVERTEX, L_FAR * pVECTORVERTEX;

The VECTORVERTEX structure holds information about a vector vertex object.

Member | Description
Object | Abstract object.
Point | VECTORPOINT structure that contains the location of a vertex in space.
Pen | VECTORPEN structure that contains information about the pen to use when drawing the vector vertex object.

Comments

nSize of the Object member must be the sizeof this structure.

nType of the Object member must be VECTOR_VERTEX.

pVECTORVERTEX is a pointer to a VECTORVERTEX structure.


WINDOWS Structures

BITMAPINFO

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for BITMAPINFO.

COLORREF

COLORREF is a Windows data type. For further information concerning COLORREF, please refer to the Microsoft SDK documentation.

DWORD

DWORD is a Windows data type, 32 bit unsigned int. For further information concerning DWORD, please refer to the Microsoft SDK documentation.

EXTLOGPEN

EXTLOGPEN is a standard Windows structure. For further information concerning EXTLOGPEN, please refer to the Microsoft SDK documentation or your compiler's documentation.

HANDLE

Handle is a standard Windows structure. For further information concerning HANDLE, please refer to the Microsoft SDK documentation or your compiler's documentation.

HDC

HDC is a standard Windows structure. For further information concerning HDC, please refer to the Microsoft SDK documentation or your compiler's documentation.

HGLOBAL

HGLOBAL is a standard Windows data type. For further information concerning HGLOBAL, please refer to the Microsoft SDK documentation or your compiler's documentation.

HWND

HWND is a standard Windows data type. For further information concerning HWND, please refer to the Microsoft SDK documentation or your compiler's documentation.

LOGBRUSH

LOGBRUSH is a standard Windows structure. For further information concerning LOGBRUSH, please refer to the Microsoft SDK documentation or your compiler's documentation.

LOGPEN

LOGPEN is a standard Windows structure. For further information concerning LOGPEN, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPBYTE

LPBYTE is a standard Windows data type. For further information concerning LPBYTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPRECT

LPRECT is a standard Windows structure. For further information concerning LPRECT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPSTR

LPSTR is a standard Windows data type. For further information concerning LPSTR, please refer to the Microsoft SDK documentation or your compiler's documentation.

OPENFILENAME

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for OPENFILENAME.


Return Codes

The following are the possible return values for LEADTOOLS functions. These are the values in the L_ERROR.H file.

Note:

All LEADTOOLS function errors will return a negative number.

Error | No. | Description
ERROR_NO_MEMORY | -1 | Not enough memory available
ERROR_NO_BITMAP | -2 | Invalid bitmap handle
ERROR_MEMORY_TOO_LOW | -3 | Not enough memory available
ERROR_FILE_LSEEK | -4 | Error seeking to position
ERROR_FILE_WRITE | -5 | Error writing file
ERROR_FILE_GONE | -6 | File not present - abort
ERROR_FILE_READ | -7 | Error reading file
ERROR_INV_FILENAME | -8 | Invalid filename specified
ERROR_FILE_FORMAT | -9 | Invalid file format
ERROR_FILENOTFOUND | -10 | File not found
ERROR_INV_RANGE | -11 | Invalid width/height
ERROR_IMAGE_TYPE | -12 | Image format recognized, but sub-type not supported
ERROR_INV_PARAMETER | -13 | Invalid parameter passed
ERROR_FILE_OPEN | -14 | Not able to open file
ERROR_UNKNOWN_COMP | -15 | Unknown compression format
ERROR_FEATURE_NOT_SUPPORTED | -16 | Feature not supported
ERROR_NOT_256_COLOR | -17 | VGA card only supports 256 colors (8 bit)
ERROR_PRINTER | -18 | Printer error
ERROR_CRC_CHECK | -19 | Data CRC check error
ERROR_QFACTOR | -21 | Invalid QFactor specified
ERROR_TARGAINSTALL | -22 | TARGA not installed
ERROR_OUTPUTTYPE | -23 | Invalid compression format
ERROR_XORIGIN | -24 | X origin specified invalid
ERROR_YORIGIN | -25 | Y origin specified invalid
ERROR_VIDEOTYPE | -26 | Invalid video mode
ERROR_BITPERPIXEL | -27 | Invalid bits/pixel
ERROR_WINDOWSIZE | -28 | Invalid window size
ERROR_NORMAL_ABORT | -29 | Escape key pressed
ERROR_NOT_INITIALIZED | -30 | Internal error - call LEAD
ERROR_CU_BUSY | -31 | Internal error - call LEAD
ERROR_INVALID_TABLE_TYPE | -32 | Internal error - call LEAD
ERROR_UNEQUAL_TABLES | -33 | Internal error - call LEAD
ERROR_INVALID_BUFFER | -34 | Internal error - call LEAD
ERROR_MISSING_TILE_DATA | -35 | Internal error - call LEAD
ERROR_INVALID_QVALUE | -36 | Internal error - call LEAD
ERROR_INVALIDDATA | -37 | Internal error - call LEAD
ERROR_INVALID_COMPRESSED_TYPE | -38 | Internal error - call LEAD
ERROR_INVALID_COMPONENT_NUM | -39 | Internal error - call LEAD
ERROR_INVALID_PIXEL_TYPE | -40 | Internal error - call LEAD
ERROR_INVALID_PIXEL_SAMPLING | -41 | Internal error - call LEAD
ERROR_INVALID_SOURCE_FILE | -42 | Internal error - call LEAD
ERROR_INVALID_TARGET_FILE | -43 | Internal error - call LEAD
ERROR_INVALID_IMAGE_DIMS | -44 | Internal error - call LEAD
ERROR_INVALID_TILE_DIMS | -45 | Internal error - call LEAD
ERROR_INVALID_PIX_BUFF_DIMS | -46 | Internal error - call LEAD
ERROR_SEGMENT_OVERFLOW | -47 | Internal error - call LEAD
ERROR_INVALID_SUBSAMPLING | -48 | Internal error - call LEAD
ERROR_INVALID_Q_VIS_TABLE | -49 | Internal error - call LEAD
ERROR_INVALID_DC_CODE_TABLE | -50 | Internal error - call LEAD
ERROR_INVALID_AC_CODE_TABLE | -51 | Internal error - call LEAD
ERROR_INSUFFICIENT_DATA | -52 | Internal error - call LEAD
ERROR_MISSING_FUNC_POINTER | -53 | Internal error - call LEAD
ERROR_TOO_MANY_DC_CODE_TABLES | -54 | Internal error - call LEAD
ERROR_TOO_MANY_AC_CODE_TABLES | -55 | Internal error - call LEAD
ERROR_INVALID_SUBIMAGE | -56 | Internal error - call LEAD
ERROR_INVALID_ABORTION | -57 | Internal error - call LEAD
ERROR_CU_NO_SUPPORT | -58 | Internal error - call LEAD
ERROR_CU_FAILURE | -59 | Internal error - call LEAD
ERROR_BAD_POINTER | -60 | Internal error - call LEAD
ERROR_HEADER_DATA_FAILURE | -61 | Internal error - call LEAD
ERROR_COMPRESSED_DATA_FAILURE | -62 | Internal error - call LEAD
ERROR_FIXEDPAL_DATA | -63 | Fixed palette data not found
ERROR_LOADFONT_DATA | -64 | Fixed palette data not found
ERROR_NO_STAMP | -65 | Stamp not found
ERROR_G3CODE_INVALID | -70 | Invalid group 3 data
ERROR_G3CODE_EOF | -71 | Group3 code end of file
ERROR_G3CODE_EOL | -72 | Group3 code end of code
ERROR_PREMATURE_EOF | -73 | Premature EOF at scanline
ERROR_PREMATURE_EOL | -74 | Premature end-of-line code
ERROR_UNCOMP_EOF | -75 | Premature end-of-line code
ERROR_ACT_INCOMP | -76 | Premature end-of-line code
ERROR_BAD_DECODE_STATE | -77 | Premature end-of-line code
ERROR_VERSION_NUMBER | -78 | Bad version number
ERROR_TWAIN_NODSM | -79 | Source manager not found
ERROR_TWAIN_BUMMER | -80 | Failure due to unknown causes
ERROR_TWAIN_LOWMEMORY | -81 | Not enough memory to perform operation
ERROR_TWAIN_NODS | -82 | No Data Source
ERROR_TWAIN_MAXCONNECTIONS | -83 | DS is connected to max possible apps
ERROR_TWAIN_OPERATIONERROR | -84 | DS or DSM reported error, app shouldn't
ERROR_TWAIN_BADCAP | -85 | Unknown capability
ERROR_TWAIN_BADPROTOCOL | -86 | Unrecognized MSG DG DAT combination
ERROR_TWAIN_BADVALUE | -87 | Data parameter out of range
ERROR_TWAIN_SEQERROR | -88 | DG DAT MSG out of expected sequence
ERROR_TWAIN_BADDEST | -89 | Unknown destination App/Src in DSM_Entry
ERROR_TWAIN_CANCEL | -90 | Operation was cancelled
ERROR_PANWINDOW_NOT_CREATED | -91 | Pan window was not created
ERROR_TWAIN_CAPUNSUPPORTED | -93 | Twain capability unsupported
ERROR_TWAIN_FILEXFER_UNSUPPORTED | -94 | Twain File Transfer unsupported
ERROR_USER_ABORT | -100 | User has aborted operation
ERROR_FPX_INVALID_FORMAT_ERROR | -101 | FlashPix error
ERROR_FPX_FILE_WRITE_ERROR | -102 | FlashPix error
ERROR_FPX_FILE_READ_ERROR | -103 | FlashPix error
ERROR_FPX_FILE_NOT_FOUND | -104 | FlashPix error
ERROR_FPX_COLOR_CONVERSION_ERROR | -105 | FlashPix error
ERROR_FPX_SEVER_INIT_ERROR | -106 | FlashPix error
ERROR_FPX_LOW_MEMORY_ERROR | -107 | FlashPix error
ERROR_FPX_IMAGE_TOO_BIG_ERROR | -108 | FlashPix error
ERROR_FPX_INVALID_COMPRESSION_ERROR | -109 | FlashPix error
ERROR_FPX_INVALID_RESOLUTION | -110 | FlashPix error
ERROR_FPX_INVALID_FPX_HANDLE | -111 | FlashPix error
ERROR_FPX_TOO_MANY_LINES | -112 | FlashPix error
ERROR_FPX_BAD_COORDINATES | -113 | FlashPix error
ERROR_FPX_FILE_SYSTEM_FULL | -114 | FlashPix error
ERROR_FPX_MISSING_TABLE | -115 | FlashPix error
ERROR_FPX_RETURN_PARAMETER_TOO_LARGE | -116 | FlashPix error
ERROR_FPX_NOT_A_VIEW | -117 | FlashPix error
ERROR_FPX_VIEW_IS_TRANFORMLESS | -118 | FlashPix error
ERROR_FPX_ERROR | -119 | FlashPix error
ERROR_FPX_UNIMPLEMENTED_FUNCTION | -120 | FlashPix error
ERROR_FPX_INVALID_IMAGE_DESC | -121 | FlashPix error
ERROR_FPX_INVALID_JPEG_TABLE | -122 | FlashPix error
ERROR_FPX_ILLEGAL_JPEG_ID | -123 | FlashPix error
ERROR_FPX_MEMORY_ALLOCATION_FAILED | -124 | FlashPix error
ERROR_FPX_NO_MEMORY_MANAGEMENT | -125 | FlashPix error
ERROR_FPX_OBJECT_CREATION_FAILED | -126 | FlashPix error
ERROR_FPX_EXTENSION_FAILED | -127 | FlashPix error
ERROR_FPX_FREE_NULL_PTR | -128 | FlashPix error
ERROR_FPX_INVALID_TILE | -129 | FlashPix error
ERROR_FPX_FILE_IN_USE | -130 | FlashPix error
ERROR_FPX_FILE_CREATE_ERROR | -131 | FlashPix error
ERROR_FPX_FILE_NOT_OPEN_ERROR | -132 | FlashPix error
ERROR_FPX_USER_ABORT | -133 | FlashPix error
ERROR_FPX_OLE_FILE_ERROR | -134 | FlashPix error
ERROR_BAD_TAG | -140 | Bad TIFF tag
ERROR_INVALID_STAMP_SIZE | -141 | Stamp size is too big or invalid bits per pixel, etc
ERROR_BAD_STAMP | -142 | Stamp is present but data is corrupted
ERROR_EXPRESS_NOT_ENABLED | -143 | Document Imaging capability is required to use this function
ERROR_IMAGE_EMPTY | -144 | Image is empty
ERROR_NO_CHANGE | -145 | The image hasn't changed
ERROR_ANN_LOCKED | -148 | The annotation object is locked.
ERROR_DLG_CANCELED | -150 | Imaging Common Dialog canceled by user
ERROR_DLG_FAILED | -151 | Imaging Common Dialog Error - error during creation of Imaging Common Dialog
ERROR_ISIS_NOCURSCANNER | -160 | No ISIS Scanner selected
ERROR_ISIS_SCANDRIVER_NOT_LOADED | -161 | ISIS Scanner driver failed to load
ERROR_ISIS_CANCEL | -162 | ISIS operation canceled by user.
ERROR_ISIS_BAD_TAG_OR_VALUE | -163 | Bad ISIS Tag or Bad Tag Value
ERROR_ISIS_NOT_READY | -164 | ISIS Scanner not ready
ERROR_ISIS_NO_PAGE | -165 | No page in the ISIS Scanner
ERROR_ISIS_JAM | -166 | ISIS Scanner Jam error
ERROR_ISIS_SCANNER_ERROR | -167 | ISIS Scanner driver error
ERROR_ISIS_BUSY | -168 | ISIS Scanner is busy
ERROR_ISIS_FILE_ERROR | -169 | ISIS File driver error
ERROR_ISIS_NETWORK_ERROR | -170 | ISIS Network error
ERROR_ISIS_NOT_INSTALLED | -171 | ISIS is not installed
ERROR_PAGE_NOT_FOUND | -310 | Page not found
ERROR_DELETE_LAST_PAGE | -311 | You cannot delete a page from a file containing only one page
ERROR_NO_HOTKEY | -312 | There is no hotkey.
ERROR_CANNOT_CREATE_HOTKEY_WINDOW | -313 | Error creating the hotkey window.
ERROR_MEDICAL_NOT_ENABLED | -314 | Medical Imaging capability is required to use this function
ERROR_JBIG_NOT_ENABLED | -315 | .JBIG capability is requiredto use this function
ERROR_VECTOR_NOT_ENABLED | -400 | Vector support is locked.
ERROR_VECTOR_DWF_NOT_ENABLED | -405 | Vector DWF capability is required to use this function
ERROR_NO_UNDO_STACK | -406 | There is no undo stack
ERROR_UNDO_DISABLED | -407 | The undo is disabled
ERROR_PDF_NOT_ENABLED | -408 | PDF capability is required to use this function
ERROR_VECTOR_IS_EMPTY | -501 | The vector is empty.
ERROR_VECTOR_LAYER_NOT_FOUND | -502 | The vector layer was not found.
ERROR_VECTOR_LAYER_IS_LOCKED | -503 | The vector layer is locked.
ERROR_VECTOR_LAYER_ALREADY_EXISTS | -504 | The vector layer was not found.
ERROR_VECTOR_OBJECT_NOT_FOUND | -505 | The vector object was not found.
ERROR_VECTOR_INVALID_OBJECT_TYPE | -506 | Invalid object type.
ERROR_VECTOR_PEN_NOT_FOUND | -507 | Pen was not found.
ERROR_VECTOR_BRUSH_NOT_FOUND | -508 | Brush was not found.
ERROR_VECTOR_FONT_NOT_FOUND | -509 | Font was not found.
ERROR_VECTOR_BITMAP_NOT_FOUND | -510 | Bitmap was not found.
ERROR_VECTOR_POINT_NOT_FOUND | -511 | Point was not found.
ERROR_VECTOR_ENGINE_NOT_FOUND | -512 | Vector engine was not found.
ERROR_VECTOR_INVALID_ENGINE | -513 | Invalid vector engine.
ERROR_VECTOR_CLIPBOARD | -514 | Clipboard error.
ERROR_VECTOR_CLIPBOARD_IS_EMPTY | -515 | Clipboard is empty.
ERROR_VECTOR_CANT_ADD_TEXT | -516 | Cannot add the text.
ERROR_VECTOR_CANT_READ_WMF | -517 | Cannot read the WMF.
ERROR_VECTOR_GROUP_NOT_FOUND | -518 | Group was not found.
ERROR_VECTOR_GROUP_ALREADY_EXISTS | -519 | Group already exists.


L_VecAddGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAddGroup(pVector, pGroupDesc, pGroup, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUPDESC pGroupDesc; | /* pointer to a structure */
pVECTORGROUP pGroup; | /* pointer to a vector group */
L_UINT32 dwFlags; | /* flags */

Adds a new empty group to a vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pGroupDesc | Pointer to a VECTORGROUPDESC structure that contains the new group settings.
pGroup | Pointer to a VECTORGROUP structure to be updated with the handle of the new group.
dwFlags | Flag that indicates whether or not to rename duplicate group names. Possible values are:
 | Value | Meaning
 | 0 | Don't rename duplicate group names, if found.
 | VECTOR_FLAGS_RENAME_DUPLICATES | Renames duplicate group names if found. The toolkit will add a suffix (0, 1, 2, etc) to the group name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For more information on the group settings, refer to the VECTORGROUPDESC structure.

To change group settings, get the current group settings by calling L_VecGetGroup, set the new settings in the VECTORGROUPDESC structure pointed to by pGroupDesc and then set the new group settings by calling L_VecSetGroup.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDeleteGroup, L_VecGetGroup, L_VecSetGroup, L_VecGetGroupByName, L_VecGetGroupByIndex, L_VecCopyGroup, L_VecEmptyGroup, L_VecEmptyGroup, L_VecFreeGroup, L_VecDeleteGroupClones
Topics: | Working with Vector Groups

Example

/* This example will add a new group to a vector handle */
L_VOID AddMyGroup( pVECTORHANDLE pVector )
{
VECTORGROUPDESC GroupDesc;
VECTORGROUP Group;

GroupDesc.nSize = sizeof( VECTORGROUPDESC );
lstrcpy( GroupDesc.szName, TEXT("My Group"));
GroupDesc.dwTag = 0L;

if( SUCCESS != L_VecAddGroup( pVector, &GroupDesc, &Group, VECTOR_FLAGS_RENAME_DUPLICATES ) )
{
MessageBox( NULL, TEXT("Could not add group!"), NULL, MB_OK );
}
}


L_VecAddHyperlink

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAddHyperlink(pVector, pObject, pTarget)

pVECTORHANDLE pVector; | /* pointer to vector handle */
pVECTOROBJECT pObject; | /* pointer to vector object */
pVECTORLINKDESC pTarget; | /* target information */

Adds a new item to the target list for the specified hyperlinked vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references a vector object. The target list of this hyperlinked vector object will be updated with the new target.
pTarget | Pointer to a VECTORLINKDESC structure that determines how the toolkit will handle the hyperlink.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Hyperlinked vector objects cause some action to take place when the end-user clicks on them. Each of these objects maintains a list of targets. That is, clicking on a hyperlinked vector object may cause several different things to occur. Depending on the target(s) and how the user specifies handling the target(s), the vector toolkit will act in response to the end-user's actions on that target.

A hyperlink must be added to a vector object using this function before it can be changed using the L_VecSetHyperlink function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetHyperlink, L_VecGetHyperlink, L_VecGetHyperlinkCount, L_VecGotoHyperlink
Topics: | Hyperlink Object
 | Hyperlink Objects

Example

L_INT AddTargetObject( pVECTORHANDLE pVector, pVECTOROBJECT pVecObj, pVECTOROBJECT pTarget )
{
L_INT nRet;
VECTORLINKDESC Link;

Link.bObject = TRUE;

Link.tar.vectorobject.target = *pTarget;
Link.tar.vectorobject.handling = VECTORLINKHANDLING_CURRENTWINDOW;

nRet = L_VecAddHyperlink ( pVector, pVecObj, &Link );
if( SUCCESS != nRet )
{
return nRet;
}

return L_VecGetHyperlinkCount ( pVector, pVecObj );
}


L_VecAddLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAddLayer(pVector, pLayerDesc, pLayer, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYERDESC pLayerDesc; | /* pointer to a structure */
pVECTORLAYER pLayer; | /* pointer to a vector layer */
L_UINT32 dwFlags; | /* flags */

Adds a new empty layer to a vector handle.

This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pLayerDesc | Pointer to a VECTORLAYERDESC structure that contains the new layer settings.
pLayer | Pointer to a VECTORLAYER structure to be updated with the handle of the new layer.
dwFlags | Flag that indicates whether or not to rename duplicate layer names. Possible values are:
 | Value | Meaning
 | 0 | Don't rename duplicate layer names, if found.
 | VECTOR_FLAGS_RENAME_DUPLICATES | Renames duplicate layer names if found. The toolkit will add a suffix (0, 1, 2, etc) to the layer name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For more information on the layer settings, refer to the VECTORLAYERDESC structure.

To change layer settings, get the current layer settings by calling L_VecGetLayer, set the new settings in the VECTORLAYERDESC structure pointed to by pLayerDesc and then set the new layer settings by calling L_VecSetLayer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDeleteLayer, L_VecGetLayer, L_VecSetLayer, L_VecGetLayerByName, L_VecGetLayerByIndex, L_VecCopyLayer, L_VecEmptyLayer, L_VecSetActiveLayer, L_VecGetActiveLayer, L_VecEmptyLayer, L_VecFreeLayer
Topics: | Working with Vector Layers

Example

/* This example will add a new layer to a vector handle */
L_VOID AddMyLayer( pVECTORHANDLE pVector )
{
VECTORLAYERDESC LayerDesc;
VECTORLAYER Layer;

LayerDesc.nSize = sizeof( VECTORLAYERDESC );
lstrcpy( LayerDesc.szName, TEXT("My Layer"));
LayerDesc.bVisible = TRUE;
LayerDesc.bLocked = FALSE;
LayerDesc.dwTag = 0L;

if( SUCCESS != L_VecAddLayer( pVector, &LayerDesc, &Layer, VECTOR_FLAGS_RENAME_DUPLICATES ) )
{
MessageBox( NULL, TEXT("Could not add layer!"), NULL, MB_OK );
}
}


L_VecAddObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAddObject(pVector, pLayer, nType, pObjectDesc, pNewObject)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */
L_INT nType; | /* object type */
const L_VOID L_FAR * pObjectDesc; | /* pointer to a vector object */
pVECTOROBJECT pNewObject; | /* pointer to the new vector object */

Adds a new object to a vector layer. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the destination vector handle.
pLayer | Pointer to the destination vector layer.
nType | Type of object to add. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_CLONE | Clone object of a vector group.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a vector object that contains information about the object to add.
pNewObject | Pointer to a VECTOROBJECT structure that references the newly added object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If pLayer is NULL, the object will be added to the current active layer within the vector handle.

If pNewObject is NULL, this pointer will not be updated with the address of the newly added object.

You may need to cast from your given object type (VECTORPOLYGON, VECTORTEXT, etc) when using this function. (See the example below.)

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecInitObject
Topics: | Working with Vector Objects

Example

/* This example will add a new red line from 1.0, 1.0, 0.0 to 2.0, 2.0, 0.0 to the vector handle */
L_VOID AddNewLine( pVECTORHANDLE pVector )
{
VECTORLINE Line;

/* Init the new object */
L_VecInitObject( &Line.Object );

Line.Object.nSize = sizeof( VECTORLINE );
Line.Object.nType = VECTOR_LINE;

Line.Point[ 0 ].x = 1.0;
Line.Point[ 0 ].y = 1.0;
Line.Point[ 0 ].z = 0.0;

Line.Point[ 1 ].x = 2.0;
Line.Point[ 1 ].y = 2.0;
Line.Point[ 1 ].z = 0.0;

Line.Pen.nSize = sizeof( VECTORPEN );
Line.Pen.bExtPen = FALSE;
Line.Pen.NewPen.LogPen.lopnStyle = PS_SOLID;
Line.Pen.NewPen.LogPen.lopnWidth.x = 1;
Line.Pen.NewPen.LogPen.lopnWidth.y = 0;
Line.Pen.NewPen.LogPen.lopnColor = RGB( 0xFF, 0x00, 0x00 );

/* add to current active layer */
L_VecAddObject ( pVector, NULL, VECTOR_LINE, &Line, NULL );
}


L_VecAddObjectToGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAddObjectToGroup(pVector, pGroup, nType, pObjectDesc, pNewObject)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */
L_INT nType; | /* object type */
const L_VOID L_FAR * pObjectDesc; | /* pointer to a vector object */
pVECTOROBJECT pNewObject; | /* pointer to the new vector object */

Adds a new object to a vector group. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the destination vector handle.
pGroup | Pointer to the destination vector group.
nType | Type of object to add. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a vector object that contains information about the object to add.
pNewObject | Pointer to a VECTOROBJECT structure that references the newly added object..

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If pNewObject is NULL, this pointer will not be updated with the address of the newly added object.

You may need to cast from your given object type (VECTORPOLYGON, VECTORTEXT, etc) when using this function. (See the example below.)

You cannot add a VECTOR_CLONE to a vector group.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecInitObject, L_VecAddObject
Topics: | Working with Vector Objects

Example

/* This example will create a new vector group with the given name that contains all currently selected objects inside a vector handle */
L_INT EXT_CALLBACK MyEnumObjectsProc( pVECTORHANDLE pVector, const pVECTOROBJECT pObject, L_VOID *pUserData )
{
pVECTORGROUP pGroup;
L_TCHAR pBuffer[ VECTOR_OBJECT_BUFFER_SIZE ];

/* Add all objects into this group */
if( pObject->nType != VECTOR_CLONE ) /* should not be a VECTOR_CLONE */
{
L_VecGetObject( pVector, pObject, pObject->nType, pBuffer );
pGroup = (pVECTORGROUP) pUserData;
L_VecAddObjectToGroup ( pVector, pGroup, pObject->nType, pBuffer, NULL );
L_VecFreeObject( pObject->nType, pBuffer );
}

return SUCCESS;
}

L_VOID CreateGroup( pVECTORHANDLE pVector, const L_TCHAR *pszName )
{
VECTORGROUPDESC GroupDesc;
VECTORGROUP Group;

/* Add a new empty group */
memset( &GroupDesc, 0, sizeof( GroupDesc ) );
GroupDesc.nSize = sizeof( GroupDesc );
lstrcpy( GroupDesc.szName, pszName );
L_VecAddGroup( pVector, &GroupDesc, &Group, 0L );

/* Add all selected objects into this group */
L_VecEnumObjects(pVector, MyEnumObjectsProc, &Group, VECTOR_FLAGS_SELECTED_ONLY);
}


L_VecApplyTransformation

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecApplyTransformation( pVector)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

Applies the current transformation to the vector image. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle referencing an image drawing.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will apply the current transformation (Rotation, scaling and translation) to the vector image. The vector image objects will be changed.

After a call to this function, rotation, scaling and translation values will be reset.

Not supported in DirectX or OpenGL engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetRotation, L_VecSetScale, L_VecSetTranslation

Example

/* This example loads a vector drawing, applies some transformation then saves it back */

void DoMyTransformation( L_TCHAR *pszFile )
{
VECTORHANDLE TmpVector; /* Vector handle for initial loading */
VECTORPOINT point;

/* Load the drawing */
L_VecLoadFile( pszFile, &TmpVector, NULL, NULL );

/* Rotate 30 degrees along the 3 axes */
point.x = 30.0;
point.y = 30.0;
point.z = 30.0;
L_VecSetRotation( &TmpVector, &point, NULL, NULL, 0L );

/* Scale to 200% */
point.x = 2.0;
point.y = 2.0;
point.z = 2.0;
L_VecSetScale( &TmpVector, &point, NULL, NULL, 0L );

/* Translate 5 units along each axis */
point.x = 5.0;
point.y = 5.0;
point.z = 5.0;
L_VecSetTranslation( &TmpVector, &point, NULL, 0L );

/* Apply the transformation to the image */
L_VecApplyTransformation( &TmpVector );

/* Saves it back */
L_VecSaveFile( pszFile, &TmpVector, FILE_DXF, NULL );

/* Free the vector */
L_VecFree( &TmpVector );
}


L_VecAttachToWindow

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecAttachToWindow(hWnd, pVector, nEngine, dwFlags)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT nEngine; | /* vector engine */
L_UINT32 dwFlags; | /* flags */

Attaches a vector handle to a window.

Parameter | Description
hWnd | Handle of the window to which the vector handle will be attached.
pVector | Pointer to a vector handle that will be attached to the window specified in hWnd.
nEngine | The vector engine to associate with the specified vector handle. Possible values are:
 | Value | Meaning
 | VECTOR_ENGINE_GDI | Use GDI rendering. (No lights and shading).
 | VECTOR_ENGINE_OPENGL | Use OpenGL rendering. (Viewing only, drawings not editable).
dwFlags | Flags that modify the vector engine. Possible values are:
 | Value | Meaning
 | VECTOR_ENGINE_DOUBLEBUFFER | Use double buffering for flicker-free screen updates.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will attach a vector handle to a window handle. All subsequent changes to the vector image will be reflected on the window.

Note:

When you copy one vector to another using L_VecCopy, and the source vector is attached to a window, the destination vector will NOT be attached to the same window automatically.

You can draw on the surface of any window using L_VecPaint, but to use double buffering, you must attach the vector handle to a window.

After the vector engine is successfully attached, all subsequent calls to the vector functions with this vector handle will use this engine for rendering.

Note:

OpenGL and DirectX engines will not work in a palletized screen mode (256-colors or less). This function will fail, and return ERROR_INV_PARAMETER if an attempt is made to use either of these engines in 256-color mode or less.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetEngine, L_VecPaint, L_VecCopy

Example

/* This example will assign a window handle to a vector handle. */

/* This is the window procedure of the attached window. */
LRESULT WINAPI WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
VECTORHANDLE Vector; /* Vector handle. */
L_INT nRet; /* return value. */
PAINTSTRUCT PaintStruct;
HDC hdc;
RECT rect;

switch(message)
{
case WM_CREATE:
/* Load an image into the vector handle. */
nRet = L_VecLoadFile( TEXT("TEMP.DXF"), &Vector, NULL, NULL );
if( nRet != SUCCESS )
{
MessageBox(hwnd, TEXT("Error loading the file."), TEXT("Error"), MB_OK);
return -1;
}

/* Attach the vector image with this window using the GDI engine and double buffering. */
nRet = L_VecAttachToWindow( hwnd, &Vector, VECTOR_ENGINE_GDI, VECTOR_ENGINE_DOUBLEBUFFER );
if( nRet != SUCCESS )
{
MessageBox(hwnd, TEXT("Error assigning vector image to window."), TEXT("Error"), MB_OK);
L_VecFree( &Vector );
return -1;
}

return 0;

case WM_SIZE:
/* Set new view port */
GetClientRect( hwnd, &rect );
L_VecSetViewport( &Vector, &rect );
return 0;

case WM_PAINT:
hdc = BeginPaint(hwnd, &PaintStruct);

/* Paint the vector image */
L_VecPaint( hdc, &Vector, TRUE );

EndPaint(hwnd, &PaintStruct);
return 0;

case WM_DESTROY:
/* Free the vector */
L_VecFree( &Vector );

PostQuitMessage( 0 );
return 0;

default:
return DefWindowProc( hwnd, message, wParam, lParam );
}
}


L_VecClipboardReady

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecClipboardReady(L_VOID)

Determines whether the Windows clipboard contains vector data that can be copied using the L_VecCopyFromClipboard function.

Returns

TRUE | The clipboard contains vector data that can be copied.
FALSE | The clipboard does not contain vector data that can be copied.

Comments

To copy vector data to the clipboard, call L_VecCopyToClipboard.

To copy vector data to a vector handle, from the clipboard, call L_VecCopyFromClipboard.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecCopyFromClipboard, L_VecCopyToClipboard.
Topics: | Using the Clipboard

Example

For an example, refer to L_VecCopyFromClipboard.


L_VecConvertFromEMF

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecConvertFromEMF(hDC, pVector, hEMF)

HDC hDC; | /* handle to a device context */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
HENHMETAFILE hEMF; | /* handle to the metafile to be converted */

Converts an enhanced Windows metafile (EMF) into a LEAD Technologies vector handle. When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hDC | Handle to the device context responsible for the conversion.
pVector | Pointer to a vector handle.
hEMF | Handle to the EMF to be converted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates information in the vector handle and copies the EMF drawing data into the LEAD bitmap.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecConvertToEMF, L_VecConvertToWMF, L_VecConvertFromWMF

Example

/* This example converts an enhanced windows metafile into a DXF file */

void SaveAsDXF( HWND hWnd, L_TCHAR *pszFileName, HENHMETAFILE hEMF )
{
VECTORHANDLE TmpVector; /* Vector handle for initial conversion */
HDC hDC;

/* Convert to LEAD vector */
hDC = GetDC( hWnd );
L_VecConvertFromEMF( hDC, &TmpVector, hEMF );
ReleaseDC( hWnd, hDC );

/* Save as DXF */
L_VecSaveFile( pszFileName, &TmpVector, FILE_DXF, NULL );

/* Free the vector */
L_VecFree( &TmpVector );
}


L_VecConvertFromWMF

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecConvertFromWMF(hDC, pVector, hWMF)

HDC hDC; | /* handle to a device context */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
HMETAFILE hWMF; | /* handle to the WMF to be converted */

Converts a Windows metafile (WMF) into a LEAD Technologies vector handle. When this function is completed, there are two copies of the drawing in memory: the WMF and the original LEAD vector. Freeing one will not affect the other. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hDC | Handle to the device context responsible for the conversion.
pVector | Pointer to the vector handle to be updated with the converted file.
hWMF | Handle to the WMF to be converted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates information in the vector handle and copies the WMF drawing data into the LEAD bitmap.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecConvertToWMF, L_VecConvertToEMF, L_VecConvertFromEMF

Example

/* This example converts a windows metafile into a DXF file */

void SaveAsDXF1( HWND hWnd, L_TCHAR *pszFileName, HMETAFILE hWMF )
{
VECTORHANDLE TmpVector; /* Vector handle for initial conversion */
HDC hDC;

/* Convert to LEAD vector */
hDC = GetDC( hWnd );
L_VecConvertFromWMF(hDC, &TmpVector, hWMF );
ReleaseDC( hWnd, hDC );

/* Save as DXF */
L_VecSaveFile( pszFileName, &TmpVector, FILE_DXF, NULL );

/* Free the vector */
L_VecFree( &TmpVector );
}


L_VecConvertToEMF

#include "lvkrn.h"

HENHMETAFILE EXT_FUNCTION L_VecConvertToEMF(hDC, pVector, pRect, uDPI)

HDC hDC; | /* handle to a device context */
const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const RECT L_FAR pRect; | /* bounding rectangle */
L_UINT uDPI; | /* DPI value */

Converts a LEAD Technologies vector handle into an enhanced Windows metafile (EMF). When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
hDC | Handle to the device context responsible for the conversion.
pVector | Pointer to a vector handle that references the vector image to be converted.
pRect | Points to a RECT structure that specifies the dimensions (in .01-millimeter units) of the picture to be stored in the enhanced metafile. If this parameter is NULL, the vector toolkit computes the dimensions of the smallest rectangle that surrounds the vector drawing. The pRect parameter should be provided where possible.
uDPI | Dots per inch that will be used in the conversion.

Returns

!NULL | A handle to the EMF.
NULL | An error occurred.

Comments

This function allocates an EMF handle and copies the LEAD vector to the EMF.

If this function is called with pRect containing these values:

pRect->left = 0;
pRect->top = 0;
pRect->right = 1000;
pRect->bottom = 1000;

the vector drawing will be converted to an EMF file with logical size 0 to 10 mm. in width and height.

This is very helpful when printing. For example, determine the printer’s printable area in millimeters. Divide that value by 100 and pass the resulting value as the right and bottom members of the RECT structure. The resulting EMF will have the same logical size as the printer, resulting in high image quality when printing the EMF file.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecConvertFromEMF, L_VecConvertToWMF, L_VecConvertFromWMF

Example

/* This example loads a vector drawing, converts it to an enhanced meta file and returns the handle to the EMF */

HENHMETAFILE LoadEMF( HWND hWnd, L_TCHAR L_FAR *pszFile )
{
VECTORHANDLE TmpVector; /* Vector handle for initial loading */
HENHMETAFILE hEMF; /* Handle to enhanced meta file */
HDC hDC; /* Load the drawing */
L_VecLoadFile ( pszFile, &TmpVector, NULL, NULL );

/* Convert to EMF */
hDC = GetDC( hWnd );
hEMF = L_VecConvertToEMF(hDC, &TmpVector, NULL, 96 );
ReleaseDC( hWnd, hDC );

/* Free the vector */
L_VecFree( &TmpVector ); return( hEMF );
}


L_VecConvertToWMF

#include "lvkrn.h"

HMETAFILE EXT_FUNCTION L_VecConvertToWMF(hDC, pVector, pRect, uDPI)

HDC hDC; | /* handle to the device context */
const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const RECT L_FAR pRect; | /* bounding rectangle */
L_UINT uDPI; | /* DPI value */

Converts a LEAD Technologies vector handle into a Windows metafile (WMF). When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
hDC | Handle to the device context responsible for the conversion.
pVector | Pointer to a vector handle.
pRect | Points to a RECT structure that specifies the dimensions (in .01-millimeter units) of the picture to be stored in the enhanced metafile. If this parameter is NULL, the vector toolkit computes the dimensions of the smallest rectangle that surrounds the vector drawing. The pRect parameter should be provided where possible.
uDPI | Dots per inch that will be used in the conversion.

Returns

!NULL | The handle to the WMF.
NULL | An error occurred.

Comments

This function allocates a WMF handle and copies the LEAD vector to the WMF.

If this function is called with pRect containing these values:

pRect->left = 0;
pRect->top = 0;
pRect->right = 1000;
pRect->bottom = 1000;

the vector drawing will be converted to an WMF file with logical size 0 to 10 mm. in width and height.

This is very helpful when printing. For example, determine the printer’s printable area in millimeters. Divide that value by 100 and pass the resulting value as the right and bottom members of the RECT structure. The resulting WMF will have the same logical size as the printer, resulting in high image quality when printing the WMF file.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecConvertFromWMF, L_VecConvertToEMF, L_VecConvertFromEMF

Example

/* This example loads a vector drawing, convert it to a meta file and returns the handle to the WMF */

HMETAFILE LoadWMF( HWND hWnd, L_TCHAR *pszFile )
{
VECTORHANDLE TmpVector; /* Vector handle for initial loading */
HMETAFILE hWMF; /* Handle to a meta file */
HDC hDC;

/* Load the drawing */
L_VecLoadFile ( pszFile, &TmpVector, NULL, NULL );

/* Convert to WMF */
hDC = GetDC( hWnd );
hWMF = L_VecConvertToWMF(hDC, &TmpVector, NULL, 96 );
ReleaseDC( hWnd, hDC );

/* Free the vector */
L_VecFree ( &TmpVector );
return( hWMF );
}


L_VecCopy

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopy(pDst, pSrc, dwFlags)

pVECTORHANDLE pDst; | /* pointer to a vector handle */
const pVECTORHANDLE pSrc; | /* pointer to a vector object */
L_UINT32 dwFlags; | /* copy flags */

Copies one vector handle to another.

Parameter | Description
pDst | Pointer to the target vector handle.
pSrc | Pointer to the source vector handle.
dwFlags | Flag that indicate the characteristics of the copy process. Possible values are:
 | Value | Meaning
 | 0 | Copy the entire vector handle from the source vector to the destination vector.
 | VECTOR_FLAGS_SELECTED_ONLY | Copy only selected objects from the source vector to the destination vector.
 | VECTOR_FLAGS_REPLACE | Empty the destination vector handle before copying.
 | VECTOR_FLAGS_RENAME_DUPLICATES | Renames duplicate layer names if found. This flag is only valid when VECTOR_FLAGS_REPLACE is not specified. The toolkit will add a suffix (0, 1, 2, etc) to the layer name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created.
 | VECTOR_FLAGS_COPY_INTO_ACTIVE_LAYER | Copies objects and layers into the active layer of the destination vector.
 | VECTOR_FLAGS_COPY_LAYERS_ONLY | Copies all layers and objects from the source vector to the destination vector. Transformation, camera, viewport and all other properties of the destination vector will not be effected.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Copies an entire drawing of a source vector structure and places it into a destination structure.

This also copies all fields in the VECTORHANDLE structure.

This function will not copy the window attachment, if pSrc is attached to a window, pDst will not be attached to the same window.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecInit, L_VecFree, L_VecEmpty

Example

/* This example will try to load a file into a given vector handle, it will try to not alter the provided handle if the file cannot be loaded. */
BOOL LoadMyImage( L_TCHAR L_FAR *pszFile, pVECTORHANDLE pVector )
{
VECTORHANDLE TempVector; /* Temporary vector handle. */
L_INT nRet; /* Return value. */

/* Load the file into the temporary vector. */
nRet = L_VecLoadFile( pszFile, &TempVector, NULL, NULL );
if( nRet != SUCCESS )
return FALSE;

/* Copy the new vector into the provided one. */
nRet = L_VecCopy( pVector, &TempVector, VECTOR_FLAGS_REPLACE );
if( nRet != SUCCESS )
{

L_VecFree( &TempVector );
return FALSE;
}

/* Free the temporary vector before returning. */
L_VecFree( &TempVector );

return TRUE;
}


L_VecCopyFromClipboard

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopyFromClipboard(hWnd, pVector, dwFlags)

HWND hWnd; | /* handle to the active window */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_UINT32 dwFlags; | /* copy flags */

Copies vector data from the clipboard to the specified vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle to the active window.
pVector | Pointer to the vector handle to be updated with the vector data from the clipboard. This function will allocate the storage to hold the new vector image.
dwFlags | Flag that indicates the behavior of the copy process. Possible values are:
 | Value | Meaning
 | 0 | Copy the entire vector handle from the source vector to the destination vector.
 | VECTOR_FLAGS_SELECTED_ONLY | Copy only selected objects from the source vector to the destination vector.
 | VECTOR_FLAGS_REPLACE | Empty the destination vector before copying.
 | VECTOR_FLAGS_RENAME_DUPLICATES | Renames duplicate layer names if found. This flag is only valid when VECTOR_FLAGS_REPLACE is not specified. The toolkit will add a suffix (0, 1, 2, etc) to the layer name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created.
 | VECTOR_FLAGS_COPY_INTO_ACTIVE_LAYER | Copies objects and layers into the active layer of the destination vector.
 | VECTOR_FLAGS_COPY_LAYERS_ONLY | Copies all layers and objects from the source vector to the destination vector. Transformation, camera, viewport and all other properties of the destination vector will not be effected.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will not remove the vector data from the clipboard.

To determine whether valid vector data is on the clipboard, call L_VecClipboardReady.

To copy vector data to the clipboard from a vector handle, call L_VecCopyToClipboard.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecClipboardReady, L_VecCopyToClipboard.
Topics: | Using the Clipboard

Example

/* This example loads a vector using clipboard data, if available */
L_VOID PasteVector( HWND hWnd, pVECTORHANDLE pVector )
{
if( L_VecClipboardReady() )
{
/* Copy the vector image from the clipboard */
L_VecCopyFromClipboard( hWnd, pVector, VECTOR_FLAGS_REPLACE );
}
}


L_VecCopyGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopyGroup(pVectorDst, pGroupDst, pVectorSrc, pGroupSrc, dwFlags)

pVECTORHANDLE pVectorDst; | /* pointer to a vector handle */
const pVECTORGROUP pGroupDst; | /* pointer to a group */
const pVECTORHANDLE pVectorSrc; | /* pointer to a vector handle */
const pVECTORGROUP pGroupSrc; | /* pointer to a vector group */
L_UINT32 dwFlags; | /* copy flags */

Copies the contents of one group to another. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVectorDst | Pointer to the destination vector handle.
pGroupDst | Pointer to a VECTORGROUP structure that references the destination group.
pVectorSrc | Pointer to the source vector handle.
pGroupSrc | Pointer to a VECTORGROUP structure that references the source group.
dwFlags | Flag that indicates whether or not to empty the destination group before copying. Possible values are:
 | Value | Meaning
 | 0 | Do not empty the destination group before copying.
 | VECTOR_FLAGS_REPLACE | Empty the destination group before copying.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The destination group can be in the same vector handle as the source group, or it can be in a different vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddGroup, L_VecGetGroup, L_VecGetGroupByName, L_VecGetGroupByIndex
Topics: | Working with Vector Groups

Example

/* This example will copy the group with the given name from the source vector to the destination vector */
L_VOID CopyGroupByName( pVECTORHANDLE pVectorDst, pVECTORHANDLE pVectorSrc, L_TCHAR *pszName )
{
VECTORGROUP GroupSrc, GroupDst;
VECTORGROUPDESC GroupDesc;
L_INT nRet;

/* Get the group with the given name */
nRet = L_VecGetGroupByName( pVectorSrc, pszName, &GroupSrc );
if( nRet == SUCCESS )
{
/* get the group properties */
L_VecGetGroup( pVectorSrc, &GroupSrc, &GroupDesc );

/* add to the destination vector */
L_VecAddGroup( pVectorDst, &GroupDesc, &GroupDst , VECTOR_FLAGS_RENAME_DUPLICATES);

/* no need for the group properties anymore */
L_VecFreeGroup( &GroupDesc );

/* copy content of source group into destination */
L_VecCopyGroup( pVectorDst, &GroupDst, pVectorSrc, &GroupSrc, 0L );
}
}


L_VecCopyLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopyLayer(pVectorDst, pLayerDst, pVectorSrc, pLayerSrc, dwFlags)

pVECTORHANDLE pVectorDst; | /* pointer to a vector handle */
const pVECTORLAYER pLayerDst; | /* pointer to a layer */
const pVECTORHANDLE pVectorSrc; | /* pointer to a vector handle */
const pVECTORLAYER pLayerSrc; | /* pointer to a vector layer */
L_UINT32 dwFlags; | /* copy flags */

Copies the contents of one layer to another. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVectorDst | Pointer to the destination vector handle.
pLayerDst | Pointer to a VECTORLAYER structure that references the destination layer.
pVectorSrc | Pointer to the source vector handle.
pLayerSrc | Pointer to a VECTORLAYER structure that references the source layer.
dwFlags | Flag that indicates whether or not to empty the destination layer before copying. Possible values are:
 | Value | Meaning
 | 0 | Do not empty the destination layer before copying.
 | VECTOR_FLAGS_REPLACE | Empty the destination layer before copying.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The destination layer can be in the same vector handle as the source layer, or it can be in a different vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddLayer, L_VecGetLayer, L_VecGetLayerByName, L_VecGetLayerByIndex
Topics: | Working with Vector Layers

Example

/* This example will copy the layer with the given name from the source vector to the destination vector */
L_VOID CopyLayerByName( pVECTORHANDLE pVectorDst, pVECTORHANDLE pVectorSrc, L_TCHAR *pszName )
{
VECTORLAYER LayerSrc, LayerDst;
VECTORLAYERDESC LayerDesc;
L_INT nRet;

/* Get the layer with the given name */
nRet = L_VecGetLayerByName( pVectorSrc, pszName, &LayerSrc );
if( nRet == SUCCESS )
{
/* get the layer properties */
L_VecGetLayer( pVectorSrc, &LayerSrc, &LayerDesc );

/* add to the destination vector */
L_VecAddLayer( pVectorDst, &LayerDesc, &LayerDst , VECTOR_FLAGS_RENAME_DUPLICATES);

/* no need for the layer properties anymore */
L_VecFreeLayer( &LayerDesc );

/* copy content of source layer into destination */
L_VecCopyLayer( pVectorDst, &LayerDst, pVectorSrc, &LayerSrc, 0L );
}
}


L_VecCopyObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopyObject(pVectorDst, pLayerDst, pObjectDst, pVectorSrc, pObjectSrc)

pVECTORHANDLE pVectorDst; | /* pointer to a vector handle */
const pVECTORLAYER pLayerDst; | /* pointer to a vector layer */
pVECTOROBJECT pObjectDst; | /* pointer to a vector object */
const pVECTORHANDLE pVectorSrc; | /* pointer to a vector handle */
const pVECTOROBJECT pObjectSrc; | /* pointer to a vector object */

Copies a vector object to another object. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVectorDst | Pointer to the destination vector handle.
pLayerDst | Pointer to the destination vector layer.
pObjectDst | Pointer to the destination vector object.
pVectorSrc | Pointer to the source vector handle.
pObjectSrc | Pointer to the source vector object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can be used to do the following:

copy an object within the same layer.

copy an object from one layer to another layer within the same vector handle.

copy an object from a layer in one vector handle to a layer in another vector handle.

This function creates a new object that is a carbon copy of the source object, but they are not related. The source object can be deleted after the copying process without affecting the newly copied object.

Setting the pLayerDst parameter to NULL will copy the object into the current active layer in the destination vector handle (pVectorDst).

If the pObjectDst parameter is set to NULL, a handle to the newly added object will not be provided when the function returns. This is similar to calling L_VecAddObject with the pNewObject parameter set to NULL.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddObject, L_VecGetObject, L_VecFreeObject, L_VecSetObject, L_VecExplodeObject
Topics: | Working with Vector Objects

Example

/* This example will copy the object under current mouse cursor to the active layer of another given vector handle */
L_VOID CopyMyObject( pVECTORHANDLE pVectorSrc, pVECTORHANDLE pVectorDst, const POINT *pptMouse )
{
VECTOROBJECT ObjectSrc;
VECTOROBJECT ObjectDst;
L_INT nRet;

/* Get object under mouse cursor */
nRet = L_VecHitTest( pVectorSrc, pptMouse, &ObjectSrc );
if( nRet == SUCCESS )
{
/* Object was found, copy to destination vector handle. Use the current active layer */
L_VecCopyObject( pVectorDst, NULL, &ObjectDst, pVectorSrc, &ObjectSrc );
}
}


L_VecCopyToClipboard

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecCopyToClipboard(hWnd, pVector, dwFlags)

HWND hWnd; | /* handle to the active window */
const pVECTORHANDLE pVector; | /* pointer to the vector handle */
L_UINT32 dwFlags; | /* copy flags */

Copies vector data from the specified vector handle to the clipboard.

Parameter | Description
hWnd | Handle to the active window.
pVector | Pointer to the vector handle that references the vector data to be copied.
dwFlags | Flag that indicates the objects to copy. Possible values are:
 | Value | Meaning
 | 0 | Copy all layers and objects from the source vector to the clipboard.
 | VECTOR_FLAGS_SELECTED_ONLY | Copy only selected objects from the source vector to the clipboard.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function first empties the clipboard, then copies the vector data to it.

To determine whether valid vector data is on the clipboard, call L_VecClipboardReady.

To copy vector data from the clipboard to a vector handle, call L_VecCopyFromClipboard.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecClipboardReady, L_VecCopyFromClipboard.
Topics: | Using the Clipboard

Example

/* This example loads a vector image and copies it to the clipboard, then deletes the original image */
void CopyImage(HWND hWnd)
{
VECTORHANDLE LeadVector; /* Vector handle for the image */

/* Load a vector image */
L_VecLoadFile(TEXT("IMAGE.DXF"), &LeadVector, NULL, NULL );

/* Copy the bitmap to the clipboard */
L_VecCopyToClipboard(hWnd, &LeadVector, 0L);

/* Delete the original vector, leaving the copy in the clipboard */
L_VecFree( &LeadVector );
}


L_VecDeleteGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecDeleteGroup(pVector, pGroup)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */

Deletes the specified group from the vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pGroup | Pointer to a VECTORGROUP structure that references the group to be deleted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Deleting a group also deletes all objects within the group.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddGroup, L_VecEmptyGroup.
Topics: | Working with Vector Groups

Example

/* This example will delete the group with the given name from the vector handle */
L_VOID DeleteGroupByName( pVECTORHANDLE pVector, L_TCHAR *pszName )
{
VECTORGROUP Group;
L_INT nRet;

/* Get the group with the given name */
nRet = L_VecGetGroupByName( pVector, pszName, &Group );
if( SUCCESS == nRet )
L_VecDeleteGroup ( pVector, &Group ); /* Delete it */
}


L_VecDeleteGroupClones

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecDeleteGroupClones(pVector, pGroup, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */
L_UINT32 dwFlags; | /* flags */

Deletes all clones of the specified group from the vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pGroup | Pointer to a VECTORGROUP structure that references the group of which its clones to be deleted.
dwFlags | Can be a combination of the following:
 | Value | Meaning
 | 0 | Delete all clones.
 | VECTOR_FLAGS_SELECTED_ONLY | Delete only the currently selected clones within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddGroup, L_VecEmptyGroup.
Topics: | Working with Vector Groups

Example

/* This example will delete all clones of the group with the given name from the vector handle */
L_VOID DeleteGroupClonesByName( pVECTORHANDLE pVector, L_TCHAR *pszName )
{
VECTORGROUP Group;
L_INT nRet;

/* Get the group with the given name */
nRet = L_VecGetGroupByName( pVector, pszName, &Group );
if( SUCCESS == nRet )
L_VecDeleteGroupClones ( pVector, &Group, 0L ); /* Delete its clones */
}


L_VecDeleteLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecDeleteLayer(pVector, pLayer)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */

Deletes the specified layer from the vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pLayer | Pointer to a VECTORLAYER structure that references the layer to be deleted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Deleting a layer also deletes all objects within the layer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddLayer, L_VecEmptyLayer.
Topics: | Working with Vector Layers

Example

/* This example will delete the layer with the given name from the vector handle */
L_VOID DeleteLayerByName( pVECTORHANDLE pVector, L_TCHAR *pszName )
{
VECTORLAYER Layer;
L_INT nRet;

/* Get the layer with the given name */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( SUCCESS == nRet )
L_VecDeleteLayer ( pVector, &Layer ); /* Delete it */
}


L_VecDeleteObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecDeleteObject(pVector, pObject, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
L_UINT32 dwFlags; | /* flag that indicates which objects to delete */

Deletes an object object from a vector image. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle. Objects within this vector handle will be deleted.
pObject | Pointer to a VECTOROBJECT structure that references the object to be deleted. If this parameter is not NULL, only the specified object will be deleted. If this parameter is NULL, the objects to delete are determined by dwFlags.
dwFlags | Flag that indicates which objects to delete. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Delete all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Delete only the currently selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Deletes all or part of the specified vector image.

Note: | When you delete a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind vertices mode set by L_VecSetBindVerticesMode.
Note: | In DirectX, you cannot delete objects, therefore this function does nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSelectObject, L_VecIsObjectSelected, L_VecHitTest, L_VecSetBindVerticesMode

Example

/* This example will delete the object under the mouse cursor */

L_VOID DeleteMyObject( pVECTORHANDLE pVector, POINT *pptMouse )
{
VECTOROBJECT Object;
L_INT nRet;

/* Get object under mouse pointer */
nRet = L_VecHitTest( pVector, pptMouse, &Object );
if( nRet == SUCCESS )
/* Delete it */
L_VecDeleteObject( pVector, &Object, 0L );
}


L_VecDlg3DOptions

This function has been removed. Refer to L_VecDlgRender.


L_VecDlgCamera

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgCamera(hWnd, pVector, pCamera, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* handle of the window that owns the dialog */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORCAMERA pCamera; | /* pointer to a VECTORCAMERA structure */
L_UINT32 dwFlags; | /* user interface flags for the dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Camera dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the camera values.
pCamera | Pointer to a VECTORCAMERA structure that contains camera values. The values present in pCamera when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, the values used to initialize the dialog will come from the vector handle. When this function returns, this parameter is updated with the values entered through the dialog.
dwFlags | User interface flags that determine the layout and action of the dialog. Possible values are:
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOW_PREVIEW | [0x40000000] show preview of image in dialog.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetCamera, L_VecGetCamera
Topics: | Vector Dialogs
 | Vector Dialogs

Example

/* This example will run the common camera dialog */
void RunCameraDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORCAMERA Camera;
L_VecGetCamera (pVector, &Camera);
L_VecDlgCamera( hWnd, pVector, &Camera, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecDlgEditAllGroups

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgEditAllGroups(hWnd, pVector, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Edit Groups dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by this dialog.
dwFlags | Reserved for future used. Must be 0.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgNewGroup, L_VecDlgEditGroup
Topics: | Vector Dialogs

Example

/* This example will run the common edit groups options dialog */
void RunEditGroupsDialog( HWND hWnd, pVECTORHANDLE pVector )
{
L_VecDlgEditAllGroups(hWnd, pVector, 0L, NULL, NULL );
}


L_VecDlgEditAllLayers

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgEditAllLayers(hWnd, pVector, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Edit Layers dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by this dialog.
dwFlags | Reserved for future used. Must be 0.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgNewLayer, L_VecDlgEditLayer.
Topics: | Vector Dialogs

Example

/* This example will run the common edit layers options dialog */
void RunEditLayersDialog( HWND hWnd, pVECTORHANDLE pVector )
{
L_VecDlgEditAllLayers (hWnd, pVector, 0L, NULL, NULL );
}


L_VecDlgEditGroup

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgEditGroup(hWnd, pVector, pGroup, pGroupDesc, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORGROUP pGroup; | /* pointer to a vector group */
pVECTORGROUPDESC pGroupDesc; | /* pointer to a structure */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Edit Group dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the edit group dialog.
pGroup | Pointer to a VECTORGROUP structure that references the group to be edited.
pGroupDesc | Pointer to a VECTORGROUPDESC structure that contains group parameters. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, values obtained from the pGroup parameter will be used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure will be updated with the values entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
 | VECTOR_DLG_NO_RETURN_DUPLICATE | [0x00000001] do not return duplicate group names.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgEditAllGroups, L_VecDlgNewGroup
Topics: | Vector Dialogs

Example

/* This example will edit the given group */
void EditGroup ( HWND hWnd, pVECTORHANDLE pVector, const L_TCHAR *pszGroupName )
{
VECTORGROUP Group;
L_VecGetGroupByName ( pVector, pszGroupName, &Group);
L_VecDlgEditGroup ( hWnd, pVector, &Group, NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}


L_VecDlgEditLayer

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgEditLayer(hWnd, pVector, pLayer, pLayerDesc, pbActiveLayer, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORLAYER pLayer; | /* pointer to a vector layer */
pVECTORLAYERDESC pLayerDesc; | /* pointer to a structure */
L_BOOL L_FAR * pbActiveLayer; | /* pointer to the active later flag */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Edit Layer dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the new layer dialog.
pLayer | Pointer to a VECTORLAYER structure that references the layer to be edited.
pLayerDesc | Pointer to a VECTORLAYERDESC structure that contains layer parameters. The values present in the structure when the function is called, are used to initialize the dialog. If this parameter is NULL when the function is called, values obtained from the pLayer parameter will be used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure will be updated with the values entered through the dialog.
pbActiveLayer | Pointer to an L_BOOL variable that indicates whether or not to use the active layer. The value present in the variable when the function is called is used to initialize the dialog. If this parameter is NULL when the function is called, a value obtained from the pLayer and pVector parameters will be used to initialize the dialog. When this function returns, if this parameter is not NULL, the variable will be updated with the value entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
 | VECTOR_DLG_NO_RETURN_DUPLICATE | [0x00000001] do not return duplicate layer names.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgEditAllLayers, L_VecDlgNewLayer.
Topics: | Vector Dialogs

Example

/* This example will edit the current active layer in the given vector handle */
void EditActiveLayer( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORLAYER Layer;
L_VecGetActiveLayer ( pVector, &Layer );
L_VecDlgEditLayer( hWnd, pVector, &Layer, NULL,
 NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}


L_VecDlgEditObject

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgEditObject(hWnd, pVector, pObject, nType, pObjectDesc, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
L_INT nType; | /* object type to edit */
L_VOID L_FAR * pObjectDesc; | /* pointer to a structure */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Edit Object dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that contains the object to edit.
pObject | Pointer to the vector object to be edited.
nType | Object type. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CLONE | Clone object of a vector group.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a structure that contains object information about the object to edit. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, values from pObject will be used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure will be updated with the values entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgNewObject.
Topics: | Vector Dialogs

Example

/* This example will edit the object under the given point */
void EditObject( HWND hWnd, pVECTORHANDLE pVector, const POINT *ppt )
{
VECTOROBJECT Object;
L_INT nRet;
/* get the object under the point */
nRet = L_VecHitTest ( pVector, ppt, &Object );
if( nRet == SUCCESS )
{
/* there was an object under the point, edit it */
L_VecDlgEditObject( hWnd, pVector, &Object, Object.nType, NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}
}


L_VecDlgGetString

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgGetString(uString, pszString)

L_UINT32 uString; | /* index of a string */
L_TCHAR L_FAR * pszString; | /* pointer to the variable to be updated */

Gets the current string for the specified index.

Parameter | Description
uString | Index into a list of strings. For a list of the strings, refer to Dialog Strings.
pszString | Pointer to the buffer to be updated with the current string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, call L_VecDlgGetStringLen to get the length of the text you want to retrieve.

Use L_VecDlgSetString to modify the automated menu item.

Before calling this function, you must declare a variable as a pointer to a character string. Then, pass the variable in the pString parameter. This function will update the variable with the character string at the given index.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgGetStringLen, L_VecDlgSetString
Topics: | Vector Dialogs

Example

For an example, refer to L_VecDlgSetString.


L_VecDlgGetStringLen

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgGetStringLen(uString, puLen)

L_UINT32 uString; | /* index of a string */
L_UINT L_FAR * puLen; | /* pointer to the variable to be updated */

Gets the length of the string at the specified index.

Parameter | Description
uString | Index into a list of strings. For a list of the strings, refer to Dialog Strings.
puLen | Pointer to an unsigned integer variable to be updated with the length of the item's current character string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Once you know the length of the string at the specified index, retrieve the text by calling L_VecDlgGetString.

Use L_VecDlgSetString to modify the text.

Before calling this function, you must declare an unsigned integer variable. Then, pass the address of the variable in the puLen parameter. This function will update the variable with the length of the automation item's character string.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgGetString, L_VecDlgSetString
Topics: | Vector Dialogs

Example

For an example, refer to L_VecDlgSetString.


L_VecDlgHitTest

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgHitTest(hWnd, pVector, pHitTest, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORHITTEST pHitTest; | /* hit test options */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Hit Test Options dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the hit test options.
pHitTest | Pointer to a VECTORHITTEST structure that contains hit test options. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, the values used to initialize the dialog will come from the vector handle. When this function returns, if this parameter is not NULL, the structure pointed to by pHitTest is updated with the values entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOW_PREVIEW | [0x40000000] show preview of image in dialog.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To get the current hit test settings use L_VecGetHitTest.

Hit test settings can also be set by calling L_VecSetHitTest.

The hit test can be performed by calling L_VecHitTest.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetHitTest, L_VecSetHitTest, L_VecHitTest.
Topics: | Vector Dialogs

Example

/* This example will run the common hit test options dialog */
void RunHitTestDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORHITTEST Hittest;
L_VecGetHitTest( pVector, &Hittest );
L_VecDlgHitTest ( hWnd, pVector, &Hittest, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecDlgNewGroup

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgNewGroup(hWnd, pVector, pGroupDesc, pGroup, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORGROUPDESC pGroupDesc; | /* pointer to a structure */
pVECTORGROUP pGroup; | /* pointer to a vector group */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector New Group dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the new group dialog.
pGroupDesc | Pointer to a VECTORGROUPDESC structure that contains new group parameters. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, default values are used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure pointed to by pGroupDesc is updated with the values entered through the dialog.
pGroup | Pointer to a VECTORGROUP structure. If this parameter is not NULL and VECTOR_DLG_AUTO_PROCESS is specified in dwFlags, the structure pointed to by pGroup will be updated with the newly added group structure.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
 | VECTOR_DLG_NO_RETURN_DUPLICATE | [0x00000001] do not return duplicate group names.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgEditAllGroups, L_VecDlgEditGroup.
Topics: | Vector Dialogs

Example

/* This example will add a new group to the given vector handle */
void AddGroup( HWND hWnd, pVECTORHANDLE pVector )
{
L_VecDlgNewGroup ( hWnd, pVector, NULL, NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}


L_VecDlgNewLayer

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgNewLayer(hWnd, pVector, pLayerDesc, pLayer, pbActiveLayer, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORLAYERDESC pLayerDesc; | /* pointer to a structure */
pVECTORLAYER pLayer; | /* pointer to a vector layer */
L_BOOL L_FAR * pbActiveLayer; | /* pointer to the active layer flag */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector New Layer dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the new layer dialog.
pLayerDesc | Pointer to a VECTORLAYERDESC structure that contains new layer parameters. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, default values are used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure pointed to by pLayerDesc is updated with the values entered through the dialog.
pLayer | Pointer to a VECTORLAYER structure. If this parameter is not NULL and VECTOR_DLG_AUTO_PROCESS is specified in dwFlags, the structure pointed to by pLayer will be updated with the newly added layer structure.
pbActiveLayer | Pointer to an L_BOOL variable that indicates whether or not to use the active layer. The value present in the variable, when the function is called, is used to initialize the dialog. If this parameter is NULL when the function is called, a default value (TRUE) is used to initialize the dialog. When this function returns, if this parameter is not NULL, the variable will be updated with the value entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
 | VECTOR_DLG_NO_RETURN_DUPLICATE | [0x00000001] do not return duplicate layer names.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgEditAllLayers, L_VecDlgEditLayer.
Topics: | Vector Dialogs

Example

/* This example will add a new layer to the given vector handle */
void AddLayer( HWND hWnd, pVECTORHANDLE pVector )
{
L_VecDlgNewLayer ( hWnd, pVector, NULL, NULL, NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}


L_VecDlgNewObject

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgNewObject(hWnd, pVector, pLayer, nType, pObjectDesc, pObject, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */
L_INT nType; | /* object type */
L_VOID L_FAR * pObjectDesc; | /* pointer to a structure */
pVECTOROBJECT pObject; | /* pointer to the new vector object */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the New Object dialog. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the destination vector handle.
pLayer | Pointer to the destination vector layer. If this parameter is NULL, the object will be added to the current active layer of the specified vector handle.
nType | Object type. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_CHORD | Chord.
 | VECTOR_CLONE | Clone object of a vector group.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a structure that contains object information about the object to add. The values present in the structure when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, default values will be used to initialize the dialog. When this function returns, if this parameter is not NULL, the structure will be updated with the values entered through the dialog.
pObject | Pointer to a VECTOROBJECT structure to be updated with the object information of the newly added object.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the vector on OK.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecDlgEditObject.

Example

/* This example will add a new line object to the active layer of the given vector handle */
void AddLine( HWND hWnd, pVECTORHANDLE pVector )
{
L_VecDlgNewObject( hWnd, pVector, NULL, VECTOR_LINE, NULL, NULL, VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
}


L_VecDlgRender

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgRender(hWnd, pVector, pbUseLights, pColorAmbient, pnPolygonMode, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_BOOL L_FAR * pbUseLights; | /* flag that indicates whether to use lights */
COLORREF L_FAR * pColorAmbient; | /* ambient color */
L_INT L_FAR * pnPolygonMode; | /* polygon draw mode */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Render Options dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the render options.
pbUseLights | Pointer to an L_BOOL variable that indicates whether or not to use lights. The value present in the L_BOOL variable when the function is called is used to initialize the dialog. If this parameter is NULL when the function is called, the value used to initialize the dialog will come from the vector handle. When this function returns, if this parameter is not NULL, the variable pointed to by pbUseLights is updated with the value entered through the dialog.
pColorAmbient | Pointer to a COLORREF variable that contains an ambient color. The value present in the COLORREF variable when the function is called is used to initialize the dialog. If this parameter is NULL when the function is called, the value used to initialize the dialog will come from the vector handle. When this function returns, if this parameter is not NULL, the variable pointed to by pColorAmbient is updated with the value entered through the dialog.
pnPolygonMode | Pointer to an L_INT variable that contains a polygon mode value. The value present in the variable when the function is called is used to initialize the dialog. If this parameter is NULL when the function is called, the value used to initialize the dialog will come from the vector handle. When this function returns, if this parameter is not NULL, the variable pointed to by pnPolygonMode is updated with the value entered through the dialog. For a list of possible polygon mode values, refer to L_VecGetPolygonMode or L_VecSetPolygonMode.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOW_PREVIEW | [0x40000000] show preview of image in dialog.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function lets you change the current light use, the ambient color, and the polygon draw mode. Updating the variables is not affected by whether or not an object is selected.

If the GDI engine is being used, the bUseLights and pColorAmbient variables are not used.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetUseLights, L_VecSetUseLights, L_VecGetAmbientColor, L_VecSetAmbientColor, L_VecGetPolygonMode, L_VecSetPolygonMode.
Topics: | Vector Dialogs

Example

/* This example will run the common render options dialog */
void RunRenderptionsDialog( HWND hWnd, pVECTORHANDLE pVector )
{
L_BOOL bUseLights;
COLORREF ColorAmbient;
L_INT nPolygonMode;

bUseLights = L_VecGetUseLights ( pVector );
ColorAmbient = L_VecGetAmbientColor ( pVector );
nPolygonMode = L_VecGetPolygonMode ( pVector );
L_VecDlgRender( hWnd, pVector, &bUseLights, &ColorAmbient, &nPolygonMode, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );

}


L_VecDlgRotate

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgRotate(hWnd, pVector, pRotation, pOrigin, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pRotation; | /* pointer to a VECTORPOINT structure */
const pVECTORPOINT pOrigin; | /* pointer to a VECTORPOINT structure */
L_UINT32 dwFlags; | /* user interface flags for dialog*/
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Rotation dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be rotated.
pRotation | Pointer to a VECTORPOINT structure that contains rotation values. The values present in pRotation when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, the values used to initialize the dialog will come from the vector handle. When this function returns, this parameter is updated with the values entered through the dialog.
pOrigin | Pointer to a VECTORPOINT structure that contains the origin of the rotation. (The point about which the rotation occurs.) If pOrigin is not NULL, rotation occurs around this point. If pOrigin is NULL, the center of rotation is the accumulative center of the objects to be rotated.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTOPROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOWPREVIEW | [0x40000000] show preview of image in dialog.
 | VECTOR_DLG_SELECTEDONLY | [0x00000001] rotate only selected objects.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If no objects are currently selected in the source vector handle, all of the objects in the vector handle will be rotated in the dialog.

If there are selected objects inside the source vector handle, only those objects will be rotated in the dialog.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetRotation, L_VecGetRotation, L_VecGetOrigin, L_VecSetOrigin, L_VecDlgScale, L_VecDlgTranslate

Example

/* This example will run the common rotate dialog */
void RunRotateDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORPOINT Point;
L_VecGetRotation (pVector, &Point);
L_VecDlgRotate( hWnd, pVector, &Point, NULL, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecDlgScale

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgScale(hWnd, pVector, pScale, pOrigin, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* handle of the window that owns the dialog */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pScale; | /* pointer to a VECTORPOINT structure */
const pVECTORPOINT pOrigin; | /* pointer to a VECTORPOINT structure */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Scale dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be scaled.
pScale | Pointer to a VECTORPOINT structure that contains scale values. The values present in pScale when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, the values used to initialize the dialog will come from the vector handle. When this function returns, this parameter is updated with the values entered through the dialog.
pOrigin | Pointer to a VECTORPOINT structure that contains the origin of the scale. (The point about which the scaling occurs.) If pOrigin is not NULL, scaling occurs around this point. If pOrigin is NULL, the center of scaling is the accumulative center of the objects to be scaled.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTOPROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOWPREVIEW | [0x40000000] show preview of image in dialog.
 | VECTOR_DLG_SELECTEDONLY | [0x00000001] scale only selected objects.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If no objects are currently selected in the source vector handle, all of the objects in the vector handle will be scaled in the dialog.

If there are selected objects inside the source vector handle, only those objects will be scaled in the dialog.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetScale, L_VecGetScale, L_VecSetOrigin, L_VecGetOrigin, L_VecDlgRotate, L_VecDlgTranslate

Example

/* This example will run the common scale dialog */
void RunScaleDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORPOINT Point;
L_VecGetScale (pVector, &Point);
L_VecDlgScale( hWnd, pVector, &Point, NULL, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecDlgSetFont

#include "lvdlg.h"

HFONT EXT_FUNCTION L_VecDlgSetFont(hFont)

HFONT hFont;

/* handle to the selected font */

Sets the font for the dialogs to use.

Parameter | Description
hFont | Handle to the selected font.

Returns

!NULL | The previous font.
NULL | An error occurred.

Comments

The default font is HELV size 8.

Call this function with hFont set to NULL to use the default font.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgGetStringLen, L_VecDlgGetString, L_VecDlgSetString
Topics: | Vector Dialogs

Example

For an example, refer to L_VecDlgSetString.


L_VecDlgSetString

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgSetString(uString, pszString)

L_UINT32 uString; | /* index of a string */
const L_TCHAR L_FAR * pszString; | /* character string that contains the string to set */

Sets the new string for the specified index

Parameter | Description
uString | Index into a list of strings. For a list of the strings, refer to Dialog Strings.
pszString | Character string that contains the new string to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To retrieve the character string for a specified index, use L_VecDlgGetStringLen to determine the length of the string and to allocate a buffer of appropriate size. Then call L_VecDlgGetString to retrieve the string.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecDlgGetStringLen, L_VecDlgGetString
Topics: | Vector Dialogs

Example

L_VOID TestFunc2(HWND hWnd, pVECTORHANDLE pVector)
{
HFONT hMyFont=NULL;
HDC hDC;
L_TCHAR L_FAR* pszString=NULL;
L_UINT uLen;
L_TCHAR szNewCaption[] = TEXT("My New Rotate Caption");

hDC = GetDC( NULL );

/* set a custom font and string for the rotate dialog */
/* NOTE, you should change the font name to a font on your system */
hMyFont = CreateFont( -MulDiv( 8, GetDeviceCaps( hDC, LOGPIXELSY ), 72),
0, 0, 0,
FW_BOLD, FALSE, FALSE, FALSE,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, DEFAULT_PITCH,
TEXT("Bones"));
L_VecDlgSetFont( hMyFont );

/* get the default caption string */
L_VecDlgGetStringLen( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, &uLen );
pszString = (L_TCHAR L_FAR*) GlobalAllocPtr( GHND, uLen * sizeof( L_TCHAR ) + 1 ); /* add 1, for the terminating NULL */
L_VecDlgGetString( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, pszString );

/* display default caption string */
MessageBox( hWnd, pszString, TEXT("Default"), MB_OK );
GlobalFreePtr( pszString );

/* change caption string */
L_VecDlgSetString ( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, szNewCaption );

/* now, display the dialog to see our changes */
L_VecDlgRotate( hWnd,
pVector,
NULL,
NULL,
VECTOR_DLG_SHOW_PREVIEW | VECTOR_DLG_AUTO_PROCESS, NULL, NULL );

L_VecDlgSetFont( NULL );
DeleteObject( hMyFont );
ReleaseDC( NULL, hDC );
}


L_VecDlgTranslate

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecDlgTranslate(hWnd, pVector, pTranslation, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* handle of the window that owns the dialog */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pTranslation; | /* pointer to a VECTORPOINT structure */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector Translation dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be translated.
pTranslation | Pointer to a VECTORPOINT structure that contains translation values. The values present in pTranslation when the function is called are used to initialize the dialog. If this parameter is NULL when the function is called, the values used to initialize the dialog will come from the vector handle. When this function returns, this parameter is updated with the values entered through the dialog.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTOPROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOWPREVIEW | [0x40000000] show preview of image in dialog.
 | VECTOR_DLG_SELECTEDONLY | [0x00000001] translate only selected objects.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If no objects are currently selected in the source vector handle, all of the objects in the vector handle will be translated in the dialog.

If there are selected objects inside the source vector handle, only those objects will be translated in the dialog.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetTranslation, L_VecGetTranslation, L_VecDlgScale, L_VecDlgRotate

Example

/* This example will run the common translate dialog */
void RunTranslateDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORPOINT Point;

L_VecGetTranslation (pVector, &Point);
L_VecDlgTranslate( hWnd, pVector, &Point, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecDlgViewMode

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgViewMode(hWnd, pVector, pnViewMode, dwFlags, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT L_FAR * pnViewMode; | /* view mode */
L_UINT32 dwFlags; | /* user interface flags for dialog */
LVCOMMDLGHELPCB pfnCallback; | /* pointer to a help callback function */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Brings up the Vector View Mode dialog.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pVector | Pointer to the vector handle that references the vector image to be affected by the view mode options.
pnViewMode | Pointer to an L_INT variable that contains a view mode value. The value present in the L_INT variable when the function is called is used to initialize the dialog. If this parameter is NULL when the function is called, the value used to initialize the dialog will come from the vector handle. When this function returns, if this parameter is not NULL, the variable pointed to by pnViewMode is updated with the value entered through the dialog. For a list of valid view mode values, refer to L_VecSetViewMode or L_VecGetViewMode.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog.
 | Value | Meaning
 | VECTOR_DLG_AUTO_PROCESS | [0x80000000] process the image on OK.
 | VECTOR_DLG_SHOW_PREVIEW | [0x40000000] show preview of image in dialog.
pfnCallback | Pointer to an optional help callback function.
 | If you do not wish to provide help to this dialog, use NULL as the value of this parameter.
 | To provide help to this dialog, use the function pointer as the value of this parameter.
 | The callback function must adhere to the prototype described in LVCOMMDLGHELPCB.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetViewMode, L_VecSetViewMode.
Topics: | Vector Dialogs

Example

/* This example will run the common view mode options dialog */
void RunViewModeDialog( HWND hWnd, pVECTORHANDLE pVector )
{
L_INT nViewMode;

nViewMode = L_VecGetViewMode ( pVector );

L_VecDlgViewMode( hWnd, pVector, &nViewMode, VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW, NULL, NULL );
}


L_VecEmpty

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEmpty(pVector)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

Deletes all layers and objects from the specified vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle that references the vector image to be emptied.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Calling this function will not affect other settings such as camera, transformation, etc.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecIsEmpty, L_VecInit, L_VecCopy, L_VecLoadFile, L_VecAddLayer, L_VecAddObject
Topics: | Working with Vector Handles

Example

/* This example empties a vector handle. */

void TestVecEmpty ( pVECTORHANDLE pVector )

{

L_INT nRet; /* return value */

nRet = L_VecEmpty ( pVector );

if( nRet != SUCCESS )

{

MessageBox( NULL, TEXT("Error while emptying the vector!"), NULL, MB_OK );

}

}


L_VecEmptyGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEmptyGroup(pVector, pGroup)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */

Empties the specified group. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pGroup | Pointer to a VECTORGROUP structure that references the group to be emptied.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The specified group is emptied by deleting all objects within that group.

To delete a group, call L_VecDeleteGroup.

After calling this function, all clone objects of this group will reflect the change immediately.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddGroup, L_VecDeleteGroup, L_VecCopyGroup, L_VecDeleteGroupClones, L_VecAddObjectToGroup, L_VecGetGroup, L_VecGetGroupByIndex, L_VecGetGroupByName
Topics: | Working with Vector Groups

Example

/* This example will delete all objects inside the group with the given name */
L_VOID EmptyGroupByName( pVECTORHANDLE pVector, L_TCHAR *pszName )
{
VECTORGROUP Group;
L_INT nRet;

/* Get the group with the given name */
nRet = L_VecGetGroupByName( pVector, pszName, &Group );
if( SUCCESS == nRet )
L_VecEmptyGroup ( pVector, &Group ); /* empty out */
}


L_VecEmptyLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEmptyLayer(pVector, pLayer)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */

Empties the specified layer. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pLayer | Pointer to a VECTORLAYER structure that references the layer to be emptied.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The specified layer is emptied by deleting all objects within that layer.

To delete a layer, call L_VecDeleteLayer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddLayer, L_VecDeleteLayer, L_VecCopyLayer, L_VecAddObject, L_VecCopyObject, L_VecGetLayer, L_VecGetLayerByIndex, L_VecGetLayerByName
Topics: | Working with Vector Layers

Example

/* This example will delete all objects inside the layer with the given name */
L_VOID EmptyLayerByName( pVECTORHANDLE pVector, L_TCHAR *pszName )
{
VECTORLAYER Layer;
L_INT nRet;

/* Get the layer with the given name */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( SUCCESS == nRet )
L_VecEmptyLayer( pVector, &Layer ); /* empty out */
}


L_VecEnumGroups

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumGroups(pVector, pEnumProc, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORENUMGROUPSPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Enumerates all groups inside a vector handle.

Parameter | Description
pVector | Pointer to a vector handle. The groups within this vector handle will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the groups within the vector handle. The callback function must adhere to the function prototype described in VECTORENUMGROUPSPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumGroups function calls the callback function as it gets the handle of each vector group.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | VECTORENUMGROUPSPROC
Topics: | Working with Vector Groups

Example

L_INT EXT_CALLBACK MyEnumGroupsProc( pVECTORHANDLE pVector, pVECTORGROUP pGroup, L_VOID * pUserData )
{
VECTORGROUPDESC GroupDesc;

UNREFERENCED_PARAMETER( pUserData );

/* show group name */
L_VecGetGroup( pVector, pGroup, &GroupDesc );
MessageBox( NULL, GroupDesc.szName, TEXT("Group Name"), MB_OK );
L_VecFreeGroup( &GroupDesc );

/* Continue enumerating */
return SUCCESS;
}

void TestEnumGroups ( pVECTORHANDLE pVector )

{

/* Enumerate all groups */

L_VecEnumGroups( pVector, (pVECTORENUMGROUPSPROC)MyEnumGroupsProc, NULL );

}


L_VecEnumLayers

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumLayers(pVector, pEnumProc, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORENUMLAYERSPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Enumerates all layers inside a vector handle.

Parameter | Description
pVector | Pointer to a vector handle. The layers within this vector handle will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the layers within the vector handle. The callback function must adhere to the function prototype described in VECTORENUMLAYERSPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumLayers function calls the callback function as it gets the handle of each vector layer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | VECTORENUMLAYERSPROC
Topics: | Working with Vector Layers

Example

/* This example will show the names of all layers inside a vector handle */
L_INT EXT_CALLBACK MyEnumLayersProc( pVECTORHANDLE pVector, pVECTORLAYER pLayer, L_VOID * pUserData )
{
VECTORLAYERDESC LayerDesc;

UNREFERENCED_PARAMETER( pUserData );

/* show layer name */
L_VecGetLayer( pVector, pLayer, &LayerDesc );
MessageBox( NULL, LayerDesc.szName, TEXT("Layer Name"), MB_OK );
L_VecFreeLayer( &LayerDesc );

/* Continue enumerating */
return SUCCESS;
}

void TestEnumLayers ( pVECTORHANDLE pVector )

{

/* Enumerate all layers */

L_VecEnumLayers( pVector, (pVECTORENUMLAYERSPROC)MyEnumLayersProc, NULL );

}


L_VecEnumObjects

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumObjects(pVector, pEnumProc, pUserData, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORENUMOBJECTSPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT32 dwFlags; | /* flags */

Enumerates all objects inside a vector handle.

Parameter | Description
pVector | Pointer to a vector handle. The objects within this vector handle will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the vertices within the vector handle. The callback function must adhere to the function prototype described in VECTORENUMOBJECTSPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | o use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | f the additional parameters are not needed, you can pass NULL in this parameter.
dwFlags | Flag that indicates which objects to enumerate. Possible values are:
 | Value | Meaning
 | 0 | umerate all objects within the vector handle.
 | VECTOR_FLAGS_SELECTED_ONLY | Enumerate only the selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

n DirectX and OpenGL, you cannot enumerate objects, therefore this function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecEnumObjectsInLayer, L_VecEnumVertices

Example

For an example, refer to L_VecIsObjectInsideRect.


L_VecEnumObjectsInGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumObjectsInGroup(pVector, pGroup, pEnumProc, pUserData, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */
pVECTORENUMOBJECTSPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT32 dwFlags; | /* flags */

Enumerates all objects inside a vector group.

Parameter | Description
pVector | Pointer to a vector handle.
pGroup | Pointer to a vector group. The objects inside this group will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the objects within the vector group. The callback function must adhere to the function prototype described in VECTORENUMOBJECTSPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
dwFlags | Flag that indicates which objects to enumerate. Possible values are:
 | Value | Meaning
 | 0 | Enumerate all objects in the group.
 | VECTOR_FLAGS_SELECTED_ONLY | Enumerate only selected objects in the group.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

In DirectX and OpenGL engines, you cannot enumerate objects, therefore this function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecEnumObjects, L_VecEnumVertices, VECTORENUMOBJECTSPROC
Topics: | Working with Vector Groups

Example

/* This example will count the objects inside a given group */

L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE pVector, pVECTOROBJECT pObject, L_VOID *pData )
{
L_INT nCount;

UNREFERENCED_PARAMETER( pVector );
UNREFERENCED_PARAMETER( pObject );

/* Increment count */
nCount = *(L_INT*) pData;
nCount++;

/* Continue the enumeration */
return( SUCCESS );
}

L_INT GetObjectCount( pVECTORHANDLE pVector, const L_TCHAR *pszGroupName )
{
VECTORGROUP Group;
L_INT nCount;

/* Get the group handle */
L_VecGetGroupByName( pVector, pszGroupName, &Group );

/* Enum all objects inside this group */
nCount = 0;
L_VecEnumObjectsInGroup( pVector, &Group, (pVECTORENUMOBJECTSPROC)EnumObjectsProc, &nCount, 0 );

return nCount;
}


L_VecEnumObjectsInLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumObjectsInLayer(pVector, pLayer, pEnumProc, pUserData, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */
pVECTORENUMOBJECTSPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT32 dwFlags; | /* flags */

Enumerates all objects inside a vector layer.

Parameter | Description
pVector | Pointer to a vector handle.
pLayer | Pointer to a vector layer. The objects inside this layer will be enumerated. If this parameter is NULL, objects inside the current active layer in the vector handle will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the vertices within the vector handle. The callback function must adhere to the function prototype described in VECTORENUMOBJECTSPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
dwFlags | Flag that indicates which objects to enumerate. Possible values are:
 | Value | Meaning
 | 0 | Enumerate all objects in the layer.
 | VECTOR_FLAGS_SELECTED_ONLY | Enumerate only selected objects in the layer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

In DirectX and OpenGL engines, you cannot enumerate objects, therefore this function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecEnumObjects, L_VecEnumVertices, VECTORENUMOBJECTSPROC
Topics: | Working with Vector Objects

Example

/* This example will select all objects inside the current active layer */
L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE pVector, pVECTOROBJECT pObject, L_VOID *pData )
{
VECTOROBJECT ObjectDesc;

UNREFERENCED_PARAMETER( pData );

/* Select the object */
L_VecGetObject( pVector, pObject, VECTOR_OBJECT, &ObjectDesc );
ObjectDesc.dwFlags |= VECTOR_OBJECT_SELECTED;
L_VecSetObject( pVector, pObject, VECTOR_OBJECT, &ObjectDesc );
L_VecFreeObject( VECTOR_OBJECT, &ObjectDesc );

/* Continue the enumeration */
return( SUCCESS );
}

/* Enum all objects inside the current active layer */
L_VecEnumObjectsInLayer( pVector, NULL, (pVECTORENUMOBJECTSPROC)EnumObjectsProc, NULL, 0L );


L_VecEnumVertices

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEnumVertices(pVector, pEnumProc, pUserData, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORENUMVERTICESPROC pEnumProc; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT32 dwFlags; | /* flags that determine which object's flags to enumerate */

Enumerates all vertices within the vector handle.

Parameter | Description
pVector | Pointer to a vector handle. All vertices within this vector handle will be enumerated.
pEnumProc | Pointer to the callback function used to enumerate the vertices within the vector handle. The callback function must adhere to the function prototype described in VECTORENUMVERTICESPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
dwFlags | Flags that determine which object's vertices to enumerate. Possible values are:
 | Value | Meaning
 | 0 | Enumerate the vertices of all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Enumerate the vertices of selected objects only.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will enumerate all the vertices in the given vector.

Note:

In OpenGL and DirectX, you cannot enumerate vertices, therefore this function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecEnumObjects, L_VecEnumObjectsInLayer

Example

/* This example will do a certain user-defined algorithm on all vertices inside the drawing. */

static L_INT EXT_CALLBACK MyEnumProc( pVECTORHANDLE, pVECTORPOINT, L_VOID *);

void DoAlgorithm1( pVECTORHANDLE pVector )
{
/* enumerate vertices */
L_VecEnumVertices( pVector, MyEnumProc, NULL, 0L );
}

static L_INT EXT_CALLBACK MyEnumProc( pVECTORHANDLE pVector, pVECTORPOINT pVertex, L_VOID *pUserData)
{
/* call our custom filter function */
DoSoAndSoWithVertex( pVertex );

return( 1 ); /* Continue enumeration */
}


L_VecEvent

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecEvent(pVector, pEvent)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOREVENT pEvent; | /* pointer to a structure */

Implements a user-defined event.

Parameter | Description
pVector | Pointer to a vector handle.
pEvent | Pointer to a VECTOREVENT structure that describes the event that has occurred inside the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function provides a means of grouping numerous operations into one event. This function must be called twice. In the first call to this function the Status member of the VECTOREVENT structure must be set to VECTOR_EVENT_STATUS_BEFORE. This allows any callback currently installed to cancel the operation. The return value for this function will be the return value of the callback function.

The second call to this function is made after the operation(s) has(have) been completed. The Status member of the VECTOREVENT structure must be set to VECTOR_EVENT_STATUS_AFTER to notify the vector toolkit that the operation(s) has(have) been completed successfully.

For information on the types of events the vector handle can generate, refer to the VECTOREVENT structure.

This function generates a call to the VECTOREVENTPROC callback function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetEventCallback
Topics: | Vector Handle Events

Example

/* This example will wrap multiple operations on a vector handle with a single user-defined event */

#define MY_CUSTOM_EVENT (VECTOR_EVENT_USER+1)

void Func( pVECTORHANDLE pVector )
{
L_INT nRet;
VECTOREVENT Event;
VECTORPOINT Point;

/* Fire our new event, giving all event callbacks in the vector handle a chance to cancel our operation */
memset( &Event, 0, sizeof( Event ) );
Event.nSize = sizeof( Event );
Event.uType = MY_CUSTOM_EVENT;

Event.Status = VECTOR_EVENT_STATUS_BEFORE;
nRet = L_VecEvent( pVector, &Event );
if( nRet != SUCCESS )
{
/* a callback has returned something other than success, we should cancel */
return;
}

/* do the operation, for example, rotate, translate and scale */

Point.x = 10.0; Point.y = 20.0; Point.z = 30.0;
L_VecSetRotation( pVector, &Point, NULL, NULL, 0L );

Point.x = 4.0; Point.y = 4.0; Point.z = 4.0;
L_VecSetTranslation( pVector, &Point, NULL, 0L );

Point.x = 0.5; Point.y = 0.5; Point.z = 0.5;
L_VecSetScale( pVector, &Point, NULL, NULL, 0L );

/* notify the vector handle that the operation is done */
Event.Status = VECTOR_EVENT_STATUS_AFTER;
L_VecEvent( pVector, &Event );
}


L_VecExplodeObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecExplodeObject(pVector, pObject, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
L_UINT32 dwFlags; | /* flag */

Explodes a vector object or objects to smaller parts. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a vector object.
dwFlags | Flag that indicates which object(s) to explode. Possible values are:
 | Value | Meaning
 | 0 | Explode all objects
 | VECTOR_FLAGS_SELECTED_ONLY | Explode only selected objects.
 | VECTOR_FLAGS_EXPLODE_TO_LINES | Explode object into lines.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If pObject is NULL and dwFlags is set to VECTOR_FLAGS_SELECTED_ONLY, this function will explode only selected objects within the vector handle.

If pObject is NULL and dwFlags is set to 0, this function will explode all objects within the vector handle.

If pObject is not NULL, only the specified object is exploded and dwFlags is ignored.

If the VECTOR_FLAGS_EXPLODE_TO_LINES flag is not specified, then not all objects can be exploded. For example an attempt to explode a VECTOR_LINE has no effect and returns SUCCESS.

Below is a list of object types and the objects into which they explode:

Object type | After L_VecExplodeObject
VECTOR_ARC | Same.
VECTOR_CHORD | Same.
VECTOR_CIRCLE | Same.
VECTOR_CLONE | The objects inside the group will be added to the vector handle.
VECTOR_ELLIPSE | Same.
VECTOR_ELLIPTICALARC | Same.
VECTOR_LINE | Same.
VECTOR_PIE | Same.
VECTOR_POLYBEZIER | ( (nPointCount + 2) / 3 ) - 1 VECTOR_POLYBEZIERs.
VECTOR_POLYDRAW | VECTOR_LINEs and VECTOR_POLYBEZIERs.
VECTOR_POLYGON | nPointCount + 1 VECTOR_LINEs
VECTOR_POLYLINE | nPointCount of VECTOR_LINE's.
VECTOR_RASTER | Same.
VECTOR_RECTANGLE | 4 VECTOR_LINE's.
VECTOR_TEXT | Same.
VECTOR_VERTEX | Same.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Topics:

Working with Vector Objects

Example

void TestVecExplodeObject (pVECTORHANDLE pVector )

{

/* This example will explode all selected objects inside a vector handle */

L_VecExplodeObject( pVector, NULL, VECTOR_FLAGS_SELECTED_ONLY );

}


L_VecFree

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecFree(pVector)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

Frees storage allocated for the specified vector image.

Parameter | Description
pVector | Pointer to a vector handle referencing the vector image to free.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when your program no longer needs the vector data.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecInit, L_VecCopy, L_VecLoadFile

Example

/* This example loads a DXF file and convert into WMF. */

void ConvertDXFToWMF( L_TCHAR L_FAR *pszDXFFile, L_TCHAR L_FAR *pszWMFFile )
{
VECTORHANDLE TmpVec;

/* Load DXF file. */
L_VecLoadFile( pszDXFFile, &TmpVec, NULL, NULL );

/* Convert to WMF */
L_VecSaveFile( pszWMFFile, &TmpVec, FILE_WMF, NULL );

/* Free the vector */
L_VecFree ( &TmpVec );
}


L_VecFreeGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecFreeGroup(pGroupDesc)

pVECTORGROUPDESC pGroupDesc;

/* pointer to a vector group descriptor */

Frees the group descriptor structure retrieved using L_VecGetGroup.

Parameter | Description
pGroupDesc | Pointer to a VECTORGROUPDESC structure retrieved using L_VecGetGroup.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When pGroupDesc is no longer needed, L_VecFreeGroup should be called to free any resources associated with the VECTORGROUPDESC structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetGroup.
Topics: | Working with Vector Groups

Example

For an example, refer to L_VecCopyGroup.


L_VecFreeLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecFreeLayer(pLayerDesc)

pVECTORLAYERDESC pLayerDesc;

/* pointer to a vector layer descriptor */

Frees the layer descriptor structure retrieved using L_VecGetLayer.

Parameter | Description
pLayerDesc | Pointer to a VECTORLAYERDESC structure retrieved using L_VecGetLayer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When pLayerDesc is no longer needed, L_VecFreeLayer should be called to free any resources associated with the VECTORLAYERDESC structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetLayer.
Topics: | Working with Vector Layers

Example

For an example, refer to L_VecCopyLayer.


L_VecFreeObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecFreeObject(nType, pObjectDesc)

L_INT nType; | /* object type */
L_VOID L_FAR * pObjectDesc; | /* pointer to a vector object structure */

Frees any resources associated with pObjectDesc, obtained using L_VecGetObject.

Parameter | Description
nType | Object type. This must be the same type used in L_VecGetObject.
pObjectDesc | Pointer to a vector object structure obtained using L_VecGetObject.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When the pointer to the object structure, obtained using L_VecGetObject, is no longer needed, free any associated resources by calling L_VecFreeObject.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetObject.
Topics: | Working with Vector Objects

Example

For an example, refer to L_VecGetObject.


L_VecGetActiveLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetActiveLayer(pVector, pLayer)

const pVECTORHANDLE pVector; | /* pointer to vector handle */
pVECTORLAYER pLayer; | /* pointer to vector layer */

Gets the active layer inside the specified vector handle.

Parameter | Description
pVector | Pointer to the source vector handle.
pLayer | Pointer to a VECTORLAYER structure to be updated with the active layer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Some functions will use the active layer when NULL is passed for a pVECTORLAYER parameter. This makes it easier to work with the toolkit when layers are not needed.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetActiveLayer.
Topics: | Working with Vector Layers

Example

/* This example will show the name of the current active layer inside the vector handle */
L_VOID ShowActiveLayer( pVECTORHANDLE pVector )
{
VECTORLAYER Layer;
VECTORLAYERDESC LayerDesc;
L_INT nRet;

/* Get the active layer layer */
nRet = L_VecGetActiveLayer( pVector, &Layer );
if( nRet == SUCCESS )
{
/* Get its name */
L_VecGetLayer( pVector, &Layer, &LayerDesc );
MessageBox( NULL, LayerDesc.szName, TEXT("Active Layer"), MB_OK );
L_VecFreeLayer( &LayerDesc );
}
else
MessageBox( NULL, TEXT("Not found!!"), TEXT("Active Layer"), MB_OK );
}


L_VecGetAmbientColor

#include "lvkrn.h"

COLORREF EXT_FUNCTION L_VecGetAmbientColor(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets the ambient (room) color used when drawing a vector image.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

The RGB value of the current ambient color.

Comments

This function will only be effective if the use of lights has been enabled using L_VecSetUseLights.

The default ambient color is white (RGB(255, 255, 255)).

This function has no effect in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetAmbientColor, L_VecSetUseLights, L_VecGetUseLights

Example

For an example, refer to L_VecSetAmbientColor.


L_VecGetBackgroundColor

#include "lvkrn.h"

COLORREF EXT_FUNCTION L_VecGetBackgroundColor(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets the current background color.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

COLORREF value of the current background color.

Comments

This function returns the current background color. If L_VecPaint is called with the bEraseBkgnd parameter set t o TRUE, this is the color that is used to erase the background.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetBackgroundColor, L_VecPaint, L_VecAttachToWindow

Example

/* This example will get the current background color and display its RGB values in a message box. */

void ShowBackgroundColor( pVECTORHANDLE pVector )
{
COLORREF color; /* Background color */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get background color */
color = L_VecGetBackgroundColor( pVector );

/* Show it in a message box */
wsprintf( szBuffer, TEXT("%02x, %02x, %02x"),
GetRValue( color ), GetGValue( color ), GetBValue( color ) );

MessageBox( NULL, szBuffer, TEXT("Background Color"), 0 );
}


L_VecGetBindVerticesMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetBindVerticesMode(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets current vertices bind mode for a vector handle.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

An L_INT value that represents the Vertices-bind mode for the specified vector handle. Possible values are:

Value | Meaning
VECTOR_BIND_VERTICES | Vertices are bound. If changes occur to an object, all other objects sharing vertices with that object will be changed too.
VECTOR_UNBIND_VERTICES | Vertices are not bound. If changes occur to an object, Other objects sharing vertices with that object will not be effected.

Comments

Default mode is VECTOR_BIND_VERTICES.

This function will have no effect in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetBindVerticesMode, L_VecSetScale, L_VecSetRotation, L_VecSetTranslation

Example

/* This example will show the current bind vertices mode in a message box */

void ShowBindVertices( pVECTORHANDLE pVector )
{
L_INT nMode; /* Current bind vertices mode */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get current bind vertices mode */
nMode = L_VecGetBindVerticesMode( pVector );

/* Show a message box */
if( nMode == VECTOR_BIND_VERTICES )
lstrcpy( szBuffer, TEXT("Vertices are bound"));
else
lstrcpy( szBuffer, TEXT("Vertices are not bound"));

MessageBox( NULL, szBuffer, TEXT("Bind Vertices Mode"), 0 );
}


L_VecGetCamera

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetCamera(pVector, pCamera)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORCAMERA pCamera; | /* pointer to a structure */

Gets the current camera settings.

Parameter | Description
pVector | Pointer to a vector handle.
pCamera | Pointer to a VECTORCAMERA structure to be updated with the current camera settings.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will get the current viewing camera.

The camera is used with the view port to determine how the drawing will be projected into the destination DC when using L_VecPaint.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetCamera, L_VecPaint

Example

/* This example will show current camera settings in a message box */

void ShowCamera( pVECTORHANDLE pVector )
{
VECTORCAMERA camera; /* Camera */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get camera */
L_VecGetCamera( pVector, &camera );

/* Format values into a buffer */
wsprintf( szBuffer, TEXT("Theta = %f\nPhi = %f\nLookAt = %f, %f, %f\nDistance = %f\nPerspective = %d"),
camera.Theta, camera.Phi, camera.LookAt.x, camera.LookAt.y, camera.LookAt.z, camera.Distance, camera.bPerspective );

MessageBox( NULL, szBuffer, TEXT("Camera"), 0 );
}


L_VecGetDisplayOptions

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetDisplayOptions(pVector, pOptions)

pVECTORHANDLE pVector; | /* pointer to the vector handle*/
pVECTOR_DISPLAY_OPTIONS pOptions; | /* pointer to the display options structure */

This function retrieves the current display options for the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
pOptions | Pointer to the VECTOR_DISPLAY_OPTIONS structure to be updated with the display options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetDisplayOptions, L_VecInvertColors
Topics: | Getting Vector Object Information
 | Viewing a Vector Image

Example

L_INT SetClipMode( pVECTORHANDLE pVector, L_INT nNewClipMode )
{
L_INT nRet;
VECTOR_DISPLAY_OPTIONS Options;

nRet = L_VecGetDisplayOptions ( pVector, &Options );
if( SUCCESS == nRet )
{
Options.nClipMode = nNewClipMode;
nRet = L_VecSetDisplayOptions ( pVector, &Options );
}

return nRet;
}


L_VecGetEngine

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetEngine(pVector)

Gets the current vector engine associated with the specified vector handle.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

The current vector engine. Possible values are:

Value | Meaning
VECTOR_ENGINE_GDI | Use GDI rendering. (No lights and shading).
VECTOR_ENGINE_OPENGL | Use OpenGL rendering. (Viewing only, drawings are not editable).

Comments

Returns the current vector engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecAttachToWindow

Example

/* This example will show a message box containing the engine currently loaded for the given vector handle. */

void ShowEngine( pVECTORHANDLE pVector )
{
L_INT nEngine; /* Current engine */

/* Get current engine */
nEngine = L_VecGetEngine(pVector);

/* Show message box */
switch( nEngine )
{
case VECTOR_ENGINE_GDI:
MessageBox( NULL, TEXT("Native GDI"), TEXT("Vector Engine"), 0 );
break;

case VECTOR_ENGINE_OPENGL:
MessageBox( NULL, TEXT("OpenGL"), TEXT(" Vector Engine "), 0 );
break;

}
}


L_VecGetFontMapper

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetFontMapper(pVector, *ppFontMapper );

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORFONTMAPPERCALLBACK *ppFontMapper; | /* pointer to a font mapper callback */

Gets the font mapper assigned to a vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle for which to get the font mapper.
ppFontMapper | Pointer to a pointer to a callback function used to handle the font mapping. The callback function must adhere to the function prototype described in VECTORFONTMAPPERCALLBACK.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetFontMapper, VECTORFONTMAPPERCALLBACK
Topics: |

Example

For an example, refer to L_VecSetFontMapper.


L_VecGetGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetGroup(pVector, pGroup, pGroupDesc)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */
pVECTORGROUPDESC pGroupDesc; | /* pointer to a structure */

Gets group information for the specified group.

Parameter | Description
pVector | Pointer to the vector handle.
pGroup | Pointer to a VECTORGROUP structure that references the requested group.
pGroupDesc | Pointer to a VECTORGROUPDESC structure to be updated with the group information if the group is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When pGroupDesc is no longer needed, L_VecFreeGroup should be called to free any resources associated with the VECTORGROUPDESC structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddGroup, L_VecFreeGroup, L_VecGetGroupByIndex, L_VecGetGroupByName, L_VecGetGroupCount
Topics: | Working with Vector Groups

Example

For an example, refer to L_VecCopyGroup.


L_VecGetGroupByIndex

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetGroupByIndex(pVector, nIndex, pGroup)

const pVECTORHANDLE pVector; | /* Pointer to the vector handle */
L_INT nIndex; | /* Index */
pVECTORGROUP pGroup; | /* pointer to a vector group */

Gets the group at the specified index in the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
nIndex | Index of the requested group. This index is zero-based. Possible values are between 0 and L_VecGetGroupCount - 1.
pGroup | Pointer to a VECTORGROUP structure to be updated with the group handle, if the group is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To determine the number of groups in a vector handle, call L_VecGetGroupCount.

To get a group, given the name of the group, use L_VecGetGroupByName.

To get group information for a specific group, call L_VecGetGroup.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetGroupCount, L_VecGetGroupByName, L_VecGetGroup
Topics: | Working with Vector Groups

Example

For an example, refer to L_VecGetGroupCount.


L_VecGetGroupByName

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetGroupByName(pVector, pszName, pGroup)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const L_TCHAR L_FAR * pszName; | /* group name */
pVECTORGROUP pGroup; | /* pointer to a vector group */

Gets the group with the specified name, in the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
pszName | Character string that contains the name of the group to get.
pGroup | Pointer to a VECTORGROUP structure to be updated with the group handle, if the group is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If two or more groups in a vector handle have the same name, this function will get the first group found.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetGroupCount, L_VecGetGroupByIndex, L_VecGetGroup.
Topics: | Working with Vector Groups

Example

For an example, refer to L_VecDeleteGroup.


L_VecGetGroupCount

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetGroupCount(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Returns the number of groups inside a vector handle.

Parameter | Description
pVector | Pointer to the vector handle.

Returns

Number of groups.

Comments

After calling this function, L_VecGetGroupByIndex can be used to iterate through the groups in a vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetGroupByName, L_VecGetGroupByIndex, L_VecGetGroup
Topics: | Working with Vector Groups

Example

/* This example will show the names of the all groups inside a vector handle, in a message box */
L_VOID ShowGroups( pVECTORHANDLE pVector )
{
L_INT nCount, i;
VECTORGROUP Group;
VECTORGROUPDESC GroupDesc;

/* Get number of groups inside the vector handle */
nCount = L_VecGetGroupCount( pVector );

/* Iterate through the groups */
for( i = 0; i < nCount; i++ )
{
/* Get group and its descriptor */
L_VecGetGroupByIndex( pVector, i, &Group );
L_VecGetGroup( pVector, &Group, &GroupDesc );

/* Show name in a message box */
MessageBox( NULL, GroupDesc.szName, TEXT("Group Name"), MB_OK );

/* Free the group descriptor because it's no longer needed */
L_VecFreeGroup( &GroupDesc );
}
}


L_VecGetHitTest

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetHitTest(pVector, pHitTest)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORHITTEST pHitTest; | /* pointer to a structure */

Gets the current hit test settings.

Parameter | Description
pVector | Pointer to a vector handle.
pHitTest | Pointer to a VECTORHITTEST structure to be updated with the current hit test settings.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The hit test settings determine the behavior of the hit test. The hit test itself is performed by calling L_VecHitTest.

The hit test settings can be changed by calling L_VecSetHitTest.

For more information on possible hit test settings, refer to the VECTORHITTEST structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetHitTest, L_VecHitTest
Topics: | Working with Vector Objects

Example

/* This example will toggle dwFlags when doing hit testing */

void ToggleCheckInClosedFigures( pVECTORHANDLE pVector )
{
VECTORHITTEST HitTest; /* Hittest settings */

/* Get the hit test settings */
L_VecGetHitTest ( pVector, &HitTest );

/* Toggle checking for closed areas */
if( HitTest.dwFlags & VECTOR_HITTEST_CLOSEDFIGURES )
HitTest.dwFlags &= ~VECTOR_HITTEST_CLOSEDFIGURES;
else
HitTest.dwFlags |= VECTOR_HITTEST_CLOSEDFIGURES;

/* Set new hit test settings */
L_VecSetHitTest( pVector, &HitTest );
}


L_VecGetHyperlink

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetHyperlink(pVector, pObject, uIndex, pTarget)

pVECTORHANDLE pVector; | /* pointer to vector handle */
const pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
L_UINT32 uIndex; | /* index in the target list */
pVECTORLINKDESC pTarget; | /* pointer to structure that will receive the hyperlink target information */

Gets information about one of the targets in the target list of a hyperlinked vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that contains the hyperlinked vector object for which to get the hyperlink target.
uIndex | Index in the target list.
pTarget | Pointer to a VECTORLINKDESC structure to be updated with the hyperlink target information.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function returns an error if the object was not a hyperlinked vector object.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddHyperlink, L_VecSetHyperlink, L_VecGetHyperlinkCount, L_VecGotoHyperlink
Topics: | Hyperlink Object
 | Hyperlink Objects

Example

L_INT ReplaceRectsWithImage( pVECTORHANDLE pVector, pVECTOROBJECT pVecObj )
{
L_INT nRet;
L_UINT i;
L_UINT uCount;
VECTORLINKDESC Link;

nRet = SUCCESS;
uCount = L_VecGetHyperlinkCount ( pVector, pVecObj );

for( i = 0 ; i < uCount && SUCCESS == nRet ; i++ )
{
nRet = L_VecGetHyperlink ( pVector, pVecObj, i, &Link );
if( SUCCESS == nRet && TRUE == Link.bObject && VECTOR_RECTANGLE == Link.tar.vectorobject.target.nType )
{
Link.bObject = FALSE;

lstrcpy( Link.tar.fileobject.target.szPath, TEXT("c:\\my documents\\shakira.jpg"));
Link.tar.fileobject.hwndParent = NULL;

nRet = L_VecSetHyperlink ( pVector, pVecObj, i, &Link );
}
}

return nRet;
}


L_VecGetHyperlinkCount

#include "lvkrn.h"

L_UINT32 EXT_FUNCTION L_VecGetHyperlinkCount(pVector, pObject)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to vector object */

Returns the number of targets in the target list for the specified hyperlinked vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to the VECTOROBJECT structure that contains the vector object for which to get the hyperlink count.

Returns

0 < | Number of targets in the target list of the specified hyperlinked vector object.
0 | The object is not a hyperlinked vector object.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddHyperlink, L_VecSetHyperlink, L_VecGetHyperlink, L_VecGotoHyperlink
Topics: | Hyperlink Object
 | Hyperlink Objects

Example

For an example, refer to L_VecAddHyperlink or L_VecGetHyperlink.


L_VecGetLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetLayer(pVector, pLayer, pLayerDesc)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */
pVECTORLAYERDESC pLayerDesc; | /* pointer to a structure */

Gets layer information for the specified layer.

Parameter | Description
pVector | Pointer to the vector handle.
pLayer | Pointer to a VECTORLAYER structure that references the requested layer.
pLayerDesc | Pointer to a VECTORLAYERDESC structure to be updated with the layer information if the layer is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When pLayerDesc is no longer needed, L_VecFreeLayer should be called to free any resources associated with the VECTORLAYERDESC structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddLayer, L_VecFreeLayer, L_VecGetLayerByIndex, L_VecGetLayerByName, L_VecGetLayerCount
Topics: | Working with Vector Layers

Example

For an example, refer to L_VecCopyLayer.


L_VecGetLayerByIndex

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetLayerByIndex(pVector, nIndex, pLayer)

const pVECTORHANDLE pVector; | /* Pointer to the vector handle */
L_INT nIndex; | /* Index */
pVECTORLAYER pLayer; | /* pointer to a vector layer */

Gets the layer at the specified index in the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
nIndex | Index of the requested layer. This index is zero-based. Possible values are between 0 and L_VecGetLayerCount - 1.
pLayer | Pointer to a VECTORLAYER structure to be updated with the layer handle, if the layer is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To determine the number of layers in a vector handle, call L_VecGetLayerCount.

To get a layer, given the name of the layer, use L_VecGetLayerByName.

To get layer information for a specific layer, call L_VecGetLayer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetLayerCount, L_VecGetLayerByName, L_VecGetLayer.
Topics: | Working with Vector Layers

Example

For an example, refer to L_VecGetLayerCount.


L_VecGetLayerByName

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetLayerByName(pVector, pszName, pLayer)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const L_TCHAR L_FAR * pszName; | /* layer name */
pVECTORLAYER pLayer; | /* pointer to a vector layer */

Gets the layer with the specified name, in the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
pszName | Character string that contains the name of the layer to get.
pLayer | Pointer to a VECTORLAYER structure to be updated with the layer handle, if the layer is found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If two or more layers in a vector handle have the same name, this function will get the first layer found.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetLayerCount, L_VecGetLayerByIndex, L_VecGetLayer.
Topics: | Working with Vector Layers

Example

For an example, refer to L_VecDeleteLayer.


L_VecGetLayerCount

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetLayerCount(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Returns the number of layers inside a vector handle.

Parameter | Description
pVector | Pointer to the vector handle.

Returns

Number of layers.

Comments

After calling this function, L_VecGetLayerByIndex can be used to iterate through the layers in a vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetLayerByName, L_VecGetLayerByIndex, L_VecGetLayer.
Topics: | Working with Vector Layers

Example

/* This example will show the names of the all layers inside a vector handle, in a message box */
L_VOID ShowLayers( pVECTORHANDLE pVector )
{
L_INT nCount, i;
VECTORLAYER Layer;
VECTORLAYERDESC LayerDesc;

/* Get number of layers inside the vector handle */
nCount = L_VecGetLayerCount( pVector );

/* Iterate through the layers */
for( i = 0; i < nCount; i++ )
{
/* Get layer and its descriptor */
L_VecGetLayerByIndex( pVector, i, &Layer );
L_VecGetLayer( pVector, &Layer, &LayerDesc );

/* Show name in a message box */
MessageBox( NULL, LayerDesc.szName, TEXT("Layer Name"), MB_OK );

/* Free the layer descriptor because it's no longer needed */
L_VecFreeLayer( &LayerDesc );
}
}


L_VecGetMarker

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetMarker(pVector, pMarker)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORMARKER pMarker; | /* pointer to a structure */

Gets the current marker settings.

Parameter | Description
pVector | Pointer to a vector handle.
pMarker | Pointer to a VECTORMARKER structure to be updated with the current marker settings.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The marker is used to indicate those objects within the vector handle that are selected.

For more information on available marker settings, refer to the VECTORMARKER structure.

To modify the marker settings, get the current settings by calling L_VecGetMarker, set the new settings in the structure pointed to by pMarker, and call L_VecSetMarker.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetMarker.
Topics: | Working with Vector Handles

Example

/* This example will toggle the pen and brush color between red and blue */

void SetMyMarker( pVECTORHANDLE pVector )
{
VECTORMARKER Marker; /* marker */

/* Get marker settings */
L_VecGetMarker ( pVector, &Marker );

/* Toggle pen and brush color between red and blue */
Marker.Pen.bExtPen = FALSE;
if( Marker.Pen.NewPen.LogPen.lopnColor == RGB( 0xFF, 0x00, 0x00 ) )
Marker.Pen.NewPen.LogPen.lopnColor = RGB( 0x00, 0x00, 0xFF );
else
Marker.Pen.NewPen.LogPen.lopnColor = RGB( 0xFF, 0x00, 0x00 );

Marker.Brush.VectorBrushStyle = VECTORBRUSH_STANDARD;
if( Marker.Brush.BrushType.StandardBrush.LogBrush.lbColor == RGB( 0xFF, 0x00, 0x00 ) )
Marker.Brush.BrushType.StandardBrush.LogBrush.lbColor = RGB( 0x00, 0x00, 0xFF );
else
Marker.Brush.BrushType.StandardBrush.LogBrush.lbColor = RGB( 0xFF, 0x00, 0x00 );

/* Set new marker */
L_VecSetMarker( pVector, &Marker );
}


L_VecGetObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObject(pVector, pObject, nType, pObjectDesc)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
L_INT nType; | /* object type to get */
L_VOID L_FAR * pObjectDesc; | /* pointer to a vector object structure */

Gets the object information of the specified vector object.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a vector object.
nType | Object type. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_CLONE | Clone object of a vector group.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a vector object structure to be updated with the object information of the specified object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to obtain information about a certain vector object.

If you set nType to VECTOR_OBJECT, the structure pointed to by pObjectDesc will be filled with the general VECTOROBJECT structure information common to all object types.

If you want specific information about an object, set the nType member to the requested object type and set pObjectDesc to the address of the appropriate vector object structure.

Once pObjectDesc is no longer needed, free any associated resources by calling L_VecFreeObject.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObject
Topics: | Working with Vector Objects

Example

/* This example will select the object under the current mouse cursor */

L_VOID SelectMyObject( pVECTORHANDLE pVector, const POINT *pptMouse )
{
VECTOROBJECT Object;
VECTOROBJECT ObjectDesc;
L_INT nRet;

/* Get the object under the mouse cursor */
nRet = L_VecHitTest( pVector, pptMouse, &Object );
if( nRet == SUCCESS )
{
/* Select this object */
L_VecGetObject( pVector, &Object, VECTOR_OBJECT, &ObjectDesc );
ObjectDesc.dwFlags |= VECTOR_OBJECT_SELECTED;
L_VecSetObject( pVector, &Object, VECTOR_OBJECT, &ObjectDesc );

/* Clean up */
L_VecFreeObject(VECTOR_OBJECT, &ObjectDesc );
}
}

/* The following example gets and sets specific information about a VECTOR_RECTANGLE object. */
/* this example will check if the object under hit-test is a rectangle and then change its pen color to red */
L_VOID ChangeRectPen( pVECTORHANDLE pVector, const POINT *pptMouse )
{
VECTOROBJECT Object;
VECTORRECTANGLE Rectangle;
L_INT nRet;

/* get the object under ths mouse cursor */
nRet = L_VecHitTest( pVector, pptMouse, &Object );

/* make sure the object is a rectangle */
if( nRet == SUCCESS && Object.nType == VECTOR_RECTANGLE )
{
/* change its pen color to red */
L_VecGetObject( pVector, &Object, VECTOR_RECTANGLE, &Rectangle );
Rectangle.Pen.bExtPen = FALSE;
Rectangle.Pen.NewPen.LogPen.lopnColor = RGB( 0xFF, 0x00, 0x00 );
L_VecSetObject( pVector, &Object, VECTOR_RECTANGLE, &Rectangle );

/* clean up */
L_VecFreeObject( VECTOR_RECTANGLE, &Rectangle );
}
}


L_VecGetObjectAttributes

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObjectAttributes(pVector, pObject, pnROP, pPen, pBrush, pFont)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
L_INT L_FAR * pnROP; | /* ROP code */
pVECTORPEN pPen; | /* pen characteristics */
pVECTORBRUSH pBrush; | /* brush characteristics */
pVECTORFONT pFont; | /* font characteristics */

Gets the attributes of an object.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to the vector object for which to get the attributes.
pnROP | Pointer to a variable to be updated with the object's ROP code. For more information on valid ROP2 codes, refer to your SDK..
pPen | Pointer to a VECTORPEN structure to be updated with the characteristics of the pen to use when drawing the class object. If you do not wish to retrieve this information, pass NULL.
pBrush | Pointer to a VECTORBRUSH structure to be updated with the characteristics of the brush to use when drawing the class object.
pFont | Pointer to a VECTORFONT structure to be updated with the characteristics of the font used by the class object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If NULL is passed for pnROP, pPen, pBrush and/or pFont, then that parameter will not be updated with the corresponding value. For example, if NULL is passed for the pFont parameter, the pFont parameter will not be updated with the font information for the specified object.

Certain parameters are ignored depending on pObject. For example, if pObject is VECTOR_LINE, then the pBrush and pFont parameters are ignored.

This function provides a simpler way of retrieving object information, without having to get the object descriptor, inspect the object type and then free the descriptor.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectAttributes, L_VecGetObject, L_VecSetObject, L_VecFreeObject
Topics: | Working with Vector Objects

Example

/* This example will get the line color of the object under a given point regardless of its type */

COLORREF GetObjectPenColor( pVECTORHANDLE pVector, POINT *pt )
{
L_INT nRet;
VECTOROBJECT Object;
VECTORPEN Pen;
COLORREF Color;

/* hit test */
nRet = L_VecHitTest( pVector, pt, &Object );
if( nRet == SUCCESS )
{
/* get its PEN */
L_VecGetObjectAttributes( pVector, &Object, NULL, &Pen, NULL, NULL );
if( Pen.bExtPen )
Color = Pen.NewPen.ExtLogPen.elpColor;
else
Color = Pen.NewPen.LogPen.lopnColor;
}
else
Color = RGB( 0, 0, 0 ); // no object under color, assume black is default

return Color;
}


L_VecGetObjectDescription

#include "lvkrn.h"

L_UINT32 EXT_FUNCTION L_VecGetObjectDescription(pVector, pObject, pBuffer, uSize)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
L_TCHAR * pBuffer; | /* pointer to a buffer */
L_UINT32 uSize; | /* size of pBuffer */

Retrieves the description string for the specified vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that contains the vector object for which to get the description.
pBuffer | Pointer to a buffer to be updated with the object description string.
uSize | Size of the buffer allocated for pBuffer.

Returns

If pBuffer is NULL, it will return the size of the buffer required for the description string. If pBuffer is not NULL, it will return the number of bytes actually written to the buffer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectDescription
Topics: | Getting Vector Object Information
 | Working with Vector Objects

Example

L_INT ModifyDescription( pVECTORHANDLE pVector, pVECTOROBJECT pObject )
{
L_INT nRet;
L_UINT32 uSize;
L_TCHAR *pszDesc;

nRet = SUCCESS;
uSize = L_VecGetObjectDescription ( pVector, pObject, NULL, 0 );
if( uSize > 0 )
{
pszDesc = (L_TCHAR*) malloc( sizeof( L_TCHAR ) * uSize );
if( NULL == pszDesc )
{
return ERROR_NO_MEMORY;
}

L_VecGetObjectDescription ( pVector, pObject, pszDesc, sizeof( L_TCHAR ) * uSize );

if( uSize > 4 )
{
pszDesc[ 0 ] = 'T';
pszDesc[ 1 ] = 'E';
pszDesc[ 2 ] = 'S';
pszDesc[ 3 ] = 'T';

nRet = L_VecSetObjectDescription ( pVector, pObject, pszDesc );
}

free( pszDesc );
}
return nRet;
}


L_VecGetObjectParallelogram

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObjectParallelogram(pVector, pObject, pMin, pMax, dwFlags)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
pVECTORPOINT pMin; | /* pointer to a VECTORPOINT structure */
pVECTORPOINT pMax; | /* pointer to a VECTORPOINT structure */
L_UINT32 dwFlags; | /* flag */

Gets the parallelogram that contains the specified object(s).

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a VECTOROBJECT structure that references an object. If this parameter is not NULL, the top left point of this object’s bounding parallelogram will be copied into pLeftTop and the bottom right point of the parallelogram will be copied into pRightBottom.
 | If this parameter is NULL, dwFlags will control which object’s parallelogram to copy into pLeftTop and pRightBottom.
pMin | Pointer to a VECTORPOINT structure to be updated with the minimum point of the bounding parallelogram of the specified object.
pMax | Pointer to a VECTORPOINT structure to be updated with the maximum point of the bounding parallelogram of the specified object.
dwFlags | Flag that indicates which parallelogram to use when updating the pLeftTop and pRightBottom parameters. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | pMin and pMax will be updated with the parallelogram containing all objects within the vector handle.
 | VECTOR_FLAGS_SELECTED_ONLY | pMin and pMax will be updated with the parallelogram containing all selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Obtains the bounding parallelogram of a single object, several selected objects, or all objects within the specified vector handle.

This function is not supported in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSelectObject, L_VecIsObjectSelected, L_VecGetObjectRect

Example

/* This example will show the logical extent of the drawing, in a message box */

void ShowExtent( pVECTORHANDLE pVector )
{
VECTORPOINT Min; /* Left-top point */
VECTORPOINT Max; /* Right-bottom point */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get the parallelogram of all objects */
L_VecGetObjectParallelogram( pVector, NULL, &Min, &Max, 0L );

/* Format into a buffer */
wsprintf( szBuffer, TEXT("%.3f, %.3f, %.3f - %.3f, %.3f, %.3f"),
Min.x, Min.y, Min.z,
Max.x, Max.y, Max.z );

/* Show in a message box */
MessageBox( NULL, szBuffer, TEXT("Drawing extent"), 0 );
}


L_VecGetObjectRect

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObjectRect(pVector, pObject, pRect, dwFlags)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
RECT L_FAR *pRect; | /* pointer to a RECT structure */
L_UINT32 dwFlags; | /* flag that indicates which object(s) to use */

Gets the physical bounding rectangle for the specified object(s).

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a VECTOROBJECT structure that references an object. If this parameter is not NULL, the bounding rectangle of this object will be copied into pRect.
 | If this parameter is NULL, dwFlags will control which object’s rectangle to copy into pRect.
pRect | Pointer to a RECT structure to be updated with the bounding rectangle of the specified object(s).
dwFlags | Flag that indicates which parallelogram to use when updating the pLeftTop and pRightBottom parameters. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | pLeftTop and pRightBottom will be updated with the parallelogram containing all objects within the vector handle.
 | VECTOR_FLAGS_SELECTED_ONLY | pLeftTop and pRightBottom will be updated with the parallelogram containing all selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Obtains the physical bounding rectangle of a single object, all selected objects, or all objects within the specified vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSelectObject, L_VecIsObjectSelected, L_VecGetObjectParallelogram, L_VecHitTest

Example

/* This example will show the physical extent of the selected objects inside the drawing, in a message box */

void ShowSelectedExtent( pVECTORHANDLE pVector )
{
RECT rect; /* Resulting bounding rectangle */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get the rectangle of selected objects */
L_VecGetObjectRect( pVector, NULL, &rect, 0L );

/* Format into a buffer */
wsprintf( szBuffer, TEXT("%d, %d, %d, %d"),
rect.left, rect.top, rect.right, rect.bottom );

/* Show in a message box */
MessageBox( NULL, szBuffer, TEXT("Selected Objects Physical Extent"), 0 );
}


L_VecGetObjectTooltip

#include "lvkrn.h"

L_UINT32 EXT_FUNCTION L_VecGetObjectTooltip(pVector, pObject, pBuffer, uSize)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a structure */
L_TCHAR * pBuffer; | /* pointer to a buffer */
L_UINT32 uSize; | /* size of pBuffer */

Retrieves the tooltip of a vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to the VECTOROBJECT structure that contains the vector object for which to get the tooltip.
pBuffer | Pointer to a buffer to be updated with the specified object's tooltip.
uSize | Size of the buffer allocated for pBuffer.

Returns

If pBuffer is NULL, it will return the size of the buffer required for the tooltip string. If pBuffer is not NULL, it will return the number of bytes actually written to the buffer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectTooltip, L_VecShowObjectTooltip, L_VecHideObjectTooltip
Topics: | Working with Tooltips
 | Tooltips

Example

L_INT ShowMyTooltip( pVECTORHANDLE pVector, pVECTOROBJECT pObject, L_BOOL bShow )
{
L_INT nRet;
L_UINT32 uSize;
L_TCHAR *pszTip;
VECTORTOOLTIPDESC TooltipDesc;

nRet = SUCCESS;
uSize = L_VecGetObjectTooltip ( pVector, pObject, NULL, 0 );

pszTip = (L_TCHAR*) malloc( sizeof( L_TCHAR ) * uSize );
if( NULL == pszTip )
return ERROR_NO_MEMORY;

nRet = SUCCESS;
L_VecGetObjectTooltip ( pVector, pObject, pszTip, uSize );
if( lstrcmp( pszTip, TEXT("test")) == 0 )
{
/* replace the tooltip */
nRet = L_VecSetObjectTooltip ( pVector, pObject, TEXT("Final"));
if( SUCCESS == nRet )
{
if( bShow )
{
ZeroMemory( &TooltipDesc, sizeof( TooltipDesc ) );
TooltipDesc.Point.x = 10;
TooltipDesc.Point.y = 10;

TooltipDesc.Pen.lopnColor = RGB( 0, 0, 0xFF );
TooltipDesc.Pen.lopnWidth.x = 1;

TooltipDesc.Brush.lbColor = RGB( 0xED, 0xF3, 0xBB );

lstrcpy( TooltipDesc.Font.lfFaceName, TEXT("Helvetica"));
TooltipDesc.Font.lfHeight = 5;

nRet = L_VecShowObjectTooltip ( pVector, pObject, &TooltipDesc );
}
else
{
nRet = L_VecHideObjectTooltip ( pVector, pObject );
}
}
}
free( pszTip );
return nRet;
}


L_VecGetObjectViewContext

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObjectViewContext(pVector, pObject, pMin, pMax)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
pVECTORPOINT pMin; | /* pointer to a VECTORPOINT structure */
pVECTORPOINT pMax; | /* pointer to a VECTORPOINT structure */

Retrieves the minimum and maximum points of an object’s view context space.

Parameter | Description
pVector | Pointer to vector handle.
pObject | Pointer to a VECTOROBJECT structure that contains the vector object for which to get the view context.
pMin | Pointer to a VECTORPOINT structure to be updated with the minimum point of the view context space.
pMax | Pointer to a VECTORPOINT structure to be updated with the maximum point of the view context space.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function fails if pObject doesn’t have a preset view context.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectViewContext, L_VecRemoveObjectViewContext
Topics: | Working View Context
 | Getting Vector Object Information

Example

L_INT ChangeViewContext( pVECTORHANDLE pVector, pVECTOROBJECT pObject, pVECTORPOINT pMin, pVECTORPOINT pMax )
{
L_INT nRet;
VECTORPOINT Min;
VECTORPOINT Max;

nRet = L_VecGetObjectViewContext ( pVector, pObject, &Min, &Max );
if( SUCCESS != nRet )
{
nRet = L_VecSetObjectViewContext ( pVector, pObject, pMin, pMax );

*pMin = Min;
*pMax = Max;
}

if( SUCCESS != nRet )
{
L_VecRemoveObjectViewContext ( pVector, pObject );
}

return nRet;
}


L_VecGetOrigin

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetOrigin(pVector, pOrigin)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pOrigin; | /* pointer to a vector point */

Gets the origin point for the specified vector handle.

Parameter | Description
pVector | Pointer to a vector handle.
pOrigin | Pointer to a VECTORPOINT structure to be updated with the origin point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The origin of a vector drawing may change whenever new objects are added. To insure that the drawing is centered around its origin, call L_VecSetOrigin(pVector, NULL) after adding objects.

The origin point may be set using L_VecSetOrigin.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetOrigin.
Topics: | Working with Vector Handles

Example

void TestVecGetOrigin ( pVECTORHANDLE pVector )

{

/* This example will show the origin of a vector image in a dialog box */

VECTORPOINT Origin;

L_TCHAR szBuffer[ 80 ];

L_VecGetOrigin( pVector, &Origin );

wsprintf( szBuffer, TEXT("%f, %f, %f"), Origin.x, Origin.y, Origin.z );

MessageBox( NULL, szBuffer, TEXT("Origin At"), MB_OK );

}


L_VecGetPalette

#include "lvkrn.h"

HPALETTE EXT_FUNCTION L_VecGetPalette(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Returns the palette associated with the specified vector handle.

Parameter | Description
pVector | Pointer to the vector handle.

Returns

Returns the handle to the logical palette

Comments

You can use this palette to allow proper drawing of vector image colors in a paletteized system.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetPalette, L_VecPaint

Example

For an example, refer to L_VecSetPalette.


L_VecGetPan

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetPan(pVector, pPan)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
POINT L_FAR * pPan; | /* pointer to a structure */

Gets the current pan values.

Parameter | Description
pVector | Pointer to a vector handle.
pPan | Pointer to a POINT structure to be updated with the current pan values.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will get the current physical pan values. These pan values are in pixels. This function can be used to scroll the VECTOR image.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetPan, L_VecSetViewport, L_VecGetViewport

Example

void TestVecGetPan ( pVECTORHANDLE pVector )

{

/* This example will shift the drawing 10 pixels to the left and 10 pixels up. */

POINT pan;

/* Get current pan values */

L_VecGetPan( pVector, &pan );

/* shift 10 pixels left, 10 pixels up */

pan.x += 10;

pan.y += -10;

/* Set new pan */

L_VecSetPan ( pVector, &pan );

}


L_VecGetParallelogram

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetParallelogram(pVector, pMin, pMax)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pMin; | /* pointer to a vector point */
pVECTORPOINT pMax; | /* pointer to a vector point */

Gets the parallelogram of a vector handle drawing.

Parameter | Description
pVector | Pointer to a vector handle.
pMin | Pointer to a VECTORPOINT structure to be updated with the minimum point of the bounding parallelogram of the specified vector handle.
pMax | Pointer to a VECTORPOINT structure to be updated with

the maximum point of the bounding parallelogram of the specified vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You can set the parallelogram with L_VecSetParallelogram.

This function will have no effect in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetParallelogram.
Topics: | Working with Vector Handles

Example

/* This example will show the parallelogram of the vector drawing inside a message box */

void ShowParallelogram ( const pVECTORHANDLE pVector )
{
VECTORPOINT Min, Max;
L_TCHAR szBuffer[ 80 ];

L_VecGetParallelogram( pVector, &Min, &Max );
 wsprintf( szBuffer, TEXT("%f,%f,%f to %f,%f,%f"), Min.x, Min.y, Min.z, Max.x, Max.y, Max.z );
MessageBox( NULL, szBuffer, TEXT("Parallelogram"), MB_OK );
}


L_VecGetPolygonMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetPolygonMode(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets the current polygon drawing mode.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

The current polygon drawing mode. Possible values are:

Value | Meaning
VECTOR_POLYGON_POINT | Draw only the edge points on polygons and lines.
VECTOR_POLYGON_LINE | Draw as a wire-frame.
VECTOR_POLYGON_FILL | Draw solid polygons.
VECTOR_POLYGON_FILL_RASTER_ALWAYS | Draw solid polygons and always draw raster objects.

Comments

This function is not supported in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetPolygonMode

Example

/* This example will show the current polygon drawing mode in a message box */

void ShowPolygonMode( pVECTORHANDLE pVector )
{
L_INT nMode; /* Current polygon mode */

nMode = L_VecGetPolygonMode( pVector );

switch( nMode )
{
case VECTOR_POLYGON_POINT:
MessageBox( NULL, TEXT("Point"), TEXT("Polygon Mode"), 0 );
break;

case VECTOR_POLYGON_LINE :
MessageBox( NULL, TEXT("Line"), TEXT("Polygon Mode"), 0 );
break;

case VECTOR_POLYGON_FILL :
MessageBox( NULL, TEXT("Fill"), TEXT("Polygon Mode"), 0 );
break;

case VECTOR_POLYGON_FILL_RASTER_ALWAYS :
MessageBox( NULL, TEXT("Fill"), TEXT("Polygon Mode with Raster Always"), 0 );
break;
}
}


L_VecGetRotation

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetRotation(pVector, pRotation)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pRotation; | /* pointer to a vector point */

Gets the current rotation values.

Parameter | Description
pVector | Pointer to a vector handle.
pRotation | Pointer to a VECTORPOINT structure to be updated with the current rotation values. The rotation values are in degrees.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The rotation values retrieved are those set using L_VecSetRotation, with pObject set to NULL and dwFlags set to 0L.

The default rotation angle values are 0.0, 0.0, and 0.0 for the X, Y and Z axes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetRotation, L_VecSetScale, L_VecGetScale, L_VecSetTranslation, L_VecGetTranslation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode

Example

For an example, refer to L_VecSetRotation.


L_VecGetScale

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetScale(pVector, pScale)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pScale; | /* pointer to a vector point */

Gets the current scale values.

Parameter | Description
pVector | Pointer to a vector handle.
pScale | Pointer to a VECTORPOINT structure to be updated with the current scale values.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The scale values retrieved are those set using L_VecSetScale, with pObject set to NULL and dwFlags set to 0L.

A scale value of 1.0 represents a scale factor of 100%; a scale value of 0.5 represents a scale factor of 50%; a scale value of 2.0 represents a scale factor of 200%, etc.

The default scale values are 1.0, 1.0, and 1.0 for the X, Y, and Z axes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetScale, L_VecSetRotation, L_VecGetRotation, L_VecSetTranslation, L_VecGetTranslation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode

Example

/* This example will show the current scale values, in percentage, in a message box */

void ShowScaleValues( pVECTORHANDLE pVector )
{
VECTORPOINT scale; /* Scale values */
L_TCHAR szBuffer[ 80 ]; /* Buffer */

/* Get current scale values */
L_VecGetScale( pVector, &scale );

/* Format in a buffer */
wsprintf( szBuffer, TEXT("%d%%, %d%%, %d%%"),
(L_INT) ( scale.x * 100.0 ),
(L_INT) ( scale.y * 100.0 ),
(L_INT) ( scale.z * 100.0 ) );

/* Show a message box */
MessageBox( NULL, szBuffer, TEXT("Scale factors"), 0 );
}


L_VecGetTranslation

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetTranslation(pVector, pTranslation)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pTranslation; | /* pointer to a vector point */

Gets the current translation values.

Parameter | Description
pVector | Pointer to a vector handle.
pTranslation | Pointer to a VECTORPOINT structure to be updated with the current translation values. The translation values are in logical units.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The translation values retrieved are those set using L_VecSetTranslation, with pObject set to NULL and dwFlags set to 0L.

The default translation values are 0.0, 0.0, and 0.0 for the X, Y and Z axes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetTranslation, L_VecSetScale, L_VecGetScale, L_VecSetRotation, L_VecGetRotation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode

Example

For an example, refer to L_VecSetTranslation.


L_VecGetUseLights

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecGetUseLights(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets the use lights status for the specified vector handle.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

TRUE | Use lights when drawing the vector handle.
FALSE | Do not use lights when drawing the vector handle.

Comments

If the use of lights is disabled, ambient light will have no effect on how the image is drawn.

This function has no effect in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetUseLights, L_VecSetAmbientColor, L_VecGetAmbientColor

Example

For an example, refer to L_VecSetUseLights.


L_VecGetViewMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetViewMode(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Gets the current view mode.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

The current view mode. Possible values are:

Value | Meaning
VECTOR_VIEWMODE_FIT | Fit the drawing on the view port, keeping the aspect ratio.
VECTOR_VIEWMODE_SNAP | Snap the drawing into the view port.

Comments

This function will get the view mode used when drawing the vector handle.

The view mode is used with the view port to determine the resulting physical drawing extents.

Not supported in OpenGL and DirectX.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetViewMode, L_VecPaint

Example

/* This will show current view mode in a message box */

void ShowViewMode( pVECTORHANDLE pVector )
{
if(L_VecGetViewMode( pVector ) == VECTOR_VIEWMODE_FIT)
MessageBox( NULL, TEXT("Fit in window"), TEXT("View Mode"), 0 );
else
MessageBox( NULL, TEXT("Snap to window"), TEXT("View Mode"), 0 );
}


L_VecGetViewport

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetViewport(pVector, pViewport)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
RECT L_FAR * pViewport; | /* pointer to a structure */

Gets the current view port.

Parameter | Description
pVector | Pointer to a vector handle.
pViewport | Pointer to a RECT structure to be updated with the current view port data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to get the view port associated with the specified vector handle.

If pVector is attached to a window, you must call this function when processing WM_SIZE messages, since the VECTOR library needs to know when the window size has changed (DirectX), or when the double buffer mode is selected in the current VECTOR engine.

This function and L_VecSetCamera are required to complete the projection process from the vector image onto a 2D surface.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetViewport, L_VecSetPan, L_VecGetPan

Example

/* This example will get current view port value and shows it in a message box */

void ShowViewport( pVECTORHANDLE pVector )
{
RECT rect;
L_TCHAR szBuffer[ 80 ];

/* Get viewport */
L_VecGetViewport( pVector, &rect );

/* Format in a buffer */
wsprintf( szBuffer, TEXT("%d, %d, %d, %d"), rect.left, rect.top, rect.right, rect.bottom );

/* Show in a message box */
MessageBox( NULL, szBuffer, TEXT("Viewport"), 0 );
}


L_VecGotoHyperlink

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGotoHyperlink(pVector, pObject, uIndex)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a structure */
L_UINT32 uIndex; | /* index to an item in the target list */

Activates the specified target from the target list of the hyperlinked vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object for which to activate the hyperlink.
uIndex | Index to an item in the target list. The target specified by this index will be used and activated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function fails if pObject is not a hyperlinked vector object.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddHyperlink, L_VecSetHyperlink, L_VecGetHyperlink, L_VecGetHyperlinkCount
Topics: | Hyperlink Object
 | Hyperlink Objects

Example

L_INT JumpToLink( pVECTORHANDLE pVector, pVECTOROBJECT pVecObj )
{
return L_VecGotoHyperlink ( pVector, pVecObj, 0 );
}


L_VecHideObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecHideObject(pVector, pObject, bHide)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOROBJECT pObject; | /* pointer to a vector object */
L_BOOL bHide; | /* flag that indicates whether to hide or show an object */

Hides or shows an object.

Parameter | Description
pVector | Pointer to a vector handle. Objects within this vector handle will be hidden or shown.
pObject | Pointer to a VECTOROBJECT structure that references an object to be hidden or shown.
bHide | Flag that indicates whether to hide or show the specified object. Possible values are:
 | Value | Meaning
 | TRUE | Hide the specified object.
 | FALSE | Show the specified object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Hides or shows an object within the specified vector handle.

A hidden object will not be drawn. It will also not be returned when calling the L_VecHitTest function.

This function is not supported in the OpenGL and DirectX engines.

Please note that you will have to update the window to see the results of this function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecIsObjectHidden, L_VecSelectObject, L_VecIsObjectSelected, L_VecDeleteObject, L_VecHitTest, L_VecGetObject

Example

/* This example will hide the object under a given 2D point */

void HideObjectUnder( pVECTORHANDLE pVector, POINT L_FAR *pPoint )
{
VECTOROBJECT Object; /* Object under point */
L_INT nRet;

/* Get object under that point */
nRet = L_VecHitTest( pVector, pPoint, &Object );

/* Is there an object under that point? */
if( nRet == SUCCESS )
{
/* Yes, hide it */
L_VecHideObject( pVector, &Object, TRUE );
}
}


L_VecHideObjectTooltip

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecHideObjectTooltip(pVector, pObject)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */

Hides the tooltip of an object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references a vector object. This function will hide the tooltip of this vector object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectTooltip, L_VecShowObjectTooltip, L_VecGetObjectTooltip
Topics: | Working with Tooltips
 | Tooltips

Example

For an example please refer to L_VecGetObjectTooltip.


L_VecHitTest

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecHitTest(pVector, pPoint, pObject)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const POINT L_FAR * pPoint; | /* pointer to a POINT structure */
pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */

Performs a hit test using the specified 2D point.

Parameter | Description
pVector | Pointer to a vector handle.
pPoint | Pointer to a POINT structure that contains the point to test.
pObject | Pointer to a VECTOROBJECT structure to be updated with the object found under the specified point, if one exists.

Returns

SUCCESS | The function was successful and an object was copied into pObject.
ERROR_VECTOR_OBJECT_NOT_FOUND | No object was found under the specified point.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will copy the first object under the specified physical point into pObject.

To set the options to use when performing the hit test, call L_VecSetHitTest.

Camera, view port, rotation, translation and scaling are all considered when determining whether or not an object is under the specified point.

This function is not supported in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSelectObject, L_VecIsObjectSelected, L_VecDeleteObject

Example

/* This example will select the object under the mouse cursor */
L_VOID SelectObject( pVECTORHANDLE pVector, POINT *pptMouse )
{
VECTOROBJECT Object;
VECTOROBJECT TempObject;
L_INT nRet;

nRet = L_VecHitTest( pVector, pptMouse, &Object );
if( nRet == SUCCESS )
{
/* Get the object to edit */
L_VecGetObject( pVector, &Object, Object.nType, &TempObject );

/* Select it */
TempObject.dwFlags |= VECTOR_OBJECT_SELECTED;

/* Apply changes */
L_VecSetObject( pVector, &Object, Object.nType, &TempObject );

/* Must free the temporary object when not used anymore */
L_VecFreeObject( TempObject.nType, &TempObject );
}
}


L_VecInit

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecInit(pVector)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

Initializes the fields in a vector handle.

Parameter | Description
pVector | Pointer to the vector handle to be initialized.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call this function before calling L_VecCopy.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecCopy
Topics: |

Example

/* This example will make a copy of a vector handle */

L_INT DoSomething( pVECTORHANDLE pVector )
{
VECTORHANDLE TmpVector; /* Temporary vector handle */
L_INT nRet; /* Return value */

/* Initiate the temporary vector handle */
L_VecInit( &TmpVector );

/* Make a copy */
nRet = L_VecCopy( &TmpVector, pVector, VECTOR_FLAGS_REPLACE );
if( nRet != SUCCESS )
{
return( nRet );
}
/*
...
Do something with TmpVector
...
*/

/* Destroy temporary vector before returning. */
L_VecFree( &TmpVector );

return( SUCCESS );
}


L_VecInitObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecInitObject(pObject)

pVECTOROBJECT pObject;

/* pointer to a vector object */

Initializes a new vector object.

Parameter | Description
pObject | Pointer to the vector object to initialize.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function must be called to initialize new objects before adding them to the vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddObject
Topics: | Working with Vector Objects

Example

For an example, refer to L_VecAddObject.


L_VecInvertColors

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecInvertColors(pVector)

pVECTORHANDLE pVector;

/* pointer to vector handle */

Inverts the colors in the vector handle.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetDisplayOptions, L_VecSetDisplayOptions
Topics: | Modifying Vector Layers
 | Viewing a Vector Image

Example

L_INT InvertColors( pVECTORHANDLE pVector )
{
return L_VecInvertColors ( pVector );
}


L_VecIs3D

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIs3D(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Determines whether or not the specified vector handle contains 3D objects.

Parameter | Description
pVector | Pointer to a vector handle. The referenced vector will be checked for the presence of 3D objects.

Returns

TRUE | The referenced data contains a three dimensional object.
FALSE | The referenced data contains a two dimensional object.

Comments

Call this function to determine whether or not the given vector handle contains any 3D objects.

A vector handle is considered to be "3D" if it has one or more objects stretching within the Z-axis.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecLoadFile

Example

/* This example will determine whether the given vector handle is 2D or 3D */

void CheckVector( pVECTORHANDLE pVector )
{
/* Check if 3D */
if( L_VecIs3D( pVector ) )
MessageBox( NULL, TEXT("Vector is 3D"), TEXT("Test"), MB_OK );
else
MessageBox( NULL, TEXT("Vector is 2D"), TEXT("Test"), MB_OK );
}


L_VecIsEmpty

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsEmpty(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Determines whether the specified vector handle is empty.

Parameter | Description
pVector | Pointer to a vector handle that references a vector image.

Returns

TRUE | The vector image is empty.
FALSE | The vector image is not empty.

Comments

A vector image is considered empty when it has no objects.

An empty vector image can still have empty layers.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecEmpty
Topics: | Working with Vector Handles

Example

/* This example determines whether a vector image is empty or not */

L_VOID CheckIfEmpty( pVECTORHANDLE pVector )
{
if( L_VecIsEmpty( pVector ) )
MessageBox( NULL, TEXT("Vector is empty!"), TEXT("Empty"), MB_OK );
else
MessageBox( NULL, TEXT("Vector is not empty!"), TEXT("Empty"), MB_OK );
}


L_VecIsLocked

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsLocked(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Determines whether or not the specified vector handle is locked.

Parameter | Description
pVector | Pointer to a vector handle.

Returns

TRUE | The specified vector handle is locked.
FALSE | The specified vector handle is not locked.

Comments

Locking a vector handle has precedence over locking layers within the vector handle. Therefore, if a vector handle is locked, the layers within that vector handle cannot be edited, even if the layers are not locked.

OpenGL and DirectX engines lock the vector handle automatically.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetLocked
Topics: | Working with Vector Handles

Example

/* This example will determine whether the given vector handle is locked */

void CheckVector( pVECTORHANDLE pVector )
{
/* Check if locked */
if( L_VecIsLocked( pVector ) )
MessageBox( NULL, TEXT("Vector is locked"), TEXT("Test"), MB_OK );
else
MessageBox( NULL, TEXT("Vector is not locked"), TEXT("Test"), MB_OK );
}


L_VecIsObjectHidden

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsObjectHidden(pVector, pObject)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */

Returns a value that indicates whether or not the specified object is hidden.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a vector object.

Returns

TRUE | The specified object is hidden.
FALSE | The specified object is not hidden.

Comments

If pObject is NULL and any object inside the vector handle is currently hidden, this function will return TRUE.

This function is not supported in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecHideObject, L_VecGetObject, L_VecSetObject, L_VecSelectObject, L_VecIsObjectSelected, L_VecDeleteObject, L_VecHitTest

Example

/* This example will determine whether the given object is hidden or not */

void TestObject ( pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
if( L_VecIsObjectHidden( pVector, pObject ) )
MessageBox( NULL, TEXT("Object is hidden"), TEXT("Test"), MB_OK );
else
MessageBox( NULL, TEXT("Object is visible"), TEXT("Test"), MB_OK );
}


L_VecIsObjectInsideParallelogram

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsObjectInsideParallelogram(pVector, pObject, pMin, pMax, dwFlags)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
const pVECTORPOINT pMin; | /* pointer to a vector point */
const pVECTORPOINT pMax; | /* pointer to a vector point */
L_UINT32 dwFlags; | /* flags */

Determines whether the specified object is within the specified parallelogram.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a VECTOROBJECT structure that contains information about a specific vector object. If this parameter is NULL, the object(s) to test is(are) determined by dwFlags.
pMin | Pointer to a VECTORPOINT structure that contains the minimum point of a parallelogram.
pMax | Pointer to a VECTORPOINT structure that contains the maximum point of a parallelogram.
dwFlags | Flag that indicates which object(s) to test. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Test all objects in the vector handle to determine whether they are in the specified parallelogram.
 | VECTOR_FLAGS_SELECTED_ONLY | Test only the selected objects within the vector handle.

Returns

TRUE | The specified object(s) is(are) within the specified parallelogram.
FALSE | The specified object(s) is(are) not within the specified parallelogram OR the specified object is not valid.

Comments

This function determines whether the object specified in pObject exists within the parallelogram specified by pMin and pMax. The parallelogram is given in logical units.

For this function, the current view port, pan position, camera, rotation, translation and scale do not effect the actual image position in 3D space.

Not supported in OpenGL and DirectX.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecIsObjectInsideRect, L_VecGetObjectParallelogram, L_VecGetObjectRect

Example

/* This example will selects all objects inside a given parallelogram */

typedef struct tagSELECTDATA
{
VECTORPOINT Min;
VECTORPOINT Max;
}
SELECTDATA, L_FAR *pSELECTDATA;

L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE, pVECTOROBJECT, L_VOID * );

void SelectAllObjectsInsideParallelogram( pVECTORHANDLE pVector, pVECTORPOINT pMin, pVECTORPOINT pMax )
{
SELECTDATA sd;

/* Fill in out custom data structure */
sd.Min.x = pMin->x;
sd.Min.y = pMin->y;
sd.Min.z = pMin->z;
sd.Max.x = pMax->x;
sd.Max.y = pMax->y;
sd.Max.z = pMax->z;

/* Enumerate all objects in the drawing */
L_VecEnumObjects( pVector, (pVECTORENUMOBJECTSPROC)EnumObjectsProc, &sd, 0 );
}

L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE pVector, pVECTOROBJECT pObject, L_VOID *pSD )
{
VECTOROBJECT ObjectDesc;
pSELECTDATA pSelectData = (pSELECTDATA) pSD;

/* Check if object is inside the parallelogram */
if( L_VecIsObjectInsideParallelogram( pVector, pObject, &pSelectData->Min, &pSelectData->Max, 0L ) )
{
L_VecGetObject( pVector, pObject, VECTOR_OBJECT, &ObjectDesc);
ObjectDesc.dwFlags |= VECTOR_OBJECT_SELECTED;
L_VecSetObject(pVector, pObject, VECTOR_OBJECT, &ObjectDesc);
L_VecFreeObject(VECTOR_OBJECT, &ObjectDesc);
}

/* Continue the enumeration */
return( SUCCESS );
}


L_VecIsObjectInsideRect

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsObjectInsideRect(pVector, pObject, pRect, dwFlags)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
const RECT L_FAR * pRect; | /* pointer to a RECT structure */
L_UINT32 dwFlags; | /* flags */

Determines whether the specified object(s) is(are) within the specified rectangle.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a VECTOROBJECT structure that contains information about a specific object. If this parameter is NULL, the object(s) to test is(are) determined by dwFlags.
pRect | Pointer to a RECT structure that contains information about a bounding rectangle.
dwFlags | Flag that indicates which object(s) to test. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Test all objects in the vector handle to determine whether they are in the specified parallelogram.
 | VECTOR_FLAGS_SELECTED_ONLY | Test only the selected objects within the vector handle.

Returns

TRUE | The specified object(s) is(are) within the specified rectangle.
FALSE | The specified object(s) is(are) not within the specified rectangle or the specified object is not valid.

Comments

The rectangle is given in screen (physical) coordinates.

The current view port, pan position, camera, scale, translation and rotation values are all considered when determining whether the object is within the rectangle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecIsObjectInsideParallelogram, L_VecGetObjectParallelogram, L_VecGetObjectRect

Example

/* This example will select all objects inside a given rectangle */

L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE, pVECTOROBJECT, L_VOID * );

void SelectAllObjectsInsideRect( pVECTORHANDLE pVector, RECT L_FAR *pRect )
{
/* Enumerate all objects in the drawing */
L_VecEnumObjects( pVector, (pVECTORENUMOBJECTSPROC)EnumObjectsProc, pRect, 0 );
}

L_INT EXT_CALLBACK EnumObjectsProc( pVECTORHANDLE pVector, pVECTOROBJECT pObject, L_VOID L_FAR *pData )
{
VECTOROBJECT ObjectDesc;
RECT *pRect = (RECT *) pData;

/* Check if object is inside the rectangle */
if( L_VecIsObjectInsideRect( pVector, pObject, pRect, 0L ) )
{
L_VecGetObject( pVector, pObject, VECTOR_OBJECT, &ObjectDesc);
ObjectDesc.dwFlags |= VECTOR_OBJECT_SELECTED;
L_VecSetObject(pVector, pObject, VECTOR_OBJECT, &ObjectDesc);
L_VecFreeObject(VECTOR_OBJECT, &ObjectDesc);
}

/* Continue the enumeration */
return( SUCCESS );
}


L_VecIsObjectSelected

#include "lvkrn.h"

L_BOOL EXT_FUNCTION L_VecIsObjectSelected(pVector, pObject)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */

Returns a value that indicates whether or not the specified object is selected.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a vector object.

Returns

TRUE | The specified object is selected.
FALSE | The specified object is not selected.

Comments

If pObject is NULL and any object inside the vector handle is currently selected, this function will return TRUE.

This function is not supported in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetObject, L_VecSetObject, L_VecSelectObject, L_VecDeleteObject, L_VecHitTest

Example

/* This example will determine whether or not the object under the given point is selected. */

void SelectObjectUnder( pVECTORHANDLE pVector, POINT *pPoint )
{
VECTOROBJECT Object; /* Object under point */
L_INT nRet;

/* Get object under that point */
nRet = L_VecHitTest( pVector, pPoint, &Object );

/* Is there an object under that point? */
if( nRet == SUCCESS )
{
/* Show the selection state of the object */
if( L_VecIsObjectSelected( pVector, &Object ) )
MessageBox(NULL, TEXT("Object is selected."), TEXT("Test"), MB_OK);
else
MessageBox(NULL, TEXT("Object is not selected."), TEXT("Test"), MB_OK);
}
}


L_VecLoadFile

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecLoadFile(pszFile, pVector, pLoadOptions, pFileInfo)

L_TCHAR L_FAR pszFile; | /* filename */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
pLOADFILEOPTION pLoadOptions; | /* pointer to a structure */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image from a file into a vector handle. The file can be any supported file format, compressed or uncompressed.

Parameter | Description
pszFile | Character string that contains the name of the file to load.
pVector | Pointer to a vector handle referencing the loaded image.
pLoadOptions | Reserved for future use. Pass NULL.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_ONLYFORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Loads a vector image into a vector handle. The file can be any supported vector file format.

The function will initialize the vector handle and allocate the storage necessary to hold the vector image.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_VecFree.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAttachToWindow, L_VecSaveFile
Topics: |

Example

void TestVecLoadFile ()

{

/* This example loads a vector image */

VECTORHANDLE LeadVector; /* Vector handle to hold the loaded image. */

L_INT nRet; /* Return value. */

/* Load the vector image. */

nRet = L_VecLoadFile(TEXT("FILE1.DXF"), &LeadVector, NULL, NULL );

if( nRet != SUCCESS )

{

/* There was an error loading the vector image. */

MessageBox( NULL, TEXT("Could not load file!"), TEXT("Error"), 0 );

}

}


L_VecLoadMemory

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecLoadMemory(pBuffer, pVector, nBufferSize, pLoadOptions, pFileInfo)

L_CHAR L_FAR * pBuffer; | /* pointer to the file in memory to be loaded */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT32 nBufferSize; | /* size of the file in memory (in bytes) */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file from memory into a vector handle. The file in memory can be in any supported image vector file format, compressed or uncompressed.

Parameter | Description
pBuffer | Pointer to the file in memory to be loaded.
pVector | Pointer to a vector handle referencing the vector to be filled with image data.
nBufferSize | Size of the file in memory (in bytes).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_ONLYFORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function will initialize the vector handle and allocate the storage necessary to hold the vector image.

Since the function allocates storage to hold the vector image, it is up to you to free this storage by calling L_VecFree.

This function cannot be used in combination with L_RedirectIO .

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LVKRN
LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecLoadFile, L_VecSaveMemory, L_VecSaveFile, L_VecFree

Example

void TestVecLoadMemory ( )

{

VECTORHANDLE LeadVector; /* Vector handle for the final image */

VECTORHANDLE TmpVector; /* Vector handle for the initial image */

HGLOBAL hFileInMemory; /* Memory handle */

L_UINT32 uMemSize; /* Size of the data in memory */

L_CHAR L_FAR *pData; /* Pointer to the data in memory */

/* Load a vector image */

L_VecLoadFile (TEXT("test.dxf"), &TmpVector, NULL, NULL );

/* Save the image as a WMF file in memory */

L_VecSaveMemory ( &hFileInMemory, &TmpVector, FILE_WMF, &uMemSize, NULL );

/* Free the temporary vector */

L_VecFree ( &TmpVector );

/* Get the pointer to the memory-resident file */

pData = (L_CHAR L_FAR *) GlobalLock( hFileInMemory );

/* Load the new vector image from memory */

L_VecLoadMemory( pData, &LeadVector, uMemSize, NULL, NULL );

/* Clean up */

GlobalUnlock( hFileInMemory );

GlobalFree( hFileInMemory );

}


L_VecLogicalToPhysical

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecLogicalToPhysical(pVector, pDst, pSrc)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
POINT L_FAR *pDst; | /* pointer to a POINT structure */
const pVECTORPOINT pSrc; | /* pointer to a VECTORPOINT structure */

Converts a 3D VECTORPOINT into a Windows 2D POINT.

Parameter | Description
pVector | Pointer to a vector handle.
pDst | Pointer to a POINT structure to be updated with the physical 2 dimensional point converted from the 3 dimensional vector point in pSrc.
pSrc | Pointer to a VECTRPOINT structure that contains a 3 dimensional point to be converted into a 2 dimensional point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Converts a given logical point in the vector drawing (with X, Y, Z coordinates), into a physical 2D point.

Conversion will be based on the current view port and camera set in the VECTORHANDLE.

Not supported in OpenGL or DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecPhysicalToLogical, L_VecGetObjectParallelogram, L_VecGetObjectRect

Example

/* This example will obtain drawing physical extents */

void GetExtents( pVECTORHANDLE pVector, RECT *pExtent )
{
VECTORPOINT LeftTop, RightBottom;

/* Get drawing logical extents */
L_VecGetObjectParallelogram( pVector, NULL, &LeftTop, &RightBottom, 0L );

/* Convert to physical to get the rect where the drawing will be painted */
L_VecLogicalToPhysical( pVector, (POINT *) &pExtent->left, &LeftTop );
L_VecLogicalToPhysical( pVector, (POINT *) &pExtent->right, &RightBottom );
}


L_VecPaint

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecPaint(hDC, pVector, bEraseBkgnd)

HDC hDC; | /* device context */
const pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_BOOL bEraseBkgnd; | /* flag that indicates whether to erase the background */

Draws the specified vector into a given device context.

Parameter | Description
hDC | Device context.
pVector | Pointer to a vector handle that references the vector to draw.
bEraseBkgnd | Flag that indicates whether or not to erase the background rectangle when rendering the vector. Possible values are:
 | Value | Meaning
 | TRUE | The background rectangle will be erased when the vector image is rendered to the device context.
 | FALSE | The background rectangle will not be erased.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If hDC is NULL, this function will assume that pVector is already attached to a window, and will draw the vector image to the window DC.

The background color used to erase the rectangle where the vector image is rendered can be set with L_VecSetBackgroundColor.

If L_VecPaint is called in response to a WM_PAINT message, hDC should be the paint DC obtained from BeginPaint.

This function will use current camera and current viewport of the vector handle to do the necessary projection into the surface of the DC.

Note:

For the OpenGL engine, the background color will always be used to erase all of the image before drawing, regardless of the view port.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecRealize, L_VecAttachToWindow, L_VecSetCamera, L_VecSetViewport, L_VecSetBackgroundColor

Example

/* This example will create a HBITMAP for the given vector file. */

HBITMAP LoadAsDDB( L_TCHAR L_FAR *pszFile, L_UINT uWidth, L_UINT uHeight )
{
/* uWidth and uHeight are the desired bitmap size, the final bitmap size will be less or equal to uWidth and uHeight. */

VECTORHANDLE TmpVector;
VECTORPOINT min, max;
L_DOUBLE Width, Height, Factor;
RECT rect;
HBITMAP hBitmap;
HDC hDC;

/* First load the vector */
L_VecLoadFile( pszFile, &TmpVector, NULL, NULL );

/* Get vector image logical parallelogram */
L_VecGetObjectParallelogram( &TmpVector, NULL, &min, &max, 0L );

/* Calculate viewport preserving drawing aspect ratio */
Width = max.x - min.x;
Height = max.y - min.y;

if( uWidth < uHeight )
{
Factor = uWidth / Width;

/* Check if height would fit in size */
if( ( Factor * Height ) > uHeight )
{
/* No can do, calculate based on height */
Factor = uHeight / Height;
}
}
else
{
Factor = uHeight / Height;

/* Check if width would fit in size */
if( ( Factor * Width ) > uWidth )
{
/* No can do, calculate based on width */
Factor = uWidth / Width;
}
}

/* Setup viewport rectangle */
rect.left = 0;
rect.top = 0;
rect.right = (L_INT) ( Factor * Width );
rect.bottom = (L_INT) ( Factor * Height );

/* Create the DDB */
hBitmap = CreateCompatibleBitmap( NULL, rect.right, rect.bottom );
hDC = CreateCompatibleDC( NULL );
SelectObject( hDC, hBitmap );

/* Setup viewport */
L_VecSetViewport( &TmpVector, &rect );

/* Setup default camera (Top view) */
L_VecSetCamera( &TmpVector, NULL );

/* Render the vector into the memory DC with black background */
L_VecSetBackgroundColor( &TmpVector, RGB( 0, 0, 0 ) );
L_VecPaint( hDC, &TmpVector, TRUE );

DeleteDC( hDC );

/* Free the vector cause it's no longer needed */
L_VecFree( &TmpVector );

return( hBitmap );
}


L_VecPaintDC

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecPaintDC(hDC, pVector, uWidth, uHeight, pSrc, pClipSrc, pDst, pClipDst, dwFlags)

HDC hDC; | /* handle to the target device context */
const pVECTORHANDLE pVector; | /* pointer to the vector handle */
L_UINT uWidth; | /* desired width of the vector */
L_UINT uHeight; | /* desired height of the vector */
const RECT L_FAR *pSrc; | /* pointer to the display source rectangle */
const RECT L_FAR *pClipSrc; | /* pointer to the display source clipping rectangle */
const RECT L_FAR *pDst; | /* pointer to the display destination rectangle */
const RECT L_FAR *pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 dwFlags; | /* flags */

Displays any vector, at any size, to any device context (screen, printer, or memory dc).

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pVector | Pointer to the vector handle referencing the vector image to paint.
uWidth | Desired virtual width of the source vector in pixels.
uHeight | Desired virtual height of the source vector in pixels.
pSrc | Pointer to the Windows RECT structure that specifies the part of the vector to use as the display source.
 | The coordinates in the RECT structure are relative to the vector. You can pass NULL to use the default, which matches the vector.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source vector has changed.
 | The coordinates in the RECT structure are relative to the vector. You can pass NULL to use the default, which matches the vector.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
dwFlags | Flag that indicates how to perform the paint process. Possible values are:
 | Value | Meaning
 | VECTOR_PAINT_ERASEBKGND | Use the vector background color to clear the destination area before painting.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function emulates the LEAD L_PaintDC function using a vector handle instead of a bitmap image.

Since vector images don't have physical width and height, you must pass width and height values to this function to determine the source size. In L_PaintDC, uWidth and uHeight are equal to Bitmap.Width and Bitmap.Height respectively.

For more information on using the source and destination rectangles and the clipping rectangles, refer to L_PaintDC .

This function is not supported in DirectX or OpenGL engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecPaint, L_VecRealize

Example

For complete sample code, refer to the VECOVRLY example.

/* This example shows the minimum requirements for overlaying a vector drawing over a raster image */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
VECTORHANDLE LeadVector; /* Vector handle for the drawing */
void TestFunction(HWND hWnd)
{
HDC hdc; /* Device context for the current window */
RECT rLeadDest; /* Destination rectangle for painting */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context */
hdc = GetDC( hWnd );

/* Set the destination rectangle to be the same as the bitmap.
Other painting rectangles can take defaults. */
SetRect( &rLeadDest, 0, 0, BITMAPWIDTH( &LeadBitmap ), BITMAPHEIGHT( &LeadBitmap ) );

/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette ( hdc, &LeadBitmap );

/* Select our palette and save the old one */
hSavedPalette = SelectPalette( hdc, hOurPalette, FALSE );

/* Realize our palette */
RealizePalette( hdc );

/* Paint the raster image */
L_PaintDC ( hdc, /* Device context */
&LeadBitmap, /* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY ); /* ROP3 code for a Normal Paint */

/* Overlay the vector image */
L_VecPaintDC( hdc, /* Device context */
&LeadVector, /* Vector handle */
LeadBitmap.Width, /* Width desired */
LeadBitmap.Height, /* Height desired */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
0L ); /* Do not erase background */

/* Restore the old palette */
SelectPalette( hdc, hSavedPalette, FALSE );

/* Delete the newly created palette */
DeleteObject( hOurPalette );

/* Release the device context */
ReleaseDC( hWnd, hdc );
return;
}


L_VecPhysicalToLogical

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecPhysicalToLogical(pVector, pDst, pSrc)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pDst; | /* pointer to a VECTORPOINT structure */
const POINT L_FAR * pSrc; | /* pointer to a POINT structure */

Converts a Windows 2D POINT into a 3D VECTORPOINT.

Parameter | Description
pVector | Pointer to a vector handle.
pDst | Pointer to a VECTORPOINT structure to be updated with the logical 3 dimensional point converted from the 2 dimensional point in pSrc.
pSrc | Pointer to a POINT structure that contains a 2 dimensional point to be converted into a 3 dimensional point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Converts a given 2D physical point into a logical (with X, Y, Z coordinates), 3D point.

The Z value of the destination 3D point will not be changed.

Conversion will be based on the current view port and camera values set in the VECTORHANDLE.

Not supported in OpenGL or DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecLogicalToPhysical, L_VecGetObjectParallelogram, L_VecGetObjectRect
Topics: | Viewing a Vector Image

Example

/* This example will show the 3D point of a given 2D point on the vector drawing */

void ShowLogicalPoint( pVECTORHANDLE pVector, POINT *ppt )
{
VECTORPOINT Point;
L_TCHAR szBuffer[ 80 ];

Point.z = 0.0;
L_VecPhysicalToLogical( pVector, &Point, ppt );

wsprintf( szBuffer, TEXT("%f, %f, %f"), Point.x, Point.y, Point.z );
MessageBox( NULL, szBuffer, TEXT("Point"), MB_OK );
}


L_VecRealize

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecRealize(pBitmap, pVector, bEraseBkgnd)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
const pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_BOOL bEraseBkgnd; | /* flag that indicates whether to erase the background */

Draws the specified vector into the specified LEAD bitmap handle.

Parameter | Description
pBitmap | Pointer to a bitmap handle, into which the vector will be drawn.
pVector | Pointer to a vector handle that references the vector to be drawn into pBitmap.
bEraseBkgnd | Flag that indicates whether or not to erase the background rectangle when realizing the vector to the bitmap. Possible values are:
 | Value | Meaning
 | TRUE | The background rectangle will be erased when the vector image is realized to the bitmap.
 | FALSE | The background rectangle will not be erased.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function draws the specified vector into the specified bitmap handle.

The bitmap handle should be allocated before calling this function.

If hDC is NULL, this function will assume that pVector is already attached to a window, and will draw it to the window DC.

The background color used to erase the rectangle where the vector image is to be rendered can be set with L_VecSetBackgroundColor.

This function will use the current camera and current view port of the vector handle to do the necessary projection onto the surface of the DC.

Note:

For the OpenGL engine, the background color will always be used to erase all of the image before drawing, regardless of the view port.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecPaint, L_VecAttachToWindow, L_VecSetCamera, L_VecSetViewport, L_VecSetBackgroundColor

Example

/* This example will create a BITMAPHANDLE for the given vector file. */

pBITMAPHANDLE LoadAsBitmap( L_TCHAR L_FAR *pszFile, L_UINT uWidth, L_UINT uHeight )
{
/* uWidth and uHeight are the desired bitmap size, the final bitmap size will be less or equal to uWidth and uHeight. */

VECTORHANDLE   TmpVector;
VECTORPOINT    Min, Max;
L_DOUBLE        Width, Height, Factor;
RECT           rect;
pBITMAPHANDLE  pBitmap;

/* First load the vector */
L_VecLoadFile( pszFile, &TmpVector, NULL, NULL );

/* Get vector image logical parallelogram */
L_VecGetObjectParallelogram( &TmpVector, NULL, &Min, &Max, 0L );

/* Calculate viewport preserving vector image aspect ratio */
Width = Max.x - Min.x;
Height = Max.y - Min.y;

if( uWidth < uHeight )
{
Factor = uWidth / Width;

/* Check if height would fit in size */
if( ( Factor * Height ) > uHeight )
{
/* No can do, calculate based on height */
Factor = uHeight / Height;
}
}
else
{
Factor = uHeight / Height;

/* Check if width would fit in size */
if( ( Factor * Width ) > uWidth )
{
/* No can do, calculate based on width */
Factor = uWidth / Width;
}
}

/* Setup viewport rectangle */
rect.left = 0;
rect.top = 0;
rect.right = (L_INT) ( Factor * Width );
rect.bottom = (L_INT) ( Factor * Height );

/* Create the LEAD bitmap */
pBitmap = (pBITMAPHANDLE) GlobalAllocPtr(GHND, sizeof( BITMAPHANDLE ));
L_InitBitmap ( pBitmap, sizeof( BITMAPHANDLE ), rect.right, rect.bottom, 24 );
L_AllocateBitmap
 ( pBitmap, TYPE_CONV );

/* set the viewport */
L_VecSetViewport( &TmpVector, &rect );

/* set the camera to a top view position. */
L_VecSetCamera( &TmpVector, NULL );

/* Render the vector into the bitmap */
L_VecRealize( pBitmap, &TmpVector, TRUE );

/* Free the vector cause it's no longer needed */
L_VecFree( &TmpVector );

return( pBitmap );
}


L_VecRemoveObjectViewContext

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecRemoveObjectViewContext(pVector, pObject)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */

Removes a preset view context from the specified vector object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object from which to remove the view context. If the object doesn’t have a view context, the object is not changed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectViewContext , L_VecGetObjectViewContext
Topics: | Modifying Vector Object Characteristics
 | Working with View Context

Example

For an example, please refer to L_VecGetObjectViewContext


L_VecSaveFile

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSaveFile(pszFile, pVector, nFormat, pSaveOptions)

L_TCHAR L_FAR pszFile; | /* file name */
pVECTORHANDLE pVector; | /* pointer to the vector handle */
L_INT nFormat; | /* file format */
pSAVEFILEOPTION pSaveOptions; | /* pointer to a structure */

Saves a vector image, contained in a vector handle, to a file in any of the supported compressed or uncompressed formats.

Parameter | Description
pszFile | Character string containing the output file name.
pVector | Pointer to the vector handle that references the image data to save.
nFormat | Format of the output file. For valid values, refer to Formats of Output Files .
pSaveOptions | Reserved for future use. Pass NULL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Saves a vector image contained in a vector handle to a file in any of the supported vector image formats. For more information about file formats that support vector images, refer to Formats of Output Files .

Required DLLs and Libraries

LVKRN
LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecLoadFile, L_VecApplyTransformation

Example

void TestVecSaveFile ()

{

/* This example loads a temporary vector and saves it to a new file. */

VECTORHANDLE TmpVector; /* Vector handle for the temporary vector image. */

/* Load a vector vector image */

L_VecLoadFile (TEXT("drawing3.dxf"), &TmpVector, NULL, NULL );

/* Save the image as a windows meta file. */

L_VecSaveFile(TEXT("TEST.WMF"), &TmpVector, FILE_WMF, NULL );

/* Free the temporary vector.*/

L_VecFree ( &TmpVector );

}


L_VecSaveMemory

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSaveMemory(phHandle, pVector, nFormat, puSize, pSaveOptions)

HANDLE L_FAR * phHandle; | /* pointer to a memory handle */
pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT nFormat; | /* output file format */
L_UINT32 L_FAR *puSize; | /* pointer to the size of the memory handle */
pSAVEFILEOPTION pSaveOptions | /* pointer to optional extended save options */

Saves a vector image to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
phHandle | Pointer to the memory handle. Set this to NULL. This function uses the handle to allocate the memory. It unlocks the memory upon completion of the save.
pVector | Pointer to a vector handle that references the vector image to be saved.
nFormat | Output file format. For valid values, refer to Formats of Output Files .
 | For possible values, refer to Compression Quality Factors .
puSize | Pointer to a variable to be updated with the size of the saved file.
pSaveOptions | Pointer to optional extended save options. Reserved for future use. Pass NULL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a memory handle. You can then pass its address in this function, which will allocate the memory, save the vector handle, and unlock the memory.
2. | Declare a long integer (L_UINT32) variable for the file-size. You can then pass its address in this function, which will update its value with the size of the file.
3. | Call this function, to save the vector handle in the specified memory handle.

This function cannot be used in combination with L_RedirectIO .

Required DLLs and Libraries

LVKRN
LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSaveFile, L_VecLoadMemory, L_VecLoadFile

Example

For an example, refer to L_VecLoadMemory.


L_VecSelectObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSelectObject(pVector, pObject, bSelect)

const pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOROBJECT pObject; | /* pointer to a vector object */
L_BOOL bSelect; | /* flag that indicates whether to select or unselect */

Selects or unselects an object.

Parameter | Description
pVector | Pointer to a vector handle. Objects within this vector handle will be selected or unselected.
pObject | Pointer to a VECTOROBJECT structure that references an object to be selected or unselected.
bSelect | Flag that indicates whether to select or unselect the specified object. Possible values are:
 | Value | Meaning
 | TRUE | Select the specified object.
 | FALSE | Unselect the specified object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Selects or unselects an object within the specified vector handle.

This function is not supported in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecIsObjectSelected, L_VecDeleteObject, L_VecHitTest, L_VecGetObject

Example

/* This example will select the object under a given 2D point */

void SelectObjectUnder( pVECTORHANDLE pVector, POINT L_FAR *pPoint )
{
VECTOROBJECT Object; /* Object under point */
L_INT nRet;

/* Get object under that point */
nRet = L_VecHitTest( pVector, pPoint, &Object );

/* Is there an object under that point? */
if( nRet == SUCCESS )
{
/* Yes, select it */
L_VecSelectObject( pVector, &Object, TRUE );
}
}


L_VecSetActiveLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetActiveLayer(pVector, pLayer)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */

Sets the active layer in the specified vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pLayer | Pointer to the VECTORLAYER structure that references the layer to set as the active layer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Some functions use the active layer when NULL is passed for a pVECTORLAYER parameter. This makes it easier to work with the toolkit when layers are not needed.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetActiveLayer.
Topics: | Working with Vector Layers

Example

/* This example will set the active layer to the one with the given name */
L_VOID SetActiveLayer( pVECTORHANDLE pVector, const L_TCHAR *pszName )
{
VECTORLAYER Layer;
L_INT nRet;

/* Get the requested layer */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( nRet == SUCCESS )
{
/* Set it as the active layer */
L_VecSetActiveLayer( pVector, &Layer );
}
}


L_VecSetAmbientColor

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetAmbientColor(pVector, Color)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
COLORREF Color; | /* the new ambient color */

Sets the ambient (room) light used when drawing a vector image.

Parameter | Description
pVector | Pointer to a vector handle.
Color | The RGB value of the ambient light to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will only be effective if the use of lights has been enabled using L_VecSetUseLights.

The default ambient color is white (RGB(255, 255, 255)).

This function has no effect in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetAmbientColor, L_VecSetUseLights, L_VecGetUseLights

Example

/* This example will decrease the ambient color to half */

void HalfAmbient( pVECTORHANDLE pVector )
{
COLORREF OldColor; /* Current ambient color */
COLORREF NewColor; /* New ambient color */

/* Get current ambient color */
OldColor = L_VecGetAmbientColor( pVector );

/* Half the color */
NewColor = RGB( GetRValue( OldColor ) / 2,
GetGValue( OldColor ) / 2,
GetBValue( OldColor ) / 2 );

/* Set new ambient color */
L_VecSetAmbientColor( pVector, NewColor );
}


L_VecSetBackgroundColor

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetBackgroundColor(pVector, Color)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
COLORREF Color; | /* the background color */

Sets the current background color.

Parameter | Description
pVector | Pointer to a vector handle.
Color | The background color to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If L_VecPaint is called, with bEraseBkgnd set to TRUE, this color will be used to erase the background.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetBackgroundColor, L_VecPaint, L_VecAttachToWindow

Example

/* This example will set the background color of a vector handle */

void ChangeBackgroundColor( HWND hWnd, pVECTORHANDLE pVector )
{
CHOOSECOLOR cc; /* ChooseColor Windows structure */
COLORREF ccCustColors[16]; /* Custom colors */

memset( &cc, 0, sizeof( CHOOSECOLOR ));
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = hWnd;
cc.rgbResult = L_VecGetBackgroundColor( pVector );
cc.lpCustColors = ccCustColors;
cc.Flags = CC_RGBINIT;

if( ChooseColor( &cc ))
L_VecSetBackgroundColor( pVector, cc.rgbResult );
}


L_VecSetBindVerticesMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetBindVerticesMode(pVector, nMode)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT nMode; | /* binding mode to set */

Sets the vertices bind mode for a vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
nMode | The vertices binding mode. Possible values are:
 | Value | Meaning
 | VECTOR_BIND_VERTICES | Vertices are bound. If changes occur to an object, all other objects sharing vertices with that object will be changed too.
 | VECTOR_UNBIND_VERTICES | Vertices are not bound. If changes occur to an object, Other objects sharing vertices with that object will not be effected.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets a value that determines whether or not the vertices of an object are bound to each other.

If VECTOR_BIND_VERTICES mode is selected, objects share vertices. Therefore, if one object changes, other objects sharing vertices with that object will change too.

If VECTOR_UNBIND_VERTICES mode is selected, objects have their own individual vertices. Therefore, if one object changes, no other objects will be effected.

This function will have no effect in the OpenGL and DirectX engines.

Default mode is VECTOR_BIND_VERTICES.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetBindVerticesMode, L_VecSetScale, L_VecSetRotation, L_VecSetTranslation

Example

/* This example will toggle the bind vertices mode of a vector handle */

void ToggleBindVertices( pVECTORHANDLE pVector )
{
if( L_VecGetBindVerticesMode( pVector ) == VECTOR_BIND_VERTICES )
L_VecSetBindVerticesMode( pVector, VECTOR_UNBIND_VERTICES );
else
L_VecSetBindVerticesMode( pVector, VECTOR_BIND_VERTICES );
}


L_VecSetCamera

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetCamera(pVector, pCamera)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORCAMERA pCamera; | /* pointer to a structure */

Sets the new camera settings.

Parameter | Description
pVector | Pointer to a vector handle.
pCamera | Pointer to a VECTORCAMERA structure that contains the new camera settings. If this is NULL, the default camera settings will be used.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will set the current viewing camera.

The camera is used with the view port to determine how the drawing will be projected into the destination DC when using L_VecPaint.

If pCamera is NULL, the default camera will be set. The default camera is defined as a top view camera .

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetCamera, L_VecPaint

Example

/* This example will set new camera settings */

void SetMyCamera( pVECTORHANDLE pVector )
{
VECTORCAMERA camera; /* Camera */

/* Set rotation around the Z-axis to 30 degrees */
camera.Theta = 30.0;

/* Set rotation off the Z-Axis to 60 degrees */
camera.Phi = 20.0;

/* Use perspective projection */
camera.bPerspective = TRUE;

/* Set camera position 200 units from the object */
camera.Distance = 200.0;

/* Set the new camera settings */
L_VecSetCamera( pVector, &camera );
}


L_VecSetDisplayOptions

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetDisplayOptions(pVector, pOptions)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOR_DISPLAY_OPTIONS pOptions; | /* pointer to a display options structure */

This functions sets the display options in the vector handle.

Parameter | Description
pVector | Pointer to the vector handle.
pOptions | Pointer to a VECTOR_DISPLAY_OPTIONS structure that contains the display options to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The display options determine how the toolkit will draw objects on the screen

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetDisplayOptions, L_VecInvertColors
Topics: | Modifying Vector Object Characteristics
 | Working with Vector Handles

Example

For an example, please refer to L_VecGetDisplayOptions


L_VecSetEngine

This function has been removed. Refer to L_VecAttachToWindow.


L_VecSetEventCallback

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetEventCallback(pVector, pProc, pUserData, pOldProc, pOldUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOREVENTPROC pProc; | /* pointer to your callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
ppVECTOREVENTPROC pOldProc; | /* pointer to a pointer */
L_VOID L_FAR **pOldUserData; | /* pointer to more parameters for the old callback function */

Sets a new vector event callback.

Parameter | Description
pVector | Pointer to a vector handle.
pProc | Your callback function that supplies the information that LEADTOOLS needs when handling events. The callback function must adhere to the syntax specified in VECTOREVENTPROC.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pOldProc | Pointer to a pointer to a VECTOREVENTPROC that will be updated with the old callback function.
pOldUserData | Pointer to the additional data used by the old callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For information about the types of events the vector handle can generate, refer to the VECTOREVENT structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecEvent, VECTOREVENTPROC
Topics: | Vector Handle Events

Example

/* This example will disable L_VecSetRotation */

#define VECTOR_ERROR_USERNOROTATION -20000

typedef struct tagDATA
{
pVECTOREVENTPROC pOldProc;
L_VOID *pOldUserData;
}
DATA, *LPDATA;

L_INT EXT_CALLBACK VectorEventProc( pVECTORHANDLE pVector, L_UINT uLevel, pVECTOREVENT pEvent, L_VOID L_FAR *pUserData )
{
L_INT nRet;
LPDATA pData;

pData = (LPDATA) pUserData;

/* call the old event handler */
nRet = pData->pOldProc( pVector, uLevel, pEvent, pData->pOldUserData );
if( nRet != SUCCESS )
return nRet;

/* disable rotation */
if( uLevel == 0 && /* top level event */
pEvent->uType == VECTOR_EVENT_ROTATION && /* from a L_VecSelectObject call */
pEvent->Status == VECTOR_EVENT_STATUS_BEFORE ) /* before any action is taken */
return VECTOR_ERROR_USERNOROTATION;

return SUCCESS;
}

void DisableRotation( pVECTORHANDLE pVector )
{
LPDATA pData;

/* set a new vector event callback */
pData = (LPDATA) GlobalAllocPtr( GHND, sizeof( LPDATA ) );
L_VecSetEventCallback( pVector, VectorEventProc, pData, &pData->pOldProc, &pData->pOldUserData );
}

void TestFunction( pVECTORHANDLE pVector )
{
L_INT nRet;
VECTORPOINT Point;

/* try to call L_VecSetRotation */
Point.x = 10.0;
Point.y = 20.0;
Point.z = 30.0;
nRet = L_VecSetRotation( pVector, &Point, NULL, NULL, 0L );

/* nRet should be VECTOR_ERROR_USERNOROTATION, the value returned from VectorEventProc */
}


L_VecSetFontMapper

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetFontMapper(pVector, pFontMapper, pUserData);

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORFONTMAPPERCALLBACK pFontMapper | /* font mapper callback */
L_VOID *pUserData | /* pointer to more parameters for the callback */

Sets a font mapper for the vector handle. A font mapper is a callback function which is invoked when adding a new font to the resource list of the vector toolkit. Using the callback, the user can modify or replace the font before allowing the toolkit to use it. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter

Description

pVector

Pointer to the vector handle for which to set the font mapper.

pFontMapper

Pointer to a callback function used to handle the font mapping. It allows the user to modify the contents of the font resource before adding it to the list of fonts maintained by the Vector toolkit. The callback function must adhere to the VECTORFONTMAPPERCALLBACK prototype.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetFontMapper, pVECTORFONTMAPPERCALLBACK
Topics: | Mapping Fonts Handling Font Mappers

Example

L_INT WINAPI myFontMapper( pVECTORHANDLE pVector, LPLOGFONT pLogFont, L_VOID* pUserData )
{
/* pUserData points to "Arial" .. copy it to pLogFont->lfFaceName to force the toolkit
to render all fonts as Arial */

if( lstrcmp( pLogFont->lfFaceName, (L_TCHAR *)pUserData ) == 0 )
{
lstrcpy( pLogFont->lfFaceName, TEXT("Times New Roman"));
}
return SUCCESS;
}

int setmyfontmapper( pVECTORHANDLE pVector )
{
pVECTORFONTMAPPERCALLBACK pTempMapper;
L_VecGetFontMapper( pVector, &pTempMapper );
if( NULL == pTempMapper )
L_VecSetFontMapper( pVector, myFontMapper, TEXT("Arial"));

return 1;
}


L_VecSetGroup

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetGroup(pVector, pGroup, pGroupDesc)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORGROUP pGroup; | /* pointer to a vector group */
const pVECTORGROUPDESC pGroupDesc; | /* pointer to a structure */

Updates a vector group with new information. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pGroup | Pointer to a VECTORGROUP structure that references the vector group to set.
pGroupDesc | Pointer to a VECTORGROUPDESC structure that contains the new group information to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For more information on the group information that can be set, refer to the VECTORGROUPDESC structure.

To get the group information for a specific group, use the L_VecGetGroup function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetGroup, L_VecFreeGroup
Topics: | Working with Vector Groups

Example

/* This example will change the name of a given group */
void LockGroup( pVECTORHANDLE pVector, const L_TCHAR *pszOldName, const L_TCHAR *pszNewName )
{
VECTORGROUP Group;
VECTORGROUPDESC GroupDesc;
L_INT nRet;

/* find the group with that name */
nRet = L_VecGetGroupByName( pVector, pszOldName, &Group );
if( nRet != SUCCESS )
return; /* group not found */

/* get this group for editing */
L_VecGetGroup( pVector, &Group, &GroupDesc );

/* set new name */
lstrcpy( GroupDesc.szName, pszNewName );

/* set back and clean up */
L_VecSetGroup( pVector, &Group, &GroupDesc );
L_VecFreeGroup( &GroupDesc );
}


L_VecSetHitTest

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetHitTest(pVector, pHitTest)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORHITTEST pHitTest; | /* pointer to a structure */

Sets the new hit test settings.

Parameter | Description
pVector | Pointer to a vector handle.
pHitTest | Pointer to a VECTORHITTEST structure that contains the new hit test settings.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The hit test settings determine the behavior of the hit test. The hit test itself is performed by calling L_VecHitTest.

To get the current hit test settings, call L_VecGetHitTest.

For more information on possible hit test settings, refer to the VECTORHITTEST structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetHitTest, L_VecHitTest
Topics: | Working with Vector Objects

Example

/* This example will set the new hit test settings */

void SetMyHitTest( pVECTORHANDLE pVector )
{
VECTORHITTEST HitTest; /* Hittest settings */

/* Allow for 4 pixels error calibration value */
HitTest.nDistance = 4;

/* Allow hittest checking to be done inside closed figures as well */
HitTest.dwFlags = VECTOR_HITTEST_CLOSEDFIGURES;

/* Set new hittest settings */
L_VecSetHitTest ( pVector, &HitTest );
}


L_VecSetHyperlink

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetHyperlink(pVector, pObject, uIndex, pTarget)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
L_UINT32 uIndex; | /* index to the target item that will be set */
pVECTORLINKDESC pTarget; | /* pointer to a structure */

Sets a target in the target list of the specified vector object's hyperlink.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references a vector object. This function will set a target in the target list of this hyperlinked vector object. If the object does not have a hyperlink, the function fails.
uIndex | Index to the target item that will be set.
pTarget | Pointer to a VECTORLINKDESC structure that contains the information on the new target to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

A hyperlink must be added to a vector object using the L_VecAddHyperlink function before it can be changed using the L_VecSetHyperlink function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecAddHyperlink, L_VecGetHyperlink, L_VecGetHyperlinkCount, L_VecGotoHyperlink
Topics: | Hyperlink Object
 | Hyperlink Objects

Example

For an example please refer to L_VecGetHyperlink


L_VecSetLayer

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetLayer(pVector, pLayer, pLayerDesc)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORLAYER pLayer; | /* pointer to a vector layer */
const pVECTORLAYERDESC pLayerDesc; | /* pointer to a structure */

Updates a vector layer with new information. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to the vector handle.
pLayer | Pointer to a VECTORLAYER structure that references the vector layer to set.
pLayerDesc | Pointer to a VECTORLAYERDESC structure that contains the new layer information to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For more information on the layer information that can be set, refer to the VECTORLAYERDESC structure.

To get the layer information for a specific layer, use the L_VecGetLayer function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetLayer, L_VecFreeLayer.
Topics: | Working with Vector Layers

Example

/* This example will make the layer with the given name locked from changes. */
void LockLayer( pVECTORHANDLE pVector, const L_TCHAR *pszName )
{
VECTORLAYER Layer;
VECTORLAYERDESC LayerDesc;
L_INT nRet;

/* find the layer with that name */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( nRet != SUCCESS )
return; /* layer not found */

/* get this layer for editing */
L_VecGetLayer( pVector, &Layer, &LayerDesc );

/* lock the layer */
LayerDesc.bLocked = TRUE;

/* set back and clean up */
L_VecSetLayer( pVector, &Layer, &LayerDesc );
L_VecFreeLayer( &LayerDesc );
}


L_VecSetLocked

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetLocked(pVector, bLock)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_BOOL bLock; | /* flag */

Locks or unlocks the specified vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
bLock | Flag that indicates whether to lock or unlock the specified vector handle. Possible values are:
 | Value | Meaning
 | TRUE | Lock the specified vector handle.
 | FALSE | Unlock the specified vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Locking a vector handle has precedence over locking layers within the vector handle. Therefore, if a vector handle is locked, the layers within that vector handle cannot be edited, even if the layers are not locked.

OpenGL and DirectX engines lock the vector handle automatically.

To lock a layer, set the bLocked member of a VECTORLAYERDESC structure to TRUE and update the layer information using the L_VecSetLayer function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecIsLocked, L_VecSetLayer
Topics: | Working with Vector Handles

Example

/* This example will toggle the lock property of a vector handle */

void ToggleLock( pVECTORHANDLE pVector )
{
if( L_VecIsLocked( pVector ) )
L_VecSetLocked( pVector, FALSE );
else
L_VecSetLocked( pVector, TRUE );
}


L_VecSetMarker

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetMarker(pVector, pMarker)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORMARKER pMarker; | /* pointer to a structure */

Sets the new marker settings.

Parameter | Description
pVector | Pointer to a vector handle.
pMarker | Pointer to a VECTORMARKER structure that contains the marker settings to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The marker is used to indicate those objects within the vector handle that are selected.

For more information on available marker settings, refer to the VECTORMARKER structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetMarker.
Topics: | Working with Vector Handles

Example

/* This example will set new marker settings */

void SetMyMarker( pVECTORHANDLE pVector )
{
VECTORMARKER Marker; /* marker */

/* Set flags to use pen color and style */
Marker.dwFlags = VECTOR_MARKER_PEN_STYLE | VECTOR_MARKER_PEN_COLOR;

/* Set marker to use a blue dot pen */
Marker.Pen.bExtPen = FALSE;
Marker.Pen.NewPen.LogPen.lopnStyle = PS_DOT;
Marker.Pen.NewPen.LogPen.lopnColor = RGB( 0x00, 0x00, 0xFF );

/* Set new marker settings */
L_VecSetMarker ( pVector, &Marker );
}


L_VecSetObject

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetObject(pVector, pObject, nType, pObjectDesc)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOROBJECT pObject; | /* pointer to a vector object */
L_INT nType; | /* object type */
const L_VOID L_FAR * pObjectDesc; | /* pointer to a vector object structure */

Sets the object information of the specified vector object. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to a vector object.
nType | Type of object to set. Possible values are:
 | Value | Meaning
 | VECTOR_ARC | Arc.
 | VECTOR_CHORD | Chord.
 | VECTOR_CIRCLE | Circle.
 | VECTOR_CLONE | Clone object of a vector group.
 | VECTOR_ELLIPSE | Ellipse.
 | VECTOR_ELLIPTICALARC | Elliptical arc.
 | VECTOR_LINE | Line.
 | VECTOR_PIE | Pie section.
 | VECTOR_POLYBEZIER | Poly Bezier curve.
 | VECTOR_POLYDRAW | Polydraw.
 | VECTOR_POLYGON | Polygon.
 | VECTOR_POLYLINE | Polyline.
 | VECTOR_RASTER | Raster.
 | VECTOR_RECTANGLE | Rectangle.
 | VECTOR_STOCK | Stock object from a stock library.
 | VECTOR_TEXT | Text.
 | VECTOR_VERTEX | 3D vertex in space.
pObjectDesc | Pointer to a vector object structure that contains the object information to be set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to update the object information of the specified vector object.

If nType is set to VECTOR_OBJECT, this function will only update the general VECTOROBJECT structure information common to all object types.

If you want to update specific information about an object, set the nType member to the desired object type and set pObjectDesc to the address of the appropriate vector object structure.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetObject
Topics: | Working with Vector Objects

Example

For an example, refer to L_VecGetObject.


L_VecSetObjectAttributes

#include "lvkrn.h"

L_INT EXT_FUNCITON L_VecSetObjectAttributes(pVector, pObject, pnROP, pPen, pBrush, pFont, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTOROBJECT pObject; | /* pointer to a vector object */
const L_INT L_FAR * pnROP; | /* ROP code */
const pVECTORPEN pPen; | /* pen characteristics */
const pVECTORBRUSH pBrush; | /* brush characteristics */
const pVECTORFONT pFont; | /* font characteristics */
L_UINT32 dwFlags; | /* flags */

Sets the attributes of an object. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
pObject | Pointer to the vector object for which to set the attributes.
pnROP | Pointer to a variable that contains the ROP code to set. For more information on valid ROP2 codes, refer to your SDK..
pPen | Pointer to a VECTORPEN structure that contains the pen characteristics to set.
pBrush | Pointer to a VECTORBRUSH structure that contains the brush characteristics to set.
pFont | Pointer to a VECTORFONT structure that contains the font to set.
dwFlags | Flag that indicates which objects to process. Possible values are:
 | Value | Meaning
 | 0 | Set the attributes for all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Set the attributes of the selected objects only.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If pObject is NULL, the function uses the dwFlags parameter to determine the objects for which to set the new attributes.

If NULL is passed for pnROP, pPen, pBrush and/or pFont, then that attribute will not be set. For example, if NULL is passed for the pFont parameter, the pFont parameter will not be set for the specified object.

Certain parameters are ignored depending on pObject. For example, if pObject is VECTOR_LINE, then the pBrush and pFont parameters are ignored.

This function provides a simpler way of setting object information, without having to get the object descriptor, inspect the object type, set the new attributes and then free the descriptor.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetObjectAttributes, L_VecGetObject, L_VecSetObject, L_VecFreeObject
Topics: | Working with Vector Objects

Example

/* This example change all objects in a given vector handle to use RED pen */

void RedPen( pVECTORHANDLE pVector )
{
VECTORPEN Pen;

Pen.nSize = sizeof( Pen );
Pen.bExtPen = FALSE;
Pen.NewPen.LogPen.lopnColor = RGB( 255, 0, 0 );
Pen.NewPen.LogPen.lopnWidth.x = 1;
Pen.NewPen.LogPen.lopnWidth.y = 1;
Pen.NewPen.LogPen.lopnStyle = PS_SOLID;

L_VecSetObjectAttributes( pVector, NULL, NULL, &Pen, NULL, NULL, 0L );
}


L_VecSetObjectDescription

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetObjectDescription(pVector, pObject, pszTarget)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
L_TCHAR * pszTarget; | /* object description */

Sets the description for an object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object for which to set the description.
pszTarget | Character string that contains the object description. Pass NULL if there is no description.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetObjectDescription
Topics: | Modifying Vector Object Characteristics
 | Working with Vector Objects

Example

For an example, please refer to L_VecGetObjectDescription.


L_VecSetObjectTooltip

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetObjectTooltip(pVector, pObject, pszTooltip)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
L_TCHAR * pszTooltip; | /* object tool tip */

Sets the object’s tooltip.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object for which to set the tooltip. If the object already has a tool tip, it will be overwritten.
pszTooltip | Pointer to a NULL terminated string which contains the tool tip.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecShowObjectTooltip, L_VecHideObjectTooltip, L_VecGetObjectTooltip
Topics: | Tooltips
 | Working with Tooltips

Example

For an example please refer to L_VecGetObjectTooltip


L_VecSetObjectViewContext

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetObjectViewContext(pVector, pObject, pMin, pMax)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
pVECTOROBJECT pObject; | /* pointer to a structure */
const pVECTORPOINT pMin; | /* pointer to a structure */
const pVECTORPOINT pMax; | /* pointer to a structure */

Sets the view context space for an object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object for which to set the view context space.
pMin | Pointer to a VECTORPOINT structure that contains the minimum point of the view context space to set.
pMax | Pointer to a VECTORPOINT structure that contains the maximum point of the view context space to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

View context space is a vector space that is assigned to a specific object. Whenever that object is being viewed on the screen as a target object, this view context space will be used as the area that will be displayed instead of showing the object only. This is used mainly in setting the dimensions of an object that will be displayed by the toolkit when the same object is a target of a hyperlink.

To make sure that the view context is understood correctly an example will be needed:

After the end-user clicks on the hyperlink, which has the blue rectangle above as its target, the view is changed from the first figure to the second one, taking the view context space into consideration.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetObjectViewContext, L_VecRemoveObjectViewContext
Topics: | Modifying Vector Object Characteristics
 | Working with View Context

Example

For an example please refer to L_VecGetObjectViewContext


L_VecSetOrigin

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetOrigin(pVector, pOrigin)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORPOINT pOrigin; | /* pointer to a vector point */

Sets new origin for a vector handle.

Parameter | Description
pVector | Pointer to a vector handle.
pOrigin | Pointer to a VECTORPOINT structure that contains the new origin. If this parameter is NULL, the new origin will be calculated based on the objects currently in the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The origin of a vector drawing may change whenever new objects are added. To insure that the drawing is centered around its origin, call L_VecSetOrigin(pVector, NULL) after adding objects.

The origin may be retrieved using L_VecGetOrigin.

L_VecApplyTransformation must be called to make the new origin take effect; if you don’t your changes will not be saved.

Note for OpenGL and DirectX, this function has no effect.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetOrigin, L_VecApplyTransformationL_VecApplyTransformation
Topics: | Working with Vector Handles

Example

/* This example will recalculate the origin of a vector image */

void TestVecSetOrigin ( pVECTORHANDLE pVector )

{

/* re-calculate origin */

L_VecSetOrigin( pVector, NULL );

}


L_VecSetPalette

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetPalette(pVector, hPalette)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
HPALETTE hPalette; | /* handle to a palette */

Sets the palette handle associated with the specified vector.

Parameter | Description
pVector | Pointer to the vector handle.
hPalette | Handle to the new palette to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function makes a copy of hPalette, so you can delete the object if you don't need it anymore.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetPalette, L_VecPaint

Example

L_INT ChangePalette( pVECTORHANDLE pVector, COLORREF *pColors, L_UINT16 uClrCount )
{
L_INT nRet;
L_UINT16 i;
HPALETTE hPalette;
LPLOGPALETTE pLogPalette;

if( uClrCount > 0 )
{
pLogPalette = (LPLOGPALETTE) malloc( sizeof( LOGPALETTE ) + sizeof( PALETTEENTRY ) * ( uClrCount - 1 ) );
if( NULL == pLogPalette )
return ERROR_NO_MEMORY;

pLogPalette->palVersion = 0x300;
pLogPalette->palNumEntries = uClrCount;
for( i = 0 ; i < pLogPalette->palNumEntries ; i++ )
{
pLogPalette->palPalEntry[ i ].peRed = GetRValue( pColors[ i ] );
pLogPalette->palPalEntry[ i ].peGreen = GetGValue( pColors[ i ] );
pLogPalette->palPalEntry[ i ].peBlue = GetBValue( pColors[ i ] );
pLogPalette->palPalEntry[ i ].peFlags = 0;
}

hPalette = CreatePalette( pLogPalette );
free( pLogPalette );
if( NULL != hPalette )
{
nRet = L_VecSetPalette( pVector, hPalette );
DeleteObject( hPalette );
}
else
{
nRet = FAILURE;
}
}
else
{
nRet = L_VecSetPalette( pVector, NULL );
}
return nRet;
}

HPALETTE GetCurrentPalette( pVECTORHANDLE pVector )
{
return L_VecGetPalette( pVector );
}


L_VecSetPan

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetPan(pVector, pPan)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const POINT L_FAR * pPan; | /* pointer to a structure */

Sets the new pan values.

Parameter | Description
pVector | Pointer to a vector handle.
pPan | Pointer to a POINT structure that contains the new pan coordinates.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will set the physical pan values. These pan values are in pixels. This function can be used to scroll the VECTOR image.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetPan, L_VecSetViewport, L_VecGetViewport

Example

/* This example will sets the pan value of a vector to 10 pixels horizontal and 20 vertical */

void TestVecSetPan ( pVECTORHANDLE pVector )

{

POINT pan;

pan.x = 10;

pan.y = 20;

L_VecSetPan( pVector, &pan );

}


L_VecSetParallelogram

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetParallelogram(pVector, pMin, pMax)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORPOINT pMin; | /* pointer to a vector point */
const pVECTORPOINT pMax; | /* pointer to a vector point */

Sets the parallelogram of a vector handle drawing.

Parameter | Description
pVector | Pointer to a vector handle.
pMin | Pointer to the minimum parallelogram point. If pMin or pMax is NULL, the toolkit will calculate the values based on the minimum paralleogram needed to hold all the objects inside the vector drawing.
pMax | Pointer to the maximum parallelogram point. If pMin or pMax is NULL, the toolkit will calculate the values based on the minimum paralleogram needed to hold all the objects inside the vector drawing.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After adding objects to a vector handle, the logical size of the image might change, this function will calculate new boundaries of the drawing.

This function will have no effect in the OpenGL and DirectX engines.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecGetParallelogram, L_VecSetScale, L_VecSetRotation, L_VecSetTranslation
Topics: | Working with Vector Handles

Example

/* This example will re-calculate the externs of a vector drawing */

void TestVecSetParallelogram ( pVECTORHANDLE pVector )

{

L_VecSetParallelogram ( pVector, NULL, NULL );

}


L_VecSetPolygonMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetPolygonMode(pVector, nMode)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT nMode; | /* polygon drawing mode */

Sets the current polygon drawing mode.

Parameter | Description
pVector | Pointer to a vector handle.
nMode | The polygon drawing mode to set. Possible values are:
Value | Meaning
VECTOR_POLYGON_POINT | Draw only the edges points on polygons and lines.
VECTOR_POLYGON_LINE | Draw as a wire-frame.
VECTOR_POLYGON_FILL | Draw solid polygons.
VECTOR_POLYGON_FILL_RASTER_ALWAYS | Draw solid polygons and always draw raster objects.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is not supported in the DirectX engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetPolygonMode

Example

/* This example toggles the polygon mode between Point, Line and Fill */

void TogglePolygonMode( pVECTORHANDLE pVector )
{
L_INT nMode; /* Current polygon mode */

nMode = L_VecGetPolygonMode( pVector );

switch( nMode )
{
case VECTOR_POLYGON_POINT:
L_VecSetPolygonMode( pVector, VECTOR_POLYGON_LINE );
break;

case VECTOR_POLYGON_LINE :
L_VecSetPolygonMode( pVector, VECTOR_POLYGON_FILL );
break;

case VECTOR_POLYGON_FILL :
L_VecSetPolygonMode( pVector, VECTOR_POLYGON_FILL_RASTER_ALWAYS );
break;

case VECTOR_POLYGON_FILL_RASTER_ALWAYS :
L_VecSetPolygonMode( pVector, VECTOR_POLYGON_POINT );
break;
}
}


L_VecSetRotation

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetRotation(pVector, pRotation, pObject, pOrigin, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORPOINT pRotation; | /* pointer to a vector point */
pVECTOROBJECT pObject; | /* pointer to a vector object */
const pVECTORPOINT pOrigin; | /* pointer to a vector point */
L_UINT32 dwFlags; | /* flag that indicates which objects to rotate */

Rotates all or part of the specified vector image. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter | Description
pVector | Pointer to a vector handle.
pRotation | Pointer to a VECTORPOINT structure that contains the rotation values for each axis. The rotation values are in degrees.
pObject | Pointer to a VECTOROBJECT structure that references the object to rotate. If this parameter is not NULL, only the specified object will be rotated. If this parameter is NULL, the objects to rotate are determined by dwFlags.
pOrigin | Pointer to a VECTORPOINT structure that contains the center of rotation. If pOrigin is not NULL, rotation occurs around this point. If pOrigin is NULL, the center of rotation is the accumulative center of the objects to be rotated.
dwFlags | Flag that indicates which objects to rotate. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Rotate all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Rotate only the currently selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Rotates all or part of the specified vector image based on the rotation values in pRotation.

The translation values may be retrieved using L_VecGetRotation.

You should call L_VecApplyTransformation to make the rotation part of the vector image, if you don’t your changes will not be saved.

Note:

When you rotate a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind vertices mode set by L_VecSetBindVerticesMode.

Note for OpenGL and DirectX, you cannot select objects or enumerate them. If you provide pObject and/or VECTOR_FLAGS_SELECTED_ONLY, the function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetRotation, L_VecSetScale, L_VecGetScale, L_VecSetTranslation, L_VecGetTranslation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode, L_VecApplyTransformation

Example

/* This example will rotate all objects in a vector handle by 30 degrees along the x-axis, -20 degrees the y-axis and +50 degrees along the z-axis. */

void TestVecSetRotation ( pVECTORHANDLE pVector )

{

VECTORPOINT rotation;

/* Get current rotation values */

L_VecGetRotation ( pVector, &rotation );

/* +30 degrees along the x-axis */

rotation.x += 30.0;

/* -20 degrees along the y-axis */

rotation.y -= 20.0;

/* +50 degrees along the z-axis */

rotation.z += 50.0;

/* Set new rotation values. Note that we will rotate around the center of the drawing */

L_VecSetRotation( pVector, &rotation, NULL, NULL, 0L );

}


L_VecSetScale

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetScale(pVector, pScale, pObject, pOrigin, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORPOINT pScale; | /* pointer to a vector point */
pVECTOROBJECT pObject; | /* pointer to a vector object */
const pVECTORPOINT pOrigin; | /* pointer to a vector point */
L_UINT32 dwFlags; | /* flag that indicates which objects to scale */

Scales all or part of the specified vectored image.

Parameter | Description
pVector | Pointer to a vector handle.
pScale | Pointer to a VECTORPOINT structure that contains the scale values for each axis. The translation values are in logical units.
pObject | Pointer to a VECTOROBJECT structure that references the object to scale. If this parameter is not NULL, only the specified object will be scaled. If this parameter is NULL, the objects to scale are determined by dwFlags.
pOrigin | Pointer to a VECTORPOINT structure that contains the scale center. If pObject is not NULL, scaling occurs around this point. If pOrigin is NULL, the scale center is the accumulative center of the objects to be rotated.
dwFlags | Flag that indicates which objects to scale. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Scale all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Scale only the currently selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Scales all or part of the specified vector image based on the scale values in pScale.

pScale contains a scale value for each axis. A scale value of 1.0 represents a scale factor of 100%; a scale value of 0.5 represents a scale factor of 50%; a scale value of 2.0 represents a scale factor of 200%, etc.

The scale values may be retrieved using L_VecGetScale.

Note:

When you scale a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind-vertices mode set by L_VecSetBindVerticesMode.

You should call L_VecApplyTransformation to make the new scaling part of the vector image, if you don’t your changes will not be saved.

Note for OpenGL and DirectX, you cannot select object nor enumerate them. If you provide pObject and/or VECTOR_FLAGS_SELECTED_ONLY, the function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetScale, L_VecSetRotation, L_VecGetRotation, L_VecSetTranslation, L_VecGetTranslation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode, L_VecApplyTransformation

Example

/* This example will set the scale factor of all objects in a vector handle to 200% */

void TestVecSetScale ( pVECTORHANDLE pVector )

{

VECTORPOINT scale;

scale.x = 2.0F;

scale.y = 2.0F;

scale.z = 2.0F;

/* Set new scale values. Note that we will scale around the center of the drawing */

L_VecSetScale( pVector, &scale, NULL, NULL, 0L );

}


L_VecSetTranslation

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetTranslation(pVector, pTranslation, pObject, dwFlags)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const pVECTORPOINT pTranslation; | /* pointer to a vector point */
pVECTOROBJECT pObject; | /* pointer to a vector object */
L_UINT32 dwFlags; | /* flags that indicate which objects to translate */

Translates all or part of the specified vectored image.

Parameter | Description
pVector | Pointer to a vector handle.
pTranslation | Pointer to a VECTORPOINT structure that contains the translation values for each axis. The translation values are in logical units.
pObject | Pointer to a VECTOROBJECT structure that references the object to translate. If this parameter is not NULL, only the specified object will be translated. If this parameter is NULL, the objects to translate are determined by dwFlags.
dwFlags | Flag that indicates which objects to translate. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | 0 | Translate all objects.
 | VECTOR_FLAGS_SELECTED_ONLY | Translate only the currently selected objects within the vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Translates all or part of the specified vectored image based on the translation values in pTranslation.

The translation values may be retrieved using L_VecGetTranslation.

Note:

When you translate a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind-vertices mode set by L_VecSetBindVerticesMode.

You should call L_VecApplyTransformation to make the translation part of the vector image, if you don’t your changes will not be saved.

Note for OpenGL and DirectX:, You cannot select objects or enumerate them. If you provide pObject and/or VECTOR_FLAGS_SELECTED_ONLY, the function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetTranslation, L_VecSetScale, L_VecGetScale, L_VecSetRotation, L_VecGetRotation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode, L_VecApplyTransformation

Example

/* This example will translate all objects in a vector handle by 30 logical units along the x-axis, -20 along the y-axis and +50 along the z-axis. */

void TestVecSetTranslation ( pVECTORHANDLE pVector )

{

VECTORPOINT translation;

/* Get current translation values */

L_VecGetTranslation ( pVector, &translation );

/* +30 along the x-axis */

translation.x += 30.0;

/* -20 along the y-axis */

translation.y -= 20.0;

/* +50 along the z-axis */

translation.z += 50.0;

/* Set new translation values */

L_VecSetTranslation( pVector, &translation, NULL, 0L );

}


L_VecSetUseLights

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetUseLights(pVector, bUseLights)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_BOOL bUseLights; | /* flag that indicates whether to enable or disable the use of lights */

Enables or disables using lights when drawing a vector handle.

Parameter | Description
pVector | Pointer to a vector handle.
bUseLights | Flag that indicates whether or not to use lights when drawing the vector handle. Possible values are:
 | Value | Meaning
 | TRUE | Use lights when drawing a vector handle.
 | FALSE | Do not use lights when drawing a vector handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If the use of lights is disabled, ambient light will have no effect on how the image is drawn.

This function has no effect in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetUseLights, L_VecSetAmbientColor, L_VecGetAmbientColor

Example

/* This example will toggle light use for a vector handle */

void ToggleUseLights( pVECTORHANDLE pVector )
{
if( !L_VecGetUseLights( pVector ) )
L_VecSetUseLights( pVector, TRUE );
else
L_VecSetUseLights( pVector, FALSE );
}


L_VecSetViewMode

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetViewMode(pVector, nMode)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_INT nMode; | /* the view mode to set */

Sets the view mode.

Parameter | Description
pVector | Pointer to the vector handle.
nMode | The view mode to set. Possible values are:
 | Value | Meaning
 | VECTOR_VIEWMODE_FIT | Fit the drawing on the view-port, keeping the aspect ratio.
 | VECTOR_VIEWMODE_SNAP | Snap the drawing into the view-port.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will set the view mode used when drawing the vector handle.

The view mode is used with the view port to determine the resulting physical drawing extents.

Not supported in OpenGL and DirectX.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetViewMode, L_VecPaint

Example

/* This example toggles the view mode of a vector handle */

void ToggleViewMode( pVECTORHANDLE pVector )
{
if(L_VecGetViewMode( pVector ) == VECTOR_VIEWMODE_FIT)
L_VecSetViewMode( pVector, VECTOR_VIEWMODE_SNAP );
else
L_VecSetViewMode( pVector, VECTOR_VIEWMODE_FIT );
}


L_VecSetViewport

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecSetViewport(pVector, pViewport)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const RECT L_FAR * pViewport; | /* pointer to a structure */

Sets the current view port.

Parameter | Description
pVector | Pointer to a vector handle.
pViewport | Pointer to a RECT structure that contains data on the new view port.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to set the view port associated with a vector.

If pVector is attached to a window, you must call this function when processing WM_SIZE messages, since the VECTOR library needs to know when the window size has changed (DirectX), or when the double buffer mode is selected in the current VECTOR engine.

This function and L_VecSetCamera are required to complete the projection process from a vector image onto a 2D surface.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetViewport, L_VecSetPan, L_VecGetPan

Example

/* This example will use L_VecSetViewport to realize a vector drawing into the upper left corner of a BITMAPHANDLE */

void DrawOnUpperLeftCorner( pVECTORHANDLE pVector, pBITMAPHANDLE pBitmap )
{
RECT rect;

/* Setup the viewport rectangle */
rect.left = 0;
rect.top = 0;
rect.right = pBitmap->Width / 2;
rect.bottom = pBitmap->Height / 2;

/* Set the viewport */
L_VecSetViewport( pVector, &rect );

/* Realize */
L_VecRealize( pBitmap, pVector, FALSE );
}


L_VecShowObjectTooltip

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecShowObjectTooltip(pVector, pObject, pTooltipDesc)

pVECTORHANDLE pVector; | /* pointer to the vector handle */
const pVECTOROBJECT pObject; | /* pointer to a VECTOROBJECT structure */
pVECTORTOOLTIPDESC pTooltipDesc; | /* pointer to a VECTORTOOLTIPDESC structure */

Shows a tooltip for an object.

Parameter | Description
pVector | Pointer to the vector handle.
pObject | Pointer to a VECTOROBJECT structure that references the vector object for which to show the tooltip. If the object doesn’t have a tooltip, nothing is changed.
pTooltipDesc | Pointer to a VECTORTOOLTIPDESC structure which contains information about how the tooltip should look.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecSetObjectTooltip, L_VecHideObjectTooltip, L_VecGetObjectTooltip
Topics: | Tooltips
 | Working with Tooltips

Example

For an example please refer to L_VecGetObjectTooltip


L_VecZoomRect

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecZoomRect (pVector, pRect)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
const RECT L_FAR * pRect; | /* pointer to a RECT structure */

Sets the current zoom rectangle inside a vector handle.

Parameter | Description
pVector | Pointer to a vector handle.
pRect | Pointer to a RECT structure that contains data on the new zoom rectangle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to set the desired zoom rectangle inside the current view port associated with a vector handle.

Please note that you will have to update the window to see the results of this function.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetViewport, L_VecGetViewPort, L_VecSetPan, L_VecGetPan

Example

/* This example will use L_VecZoomRect to zoom to a desired area inside the vector handle */

void Zoom ( pVECTORHANDLE pVector, RECT *pRect )
{
L_VecZoomRect( pVector, pRect );
}


LVCOMMDLGHELPCB Function

#include "lvdlg.h"

L_VOID pEXT_CALLBACK LVCOMMDLGHELPCB (uDlgID, hElement, nCtlID, pUserData)

L_UINT32 uDlgID; | /* vector common dialog id */
HWND hElement; | /* window handle */
L_INT nCtlID; | /* id of the control */
L_VOID L_FAR pUserData; | /* pointer to additional parameters */

The callback function that will be called to provide the appropriate help information, based on the vector dialog from which help was requested.

Parameter | Description
uDlgID | Id of the vector common dialog which made the help request. Possible values are:
 | Constant | Meaning
 | LVDLG_HELP_ALLGROUPS | Help command message coming from L_VecDlgEditAllGroups.
 | LVDLG_HELP_ALLLAYERS | Help command message coming from L_VecDlgEditAllLayers.
 | LVDLG_HELP_GROUP | Help command message coming from L_VecDlgEditGroup.
 | LVDLG_HELP_LAYER | Help command message coming from L_VecDlgEditLayer.
 | LVDLG_HELP_HITTEST | Help command message coming from L_VecDlgHitTest.
 | LVDLG_HELP_RENDER | Help command message coming from L_VecDlgRender.
 | LVDLG_HELP_ROTATE | Help command message coming from L_VecDlgRotate.
 | LVDLG_HELP_SCALE | Help command message coming from L_VecDlgScale.
 | LVDLG_HELP_TRANSLATE | Help command message coming from L_VecDlgTranslate.
 | LVDLG_HELP_CAMERA | Help command message coming from L_VecDlgCamera.
 | LVDLG_HELP_VIEWMODE | Help command message coming from L_VecDlgViewMode.
 | LVDLG_HELP_GENERAL | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_PEN | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_BRUSH | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_VERTEX | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_LINE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_RECTANGLE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_CIRCLE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_ELLIPSE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_POLYLINE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_POLYGON | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_POLYDRAW | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_POLYBEZIER | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_ARC | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_ELLIPTICALARC | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_PIE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_TEXT | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_RASTER | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_CLONE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject.
 | LVDLG_HELP_SPLINE | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject
 | LVDLG_HELP_HPOLYBEZIER | Help command message coming from L_VecDlgEditObject or L_VecDlgNewObject
hElement | Window handle of the dialog control which is requesting help information. if the handle is NULL, this means that the control which is requesting help information is the help button of the dialog.
nCtlID | ID of the dialog control which is requesting help information, IDs can be one of the following (defined in lvdlgres.h):
 | Transform dialog
 | LVDLG_IDD_TRANSFORM
 | LVDLG_IDC_TRANSFORM_BUTTON_XUP
 | LVDLG_IDC_TRANSFORM_EDIT_X
 | LVDLG_IDC_TRANSFORM_BUTTON_XDOWN
 | LVDLG_IDC_TRANSFORM_BUTTON_YUP
 | LVDLG_IDC_TRANSFORM_EDIT_Y
 | LVDLG_IDC_TRANSFORM_BUTTON_YDOWN
 | LVDLG_IDC_TRANSFORM_BUTTON_ZUP
 | LVDLG_IDC_TRANSFORM_EDIT_Z
 | LVDLG_IDC_TRANSFORM_BUTTON_ZDOWN
 | LVDLG_IDC_TRANSFORM_CHECK_ALL
 | LVDLG_IDC_TRANSFORM_BUTTON_RESET
 | LVDLG_IDC_TRANSFORM_STATIC_PREVIEW
 | LVDLG_IDC_TRANSFORM_CHECK_PREVIEW
 | LVDLG_IDC_TRANSFORM_UPDATE
 | LVDLG_IDC_TRANSFORM_BUTTON_HELP
 | Render dialog
 | LVDLG_IDD_RENDER
 | LVDLG_IDC_RENDER_FRAME_LIGHTS
 | LVDLG_IDC_RENDER_CHECK_USELIGHTS
 | LVDLG_IDC_RENDER_BUTTON_AMBIENT
 | LVDLG_IDC_RENDER_FRAME_POLYGONMODE
 | LVDLG_IDC_RENDER_RADIO_POINT
 | LVDLG_IDC_RENDER_RADIO_LINE
 | LVDLG_IDC_RENDER_RADIO_FILL
 | LVDLG_IDC_RENDER_RADIO_FILL_RASTER_ALWAYS
 | LVDLG_IDC_RENDER_CHECK_PREVIEW
 | LVDLG_IDC_RENDER_STATIC_PREVIEW
 | LVDLG_IDC_RENDER_BUTTON_HELP
 | View mode dialog
 | LVDLG_IDD_VIEWMODE
 | LVDLG_IDC_VIEWMODE_FRAME_VIEWMODE
 | LVDLG_IDC_VIEWMODE_RADIO_FIT
 | LVDLG_IDC_VIEWMODE_RADIO_SNAP
 | LVDLG_IDC_VIEWMODE_CHECK_PREVIEW
 | LVDLG_IDC_VIEWMODE_STATIC_PREVIEW
 | LVDLG_IDC_VIEWMODE_BUTTON_HELP
 | Hit test dialog
 | LVDLG_IDD_HITTEST
 | LVDLG_IDC_HITTEST_FRAME_DISTANCE
 | LVDLG_IDC_HITTEST_EDIT_DISTANCE
 | LVDLG_IDC_HITTEST_SPIN_DISTANCE
 | LVDLG_IDC_HITTEST_FRAME_OPTIONS
 | LVDLG_IDC_HITTEST_CHECK_CLOSEDFIGURES
 | LVDLG_IDC_HITTEST_CHECK_IGNORESELECTED
 | LVDLG_IDC_HITTEST_BUTTON_HELP
 | All layers dialog
 | LVDLG_IDD_ALLLAYERS
 | LVDLG_IDC_ALLLAYERS_LIST_LAYERS
 | LVDLG_IDC_ALLLAYERS_BUTTON_NEW
 | LVDLG_IDC_ALLLAYERS_BUTTON_EDIT
 | LVDLG_IDC_ALLLAYERS_BUTTON_DELETE
 | LVDLG_IDC_ALLLAYERS_YES
 | LVDLG_IDC_ALLLAYERS_NO
 | LVDLG_IDC_ALLLAYERS_NAME
 | LVDLG_IDC_ALLLAYERS_ACTIVE
 | LVDLG_IDC_ALLLAYERS_VISIBLE
 | LVDLG_IDC_ALLLAYERS_LOCKED
 | LVDLG_IDC_ALLLAYERS_BUTTON_HELP
 | Layer dialog
 | LVDLG_IDD_LAYER
 | LVDLG_IDC_LAYER_FRAME_NAME
 | LVDLG_IDC_LAYER_EDIT_NAME
 | LVDLG_IDC_LAYER_CHECK_ACTIVE
 | LVDLG_IDC_LAYER_CHECK_VISIBLE
 | LVDLG_IDC_LAYER_CHECK_LOCKED
 | LVDLG_IDC_LAYER_BUTTON_HELP
 | All groups dialog
 | LVDLG_IDD_ALLGROUPS
 | LVDLG_IDC_ALLGROUPS_BUTTON_NEW
 | LVDLG_IDC_ALLGROUPS_LIST_GROUPS
 | LVDLG_IDC_ALLGROUPS_BUTTON_EDIT
 | LVDLG_IDC_ALLGROUPS_BUTTON_DELETE
 | LVDLG_IDC_ALLGROUPS_BUTTON_HELP
 | Group dialog
 | LVDLG_IDD_GROUP
 | LVDLG_IDC_GROUP_FRAME_NAME
 | LVDLG_IDC_GROUP_EDIT_NAME
 | LVDLG_IDC_GROUP_BUTTON_HELP
 | General dialog
 | LVDLG_IDD_GENERAL
 | LVDLG_IDC_GENERAL_FRAME_SELECTION
 | LVDLG_IDC_GENERAL_CHECK_SELECTION
 | LVDLG_IDC_GENERAL_FRAME_RASTEROPERATION
 | LVDLG_IDC_GENERAL_COMBO_ROP
 | LVDLG_IDC_GENERAL_FRAME_CLIPPING
 | Pen dialog
 | LVDLG_IDD_PEN
 | LVDLG_IDC_PEN_FRAME_STYLE
 | LVDLG_IDC_PEN_COMBO_STYLE
 | LVDLG_IDC_PEN_FRAME_WIDTH
 | LVDLG_IDC_PEN_EDIT_WIDTH
 | LVDLG_IDC_PEN_SPIN_WIDTH
 | LVDLG_IDC_PEN_FRAME_COLOR
 | LVDLG_IDC_PEN_BUTTON_COLOR
 | LVDLG_IDC_PEN_FRAME_ENDCAP
 | LVDLG_IDC_PEN_COMBO_ENDCAP
 | LVDLG_IDC_PEN_FRAME_JOIN
 | LVDLG_IDC_PEN_COMBO_JOIN
 | Brush dialog
 | LVDLG_IDD_BRUSHSTYLES
 | LVDLG_IDC_BRUSHSTYLES_FRAME_BRUSHSTYLE
 | LVDLG_IDC_BRUSHSTYLES_COMBO_STYLES
 | LVDLG_IDC_BRUSHSTYLES_FRAME_STYLES
 | Standard Brush dialog
 | LVDLG_IDD_STDBRUSH
 | LVDLG_IDC_STDBRUSH_FRAME_STDBRUSHPROP
 | LVDLG_IDC_STDBRUSH_FRAME_STYLE
 | LVDLG_IDC_STDBRUSH_COMBO_STYLE
 | LVDLG_IDC_STDBRUSH_FRAME_HATCH
 | LVDLG_IDC_STDBRUSH_COMBO_HATCH
 | LVDLG_IDC_STDBRUSH_FRAME_COLOR
 | LVDLG_IDC_STDBRUSH_STATIC_COLOR
 | LVDLG_IDC_STDBRUSH_BUTTON_COLOR
 | LVDLG_IDC_STDBRUSH_CHECK_ODDEVEN
 | Pattern Brush dialog
 | LVDLG_IDD_PTRBRUSH
 | LVDLG_IDC_PTRBRUSH_FRAME_PTRBRUSHPROP
 | LVDLG_IDC_PTRBRUSH_STATIC_BITMAP
 | LVDLG_IDC_PTRBRUSH_STATIC_PREVIEW
 | LVDLG_IDC_PTRBRUSH_BUTTON_BITMAP
 | Gradient Brush dialog
 | LVDLG_IDD_GRDBRUSH
 | LVDLG_IDC_GRDBRUSH_FRAME_GRDBRUSHPROP
 | LVDLG_IDC_GRDBRUSH_STATIC_STARTCOLOR
 | LVDLG_IDC_GRDBRUSH_STATIC_ENDCOLOR
 | LVDLG_IDC_GRDBRUSH_BUTTON_COLOR2
 | LVDLG_IDC_GRDBRUSH_BUTTON_COLOR1
 | LVDLG_IDC_GRDBRUSH_COMBO_STYLE
 | LVDLG_IDC_GRDBRUSH_STATIC_STYLE
 | LVDLG_IDC_GRDBRUSH_EDIT_STEPS
 | LVDLG_IDC_GRDBRUSH_SPIN_STEPS
 | LVDLG_IDC_GRDBRUSH_STATIC_STEPS
 | LVDLG_IDC_GRDBRUSH_COMBO_DIRECTION
 | LVDLG_IDC_GRDBRUSH_STATIC_DIRECTION
 | Hatch Brush dialog
 | LVDLG_IDD_HATBRUSH
 | LVDLG_IDC_HATBRUSH_COMBO_STYLE
 | LVDLG_IDC_HATBRUSH_EDIT_STEP
 | LVDLG_IDC_HATBRUSH_EDIT_ANGLE
 | LVDLG_IDC_HATBRUSH_SPIN_STEP
 | LVDLG_IDC_HATBRUSH_SPIN_ANGLE
 | LVDLG_IDC_HATBRUSH_FRAME_PENPROP
 | LVDLG_IDC_HATBRUSH_STATIC_STEP
 | LVDLG_IDC_HATBRUSH_STATIC_ANGLE
 | LVDLG_IDC_HATBRUSH_STATIC_STYLE
 | LVDLG_IDC_HATBRUSH_COMBO_PENSTYLE
 | LVDLG_IDC_HATBRUSH_BUTTON_PENCOLOR
 | LVDLG_IDC_HATBRUSH_STATIC_PENSTYLE
 | LVDLG_IDC_HATBRUSH_STATIC_HATCHPROP
 | LVDLG_IDC_HATBRUSH_COMBO_BRUSHSTYLE
 | LVDLG_IDC_HATBRUSH_STATIC_PENWIDTH
 | LVDLG_IDC_HATBRUSH_EDIT_PENWIDTH
 | LVDLG_IDC_HATBRUSH_SPIN_PENWIDTH
 | LVDLG_IDC_HATBRUSH_STATIC_PENCOLOR
 | LVDLG_IDC_HATBRUSH_FRAME_BRUSHPROP
 | LVDLG_IDC_HATBRUSH_STATIC_BRUSHSTYLE
 | LVDLG_IDC_HATBRUSH_STATIC_BRUSHCOLOR
 | LVDLG_IDC_HATBRUSH_BUTTON_BRUSHCOLOR
 | LVDLG_IDC_HATBRUSH_COMBO_BRUSHHATCH
 | LVDLG_IDC_HATBRUSH_STATIC_BRUSHHATCH
 | Vertex dialog
 | LVDLG_IDD_VERTEX
 | LVDLG_IDC_VERTEX_FRAME_LOCATION
 | LVDLG_IDC_VERTEX_EDIT_X
 | LVDLG_IDC_VERTEX_EDIT_Y
 | LVDLG_IDC_VERTEX_EDIT_Z
 | Line dialog
 | LVDLG_IDD_LINE
 | LVDLG_IDC_LINE_FRAME_STARTPOINT
 | LVDLG_IDC_LINE_EDIT_START_X
 | LVDLG_IDC_LINE_EDIT_START_Y
 | LVDLG_IDC_LINE_EDIT_START_Z
 | LVDLG_IDC_LINE_FRAME_ENDPOINT
 | LVDLG_IDC_LINE_EDIT_END_X
 | LVDLG_IDC_LINE_EDIT_END_Y
 | LVDLG_IDC_LINE_EDIT_END_Z
 | Rectangle dialog
 | LVDLG_IDD_RECTANGLE
 | LVDLG_IDC_RECTANGLE_FRAME_STARTPOINT
 | LVDLG_IDC_RECTANGLE_EDIT_START_X
 | LVDLG_IDC_RECTANGLE_EDIT_START_Y
 | LVDLG_IDC_RECTANGLE_EDIT_START_Z
 | LVDLG_IDC_RECTANGLE_FRAME_ENDPOINT
 | LVDLG_IDC_RECTANGLE_EDIT_END_X
 | LVDLG_IDC_RECTANGLE_EDIT_END_Y
 | LVDLG_IDC_RECTANGLE_EDIT_END_Z
 | Polyline dialog
 | LVDLG_IDD_POLYLINE
 | LVDLG_IDC_POLYLINE_FRAME_POINTS
 | LVDLG_IDC_POLYLINE_EDIT_X
 | LVDLG_IDC_POLYLINE_EDIT_Y
 | LVDLG_IDC_POLYLINE_EDIT_Z
 | LVDLG_IDC_POLYLINE_BUTTON_FIRST
 | LVDLG_IDC_POLYLINE_BUTTON_PREVIOUS
 | LVDLG_IDC_POLYLINE_BUTTON_NEXT
 | LVDLG_IDC_POLYLINE_BUTTON_LAST
 | LVDLG_IDC_POLYLINE_STATIC_POINT
 | LVDLG_IDC_POLYLINE_BUTTON_NEW
 | LVDLG_IDC_POLYLINE_BUTTON_DELETE
 | Polybezier dialog
 | LVDLG_IDD_POLYBEZIER
 | LVDLG_IDC_POLYBEZIER_FRAME_POINTS
 | LVDLG_IDC_POLYBEZIER_EDIT_X
 | LVDLG_IDC_POLYBEZIER_EDIT_Y
 | LVDLG_IDC_POLYBEZIER_EDIT_Z
 | LVDLG_IDC_POLYBEZIER_BUTTON_FIRST
 | LVDLG_IDC_POLYBEZIER_BUTTON_PREVIOUS
 | LVDLG_IDC_POLYBEZIER_BUTTON_NEXT
 | LVDLG_IDC_POLYBEZIER_BUTTON_LAST
 | LVDLG_IDC_POLYBEZIER_STATIC_POINT
 | LVDLG_IDC_POLYBEZIER_BUTTON_NEW
 | LVDLG_IDC_POLYBEZIER_BUTTON_DELETE
 | Polygon dialog
 | LVDLG_IDD_POLYGON
 | LVDLG_IDC_POLYGON_FRAME_POINTS
 | LVDLG_IDC_POLYGON_EDIT_X
 | LVDLG_IDC_POLYGON_EDIT_Y
 | LVDLG_IDC_POLYGON_EDIT_Z
 | LVDLG_IDC_POLYGON_BUTTON_FIRST
 | LVDLG_IDC_POLYGON_BUTTON_PREVIOUS
 | LVDLG_IDC_POLYGON_BUTTON_NEXT
 | LVDLG_IDC_POLYGON_BUTTON_LAST
 | LVDLG_IDC_POLYGON_BUTTON_NEW
 | LVDLG_IDC_POLYGON_BUTTON_DELETE
 | LVDLG_IDC_POLYGON_STATIC_POINT
 | LVDLG_IDC_POLYGON_FRAME_FILLMODE
 | LVDLG_IDC_POLYGON_RADIO_ALTERNATE
 | LVDLG_IDC_POLYGON_RADIO_WINDING
 | Ellipse dialog
 | LVDLG_IDD_ELLIPSE
 | LVDLG_IDC_ELLIPSE_FRAME_CENTER
 | LVDLG_IDC_ELLIPSE_EDIT_X
 | LVDLG_IDC_ELLIPSE_EDIT_Y
 | LVDLG_IDC_ELLIPSE_EDIT_Z
 | LVDLG_IDC_ELLIPSE_FRAME_RADIUS
 | LVDLG_IDC_ELLIPSE_EDIT_RADIUSX
 | LVDLG_IDC_ELLIPSE_EDIT_RADIUSY
 | Circle dialog
 | LVDLG_IDD_CIRCLE
 | LVDLG_IDC_CIRCLE_FRAME_CENTER
 | LVDLG_IDC_CIRCLE_EDIT_X
 | LVDLG_IDC_CIRCLE_EDIT_Y
 | LVDLG_IDC_CIRCLE_EDIT_Z
 | LVDLG_IDC_CIRCLE_FRAME_RADIUS
 | LVDLG_IDC_CIRCLE_EDIT_RADIUS
 | Arc dialog
 | LVDLG_IDD_ARC
 | LVDLG_IDC_ARC_FRAME_CENTER
 | LVDLG_IDC_ARC_EDIT_X
 | LVDLG_IDC_ARC_EDIT_Y
 | LVDLG_IDC_ARC_EDIT_Z
 | LVDLG_IDC_ARC_FRAME_RADIUS
 | LVDLG_IDC_ARC_EDIT_RADIUS
 | LVDLG_IDC_ARC_FRAME_ANGLES
 | LVDLG_IDC_ARC_EDIT_START
 | LVDLG_IDC_ARC_STATIC_START
 | LVDLG_IDC_ARC_EDIT_SWEEP
 | LVDLG_IDC_ARC_STATIC_SWEEP
 | Text dialog
 | LVDLG_IDD_TEXT
 | LVDLG_IDC_TEXT_FRAME_POINT
 | LVDLG_IDC_TEXT_EDIT_X
 | LVDLG_IDC_TEXT_EDIT_Y
 | LVDLG_IDC_TEXT_EDIT_Z
 | LVDLG_IDC_TEXT_FRAME_HORIZONTAL
 | LVDLG_IDC_TEXT_FRAME_VERTICAL
 | LVDLG_IDC_TEXT_COMBO_HORIZONTAL
 | LVDLG_IDC_TEXT_COMBO_VERTICAL
 | LVDLG_IDC_TEXT_CHECK_HITTESTRECTANGLE
 | LVDLG_IDC_TEXT_FRAME_TEXT
 | LVDLG_IDC_TEXT_EDIT_TEXT
 | LVDLG_IDC_TEXT_FRAME_FONT
 | LVDLG_IDC_TEXT_BUTTON_FONT
 | LVDLG_IDC_TEXT_EDIT_CHARHEIGHT
 | LVDLG_IDC_TEXT_EDIT_CHARWIDTH
 | LVDLG_IDC_TEXT_STATIC_CHARWIDTH
 | LVDLG_IDC_TEXT_STATIC_CHARHEIGHT
 | LVDLG_IDC_TEXT_CHECK_FORCELINECURVE
 | Pie dialog
 | LVDLG_IDD_PIE
 | LVDLG_IDC_PIE_FRAME_CENTER
 | LVDLG_IDC_PIE_EDIT_X
 | LVDLG_IDC_PIE_EDIT_Y
 | LVDLG_IDC_PIE_EDIT_Z
 | LVDLG_IDC_PIE_FRAME_RADIUS
 | LVDLG_IDC_PIE_EDIT_RADIUS
 | LVDLG_IDC_PIE_FRAME_ANGLES
 | LVDLG_IDC_PIE_STATIC_START
 | LVDLG_IDC_PIE_EDIT_START
 | LVDLG_IDC_PIE_STATIC_SWEEP
 | LVDLG_IDC_PIE_EDIT_SWEEP
 | Polydraw dialog
 | LVDLG_IDD_POLYDRAW
 | LVDLG_IDC_POLYDRAW_FRAME_POINTS
 | LVDLG_IDC_POLYDRAW_EDIT_X
 | LVDLG_IDC_POLYDRAW_EDIT_Y
 | LVDLG_IDC_POLYDRAW_EDIT_Z
 | LVDLG_IDC_POLYDRAW_BUTTON_FIRST
 | LVDLG_IDC_POLYDRAW_BUTTON_PREVIOUS
 | LVDLG_IDC_POLYDRAW_BUTTON_NEXT
 | LVDLG_IDC_POLYDRAW_BUTTON_LAST
 | LVDLG_IDC_POLYDRAW_STATIC_POINT
 | LVDLG_IDC_POLYDRAW_BUTTON_NEW
 | LVDLG_IDC_POLYDRAW_BUTTON_DELETE
 | LVDLG_IDC_POLYDRAW_FRAME_TYPE
 | LVDLG_IDC_POLYDRAW_CHECK_CLOSEFIGURE
 | LVDLG_IDC_POLYDRAW_COMBO_TYPE
 | Raster dialog
 | LVDLG_IDD_RASTER
 | LVDLG_IDC_RASTER_FRAME_POINT1
 | LVDLG_IDC_RASTER_EDIT_POINT1_X
 | LVDLG_IDC_RASTER_EDIT_POINT1_Y
 | LVDLG_IDC_RASTER_EDIT_POINT1_Z
 | LVDLG_IDC_RASTER_FRAME_POINT2
 | LVDLG_IDC_RASTER_EDIT_POINT2_X
 | LVDLG_IDC_RASTER_EDIT_POINT2_Y
 | LVDLG_IDC_RASTER_EDIT_POINT2_Z
 | LVDLG_IDC_RASTER_FRAME_BITMAP
 | LVDLG_IDC_RASTER_STATIC_PREVIEW
 | LVDLG_IDC_RASTER_BUTTON_BITMAP
 | Clone dialog
 | LVDLG_IDD_CLONE
 | LVDLG_IDC_CLONE_FRAME_POINT
 | LVDLG_IDC_CLONE_EDIT_X
 | LVDLG_IDC_CLONE_EDIT_Y
 | LVDLG_IDC_CLONE_EDIT_Z
 | LVDLG_IDC_CLONE_FRAME_SCALE
 | LVDLG_IDC_CLONE_EDIT_SCALEX
 | LVDLG_IDC_CLONE_EDIT_SCALEY
 | LVDLG_IDC_CLONE_EDIT_SCALEZ
 | LVDLG_IDC_CLONE_FRAME_ROTATION
 | LVDLG_IDC_CLONE_EDIT_ROTATIONX
 | LVDLG_IDC_CLONE_EDIT_ROTATIONY
 | LVDLG_IDC_CLONE_EDIT_ROTATIONZ
 | LVDLG_IDC_CLONE_FRAME_ATTRIBUTES
 | LVDLG_IDC_CLONE_CHECK_USEPEN
 | LVDLG_IDC_CLONE_CHECK_USEBRUSH
 | LVDLG_IDC_CLONE_CHECK_USEPOINTASORIGIN
 | LVDLG_IDC_CLONE_FRAME_GROUP
 | LVDLG_IDC_CLONE_LIST_GROUP
 | Elliptical arc dialog
 | LVDLG_IDD_ELLIPTICALARC
 | LVDLG_IDC_ELLIPTICALARC_FRAME_CENTER
 | LVDLG_IDC_ELLIPTICALARC_EDIT_X
 | LVDLG_IDC_ELLIPTICALARC_EDIT_Y
 | LVDLG_IDC_ELLIPTICALARC_EDIT_Z
 | LVDLG_IDC_ELLIPTICALARC_FRAME_ANGLES
 | LVDLG_IDC_ELLIPTICALARC_STATIC_START
 | LVDLG_IDC_ELLIPTICALARC_EDIT_START
 | LVDLG_IDC_ELLIPTICALARC_STATIC_SWEEP
 | LVDLG_IDC_ELLIPTICALARC_EDIT_SWEEP
 | LVDLG_IDC_ELLIPTICALARC_FRAME_RADIUS
 | LVDLG_IDC_ELLIPTICALARC_EDIT_RADIUSX
 | LVDLG_IDC_ELLIPTICALARC_EDIT_RADIUSY
 | Spline dialog
 | LVDLG_IDD_SPLINE
 | LVDLG_IDC_SPLINE_FRAME_POINTS
 | LVDLG_IDC_SPLINE_EDIT_X
 | LVDLG_IDC_SPLINE_EDIT_Y
 | LVDLG_IDC_SPLINE_EDIT_Z
 | LVDLG_IDC_SPLINE_BUTTON_FIRST
 | LVDLG_IDC_SPLINE_BUTTON_PREVIOUS
 | LVDLG_IDC_SPLINE_BUTTON_NEXT
 | LVDLG_IDC_SPLINE_BUTTON_LAST
 | LVDLG_IDC_SPLINE_BUTTON_NEW
 | LVDLG_IDC_SPLINE_BUTTON_DELETE
 | LVDLG_IDC_SPLINE_STATIC_POINT
 | LVDLG_IDC_SPLINE_FRAME_SPLINEPOINTSTYPE
 | LVDLG_IDC_SPLINE_RADIO_FITPOINTS
 | LVDLG_IDC_SPLINE_RADIO_CONTROLPOINTS
 | Heterogeneous Poly Bezier dialog
 | LVDLG_IDD_HPOLYBEZIER
 | LVDLG_IDC_HPOLYBEZIER_FRAME_SECTIONS
 | LVDLG_IDC_HPOLYBEZIER_EDIT_SECTIONNUMBER
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_FIRSTSEC
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_PREVIOUSSEC
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_NEXTSEC
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_LASTSEC
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_NEWSEC
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_DELETESEC
 | LVDLG_IDC_HPOLYBEZIER_STATIC_POINTSEC
 | LVDLG_IDC_HPOLYBEZIER_FRAME_POINTS
 | LVDLG_IDC_HPOLYBEZIER_EDIT_DEGREE
 | LVDLG_IDC_HPOLYBEZIER_EDIT_X
 | LVDLG_IDC_HPOLYBEZIER_EDIT_Y
 | LVDLG_IDC_HPOLYBEZIER_EDIT_Z
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_FIRST
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_PREVIOUS
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_NEXT
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_LAST
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_NEW
 | LVDLG_IDC_HPOLYBEZIER_BUTTON_DELETE
 | LVDLG_IDC_HPOLYBEZIER_STATIC_POINT
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

None.

Comments

This callback function is optional. It is necessary only if you wish to provide help information for individual dialogs. The exact nature of the help provided is up to you, but must be outlined in this callback function. In order to implement help for a dialog box, a pointer to this HelpCallback Function must be passed to the specific dialog function. By passing this pointer, a Help button is shown in the dialog.

Required DLLs and Libraries

LVDLG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecDlgCamera, L_VecDlgEditAllGroups, L_VecDlgEditAllLayers, L_VecDlgEditGroup, L_VecDlgEditLayer, L_VecDlgGetString, L_VecDlgGetStringLen, L_VecDlgHitTest, L_VecDlgNewGroup, L_VecDlgNewLayer, L_VecDlgNewObject, L_VecDlgRender, L_VecDlgRotate, L_VecDlgScale, L_VecDlgSetFont, L_VecDlgSetString, L_VecDlgTranslate, L_VecDlgViewMode

Example

void g_hWndFrame;

L_VOID EXT_CALLBACK
VectorHelpCallback
(
L_UINT32 uDlgID,
HWND hElement,
L_INT nCtlID,
L_VOID *pUserData
)
{
L_TCHAR szBuffer[ 255 ] = TEXT("No information");
L_TCHAR szTitle[ 255 ] = TEXT("");

UNREFERENCED_PARAMETER( hElement );
UNREFERENCED_PARAMETER( pUserData );

switch( uDlgID )
{
case LVDLG_HELP_SCALE: /* Scale Dialog */
lstrcpy( szTitle, TEXT("Scale"));
switch( nCtlID )
{
case LVDLG_IDC_TRANSFORM_BUTTON_XUP:
lstrcpy( szBuffer, TEXT("Button X Up"));
break;

case LVDLG_IDC_TRANSFORM_EDIT_X:
lstrcpy( szBuffer, TEXT("Edit X"));
break;

case LVDLG_IDC_TRANSFORM_BUTTON_XDOWN:
lstrcpy( szBuffer, TEXT("Button X Down"));
break;

case LVDLG_IDC_TRANSFORM_BUTTON_YUP:
lstrcpy( szBuffer, TEXT("Button Y Up"));
break;

case LVDLG_IDC_TRANSFORM_EDIT_Y:
lstrcpy( szBuffer, TEXT("Edit Y"));
break;
}
break;
}

MessageBox( g_hWndFrame, szBuffer, szTitle, MB_OK | MB_ICONINFORMATION );
}

void RunRotateDialog( HWND hWnd, pVECTORHANDLE pVector )
{
VECTORPOINT Point;

L_VecGetRotation (pVector, &Point);
L_VecDlgRotate ( hWnd,
pVector,
&Point,
NULL,
VECTOR_DLG_AUTO_PROCESS | VECTOR_DLG_SHOW_PREVIEW,
VectorHelpCallback,
NULL );
}


VECTORENUMGROUPSPROC Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction(pVector, pGroup, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORGROUP pGroup; | /* pointer to a vector group */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Processes each vector group enumerated by the L_VecEnumGroups function.

Parameter | Description
pVector | Pointer to the vector handle that contains the groups to enumerate.
pGroup | Pointer to the vector group being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumGroups function calls the callback function as it gets the handle of each vector group.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_VecEnumGroups
Topics: | Working with Vector Groups

Example

For an example, refer to L_VecEnumGroups .


VECTORENUMLAYERSPROC Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction(pVector, pLayer, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORLAYER pLayer; | /* pointer to a vector layer */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Processes each vector layer enumerated by the L_VecEnumLayers function.

Parameter | Description
pVector | Pointer to the vector handle that contains the layers to enumerate.
pLayer | Pointer to the vector layer being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumLayers function calls the callback function as it gets the handle of each vector layer.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecEnumLayers

Example

For an example, refer to L_VecEnumLayers .


VECTORENUMOBJECTSPROC Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction (pVector, pObject, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTOROBJECT pObject; | /* pointer to a vector Object */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Processes each vector object enumerated by the L_VecEnumObjects or L_VecEnumObjectsInLayer functions.

Parameter | Description
pVector | Pointer to the vector image containing the objects to enumerate.
PObject | Pointer to the vector object being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumObjects function or the L_VecEnumObjectsInLayer function calls your callback function as it gets the handle of each vector object.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecEnumObjects, L_VecEnumObjectsInLayer

Example

For an example, refer to L_VecEnumObjects.


VECTORENUMVERTICESPROC Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction (pVector, pPoint, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
pVECTORPOINT pPoint; | /* pointer to a vector point */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Processes each point enumerated by the L_VecEnumVertices function.

Parameter | Description
pVector | Pointer to the vector image containing the points to enumerate.
pPoint | Pointer to the vector point being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_VecEnumVertices function calls your callback function as it gets the handle of each vector point.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecEnumVertices

Example

For an example, refer to L_VecEnumVertices.


VECTOREVENTPROC Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction (pVector, uLevel, pEvent, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
L_UINT uLevel; | /* event level */
pVECTOREVENT pEvent; | /* pointer to a vector event */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Processes each event that occurs inside the vector handle.

Parameter | Description
pVector | Pointer to the vector handle in which the event occurred.
uLevel | Level of the event that occurred. For a top-level event, this value is 0. For a second level event this value is 1, etc. For an example, refer to the Comments section below.
pEvent | Pointer to a VECTOREVENT structure that describes the event that occurred in the vector handle.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you passed in L_VecSetEventCallback.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

The return value is valid only when pEvent->Status is EVENT_STATUS_BEFORE.

SUCCESS | Continue with the operation.
SUCCESS_ABORT | Abort this operation only.
< 1 | An error occurred. Refer to Return Codes.

Comments

To understand event levels, consider this example:

Assume the clipboard contains a vector handle with 1 layer and 2 objects inside this layer.

Now you execute L_VecCopyFromClipboard, the toolkit may fire these events in the following sequence:

pEvent->uType | pEvent->Status | uLevel | Comment
VECTOR_EVENT_COPYFROMCLIPBOARD | VECTOR_EVENT_BEFORE | 0 | L_VecCopyFromClipboard is about to execute.
VECTOR_EVENT_ADDLAYER | VECTOR_EVENT_BEFORE | 1 | L_VecAddLayer is about to execute.
VECTOR_EVENT_ADDOBJECT | VECTOR_EVENT_BEFORE | 2 | L_VecAddObject for first object is about to execute.
VECTOR_EVENT_ADDOBJECT | VECTOR_EVENT_AFTER | 2 | L_VecAddObject for first object has been completed.
VECTOR_EVENT_ADDOBJECT | VECTOR_EVENT_BEFORE | 2 | L_VecAddObject for second object is about to execute.
VECTOR_EVENT_ADDOBJECT | VECTOR_EVENT_AFTER | 2 | L_VecAddObject for second object has been completed.
VECTOR_EVENT_ADDLAYER | VECTOR_EVENT_AFTER | 1 | L_VecAddLayer has been completed.
VECTOR_EVENT_COPYFROMCLIPBOARD | VECTOR_EVENT_AFTER | 0 | L_VecCoptFromClipboard has been completed.

Your callback can monitor all these operations and cancel whatever operation you want.

Returning SUCCESS_ABORT will abort a single operation. For example, to delete objects and not the layers of a vector when L_VecEmpty is called, the callback can be written like this:

L_INT VectorEventCallback( pVECTOREVENT pEvent )
{
switch( pEvent->uType )
{
case VECTOR_EVENT_DELETEOBJECT:
if( pEvent->Status == VECTOR_EVENT_STATUS_BEFORE ) // a chance to cancel
{
return SUCCESS_ABORT; // cancel this operation only, continue with the rest
}
break;

default:
break;
}

return SUCCESS;
}

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetEventCallback, L_VecEvent

Example

For an example, refer to L_VecSetEventCallback.


VECTORFONTMAPPERCALLBACK Function

#include "lvkrn.h"

L_INT pEXT_CALLBACK YourFunction (pVector, pFont, pUserData)

pVECTORHANDLE pVector; | /* pointer to a vector handle */
LPLOGFONT; | /* pointer to LOGFONT structure */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Processes each new font that is added to the resource list of the vector drawing.

Parameter | Description
pVector | Pointer to the vector handle to which the font is being added.
pFont | Pointer to a LOGFONT structure. The user can modify the contents of this structure to control the attributes of the font before adding/using it in the drawing.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Thte L_VecSetFontMapper function calls your callback function for every font being added to the vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetFontMapper, L_VecGetFontMapper

Example

L_INT WINAPI myFontMapper1( pVECTORHANDLE pVector, LPLOGFONT pLogFont, L_VOID* pUserData )
{
UNREFERENCED_PARAMETER( pVector );
UNREFERENCED_PARAMETER( pLogFont );
UNREFERENCED_PARAMETER( pUserData );

/* pUserData points to "Arial" .. copy it to pLogFont->lfFaceName to force the toolkit
to render all fonts as Arial */
lstrcpy( pLogFont->lfFaceName, (L_TCHAR *)pUserData );

return SUCCESS;
}

void myfunc(pVECTORHANDLE pVector )
{
L_VecSetFontMapper( pVector, myFontMapper1, TEXT("Arial"));
}


Tutorials

Creating an Empty Vector Handle and Attaching it to a Window

Vector Load and Save

Transformation

Using the Camera

Using Vector Engines

Implementing Hit Testing

Working with Layers

Adding and Displaying Vector Objects


Creating an Empty Vector Handle and Attaching it to a Window

Take the following steps to start a project and to add some code that creates a new empty vector handle, and attaches it to a window.

Note:

This example is for a 32-bit (NT or Windows 9x) environment.

1. | Start Visual C++, version 4.2.
2. | Select the File->New menu option, and in the dialog box, select Project Workspace.
3. | In the New Project Workspace dialog box, enter the directory (c:\lead\examples\vector\tutorial), make sure to select Application (Win32 Application) as the project type,. Give the project the name "tutorial" and press Enter.
4. | Select the File->New menu option, and in the dialog box, select Text File and press Enter.
5. | Copy and paste the following code into the text file you have just created:

#include <windows.h>
#include "c:\lead14\dll\include\l_bitmap.h"
#include "c:\lead14\dll\include\lvkrn.h"

static L_VOID ResetView( HWND hWnd, pVECTORHANDLE pVector )
{
// let the vector toolkit calculates the extent of the current drawing.
L_VecSetParallelogram ( pVector, NULL, NULL );

// let the vector toolkits calculates the origin of current drawing.
L_VecSetOrigin ( pVector, NULL );

// let the vector toolkits calculates the default camera position (top-view)
L_VecSetCamera ( pVector, NULL );

// cause a redraw of our main window
InvalidateRect( hWnd, NULL, FALSE );
}

static LRESULT WINAPI WndProc( HWND hWnd, L_UINT uMessage, WPARAM wParam, LPARAM lParam )
{
static VECTORHANDLE Vector; // our vector handle
RECT Rect;
PAINTSTRUCT PaintStruct;
HDC hDC;

switch( uMessage )
{
case WM_CREATE:
// initiates the vector handle
L_VecInit ( &Vector );

// set wireframe mode
L_VecSetPolygonMode ( &Vector, VECTOR_POLYGON_LINE );

// attach it to the main window
L_VecAttachToWindow ( hWnd, &Vector, VECTOR_ENGINE_GDI, VECTOR_ENGINE_DOUBLEBUFFER );

// set default view
ResetView( hWnd, &Vector );
return 0L;

case WM_SIZE:
// set the vector viewport to all client area
GetClientRect( hWnd, &Rect );
L_VecSetViewport ( &Vector, &Rect );
return 0L;

case WM_PAINT:
// draw the vector
hDC = BeginPaint( hWnd, &PaintStruct );
L_VecPaint ( hDC, &Vector, TRUE );
EndPaint( hWnd, &PaintStruct );
return 0L;

case WM_DESTROY:
// free the vector handle
L_VecFree ( &Vector );
PostQuitMessage( 0 );
return 0L;

default:
break;
}

return DefWindowProc( hWnd, uMessage, wParam, lParam );
}

L_INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE hInstPrev, LPTSTR pCmdLine, L_INT nCmdShow )
{
const L_TCHAR szClassName[] = TEXT("lead_vector_tutorial");
WNDCLASSEX WndClass;
HWND hWnd;
MSG Msg;

UNREFERENCED_PARAMETER( hInstPrev );
UNREFERENCED_PARAMETER( pCmdLine );

// unlock vector support
L_UnlockSupport ( L_SUPPORT_VECTOR, L_KEY_VECTOR );

WndClass.cbSize = sizeof( WNDCLASSEX );
WndClass.style = CS_HREDRAW | CS_VREDRAW;
WndClass.lpfnWndProc = WndProc;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = hInst;
WndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
WndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
WndClass.hbrBackground = NULL;
WndClass.lpszMenuName = NULL;
WndClass.lpszClassName = szClassName;
WndClass.hIconSm = NULL;

RegisterClassEx( &WndClass );

hWnd = CreateWindowEx( 0L, szClassName, TEXT("Vector Tutorial"), WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
NULL, NULL, hInst, NULL );

ShowWindow( hWnd, nCmdShow );
UpdateWindow( hWnd );

while( GetMessage( &Msg, NULL, 0, 0 ) != 0 )
{
TranslateMessage( &Msg );
DispatchMessage( &Msg );
}

UnregisterClass( szClassName, hInst );

return Msg.wParam;
}

6. | Select File->Save from the menu and give the text file the name "vectut.c"
7. | Select Insert->Files into Project from the menu . In the dialog box that appears, browse to the vectut.c file you have just created, select it and click Add.
8. | Select Insert->Files into Project from the menu In the dialog box that appears, browse to c:\lead\lib\ltkrn_n.lib, select it and click Add.
9. | Select Insert->Files into Project from the menu . In the dialog box that appears, browse to c:\lead\lib\lvkrn_n.lib, select it and click Add.
10. | Compile and run the project by selecting Build->Execute vectut.exe from the menu.
11. | The program should display a white background drawn by the vector handle.


Vector Load and Save

Start with the project you created in Creating an Empty Vector Handle and Attaching it to a Window.

Take the following steps to add vector load and save functionality:

1. | Select File->New menu option, and in the dialog box, select Resource Script and press Enter.
2. | Right click the script you just created. Select Insert and then Menu from the dialog box that appears and click OK.
3. | Create this Menu structure:

IDR_MENU1

&File
&Open… with ID = IDM_FILE_OPEN
&Save… with ID = IDM_FILE_SAVE
E&xit with ID = IDM_FILE_EXIT

4. | Select File->Save from the menu. Enter Tutorial.rc in the Save As box and click Save.
5. | Select Insert->Files into Project. Browse to the Tutorial.rc file that was just created and click Add.
6. | Add the following line right under #include "c:\lead\include\lvkrn.h":

#include "resource.h"

7.

Change the line:

WndClass.lpszMenuName = NULL;

in the WinMain function to

WndClass.lpszMenuName = MAKEINTRESOURCE( IDR_MENU1 );

8.

Add these local variables under HDC hDC; in the WndProc function:

static OPENFILENAME OpenFileName;
static L_TCHAR szFileName[ _MAX_PATH ];
static L_TCHAR szFileTitle[ _MAX_PATH ];
static L_TCHAR *szFilter[] = { TEXT("All Files\0*.*\0") };
L_INT nRet;

9.

Add these lines right after ResetView( hWnd, &Vector ); in WM_CREATE handle:

// reset the OPENFILENAME structure
memset( &OpenFileName, 0, sizeof( OPENFILENAME ) );
OpenFileName.lStructSize = sizeof( OPENFILENAME );
OpenFileName.hwndOwner = hWnd;
OpenFileName.lpstrFilter = szFilter[ 0 ];
OpenFileName.lpstrFile = szFileName;
OpenFileName.nMaxFile = _MAX_PATH;
OpenFileName.lpstrFileTitle = szFileTitle;
OpenFileName.nMaxFileTitle = _MAX_PATH;

10.

Add these lines after the return 0L; statement of case WM_PAINT:

case WM_COMMAND:
switch( LOWORD( wParam ) )
{
case IDM_FILE_OPEN:
OpenFileName.Flags = OFN_HIDEREADONLY;
if( GetOpenFileName( &OpenFileName ) )
{
// open the vector file
nRet = L_VecLoadFile ( szFileName, &Vector, NULL, NULL );
if( nRet != SUCCESS )
MessageBox( hWnd, TEXT("Cannot open file!"), TEXT("Error"), MB_ICONEXCLAMATION );

GetClientRect( hWnd, &Rect );
L_VecSetViewport ( &Vector, &Rect );

ResetView( hWnd, &Vector );
}
return 0L;

case IDM_FILE_SAVE:
OpenFileName.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
if( GetSaveFileName( &OpenFileName ) )
{
// save the vector file
nRet = L_VecSaveFile ( szFileName, &Vector, FILE_DXF, NULL );
if( nRet != SUCCESS )
MessageBox( hWnd, TEXT("Cannot save file!"), TEXT("Error"), MB_ICONEXCLAMATION );
}
return 0L;

case IDM_FILE_EXIT:
PostMessage( hWnd, WM_CLOSE, 0L, 0L );

return 0L;
}
break;

11. | Select Insert->Files into Project from the menu. In the dialog box that appears, browse to c:\lead\lib\ltfil_n.lib, select it and click Add.
12. | Compile and run the project. You will be able to view, load and save vector files as you browse your local hard disk.


Transformation

Start with the project you created in Vector Load and Save.

Take the following steps to add scale, rotation and translation to the sample program:

1.

Add this local variable under L_INT nRet; in the WndProc function:

VECTORPOINT Point;

2.

Add these lines right after the return 0L; of case WM_PAINT:

case WM_CHAR:
switch( wParam )
{
case 'x':
case 'X':
case 'y':
case 'Y':
case 'z':
case 'Z':
// get current rotation value
L_VecGetRotation ( &Vector, &Point );
Point.x += ( wParam == 'x' || wParam == 'X' ) ? 5.0 : 0;
Point.y += ( wParam == 'y' || wParam == 'Y' ) ? 5.0 : 0;
Point.z += ( wParam == 'z' || wParam == 'Z' ) ? 5.0 : 0;
// set new rotation value
L_VecSetRotation ( &Vector, &Point, NULL, NULL, 0 );
InvalidateRect( hWnd, NULL, FALSE );
break;

case '+':
case '-':
// get current scale value
L_VecGetScale ( &Vector, &Point );
Point.x += ( wParam == '+' ) ? 0.1 : -0.1;
Point.y += ( wParam == '+' ) ? 0.1 : -0.1;
Point.z += ( wParam == '+' ) ? 0.1 : -0.1;
// set new scale value
L_VecSetScale ( &Vector, &Point, NULL, NULL, 0 );
InvalidateRect( hWnd, NULL, FALSE );
break;
}
return 0L;

case WM_KEYDOWN:
switch( wParam )
{
case VK_UP:
case VK_DOWN:
case VK_LEFT:
case VK_RIGHT:
// get current translation
L_VecGetTranslation ( &Vector, &Point );
if( wParam == VK_LEFT ) Point.x -= 1.0;
if( wParam == VK_RIGHT ) Point.x += 1.0;
if( wParam == VK_UP ) Point.y += 1.0;
if( wParam == VK_DOWN ) Point.y -= 1.0;
// set new translation value
L_VecSetTranslation ( &Vector, &Point, NULL, 0 );
InvalidateRect( hWnd, NULL, FALSE );
break;
}
return 0L;

3. | Compile and run the demo.
4. | Select File/Open… from the program menu. Browse to c:\lead\images\random.dxf and click OK.
5. | Now you should be able to rotate the vector drawing around any axis using the x, y and z keys on your keyboard and scale up and down using the + and – keys.


Using the Camera

Start with the project you created in Transformation.

Take the following steps to support for the camera:

1.

Add this local variable under L_INT nRet; in the WndProc function:

VECTORCAMERA Camera;

2.

Add these lines right after the break; statement of case '-': in WM_CHAR:

case 'b':
case 'B':
// flip camera projection between parallel and perspective
L_VecGetCamera ( &Vector, &Camera );
Camera.bPerspective = !Camera.bPerspective;
L_VecSetCamera ( &Vector, &Camera );
InvalidateRect( hWnd, NULL, FALSE );
break;

case 'T':
case 't':
// rotate the camera theta angle
L_VecGetCamera( &Vector, &Camera );
Camera.Theta += 5.0;
L_VecSetCamera( &Vector, &Camera );
InvalidateRect( hWnd, NULL, FALSE );
break;

case 'P':
case 'p':
// rotate the camera phi angle
L_VecGetCamera ( &Vector, &Camera );
Camera.Phi += 5.0;
L_VecSetCamera ( &Vector, &Camera );
InvalidateRect( hWnd, NULL, FALSE );
break;

3. | Compile and run the demo.
4. | Select File/Open… from the program menu. Browse to c:\lead\images\random.dxf and click OK.
5. | Now you should be able to rotate the camera using the T and P keys on your keyboard, flip projection between parallel and perspective using the B key.


Using Vector Engines

Start with the project you created in Using the Camera.

Take the following steps to add support for viewing vector drawing in different vector engines:

1.

Click the ResourceView tab in the Project Workspace. Double click IDR_MENU1 and add the following menu structure:

&Engine
&GDI with ID = IDM_ENGINE_GDI
&OpenGL with ID = IDM_ENGINE_OPENGL
&DirectX with ID = IDM_ENGINE_DIRECTX

2.

Click the FileView tab in Project Workspace again and go to Vecaut.c. Add these lines right after the return 0L; statement of case IDM_FILE_EXIT for WM_COMMAND:

case IDM_ENGINE_GDI:
// re-attach vector using GDI engine.
L_VecAttachToWindow ( hWnd, &Vector, VECTOR_ENGINE_GDI, VECTOR_ENGINE_DOUBLEBUFFER );
L_VecSetPolygonMode ( &Vector, VECTOR_POLYGON_LINE );
L_VecSetUseLights ( &Vector, FALSE );
ResetView( hWnd, &Vector );
break;

case IDM_ENGINE_OPENGL:
// re-attach vector using OpenGL engine.
L_VecAttachToWindow( hWnd, &Vector, VECTOR_ENGINE_OPENGL, VECTOR_ENGINE_DOUBLEBUFFER );
L_VecSetPolygonMode( &Vector, VECTOR_POLYGON_FILL );
L_VecSetUseLights( &Vector, TRUE );
L_VecSetAmbientColor ( &Vector, RGB( 0x3F, 0x3F, 0x3F ) );
ResetView( hWnd, &Vector );
break;

case IDM_ENGINE_DIRECTX:
// re-attach vector using DirectX engine.
L_VecAttachToWindow ( hWnd, &Vector, VECTOR_ENGINE_DIRECTX, VECTOR_ENGINE_DOUBLEBUFFER );
L_VecSetPolygonMode ( &Vector, VECTOR_POLYGON_FILL );
L_VecSetUseLights ( &Vector, TRUE );
L_VecSetAmbientColor( &Vector, RGB( 0x3F, 0x3F, 0x3F ) );
ResetView( hWnd, &Vector );
break;

3. | Compile and run the demo.
4. | Select File/Open… from the program menu. Browse to c:\lead\images\random.dxf and click OK.
5. | You should be able now to select different vector engines and see the effect of how the drawing is painted on the window.


Implementing Hit Testing

Start with the project you created in Using Vector Engines.

Take the following steps to add support for hit testing different vector objects:

1.

Add the following local variables right under the VECTORPOINT Point; statement in the WndProc function:

POINT pt;
VECTOROBJECT Object;
L_TCHAR szBuffer[ 80 ];
VECTORPEN Pen;

2.

Add the following lines right after the return 0L; statement of case WM_KEYDOWN:

case WM_MOUSEMOVE:
// hit test object under mouse cursor
pt.x = LOWORD( lParam );
pt.y = HIWORD( lParam );
nRet = L_VecHitTest( &Vector, &pt, &Object );
if( nRet == SUCCESS )
{
// theres an object, show its type in main window caption
switch( Object.nType )
{
case VECTOR_VERTEX: lstrcpy( szBuffer, TEXT("Vertex ")); break;
case VECTOR_LINE: lstrcpy( szBuffer, TEXT("Line ")); break;
case VECTOR_RECTANGLE: lstrcpy( szBuffer, TEXT("Rectangle ")); break;
case VECTOR_POLYLINE: lstrcpy( szBuffer, TEXT("Polyline")); break;
case VECTOR_POLYBEZIER: lstrcpy( szBuffer, TEXT("Polybezier")); break;
case VECTOR_POLYGON: lstrcpy( szBuffer, TEXT("Polygon")); break;
case VECTOR_ELLIPSE: lstrcpy( szBuffer, TEXT("Ellipse")); break;
case VECTOR_CIRCLE: lstrcpy( szBuffer, TEXT("Circle")); break;
case VECTOR_ARC: lstrcpy( szBuffer, TEXT("Arc")); break;
case VECTOR_TEXT: lstrcpy( szBuffer, TEXT("Text")); break;
case VECTOR_PIE: lstrcpy( szBuffer, TEXT("Pie")); break;
case VECTOR_CHORD: lstrcpy( szBuffer, TEXT("Chord")); break;
case VECTOR_RASTER: lstrcpy( szBuffer, TEXT("Raster ")); break;
}
}
else
lstrcpy( szBuffer, TEXT("No object under mouse cursor"));

SetWindowText( hWnd, szBuffer );
return 0L;

case WM_LBUTTONDOWN:
// hit test object under mouse cursor
pt.x = LOWORD( lParam );
pt.y = HIWORD( lParam );
nRet = L_VecHitTest ( &Vector, &pt, &Object );
if( nRet == SUCCESS )
{
// theres an object, flip its pen width between 1 and 4
L_VecGetObjectAttributes ( &Vector, &Object, NULL, &Pen, NULL, NULL );
Pen.LogPen.lopnWidth.x = ( Pen.LogPen.lopnWidth.x == 1 ) ? 4 : 1;
L_VecSetObjectAttributes ( &Vector, &Object, NULL, &Pen, NULL, NULL, 0L );

// reflect our changes
InvalidateRect( hWnd, NULL, FALSE );
}
return 0L;

case WM_RBUTTONDOWN:
// hit test object under mouse cursor
pt.x = LOWORD( lParam );
pt.y = HIWORD( lParam );
nRet = L_VecHitTest ( &Vector, &pt, &Object );
if( nRet == SUCCESS )
{
// theres an object, delete it
L_VecDeleteObject ( &Vector, &Object, 0L );

// reflect our changes
InvalidateRect( hWnd, NULL, FALSE );
}
return 0L;

3. | Compile and run the demo.
4. | Select File/Open… from the program menu. Browse to c:\lead\images\random.dxf and click OK.
5. | You should be able now to see the object type under the mouse cursor on the main window caption. Left click an object to flip its pen width size between 1 and 4. Right click an object to delete it.


Working with Layers

Start with the project you created in Implementing Hit Testing.

Take the following steps to show/hide layers from a vector drawing:

1.

Add these local variables under the HDC hDC; statement in the WndProc function:

L_INT nIndex;
VECTORLAYER Layer;
VECTORLAYERDESC LayerDesc;

2.

Add the following lines in WM_CREATE handler right after L_VecInit ( &Vector ); statement:

L_VecLoadFile ( TEXT("c:\\lead\\images\\random.dxf"), &Vector, NULL, NULL );

3.

Add the following lines before the case 'x' statement of the WM_CHAR message:

case '1':
case '2':
// get layer from index
if( wParam == '1' )
nIndex = 0;
else
nIndex = 1;

L_VecGetLayerByIndex ( &Vector, nIndex, &Layer );
L_VecGetLayer ( &Vector, &Layer, &LayerDesc );

// flip the visible state of the layer
LayerDesc.bVisible = !LayerDesc.bVisible;

// update
L_VecSetLayer ( &Vector, &Layer, &LayerDesc );
L_VecFreeLayer ( &LayerDesc );
InvalidateRect( hWnd, NULL, FALSE );
break;

4. | Compile and run the demo.
5. | The sample image (random.dxf) shipped with LEADTOOLS has 2 layers. You should be able to hide/show those layers by pressing 1 and 2 on your keyboard.


Adding and Displaying Vector Objects

Start with the project you created in Implementing Hit Testing.

Take the following steps to start adding new layer and objects to the vector handle.

Note:

This tutorial will only use 3 types of objects (Line, Ellipse and Polygon) to keep things simple. For more information about the vector object types supported by the toolkit, refer to the VECTOROBJECT structure.

1.

Comment out these local variables from the WndProc function:

static OPENFILENAME OpenFileName;
static L_TCHAR szFileName[ _MAX_PATH ];
static L_TCHAR szFileTitle[ _MAX_PATH ];
static L_TCHAR *szFilter[] = { TEXT("All Files\0*.*\0") };

2.

Comment out these lines from WM_CREATE handler:

// reset the OPENFILENAME structure
memset( &OpenFileName, 0, sizeof( OPENFILENAME ) );
OpenFileName.lStructSize = sizeof( OPENFILENAME );
OpenFileName.hwndOwner = hWnd;
OpenFileName.lpstrFilter = szFilter[ 0 ];
OpenFileName.lpstrFile = szFileName;
OpenFileName.nMaxFile = _MAX_PATH;
OpenFileName.lpstrFileTitle = szFileTitle;
OpenFileName.nMaxFileTitle = _MAX_PATH;

3.

Comment out these 2 cases from the switch( wParam ) statement in WM_COMMAND handle:

case IDM_FILE_OPEN:
case IDM_FILE_SAVE:

4.

Add these local variables under the VECTORPEN Pen; statement in the WndProc function:

VECTORLINE Line; // line vector object
VECTORELLIPSE Ellipse; // circle vector object
VECTORPOLYGON Polygon; // polygon vector object
L_INT i;

5.

Add the following lines in WM_CREATE handler after L_VecAttachToWindow and before ResetView:

// fill in the layer descriptor structure and add new layer to the vector handle
LayerDesc.nSize = sizeof( VECTORLAYERDESC );
lstrcpy( LayerDesc.szName, TEXT("Default Layer"));
LayerDesc.bVisible = TRUE;
LayerDesc.bLocked = FALSE;
LayerDesc.dwTag = 0L;
L_VecAddLayer ( &Vector, &LayerDesc, &Layer, 0L );

// make this the active layer in the vector handle
L_VecSetActiveLayer ( &Vector, &Layer );

6.

Add the following code to the WM_CHAR handler, after the break; statement of case ‘-‘:

case 'l':
case 'L':
// add a new vector line
L_VecInitObject ( &Line.Object );
Line.Object.nSize = sizeof( VECTORLINE );
Line.Object.nType = VECTOR_LINE;

// set the line pen
Line.Pen.nSize = sizeof( VECTORPEN );
Line.Pen.LogPen.lopnColor = RGB( rand() % 246 + 10, rand() % 246 + 10, rand() % 246 + 10 );
Line.Pen.LogPen.lopnStyle = PS_SOLID;
Line.Pen.LogPen.lopnWidth.x = 1;
Line.Pen.LogPen.lopnWidth.y = 1;

// set the line start and end points
for( i = 0; i < 2; i++ )
{
Line.Point[ i ].x = rand() % 100;
Line.Point[ i ].y = rand() % 100;
Line.Point[ i ].z = rand() % 100;
}

// add the object to the active layer
L_VecAddObject ( &Vector, NULL, VECTOR_LINE, &Line, NULL );

// update view parameters and re-paint window
ResetView( hWnd, &Vector );
break;

case 'e':
case 'E':
// add a new ellipse object
L_VecInitObject ( &Ellipse.Object );
Ellipse.Object.nSize = sizeof( VECTORELLIPSE );
Ellipse.Object.nType = VECTOR_ELLIPSE;

// set the ellipse pen
Ellipse.Pen.nSize = sizeof( VECTORPEN );
Ellipse.Pen.LogPen.lopnColor = RGB( rand() % 246 + 10, rand() % 246 + 10, rand() % 246 + 10 );
Ellipse.Pen.LogPen.lopnStyle = PS_SOLID;
Ellipse.Pen.LogPen.lopnWidth.x = 1;
Ellipse.Pen.LogPen.lopnWidth.y = 1;

// set the ellipse brush
Ellipse.Brush.nSize = sizeof( VECTORBRUSH );
Ellipse.Brush.LogBrush.lbColor = RGB( rand() % 246 + 10, rand() % 246 + 10, rand() % 246 + 10 );
Ellipse.Brush.LogBrush.lbStyle = BS_SOLID;
Ellipse.Brush.LogBrush.lbHatch = 0;

// set the ellipse center, x radius and y radius
Ellipse.Point.x = rand() % 100;
Ellipse.Point.y = rand() % 100;
Ellipse.Point.z = rand() % 100;

Ellipse.xRadius = rand() % 10;
Ellipse.yRadius = rand() % 10;

// add the object to the active layer
L_VecAddObject ( &Vector, NULL, VECTOR_ELLIPSE, &Ellipse, NULL );

// update view parameters and re-paint window
ResetView( hWnd, &Vector );
break;

case 'g':
case 'G':
// add a new polygon object
L_VecInitObject ( &Polygon.Object );
Polygon.Object.nSize = sizeof( VECTORPOLYGON );
Polygon.Object.nType = VECTOR_POLYGON;

// set the polygon pen
Polygon.Pen.nSize = sizeof( VECTORPEN );
Polygon.Pen.LogPen.lopnColor = RGB( rand() % 246 + 10, rand() % 246 + 10, rand() % 246 + 10 );
Polygon.Pen.LogPen.lopnStyle = PS_SOLID;
Polygon.Pen.LogPen.lopnWidth.x = 1;
Polygon.Pen.LogPen.lopnWidth.y = 1;

// set the polygon brush
Polygon.Brush.nSize = sizeof( VECTORBRUSH );
Polygon.Brush.LogBrush.lbColor = RGB( rand() % 246 + 10, rand() % 246 + 10, rand() % 246 + 10 );
Polygon.Brush.LogBrush.lbStyle = BS_SOLID;
Polygon.Brush.LogBrush.lbHatch = 0;

// set the polygon points
Polygon.nPointCount = rand() % 5 + 3;
Polygon.Point = (pVECTORPOINT) malloc( Polygon.nPointCount * sizeof( VECTORPOINT ) );
for( i = 0; i < Polygon.nPointCount; i++ )
{
Polygon.Point[ i ].x = rand() % 100;
Polygon.Point[ i ].y = rand() % 100;
Polygon.Point[ i ].z = rand() % 100;
}

// set polygon fill mode
Polygon.nPolyFillMode = VECTOR_POLY_ALTERNATE;

// add the object to the active layer
L_VecAddObject ( &Vector, NULL, VECTOR_POLYGON, &Polygon, NULL );

free( Polygon.Point );

// update view parameters and re-paint window
ResetView( hWnd, &Vector );
break;

7.

Compile and run the project. You will be able to add new line objects by pressing L on your keyboard, new ellipse objects by pressing E and new polygon objects by pressing G. You can still perform hit testing and transform your drawing as shown in the previous tutorials.


Dialog Strings

The following strings can be accessed and modified using L_VecDlgGetString and L_VecDlgSetString.

Generic control strings

Value | String
VECTOR_DLGSTR_BUTTON_OK | "OK"
VECTOR_DLGSTR_BUTTON_CANCEL | "Cancel"
VECTOR_DLGSTR_BUTTON_HELP | "Help"
VECTOR_DLGSTR_CHECK_PREVIEW | "Preview"

Transform dialog

Value | String
VECTOR_DLGSTR_TRANSFORM_SCALE_CAPTION | "Scale"
VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION | "Rotate"
VECTOR_DLGSTR_TRANSFORM_TRANSLATE_CAPTION | "Translate"
VECTOR_DLGSTR_TRANSFORM_CAMERA_CAPTION | "Camera"
VECTOR_DLGSTR_TRANSFORM_BUTTON_XUP | "+ X"
VECTOR_DLGSTR_TRANSFORM_BUTTON_XDOWN | "- X"
VECTOR_DLGSTR_TRANSFORM_BUTTON_YUP | "+ Y"
VECTOR_DLGSTR_TRANSFORM_BUTTON_YDOWN | "- Y"
VECTOR_DLGSTR_TRANSFORM_BUTTON_ZUP | "+ Z"
VECTOR_DLGSTR_TRANSFORM_BUTTON_ZDOWN | "- Z"
VECTOR_DLGSTR_TRANSFORM_BUTTON_XUPCAMERA | "+ Theta"
VECTOR_DLGSTR_TRANSFORM_BUTTON_XDOWNCAMERA | "- Theta"
VECTOR_DLGSTR_TRANSFORM_BUTTON_YUPCAMERA | "+ Phi"
VECTOR_DLGSTR_TRANSFORM_BUTTON_YDOWNCAMERA | "- Phi"
VECTOR_DLGSTR_TRANSFORM_BUTTON_ZUPCAMERA | "+ Distance"
VECTOR_DLGSTR_TRANSFORM_BUTTON_ZDOWNCAMERA | "- Distance"
VECTOR_DLGSTR_TRANSFORM_CHECK_ALL | "All"
VECTOR_DLGSTR_TRANSFORM_CHECK_PERSPECTIVE | "Perspective"
VECTOR_DLGSTR_TRANSFORM_BUTTON_RESET | "Reset"

Render dialog

Value | String
VECTOR_DLGSTR_RENDER_CAPTION | "Render Options"
VECTOR_DLGSTR_RENDER_FRAME_LIGHTS | "Lights"
VECTOR_DLGSTR_RENDER_CHECK_USELIGHTS | "Use lights"
VECTOR_DLGSTR_RENDER_BUTTON_AMBIENT | "Ambient Color"
VECTOR_DLGSTR_RENDER_FRAME_POLYGONMODE | "Polygon Mode"
VECTOR_DLGSTR_RENDER_RADIO_POINT | "Points"
VECTOR_DLGSTR_RENDER_RADIO_LINE | "Lines"
VECTOR_DLGSTR_RENDER_RADIO_FILL | "Filled"

View mode dialog

Value | String
VECTOR_DLGSTR_VIEWMODE_CAPTION | "View Mode Options"
VECTOR_DLGSTR_VIEWMODE_FRAME_VIEWMODE | "View Mode"
VECTOR_DLGSTR_VIEWMODE_RADIO_FIT | "Fit"
VECTOR_DLGSTR_VIEWMODE_RADIO_SNAP | "Snap"

Hit test dialog

Value | String
VECTOR_DLGSTR_HITTEST_CAPTION | "Hit Test Options"
VECTOR_DLGSTR_HITTEST_FRAME_DISTANCE | "Distance"
VECTOR_DLGSTR_HITTEST_FRAME_OPTIONS | "Options"
VECTOR_DLGSTR_HITTEST_CHECK_CLOSEDFIGURES | "Closed figures"
VECTOR_DLGSTR_HITTEST_CHECK_IGNORESELECTED | "Ignore selected"

All layers dialog

Value | String
VECTOR_DLGSTR_ALLLAYERS_CAPTION | "Layers"
VECTOR_DLGSTR_ALLLAYERS_BUTTON_NEW | "New"
VECTOR_DLGSTR_ALLLAYERS_BUTTON_EDIT | "Edit"
VECTOR_DLGSTR_ALLLAYERS_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_ALLLAYERS_YES | "Yes"
VECTOR_DLGSTR_ALLLAYERS_NO | "No"
VECTOR_DLGSTR_ALLLAYERS_NAME | "Name"
VECTOR_DLGSTR_ALLLAYERS_ACTIVE | "Active"
VECTOR_DLGSTR_ALLLAYERS_VISIBLE | "Visible"
VECTOR_DLGSTR_ALLLAYERS_LOCKED | "Locked"

Layer dialog

Value | String
VECTOR_DLGSTR_LAYER_CAPTION | "Layer"
VECTOR_DLGSTR_LAYER_FRAME_NAME | "Name"
VECTOR_DLGSTR_LAYER_CHECK_ACTIVE | "Current Active Layer"
VECTOR_DLGSTR_LAYER_CHECK_VISIBLE | "Visible"
VECTOR_DLGSTR_LAYER_CHECK_LOCKED | "Locked"

General dialog

Value | String
VECTOR_DLGSTR_GENERAL_CAPTION | "General"
VECTOR_DLGSTR_GENERAL_FRAME_SELECTION | "Selection"
VECTOR_DLGSTR_GENERAL_CHECK_SELECTION | "Selected"
VECTOR_DLGSTR_GENERAL_FRAME_RASTEROPERATION | "Raster Operation"

ROP2

Value | String
VECTOR_DLGSTR_GENERAL_ROP2_BLACKNESS | "Blackness"
VECTOR_DLGSTR_GENERAL_ROP2_NOTMERGEPEN | "Not Merge Pen"
VECTOR_DLGSTR_GENERAL_ROP2_MASKNOTPEN | "Mask Not Pen"
VECTOR_DLGSTR_GENERAL_ROP2_NOTCOPYPEN | "Not Copy Pen"
VECTOR_DLGSTR_GENERAL_ROP2_MASKPENNOT | "Mask Pen Not"
VECTOR_DLGSTR_GENERAL_ROP2_INVERT | "Invert"
VECTOR_DLGSTR_GENERAL_ROP2_XORPEN | "Xor Pen"
VECTOR_DLGSTR_GENERAL_ROP2_NOTMASK | "Not Mask"
VECTOR_DLGSTR_GENERAL_ROP2_MASKPEN | "Mask Pen"
VECTOR_DLGSTR_GENERAL_ROP2_NOTXORPEN | "Not Xor Pen"
VECTOR_DLGSTR_GENERAL_ROP2_NOP | "Nop"
VECTOR_DLGSTR_GENERAL_ROP2_MERGENOTPEN | "Merge Not Pen"
VECTOR_DLGSTR_GENERAL_ROP2_COPYPEN | "Copy Pen"
VECTOR_DLGSTR_GENERAL_ROP2_MERGEPENNOT | "Merge Pen Not"
VECTOR_DLGSTR_GENERAL_ROP2_MERGEPEN | "Merge Pen"
VECTOR_DLGSTR_GENERAL_ROP2_WHITENESS | "Whiteness"

Pen dialog

Value | String
VECTOR_DLGSTR_PEN_CAPTION | "Pen"
VECTOR_DLGSTR_PEN_FRAME_STYLE | "Style"
VECTOR_DLGSTR_PEN_FRAME_ENDCAP | "Endcap"
VECTOR_DLGSTR_PEN_FRAME_JOIN | "Join"
VECTOR_DLGSTR_PEN_FRAME_WIDTH | "Width"
VECTOR_DLGSTR_PEN_FRAME_COLOR | "Color"

Pen styles

Value | String
VECTOR_DLGSTR_PEN_STYLE_SOLID | "Solid"
VECTOR_DLGSTR_PEN_STYLE_DASH | "Dash"
VECTOR_DLGSTR_PEN_STYLE_DOT | "Dot"
VECTOR_DLGSTR_PEN_STYLE_DASHDOT | "Dash-Dot"
VECTOR_DLGSTR_PEN_STYLE_DASHDOTDOT | "Dast-Dot-Dot"
VECTOR_DLGSTR_PEN_STYLE_TRANSPARENT | "Transparent"
VECTOR_DLGSTR_PEN_STYLE_INSIDEFRAME | "Inside Frame"

Brush dialog

Value | String
VECTOR_DLGSTR_BRUSH_CAPTION | "Brush"
VECTOR_DLGSTR_BRUSH_FRAME_STYLE | "Brush Styles"
VECTOR_DLGSTR_BRUSH_FRAME_HATCH | "Hatch"
VECTOR_DLGSTR_BRUSH_FRAME_COLOR | "Color"

Standard Brush

Value | String
VECTOR_DLGSTR_STDBRUSH_FRAME_STDBRUSHPROP | "Standard Brush Properties"
VECTOR_DLGSTR_STDBRUSH_FRAME_STYLE | "Style"
VECTOR_DLGSTR_STDBRUSH_FRAME_HATCH | "Hatch"
VECTOR_DLGSTR_STDBRUSH_FRAME_COLOR | "Color"

Standard Brush style:

Value | String
VECTOR_DLGSTR_STDBRUSH_STYLE_SOLID | "Solid"
VECTOR_DLGSTR_STDBRUSH_STYLE_TRANSPARENT | "Transparent"
VECTOR_DLGSTR_STDBRUSH_STYLE_HATCHED | "Hatched"

Standard Brush hatch styles:

Value | String
VECTOR_DLGSTR_STDBRUSH_HATCHED_HORIZONTAL | "Horizontal"
VECTOR_DLGSTR_STDBRUSH_HATCHED_VERTICAL | "Vertical"
VECTOR_DLGSTR_STDBRUSH_HATCHED_FORWARDDIAGONAL | "Forward Diagonal"
VECTOR_DLGSTR_STDBRUSH_HATCHED_BACKWARDDIAGONAL | "Backward Diagonal"
VECTOR_DLGSTR_STDBRUSH_HATCHED_CROSS | "Cross"
VECTOR_DLGSTR_STDBRUSH_HATCHED_DIAGONALCROSS | "Diagonal Cross"

Pattern Brush

Value | String
VECTOR_DLGSTR_PTRBRUSH_FRAME_PTRBRUSHPROP | "Pattern Brush Properties"
VECTOR_DLGSTR_PTRBRUSH_STATIC_BITMAP | "Bitmap"

Gradient Brush

Value | String
VECTOR_DLGSTR_GRDBRUSH_FRAME_GRDBRUSHPROP | "Gradient Brush Properties"
VECTOR_DLGSTR_GRDBRUSH_STATIC_STARTCOLOR | "Start Color"
VECTOR_DLGSTR_GRDBRUSH_STATIC_ENDCOLOR | "End Color"
VECTOR_DLGSTR_GRDBRUSH_STATIC_STYLE | "Style"
VECTOR_DLGSTR_GRDBRUSH_STATIC_DIRECTION | "Direction"
VECTOR_DLGSTR_GRDBRUSH_STATIC_STEPS | "Steps"

Gradient Brush styles:

Value | String
VECTOR_DLGSTR_GRDBRUSH_STYLE_LINE | "Linear Gradient"
VECTOR_DLGSTR_GRDBRUSH_STYLE_ANGLE | "Angular Gradient "
VECTOR_DLGSTR_GRDBRUSH_STYLE_RECTANGLE | "Rectangular Gradient"
VECTOR_DLGSTR_GRDBRUSH_STYLE_ELLIPSE | "Sunburst Gradient"
VECTOR_DLGSTR_GRDBRUSH_STYLE_CONE | "Radial Gradient"

Gradient Brush Directions – Line:

Value | String
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_L_TO_R | "Left To Right"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_R_TO_L | "Right To Left"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_T_TO_B | "Top To Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_B_TO_T | "Bottom To Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_LT_TO_RB | "LeftTop To RightBottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_LB_TO_RT | "LeftBottom To RightTop"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_RT_TO_LB | "RightTop To LeftBottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_RB_TO_LT | "RightBottom To LeftTop"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_L_AND_R_TO_C | "Left And Right To Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_C_TO_L_AND_R | "Center To Left And Right"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_T_AND_B_TO_C | "Top And Bottom To Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_C_TO_T_AND_B | "Center To Top And Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_LT_AND_RB_TO_C | "LeftTop And RightBottom To Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_C_TO_LT_AND_RB | "Center To LeftTop And RightBottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_RT_AND_LB_TO_C | "RightTop And LeftBottom to Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_LINE_C_TO_RT_AND_LB | "Center To RightTop And LeftBottom"

Gradient Brush Directions – Angle:

Value | String
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_TO_LT | "To Left Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_TO_LB | "To Left Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_TO_RT | "To Right Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_TO_RB | "To Right Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_FROM_LT | "From Left Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_FROM_LB | "From Left Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_FROM_RT | "From Right Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ANGLE_FROM_RB | "From Right Bottom"

Gradient Brush Directions – Rectangle:

Value | String
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_RECTANGLE_TO_C | "To Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_RECTANGLE_FROM_C | "From Center"

Gradient Brush Directions – Ellipse:

Value | String
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ELLIPSE_TO_C | "To Center"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_ELLIPSE_FROM_C | "From Center"

Gradient Brush Directions – Cone:

Value | String
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_L | "From Left"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_R | "From Right"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_T | "From Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_B | "From Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_LT | "From Left Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_LB | "From Left Bottom"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_RT | "From Right Top"
VECTOR_DLGSTR_GRDBRUSH_DIRECTION_CONE_RB | "From Right Bottom"

Hatch Brush

Value | String
VECTOR_DLGSTR_HATBRUSH_FRAME_HATCHPROP | "Hatch Brush Properties"
VECTOR_DLGSTR_HATBRUSH_STATIC_STEP | "Step"
VECTOR_DLGSTR_HATBRUSH_STATIC_ANGLE | "Angle"
VECTOR_DLGSTR_HATBRUSH_FRAME_PENPROP | "Pen Properties"
VECTOR_DLGSTR_HATBRUSH_STATIC_PENSTYLE | "Style"
VECTOR_DLGSTR_HATBRUSH_STATIC_PENWIDTH | "Width"
VECTOR_DLGSTR_HATBRUSH_STATIC_PENCOLOR | "Color"
VECTOR_DLGSTR_HATBRUSH_FRAME_BRUSHPROP | "Brush Properties"
VECTOR_DLGSTR_HATBRUSH_STATIC_BRUSHSTYLE | "Style"
VECTOR_DLGSTR_HATBRUSH_STATIC_BRUSHCOLOR | "Color"
VECTOR_DLGSTR_HATBRUSH_STATIC_BRUSHHATCH | "Hatch"

Hatch Brush Styles

Value | String
VECTOR_DLGSTR_HATBRUSH_STYLE_RECT | Rectangle
VECTOR_DLGSTR_HATBRUSH_STYLE_CIRCLE | Circle
VECTOR_DLGSTR_HATBRUSH_STYLE_TRIANGLE | Triangle
VECTOR_DLGSTR_HATBRUSH_STYLE_LINE | Line

Vertex dialog

Value | String
VECTOR_DLGSTR_VERTEX_CAPTION | "Vertex"
VECTOR_DLGSTR_VERTEX_FRAME_LOCATION | "Location"

Line dialog

Value | String
VECTOR_DLGSTR_LINE_CAPTION | "Line"
VECTOR_DLGSTR_LINE_FRAME_STARTPOINT | "Start Point"
VECTOR_DLGSTR_LINE_FRAME_ENDPOINT | "End Point"

Rectangle dialog

Value | String
VECTOR_DLGSTR_RECTANGLE_CAPTION | "Rectangle"
VECTOR_DLGSTR_RECTANGLE_FRAME_STARTPOINT | "Start Point"
VECTOR_DLGSTR_RECTANGLE_FRAME_ENDPOINT | "End Point"

Polyline dialog

Value | String
VECTOR_DLGSTR_POLYLINE_CAPTION | "Poly Line"
VECTOR_DLGSTR_POLYLINE_FRAME_POINTS | "Point"
VECTOR_DLGSTR_POLYLINE_BUTTON_NEW | "New"
VECTOR_DLGSTR_POLYLINE_BUTTON_DELETE | "Delete"

Polybezier dialog

Value | String
VECTOR_DLGSTR_POLYBEZIER_CAPTION | "Poly Bezier"
VECTOR_DLGSTR_POLYBEZIER_FRAME_POINTS | "Points"
VECTOR_DLGSTR_POLYBEZIER_BUTTON_NEW | "New"
VECTOR_DLGSTR_POLYBEZIER_BUTTON_DELETE | "Delete"

Polygon dialog

Value | String
VECTOR_DLGSTR_POLYGON_CAPTION | "Polygon"
VECTOR_DLGSTR_POLYGON_FRAME_POINTS | "Points"
VECTOR_DLGSTR_POLYGON_BUTTON_NEW | "New"
VECTOR_DLGSTR_POLYGON_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_POLYGON_FRAME_FILLMODE | "Fill Mode"
VECTOR_DLGSTR_POLYGON_RADIO_ALTERNATE | "Alternate"
VECTOR_DLGSTR_POLYGON_RADIO_WINDING | "Winding"

Ellipse dialog

Value | String
VECTOR_DLGSTR_ELLIPSE_CAPTION | "Ellipse"
VECTOR_DLGSTR_ELLIPSE_FRAME_CENTER | "Center"
VECTOR_DLGSTR_ELLIPSE_FRAME_RADIUS | "Radius"

Circle dialog

Value | String
VECTOR_DLGSTR_CIRCLE_CAPTION | "Circle"
VECTOR_DLGSTR_CIRCLE_FRAME_CENTER | "Center"
VECTOR_DLGSTR_CIRCLE_FRAME_RADIUS | "Radius"

Arc dialog

Value | String
VECTOR_DLGSTR_ARC_CAPTION | "Arc"
VECTOR_DLGSTR_ARC_FRAME_CENTER | "Center"
VECTOR_DLGSTR_ARC_FRAME_RADIUS | "Radius"
VECTOR_DLGSTR_ARC_FRAME_ANGLES | "Angles"
VECTOR_DLGSTR_ARC_STATIC_START | "Start"
VECTOR_DLGSTR_ARC_STATIC_SWEEP | "Sweep"

Text dialog

Value | String
VECTOR_DLGSTR_TEXT_CAPTION | "Text"
VECTOR_DLGSTR_TEXT_FRAME_POINT | "Point"
VECTOR_DLGSTR_TEXT_FRAME_HORIZONTAL | "Horizontal"
VECTOR_DLGSTR_TEXT_FRAME_VERTICAL | "Vertical"
VECTOR_DLGSTR_TEXT_CHECK_HITTESTRECTANGLE | "Hit Test Rectangle"
VECTOR_DLGSTR_TEXT_FRAME_TEXT | "Text"
VECTOR_DLGSTR_TEXT_FRAME_FONT | "Font"
VECTOR_DLGSTR_TEXT_BUTTON_FONT | "Font..."
VECTOR_DLGSTR_TEXT_STATIC_CHARWIDTH | "Char Width"
VECTOR_DLGSTR_TEXT_STATIC_CHARHEIGHT | "Char Height"

Text alignment combo

Value | String
VECTOR_DLGSTR_TEXT_LEFT | "Left"
VECTOR_DLGSTR_TEXT_RIGHT | "Right"
VECTOR_DLGSTR_TEXT_HCENTER | "Center"
VECTOR_DLGSTR_TEXT_TOP | "Top"
VECTOR_DLGSTR_TEXT_BOTTOM | "Bottom"
VECTOR_DLGSTR_TEXT_VCENTER | "Center"

Pie dialog

Value | String
VECTOR_DLGSTR_PIE_CAPTION | "Pie"
VECTOR_DLGSTR_CHORD_CAPTION | "Chord"
VECTOR_DLGSTR_PIE_FRAME_CENTER | "Center"
VECTOR_DLGSTR_PIE_FRAME_RADIUS | "Radius"
VECTOR_DLGSTR_PIE_FRAME_ANGLES | "Angles"
VECTOR_DLGSTR_PIE_STATIC_START | "Start"
VECTOR_DLGSTR_PIE_STATIC_SWEEP | "Sweep"

Polydraw dialog

Value | String
VECTOR_DLGSTR_POLYDRAW_CAPTION | "Poly Draw"
VECTOR_DLGSTR_POLYDRAW_FRAME_POINTS | "Points"
VECTOR_DLGSTR_POLYDRAW_BUTTON_NEW | "New"
VECTOR_DLGSTR_POLYDRAW_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_POLYDRAW_FRAME_TYPE | "Type"
VECTOR_DLGSTR_POLYDRAW_CHECK_CLOSEFIGURE | "Close Figure"

Polydraw types

Value | String
VECTOR_DLGSTR_POLYDRAW_MOVETO | "Move To"
VECTOR_DLGSTR_POLYDRAW_LINETO | "Line To"
VECTOR_DLGSTR_POLYDRAW_BEZIERTO | "Bezier To"

Raster dialog

Value | String
VECTOR_DLGSTR_RASTER_CAPTION | "Raster"
VECTOR_DLGSTR_RASTER_FRAME_POINT1 | "Point 1"
VECTOR_DLGSTR_RASTER_FRAME_POINT2 | "Point 2"
VECTOR_DLGSTR_RASTER_FRAME_BITMAP | "Bitmap"

Messages

Value | String
VECTOR_DLGSTR_VECTOR_IS_LOCKED | "Vector is locked!"
VECTOR_DLGSTR_VECTOR_NOT_ENABLED | "Vector is not enabled!"
VECTOR_DLGSTR_LAYER_NOT_FOUND | "Layer not found!"
VECTOR_DLGSTR_LAYER_ALREADY_EXISTS | "Layer already exists!"
VECTOR_DLGSTR_NO_MEMORY | "Out of memory!"
VECTOR_DLGSTR_DELETELAYERQUERY | "This will delete all objects inside layer:\n%s\n\nAre you sure you want to continue?"
VECTOR_DLGSTR_CANNOTFINISHOPERATION | "Cannot finish this operation"
VECTOR_DLGSTR_CANNOTLOADBITMAP | "Cannot load bitmap!"

Spline dialog

Value | String
VECTOR_DLGSTR_SPLINE_CAPTION | "Spline"
VECTOR_DLGSTR_SPLINE_FRAME_POINTS | "Points"
VECTOR_DLGSTR_SPLINE_BUTTON_NEW | "New"
VECTOR_DLGSTR_SPLINE_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_SPLINE_FRAME_SPLINEPOINTSTYPE | "Spline Points Type"
VECTOR_DLGSTR_SPLINE_RADIO_CONTROLPOINTS | "Control Points"
VECTOR_DLGSTR_SPLINE_RADIO_FITPOINTS | "Fit Points"

Spline dialog

Value | String
VECTOR_DLGSTR_SPLINE_CAPTION | "Spline"
VECTOR_DLGSTR_SPLINE_FRAME_POINTS | "Points"
VECTOR_DLGSTR_SPLINE_BUTTON_NEW | "New"
VECTOR_DLGSTR_SPLINE_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_SPLINE_FRAME_SPLINEPOINTSTYPE | "Spline Points Type"
VECTOR_DLGSTR_SPLINE_RADIO_CONTROLPOINTS | "Control Points"
VECTOR_DLGSTR_SPLINE_RADIO_FITPOINTS | "Fit Points"

Heterogeneous Poly Bezier dialog

Value | String
VECTOR_DLGSTR_HPOLYBEZIER_CAPTION | "HPoly Bezier"
VECTOR_DLGSTR_HPOLYBEZIER_FRAME_POINTS | "Points"
VECTOR_DLGSTR_HPOLYBEZIER_BUTTON_NEW | "New"
VECTOR_DLGSTR_HPOLYBEZIER_BUTTON_DELETE | "Delete"
VECTOR_DLGSTR_HPOLYBEZIER_FRAME_SECTIONS | "Sections"
VECTOR_DLGSTR_HPOLYBEZIER_BUTTON_NEWSEC | "New"
VECTOR_DLGSTR_HPOLYBEZIER_BUTTON_DELETESEC | "Delete"


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 them by calling L_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 L_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, 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.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

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 .

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. [Document/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 .


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

CompuServe: 71333,2237 or GO LEADTECH

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.