Introduction

LEADTOOLS COM has several custom controls and COM Objects developed by LEAD Technologies, Inc.

LEAD Raster Object provides objects for adding basic BITMAP functionality into your applications. The objects in this library are used by many of the other objects and controls in the LEADTOOLS COM product.

LEAD RasterIO Object provides objects for incorporating image file format input, output, compression and decompression into your applications.

LEAD RasterProcess Object provides objects for incorporating image processing (filters, transforms, etc.) into your applications.

LEAD RasterView Control provides controls for incorporating image display into your applications.

LEAD RasterTwain Object provides an object for incorporating TWAIN scanner control into your applications. Information on this object can be found in the LEADTOOLS TWAIN COM Help File (Lttwncomn.chm) in the HELP directory.

LEAD RasterDlg Object provides objects for incorporating imaging common dialogs into your applications. These dialogs provided a quick and easy way to get and utilize user input necessary for image processing.

LEAD RasterAnnotation provides objects for incorporating annotations into your applications.

LEAD RasterAnnMenu provides objects for modifying annotation automation menus.

LEAD RasterAnnToolBar provides objects for incorporating an Annotation Toolbar into your applications. This toolbar makes interaction with annotation easier.

LEAD RasterOLEDB provides objects for incorporating database access, using an OLE DB Provider, into your applications.

LEAD RasterODBC provides objects for incorporating database access, using Open Database Connectivity, into your applications.

LEAD RasterFXD provides objects for incorporating special effects.

LEAD RasterThumbnail provides objects for generating thumbnails of LEAD supported images from a directory.

LEAD ImageList Control provides controls for displaying and manipulating image lists.

LEAD Raster ISIS Object provides custom controls for incorporating ISIS scanner control into your applications.

LEAD Raster Mixed Raster Content Object provides an object for enhancing LEADTOOLS input/output functionality by adding support for color documents containing mixed image and text components.

LEAD Raster PDF Compressor Object provides advanced PDF compression support.

In the documentation, properties, methods and events are designated as to which interface(s) they belong. The properties, methods and events are designated as follows:

Designation | Description
ILEADRaster | member of the LEAD Raster Object
ILEADRasterIO | member of the LEAD RasterIO Object
ILEADRasterProcess | member of the LEAD RasterProcess Object
ILEADRasterView | member of the LEAD RasterView Control
ILEADRasterDlg | member of the LEAD RasterDlg Object
ILEADRasterAnnotation | member of the LEAD RasterAnnotation Object
ILEADRasterAnnMenu | member of the LEAD RasterAnnMenu Object
ILEADRasterAnnToolBar | member of the LEAD RasterAnnToolBar Object
ILEADRasterOLEDB | member of the LEAD RasterOLEDB Object
ILEADRasterODBC | member of the LEAD RasterODBC Object
ILEADRasterFXD | member of the LEAD RasterFXD Object
ILEADRasterImgList | member of the LEAD ImageList Control
ILEADRasterThumbnail | member of the LEAD RasterThumbnail Object
ILEADRasterISIS | member of the LEAD RasterISIS Object
ILEADRasterMRC | member of the LEAD RasterMRC Object
ILEADPDFCompressor | member of the LEAD PDF Compressor Object

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The toolkit comes in 32-bit Document/Medical and non-Document/Medical editions. You can use LEADTOOLS COM in any programming environment that supports COM Objects, including the following:

Visual C++ 5.0 and later
Visual Basic 5.0 and later

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.

Advisories

Introduction To Image Processing with LEADTOOLS

Compression Using LEAD and JPEG Formats

Summary of All Supported Image File Formats

Compression Quality Factors


Advisories

Limitations with Visual Basic


Limitations with Visual Basic

Installations created with the Visual Basic 4.0 Setup Toolkit sometimes fail because of incompatible versions of the Olepro32.dll and Oleaut32.dll files. This is a known problem in Visual Basic, and a resolution of the problem is described in article Q162518 in the Microsoft Knowledge Base.

In an MDI application, Visual Basic 4.0 sometimes fails to update the palette on a child window when painting a 256-color image. This is a known bug in Visual Basic, and it is described in article Q149233 in the Microsoft Knowledge Base. The workaround recommended in the Knowledge Base article has been unreliable in testing performed by LEAD Technologies.


Version History

Current version: | 14.5
Last update: | November 2, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Version 12.1


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS COM Objects has changed from Version 14 as follows:

With this mid-release of LEADTOOLS version 14, many new features are being introduced to the annotations. Some of these features alter the way annotations are displayed. Other features change or enhance the user interface. To maintain backward compatibility within version 14, most of these features must be enabled by calling the AnnSetOptions method. In LEADTOOLS version 15, these options will be enabled by default.

The following features are being introduced:

New Rubber Stamp Display Style

New XP Style Annotation Toolbar

New Alpha Background Fill Option

New Annotation Rotate Option

New Annotation Side Handles

New Annotation Multi-select

New Annotation Cursors

New ESC to Cancel

New Calibrate Ruler Feature

New Dot Dash Lines

New XML Format

New Text Annotation Options

For detailed information regarding the new features, refer to New Annotation Features of Version 14.5.

LEADTOOLS supports now the Zoom View; which provides a means of "zooming in" on the image loaded into the window to which it is attached. This is similar to having multiple Magnifying Glasses on the same source image.

LEADTOOLS supports the GeoKeys; which are TIFF files containing a few extra TIFF tags describing the image location, scale at which the picture was taken and many other information useful for topographic applications.

LEADTOOLS has supported functionality to load embedded ICC profiles from JPEG, TIFF or EPS files.

LEADTOOLS provides Image Optimization functionality to optimize certain image file formats, by saving images using the optimal bits per pixel, based on specific optimization options.

LEADTOOLS has supported functionality to handle a mask image from a region.

LEADTOOLS has supported functionality to extract bitmaps from a series.

LEADTOOLS now supports the PDF Compressor to create compressed PDF files through MRC segmentation.

LEADTOOLS has added the new functionality to MRC COM object to:

Automatically segment the specified bitmap, finding the best segment combination without specifying minimum segment dimensions.

Save MRC images contained in a bitmap list to a file using the MRC LEAD, standard Proprietary T44 or PDF format.

LEADTOOLS has added new functionality to the Image List Control, for sorting the items in the image list based on their Text or Extended Text attributes, inserting a list of bitmaps into the Image List Control, and exporting a number of bitmaps from the Image List Control to a bitmap list.

When saving JBIG2 file, you can get or change the current values for the control options used by LEADTOOLS.

When loading TXT file, you can get or change the current values for the control options used by LEADTOOLS.

LEADTOOLS supports CMYK functions, which handle CMYK TIFF Files as separate bitmaps.

LEADTOOLS has added new functionality, which handles the TIFF and Exif files, such as compact TIFF files, enumerates all the tags in TIFF and Exif files, and deletes a tag from TIFF and Exif files.

LEADTOOLS supports read a comment from a file at a specific location.

LEADTOOLS has added functionality that enables or disables automatically inserting CLEAR codes during LZW compression. Saving LEAD TIFF LZW files uses the standard LZW compression, which uses CLEAR codes. Some IBM decoders cannot handle early CLEAR codes.

LEADTOOLS provides functionality for compressing and decompressing ABIC images in buffers.

LEADTOOLS has improved the annotation toolkit by adding the following new features:

New functionality allows the user to extract information from annotation objects.

Several methods for manipulating annotation objects so they are flipped, reversed, or rotated.

Improve the annotation objects displaying and manipulating; such as; alter the object’s display order within the container, perform geometric transformations on an annotation, set the color display options of any annotation object, set the bitmap transparency if the annotation object(s) are Stamp or Point.

LEADTOOLS now supports the following file formats:

File Formats: JBIG2 Format (JB2)

File Formats: ABIC Format (ABIC, ICA)

File Formats: Mixed Raster Content Format (MRC)

New properties, methods and events:

The following list is the new properties, methods and events in version 14.5.

Annotation

AnnTextEdit method

AnnCalibrateRuler method

AnnSetOptions method

AnnGetOptions method

AnnSetRotateOptions method

AnnGetRotateOptions method

AnnShowRotateHandles property

AnnSetTextOptions method

AnnGetTextOptions method

AnnShowText property

AnnShowBorder property

AnnTextColor property

AnnAutoSnapCursor property

AnnGetFillModeExt method

AnnSetFillModeExt method

AnnFillMode property

AnnAlpha property

MRC

AutoSegmentExt method (ILEADRasterMrc)

MaskCoder property (ILEADRasterIO)

PictureCoder property (ILEADRasterIO)

Grayscale2BitCoder property (ILEADRasterIO)

Grayscale8BitCoder property (ILEADRasterIO)

Grayscale8BitQFactor property (ILEADRasterIO)

Text2BitCoder property (ILEADRasterIO)

PictureQFactor property (ILEADRasterIO)

MRCRasterCount property (ILEADRasterIO)

MRCRaster property (ILEADRasterIO)

SaveList method (ILEADRasterIO)

SegmentExt method (ILEADRasterMrc)

Using the Zoom View

ILEADRasterZoomView

AnnContainer property

BorderColor property

BorderStyle property

CalloutColor property

CalloutPenStyle property

DstHeight property

DstLeft property

DstTop property

DstWidth property

EnableCallouts property

Enabled property

ForceDst property

Index property

PenStyle property

SrcBorderColor property

SrcBorderStyle property

SrcHeight property

SrcLeft property

SrcPenStyle property

SrcTop property

SrcWidth property

ZoomFactor property

ILEADRasterView

CreateZoomView method

DestroyZoomView method

GetZoomView method

HasZoomView property

UpdateZoomView method

ZoomViewsCount property

Mask Image from a Region

CreateMaskFromRgn method

MaskBitmap property

SetRgnFromMask method

Image Optimization

DefaultOptions method

DirectoryInfo property

Distance property

EnableMethodErrors property

FilePercent property

JPEGColorSpace property

JPEGQFactor property

OnOptimize Event

OnOptimizeDir Event

OptimizeBuffer method

OptimizeDir method

OptimizedFileName property

OptimizeOptions property

OptimizingError property

OrginalFileName property

Percent property

PickSamePalette property

PNGQFactor property

StatusCode property

TotalFolderFilesCount property

TotalPercent property

GeoKeys

SetGeoKey method

GetGeoKey method

GeoKeyType property

GeoKeyCount property

GeoKeyData property

WriteFileGeoKey method

ReadFileGeoKey method

EnumFileGeoKeys method

EnumGeoKeys event

StopFireEnumGeoKeys property

Extracting Bitmaps From A Series

Slice method

OnSliceBitmap event

SliceDeskewAngle property

ContinueSlicing property

ICC Profile

LoadICCProfile method

LoadICCProfile2 method

SaveICCProfile method

SaveICCProfile2 method

Compressed PDF File

BackGroundThreshold property

CleanSize property

ColorThreshold property

CombineThreshold property

EnableAddSegment property

EnableMethodErrors property

Flags property

ImageQuality property

MRCSegmentInfo property

OutputQuality property

PDFCompEvent event

PDFCompFree method

PDFCompInit method

PDFCompInsertMRC method

PDFCompInsertNormal method

PDFCompInsertSegments method

PDFCompSetCompression method

PDFCompWrite method

SegmentBottom property

SegmentColors property

SegmentColorsCount property

SegmentLeft property

SegmentQuality property

SegmentRight property

SegmentTop property

SegmentType property

UserSegmentInfo property

UserSegmentInfoCount property

Image List Control

ExportBitmapList method

ImportBitmapList method

SortExt method

ExportedBitmapList property

JBIG2 File Saving Options

JBIG2GBATX1 property

JBIG2GBATY1 property

JBIG2GBATX2 property

JBIG2GBATY2 property

JBIG2GBATX3 property

JBIG2GBATY3 property

JBIG2GBATX4 property

JBIG2GBATY4 property

JBIG2TemplateType property

JBIG2SaveFlags property

TXT Files Loading Options

TXTBold property

TXTBottomMarg property

TXTEnabled property

TXTFaceName property

TXTFontColor property

TXTFontSize property

TXTHighlight property

TXTItalic property

TXTLeftMarg property

TXTPaperHeight property

TXTPaperWidth property

TXTRightMarg property

TXTStrikeThrough property

TXTTopMarg property

TXTUnderLine property

Image Processing Functionality

AdjustTint method

BricksTexture method

Canvas method

Clouds method

ColoredBall property

ColoredBallsCount property

ColoredBalls method

ColoredPencil method

ColorHalfTone method

CorrelationList method

CorrelationListCount property

CorrelationListIndex property

CorrelationListMaxPoints property

CorrelationListX property

CorrelationListY property

DeskewExt method

DeskewExtAngle property

DiffuseGlow method

DisplaceMap method

GammaCorrectExt method

HalfTonePattern method

HighPassFilter method

MaskConvolution method

MosaicTiles method

Offset method

Perlin method

Perspective method

PerspectivePointsX property

PerspectivePointsY property

PlasmaFilter method

Pointillist method

RomanMosaic method

ShiftAmount property

ShiftMinimumToZero method

ShiftZeroToNegative method

Vignette method

ZigZag method

CMYK TIFF Files

CMYKRasterCount property

LoadFileCMYKArray method

SaveFileCMYKArray method

CMYKRaster property

EnablePaintCMYKArray property

RasterIO property

Handling TIFF and Exif Files

CompactFile method

DeleteTag method

EnumFileTags method

EnumTags event

StopFireEnumTags property

Reading a comment from a file at a specific location

ReadFileCommentOffset method

Miscellaneous

AnnEnableZoomView property

EnableLoadInfoEvent property

EncodeABIC method

DecodeABIC method

FastLoad property

ColorSpace property

DoubleBuffer property

IgnoreViewPerspective property

LoadStatus property

LZWAutoClear property

ReadTagMemory method

SetMinMaxBits method

UseFastConversion property

vType property


Changes from Version 13 to Version 14

LEADTOOLS COM now supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

LEADTOOLS now supports a new ILEADRasterVariant object.

The Common Dialog functionality has been removed from this help file and is presented in the new LEADTOOLS Common Dialog COM objects help file. For information on the new version 14 of the LEADTOOLS Common Dialog COM objects, refer to the LEADTOOLS Common Dialog COM Objects Help File .

LEADTOOLS now supports overlay bitmap drawing.

When loading PTOCA and AFP:PTOCA files, you can get and change the current values for the control options used by LEADTOOLS when loading a PTOCA file.

LEADTOOLS now lets you load embedded ICC profiles.

LEADTOOLS now supports the ability to instruct the toolkit to react dynamically depending on the bitmap size or the amount of available memory.

LEADTOOLS now can subtract the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps.

LEADTOOLS now supports double buffering; which is used to reduce flickering when painting windows.

LEADTOOLS now can detect the registration marks.

LEADTOOLS has improved the brightness and contrast functionality by adding the following new features:

Improve the brightness of an image by adding bitmaps within a bitmap list.

Increase or decrease the brightness in the bitmap by multiplying the colors in the specified bitmap.

Performs an adaptive contrast enhancement (ACE) to areas that are originally low in contrast.

Changes the distribution of the red, green, or blue channels.

Applies brightness, contrast and intensity adjustments to enhance the image tonal range.

Change the hue, saturation and brightness of all or specified colors in the image.

Adjust the hue, saturation and brightness of an image by applying one of five mathematical functions to a bitmaps pixel values: square, square root, log, sine, and cosine and then multiplying the results by specified factor.

Remap pixel values using a lookup table, or by applying a linear transformation.

Set up window leveling options for a bitmap using a lookup table or a linear transformation.

Converts a bitmap into a black and white image without changing its bits per pixel by using a local threshold value for each pixel of the image.

Wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).

Correcting nonuniform brightness.

LEADTOOLS has added Fourier Transforms to remove noise from video signals, CCDs, and harmonic noise like:

Herringbone patterns seen in video images

Sine wave patterns

Moiré patterns

Halftone patterns

Interference patterns

LEADTOOLS has improved the Annotation Automation Object by adding new features.

Functionality has been added with Version 14 that makes it possible for you to create custom annotations that look and behave in almost any way imaginable.

LEADTOOLS has improved the automated annotation by adding new six tools:

Curve Tool

Closed Curve Tool

RTF Tool

PolyRuler Tool

Encrypt Tool

Text Pointer Tool

In addition, LEADTOOLS has made the following Annotation improvements:

Ability to create handles on existing annotation object to provide a custom user-interface or manipulating annotations.

Ability to create custom annotations

Improved options for all text annotations including

  • control of alignment

  • ability to rotate text

  • support for text tokens

  • import text from a file

Ability to fix annotations so that they are attached to the window instead of the image. A fixed annotation will not change size or move when the underlying image is scrolled or moved.

Improved options for annotation names

Improved ruler options for polyruler, ruler, protractor, cross-product, including

  • Smart Unit display

  • Option to display tic-marks

Improved "Point Annotation" options

Ability to store user-defined data in an annotation object

Ability to change all cursor associated with annotation automation

LEADTOOLS now supports the following file formats:

CIN

DjVu

CRW

DCR

DCS ECW

FITS

KDC

PSP

RTF SFF

MrSID

TIFF-FX

WMZ

LEADTOOLS now supports The PLT/RTF Options.

LEADTOOLS now supports AutoCAD Color Scheme.

LEADTOOLS now can compare all or part of one bitmap with all the areas of the same dimensions in another bitmap and finds those areas that match according to the measure of correlation.

LEADTOOLS now can be used to improve the brightness of an image by adding bitmaps within a bitmap list.

LEADTOOLS now can increase or decrease the brightness in the bitmap by multiplying the colors in the specified bitmap.

LEADTOOLS now filters a specified bitmap to detect colors in a specified intensity range in all planes or a specific plane.

LEADTOOLS now can combine image data from the source bitmap (the slave) and the destination bitmap (the master), using a perspective warp.

LEADTOOLS now supports linearizes the number of pixels locally in a bitmap, based on the specified color space.

LEADTOOLS now supports averaging the bitmaps in a list, eliminating random noise contained in the images.

LEADTOOLS now transforms the bitmap into a binary image.

LEADTOOLS now deinterlaces video source images by removing the black lines. It proceeds by merging lines in the image together and/or blending them together.

LEADTOOLS now smoothes the edges of a bitmap.

LEADTOOLS now can detect the edges in a bitmap by applying a statistical filter that analyzes the variations of colors in all directions around each pixel.

LEADTOOLS now can find the skeleton of regions or objects in a binary bitmap.

LEADTOOLS now converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with one or more new colors. Also it converts the image to a grayscale level by reducing the saturation of each color to zero.

LEADTOOLS now can removes holes from a bitmap region.

LEADTOOLS has improved the artistic effects by adding the following new features:

Adds shadows to a bitmap, letting you specify the threshold value, the direction of the light source, and whether the shadows are colored or grayscale.

Adds effects that simulate random color changes, scratches, dust and pits, making a bitmap look like it was made from an old film.

Splits the image into square or rectangular blocks. If the blocks are square, rotates each block by 0, 90, 180, or 270 degrees. If the blocks are rectangular, flips the blocks around the X-axis and Y-axis.

Adds light to the bitmap according to a function-based distribution. This functional light will be generated by one of the following methods: linear, quadratic, sine, cosine, or using freehand points.

Splits the image into square blocks and randomizes these blocks inside the image.

Divides the image into a certain number of rings. Each ring is rotated according to a rotate angle. The rotate angle for each ring will be chosen randomly by the function or can be passed to the function.

Adds a pseudo-3D wave effect to the bitmap by drawing horizontal lines across the bitmap and basing each lines height at each point on its brightness at that point.

Divides the bitmap into segments where each segments pixels have approximately the same color (homogenous color).

LEADTOOLS now can combine image data from the mask bitmap and underlay bitmap with an underlay effect.

Wraps the bitmap along the inside or outside of an arc pattern.

Warps the bitmap to a cylindrical shape.

Shears the bitmap by the wave drawn using amplitude values

Distorts the bitmap by the wave drawn using amplitude values

Makes a bitmap look like it was painted by an impressionist painter.

Divides the bitmap into rectangular or circular cells and then recreates the image using those cells filled with the minimum, maximum, or average pixel value, depending upon the effect that was set.

Converts the bitmap from rectangular to polar coordinates and vice versa.

Warps the bitmap by pinching it toward the center or expanding the bitmap away from its center.

Rotates the bitmap pixels around a center point.

Distorts a bitmap using a wave radiating from the specified center.

Warps the image in concentric rings.

Warps the image around a 3D spherical shape.

Produces a swirl pattern by rotating the bitmap the specified number of degrees about the specified point.

Distorts the bitmap with two perpendicular waves at the specified angle and with the specified wave type.

Creates thin lines, directed along the specified angle, on the specified bitmap.

Blurs the bitmap along radial lines starting from the specified center point.

Distorts the bitmap with a wave zoomed from the specified center.

Draws a water wave effect

LEADTOOLS has improved the adjusting colors in an image by adding the following new features:

Performs specific Mathematical or logical operations on the colors of a bitmap.

Replaces specified colors by adjusting values of hue, saturation and brightness.

Using any one of eight color spaces, resets those bitmaps pixel component values that fall inside or outside of a specified range.

Changes the distribution of the red, green, or blue channels.

Colors an 8, 12 or 16-bit grayscale bitmap. The function changes the color bits/pixel of the bitmap from the specified formats into 24-bit RGB format.

Selects a specified number of bits of an 8, 12 or 16-bit grayscale bitmap and puts them into a mask, then colors the bitmap depending on the mask. This can show bitmap variances depending on user-defined conditions.

Selects a specified number of bits from an 8, 12 or 16-bit grayscale bitmap into a mask and places the mask in a new 8, 12 or 16-bit grayscale bitmap.

Makes dark values darker and light values lighter to automatically enhance shadows and brighten the image.

Adds a three-dimensional texture pattern by applying the bump image to the destination image.

Rebalances the colors in a bitmap in order to make color adjustments and to correct images which have more color than others.

Applies color leveling to an image. It changes the image shadows, midtones and highlights.

Remaps the bitmap into a collection of rotated rectangles (cubic faces), in the Cubist style.

Draws a star on the bitmap.

Simulates painting an image with the watercolor dry brush technique.

Wraps the bitmap onto a 3D plane.

Wraps the bitmap along its radius on a 3D surface.

Divides the image into cells and makes it look as if it is being viewed through glass blocks.

Makes colored edges shine with a neon-like glow.

Simulates the secondary reflections caused when bright lights are facing the camera lens.

Adds many spots of directed light sources to the bitmap.

Lightens or darkens all or part of a bitmap by remapping the pixel values.

Reflects the bitmap on an ocean surface.

Corrects color values by shifting the sample colors to the target colors.

Places the bitmap on parallel planes along the Z-axis bent towards a center point.

Places the bitmap on parallel planes along the Z-axis.

Corrects color values by shifting the sample colors to the target colors.

Changes the color of a bitmap by altering the definitions of one or more colors used by the bitmap.

Smoothes the rough edges in the bitmap.

applies color leveling to an image and changes the image's shadows, midtones and highlights.

Places the bitmap inside a tunnel along the Z-axis.

Changed properties, methods and events:

The following methods and events take new parameters:

AutoSegment method (ILEADRasterMrc)

EnumSegments event (ILEADRasterMrc)

Save method (ILEADRasterMrc)

SaveT44 method (ILEADRasterMrc)

The following property has new possible values:

MaskCoder property (ILEADRasterMrc)

The following methods have changed as indicated:

The BackgroundCoder property has become the PictureCoder property (ILEADRasterMrc).

The BackgroundQFactor property has become the PictureQFactor property (ILEADRasterMrc).

The SetStripeSegment method has become the CreateNewSegment method (ILEADRasterMrc).

The UpdateSegmentData method has become the SetSegmentData method (ILEADRasterMrc).

New objects:

ILEADRasterVariant

New enumeration

BitmapCompressionConstants

New properties, methods and events:

The following list is the new properties, methods and events in version 14.

AdaptiveContrast method (ILEADRasterProcess)

AddMessage method (ILEADRasterProcess)

AddShadow Method (ILEADRasterProcess)

AddWeightedBitmaps method (ILEADRasterProcess)

Aging method (ILEADRasterProcess)

Amplitudes property (ILEADRasterProcess)

AmplitudesCount property (ILEADRasterProcess)

AnnAddUserHandle method (ILEADRasterAnnotation)

AnnAdjustPoint method (ILEADRasterAnnotation)

AnnAutoCursor property (ILEADRasterAnnotation)

AnnAutoHilightPen property (ILEADRasterAnnotation)

AnnAutoText property (ILEADRasterAnnotation)

AnnChangeUserHandle method (ILEADRasterAnnotation)

AnnClearTokenTable method (ILEADRasterAnnotation)

AnnConvert method (ILEADRasterAnnotation)

AnnDefine2 method (ILEADRasterAnnotation)

AnnDeleteTokenTable method (ILEADRasterAnnotation)

AnnDeleteUserHandle method (ILEADRasterAnnotation)

AnnEncryptApply method (ILEADRasterAnnotation)

AnnEncryptOptions property (ILEADRasterAnnotation)

AnnEnumerateHandle method (ILEADRasterAnnotation)

AnnEnumerateTextToken method (ILEADRasterAnnotation)

AnnError property (ILEADRasterAnnotation)

AnnFixed property (ILEADRasterAnnotation)

AnnGetDistance2 method (ILEADRasterAnnotation)

AnnGetEncryptOptions method (ILEADRasterAnnotation)

AnnGetNameOptions method (ILEADRasterAnnotation)

AnnGetPointOptions method (ILEADRasterAnnotation)

AnnGetSecondaryMetaFile method (ILEADRasterAnnotation)

AnnGetUserData method (ILEADRasterAnnotation)

AnnGetUserHandle method (ILEADRasterAnnotation)

AnnGetUserHandles method (ILEADRasterAnnotation)

AnnHandle property (ILEADRasterAnnotation)

AnnHitTestExt method (ILEADRasterAnnotation)

AnnInsertTokenTable method (ILEADRasterAnnotation)

AnnIsFixedRect property (ILEADRasterAnnotation)

AnnNameOptions property (ILEADRasterAnnotation)

AnnotationName property (ILEADRasterAnnNameOptions)

AnnPointOptions property (ILEADRasterAnnotation)

AnnPopFixedState method (ILEADRasterAnnotation)

AnnPredefinedRaster property (ILEADRasterAnnotation)

AnnPushFixedState method (ILEADRasterAnnotation)

AnnRestrictCursor method (ILEADRasterAnnotation)

AnnRotateAngle property (ILEADRasterAnnotation)

AnnRTFText property (ILEADRasterAnnotation)

AnnSetEncryptOptions method (ILEADRasterAnnotation)

AnnSetNameOptions method (ILEADRasterAnnotation)

AnnSetPointOptions method (ILEADRasterAnnotation)

AnnSetUserData method (ILEADRasterAnnotation)

AnnTextAlign property (ILEADRasterAnnotation)

AnnTextExpandTokens property (ILEADRasterAnnotation)

AnnTextPointerFixed property (ILEADRasterAnnotation)

AnnTextRotate property (ILEADRasterAnnotation)

AnnTicMarkLength property (ILEADRasterAnnotation)

ApplyLinearModalityLUT Method (ILEADRasterProcess)

ApplyLinearVOILUT Method (ILEADRasterProcess)

ApplyMathLogic method (ILEADRasterProcess)

ApplyModalityLUT Method (ILEADRasterProcess)

ApplyModalityLUT2 Method (ILEADRasterProcess)

ApplyTransformationParameters method (ILEADRasterProcess)

ApplyVOILUT Method (ILEADRasterProcess)

ApplyVOILUT2 Method (ILEADRasterProcess)

AutoBinary method (ILEADRasterProcess)

AutoColorLevel method (ILEADRasterProcess)

BackNameColor property (ILEADRasterAnnNameOptions)

Bending method (ILEADRasterProcess)

BitmapMaxValue property (ILEADRasterProcess)

BitmapMean property (ILEADRasterProcess)

BitmapMedian property (ILEADRasterProcess)

BitmapMinValue property (ILEADRasterProcess)

BitmapPixelsCount property (ILEADRasterProcess)

BitmapSelectedPixelPercent property (ILEADRasterProcess)

BitmapStandardDeviation property (ILEADRasterProcess)

BitmapTotalPixelCount property (ILEADRasterProcess)

Blue property (ILEADBalanceData)

BlueGamma property (ILEADRasterProcess)

BlueMaxInput property (ILEADRasterProcess)

BlueMaxOutput property (ILEADRasterProcess)

BlueMinInput property (ILEADRasterProcess)

BlueMinOutput property (ILEADRasterProcess)

BooleanItemValue property (ILEADRasterVariant)

BooleanValue property (ILEADRasterVariant)

Bottom property (ILEADMarkInfo)

BottomPreviousClip property (ILEADRasterAnnotation)

BumpMap method (ILEADRasterProcess)

ChannelMix method (ILEADRasterProcess)

ClientPointX property (ILEADRasterAnnotation)

ClientPointY property (ILEADRasterAnnotation)

ClientX property (ILEADRasterAnnHandle)

ClientX property (ILEADRasterAnnHandleInfo)

ClientY property (ILEADRasterAnnHandle)

ClientY property (ILEADRasterAnnHandleInfo)

ColorIntensityBalance method (ILEADRasterProcess)

ColorizeGray method (ILEADRasterProcess)

ColorLevel method (ILEADRasterProcess)

ColorReplace Method (ILEADRasterProcess)

ColorThreshold Method (ILEADRasterProcess)

CombineFactor property (ILEADRasterMrc)

CombineFlags property (ILEADRasterMrc)

CombineSegments method (ILEADRasterMrc)

ComponentFlags property (ILEADRasterProcess)

ComponentMaxRange property (ILEADRasterProcess)

ComponentMinRange property (ILEADRasterProcess)

ContainerPointX property (ILEADRasterAnnotation)

ContainerPointY property (ILEADRasterAnnotation)

ContainerX property (ILEADRasterAnnHandle)

ContainerX property (ILEADRasterAnnHandleInfo)

ContainerY property (ILEADRasterAnnHandle)

ContainerY property (ILEADRasterAnnHandleInfo)

ContoursCount property (ILEADRasterProcess)

ContourX property (ILEADRasterProcess)

ContourY property (ILEADRasterProcess)

ContrastBrightIntensity method (ILEADRasterProcess)

ConvertUnsignedToSigned Method (ILEADRasterProcess)

CopyMarkers method (ILEADRasterIO)

CopySegmentationHandle method (ILEADRasterMrc)

Correlation method (ILEADRasterProcess)

CorrelationCount property (ILEADRasterProcess)

CorrelationMaxPoints property (ILEADRasterProcess)

CorrelationX property (ILEADRasterProcess)

CorrelationY property (ILEADRasterProcess)

Count property (ILEADMarkers)

CountLUTColors method (ILEADRasterProcess)

CreateMarkers method (ILEADMarkers)

Cubism method (ILEADRasterProcess)

Cylindrical method (ILEADRasterProcess)

Deinterlace method (ILEADRasterProcess)

DeleteMarker method (ILEADMarkers)

DeleteMarkerAt method (ILEADMarkers)

Desaturate method (ILEADRasterProcess)

Description property (ILEADRasterAnnotation)

Deskew method (ILEADRasterProcess)

DetectedMarkCount property (ILEADMarkInfo)

DetectedMarkPointX property (ILEADMarkInfo)

DetectedMarkPointY property (ILEADMarkInfo)

DiceEffect method (ILEADRasterProcess)

DigitalSubtract method (ILEADRasterProcess)

DirectionEdgeStatistical Method (ILEADRasterProcess)

Directory property (ILEADRasterProcess)

DiscreteFourierTransformation Method (ILEADRasterProcess)

DispatchValue property (ILEADRasterVariant)

DisplayFourierTransformation Method (ILEADRasterProcess)

Distance property (ILEADRasterAnnotation)

DistanceCount property (ILEADRasterAnnotation)

DoubleItemValue property (ILEADRasterVariant)

DoubleValue property (ILEADRasterVariant)

DrawStar method (ILEADRasterProcess)

Dry method (ILEADRasterProcess)

DynamicBinary method (ILEADRasterProcess)

EdgeDetectEffect method (ILEADRasterProcess)

EdgeDetectStatistical method (ILEADRasterProcess)

EffectCycles property (ILEADRasterView)

EffectSpeed property (ILEADRasterView)

Element property (ILEADMarkers)

ElementCount property (ILEADMarkers)

EnableAdjust property (ILEADRasterAnnotation)

EnableClearDecryptorKey property (ILEADRasterAnnEncryptOption)

EnableClearEncryptorKey property (ILEADRasterAnnEncryptOption)

EnableEncryptor property (ILEADRasterAnnEncryptOption)

EnableFontBold property (ILEADRasterAnnNameOptions)

EnableFontItalic property (ILEADRasterAnnNameOptions)

EnableFontStrikeOut property (ILEADRasterAnnNameOptions)

EnableFontUnderLine property (ILEADRasterAnnNameOptions)

EnableMethodErrors property (ILEADRasterVariant)

EnableMouseWheel Property (ILEADRasterView)

EnableNameRestrict property (ILEADRasterAnnNameOptions)

EnableNeverEncrypted property (ILEADRasterAnnEncryptOption)

EnableOLEDragMethod property (ILEADRasterView)

EnableOLEDragMethod property (ImageList Control)

EnablePointFixedSize property (ILEADRasterAnnPointOption)

EnablePointTransparentFill property (ILEADRasterAnnPointOption)

EnablePointUseBitmap property (ILEADRasterAnnPointOption)

EnableRestrictToContainer property (ILEADRasterAnnotation)

EnableSaveDecryptorKey property (ILEADRasterAnnEncryptOption)

EnableSaveEncryptorKey property (ILEADRasterAnnEncryptOption)

EnableShowName property (ILEADRasterAnnNameOptions)

EnableUseDefaultCursor property (ILEADRasterView)

EnableUseDefaultCursor property (ImageList Control)

EnableVisible property (ILEADRasterAnnHandle)

EnableVisible property (ILEADRasterAnnHandleInfo)

EncryptRaster property (ILEADRasterAnnEncryptOption)

EnumerateHandle Event (LEADRasterAnnotation)

EnumerateMarkers event (ILEADMarkers)

EnumerateTextTokenTable Event (LEADRasterAnnotation)

EnumMarkers method (ILEADMarkers)

Error property (ILEADRasterVariant)

ExtractMessage method (ILEADRasterProcess)

FaceNameColor property (ILEADRasterAnnNameOptions)

Factor property (ILEADRasterProcess)

FactorCount property (ILEADRasterProcess)

FastFourierTransformation Method (ILEADRasterProcess)

FeretsDiameterLength property (ILEADRasterProcess)

FeretsFirstIndex property (ILEADRasterProcess)

FeretsSecondIndex property (ILEADRasterProcess)

FileName property (ILEADRasterProcess)

FillColor property (ILEADRasterAnnHandle)

FillColor property (ILEADRasterAnnHandleInfo)

Flags property (ILEADRasterAnnEncryptOption)

Flags property (ILEADRasterAnnHandle)

Flags property (ILEADRasterAnnNameOptions)

Flags property (ILEADRasterAnnotation)

Flags property (ILEADRasterAnnPointOption)

FloatItemValue property (ILEADRasterVariant)

FloatValue property (ILEADRasterVariant)

FontName property (ILEADRasterAnnNameOptions)

FontSize property (ILEADRasterAnnNameOptions)

FreeFourierTransformation Method (ILEADRasterProcess)

FreeHandShear method (ILEADRasterProcess)

FreeHandWave method (ILEADRasterProcess)

FreePlaneBend method (ILEADRasterProcess)

FreeRadBend method (ILEADRasterProcess)

FrequencyFilter Method (ILEADRasterProcess)

FrequencyFilterMask Method (ILEADRasterProcess)

FunctionalLight method (ILEADRasterProcess)

GetBitmapStatisticsInfo Method (ILEADRasterProcess)

GetCurvePoints method (ILEADRasterProcess)

GetFeretsDiameter Method (ILEADRasterProcess)

GetLinearVOILUT method (ILEADRasterProcess)

GetMarker method (ILEADMarkers)

GetMarkers method (ILEADMarkers)

GetMarksCenterMass method (ILEADRasterProcess)

GetObjectInfo Method (ILEADRasterProcess)

GetRgnContourPoints Method (ILEADRasterProcess)

GetRgnPerimeterLength Method (ILEADRasterProcess)

GetTransformationParameters method (ILEADRasterProcess)

GlassEffect method (ILEADRasterProcess)

GlowFilter method (ILEADRasterProcess)

GrayColorBlue property (ILEADRasterProcess)

GrayColorCount property (ILEADRasterProcess)

GrayColorGreen property (ILEADRasterProcess)

GrayColorRed property (ILEADRasterProcess)

GrayColorThreshold property (ILEADRasterProcess)

Grayscale2BitCoder property (ILEADRasterMrc)

Grayscale8BitCoder property (ILEADRasterMrc)

Grayscale8BitQFactor property (ILEADRasterMrc)

GrayScaleBlue property (ILEADRasterProcess)

GrayScaleGreen property (ILEADRasterProcess)

GrayScaleRed property (ILEADRasterProcess)

GrayScaleToDuotone method (ILEADRasterProcess)

GrayScaleToMultitone Method (ILEADRasterProcess)

Green property (ILEADBalanceData)

GreenGamma property (ILEADRasterProcess)

GreenMaxInput property (ILEADRasterProcess)

GreenMaxOutput property (ILEADRasterProcess)

GreenMinInput property (ILEADRasterProcess)

GreenMinOutput property (ILEADRasterProcess)

Halftone method (ILEADRasterProcess)

HandleID property (ILEADRasterAnnotation)

HandleIndex property (ILEADRasterAnnotation)

hCursor property (ILEADRasterAnnHandle)

hCursor property (ILEADRasterAnnHandleInfo)

Height property (ILEADMarkInfo)

Highlight property (ILEADRasterProcess)

HolesRemovalBitmapRgn method (ILEADRasterProcess)

HSICount property (ILEADRasterProcess)

HSIHue property (ILEADRasterProcess)

HSIInnerHigh property (ILEADRasterProcess)

HSIInnerLow property (ILEADRasterProcess)

HSIIntensity property (ILEADRasterProcess)

HSIOuterHigh property (ILEADRasterProcess)

HSIOuterLow property (ILEADRasterProcess)

HSISaturation property (ILEADRasterProcess)

HueSaturationIntensity Method (ILEADRasterProcess)

ID property (ILEADRasterAnnHandle)

ID property (ILEADRasterAnnHandleInfo)

ImageType property (ILEADRasterMrc)

Impressionist method (ILEADRasterProcess)

Index property (ILEADRasterAnnHandleInfo)

InitFourierTransformation Method (ILEADRasterProcess)

InsertMarker method (ILEADMarkers)

IntensityDetect method (ILEADRasterProcess)

IsRegistrationMark method (ILEADRasterProcess)

ItemCount property (ILEADRasterVariant)

Key property (ILEADRasterAnnEncryptOption)

Left property (ILEADMarkInfo)

LeftPreviousClip property (ILEADRasterAnnotation)

LensFlare method (ILEADRasterProcess)

Light method (ILEADRasterProcess)

LightAngle property (ILEADRasterProcess)

LightAvr property (ILEADRasterProcess)

LightBlueAmplitude property (ILEADRasterProcess)

LightControl method (ILEADRasterProcess)

LightFlags property (ILEADRasterProcess)

LightFrequency property (ILEADRasterProcess)

LightGreenAmplitude property (ILEADRasterProcess)

LightLowerAvr property (ILEADRasterProcess)

LightPhase property (ILEADRasterProcess)

LightRedAmplitude property (ILEADRasterProcess)

LightUpperAvr property (ILEADRasterProcess)

LightXOrigin property (ILEADRasterProcess)

LightYOrigin property (ILEADRasterProcess)

LoadOffset method (ILEADRasterIO)

LoadSegmentation method (ILEADRasterMrc)

LocalHistoEqualize method (ILEADRasterProcess)

LongItemValue property (ILEADRasterVariant)

LongValue property (ILEADRasterVariant)

LUTColorsCount property (ILEADRasterProcess)

LUTColorsFirstIndex property (ILEADRasterProcess)

MagGlassCursor event (ILEADRasterView)

MagGlassPaintContrast property (ILEADRasterView)

MagGlassPaintGamma property (ILEADRasterView)

MagGlassPaintIntensity property (ILEADRasterView)

Mark property (ILEADRasterProcess)

MarkCMPointX property (ILEADRasterProcess)

MarkCMPointY property (ILEADRasterProcess)

MarkPointX property (ILEADRasterProcess)

MarkPointY property (ILEADRasterProcess)

MarksCount property (ILEADRasterProcess)

MasterGamma property (ILEADRasterProcess)

MasterMaxInput property (ILEADRasterProcess)

MasterMaxOutput property (ILEADRasterProcess)

MasterMinInput property (ILEADRasterProcess)

MasterMinOutput property (ILEADRasterProcess)

MathFunction Method (ILEADRasterProcess)

MaxScale property (ILEADMarkInfo)

Message property (ILEADRasterProcess)

MidTone property (ILEADRasterProcess)

MinScale property (ILEADMarkInfo)

MouseWheel event (ILEADRasterView)

Multiply method (ILEADRasterProcess)

MultiScaleEnhancement method (ILEADRasterProcess)

MultitoneColors property (ILEADRasterProcess)

MultitoneGradient property (ILEADRasterProcess)

NumberOfExpectedMarks property (ILEADMarkInfo)

ObjectHitHandle property (ILEADRasterAnnotation)

ObjectOrientationAngle property (ILEADRasterProcess)

ObjectRoundness property (ILEADRasterProcess)

ObjectXPos property (ILEADRasterProcess)

ObjectYPos property (ILEADRasterProcess)

Ocean method (ILEADRasterProcess)

OLECompleteDrag event (ILEADRasterView)

OLECompleteDrag event (ImageList Control)

OLEDragCursor property (ILEADRasterView)

OLEDragCursor property (ImageList Control)

OLEDragOver event (ILEADRasterView)

OLEDragOver event (ImageList Control)

OLEGiveFeedback event (ILEADRasterView)

OLEGiveFeedback event (ImageList Control)

OLEStartDrag event (ILEADRasterView)

OLEStartDrag event (ImageList Control)

OnAnnChange event (ILEADRasterAnnotation)

OnAnnClicked event (ILEADRasterAnnotation)

OnAnnCreate event (ILEADRasterAnnotation)

OnAnnDestroy event (ILEADRasterAnnotation)

OnAnnDrawn event (ILEADRasterAnnotation)

OnAnnEnumerate event (ILEADRasterAnnotation)

OnAnnHyperlink event (ILEADRasterAnnotation)

OnAnnHyperlinkMenu event (ILEADRasterAnnotation)

OnAnnLocked event (ILEADRasterAnnotation)

OnAnnMenu event (ILEADRasterAnnotation)

OnAnnMouseDown event (ILEADRasterAnnotation)

OnAnnMouseMove event (ILEADRasterAnnotation)

OnAnnMouseUp event (ILEADRasterAnnotation)

OnAnnSelect event (ILEADRasterAnnotation)

OnAnnToolChecked event (ILEADRasterAnnotation)

OnAnnToolDestroy event (ILEADRasterAnnotation)

OnAnnUnlocked event (ILEADRasterAnnotation)

OnAnnUserMenu event (ILEADRasterAnnotation)

OnEnumerateHandle Event (LEADRasterAnnotation)

OnEnumerateTextTokenTable Event (LEADRasterAnnotation)

Password property (ILEADRasterProcess)

PDFInitDir property(ILEADRasterIO)

PenColor property (ILEADRasterAnnHandle)

PenColor property (ILEADRasterAnnHandleInfo)

Pixelate method (ILEADRasterProcess)

Plane method (ILEADRasterProcess)

PlaneBend method (ILEADRasterProcess)

PLTPenColor property (ILEADRasterIO)

PLTPenWidth property (ILEADRasterIO)

PointBorderColor property (ILEADRasterAnnPointOption)

PointFillColor property (ILEADRasterAnnPointOption)

PointIndex property (ILEADRasterAnnotation)

PointRadius property (ILEADRasterAnnPointOption)

PointRaster property (ILEADRasterAnnPointOption)

PointsCount property (ILEADRasterAnnotation)

Polar method (ILEADRasterProcess)

PositionResult property (ILEADRasterAnnotation)

PTKResolution property (ILEADRasterIO)

Punch method (ILEADRasterProcess)

PuzzleEffect method (ILEADRasterProcess)

RadialBlur method (ILEADRasterProcess)

RadWave method (ILEADRasterProcess)

Red property (ILEADBalanceData)

RedGamma property (ILEADRasterProcess)

RedMaxInput property (ILEADRasterProcess)

RedMaxOutput property (ILEADRasterProcess)

RedMinInput property (ILEADRasterProcess)

RedMinOutput property (ILEADRasterProcess)

ReferencePointsX property (ILEADRasterProcess)

ReferencePointsY property (ILEADRasterProcess)

RemapHueTablesSize property (ILEADRasterProcess)

ReplaceColorFuzziness property (ILEADRasterProcess)

ReplaceColorsCount property (ILEADRasterProcess)

ReplaceColorValue property (ILEADRasterProcess)

RevEffect Method (ILEADRasterProcess)

RgnPerimeterLength property (ILEADRasterProcess)

Right property (ILEADMarkInfo)

RightPreviousClip property (ILEADRasterAnnotation)

RingEffect method (ILEADRasterProcess)

Ripple method (ILEADRasterProcess)

RTFBottomMarg property (ILEADRasterIO)

RTFLeftMarg property (ILEADRasterIO)

RTFPaperHeight property (ILEADRasterIO)

RTFPaperWidth property (ILEADRasterIO)

RTFRightMarg property (ILEADRasterIO)

RTFTextLength property (ILEADRasterAnnotation)

RTFTopMarg property (ILEADRasterIO)

RulerUnit property (ILEADRasterAnnotation)

SampleTarget method (ILEADRasterProcess)

SaveSegmentation method (ILEADRasterMrc)

SearchRegMarks method (ILEADRasterProcess)

Segment Method (ILEADRasterProcess)

SelectData method (ILEADRasterProcess)

SelectiveColor method (ILEADRasterProcess)

SelectiveColorBlack property (ILEADRasterProcess)

SelectiveColorCyan property (ILEADRasterProcess)

SelectiveColorMagenta property (ILEADRasterProcess)

SelectiveColorYellow property (ILEADRasterProcess)

Sensitivity property (ILEADRasterMrc)

SetMagGlassPos method (ILEADRasterView)

SetMarkers method (ILEADRasterIO)

SetRgnBorder method (ILEADRaster)

Shadow property (ILEADRasterProcess)

Shape property (ILEADRasterAnnHandle)

Shape property (ILEADRasterAnnHandleInfo)

ShiftData method (ILEADRasterProcess)

ShortItemValue property (ILEADRasterVariant)

ShortValue property (ILEADRasterVariant)

ShowMagGlass method (ILEADRasterView)

Skeleton method (ILEADRasterProcess)

SmartUnit property (ILEADRasterAnnotation)

SmoothEdges method (ILEADRasterProcess)

Spherize method (ILEADRasterProcess)

StartSegmentation method (ILEADRasterMrc)

StartX property (ILEADRasterProcess)

StartY property (ILEADRasterProcess)

StopFireEnumerateHandleEvent property (ILEADRasterAnnotation)

StopSegmentation method (ILEADRasterMrc)

StringItemValue property (ILEADRasterVariant)

StringValue property (ILEADRasterVariant)

SubtractBackground Method (ILEADRasterProcess)

Swirl method (ILEADRasterProcess)

TextureAlphaBlend method (ILEADRasterProcess)

Token property (ILEADRasterAnnotation)

TokenString property (ILEADRasterAnnotation)

TokenType property (ILEADRasterAnnotation)

Top property (ILEADMarkInfo)

TopPreviousClip property (ILEADRasterAnnotation)

TotalDistance property (ILEADRasterAnnotation)

Totalhandles property (ILEADRasterAnnHandleInfo)

TotalRulerUnit property (ILEADRasterAnnotation)

TotalSmartUnit property (ILEADRasterAnnotation)

TransformationAngle property (ILEADRasterProcess)

TransformedPointsX property (ILEADRasterProcess)

TransformedPointsY property (ILEADRasterProcess)

Tunnel method (ILEADRasterProcess)

Type property (ILEADMarkers)

Type property (ILEADMarkInfo)

Type property (ILEADRasterAnnHandleInfo)

Type property (ILEADRasterVariant)

UpdateMagGlassFromHandle method (ILEADRasterView)

UserFilter Method (ILEADRasterProcess)

UserFilterData property (ILEADRasterProcess)

UserFilterDivisor property (ILEADRasterProcess)

UserFilterFlags property (ILEADRasterProcess)

UserFilterHeight property (ILEADRasterProcess)

UserFilterOffset property (ILEADRasterProcess)

UserFilterWidth property (ILEADRasterProcess)

UserFilterXCenter property (ILEADRasterProcess)

UserFilterYCenter property (ILEADRasterProcess)

UserHandle property (ILEADRasterAnnotation)

UserHandleCount property (ILEADRasterAnnotation)

UserShape property (ILEADRasterProcess)

UserShapeCount property (ILEADRasterProcess)

UserWindowCenter property (ILEADRasterProcess)

UserWindowWidth property (ILEADRasterProcess)

Wave method (ILEADRasterProcess)

Width property (ILEADMarkInfo)

Wind method (ILEADRasterProcess)

WriteMetaData method (ILEADRasterIO)

X property (ILEADRasterAnnNameOptions)

XScale property (ILEADRasterProcess)

XTranslation property (ILEADRasterProcess)

Y property (ILEADRasterAnnNameOptions)

YScale property (ILEADRasterProcess)

YTranslation property (ILEADRasterProcess)

ZoomBlur method (ILEADRasterProcess)

ZoomWave method (ILEADRasterProcess)


Changes from Version 12.1 to Version 13

LEADTOOLS now supports region of interest in J2K files.

IMPORTANT NOTICE CONCERNING SUPPORT FOR ISIS DRIVERS:

LEADTOOLS TOOLKITS CONTAIN SUPPORT FOR ISIS® DRIVERS USING PIXEL TRANSLATIONS RUNTIME (PIXDFLTN. DLL) VERSION NUMBER 55.1.260.832 OR EARLIER ALLOWING LEADTOOLS TO DIRECTLY INTERFACE WITH THE ISIS DRIVERS.

LEADTOOLS TOOLKITS DO NOT DIRECTLY COMMUNICATE WITH ISIS ® DRIVERS USING PIXEL TRANSLATIONS RUNTIME (PIXDFLTN) VERSION NUMBER 56.*.*.* OR HIGHER. A LEADTOOLS APPLICATION WHICH OPERATES PROPERLY WITH THE EARLIER VINTAGE ISIS DRIVERS WILL CEASE TO OPERATE PROPERLY IF THE OLDER ISIS DRIVER IS REPLACED WITH A NEWER ISIS DRIVER REQUIRING THE PIXEL TRANSLATIONS RUNTIME DLL VERSION NUMBER 56.*.*.* OR HIGHER.

Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is now available in Document and Medical toolkits.

LEADTOOLS no longer provides the Netscape Plug In.

LEADTOOLS now supports the following file formats:

SCT (Scitex Continuous Tone Format)

PCL (Printer Command Language)

AFP

IOCA (Image Object Content Architecture)

Intergraph Format (ITG)

SHP (ESRI Shape Format)

CMW

LEADTOOLS reorders the specified annotation object more.

LEADTOOLS now supports a Mixed Raster Content module for support of images that contain mixed image and text components.

LEADTOOLS provides more support for getting and setting the background color of one or more annotation objects.

LEADTOOLS supports new features for a Protractor annotation objects.

LEADTOOLS provides more support for setting and getting the characteristic for an annotation object.

LEADTOOLS supports formatting for an annotation object.

LEADTOOLS supports editing for an annotation object.

LEADTOOLS supports new feature for a ruler objects.

LEADTOOLS can add motion blur to images.

LEADTOOLS provides support for removing red-eye from images.

LEADTOOLS supports an anti-aliasing filter.

LEADTOOLS can perform Gaussian blurring.

LEADTOOLS now supports loading and saving layers in PSD files.

New methods and properties let you combine images using a single opacity value, or varying opacity values. Using the varying opacity values creates a feathering appearance.

LEADTOOLS lets you add borders and frames to bitmaps.

LEADTOOLS provides support for determining whether a magnifying glass is attached to a window, a control or an object.

LEADTOOLS now supports loading and saving layers in PSD files.

LEADTOOLS now lets you get or set pixel data for 48 and 64-bit bitmaps.

The LEADTOOLS picturize capabilities have been extended to picturize an image using a single bitmap or a list of bitmaps.

LEADTOOLS now lets you create curved regions or add a curved region to an existing region.

LEADTOOLS can now resize bitmaps during the load process.

LEADTOOLS now lets you save bitmaps to files in memory.

An ImageList Control has been added to make working with and displaying a list of images simple.

You can now browse a directory for LEAD support images and generate thumbnails.

Support for ISIS scanning has been added.

New Borland C++ and Borland Delphi samples and tutorials were added.

The LEADTOOLS picturize capabilities have been extended to picturize an image using a single bitmap or a list of bitmaps.

Changed properties, methods and events:

The following methods have been changed from the previous version of LEADTOOLS:

AnnLoadMemory method (ILEADRasterAnnotation) takes 1 new parameter.

AnnLoadArray method (ILEADRasterAnnotation) takes 1 new parameter.

AnnSave method (ILEADRasterAnnotation) takes 2 new parameters.

AnnSaveArray method (ILEADRasterAnnotation) takes 2 new parameters.

AnnSaveMemory method (ILEADRasterAnnotation) takes 2 new parameters.

AnnDefine method (ILEADRasterAnnotation) takes a new flag.

HistoEqualize method (ILEADRasterProcess) takes 1 new parameter.

Halftone method (ILEADRasterProcess) takes 1 new parameter.

HistogramTable property (ILEADRasterProcess) iIndex parameter is now a long value.

LoadCompressed property (ILEADRasterIO) data type is now LoadCompressedConstants.

RemapTable property (ILEADRasterProcess) both the property and the parameter are now type long.

The rest of this topic lists the new properties, methods and events in version 13.

Annotation (Document/Medical Only)

AnnBoundingRectHeight property

AnnBoundingRectLeft property

AnnBoundingRectTop property

AnnBoundingRectWidth property

AnnBringToFront method

AnnCreateItem method

AnnCut method

AnnDeletePage method

AnnDeletePageArray method

AnnDeletePageMemory method

AnnFileInfo method

AnnFileInfoArray method

AnnFileInfoMemory method

AnnGetAngle method

AnnGetArea method

AnnGetAutoBackColor method

AnnGetBackColor method

AnnGetBitmap method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY method

AnnGetContainer method

AnnGetDistance method

AnnGetFillMode method

AnnGetFillPattern method

AnnGetFontBold method

AnnGetFontItalic method

AnnGetFontName method

AnnGetFontSize method

AnnGetFontStrikeThrough method

AnnGetFontUnderline method

AnnGetForeColor method

AnnGetGaugeLength method

AnnGetLineStyle method

AnnGetLineWidth method

AnnGetMetafile method

AnnGetName method

AnnGetNameOffsetX method

AnnGetNameOffsetY method

AnnGetNameRestrict method

AnnGetNodes method

AnnGetOffsetX method

AnnGetOffsetY method

AnnGetPolyFillMode method

AnnGetPredefinedMetafile method

AnnGetProtractorOptions method

AnnGetRgnHandle method

AnnGetROP2 method

AnnGetScalarX method

AnnGetScalarY method

AnnGetSecondaryBitmap method

AnnGetSelected method

AnnGetShowFlags method

AnnGetText method

AnnGetTopContainer method

AnnGetTransparent method

AnnGetTransparentColor method

AnnGetUnit method

AnnGetWnd method

AnnHitTest method

AnnInfoFormat property

AnnInfoTotalPages property

AnnInfoVersion property

AnnNameBoundingRectHeight property

AnnNameBoundingRectLeft property

AnnNameBoundingRectTop property

AnnNameBoundingRectWidth property

AnnNameRectHeight property

AnnNameRectLeft property

AnnNameRectTop property

AnnNameRectWidth property

AnnRemove method

AnnSelectPoint method

AnnSelectRect method

AnnSelectRectHeight property

AnnSelectRectLeft property

AnnSelectRectTop property

AnnSelectRectWidth property

AnnSendToBack method

AnnSetAutoBackColor method

AnnSetBackColor method

AnnSetBitmap method

AnnSetBitmapDpiX method

AnnSetBitmapDpiY method

AnnSetFillMode method

AnnSetFillPattern method

AnnSetFontBold method

AnnSetFontItalic method

AnnSetFontName method

AnnSetFontSize method

AnnSetFontStrikeThrough method

AnnSetFontUnderline method

AnnSetForeColor method

AnnSetGaugeLength method

AnnSetLineStyle method

AnnSetLineWidth method

AnnSetMetafile method

AnnSetName method

AnnSetNameOffsetX method

AnnSetNameOffsetY method

AnnSetNameRestrict method

AnnSetNodes method

AnnSetOffsetX method

AnnSetOffsetY method

AnnSetPoints method

AnnSetPolyFillMode method

AnnSetPredefinedMetafile method

AnnSetProtractorOptions method

AnnSetROP2 method

AnnSetScalarX method

AnnSetScalarY method

AnnSetSecondaryBitmap method

AnnSetShowFlags method

AnnSetText method

AnnSetTransparent method

AnnSetTransparentColor method

AnnSetUnit method

AnnSetWnd method

Buffers

EnableSaveBufferEvent property

LoadBuffer method

SaveBuffer event

SaveBuffer method

SaveBufferAddress property

SaveBufferSize property

Mixed Raster Content Module

AutoSegment method (ILEADRasterMrc)

AutoSegment event (ILEADRasterMrc)

BackgroundCoder property (ILEADRasterMrc)

BackgroundQFactor property (ILEADRasterMrc)

BaseBackColor property (ILEADRasterMrc)

BaseForeColor property (ILEADRasterMrc)

DeleteSegment method (ILEADRasterMrc)

EnableMethodErrors property (ILEADRasterMrc)

EnhanceQuality property (ILEADRasterMrc)

EnumSegments method (ILEADRasterMrc)

EnumSegments event (ILEADRasterMrc)

GetPagesCount method (ILEADRasterMrc)

Load method (ILEADRasterMrc)

MaskCoder property (ILEADRasterMrc)

Save method (ILEADRasterMrc)

SaveT44 method (ILEADRasterMrc)

StripeMaxHeight property (ILEADRasterMrc)

SetNewStripe method (ILEADRasterMrc)

SetStripeSegment method (ILEADRasterMrc)

UpdateSegmentData method (ILEADRasterMrc)

Using the Thumbnail Browser

BrowseDir method

ContinueBrowse property

CreateThumbnailFromFile method

DitherFlags property

EnableMethodErrors property

ExpandMultipage property

Filter property

ForceSize property

IncludeSubDirectories property

InfoBits property

InfoCompression property

InfoFormat property

InfoHeight property

InfoPage property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoWidth property

InfoXRes property

InfoYRes property

LoadStamp property

MaintainAspect property

MaxSizeDisk property

MaxSizeMem property

PaletteFlags property

Resample property

SkipFile property

StopOnError property

ThumbnailBackgroundColor property

ThumbnailBitsPerPixel property

ThumbnailEvent event

ThumbnailHeight property

ThumbnailWidth property

Using the Image List Control

AllowSelection property (ILEADRasterImgList)

Appearance property (ILEADRasterImgList)

BackColor property (ILEADRasterImgList)

BitonalScaling property (ILEADRasterImgList)

BorderColor property (ILEADRasterImgList)

BorderStyle property (ILEADRasterImgList)

Clear method (ILEADRasterImgList)

Click event (ILEADRasterImgList)

ColumnCount property (ILEADRasterImgList)

ControlWindow property (ILEADRasterImgList)

Count property (ILEADRasterImgList)

CurrentPage property (ILEADRasterImgList)

DblClick event (ILEADRasterImgList)

DisplayItemText property (ILEADRasterImgList)

EnableFireMouse2Event property (ILEADRasterView)

EnableKeyboard property (ILEADRasterImgList)

EnableMethodErrors property (ILEADRasterImgList)

EnsureVisible method (ILEADRasterImgList)

FirstVisibleItem property (ILEADRasterImgList)

Font property (ILEADRasterImgList)

ForeColor property (ILEADRasterImgList)

HitTest method (ILEADRasterImgList)

Insert method (ILEADRasterImgList)

InsertAt method (ILEADRasterImgList)

InsertFromBitmapList method (ILEADRasterImgList)

Item property (ILEADRasterImgList)

ItemBackgroundColor property (ILEADRasterImgList)

ItemHeight property (ILEADRasterImgList)

ItemHorizontalSpacing property (ILEADRasterImgList)

ItemSelected event (ILEADRasterImgList)

ItemUnSelected event (ILEADRasterImgList)

ItemVerticalSpacing property (ILEADRasterImgList)

ItemWidth property (ILEADRasterImgList)

KeyDown event (ILEADRasterImgList)

KeyPress event (ILEADRasterImgList)

KeyUp event (ILEADRasterImgList)

LoadDatabase method (ILEADRasterImgList)

LoadFromFile method (ILEADRasterImgList)

MouseDown event (ILEADRasterImgList)

MouseDown2 event (ILEADRasterView)

MouseIcon property (ILEADRasterImgList)

MouseMove event (ILEADRasterImgList)

MouseMove2 event (ILEADRasterView)

MousePointer property (ILEADRasterImgList)

MouseUp event (ILEADRasterImgList)

MouseUp2 event (ILEADRasterView)

OwnerDrawItem event (ILEADRasterImgList)

OwnerDrawItems property (ILEADRasterImgList)

PageCount property (ILEADRasterImgList)

PaintDither property (ILEADRasterImgList)

PaintScaling property (ILEADRasterImgList)

Remove method (ILEADRasterImgList)

Resize event (ILEADRasterImgList)

RowCount property (ILEADRasterImgList)

SaveDatabase method (ILEADRasterImgList)

SaveToFile method (ILEADRasterImgList)

ScaleHeight property (ILEADRasterImgList)

ScaleLeft property (ILEADRasterImgList)

ScaleMode property (ILEADRasterImgList)

ScaleTop property (ILEADRasterImgList)

ScaleWidth property (ILEADRasterImgList)

Scroll event (ILEADRasterImgList)

ScrollItems method (ILEADRasterImgList)

ScrollStyle property (ILEADRasterImgList)

SelectAll method (ILEADRasterImgList)

SelectedCount property (ILEADRasterImgList)

SelectedItems property (ILEADRasterImgList)

SelectionColor property (ILEADRasterImgList)

SelectionStyle property (ILEADRasterImgList)

SetSelectionBitmap method (ILEADRasterImgList)

Sort method (ILEADRasterImgList)

ViewSize property (ILEADRasterImgList)

Window property (ILEADRasterImgList)

Scanning Images using ISIS

DriverName property

EnableISISEvent property

EnableMethodErrors property

ISISGetTag method

IsISISAvailable property

ISISLoadDriver method

ISISSelect method

ISISSetScanOptions method

ISISSetTag method

ISISAcquire method

ISISAcquireMulti method

ISISPage event

ISISUnloadDriver method

PagesDiscarded property

Image Processing

AddBitmaps method(ILEADRasterProcess)

AddBorder method (ILEADRasterProcess)

AddFrame method (ILEADRasterProcess)

AlphaBlend method(ILEADRasterProcess)

AntiAlias method(ILEADRasterProcess)

BalanceColors method(ILEADRasterProcess)

CombineBitmapWarp method (ILEADRasterProcess)

CombineExt method (ILEADRasterProcess)

ConvertSignedToUnsigned method (ILEADRasterProcess)

ConvertToColoredGray method(ILEADRasterProcess)

CreateFadedMask method(ILEADRasterProcess)

EdgeDetector method(ILEADRasterProcess)

FeatherAlphaBlend method(ILEADRasterProcess)

GaussianFilter method(ILEADRasterProcess)

GetFunctionalLookupTable method (ILEADRasterProcess)

GetUserLookupTable method (ILEADRasterProcess)

GrayscaleExt method(ILEADRasterProcess)

LineProfile method(ILEADRasterProcess)

LineProfileBlue property(ILEADRasterProcess)

LineProfileGreen property(ILEADRasterProcess)

LineProfileRed property(ILEADRasterProcess)

LineProfileSize property(ILEADRasterProcess)

MotionBlur method(ILEADRasterProcess)

PicturizeBitmapList method(ILEADRasterProcess)

PicturizeSingle method(ILEADRasterProcess)

RemoveRedeye method(ILEADRasterProcess)

SwapColors method(ILEADRasterProcess)

UnsharpMask method(ILEADRasterProcess)

PSD Layers

InfoLayers property

LayerBlendModeKey property

LayerClipping property

LayerLeft property

LayerOpacity property

LayerTop property

LoadLayer method

SaveLayers property

Scrolling

HScrollInfo property (ILEADRasterView)

VScrollInfo property (ILEADRasterView)

Standard Curves and Bezier Curves

BezierSize property

BezierX property

BezierY property

CurveClose property

CurveSize property

CurveTension property

CurveToBezier method

CurveType property

CurveX property

CurveY property

SetRgnCurve method

UserLUTCurveSize property

UserLUTCurveX property

UserLUTCurveY property

Super Compression

BitmapCompression property

Transforming Files

TransformFile method

TransformMarker event

WriteMarker method

WriteMarkerAction property

Magnifying Glass

HasMagGlass property (ILEADRasterView)

Miscellaneous

CreateObject2 method

CreateObject method

CenterImage property

GetBitmapClipSegments method

IsSigned property

LoadResize method

LoadSigned property

PixelData property

CreateUserBitmap method

SetBitmapDataPointer method


Version 12.1

Version 12.1 is the first version of the LEADTOOLS COM Object. The LEADTOOLS COM Objects support the following:

LEADTOOLS now supports the J2K and JP2 JPEG 2000 file formats. (JPEG 2000 Plug In only)

New properties, methods, and events for Raster imaging provide support for the following:

Bitmap Handling

Viewing Bitmaps

Bitmap Processing.

Input and Output Functionality

New properties, methods, and events let you create and maintain Raster annotations. In addition, there is support for the following:

Annotation Menu

Annotation Toolbar

New properties, methods, and events for Raster database processing provide support for the following:

Using ODBC Functionality

Using OLEDB Functionality

New properties, methods, and events for Raster Twain scanning are provided.

The following is a list of the new methods, properties, and events:

JPEG 2000 Plug in Features

J2KROIControl property

J2KROIHeight property

J2KROILeft property

J2KROITop property

J2KROIWidth property

J2KUseROI property

For Bitmap Handling

Bitmap property

BitmapAlpha property

BitmapBits property

BitmapDelay property

BitmapDisposalMethod property

BitmapEnableTransparency property

BitmapHeight property

BitmapLeft property

BitmapList property

BitmapListCount property

BitmapListIndex property

BitmapPalette property

BitmapTop property

BitmapTransparentColor property

BitmapWidth property

BitmapXRes property

BitmapYRes property

Capture method

ColorResList method

Copy method

CreateBitmap method

DeleteBitmapListItems method

DeleteRgnHandle method

FreeRgn method

GetBitmapDC method

GetDDB method

GetDIB method

GetDIB2 method

GetMinMaxBits method

GetMinMaxVal method

GetPicture method

GetRgnArea method

GetRgnHandle method

HasRgn property

InsertBitmapListItem method

IsGrayscale property

IsPtInRgn method

IsSupportLocked method

LevelHighBit property

LevelLUT property

LevelLUTLength property

MaxBit property

MaxVal property

MinBit property

MinVal property

OffsetRgn method

Paste method

Pixel property

PolygonSize property

PolygonX property

PolygonY property

RefBitmap property

ReleaseBitmapDC method

RefBitmapList property

RgnHeight property

RgnLeft property

RgnTop property

RgnWidth property

LevelHighBit property

LevelLUT property

LevelLUTLength property

MaxBit property

MaxVal property

MinBit property

MinVal property

OffsetRgn method

Paste method

Pixel property

PolygonSize property

PolygonX property

PolygonY property

RefBitmap property

ReleaseBitmapDC method

RefBitmapList property

RgnHeight property

RgnLeft property

RgnTop property

RgnWidth property

SetDDB method

SetDIB method

SetPicture method

SetRgnColor method

SetRgnColorHSVRange method

SetRgnColorRGBRange method

SetRgnEllipse method

SetRgnHandle method

SetRgnMagicWand method

SetRgnPolygon method

SetRgnRect method

SetRgnRoundRect method

UnlockSupport method

WindowLevelFillLUT method

For Viewing Bitmaps

AboutBox method

Animate event

AnimationBackColor property

AnimationBitsPerPixel property

AnimationEnable property

AnimationHeight property

AnimationLoop property

AnimationPalette property

AnimationWidth property

Appearance property

AutoAnimate property

AutoAnimationLoop property

AutoPan property

AutoRepaint property

AutoRubberBand property

AutoScroll property

AutoSetRects property

AutoSize property

BackColor property

BackErase property

BitmapToClient method

BitonalScaling property

BorderStyle property

Click event

ClientToBitmap method

ConvertX property

ConvertY property

DblClick event

DstClipHeight property

DstClipLeft property

DstClipTop property

DstClipWidth property

DstHeight property

DstLeft property

DstTop property

DstWidth property

EffectDelay property

EffectGrain property

Enabledproperty

EnableMagGlassEvent property

EnablePaint property

EnableZoomInRect property

Floater property

FloaterDstClipHeight property

FloaterDstClipLeft property

FloaterDstClipTop property

FloaterDstClipWidth property

FloaterDstHeight property

FloaterDstLeft property

FloaterDstTop property

FloaterDstWidth property

FloaterHeight property

FloaterVisible property

FloaterWidth property

ForceRepaint method

ForePalette property

FrameColor property

FrameInnerHiliteColor property

FrameInnerShadowColor property

FrameInnerStyle property

FrameInnerThickness property

FrameOuterHiliteColor property

FrameOuterShadowColor property

FrameOuterStyle property

FrameOuterThickness property

FrameThickness property

GetClientDC method

GetFloaterHandle method

GetPalette method

GradientEndColor property

GradientStartColor property

Window property

IsPtInFloater method

KeyDown event

KeyPress event

KeyUp event

MagGlassExt event

MagGlassFlags property

MagGlassMask property

MagGlassMaskCount property

MouseDown event

MouseIcon property

MouseMove event

MousePointer property

MouseUp event

OLEDropAllowed property

OLEDropFile event

Paint event

PaintContrast property

PaintDither property

PaintEffect property

PaintGamma property

PaintIntensity property

PaintEffectMaxPasses property

PaintEffectPass property

PaintTransitionMaxPasses property

PaintTransitionPass property

PaintNotification event

PaintNotificationDelay property

PaintPalette property

PaintRgnOnly property

PaintROP3 property

PaintScaling property

PaintSizeMode property

PaintSizeUseDPI property

PaintZoomFactor property

PanWin event

PanWinBitonalScaling property

PanWinCursor property

PanWinHeight property

PanWinIcon property

PanWinPaintDither property

PanWinPaintPalette property

PanWinPaintScaling property

PanWinPointer property

PanWinRectColor property

PanWinSysMenu property

PanWinTitle property

PanWinWidth property

PanWinX property

PanWinY property

PatternBackColor property

PatternForeColor property

PatternStyle property

PrintEnd method

PrintNewPage method

PrinterScaleHeight property

PrinterScaleWidth property

PrintStart method

Raster property

ReleaseClientDC method

Render method

RepaintRect method

Resize event

RgnFrameColor property

RgnFrameType property

RgnMarkingMode property

RubberBand event

RubberBandHeight property

RubberBandLeft property

RubberBandTop property

RubberBandVisible property

RubberBandWidth property

Scroll event

SetDstClipRect method

SetDstRect method

SetFloaterDstClipRect method

SetFloaterDstRect method

SetRubberBandRect method

SetSrcClipRect method

SetSrcRect method

ShowPanWin method

SrcClipHeight property

SrcClipLeft property

SrcClipTop property

SrcClipWidth property

SrcHeight property

SrcLeft property

SrcTop property

SrcWidth property

StartMagGlass method

StopMagGlass method

TransitionDelay property

TransitionEffect property

TransitionStyle property

UpdateMagGlass method

UpdateMagGlassShape method

WandSize property

WindowLevel method

ZoomIn method

ZoomInDone event

ZoomToRect method

For Bitmap Processing.

AddNoise method

AutoTrim method

Average method

BinaryFilter method

BorderRemove event

BorderRemove method

ColorMerge method

ColorPlanes property

ColorSeparate method

Combine method

ContourFilter method

Contrast method

Deskew method

Deskew2 method

Despeckle method

DocCleanSuccess property

DotRemove event

DotRemove method

Emboss method

FastRotate method

Fill method

Flip method

GammaCorrect method

GetColorCount method

GetHistogram method

GetHistogramGray method

Grayscale method

Halftone method

HistoContrast method

HistoEqualize method

HistogramTable property

HistogramGrayTable property

HistogramGrayTableSize property

HolePunchRemove event

HolePunchRemove method

HSV_HfromRGB method

HSV_SfromRGB method

HSV_VfromRGB method

HTable property

Hue method

HdocCleanRgn property

Intensity method

IntensityDetect method

Invert method

InvertedText event

InvertedText method

LineRemove event

LineRemove method

MaskTable property

MaxFilter method

Median method

MinFiltermethod

Mosaic method

Oilify method

Picturize method

Posterize method

RemapHue method

RemapIntensity method

RemapTable property

Reverse method

Rotate method

Saturation method

Sharpen method

Shear method

STable property

Size method

Smooth event

Smooth method

Solarize method

SpatialFilter method

StretchIntensity method

Trim method

Underlay method

UserPalette property

VTable property

WindowLevel method

For Input and Output Functionality

ClientSizeX property

ClientSizeY property

DrawEllipse method

DrawFillColor property

DrawFillStyle property

DrawFontColor property

DrawLine method

DrawMode property

DrawPenColor property

DrawPenStyle property

DrawPenWidth property

DrawPersistence property

DrawRectangle method

DrawShape method

DrawText method

DrawTextHeight method

DrawTextWidth method

DstBottom property

DstLeft property

DstRight property

DstTop property

Font property

InfoViewPerspective property

IOPalette Property

SaveOffset Method

SavePad4 property

ScaleMode property

ShapeBackgroundStyle property

ShapeBorderThickness property

ShapeHeight property

ShapeInnerBandHiliteColor property

ShapeInnerBandShadowColor property

ShapeInnerBandStyle property

ShapeInnerBandThickness property

ShapeLeft property

ShapeOuterBandHiliteColor property

ShapeOuterBandShadowColor property

ShapeOuterBandStyle property

ShapeOuterBandThickness property

ShapeTop property

ShapeWidth property

SrcBottom property

SrcLeft property

SrcRight property

SrcTop property

TextAngle property

TextHeight property

TextLeft property

TextTop property

TextWidth property

FileSizeWritten Property

PDFDisplayDepth property

PDFGraphicsAlpha property

PDFSaveLowMemory property

PDFSaveUseDPI property

PDFTextAlpha property

PDFUseLibFonts property

PDFXResolution property

PDFYResolution property

RasterizeViewMode property

RasterizeViewportHeight property

RasterizeViewportWidth property

For Annotation

AnnAutoDrawEnable property

AnnAutomation property

AnnAutoMenuEnable property

AnnContainer property

AnnCopy method

AnnCreate method

AnnDataPath method

AnnDefine method

AnnDestroy method

AnnEnumerate event

AnnEnumerate method

AnnFlip method

AnnGetAutoMenuItemEnable method

AnnGetAutoText method

AnnGetHyperlinkParam method

AnnGetHyperlinkString method

AnnGetHyperlinkType method

AnnGetLocked method

AnnGetObjectFromTag method

AnnGetPointCount method

AnnGetPointX method

AnnGetPointY method

AnnGetSelectCount method

AnnGetSelectList method

AnnGetTag method

AnnGetType method

AnnGetVisible method

AnnGroup method

AnnHyperlinkMenuEnable property

AnnInsert method

AnnLoad method

AnnLoadArray method

AnnLoadMemory method

AnnLock method

AnnMove method

AnnPaste method

AnnPasteReady property

AnnRealize method

AnnRectHeight property

AnnRectLeft property

AnnRectTop property

AnnRectWidth property

AnnReverse method

AnnRotate method

AnnSave method

AnnSaveArray method

AnnSaveMemory method

AnnSaveTag method

AnnSetAutoDefaults method

AnnSetAutoMenuItemEnable method

AnnSetAutoText method

AnnSetHyperlinkMsg method

AnnSetHyperlinkString method

AnnSetSelected method

AnnSetTag method

AnnSetUser method

AnnSetVisible method

AnnShowLockedIcon property

AnnTool property

AnnUngroup method

AnnUnlock method

AnnUnrealize method

AnnUserMode property

SetMousePos method

For Annotation Menu

AnnUndoEnable property

AnnUndoDepth property

AnnAutoDialogFontSize property

AnnSetGrouping method

AnnGetGrouping method

AnnAddUndoNode method

AnnUndo method

AddItem method

GetSubMenu method

ToolBarhWnd property

ItemChecked property

ItemEnabled property

ItemID property

ItemString property

ItemType property

SetAnnMenu method

For Annotation Toolbar

ButtonBitmapDown property

ButtonBitmapUp property

ButtonColumns property

ButtonCount property

ButtonMenuText property

ButtonMenuTextID property

ButtonMenuTool property

ButtonRows property

ButtonTool property

ButtonToolCount property

ButtonToolTipText property

ButtonToolTipTextID property

ButtonVisible property

Count property

Create method

DeleteItem method

Tool property

Visible property

Using ODBC Functionality

DbAddNew method

DbCanAppend property

DbCanRestart property

DbCanScroll property

DbCanUpdate property

DbClose method

DbCurrentRecord property

DbDelete method

DbEdit method

DbEditMode property

DbIsBOF property

DbIsDeleted property

DbIsEOF property

DbIsOpen property

DbLoadBits property

DbLockingMode property

DbMove method

DbMoveFirst method

DbMoveLast method

DbMoveNext method

DbMovePrev method

DbOpen method

DbRecordCount property

DbRequery method

DbUpdate method

Using OLEDB Functionality

AnnContainer property

DataDirty property

DataField property

DataLoadBits property

DataLoaded event

DataMember property

DataSaveBits property

DataSaved event

DataSaveFormat property

DataSaveQuality property

DataSource property

For Twain Scanning

EnableTwainAutoFeed property

EnableTwainEvent property

EnableTwainFeeder property

EnableTwainDuplex property

EnableTwainFileFormatEvent property

EnableTwainFileEvent property

IsTwainAvailable method

TwainAcquire method

TwainAcquireFile method

TwainAppAuthor property

TwainAppFamily property

TwainFile event

TwainAppName property

TwainBits property

TwainCloseSession method

TwainContrast property

TwainDuplex property

TwainEnumSources method

TwainFlags property

TwainFileFormat event

TwainFrameHeight property

TwainFileFormatStatus property

TwainFrameLeft property

TwainFrameTop property

TwainFrameWidth property

TwainIntensity property

TwainMaxPages property

TwainPage event

TwainPixelType property

TwainRealize method

TwainRes property

TwainSelect method

TwainSourceCount property

TwainSourceList property

TwainSourceName property

JPEG 2000 Plug in Feature

J2KCBS_ErrorResilienceSymbol property

J2KCBS_PredictableTermination property

J2KCBS_ResetContextOnBoundaries property

J2KCBS_SelectiveACBypass property

J2KCBS_TerminationOnEachPass property

J2KCBS_VerticallyCausalContext property

J2KCodBlockHeight property

J2KCodBlockWidth property

J2KCompressionControl property

J2KCompressionRatio property

J2KDecompLevel property

J2KDerivedBaseExponent property

J2KDerivedBaseMantissa property

J2KDerivedQuantization property

J2KGuardBits property

J2KProgressOrder property

J2KSetDefaults method

J2KTargetFileSize property

J2KUseColorTransform property

J2KUseEPHMarker property

J2KUseSOPMarker property

J2KXOsiz property

J2KXTOsiz property

J2KXTsiz property

J2KYOsiz property

J2KYTOsiz property

J2KYTsiz property


Copyright notice

Copyright Notices

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

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, 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.
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

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


Introduction To Image Processing with LEADTOOLS

The following topics provide general information about image processing, and where appropriate, they describe the related LEADTOOLS capabilities. These topics build up concepts and terminology; so if you are new to image processing, it is best to read them in order.

Bits Per Pixel and Related Ideas

Color Resolution and Dithering

Palette Handling

Image Manipulation and Analysis

Image Display

Bitmaps in Memory and in Files

DIBs, DDBs, and the Clipboard

Printing

TWAIN and ISIS Input

Data Transfer

Animation


Introduction: Animation

GIF files are commonly used for small animated images in applications. These are multipage files, and animation is achieved by processing the list of images. (This is not the same as AVI or other full-motion video formats.)

LEADTOOLS lets you load a multipage file into a list of bitmaps; then create and play an animation sequence using the list. With the paint-while-load feature, you can also play the animation while the list is being loaded.

LEADTOOLS takes advantage of the special animation features in GIF files, such as using one palette for the whole list of bitmaps. But you can create, play, and save animations in any multipage format, including GIF, TIFF, and PCX. You can also create a list of bitmaps from an AVI file, but this is a read-only feature.


Introduction: Bitmaps in Memory and in Files

Generally, the size of a bitmap in memory is determined by its dimensions and its color resolution. For example, to calculate the number of bytes for a 500-by-500 pixel, 24-bit image, you multiply 500 * 500 * 3. (Multiply by 3 because there are 3 bytes in 24 bits.) For an 8-bit image, it would be 500 * 500, plus the size of its palette, which is about 1K. There is an exception for 1-bit files, which can be loaded in a compressed format using the LEADTOOLS Document/Medical toolkit.

For any color image, whether the color values are in a palette or in the image data, the color of each pixel in the bitmap consists of red, green, and blue values. They always use the RGB color-space model, which means that red, green, and blue values are combined to represent a color.

The size of the same color image when it is stored in a file is often much smaller, and the color-space model is not always RGB. For example, JPEG and LEAD CMP files both use a YUV color-space model, where Y is a luminance value, and the U and V values are chrominance values. In this color-space model, brightness information is stored in the luminance value, and color information is stored in the chrominance values. JPEG and LEAD CMP achieve data compression through sampling techniques that can affect the accuracy of the YUV values. This kind of compression is sometimes referred to as lossy compression, because you can manipulate the compression parameters to choose between greater compression or greater accuracy. (YCbCr, used in TIFF images, is the same color-space model as YUV.)

Another color-space model used in image files is CMYK (designed for color printing using cyan, magenta, yellow, and blackness). Other compression techniques include RLE (run-length encoding) and LZW (Lempel-Ziv and Welch). Both of these techniques preserve the accuracy of the image data, and they achieve compression solely by identifying repetitions of data. Some grayscale and 1-bit image file formats also use RLE and LZW compression techniques.

There is also a family of Reference Output Medium Metric (ROMM) BGR Color encodings that is a wide-primary output-referred extended color-gamut BGR color encoding. These encodings are used by digital still picture imaging systems to manipulate, store, transmit, display and print digital images. Unlike sRGB color encoding, the range of colors is not limited to those colors that can be displayed on a CRT monitor, and unlike e-sRGB, these encodings do not use negative RGB colorimetry co-ordinates. ROMM color order can be used only with 24 or 48-bit bitmaps and is supported by the CMP/JPEG/Exif JPEG/JTIF/TIFF CMP file formats.

The image file formats are not only used for storage in the computer's file system, but are also used for database storage and for transmission of images. Furthermore, some applications keep frequently-used images in memory in a compressed file format. Thus, they can take advantage of memory speed when loading bitmaps from these files.


Introduction: Bits Per Pixel and Related Ideas

The terminology for image formats can be confusing because there are often several ways of describing the same format. This topic explains what the terms mean.

If an image is 24 bits per pixel, it is also called a 24-bit image, a true color image, or a 16M color image. Sixteen million is roughly the number of different colors that can be represented by 24 bits, where there are 8 bits for each of the red, green, and blue (RGB) values.

A 32-bit image is a specialized true-color format used in image files, where the extra byte carries information that is either converted or ignored when the file is loaded. The extra byte is used for an additional color plane in CMYK files, which are specialized files for color printing. In that case, LEADTOOLS, by default, converts the values to 24-bit RGB values when loading the image. The additional byte may also be used for an Alpha channel, which carries extra information such as a transparency indicator.

If an image is 16 bits per pixel, it is also called a 16-bit image, a high color image, or a 32K color image. Thirty-two thousand is roughly the number of different colors that can be represented by 16 bits, where there are 5 bits for each of the red, green, and blue values. (Devices that specify 64K color support are also referring to 16-bit images, but they are counting the left-over bit.)

If an image is 8 bits per pixel, it is also called an 8-bit image or a 256-color image. Two hundred fifty-six is the number of different colors that can be achieved by using the image data as 8-bit indexes to an array of colors called a palette.

If an image is 4 bits per pixel, it is also called a 4-bit image or a 16-color image. Sixteen is the number of different colors that can be achieved by using the image data as 4-bit indexes to a palette.

If an image is 1 bit per pixel, it is also called a 1-bit image, a black and white image, a 2-color image, or a bitonal image. Two is the number of different colors that can be achieved by using the image data as 1-bit indexes to a palette. The palette can contain colors other than black and white, although black and white are most common.

If an image is grayscale, its red, green, and blue values are all the same, and the values are incremented from the lowest to the highest. For example, an 8-bit grayscale image has 256 shades of gray, with values from 0 to 255. LEADTOOLS supports 4, 8, 12, and 16-bit grayscale. Support for the 12 and 16-bit grayscale images is only available in the Document/Medical.

Most of this same terminology is applied to video cards. For example, an 8-bit card is one that is capable of displaying 256 colors.


Introduction: Color Resolution and Dithering

Color resolution (also called color depth) refers to the number of possible colors in an image, as determined by the bits-per-pixel. If an image in your computer is loaded from a FAX scanner or received as a FAX transmission, it is a black-and-white (1-bit) image. If it is loaded from a color scanner or a JPEG file, it can have 16 million colors. If it is loaded from a GIF file, it is likely to have 256 colors. There are many possibilities, ranging from two colors to 16 million.

LEADTOOLS lets you manipulate an image and display it on any Windows-compatible device, regardless of the image's color resolution. Therefore, in most cases you can load, display, modify, and save an image without ever changing its color resolution. Nevertheless, in some cases you may need to increase or decrease the color resolution. Here are some examples:

Suppose you need to load a large 24-bit image on a computer that does not have much memory. You can conserve memory by loading it as an 8-bit image. Then, if you were using an 8-bit display device, you would not see any difference in the quality of the image. Of course, there would be some loss of quality on a 24-bit display device, and the loss would be permanent if you then saved the image in the same file.

Suppose you want to save an image in a different file format. If the new file format does not support the original color resolution, you can specify a different color resolution when you save the image.

Suppose you want to combine one 8-bit image with another one. To combine two images, they must have the same color resolution, and if they are less than 16 bits per pixel, they must use the same palette. The simplest solution is to convert both images to 24 bits per pixel before combining them. Then, if necessary, you can reduce the color resolution of the combined image.

Whenever you reduce an image's color resolution to 8 bits per pixel or less, a dithering method comes into play. One alternative is to use a nearest-color match (no dithering), which means that the color of each pixel is changed to the palette color that most closely matches it. If the original image contains subtle color details, the result of a nearest-color match may have large blotches of color that are not very pleasing.

Dithering methods create the appearance of more subtle shades by mixing in pixels of different colors. This is similar to the way newspaper pictures produce the appearance of shades of gray, even though the only actual colors are black and white.

Ordered dithering is the fastest method. It is the default dithering method when painting to a display device that is 256 colors or less. Ordered dithering takes advantage of the fact that the colors in most palettes are ordered so that similar shades are next to each other in the palette. This method avoids blotches of color by adding to or subtracting from the nearest-color value of each pixel to ensure that adjacent pixels do not have exactly the same color. (If the colors in the palette are not ordered, the results are not good.)

All of the other dithering methods in LEADTOOLS use error-diffusion algorithms. In error diffusion, the error is the difference between the original pixel color and the nearest match, and diffusion of this error is what the algorithm accomplishes. Floyd-Steinberg is a high-quality, fast error-diffusion method. It is the default method that LEADTOOLS uses if you reduce the color resolution when loading or saving an image, or if you specify error diffusion as the dithering method when painting to a display device that is 256 colors or less.

If you use a LEADTOOLS function to change the color resolution of a bitmap in memory, you can choose from a list of possible dithering methods. All of the alternative error-diffusion methods are slower than Floyd-Steinberg, and the quality may or may not be better, depending on the original image, and depending on whether the resulting image is to be displayed or printed. Choosing an alternative dithering method is a subjective, trial-and-error decision. Stevenson and Arce dithering, the slowest of the alternatives, is most likely to produce a higher quality result.

There is a family of Reference Output Medium Metric (ROMM) BGR Color encodings that is a wide-primary output-referred extended color-gamut BGR color encoding. These encodings are used by digital still picture imaging systems to manipulate, store, transmit, display and print digital images. Unlike sRGB color encoding, the range of colors is not limited to those colors that can be displayed on a CRT monitor, and unlike e-sRGB, these encodings do not use negative RGB colorimetry co-ordinates.

ROMM color order can be used only with 24 or 48-bit bitmaps and is supported by the CMP/JPEG/Exif JPEG/JTIF/TIFF CMP file formats. There are colors that can be represented in RGB, but not in ROMM. Conversely, there are colors that can be represented in ROMM that cannot be represented in RGB. If you convert from one to the other you lose the colors that can be represented only in one of the colorspaces.


Introduction: Data Transfer

When receiving transferred data, as in an Internet application or a FAX modem transmission, you often want to display the image as it is received.

To meet that need, LEADTOOLS provides simple functions that let you load image data into a bitmap as it is received. You can also use the LEADTOOLS paint-while-load feature to display the bitmap as it is received.

For Internet support, LEADTOOLS provides a plug-in DLL that can be used on WIN32 systems to view compressed images with Netscape Navigator or Microsoft Internet Explorer.


Introduction: Database Interaction

With LEADTOOLS, you can use a variety of strategies to maintain images in a database. This variety is necessary because of the uneven support for storing images using different development and database systems.

You may be able to use ODBC (Open Database Connectivity). ODBC is a standard interface for accessing local and remote databases. To use it, you define a data source that is implemented with an ODBC driver; then you access the data source in the same way you would a local database. LEADTOOLS provides COM methods and properties that let you directly access image data through an ODBC data source. There are a couple of limitations in this approach. First, since the ILEADRasterODBC COM accesses the image data directly and does not access any other data in the record, you must deal with the problem of identifying the image. To solve this problem, you can use another means of selecting records; then synchronize the ILEADRaseterView COM to view, so that it is always accessing the same record. (The COM tutorials describe how to do this.) The second limitation is with ODBC drivers. Most of the available ODBC drivers do not properly support access to long binary fields.

Also, for systems with COM support, you can use OLE DB and ADO to access data. You can bind the LEADTOOLS OLE Raster DB Control to an OLE DB data source, such as the Microsoft ADO Data Control. You can associate the LEADTOOLS OLE Raster DB Control with a long binary field in the database, and let the data control handle all of the database maintenance and navigation.

A more flexible approach on lower-level development systems, such as C, and C++ is to use the ability of LEADTOOLS to save a file in memory. Once the image is available in memory in a compressed file format, you can use your choice of database engines to store and retrieve the data.

Finally, you may want to consider using your computer's or network's file system to store the images, use a database to store the file paths as strings, and write your own code to do the synchronization. In some cases, this could be a better solution than storing the images directly in the database.


Introduction: DIBs, DDBs, and the Clipboard

A DIB (device independent bitmap) is a standard Windows representation of a bitmap. It is similar to the LEADTOOLS representation of a bitmap in that it includes palette information. A DDB (device dependent bitmap) is a hardware-specific representation that does not include palette information. Sometimes, you may need to manipulate a bitmap using Windows functions that work with DIBs or DDBs. For example, you may need to interact with an existing application that uses those functions. For that purpose, LEADTOOLS functions let you convert or copy to and from DIBs or DDBs. Of course, when converting to and from a DDB, you must preserve the palette information separately.

The clipboard is a standard Windows object for copying data from one application to another. LEADTOOLS lets you copy images to the clipboard and paste images from the clipboard. When copying to the clipboard, most LEADTOOLS functions clear the existing data from the clipboard, and copy image data to it in the form of a DIB, a DDB, and a palette (if one is needed). If that is not what you want, you can use a LEADTOOLS DLL function to specify exactly which actions to take.


Introduction: Image Display

When you display an image, the following things come into play:

Sizing and positioning the display.

Adapting the image to the color resolution of the display device.

Making other refinements that affect the display but not the bitmap in memory.

The LEADTOOLS paint functions let you specify which part of an image to display, how big to make the display, and where to position the origin (for scrolling and zooming). In the ActiveX, the origin defaults to 0,0 and the size defaults to the bitmap size. This is arbitrary, and even with automatic scroll bars, it is unlikely to be what a user wants to see. Instead, the typical user either wants to see the whole image or wants to select a portion of the image to view.

Fortunately, LEADTOOLS makes it easy to show the user exactly what he wants to see. LEADTOOLS lets you control the size and position of the display without resizing or trimming the bitmap. In fact, it usually is best to think of the bitmap size as a measure of resolution, rather than a measure of size. The larger the bitmap, the more you can zoom in without losing detail.

As for adapting to the color resolution of the display device, if the color resolution of your device is greater than 256 colors, no adaptation is necessary. If the color resolution is higher than 256 colors, images are displayed using their own color values. Of course, if a 24-bit image is displayed on a 16-bit device, there is some loss, but there are still no programming issues, since the only remedy is to change the display mode.

If the color resolution of your display device is 256 colors or less, you have to make some programming decisions regarding dithering and palette selection. When displaying 16-, 24-, or 32-bit images, you can determine whether LEADTOOLS uses ordered dithering or error diffusion to handle the color reduction. (LEADTOOLS uses a fixed palette for these images.) When displaying 8-, 4-, or 1-bit images, you must decide whether to use a fixed palette or the individual image's palette. Using the fixed palette avoids palette shifting when more than one image is displayed at the same time. Using the image's original palette produces the best possible display of the image's colors.

Other LEADTOOLS functions let you determine how the new display interacts with whatever is already on the display device. For example, when displaying 1-bit images, you can set scale-to-gray or favor-black options that can improve the readability of scaled images (images that are zoomed in or out to fit the available space).

If the image is a 24 or 48-bit bitmap it is possible to specify use of Reference Output Medium Metric (ROMM) BGR Color encoding. This is a wide-primary output-referred extended color-gamut BGR color encoding. This encoding is used by digital still picture imaging systems to manipulate, store, transmit, display and print digital images. Unlike sRGB color encoding, the range of colors is not limited to those colors that can be displayed on a CRT monitor, and unlike e-sRGB, these encodings do not use negative RGB colorimetry co-ordinates.

ROMM color order is supported by the CMP/JPEG/Exif JPEG/JTIF/TIFF CMP file formats. Because there are colors that can be represented in RGB, but not in ROMM as well as colors that can be represented in ROMM that cannot be represented in RGB, if you convert from one to the other you lose the colors that can be represented only in one of the colorspaces.

For displaying 12 to 16-bit grayscale images, LEADTOOLS provides functions for window leveling. Window leveling is only available in the Medical Imaging editions.


Introduction: Image Manipulation and Analysis

Most LEADTOOLS functions for image manipulation and analysis act on the bitmap in memory. It is important to keep this in mind, because the changes become permanent when you save the bitmap in a file. Sometimes you want the changes to be permanent, and sometimes you do not. It all depends on the reason for making the changes.

Sometimes, you start with an image that has some undesirable qualities. For example, if the original image is too flat, you may want to use one of the contrast enhancement functions to make permanent improvements.

At other times, you may need to make temporary changes for use on a particular monitor or printer. Using the ActiveX control or DLL functions, you can set the brightness, contrast, and gamma correction for the display of all images, without affecting the bitmaps. But for other changes, such as creating a halftone for printing, a good strategy is to modify a copy of the image, and give the user the ability to undo changes. The undo strategy also makes sense with a manipulation, such as a mosaic effect, that intentionally distorts an image.

Some image manipulations, such as edge-detection filters, are commonly used to analyze an image, rather than to improve it. For example, in an industrial quality-assurance application, defects in a machine part may be easier to detect if an image of the part is processed with an edge-detection filter. Similarly, the creation of a histogram (an array that charts the frequency of color usage in an image) can be of value in an analytical situation.

Edge detection and histogram creation can also be used as steps in improving an image. For example, creating a histogram is a necessary step, internally, in some of the contrast-improvement functions. Also, an image created with an edge detection filter can be combined with the original image to harden or soften the original's edges.


Introduction: Palette Handling

Any image that is 8 bits per pixel or less must have a palette. The palette is an array that contains the colors for displaying the image. The pixel values are indexes into the array. An image can have its own unique palette or it can share a common fixed palette. In either case, every bitmap in memory that is 8 bits per pixel or less has its own copy of a palette (even if it is a common fixed palette).

One way for a bitmap to have a unique palette is to load an image from a file that is 8 bits per pixel or less. In that case, the file contains a palette for the image, and you can assume that the palette is unique. By default, LEADTOOLS loads the palette that is stored in the file and associates it with the bitmap in memory.

Another way for a bitmap to get a unique palette is to create the palette. For example, if you reduce a 24-bit image to 8 bits per pixel, you can let LEADTOOLS create an optimized palette for the image.

By using a unique, optimized palette, you get the best possible image quality, but there is a drawback. When a display device uses a palette (for example, when it is in 256-color mode), it can only use one palette at a time to display colors. Therefore, if you are displaying more than one image at the same time, the current image may look perfect, while all of the others look bad, because they are mapped to the wrong palette. This is called palette shift.

Using a fixed palette solves these palette-shift problems. The best approach is to specify the fixed palette as a display option. Then, LEADTOOLS remaps each image to the fixed palette when it is displayed, without disturbing the individual image's palette. (When displaying 16-, 24-, or 32-bit images on a device with 256 colors or less, LEADTOOLS always uses the fixed palette.)

Alternatively, you can use a color resolution function to specify a fixed palette for each individual image. But then, when you save the image to a file, the fixed palette is saved in the file, and any unique palette information is lost.

If the image is a 24 or 48-bit bitmap it is possible to specify use of Reference Output Medium Metric (ROMM) BGR Color encoding. This is a wide-primary output-referred extended color-gamut BGR color encoding. This encoding is used by digital still picture imaging systems to manipulate, store, transmit, display and print digital images. Unlike sRGB color encoding, the range of colors is not limited to those colors that can be displayed on a CRT monitor, and unlike e-sRGB, these encodings do not use negative RGB colorimetry co-ordinates.

ROMM color order is supported by the CMP/JPEG/Exif JPEG/JTIF/TIFF CMP file formats. Because there are colors that can be represented in RGB, but not in ROMM as well as colors that can be represented in ROMM that cannot be represented in RGB, if you convert from one to the other you lose the colors that can be represented only in one of the color spaces.


Introduction: Printing

LEADTOOLS printing functions are designed to work with Windows printing functions. Normally, you use Windows to select a device context (DC) and start the print job. LEADTOOLS functions let you scale and position one or more images in the printer DC. You use Windows functions to get the available page dimensions. You also use Windows functions to eject each page and to end the print job.

In most cases, you can scale and position an image on a printer DC with the same flexibility as when you display an image on a computer screen. You can let the printer handle any dithering or halftoning. However, if you halftone a bitmap, yourself, before sending it to a printer, you should resize the bitmap to the desired height and width, then use the halftone function, then send the image to the printer without scaling it. (You get bad results if you scale a halftoned image.)

In C, C++, Visual Basic, and Delphi, you can use the actual Windows printing functions, or their equivalents in the development system. However, printing with Microsoft FoxPro and older versions of Access is more limited, because they do not give you direct access to the printer DC. The LEADTOOLS ActiveX handles this problem by providing methods to start and stop the print job.

With Access 7.0, you can also add code to a report's Print event to include ActiveX images. Or, more simply, you can embed the LEAD OLE Server, which is provided as a separate toolkit component.


Introduction: TWAIN and ISIS® Input

TWAIN:

TWAIN is a standard for image input devices, such as scanners and digital cameras. Getting an image from a TWAIN device can be very simple. First, there is a standard facility for selecting the input device. It is similar to selecting a default printer, and you can skip this step if you know that the default is right. Then, each TWAIN device has its own user interface, which you invoke to acquire an image.

Some complexity is introduced only when acquiring multiple images or when bypassing the user interface. If you acquire multiple images, you must code a callback function or event procedure to handle each image. If you bypass the user interface, you must set some standard TWAIN parameters to provide the information that the TWAIN driver would normally get from the user interface. The tricky part is that some TWAIN drivers implement the standard more fully than others. If you do not know in advance how the TWAIN device will behave, it is a good idea to add logic to your program to test the success of setting the TWAIN parameters. LEADTOOLS provides functions for all of this.

Please note that TWAIN support requires TWAIN.DLL for 16-bit or TWAIN_32.DLL for 32-bit. These files must be obtained from the TWAIN device manufacturer.

ISIS [Document/Medical]:

The Image and Scanner Interface Specification (ISIS) is a standard for scanner control and provides a complete framework for image processing. LEADTOOLS supports image acquisition from ISIS scanner drivers. The ISIS interface is message based, using tags to get and set scanner information and operating parameters.

LEADTOOLS provides ISIS Scanner support which allows you to determine if ISIS is available, load and unload ISIS Scanner Drivers, select and/or add an ISIS Scanner Driver through a dialog, scan one or more pages and save the images to files, and get or set Scanner Driver tags. These tags provide information about the scanner and let you set parameters pertaining to scanning, such as contrast, brightness, resolution, compression method, etc. With multipage scanning, you can code a callback function to provide a status report or cancel the operation.

Please note that ISIS support requires PIXDFLTN.DLL, which is not included with this package. This file must be obtained from the ISIS device manufacturer. Also note that you must obtain an ISIS driver from the scanner manufacturer or from Pixel Translations. The .chn or .chw file must be in your path for ISIS scanning to work. LEAD does not grant any license to the ISIS driver or to ISIS development capabilities. It is your responsibility to obtain the appropriate license to your development project, either from Pixel Translations, or one of their licensees. For more information on using ISIS, refer to Using ISIS to Scan Images.


Example Programs

Note:

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

The executable files for these examples were compiled with Document/Medical capabilities of the toolkit. 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.

Visual Basic

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

EXAMPLES\COM\VB\ANNOT32 contains a sample application that demonstrates the annotation capabilities. To run the 32-bit sample application, you can run the EXE file in LEAD's BIN directory.

EXAMPLES\COM\VB\DB32 contains sample project code for an ODBC database example in Visual Basic 5.0. To use the DB demo, you must first do the following:

1. | Specify an ODBC data source named LEADACCESS that references the IMAGES\LEADPIC.MDB database. For instructions on specifying an ODBC data source, refer to Using ODBC.
2. | Open the project in Visual Basic and modify the Dpeople data control's DatabaseName property to reference the IMAGES\LEADPIC.MDB database.

EXAMPLES\COM\VB\OLEDB32 contains sample project code for an OLEDB database example in Visual Basic 6.0. To use the OLEDB demo, you must first do the following:

1. | Specify an ODBC data source named LEADACCESS that references the IMAGES\LEADPIC.MDB database. For instructions on specifying an ODBC data source, refer to Using ODBC.
2. | Open the project in Visual Basic and modify the Dpeople data control's ConnectString property to reference the LEADACCESS DSN.

EXAMPLES\COM\VB\FX32 demonstrates the LEADTOOLS special effects, including paint effects, transitions, three-dimensional text, and three-dimensional shapes. To run the 32-bit sample application, you can run the EXE file in LEAD's BIN directory.

EXAMPLES\COM\VB\LMCDemo demonstrates the use of the LMD file format. To run the 32-bit sample application, you can run the EXE file in LEAD's BIN directory.

Visual C++

EXAMPLES\COM\MSVC5\DEMO contains sample project code for Visual C++. You can open the project in Visual C++; then compile and run it.

EXAMPLES\COM\MSVC5\ANNCOM demonstrates the LEADTOOLS annotation capabilities. To run the sample application, you can run the EXE file in LEAD's BIN directory.

EXAMPLES\COM\MSVC5\DB contains sample project code for a database example in Visual C++. To use the DB demo, you must first do the following:

1. | Specify an ODBC data source named LEADACCESS that references the IMAGES\LEADPIC.MDB database. For instructions on specifying an ODBC data source, refer to Using ODBC.
2. | Open the project in Visual C++ and modify the GetDefaultDBName function to reference the IMAGES\LEADPIC.MDB database.

EXAMPLES\COM\MSVC5\OLEDB contains sample project code for an OLEDB database example in Visual C++. To use the OLEDB demo, you must first do the following:

1. | Specify an ODBC data source named LEADACCESS that references the IMAGES\LEADPIC.MDB database. For instructions on specifying an ODBC data source, refer to Using ODBC.
2. | Open the project in MSVC and modify the ADODC1 data control's ConnectString property to reference the LEADACCESS DSN.

EXAMPLES\COM\MSVC5\SPFXCOM demonstrates the LEADTOOLS special effects, including paint effects, transitions, three-dimensional text, and three-dimensional shapes. To run the sample application, you can run the EXE file in LEAD's BIN directory.


ASP Example

Your Web Server must support Active Server Pages to use this feature. Some Web Servers that currently support ASP:

Microsoft Personal Web Server

Microsoft Internet Information Server (IIS)

Microsoft Peer Web Services (IIS for Windows NT Workstation 4.0)

You must have the LEAD license file on the server, in the same directory as the LEAD ActiveX file. In version 12, the license file is named LTOCX14.LIC. If Document/Medical features are required (i.e. ScaleToGray, Despeckle, Deskew, etc), you must obtain the appropriate license file from LEAD Technologies, Inc. (704-372-9681).

An instance of the LEAD COM Objects is created on the server using CreateObject method (three of LEAD COM Objects are used in this demo). CreateObject has the required argument "class" which is either the ClassID or the ProgID of the ActiveX component. This can be done one of two ways:

1.

Set Raster | = Server.CreateObject("LEADRaster.LEADRaster.145")
Set RasterProc | = Server.CreateObject("LEADRasterProcess.LEADRasterProcess.145")
Set RasterIO | = Server.CreateObject("LEADRasterIO.LEADRasterIO.145")

2.

Set Raster | = Server.CreateObject("00120700-B1BA-11CE-ABC6-F5B2E79D9E3F")
Set RasterProc | = Server.CreateObject("00120712-B1BA-11CE-ABC6-F5B2E79D9E3F")
Set RasterIO | = Server.CreateObject("0012070E-B1BA-11CE-ABC6-F5B2E79D9E3F")

View the LEAD ASP demo by going to "http://www.leadtools.com" and clicking on the "Download Demos"

To install the ASP Lead demo on your web server, you must install and register the mentioned LEAD COM Objects on the web server. For a list of files that are necessary, see the Files To Be Included With Your Application. Next, copy the file demo.asp to the desired location on your web server. The location must be accessible through a client browser.

Open demo.asp in an editor, and change the two variables IMAGE_FOLDER, UPLOAD_FOLDER to map to directories on your web server. These directories must exist on your web server. If they do not exist, you must create the directories.

Change the two variables COM_IMAGE_FOLDER, COM_UPLOAD_FOLDER to have same values as IMAGE_FOLDER, UPLOAD_FOLDER respectively and replacing the single back slash "\" with a double back slash "\\".

Change the variables LOGO_IMAGE have the server path to a logo image used to be displayed to users each time they start the demo.

The following .cmp images must be present on the server under the path indicated by the variables IMAGE_FOLDER and COM_IMAGE_FOLDER:

Flowers.cmp , TeddyBear.cmp, NightLights.cmp, Santa.cmp, Turtle.cmp, Car.cmp, Faces.cmp, Cake.cmp, Athlete.cmp, Field.cmp

After installing your LEAD toolkit, copy all the *.cmp files from the LEAD\images folder to the This location, and rename files.

COM_UPLOAD_FOLDER and UPLOAD_FOLDER variables indicate the location used for temporary uploaded image files that are uploaded by users.

In the demo.asp demo, every action (i.e. "flip") generates a temp image that replaces the current image. HTML is generated to display this image, and this is sent to the client. This will work under Internet Explorer, but fail to work under certain versions of Netscape 4.0 because of a problem with caching images. The result is that once certain versions of Netscape 4.0 cache an image file, it always accesses the cached image instead of reloading from the server.

Modify the "global.asa" file on your webserver to initalize variables required by the demo. An example "global.asa" file is shown below.

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Application_OnStart
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Application_OnEnd
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnStart
Session("SelectedValue")= ""
Session("Start")= "true"
Session("CurAction")= ""
Session("Finish")= "false"
Session("ServerImage")=""
Session("Upload")="false"
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnEnd
Session("Finish")= "true"
END SUB
</SCRIPT>


Using the RTF Filter in Windows 98

In order for the RTF filter to function properly on a Windows98 machine:

Replace this DLL: | With this DLL:
riched20.dll version number: 5.30.23.1200 Description: Rich Text Edit Control, v3.0 size: 421 KB | riched20.dll version number: 5.30.23.1211 Description: Rich Text Edit Control, v3.0 size: 413 KB
And replace this DLL: | With this DLL:
riched32.dll version number: 5.1.330.0 Description: Windows 98 Rich Text Edit Control size: 200 KB | riched32.dll version number: 5.1.2600.0 Description: Wrapper DLL for Richedit 1.0 size: 4.0 KB


Programming with the LEADTOOLS Com Object

Programming with LEADTOOLS COM Object

The following topics provide a systematic approach to understanding and using the LEAD COM properties, methods, and events:

Registering and Unregistering the COM Objects and Controls

Unlocking Vector File Format Support

Using Cabinet Files for Packaging COM Object

Using LEAD RasterIO COM Object To Install LEAD Static Filters From Within A Web Page

Creating Instances of Licensed COM Objects

Concepts and Definitions

Bitmaps and Bitmap Lists

Loading Filters

Input and Output

Implementing Internet Features

Displaying an Image

Scrolling an Image

Cleaning Up 1-Bit Images

Thumbnail Browser

Using the Image List Control

Using a PanWindow

Implementing Transparency

PNG Files and Transparency

Implementing TIFF Tags

Using Special Effects When Painting

Using the Magnifying Glass

Using the Zoom View

Customizing Magnifying Glass Painting

Loading and Saving Large TIFF Files

Playing an Animation

Printing an Image

Marking a Selection with a Rubberband

Copying and Creating Bitmaps

Image Processing

Working with the MRC Bitmap

Understanding the Mixed Raster Content (MRC) Format

Compression Quality Factors in the Mixed Raster Content Object

Saving PDF Files with MRC Segmentation

Creating and Using a Bitmap Region

Managing Palettes

Implementing PDF Plug in Features

Working with the RAW File Filter

Implementing Annotations

Annotation Files

Annotation Menu

Annotation Toolbar

Implementing Annotation Security

Moving the Name of an Annotation

Implementing Annotation Hyperlinks

Low-Level Coordinate System for Annotations

Converting Annotation Automation Dialogs to Other Languages

Undoing Automation Operations

The Annotation Text Token Table

Fixed Annotations

Changing the Annotation Automation Pen Highlight Color

Using Rulers in Annotation Objects

Using Annotation Bitmap Objects

Displaying and Manipulating Annotation Objects

Obtaining Annotation Object Information

Flipping, Reversing, and Rotating Annotation Objects

Controlling and Detecting Events

Getting LEADTOOLS Toolkit Information

Miscellaneous Methods and Properties

Layers in Files

Super Compressed Bitmaps

Grayscale Images


Registering and Unregistering the Com Object Controls

Registering and Unregistering the COM Objects and Controls

Registering COM Objects and Controls

Before any COM Object can be used, it must be registered. The installation program automatically registers all the LEADTOOLS COM Objects and Controls. If you would like to manually register the controls run REGSVR32.EXE.

found in the BIN directory and pass the name of the control or object (.OCX or .DLL) to register as a parameter.

EX.:

REGSVR32 LTR14N.DLL will register the LEAD Raster Object Library.

REGSVR32 LTRVW14N.OCX will register the LEAD RasterView Control.

Unregistering COM Objects Controls

To unregister COM Objects, include the "/u" switch before the library name when running REGSVR32.EXE.

EX.:

REGSVR32 /u LTR14N.DLL will unregister the LEAD Raster Object Library.

REGSVR32 /u LTRVW14N.OCX will unregister the LEAD RasterView Control.

Note:

The LEADTOOLS COM Objects and controls do not register without certain DLLs. For a list of required DLLs, refer to Files To Be Included With Your Application.


Unlocking Vector File Format Support

Vector Toolkits

Support for the DXF, DWG, PCT, PLT, DRW, DGN, WMF, EMF and CGM file formats is provided in the LEADTOOLS Vector toolkits. This support is unlocked when the Vector features are unlocked by calling UnlockSupport(L_SUPPORT_VECTOR, L_KEY_VECTOR). The L_KEY_VECTOR key is provided when a LEADTOOLS Vector toolkits is purchased.


Concepts and Definitions

The LEADTOOLS COM Objects let you load images from files, manipulate them as bitmaps in memory, display them, manipulate the way they are displayed, prints them, and save them to files.

The following illustrates the fundamental components and their relationships:

ILEADRaster is the COM interface for managing a bitmap in memory. This interface provides functions for getting information about a bitmap, creating a new bitmap, working with the clipboard, etc.

ILEADRasterIO is the COM interface for performing image file formation input and output. This interface provides functions for reading and writing image files to disk, memory, or network locations. This interface also provides the functionality for doing image data compression and decompression.

ILEADRasterProcess is the COM interface for performing image processing on bitmaps. This interface provides functions for image filters, transforms, effects, etc.

ILEADRasterView is the COM object for displaying bitmaps. This is a full ActiveX Control that provides functionality for displaying, scrolling, zooming, printing, etc. The ILEADRasterView object contains an instance of ILEADRaster, which can be used with the other LEADTOOLS COM objects. This object is an ActiveX control that you add to your application. In the illustration, the control is the box inside the window where the image is displayed.

The bitmap is the image data in memory. The LEAD RasterView control references the bitmap. Most LEAD methods that alter an image (such as Grayscale or Rotate) actually alter the bitmap. If you alter a bitmap, the changes you make do not appear in the control until the image repaints. When you save a bitmap, the changes you have made are saved in the file.

The displayed image is the rectangle on the screen that shows all or part of the bitmap. It can be positioned, scaled, and cropped without affecting the image data in memory. For information on the source and destination rectangles that control which part of an image is displayed, refer to Specifying Only the Destination Rectangles, Specifying Both the Source and Destination Rectangles, Specifying the Source Clipping Rectangle and Specifying the Destination Clipping Rectangle. For more information about how to position, scale, and crop an image, refer to Displaying an Image.


Copying and Creating Bitmaps

Use the following methods for Clipboard input and output:

Copy method

Paste method

Use the following methods to copy the bitmap to or from a LEAD OLE Server control.

GetServerBitmap method

SetServerBitmap method

Use the following methods to copy the bitmap to or from a Picture object:

GetPicture method

SetPicture method

Use the following methods to copy the bitmap to or from a DIB or DDB:

GetDDB method

GetDIB method

SetDDB method

SetDIB method

Use the following property to create a bitmap from scratch:

CreateBitmap method

To create a user bitmap, use the CreateUserBitmap method. The user is responsible for allocating and maintaining the bitmap data pointer. The bitmap data pointer is set using the SetBitmapDataPointer method. These methods are useful when using images obtained from the LEADTOOLS Multimedia toolkit with the Main LEADTOOLS COM.

You can copy an object's entire list of bitmaps by assigning the BitmapList property from one object to another. You can free all of the bitmaps in the list by setting the property to 0.

You can copy one object's current bitmap to another object's current bitmap by assigning the Bitmap property from one object to the other. You can remove the current bitmap from the list (freeing the bitmap) by setting the Bitmap property to 0. When an object has only one bitmap, you do not have to set the BitmapListIndex property to specify the current bitmap.


Creating Instances of Licensed COM Objects

In some programming languages, such as Visual Basic, you cannot create instances of licensed COM objects. The ILTRasterFactory object/interface will allow you to create instances of licensed COM objects, such as the LEAD Raster COM Object, LEAD RasterView Control, and LEAD Dicom Kernel COM Object. The CreateObject method creates an instance of a licensed COM object and returns an IUnknown pointer to the created object. This is for use in Visual Basic. For ASP, VisualBasic Script and Java Script, LEADTOOLS provides the CreateObject2 method, which returns an IDispatch pointer to the created object.

Index words for this topic: Instances of licensed COM objects;Licensed COM objects;COM objects;Visual Basic;VB;ASP;VisualBasic Script;Java Script;Creating instances of licensed COM objects;ILEADRasterFactory


Memory Storage Types for Bitmaps

There are several types of bitmaps:

Conventional bitmaps: The most common bitmaps - support all bits/pixel and with the fastest access time. But they also require the highest amount of memory.

Compressed bitmaps: 1-bit only, using a proprietary RLE compression. They usually require less memory than the conventional bitmaps.

Super-Compressed bitmaps: 1-bit (uses Fax G4 compression), 8-bit, or 24-bit (uses MCMP compression) only. They require little memory but the read and write operations performed on the bitmap are slower. Also, the 24-bit and 8-bit compression are lossy, which means there is some small amount of degradation each time the 24-bit or 8-bit super-compressed bitmap changes. (The 1-bit super-compressed bitmap uses lossy compression, so there is never any quality loss).

Disk bitmaps: all the bitmap data is on disk. But a memory view is used to access the disk, which causes more and more conventional memory to be used the as you read or write more bitmap pixels.

Tiled bitmaps: the bitmap is broken into separate tiles. Tiles can be disk or conventional memory.

To instruct LEADTOOLS to react dynamically depending on the bitmap size or the amount of available memory, use the SetMemoryThresholds method. This method will use the values set in the following properties to set the thresholds:

MaxConventionalSize property

MemoryConventionalBuffers property

MemoryConventionalTiles property

TiledBitmapsSize property

MemoryFlags property

MemoryTiledThreshold property

When LEADTOOLS has to allocate a conventional bitmap, it does the following:

1. | If the size of the bitmap being allocated is less than the fixed tile size (set through the SetMemoryThresholds method when the TiledBitmapsSize property is > 0), the bitmap is allocated as conventional. If the allocation fails, the memory allocation function fails. If the allocation succeeds, the memory allocation function returns SUCCESS. No other steps are executed.
2. | Checks the maximum size for a conventional bitmap (set through SetMemoryThresholds). If the size of the bitmap being allocated is greater than this threshold, a tiled bitmap will be allocated. Go to step 5. If the size of the bitmap being allocated is lower than the threshold, go to step 3.
3. | Checks whether there is enough available memory to allocate a conventional bitmap. (This threshold is set in the MaxConventionalSize property). If there is not enough free memory, a tiled bitmap will be allocated and go to step 5. Else, go to step 4.
4. | Try to allocate a conventional memory bitmap (bitmap which is contained entirely in conventional memory. If the allocation succeeds, the memory allocation returns success and no other steps are performed. If the allocation fails, go to step 5.
5. | Try to allocate a tiled bitmap. There can be a mix of disk and conventional memory tiles. If the function succeeds, the allocation function returns success and no other steps are performed. If the allocation fails, go to step 6.
6. | Try to allocate a tiled bitmap. Return success if the allocation succeeds, error otherwise.

To get the memory threshold information set by the SetMemoryThresholds method, call the GetMemoryThresholds method.

By default, the Windows temporary directory is used to store the disk files used for the disk tiles and disk images. You can get or set the location where these files are stored using the TempDirectory property.

Even when you have lots of RAM and enough space in the swap file, Windows might fail to allocate you one contiguous chunk of conventional memory. In this case, the bitmap will be allocated as tiled or disk.

Example: You attempt to allocate a 512MB bitmap. Windows might fail to allocate a contiguous 512MB memory chunk, but it might be able to allocate you 2x 256 MB chunks or 4x 128 MB chunks. In this case, LEADTOOLS allocates your 512MB bitmap using several smaller chunks in a tiled bitmap.

In a more extreme case, you might have not enough space to allocate the whole bitmap in conventional memory. Or you might have specified a maximum amount of conventional memory to be used with a bitmap. In either of these cases, LEADTOOLS will try to allocate a tiled bitmap with some tiles in conventional memory and others on disk.

The conventional memory tiles are always accessible (read further to see why this matters). Disk tiles will still need some chunks of conventional memory to read from disk/write to disk. We will refer to these chunks as "views". The more views you have, the more disk tiles can be accessed at a time and the faster the working with the bitmap will be. When you read or read from a disk tile, data is being cached to the view and no disk access is performed unless you move to another tile. The "move to another tile" operation is performed automatically when you read or write data to a certain row.

When you go to a disk tile that has no view, LEADTOOLS will:

create a new "view" (if you have not exceeded the maximum allowed of views and you have available memory) or

discard an old view and reassign it to the new tile. When the old view is discarded, data is written to the disk (if it has been modified since it was read). The writing of data to disk will cause a performance hit.

You can find out the memory allocation parameters for a bitmap using the GetMemoryInfo. You can change the memory allocation parameters using the SetMemoryInfo method. The memory properties are:

The MemoryInfoType property (conv, tiled, disk, etc)

These are for tiled bitmaps only:

The MemoryInfoTotalTiles property

The MemoryInfoTileSize property

The MemoryInfoConventionalTiles property

The MemoryInfoMaxTileViews property (for disk tiles only)

The MemoryInfoTileViews property (for disk tiles only)


Getting LEADTOOLS Toolkit Information

Use the following to get information about the LEADTOOLS toolkit:

AboutBox method


Using LEAD RasterIO COM Object To Install LEAD Static Filters From Within A Web Page

You can install any of the LEAD static filters from within a web page using the LEAD RasterIO COM Object. Use the SetFilterUrl method to specify the Url from which to install the filter(s). To begin installing, use the InstallFilter method. This method will determine whether the filter already exists. If the filter does not already exist, it will be installed. During installation a string will be displayed. To get or set this string use the InstallFilterMsg property. The SetFilterUrl method must be called before each call to the InstallFilter method.


Controlling and Detecting Events

The following topics describe how to control and detect events:

Controlling Events

Detecting Events


Controlling Events

Use the following properties to control the generation of error, status, and events:

EnableMethodErrors property

EnableSaveBufferEvent property

EnableProgressEvent property


Detecting Events

The LEAD control recognizes the following events:

Animate event

Change event

Click event

DblClick event

EnableFireMouse2Event property

EnableMouseWheel property

FilePage event

KeyDown event

KeyPress event

KeyUp event

LoadInfo event

MouseDown event

MouseDown2 event

MouseMove event

MouseMove2 event

MouseUp event

MouseUp2 event

MouseWheel event

Paint event

ProgressStatus event

Resize event

RubberBand event

SaveBuffer event

Scroll event


Using ILEADRasterVariant object

Use the ShortValue property for the following values:

To set a character value, set the Type property to VALUE_CHAR.

T o set a byte value, set the Type property to VALUE_BYTE

T o set a short value, set the Type property to VALUE_SHORT

Use the LongValue property for the following values:

T o set an unsigned short value, set the Type property to VALUE_USHORT

T o set a long value, set the Type property to VALUE_LONG

T o set an integer value, set the Type property to VALUE_INT

Use the DoubleValue property for the following values:

T o set a double value, set the Type property to VALUE_DOUBLE

T o set an unsigned long value, set the Type property to VALUE_ULONG

T o set an unsigned integer value, set the Type property to VALUE_UINT

Use the FloatValue property for the following value:

T o set a float value, set the Type property to VALUE_FLOAT

Use the BooleanValue property for the following values:

T o set a Boolean value, set the Type property to VALUE_BOOLEAN

Use the StringValue property for the following values:

T o set a string value, set the Type property to VALUE_STRING

Use the DispatchValue property for the following values:

T o set dispatch value, set the Type property to VALUE_DISPATCH

Use the ShortItemValue property for the following values:

T o set an array of bytes, set the Type property to VALUE_ARRAY_BYTE

T o set an array of short values, set the Type property to VALUE_ARRAY_SHORT

Use the LongItemValue property for the following values:

To set an array of unsigned short values, set the Type property to VALUE_ARRAY_USHORT

T o set an array of long values, set the Type property to VALUE_ARRAY_LONG

T o set an array of integer values, set the Type property to VALUE_ARRAY_INT

Use the DoubleItemValue property for the following values:

T o set an array of double values, set the Type property to VALUE_ARRAY_DOUBLE

T o set an array of unsigned long values, set the Type property to VALUE_ARRAY_ULONG

T o set an array of unsigned integer values, set the Type property to VALUE_ARRAY_UINT

Use the FloatItemValue property for the following values:

T o set an array of float values, set the Type property to VALUE_ARRAY_FLOAT

Use the BooleanItemValue property for the following values:

T o set an array of Boolean values, set the Type property to VALUE_ARRAY_BOOLEAN

Use the StringItemValue property for the following values:

T o set an array of strings, set the Type property to VALUE_ARRAY_STRING

Please note that the Type property and the vType property contain the same information and serve the same purpose. However, in VB Script "Type" is a keyword, so the Type property does not work. In VB Script, you must use the vType property.

Before setting an array item value, you should specify the item count by setting the ItemCount property.

To get the last operation error, read the Error property value.

Use EnableMethodErrors property to determine whether you need to get error runtime exceptions or not.


Using Cabinet Files for Packaging COM Object

The tools you need to create and sign CAB files are provided on the Visual C++® 5.0 CD in the CAB&SIGN directory. The utilities in the CAB&SIGN directory are not installed automatically when you install Visual C++, so you must copy the contents of the CAB&SIGN directory to your hard drive.

Before you can sign files, you need to get a Software Publisher Certificate. You must apply for your own certificate to a Certification Authority. With the tools in the CAB&SIGN directory, you can create a test certificate for testing purposes, but this certificate cannot be used to sign code for distribution. See Step 1 below for information about applying for a Software Publisher Certificate.

These are the steps used to create a signed CAB file. Each step provides a link to further information concerning that particular step.

Step 1 Get a Software Publisher Certificate (CAB) (you only need to do this once).

Step 2 Create the CAB File.

Step 3 Signing the CAB Files.

Step 4 Embed the Signed CAB File in a Web Page (optional).


Get a Software Publisher Certificate (CAB)

Step 1 Get a Software Publisher Certificate (CAB)

Before you can sign files, you need to obtain a Software Publisher Certificate (SPC). To do this, you must make a request to a Certification Authority. During the application process, you must generate a key pair and provide the Certification Authority with identification information, such as your name, address, and public key. You must also make a legally binding pledge that you cannot and will not distribute software you know or should have known contains viruses or will otherwise maliciously harm the user's machine or code.

To apply for a certificate, see "Digital Certificates for Authenticode" at

http://msdn.microsoft.com/workshop/security/authcode/certs.asp

The Certification Authority generates a Software Publisher Certificate that conforms to the industry standard X.509 certificate format with Version 3 extensions. The certificate identifies you and contains your public key. The Certification Authority stores it for reference and a copy is returned to you via electronic mail. After accepting the certificate, you should include a copy of it in all published software signed with the private key.

Note: For testing purposes a test certificate is used for signing your CAB file. For more information, refer to Making a Test Software Publisher Certificate below.

Making a test Software Publisher Certificate

You can use the MAKECERT and CERT2SPC utilities provided in the CAB&SIGN directory on the Visual C++ 5.0 CD to make a test Software Publisher Certificate. Note that this test SPC is not valid for software publishing, but can be used to test code signing.

To make a private key file called MYKEY.PVK and a company certificate called CERT.CER, run the MAKECERT utility with the following command:

C:\CAB&SIGN\MAKECERT -u:MyKey -n:CN=MySoftwareCompany
–k:MYKEY.PVK CERT.CER

MyKey is the name you give to your key and MySoftwareCompany is the name of your company. Note that the MAKECERT utility is case sensitive to command-line options, so you must use lowercase -u, -n, and -k. The value for the -n option must be an uppercase CN=.

To create a test Software Publisher Certificate (SPC) called CERT.SPC, run the CERT2SPC utility with the following command:

C:\CAB&SIGN\CERT2SPC C:\CAB&SIGN\ROOT.CER CERT.CER CERT.SPC

Note that the CERT.SPC file is created from the CERT.CER file you created with MAKECERT and from the ROOT.CER file provided in the CAB&SIGN directory.

Signing Cabinet Files

A .cab file can be digitally signed like an COM Object. A digital signature provides accountability for software developers: The signature associates a software vendor’s name with a given file. A signature is applied to a .cab file (or control) using Microsoft Authenticode Technology.

The CAB toolset assists software developers in applying digital signatures to CAB files by allowing a developer to allocate space in the CAB file for the signature (See Step 3 Signing the CAB Files )


Create the CAB File

Step 2 Create the CAB File

This section describes creating CAB files for distributing ATL and MFC controls over the Internet. If you need more information about CAB files, see the Cabinet File Reference in the Platform SDK section Setup and System Management Services\Setup API\Overview\Cabinet Files. The Platform SDK is included with the Visual C++ 5.0 online documentation and in the MSDN Library.

To create a CAB file:

1. Create an INF file (see Creating an INF File below).

2. Run the CABARC utility (available in the CAB&SIGN directory on the CD) to make the CAB file.

INF Files

An .inf file contains data that Microsoft® Windows 95/98, Windows NT 4.0, and Windows 2000 and later use to load and register a bundled control (as well as any files required by that control). Each section of the .inf file is described below.

Read Carefully:

Before talking about the sections of the .inf file let’s take the following scenario:

A developer created an COM Object using ATL. The control is called MyCtrl.ocx which, in order to run, needs the dependent DLL called MyFile.DLL.

The developer wants to package the COM Object with its related DLL into a .cab file that is distributable over Internet.

Note: since the control was created using ATL then atl.dll is needed on the user machine in order to run the control.

The developer wrote the following MyFile.inf:

[version]
signture="$CHICAGO$"
AdvancedINF=2.0

[Add.Code]
MyFile.DLL = MyFile.DLL
ATL.DLL = ATL.DLL
MyCtrl.ocx = MyCtrl.ocx

[MyFile.DLL]
file-win32-x86=thiscab
FileVersion=
DestDir=11
RegisterServer=yes

[ATL.DLL]
file-win32-x86=thiscab
FileVersion=
DestDir=11
RegisterServer=yes

[MyCtrl.ocx]
file-win32-x86=thiscab
clsid={46A5E7C2-3003-11D4-8735-00E0295AF9CE}
FileVersion=
DestDir=11
RegisterServer=yes

All explanations that follow depend on the above mentioned scenario.

Creating the .INF File

The first section in the .inf file is the [version] section. In the sample .inf, this section has the following format:

[version]
signature="$CHICAGO$"
AdvancedINF=2.0

The signature= tag specifies that the .inf version is compatible with Windows 95/98, Windows NT 4.0, and Windows 2000 and later.

The AdvancedINF= tag identifies the version of Advpack.dll that Internet Explorer 4.0 must load in order to parse this .inf file. In this case, version 2.0 is required.

The [Add.Code] Section of the .inf File:

The second section of the .inf file is the largest section. In addition to the section immediately following the [Add.Code] tag, this section includes the subsections that are identified by the [MyFile.DLL], [atl.dll], [MyCtrl.ocx] tags.

The [Add.Code] section maps files required by a given .ocx file to subsections in the .inf file. In the sample .inf file, this section has the following format:

[Add.Code]
MyFile.DLL = MyFile.DLL
ATL.DLL = ATL.DLL
MyCtrl.ocx = MyCtrl.ocx

The First line in this section maps MyFile.DLL (the file that contains the needed DLL) to a subsection of the same name.

The Second line in this section maps ATL.DLL to a subsection of the same name. The ATL.DLL is required on a user's computer before the control will successfully run.

The Third line in this section maps MyCtrl.OCX (the file that contains the sample control) to a subsection of the same name.

[MyFile.DLL]
file-win32-x86=thiscab
FileVersion=
DestDir=11
RegisterServer=yes

The first line in this subsection specifies that the x86 binary is found in the same .cab file as the .inf file.

The second line specifies the File’s version.

The Third line in this subsection specifies the destination directory on the user’s machine where the file will be installed.

The fourth line specifies that Internet Explorer 4.0 and later should register the control (using the specified version number).

[ATL.DLL]
file-win32-x86=thiscab
FileVersion=
DestDir=11
RegisterServer=yes

The first line in this subsection specifies that the x86 binary is found in the same .cab file as the .inf file.

The second line specifies the File’s version.

The Third line in this subsection specifies the destination directory on the user’s machine where the file will be installed.

The fourth line specifies that Internet Explorer 4.0 and later should register the control (using the specified version number).

The [MyCtrl.ocx] subsection of the [Add.Code] section:

The [MyCtrl.ocx] subsection has the following format:

[MyCtrl.ocx]
file-win32-x86=thiscab
clsid={46A5E7C2-3003-11D4-8735-00E0295AF9CE}
FileVersion=
DestDir=11
RegisterServer=yes

The first line in this subsection specifies that the x86 binary is found in the same .cab file as the .inf file.

The second line specifies the control's CLSID.

The third line specifies the control's version.

The fourth line in this subsection specifies the destination directory on the user’s machine where the file will be installed.

The fifth line specifies that Internet Explorer 4.0 and later should register the control (using the specified CLSID and version number).

Important Note: Note that if your control requires that a DLL be registered before the control (as required in our scenario), its corresponding entry in the .inf file must precede the control's entry in the file. Also, note that the order of the source files in the command line that is passed to Cabarc.exe must match the order of the file references in the .inf file.

Building the .cab File

Once you have installed Cabarc.exe and built the .inf file for your package, you can build the cab file. In the case of the sample .cab file, this entailed running Cabarc.exe with the following arguments:

C:\cab&sign\Cabarc –s 6144 n MyControl.cab MyFile.DLL MyCtrl.ocx MyFile.inf

Where MyControl.cab is the name of the generated .cab file.

(C:\cab&sign\Cabarc can be written at the command prompt for a list of options for the utility Cabarc.exe)

Note:

1.The order of the files is related to the order indicated inside the .inf file.

2.You must run the Cabarc.exe in the directory containing your control .inf files.


Signing the CAB File

Step 3 Signing the CAB File

When IE 4.0 and later versions are running at the default security level, any object identified by the OBJECT object on an HTML page must be digitally signed.

A digital signature associates a software vendor’s name and a unique public key with a file that contains an Com Object object.

The test certificate generated before can be used to sign the CAB file.

Use the signcode.exe utility (and accompanying wizard), to sign the .cab file

C:\CAB&SIGN\Signcode

If the signcode is successful, it will have embedded a PKCS7 certificate in the cab file.

If you package your control in one or more .cab files, each file must be digitally signed.


Embed the Signed CAB File in a Web Page

Step 4 Embed the Signed CAB File in a Web Page

An COM Object is identified by the OBJECT object in an HTML file. If the control is stored in a .cab file, OBJECT must include a CODEBASE= attribute that specifies the URL of this .cab file.

Example:

<OBJECT CLASSID="CLSID:46A5E7C2-3003-11D4-8735-00E0295AF9CE"
codebase="http://webserver/MyControl.cab"
ALIGN ="CENTER" WIDTH=400 HEIGHT=300 ID="MyCtrl2">


Input and Output

The following topics describe the kinds of input and output:

Loading a Bitmap from a File

Loading a Bitmap from Your Own Buffer

Loading Vector Files

Saving a Bitmap to a File

Maintaining File Comments

Implementing PhotoCD and FlashPix Features

Implementing JBIG Features

Implementing JPEG 2000 Plug in Features

Implementing PDF Plug in Features

Managing Images in a Database

Using the OLE DB Control

Using Memory-Resident Image Files

Capturing an Image from the Screen

Using ISIS to Scan Images

Markers

Handling CMYK Files as Separate Bitmaps


Loading Filters

So

me operating systems (like Windows 95) have a limit for the number of DLLs that can be loaded at a time and that limit can be quickly reached, especially if there are several different controls on the same page/form or if the programming environments themselves load many DLLs. By default, LEADTOOLS loads several fixed filters and several cached filters. The fixed filters are FAX, CMP, TIF, JBG, LMB, BMP and PCX. The cached filters are a random selection of filters.

Use the following method to specify the file format filters you want LEADTOOLS to load:

PreLoadFilters method

Use the following method to specify the file formats LEADTOOLS should never load:

IgnoreFilters method


Loading a Bitmap from a File

Use the following method to load a file into a bitmap. In most cases, this method is all you need to load a file. Other methods and properties listed in this topic are for optional features and special cases.

Load method

To load an image from a file and resize it as it is being loaded to the desired width, height and bits per pixel, use the following method:

LoadResize method

To load an image from a specific location within a file, use the following method:

LoadOffset method

To load a file asynchronously from an Internet URL or local pathname, refer to Implementing Internet Features.

LEADTOOLS supports loading TIFF CMYK files without converting the data to BGR. This is done by loading each CMYK plane as a separate LEADTOOLS bitmap using the LoadFileCMYKArray method. For more information, refer to Handling CMYK Files as Separate Bitmaps.

When loading CMYK or CIELab files, you can use the fast color conversions, by calling the UseFastConversion property.

Use the following properties and event to control loading an image through an OLE drag-and-drop operation:

OLEDropAllowed property

OLEDropFile event

Use the following method to load a thumbnail (stamp image) into a bitmap from a JFIF or LEAD CMP file:

LoadStamp method

Use the following method to get information about a file before loading it:

GetFileInfo method

Then, read the following properties, which the method updates:

InfoBits property

InfoCompress property

InfoFormat property

InfoHasAlpha property

InfoHeight property

InfoLayers property

InfoPage property

InfoPCDRes property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoViewPerspective property

InfoWidth property

InfoXRes property

InfoYRes property

Use the following property to let the user see the progress when loading a bitmap:

PaintWhileLoad property

Bitmap data can be signed or unsigned. If the bitmap data is signed, the image processing and paint methods may not work correctly. A bitmap will not be loaded signed unless the LoadSigned property is set to TRUE before loading the image. For more information on this, refer to Examining and Altering Bitmaps.

Use the following property to specify the number of paint-while-load passes when the file is a progressive LEAD or JPEG file, or when it is an interlaced PNG file:

ProgressivePasses property

Use the following property to specify which of the available resolutions in a PCD file to load:

PCDRes property

The WMFResolution property sets the DPI (dots per inch) value that LEADTOOLS uses when loading WMF files.

When loading DJVU files, you can use the DJVResolution property to get or set the current display resolution used by LEADTOOLS when loading a DJVU file. The default value for this property is 96 DPI.

When loading PTOCA and AFP:PTOCA files, you can use the PTKResolution property to get or set the current display resolution used by LEADTOOLS.

When loading RTF files, you can use the RTFTopMarg, RTFBottomMarg, RTFRightMarg, RTFLeftMarg, RTFPaperWidth, and RTFPaperHeight properties to get or set the current value for the control options used by LEADTOOLS.

When loading HPGL files, you can use the PLTPenColor property and the PLTPenWidth property to get or set the current value for the control options used by LEADTOOLS.

For PCD and FlashPix files, additional methods and properties are described in Implementing PhotoCD and FlashPix Features.

Use the following property to let a bitmap with a rotated view perspective keep its internal orientation when it is loaded.

LoadUseViewPerspective property

Use the following property to indicate whether to load images compressed or uncompressed:

LoadCompressed property

Use the following properties, if necessary, to supply format information about the image data that is being loaded. You can use this feature for loading input data (such as raw fax) that LEADTOOLS cannot recognize. When loading an image from a file, LEADTOOLS normally determines the file format from the file header, and if the format is unrecognized, the function returns an error. The LoadInfo event occurs before the error, if the EnableLoadInfoEvent property has been set to true. (If the EnableLoadInfoEvent property is set to false, this event is not generated.) You can set these properties in that event (or anywhere else in your program) to supply the missing format information and prevent the error. (LEADTOOLS checks for a non-zero value in the LoadInfoFormat property, but to implement this feature, you need to set all of the properties to appropriate values.)

LoadInfoBits property

LoadInfoFlags property

LoadInfoFormat property

LoadInfoHeight property

LoadInfoOffset property

LoadInfoWidth property

LoadInfoXRes property

LoadInfoYRes property

ColorSpace property

IgnoreViewPerspective property

To set the file format to try first when recognizing files for loading, set the PreferredLoadFormat property.

Please note that the Document/Medical editions also support the loading and saving of Mixed Raster Content (MRC) files. The Mixed Raster Content format was defined for use for color and grayscale fax as part of the RFC-2301, File Format for Internet Fax. The Mixed Raster Content mode (T.44) enables different coding methods and resolutions to be used within a single page by defining a 3-layer image model for structuring and combining the scanned image data.

LEADTOOLS will attempt to load corrupted files, so you can see at least a portion of the image. For these images, the load functions will return SUCCESS, but the LoadStatus property will be updated with an error code.

When loading TXT files, you can use the following properties to get or change the current values for the control options used by LEADTOOLS:

TXTBold property

TXTBottomMarg property

TXTEnabled property

TXTFaceName property

TXTFontColor property

TXTFontSize property

TXTHighlight property

TXTItalic property

TXTLeftMarg property

TXTPaperHeight property

TXTPaperWidth property

TXTRightMarg property

TXTStrikeThrough property

TXTTopMarg property

TXTUnderLine property

To use the fast loading algorithm while loading LEAD ABC files, use the FastLoad property. The fast loading algorithm provides faster loading with less image details.


Loading a Bitmap from Your Own Buffer

You can use the following methods to control the input stream in a file-load process. This is especially useful for handling a transmitted image, such as an image received over the Internet. These methods let you collect image data in your own buffer and feed the data to the LEAD object little-by-little, each time your buffer fills.

StartFeedLoad method

FeedLoad method

StopFeedLoad method


Loading and Saving Large TIFF Files

TIFF files can contain large numbers of pages. This can make loading and saving these TIFF files very time consuming. To speed-up both the loading and saving of very large TIFF files, LEADTOOLS provides several properties.

The InfoIFD property contains an offset to the current page of a TIFF file. The page starting at this offset is considered page one, the next page is considered page 2, and so forth. The value of the InfoIFD property can be used for the LoadIFD and SaveIFD properties.

When loading a page from a TIFF file, setting the LoadIFD property tells the control to treat the page beginning at the specified offset as page 1. Therefore, the control does not have to go through all pages from the beginning of the file prior to loading the desired page.

Similarly, when saving a page to a TIFF file, setting the SaveIFD property tells the control to treat the page beginning at the specified offset as page 1. Pages after this offset can be replaced, appended or deleted more quickly, since the control does not have to go through all pages from the beginning of the file.

If you are loading a TIF or Exif file that looks rotated or flipped, try setting the IgnoreViewPerspective property before loading the file. To load the file as TOP_LEFT, pass TRUE to the IgnoreViewPerspective property, otherwise pass FALSE.

The CompactFile method lets you compact TIFF files. It also lets you copy or extract one or more pages from a TIFF file and copy them without recompression to another TIFF file.


Loading Vector Files

LEADTOOLS provides support for working with several vector file formats. The most extensive support is available in selected products only.

Depending on the toolkit, support for certain vector file formats may require purchasing a file format plug in. In addition, the vector file format support must be unlocked. For more information about vector file format support, refer to Unlocking Vector File Format Support. For more information on available File Format Plug ins, refer to Topic Selection and click on LEAD Products.

When working with Vector files, you can use the Vector features, available in selected products, or you can use the ILEADRasterIO object. If you use the ILEADRasterIO object for loading, using the standard loading methods, you can modify the view port and view mode using the following:

RasterizeViewMode property

RasterizeViewportHeight property

RasterizeViewportWidth property


Saving a Bitmap to a File

Use one of the following methods to save the bitmap in a file:

Save method

SaveWithStamp method

If you are saving a progressive JPEG or CMP file, set the following property to specify the number of passes in the file:

ProgressivePasses property

If you are saving a GIF file, set the following property to specify whether it is saved as an interlaced file:

SaveInterlaced property

If you are saving an animated GIF file, information specified in the animation playback properties is saved in the file. For details, refer to the description of the Save method.

When saving a TIFF 1-bit image, you can save it least significant bit first or most significant bit first by setting the SaveLSB property.

TIF files can be saved in strips or they may be saved in tiles. The SaveTileWidth property determines whether a TIF files will be saved in strips or tiles. If it is set to 0, TIF files will be saved in strips. If the SaveTileWidth property is greater than the bitmap width, the TIF file will be saved in strips. If the SaveTileWidth property is less than the bitmap width, the TIF file will be saved in tiles and the SaveTileHeight property will determine the height of the tiles.

To save a bitmap as TIFF CMYK, call the SaveFileCMYKArray method. For more information, refer to Handling CMYK Files as Separate Bitmaps.

When saving a page to a multi-page file, the new page either replaces an existing page or is inserted before an existing page. Set the following property to determine which page to replace, or where to insert the new page.

SavePage property

Regions are saved automatically inside TIFF files. For more information, refer to Saving a Region.

If you are saving a multi-page TIFF file, use the SavePageNumberTag property to indicate whether to update the PageNumber tag associated with each page of the file.

The SaveOffset method saves a bitmap to a file, starting at a specified offset. This enables you to embed an image file in another file. After calling the SaveOffset method, the FileSizeWritten property is updated with the length of the file written, in bytes.

When saving RAW uncompressed data, the SavePad4 property can be used to determine whether or not to pad each line so the length is a multiple of four bytes. For more information on saving RAW uncompressed data, refer to Working with the RAW File Filter.

For FlashPix files, additional considerations are described in Implementing PhotoCD and FlashPix Features.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

Saving LEAD TIFF LZW files uses the standard LZW compression, which uses CLEAR codes. Some IBM decoders cannot handle early CLEAR codes. To solve this problem, the user may use the LZWAutoClear property to enable or disable automatically inserting CLEAR codes during LZW compression.

When saving JBIG2 files, you can use the following properties to get or change the current values for the control options used by LEADTOOLS:

JBIG2GBATX1 property

JBIG2GBATY1 property

JBIG2GBATX2 property

JBIG2GBATY2 property

JBIG2GBATX3 property

JBIG2GBATY3 property

JBIG2GBATX4 property

JBIG2GBATY4 property

JBIG2TemplateType property

JBIG2SaveFlags property

Related topics:

Saving a Region


Thumbnail Browser

LEADTOOLS Raster Thumbnail Browser Control provides a thumbnail browser that browses a specified directory for images supported by LEADTOOLS. For each supported image, a thumbnail image is generated. In addition, the Thumbnail Browser also lets you create a thumbnail from a specific image file.

To browse a directory, call the BrowseDir method. For each thumbnail image generated, a ThumbnailEvent event occurs. To generate a thumbnail from a specific image file, call the CreateThumbnailFromFile method. The thumbnail image generated using this method can also be processed through the ThumbnailEvent event.

The browse process can be modified using the following properties:

ContinueBrowse property

ExpandMultipage property

Filter property

IncludeSubDirectories property

LoadStamp property

MaxSizeDisk property

MaxSizeMem property

SkipFile property

StopOnError property

In addition, you can modify thumbnail characteristics using these properties:

DitherFlags property

ForceSize property

MaintainAspect property

PaletteFlags property

Resample property

ThumbnailBackgroundColor property

ThumbnailBitsPerPixel property

ThumbnailHeight property

ThumbnailWidth property

To gain information about the file, from which the thumbnail images were generated, use the following properties:

InfoBits property

InfoCompression property

InfoFormat property

InfoHeight property

InfoPage property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoWidth property

InfoXRes property

InfoYRes property

The EnableMethodErrors property facilitates controlling error handling for the object.


Using Memory-Resident Image Files

The following properties, methods and events let you work with files that are stored in memory in their original formats:

EnableSaveBufferEvent property

ArraySize method

GetMemoryInfo method

GetArrayInfo method

LoadArray method

LoadBuffer method

LoadMemory method

SaveArray method

SaveBuffer event

SaveBuffer method

SaveBufferAddress property

SaveBufferSize property

SaveMemory method

The SaveMemory method saves single-page files to memory. To save multi-page files use the SaveMemory2 method. The handle to the file is contained in the SaveMemory2Handle property and the size of the file is contained in the SaveMemory2Size property.


Capturing an Image from the Screen

Use the following method to capture an image from a device context (usually the screen) and load it into the bitmap:

Capture method

Use the following to capture and zoom in on an image:

EnableZoomInRect property

ZoomIn method

ZoomInDone event

LEAD also provides a LEAD Screen Capture control that provides more versatility in capturing images from the screen. For more information, refer to the Screen Capture Help File (Ltscrocxn.hlp, Ltscrocxe.hlp or Ltscrocxc.hlp).


Drag and Drop

LEADTOOLS provides properties and events that support the drag and drop process in the ILEADRasteImgList control and in the ILEADRasterView control. The properties and events of the ILEADRasteImgList control let you drag an image that is open in one ILEADRasteImgList control and drop it in another ILEADRasteImgList control. The properties and events of the ILEADRasterView control let you drag an image that is open in one ILEADRasterView control and drop it in another ILEADRasterView control.

To begin the drag and drop process, you must enable the process by setting the EnableOLEDragMethod property (ILEADRasterView) or the EnableOLEDragMethod property (ILEADRasterImgList) to TRUE, depending on the control you are using. If you are working with the ILEADRasterImgList control you must also set the AllowSelection property to ALLOWSELECTION_SINGLE.

With the drag and drop process enabled, select an image within the ImageList control or press the left mouse button within the Main control and begin dragging. This will generate the OLEStartDrag event (ILEADRasterImgList) if you are working with the ImageList control, or it will generate the OLEStartDrag event (ILEADRasterView) if you are working with the ILEADRasterView control.

As you continue to drag the image, two more events are generated repeatedly for each control. If you are working in the ILEADRasterImgList control the OLEDragOver event (ILEADRasterImgList) and the OLEGiveFeedback event (ILEADRasterImgList) are generated. If you are working with the ILEADRasterView Control, the OLEDragOver event (ILEADRasterView) and the OLEGiveFeedback event (ILEADRasterView) are generated. The OnOLEDragOver event receives information concerning the button(s) used in the dragging process and the location of the cursor during the dragging process. The OnOLEGiveFeedback event receives a parameter that is used to indicate which cursor to use during the dragging process. By setting the parameter received by the OnOLEGiveFeedback event to FALSE, a custom cursor can be displayed during the dragging process. The custom cursor that will be used in this case is set in the OLEDragCursor property (ILEADRasterView). Custom cursors can also be used for the ImageList Control. However, in the ImageList control the EnableUseDefaultCursor property must be set to FALSE for the custom cursor in the OLEDragCursor property (ILEADRasterImgList) to be used.

When the dragging process is finished and you drop the image into the target control, an OLECompleteDrag event (ILEADRasterView) or OLECompleteDrag event (ILEADRasterImgList) is generated.


A Special Note About Loading 12 and 16-Bit Grayscale Images

If the image to be loaded is 12 or 16-bit grayscale and 0 is passed for the parameter that controls the number of bits per pixel at which to load the image, then if L_SUPPORT_EXTGRAY support is locked, the image will be loaded as 8-bit grayscale, instead of the original bits per pixel.

For more information on the L_SUPPORT_EXTGRAY support, refer to the UnlockSupport method.


Using ICC Profile Functionality

The ICC Profile format is defined by the International Color Consortium (ICC). For background on the origination and purpose of this format, refer to www.color.org.

Loading an ICC Profile

To load an ICC profile from an image file, call the LoadICCProfile method or the LoadICCProfile2 method. These methods fill the pData parameter with a pointer to one block of memory that contains the entire ICC profile. The only difference in these two methods is the data type of the pData parameter. The LoadICCProfile method loads the profile data into an ILEADRasterVariant object while the LoadICCProfile2 method loads the data into a VARIANT byte array.

Saving an ICC Profile

ICC profiles can be embedded in image files and loaded at a later date. An ICC profile can be saved, or embedded, in a TIFF, GIF or JPEG image file by calling the SaveICCProfile method or the SaveICCProfile2 method. Like the LoadICCProfile an LoadICCProfile2 methods, the SaveICCProfile and SaveICCProfile2 methods differ only in the data type of the pData parameter. The SaveICCProfile method saves the ICC profile data from an ILEADRasterVariant object to the file. The SaveICCProfile2 method saves the profile data from a VARIANT byte array to the file.


Handling CMYK Files as Separate Bitmaps

LEADTOOLS supports loading TIFF CMYK files without converting the data to BGR. This is done by loading each CMYK plane as a separate LEADTOOLS bitmap using the LoadFileCMYKArray method. Alpha channel information can be loaded or ignored as follows:

to ignore alpha information, set the CMYKRasterCount property to 4.

Or :

to load alpha information, set the CMYKRasterCount property to 5. (The alpha channel will be stored in the 5th element of the array).

Call the LoadFileCMYKArray method to load the CMYK planes and fill the CMYKRaster property.

If the source file is not in the TIFF CMYK format, load the bitmap normally with the LoadResize method, the Load method, the LoadOffset method, or the LoadMemory method and then obtain the CMYK planes by calling the ColorSeparate method.

Paint the bitmaps by passing a valid Raster IO object to the RasterIO property and passing TRUE to the EnablePaintCMYKArray property.

To save the bitmap as TIFF CMYK, call the SaveFileCMYKArray method.

To save the array of bitmaps to a file format not supported by this function, call the ColorMerge method to create a BGR bitmap and save the generated bitmap using the Save method.

The bitmap can be manipulated by manipulating each plane independently. Be careful when doing this. Some transformations should be done to all of the planes, while others should be done only to a particular plane.

For example, when performing a spatial transformation (flip, resize, rotate, etc), perform the same spatial transformation on all of the planes. Otherwise, there may be unwanted or unexpected results.

Other transformations should be done to a particular plane. For example, the K plane controls the amount of black ink. Changing the intensity of the K plane will darken or lighten the bitmap. Changing the brightness of one of the other planes will change the color rather than the image brightness. Be sure to study how the CMYK planes are combined to make the final image, in order to have a good understanding of what is needed to achieve a particular result.


Saving Window-Leveled Bitmaps

Note:

This topic is for Document/Medical only.

Only TIFF and DICOM file formats are capable of saving bitmaps that have been window-leveled. Bitmaps can be window-leveled by calling the WindowLevel method (ILEADRasterProcess) method or by loading a bitmap from a file format that supports window-leveling. If a window-leveled bitmap is saved as any other file format, the bitmap data will be converted before being saved. The conversion is done as follows:

the data is converted to the full bit range (LowBit = 0, HighBit = BitsPerPixel – 1)

the LUT is converted so first entry = 0 (BLACK) and last entry = 255 (WHITE).

When the bitmaps are saved as DICOM or TIFF, no conversion is made.


Managing Images in a Database

The LEADTOOLS COM supports database access using Open Database Connectivity (ODBC). For more information about the ODBC requirements, refer to Using ODBC.

Use the following methods to open and close the database. (The dbOpen method identifies not only the database, but also the recordset to be accessed and the field that is used for LEADTOOLS images.)

dbOpen method

dbClose method

Use the following methods to access an existing record:

dbMove method

dbMoveFirst method

dbMoveLast method

dbMoveNext method

dbMovePrev method

Use the following property to control how the image is loaded from the database field into the bitmap:

dbLoadBits property

Use one of the following methods to indicate whether you are adding a new record or editing the current one:

dbAddNew method

dbEdit method

When updating an existing record, use the following property to control record locking:

dbLockingMode property

When adding or updating an image, use the following method to store the image in the field:

dbUpdate method

Use the following method to delete the current record:

dbDelete method

Use the following method to verify your changes in the database:

dbRequery method

Use the following properties to get information about the database and your connection to it:

dbCanAppend property

dbCanRestart property

dbCanScroll property

dbCanUpdate property

dbCurrentRecord property

dbEditMode property

dbIsBOF property

dbIsDeleted property

dbIsEOF property

dbIsOpen property

dbRecordCount property

Use the following properties to access the internal ILEADRaster object and the Annotation container:

Raster property

AnnContainer property

Set the following property to enable or disable the generation of error exceptions:

EnableMethodErrors property

Use the following event to determine when the bitmap has been changed by an ODBC method:

ODBCChanged event


Using ODBC

The LEADTOOLS COM supports database access using Open Database Connectivity (ODBC). Before using any application (including LEADTOOLS examples) to access any database, you must first specify the ODBC data source as follows.

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Open the ODBC administrator and click the Add button.
2. | Select the appropriate driver and click the OK button. (Use the Microsoft FoxPro driver for FoxPro, and use the Microsoft Access driver for Visual Basic, Visual C++, or Access 95.)
3. | Enter a data source name and a description.
4. | Click the Select directory button and select the directory containing the database you want to access.
5. | Step out of the ODBC administrator by clicking the OK button on two forms then clicking the Close button.


Using OLE DB and ADO

The LEADTOOLS OLE DB COM supports database access though an OLE DB Provider. OLE DB allows users to have uniform access to data regardless of the database format. An OLE DB Provider is a COM object that exposes interfaces to consumers wanting to access data in a particular format. For example, there are OLE DB Providers for JET, SQL Server, Oracle, ODB drivers, Excel, and many other data sources. The LEADTOOLS OLE DB Control is a consumer for the data exposed by OLE DB Providers. Using the Microsoft ADO Data Control, you can connect to any of several OLE DB Providers. You specify the provider to which you wish to connect in the ADO Control's ConnectionString property. The ADO Control provides a user interface for selecting the OLE DB Provider, as well as setting other connection parameters. For more information, consult the Microsoft ADO Data Control documentation, or consult the "Using OLE DB Providers with ADO" section of the "Microsoft Data Access SDK" documentation.

Note: | During testing, the OLE DB Provider for JET 3.51 was found to not perform properly when attempting to save images > 64K. For this reason, saving > 64K has been disabled in the ActiveX when the provider is MSJTOR35.DLL, and the DataSaved event will be fired with an error code.
Note: | During testing we found that the ADO Data control will cache all records if you leave the MaxRecords property set to the default value of 0. If you leave this property at 0, all records will be retrieved from the database. For large databases, this may cause your application to slow down while the records are retrieved. Therefore, we recommend that you set the MaxRecords property to a value other than 0.


Using the OLE DB Control

You can associate the LEAD Raster OLE DB Control with an OLE DB DataSource such as the ADO Data control so that the LEADRasterView control's Raster is bound to a specified field in the data control's recordset.

Use the following properties to specify the data control and field to which the OLE DB Control is bound:

DataSource property

DataMember property

DataField property

Use the following properties to specify how images are stored in the data field:

DataSaveBits property

DataSaveFormat property

DataSaveQuality property

Use the following property to specify the bits per pixel of the bitmap in memory:

DataLoadBits property

Use the following property to indicate that the database field should be updated:

DataDirty property

Use the following properties to copy the data to/from the LEADRasterView & LEADRasterAnnotation objects:

Raster property

AnnContainer property

Use the following events to be notified when data is loaded from or saved to the recordset:

DataLoaded event

DataSaved event

Use the following property to access the internal ILEADRaster object:

Raster property

Set the following property to TRUE to enable the generation of system errors:

EnableMethodErrors property


Displaying an Image

Set the following properties (possibly at design time) to control the style of display:

Appearance property

AutoRepaint property

BackColor property

BackErase property

BitonalScaling property

BorderStyle property

ForePalette property

PaintDither property

PaintPalette property

PaintRgnOnly property

PaintROP3 property

PaintGamma property

PaintIntensity property

PaintContrast property

PaintScaling property

Transparent property

For additional settings, refer to Using Special Effects When Painting. and Adding a Frame to the Control.

Use the following properties to implement automated scaling and positioning of an image.

AutoSetRects property

CenterImage property

PaintSizeUseDPI property

PaintSizeMode property

PaintZoomFactor property

ZoomToRect method

AutoScroll property

AutoSize property

If you do not use the automated scaling properties, other properties and methods let you specify exactly which part of an image to paint and how big to make it.

When painting an image, LEADTOOLS uses the following four rectangles that determine how the image is scaled, positioned, and cropped:

The source rectangle determines which part of the bitmap LEADTOOLS treats as the source image. By default, it is the whole bitmap. (In fact, by default, all four rectangles are initialized to the size of the bitmap.)

The destination rectangle positions the displayed image relative to the LEAD control and determines the displayed size. If the destination rectangle is larger or smaller than the source rectangle, LEADTOOLS scales the image to fit the destination rectangle. You can view the following illustrations in a separate window:

Specifying Only the Destination Rectangles

Specifying Both the Source and Destination Rectangles

The source clipping rectangle limits the part of the source rectangle that LEADTOOLS paints. This rectangle does not affect scaling. You can view the following illustration in a separate window:

Specifying the Source Clipping Rectangle

The destination clipping rectangle limits the part of the destination rectangle that LEADTOOLS paints. This rectangle does not affect scaling, but if the image is scaled, you should set it to match the destination rectangle. You can view the following illustration in a separate window:

Specifying the Destination Clipping Rectangle

If you set the AutoSetRects property to true, when a bitmap is loaded or resized, LEADTOOLS initializes all four rectangles to a 0, 0 position and to the same width and height as the bitmap. If you set the AutoScroll property, LEADTOOLS automatically adjusts the origin of the destination rectangles when the user scrolls the image.

The size of the LEAD control also can limit how much of the image is displayed. The way you size and position the LEAD control depends on your programming environment, but you can set the destination rectangle to fit the size of the control.

Use the following property to specify the unit of measure for the LEAD control:

ScaleMode property

Use the following properties to get the current client area of the LEAD control or to implement a custom coordinate system. Typically, you would use these properties to fit the destination rectangle to the size of the control.

ScaleHeight property

ScaleLeft property

ScaleTop property

ScaleWidth property

Use the following methods to set the rectangle specifications:

SetDstClipRect method

SetDstRect method

SetSrcClipRect method

SetSrcRect method

Alternatively, you can read or write the following properties that define the rectangles:

DstClipHeight property

DstClipLeft property

DstClipTop property

DstClipWidth property

DstHeight property

DstLeft property

DstTop property

DstWidth property

SrcClipHeight property

SrcClipLeft property

SrcClipTop property

SrcClipWidth property

SrcHeight property

SrcLeft property

SrcTop property

SrcWidth property

Occasionally it is necessary to convert between bitmap coordinates and client area coordinates. LEADTOOLS provides the BitmapToClient and ClientToBitmap methods for converting coordinates. Each of these methods takes as parameters the X and Y coordinates to be converted, and updates the ConvertX and ConvertY properties with the newly converted coordinates.

Use the following method to force repainting of the image. (If the AutoRepaint property is set to TRUE, you do not have to force a repaint.)

ForceRepaint method

The following property enables or disables painting of the control's window:

EnablePaint property

Use the following method to force repainting of a specified rectangle in the LEAD control's client area.

RepaintRect method

When repainting invalidated areas of a bitmap, flickering may occur. To avoid this flicker, enable double buffer image display by setting the DoubleBuffer property to TRUE. This may be particularly helpful when displaying annotations on a bitmap.

Use the following properties and methods to apply window leveling to a 12 or 16-bit grayscale image. (12 and 16-bit grayscale support are Document/Medical only. Window leveling support is Medical only):

WindowLevel method

LevelLUT property

LevelLUTLength property

LEADTOOLS provides several properties to let the user display OCR data from the OCR engine in an ILEADRasterView control. To do this:

  1. Start the OCR engine for a specific ILEADRasterDocument object.

  2. Set the ActivePageIndex property (ILEADRasterDocument) to the page to be drawn.

  3. Set the RasterDocument property (ILEADRasterView) to the valid ILEADRasterDocument object for which the OCR engine was started in step 1.

  4. Set the EnableOCRDrawing property to TRUE to allow the OCR engine data to be drawn in the ILEADRasterView control.

To display the selected zone on the active page, set the SelectedZoneIndex property (ILEADRasterView).


Bitmaps and Bitmap Lists

To support multipage files and animation, the ILEADRaster object can reference a list of bitmaps. In fact, even an object with only one bitmap has a list, and the list contains only the one bitmap.

The following properties reference the object's entire list of bitmaps:

BitmapList property

BitmapListCount property

The following methods let you update a bitmap list:

InsertBitmapListItem method

DeleteBitmapListItems method

You can copy an entire list by assigning the BitmapList property from one control to another. You can free all of the bitmaps in the list by setting the property to 0. You can also reference the entire list of bitmaps when you load and save multipage files and when you play the list as an animation.

Most methods and properties reference only one bitmap (the current bitmap). When there is a list of bitmaps, the following property lets you specify the current bitmap:

BitmapListIndex property

The following property references the control's current bitmap:

Bitmap property

You can copy one object's current bitmap to another object's current bitmap by assigning the Bitmap property from one object to the other. You can remove the current bitmap from the list (freeing the bitmap) by setting the Bitmap property to 0. When an object has only one bitmap, you do not have to set the BitmapListIndex property to specify the current bitmap.

When assigning a bitmap of one object to a bitmap of another object, the RefBitmap property can be used to indicate whether to perform a copy, or simply reference the source object’s Bitmap property.

When assigning a bitmap list of one object to a bitmap list of another object, RefBitmapList property can be used to indicate whether to perform a copy, or simply move the source object’s BitmapList property to the destination object's BitmapList property.

To delete a specific page from a multipage file that supports delete operations, use the following method:

DeletePage method

Comparing Images

Two bitmaps or parts of two bitmaps can be compared using the Correlation method. This method compares all or part of one bitmap with all the areas of the same dimensions in another bitmap and finds those areas that match according to the measure of correlation. The Correlation method updates the CorrelationX and CorrelationY properties with the X and Y coordinates of the points of correlated areas. The size of these properties is set using the CorrelationMaxPoints property. The CorrelationCount property is updated by the Correlation method with the number of correlated areas actually found.

The CorrelationList method compares the images in the BitmapList property with all the areas of the same dimensions in the bitmap referenced by the pRaster parameter and finds those portions that match according to the measure of correlation.

Correlated Area

The CorrelationListMaxPoints property gets or sets the maximum number of values that can be stored in the CorrelationListX and CorrelationListY properties. This is also equal to the maximum number of regions in bitmap referenced by pRaster that can be found to correlate. Also to update the CorrelationListIndex property and the CorrelationListCount property with the number of areas in the bitmap referenced by pRaster that correlate to an image in BitmapList property.


Implementing Transparency

You can implement transparency when doing any of the following:

Animation. When playing an animation, the playback process recognizes the transparent color specified in the BitmapTransparentColor property if the BitmapEnableTransparency property is set to TRUE. The transparent color is loaded from and saved to GIF files. If you save animated files in other multi-page formats, you must maintain the color yourself. For more information, refer to Playing an Animation.

Paint effects. When painting a bitmap or other object, you can specify a transparent color in the BitmapTransparentColor property and set the BitmapEnableTransparency property. For more information about painting images, refer to Displaying an Image.

Displaying an image with transparent color. When painting a bitmap, you can specify a transparent color in the BitmapTransparentColor property and set the BitmapEnableTransparency property to TRUE. LEAD will then paint the bitmap without the color set in the BitmapTransparentColor property.

Note: When loading an image file of any supported file format, LEADTOOLS ActiveX control will load the transparent color information into the BitmapTransparentColor property. You must assign the BitmapTransparentColor property and set the BitmapEnableTransparency property to TRUE for proper display.

Region processing. Defining a region in a bitmap makes it possible to treat the area outside the region as transparent. You can set the PaintRgnOnly property to TRUE to paint only the region that is defined for a bitmap. When combining images with the Combine method, if a region is defined for the target bitmap, the combine applies only to the region. (Any region defined in the source bitmap is ignored.). For example, if a transparent color is defined for a bitmap, you can create a region that omits pixels of that color. For details, refer to Combining Images.

To combine image data from the source bitmap (the slave) into the destination bitmap (master) using a perspective warp, use the CombineBitmapWarp method. If you want to specify the areas to be combined, the operations to be performed when combining the data, and which color planes (R or G or B or R, G, and B) are used, use the CombineExt method.

Once a region is defined, you can create a mask from it, which you can save in the alpha channel of a 16- or 32-bit file. Refer to the BitmapAlpha property for an example of how to save a region in an alpha channel.

Transparent control. You can make the background of the LEAD control transparent by setting the Transparent property to TRUE. This lets you take advantage of related transparency properties when one control is positioned on top of another one.

When specifying a transparent color, you can refer to a particular palette index, instead of the RGB value. This can be useful in cases where a color is used for transparency and the palette may contain the same color in more than one palette position.

When specifying a palette index as a color value, use the following formula:

16777216 + index

When evaluating a value to see if it is a palette index, you can use the following logic:

if value >= 16777216 then
index = value - 16777216

(Document/Medical only) Setting Transparent Colors For Annotation Bitmap Objects

The annotation Stamp object (ANN_OBJECT_STAMP, which includes the different Rubber Stamp tools) and Point object (ANN_OBJECT_POINT) can be set to display bitmaps that use a transparent color. A transparent color is a color that is not painted when the image is painted. Call the AnnSetTransparent method to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). Use the AnnSetTransparentColor method to set the color to be used as the transparent color. Use the AnnGetTransparent method to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Use the AnnGetTransparentColor method to get a value that indicates which color is being used as the transparent color.

FeatherAlphaBlend is a powerful function that can be used to implement transparency, using a mask. In many applications, a transparency mask is saved as an alpha channel. If a bitmap contains a transparency mask in the alpha channel, use BitmapAlpha property to get the alpha channel information back into a bitmap form. Once the transparency mask information is in a bitmap, it can be passed directly to the FeatherAlphaBlend method as the mask. The following code demonstrates how to do this:

VB Example:

Private Sub Test_Click()
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim nRet As Integer
Dim RasterAlpha As New LEADRaster
Dim RasterDst As New LEADRaster

' Load a bitmap at 16 bits per pixel
nRet = RasterIO.Load(LEADRasterView1.Raster, "c:\parrots.jpg", 16, 0, 1)
' Specify a rectangle to define the region
nRet = LEADRasterView1.Raster.SetRgnEllipse(0, 0, 100, 100, L_RGN_SET)
' Create a mask bitmap from the region
nRet = LEADRasterView1.Raster.CreateMaskFromRgn()
' Update the alpha channel in the main bitmap
RasterAlpha.Bitmap = LEADRasterView1.Raster.MaskBitmap
' Save the bitmap at 16 bits per pixel to keep the alpha channel
nRet = RasterIO.Save (LEADRasterView1.Raster, "TEST.TIF", FILE_TIF, 16, 0, 0)
' Load the bitmap that we just saved and get its alpha channel
nRet = RasterIO.Load(LEADRasterView1.Raster, "TEST.tif", 16, 0, 1)
RasterDst.CreateBitmap LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, LEADRasterView1.Raster.BitmapBits
nRet = RasterProc.FeatherAlphaBlend(RasterDst, 0, 0, RasterAlpha.BitmapWidth, RasterAlpha.BitmapHeight, LEADRasterView1.Raster, 0, 0, RasterAlpha)
LEADRasterView2.Raster = RasterDst
End Sub

VC++ Example:

ILEADRasterIO *pRasterIO = NULL;
ILEADRasterProcess *pRasterProc = NULL;
ILEADRaster *pRasterAlpha;
ILEADRaster *pRasterDst;
int nRet;

CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pRasterAlpha
);

CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pRasterDst
);

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

CoCreateInstance(
CLSID_LEADRasterProcess,
NULL,
CLSCTX_ALL,
IID_ILEADRasterProcess,
(void**)&pRasterProc
);

//Load a bitmap at 16 bits per pixel
nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster (), "c:\\parrots.jpg", 16, 0, 1);
// Specify a rectangle to define the region
nRet = m_LEADRasterView1.GetRaster().SetRgnEllipse(0, 0, 100, 100, L_RGN_SET);
//Create a mask bitmap from the region
nRet = m_LEADRasterView1.GetRaster().CreateMaskFromRgn();
//Update the alpha channel in the main bitmap
pRasterAlpha->PutBitmap(m_LEADRasterView1.GetRaster().GetMaskBitmap());
// Save the bitmap at 16 bits per pixel to keep the alpha channel
nRet = pRasterIO->Save (m_LEADRasterView1.GetRaster(), "TEST.TIF", FILE_TIF, 16, (QFactorConstants)0, 0);
// Load the bitmap that we just saved and get its alpha channel
nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster(), "TEST.tif", 16, (QFactorConstants)0, 1);

pRasterDst->CreateBitmap(m_LEADRasterView1.GetRaster().GetBitmapWidth(), m_LEADRasterView1.GetRaster().GetBitmapHeight(), m_LEADRasterView1.GetRaster().GetBitmapBits());
nRet = pRasterProc->FeatherAlphaBlend(pRasterDst, 0, 0, pRasterAlpha->BitmapWidth, pRasterAlpha->BitmapHeight, m_LEADRasterView1.GetRaster (), 0, 0, pRasterAlpha);
m_LEADRasterView2.GetRaster().SetBitmap(pRasterDst->GetBitmap());
pRasterIO->Release();
pRasterProc ->Release();
pRasterAlpha->Release();
pRasterDst->Release();


Managing Palettes

Use the following properties to modify a palette that is used to display an image on a device that is 8 bits per pixel or less:

BitmapPalette property

UserPalette property

Use the following method to get the palette used in a particular device context:

GetPalette method

For related information about palette usage, refer to the ColorRes and ColorResList methods, and to the PaintPalette property.


Marking a Selection with a Rubberband

You can mark a selection area by using a rubberband, which is a one-pixel rectangle on the display surface.

The following property lets you automate the rubberband so that it appears whenever the mouse is moved with the left button down:

AutoRubberBand property

Alternatively, you can control the rubberband by adding code to the mouse events. You can use the following method to set the size and position of the rubberband:

SetRubberBandRect method

You can use the following property to change the visibility of the rectangle, effectively turning it on or off:

RubberBandVisible property

You can use the following properties to get or set the current size and position of the rectangle:

RubberBandHeight property

RubberBandLeft property

RubberBandTop property

RubberBandWidth property

The following event occurs before the MouseUp event when the rubberband is turned on:

RubberBand event


Playing an Animation

When you play an animation, you display a sequence of images from a list of bitmaps. This list of bitmaps can be in a multipage file that plays as it loads, or they can be already loaded in a control. For an explanation of bitmap lists, refer to Bitmaps and Bitmap Lists.

To execute a playback, LEADTOOLS creates a temporary target bitmap, renders the listed bitmaps to the target, and displays the target bitmap. An animated GIF file can specify properties of this target bitmap. With images from other sources, LEADTOOLS uses default values that are based on bitmaps in the list.

Before playing an animation from a file, you can use the GetFileInfo method to find out whether the file is an animated file and to find out the height and width of the target bitmap. The GetFileInfo method updates the following properties that contain this information:

InfoAnimation property

InfoAnimationHeight property

InfoAnimationWidth property

To determine how a particular bitmap in a list behaves during playback, you can get and set the following properties:

BitmapDelay property

BitmapDisposalMethod property

BitmapEnableTransparency property

BitmapTransparentColor property

To determine how a particular bitmap in a list is positioned relative to the temporary target bitmap, you can get and set the following properties:

BitmapLeft property

BitmapTop property

You can get and set the following properties of the temporary target bitmap:

AnimationBackColor property

AnimationBitsPerPixel property

AnimationPalette property

AnimationWidth property

AnimationHeight property

Use the following properties to control the playback execution:

AnimationLoop property

AnimationEnable property

AutoAnimate property

AutoAnimationLoop property

Use the following event to add code that executes when an animation playback starts or stops:

Animate event


PNG Files and Transparency

Bitmaps may or may not contain transparency. The transparent color is a RGB color for bitmaps that are not palettized (> 8 bits per pixel). For palettized bitmaps, the transparent color is an index to a color within the palette.

PNG supports transparent bitmaps that have one or more transparent colors. However, currently LEADTOOLS cannot handle more than one transparent color. Therefore, the first transparent color encountered by LEADTOOLS is used as the transparent color for the bitmap.

When loading PNG bitmaps that have transparency, LEADTOOLS sets the BitmapEnableTransparency property to TRUE and BitmapTransparentColor property to the transparent color. Please note that if the loaded PNG bitmap is not palettized, then the BitmapTransparentColor property is set to an RGB color. If the loaded PNG bitmap is palettized, the BitmapTransparentColor property is set to 0x010000XX, where XX is the index of the transparent color.

When a bitmap that contains transparency (i.e. BitmapEnableTransparency property is set to TRUE) is saved as PNG, the transparency information is saved automatically. This is true for all bitmaps, regardless of their bits/pixel.

Please note that some developers consider the alpha channel to contain transparency information. LEADTOOLS does not make that assumption. Transparency is generally implemented in LEADTOOLS as explained above. However, FeatherAlphaBlend is a powerful method that can be used to implement transparency, using a mask saved as an alpha channel. If a bitmap contains a transparency mask in the alpha channel, use BitmapAlpha property to get the alpha channel information back into a bitmap form. Once the transparency mask information is in a bitmap, it can be passed directly to the FeatherAlphaBlend method as the mask. For sample code that demonstrates how to do this, refer to Implementing Transparency. For more information on functions that utilize alpha channel information, refer to Alpha channel functions.

Some PNG files have an 8-bit palettized component (for the image) and 8-bit alpha information. When you get the information for these files, InfoBits property gets set to 8 and the InfoHasAlpha property gets set to TRUE. By default (when passing 0 for iBitsPerPixel to the Load methods), the image is loaded as 8 bits (the alpha information is ignored). To get the alpha information from these files, you need to load the image as 32 or 64-bit. In this case, the alpha information can be accessed with the BitmapAlpha property. LEADTOOLS does not save these 8+8 files.


Scrolling an Image

LEADTOOLS provides the following for scrolling images in the ILEADRasterView object:

AutoScroll property

HScrollInfo property

Scroll event

VScrollInfo property

To enable the implementation of automatic scrollbars, the AutoScroll property must be set to TRUE. Is this property is set to TRUE, then whenever the user drags the box on an ILEADRasterView object's scrollbar, a Scroll event occurs, notifying the user that the image has been scrolled. Information about the horizontal and vertical scrollbars can be obtained in the HScrollInfo property and VScrollInfo property.


Specifying Both the Source and Destination Rectangles

The following illustrates how you can specify a part of the bitmap as the source rectangle. Then, the source rectangle (rather than the whole bitmap) is scaled and displayed.


Specifying Only the Destination Rectangles

The following illustrates how you can scale the displayed image by accepting the default source rectangle and specifying only the destination rectangles. (To paint the whole image, you must set the clipping rectangle to the same values as the destination rectangle.)


Specifying the Destination Clipping Rectangle

The following illustrates how you can specify a destination clipping rectangle to limit the part of the destination rectangle that gets painted. (Keep in mind that if you want the whole destination rectangle to paint, you must update the clipping area to match it.)


Specifying the Source Clipping Rectangle

The following illustrates how you can specify a source clipping rectangle to limit the part of the source rectangle that gets painted. Usually, you do not need to specify a source clipping rectangle. However, this feature can be useful in sophisticated applications that treat the bitmap as both a display surface and a display source.


Overlays Overview

(Medical only) An "Overlay Plane" describes graphics or bit-mapped text that is associated with an image or has its own existence within a series. It may also describe a ROI in an image. Each "Overlay Plane" is one bit deep (1BPP). Sixteen separate planes may be associated with an image or exist as "Standalone Overlays" in a series. Overlay pixel data is stored either in "Overlay Data" (60xx,3000) or embedded in the "Image Pixel Data" (7FE0,0010).

LEADTOOLS provides functionality to manipulate overlays in DICOM. The GetOverlayCount method gets or sets the number of overlays in the DICOM Data Set. The attributes of an overlay can be obtained using the following methods/properties:

GetOverlayAttributes method

OverlayAttributes property

The OverlayAttributes property is a pointer to an ILEADOverlayAttributes object that contains a number of properties, which can be set by the user. These attributes are broken into two categories:

Display properties

These properties specify how an overlay gets painted:

BitPosition property (ILEADOverlayAttributes)

Color property (ILEADOverlayAttributes)

OriginX property (ILEADOverlayAttributes)

OriginY property (ILEADOverlayAttributes)

DICOM-related properties

These properties are DICOM specific and are based on the "Overlay Plane Module Attributes" defined in PS 3.3 of the DICOM standard:

ActivationLayer property (ILEADOverlayAttributes)

BitsAllocated property (ILEADOverlayAttributes)

Columns property (ILEADOverlayAttributes)

Description property (ILEADOverlayAttributes)

Flags property (ILEADOverlayAttributes)

ImageFrameOrigin property (ILEADOverlayAttributes)

Label property (ILEADOverlayAttributes)

NumberFramesInOverlay property (ILEADOverlayAttributes)

ROIArea property (ILEADOverlayAttributes)

ROIMean property (ILEADOverlayAttributes)

ROIStandardDeviation property (ILEADOverlayAttributes)

Rows property (ILEADOverlayAttributes)

Subtype property (ILEADOverlayAttributes)

Type property (ILEADOverlayAttributes)

Use the GetOverlayBitmap method to retrieve the "Overlay Data" (60xx,3000) for a single-frame overlay.

The UpdateOverlayBits method updates the overlay bitmap pixels with the bits from the corresponding bitplane of the main bitmap, or it updates the main bitmap’s bitplane with the data from the overlay bitmap.

LEADTOOLS also allows you to insert a new or update an existing overlay. Use the SetOverlayAttributes method to set the attributes of a certain overlay and then use the SetOverlayBitmap method to set its data.


Using a PanWindow

The Pan Window is a small window which will display a scaled view of a bitmap, which is also being displayed in the Main Control's window at a size that would require scrolling. The Pan Window will maintain the image’s aspect ratio. In the Pan Window, a colored Pan Rect will be displayed to indicate the portion of the image currently being displayed in the main window. When a user clicks inside the Pan Window and moves the mouse, while holding down the button, the Pan Rect will move with the mouse pointer.

To set the location of the PanWindow, use:

PanWinX property

PanWinY property

To set the dimensions of the PanWindow, use:

PanWinWidth property

PanWinHeight property

The following properties can be set to control image quality in the PanWindow:

PanWinPaintPalette property

PanWinBitonalScaling property

PanWinPaintDither property

PanWinPaintScaling property

To make the PanWindow visible (or invisible) use:

ShowPanWin method

When the PanWindow is created, updated, destroyed or moved, the following event is generated:

PanWin event

Other PanWindow characteristics which can be set are:

PanWinTitle property

PanWinRectColor property

PanWinSysMenu property

PanWinPointer property

In Visual Basic only, the following properties can be set to use Picture objects for the PanWindow cursor and icon:

PanWinCursor property

PanWinIcon property


Using Color Values in LEADTOOLS

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette, which holds the color value. You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values. Please note that just because an image has a palette, which does not mean the value returned by this property is a palette index.

In the Document/Medical toolkits, the COLORREF value may represent a 16-bit grayscale value if the bBitmap is a 12 or 16-bit grayscale. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask (0x04000000) is set. In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS elements will recognize a COLORREF having this format, but Windows elements will not. For information on converting from a 16-bit value, refer to Converting 16-bit Grayscale Values.


Using Palette Indexes As Color Values

Methods and properties that take an OLE_COLOR data type can also reference a particular index in the current bitmap's palette. This can be useful in cases where a color is used for transparency and the palette may contain the same color in more than one palette position.

When specifying a palette index as a color value, use the following formula:

16777216 + index

When evaluating a palette index, you can use the following logic:

if value >= 16777216 then
index = value - 16777216


Gradients and Patterns

You can specify a gradient color or a pattern when you implement a transitional paint effect.

The following properties let you specify a gradient color, which starts as one color and ends as another, with the specified number of transitional colors from start to end. The direction of the transition depends on the gradient style.

GradientStyle property

GradientStartColor property

GradientEndColor property

GradientSteps property

The following properties let you specify a pattern or solid color:

PatternStyle property

PatternBackColor property

PatternForeColor property

The usage of gradients and patterns varies as follows:

For painting transitions, described in Using Special Effects When Painting, you always use a gradient or pattern to achieve the effect.


Using the Image List Control

LEADTOOLS provides an image list control that lets you display and manipulate a list of images. It can be used with other LEAD Raster COM objects and controls. The ImageList properties, methods and events let you do the following with a list of images:

You can load and save image lists using these methods:

LoadDatabase method

SaveDatabase method

LoadFromFile method

SaveToFile method

To insert and delete images, use the following:

Clear method

Insert method

InsertAt method

InsertFromBitmapList method

Remove method

To specialize mouse and keyboard input, use the following:

Click event

DblClick event

EnableKeyboard property

KeyDown event

KeyPress event

KeyUp event

MouseDown event

MouseIcon property

MouseMove event

MousePointer property

MouseUp event

You can modify the display characteristics, or item characteristics using the following:

AllowSelection property

Appearance property

BackColor property

BitonalScaling property

BorderColor property

BorderStyle property

DisplayItemText property

FirstVisibleItem property

Font property

ForeColor property

Item property

ItemBackgroundColor property

ItemHeight property

ItemHorizontalSpacing property

ItemSelected event

ItemUnSelected event

ItemVerticalSpacing property

ItemWidth property

PaintDither property

PaintScaling property

Resize event

ScaleHeight property

ScaleLeft property

ScaleMode property

ScaleTop property

ScaleWidth property

SelectAll method

SelectedCount property

SelectedItems property

SelectionColor property

SelectionStyle property

Sort method

SortExt method

SetSelectionBitmap method

ViewSize property

The following elements let you import or export items to or from the ImageList Control:

ExportBitmapList method

ExportedBitmapList property

ImportBitmapList method

The following provide support for user-defined or custom painting of the ImageList items:

OwnerDrawItem event

OwnerDrawItems property

The following elements let you scroll through the image list:

EnsureVisible method

Scroll event

ScrollItems method

ScrollStyle property

To obtain information about the image list, use the following:

ColumnCount property

Count property

CurrentPage property

HitTest method

PageCount property

RowCount property

LEADTOOLS also provides the following general elements:

ControlWindow property

EnableMethodErrors property

Window property


Using the Magnifying Glass

LEADTOOLS provides a "magnifying glass" for the LEADRasterView Control. This magnifying glass provides a means of "zooming in" on the image loaded into the LEADRasterView Control.

Use the "Magnifying Glass" if you want to:

control the painting options for the zoomed display.

set the contrast, gamma and intensity for the zoomed area.

Note that in the Document/Medical toolkits LEADTOOLS also provides a "Zoom View" that can be attached to a window handle.

Use the "Zoom View" if you want to:

display one or more zoomed views for a single displayed image

display an annotation in addition to the zoomed view

display callout lines

For more information about the Zoom View, refer to Using the Zoom View.

To start the magnifying glass procedure, call the StartMagGlass method. This method lets you set the following:

size of the magnifying glass

shape of the magnifying glass

magnifying glass border (color, thickness, appearance)

magnification level

section of the pixel on which to center the zoomed image

The user can check the HasMagGlass property to determine whether the control has a magnifying glass attached to it. As the magnifying glass is moved over an image, the zoomed - in view is also displayed.

A magnifying glass can be used in one of the following ways:

1.

Attach an ordinary magnifying glass to the control's window. To do this, set the EnableMagGlassEvent property to FALSE, do not set MAGGLASS_MANUAL_UPDATE in the MagGlassFlags property, and then call the StartMagGlass method. If you use the magnifying glass this way, there is no need to write any code to display the magnifying glass or to handle its movement across an image. All this is handled internally by LEADTOOLS.

2.

Attach a magnifying glass to the window's control and update the magnified image that is displayed using the MagGlassExt event. To do this, set the EnableMagGlassEvent property to TRUE before calling the StartMagGlass method. By setting the EnableMagGlassEvent property to TRUE, the MagGlassExt event will be fired each time the left mouse button is pressed, each time the left mouse button is released and each time the mouse is moved over the control while the left mouse button is pressed. Each time the MagGlassExt event is fired, you can get information about non-updated parts of the bitmap that need to be updated. This information can be obtained using the Pixel property. This needed information can then be passed to the UpdateMagGlass method to update the Magnifying Glass's zoomed display area. This enables the Magnifying Glass to paint the zoomed area more clearly. If the EnableMagGlassEvent property has been set to TRUE, the UpdateMagGlass method must be used to update the Magnifying Glass display area with the zoomed image. The MagGlassExt event works more efficiently when working with a Client/Server, available in the Multimedia/Internet toolkits, and using Internet methods to get the needed information. Using the magnifying glass this way, the user is involved with updating the displayed bitmap through the UpdateMagGlass method.

3.

In the third method, the user is responsible for manually updating the magnifying glass by handling the WM_LBUTTONDOWN, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MOUSEMOVE, WM_SETCURSOR and WM_KILLFOCUS messages instead of having them handled internally by LEADTOOLS. To do this, set MAGGLASS_MANUAL_UPDATE in the MagGlassFlags property. The magnifying glass can then be manipulated manually using the ShowMagGlass method, the SetMagGlassPos method, the UpdateMagGlassFromHandle method and the MagGlassCursor event. The ShowMagGlass method will show or hide the Magnifying Glass while SetMagGlassPos method will move the Magnifying Glass to a specified position. The UpdateMagFromHandle method can be used to update the bitmap that the Magnifying Glass displays in the zoomed display area. The MagGlassCursor event occurs repeatedly while the left mouse button is not pressed. This event lets the user set the Magnifying Glass cursor.

To set masks for certain colors to be masked from the zoomed - in display, LEADTOOLS provides the MagGlassMaskCount property and the MagGlassMask property. Setting the MagGlassMaskCount allocates the array of the MagGlassMask property. The MagGlassFlags property controls two behaviors of the Magnifying Glass:

1. | whether the colors set in the MagGlassMask property are the only displayed colors or the only masked colors in the displayed image.
2. | whether the Magnifying Glass will be manually updated.

LEADTOOLS provides two defined shapes for the Magnifying Glass: Rectangle and Ellipse. The UpdateMagGlassShape method lets you update the shape of the magnifying glass to one of the previously listed shapes, or to a custom shape.

To control the painting options for the zoomed display, use the following:

PanWinPaintPalette property

PanWinBitonalScaling property

PanWinPaintDither property

PanWinPaintScaling property

To control the Contrast, Gamma and Intensity of the zoomed area, use the following:

MagGlassPaintContrast property

MagGlassPaintGamma property

MagGlassPaintIntensity property

To use a custom shape for the magnifying glass, use the following:

PanWinPointer = 99 ' custom pointer
PanWinCursor = the custom cursor image

In addition to customizing the look of the magnifying glass itself, LEADTOOLS lets you customize the actual painting of the magnifying glass display area. For more information, refer to Customizing Magnifying Glass Painting.

When the magnifying glass is no longer needed, call the StopMagGlass method to stop the magnifying glass procedure.


Customizing Magnifying Glass Painting

LEADTOOLS provides several properties, methods and events that let the user provide custom magnifying glass painting, including the painting of annotations in the magnifying glass. After the StartMagGlass method has been called and the magnifying glass paints itself to the DC, but before the magnifying glass is displayed on the screen, the user can change what is in the DC, through the MagGlassOwnerDraw event. In order to generate this event, the EnableMagGlassDraw property must be set to TRUE. This feature lets you render magnified annotations, which may be overlaid on the currently displayed image, or just simply override what is currently in the magnifying glass display area.

If the user provides custom magnifying glass painting that does not include annotations, then all the user must do is set the EnableMagGlassDraw property to TRUE and provide the necessary code for the MagGlassOwnerDraw event. Setting the EnableMagGlassDraw property to TRUE enables the generation of the MagGlassOwnerDraw event.

If the user provides custom magnifying glass painting that does involve annotations, the user must:

  • set the EnableMagGlassDraw property to TRUE so the MagGlassOwnerDraw event will be generated

  • set the AnnEnableMagGlass property to TRUE so the annotations can be painted

  • call the AnnMagGlass method within the MagGlassOwnerDraw event to actually draw the annotations

To stop generating MagGlassOwnerDraw events, set the EnableMagGlassDraw property to FALSE.


Adding a Frame to the Control

The following properties let you add a three-dimensional frame to the LEAD control:

FrameThickness property

FrameColor property

You can turn the frame off by specifying a thickness of 0. When the frame is turned on, the ScaleHeight and ScaleWidth properties are updated to reflect the smaller size of the client area. The automated fit modes also fit the image into the smaller client area.

The following properties specify the inner and outer bands that give the frame a three-dimensional appearance:

FrameInnerStyle property

FrameInnerThickness property

FrameInnerHiliteColor property

FrameInnerShadowColor property

FrameOuterStyle property

FrameOuterThickness property

FrameOuterHiliteColor property

FrameOuterShadowColor property


Using Special Effects When Painting

You can specify a special effect to be applied when painting an image, and you can specify a transitional effect that occurs before the image is painted. Other aspects of painting (such as zooming) are automated or controlled as explained in Displaying an Image.

The following property lets you specify a special effect when painting an image:

PaintEffect property

The following properties let you implement a transitional effect that paints before the image paints:

TransitionStyle property

TransitionEffect property

The TransitionStyle property determines whether a transitional effect is used, and it determines whether the transition is based on pattern properties or gradient color properties. Refer to Gradients and Patterns for related properties.

If the PaintEffect or TransitionEffect is an option from the Wave class of Effects, the EffectCycles and EffectSpeed properties can be used to indicate the number of repetitions and the speed of the wave effect.

The following properties let you specify the speed and granularity of the effect:

EffectDelay property

TransitionDelay property

EffectGrain property

The following properties and event let you control the number of passes when painting an image or transition. If you specify more than one pass, a pattern brush paints some of the pixels on each pass, and the painting is complete when you finish all of the passes.

PaintEffectMaxPasses property

PaintTransitionMaxPasses property

PaintTransitionPass property

PaintNotificationDelay property

PaintNotification event

The PaintEffectPass property indicates the current pass during a paint effect.

The first PaintNotification event occurs before the first pass and after each pass when painting a transition or an image. Therefore, you can use the event to change other properties between passes, or after the transition paints and before the image paints.

The following properties let you specify a transparent color (a color that is not painted):

BitmapEnableTransparency property

BitmapTransparentColor property

The following properties let you specify a wand (a band of color that is used at the leading edge of some effects):

WandColor property

WandSize property


Using the Zoom View

Note:

This topic is for Document/Medical only.

LEADTOOLS provides a "zoomed view" that can be attached to a window handle. This Zoom View provides a means of "zooming in" on the image loaded into the window to which it is attached. As the source rectangle is moved over an image, the zoomed - in view also changes. This is similar to having multiple Magnifying Glasses on the same source image.

Use the "Zoom View" if you want to:

display one or more zoomed views for a single displayed image

display an annotation in addition to the zoomed view

display callout lines

Note that LEADTOOLS also provides a "magnifying glass" that can be attached to a window handle.

Use the "Magnifying Glass" if you want to:

control the painting options for the zoomed display.

set the contrast, gamma and intensity for the zoomed area.

For more information about the magnifying glass, refer to Using the Magnifying Glass.

To attach the zoomed view to a RasterView Control, call the CreateZoomView method. The following can be set using the ILEADRasterZoomView Object:

the rectangle describing the source area of the image to be zoomed (using the SrcHeight, SrcLeft, SrcTop, and SrcWidth properties)

the rectangle describing the location of the zoomed view (using the DstHeight, DstLeft, DstTop, and DstWidth properties)

the zoom factor (using the ZoomFactor property)

whether the zoomed view should be the size of the rectangle describing the location of the zoomed view, or whether to display the source rectangle magnified by the specified zoom factor (using the ForceDst property)

the border style for the zoomed view, along with border color and pen style (using the BorderColor, BorderStyle, and PenStyle properties)

the border style for the source rectangle, along with border color and pen style (using the SrcBorderColor, SrcBorderStyle, and SrcPenStyle properties)

whether callout lines will be used, along with color and pen style (using the CalloutColor, CalloutPenStyle, and EnableCallouts properties)

the annotation object to be displayed (using the AnnContainer property)

whether the Zoom View is enabled (using the Enabled property)

the Index of the specified Zoom View (using the Index property)

The annotation objects can be displayed using the zoom view. To enable or disable displaying the annotation objects using the zoom view, use the AnnEnableZoomView property.

Use the CreateZoomView method to set and the GetZoomView method to obtain the properties for the specified zoom view. To change the current options for the specified Zoom View, change the values in the ZoomView after calling the GetZoomView method and then pass the changed values to the UpdateZoomView method.

To determine whether a window has a zoomed view attached to it, call the HasZoomView property.

A window can have more than one Zoom Views attached to it. To obtain the number of zoomed views attached to a window, call the ZoomViewsCount property. Use the Index property to keep track of the different Zoom Views attached to a window.

LEADTOOLS provides several different shapes for the zoomed view, including a rectangle, a rounded rectangle and a shape that looks like a piece of paper that has been torn from a larger sheet.

When the zoomed view is no longer needed, call the DestroyZoomView method to stop the Zoom View procedure and to detach it from the window handle.


BackStyle

The following values may be used for the ShapeBackgroundStyle property (ILEADRasterFXD).

Value | Meaning
FXD_BACKSTYLE_TRANSPARENT | Transparent
FXD_BACKSTYLE_OPAQUE | Opaque
FXD_BACKSTYLE_TRANSLUCENT | Translucent
FXD_BACKSTYLE_TILED_IMAGE | Tiled image
FXD_BACKSTYLE_TRANSLUCENT_TILED_IMAGE | Translucent tiled image
FXD_BACKSTYLE_GRADIENT | Gradient color
FXD_BACKSTYLE_TRANSLUCENT_GRADIENT | Translucent gradient color
FXD_BACKSTYLE_MAX | The last background style (for use in a loop counter)


BorderStyles

The following values may be used for the ShapeBorderStyle property (ILEADRasterFXD).

Value | Meaning
FXD_BORDERSTYLE_TRANSPARENT | Transparent
FXD_BORDERSTYLE_SOLID | Solid line
FXD_BORDERSTYLE_DASH | Dash line (valid only for 1-pixel lines)
FXD_BORDERSTYLE_DOT | Dot line (valid only for 1-pixel lines)
FXD_BORDERSTYLE_DASHDOT | Dash dot line (valid only for 1-pixel lines)
FXD_BORDERSTYLE_DASHDOTDOT | Dash dot dot line (valid only for 1-pixel lines)
FXD_BORDERSTYLE_MAX | Dash dot dot line (valid only for 1-pixel lines)


Effects

The following values may be used for the PaintEffect property.

Value

Meaning

No effect class

EFX_EFFECT_NONE | No effect
EFX_EFFECT_NO_PICTURE | No picture (no background)
EFX_EFFECT_MAX | Number of effects in this class.

Linear wipe class

EFX_EFFECT_WIPE_L_TO_R | Wipe left to right
EFX_EFFECT_WIPE_R_TO_L | Wipe right to left
EFX_EFFECT_WIPE_T_TO_B | Wipe top to bottom
EFX_EFFECT_WIPE_B_TO_T | Wipe bottom to top
EFX_EFFECT_WIPE_LT_TO_RB | Wipe left-top to right-bottom
EFX_EFFECT_WIPE_LB_TO_RT | Wipe left-bottom to right-top
EFX_EFFECT_WIPE_RT_TO_LB | Wipe right-top to left-bottom
EFX_EFFECT_WIPE_RB_TO_LT | Wipe right-bottom to left-top
EFX_EFFECT_WIPE_INTERH_L_TO_R_THEN_L_TO_R | Wipe horizontal interlace left to right twice
EFX_EFFECT_WIPE_INTERV_T_TO_B_THEN_T_TO_B | Wipe vertical interlace top to bottom twice
EFX_EFFECT_WIPE_INTERH_L_TO_R_THEN_R_TO_L | Wipe horizontal interlace left to right then back
EFX_EFFECT_WIPE_INTERV_T_TO_B_THEN_B_TO_T | Wipe vertical interlace top to bottom then back
EFX_EFFECT_WIPE_INTERV_L_TO_R_THEN_L_TO_R | Wipe vertical interlace left to right twice
EFX_EFFECT_WIPE_INTERV_R_TO_L_THEN_R_TO_L | Wipe vertical interlace right to left twice
EFX_EFFECT_WIPE_INTERH_T_TO_B_THEN_T_TO_B | Wipe horizontal interlace top to bottom twice
EFX_EFFECT_WIPE_INTERH_B_TO_T_THEN_B_TO_T | Wipe horizontal interlace bottom to top twice
EFX_EFFECT_WIPE_INTERV_L_TO_R_THEN_R_TO_L | Wipe vertical interlace left to right then back
EFX_EFFECT_WIPE_INTERV_R_TO_L_THEN_L_TO_R | Wipe vertical interlace right to left then back
EFX_EFFECT_WIPE_INTERH_T_TO_B_THEN_B_TO_T | Wipe horizontal interlace top to bottom then back
EFX_EFFECT_WIPE_INTERH_B_TO_T_THEN_T_TO_B | Wipe horizontal interlace bottom to top then back
EFX_EFFECT_WIPE_INTERH_L_TO_R_AND_R_TO_L | Wipe horizontal interlace left to right and right to left
EFX_EFFECT_WIPE_INTERV_T_TO_B_AND_B_TO_T | Wipe vertical interlace top to bottom and bottom to top
EFX_EFFECT_WIPE_INTERV_L_AND_R_TO_C | Wipe vertical interlace left and right to center
EFX_EFFECT_WIPE_INTERV_C_TO_L_AND_R | Wipe vertical interlace center to left and right
EFX_EFFECT_WIPE_INTERH_T_AND_B_TO_C | Wipe horizontal interlace top and bottom to center
EFX_EFFECT_WIPE_INTERH_C_TO_T_AND_B | Wipe horizontal interlace center to top and bottom
EFX_EFFECT_WIPE_INTERV_L_AND_R_TO_C_THEN_C_TO_L_AND_R | Wipe vertical interlace left and right to center then back
EFX_EFFECT_WIPE_INTERV_C_TO_L_AND_R_THEN_L_AND_R_TO_C | Wipe vertical interlace center to left and right then back
EFX_EFFECT_WIPE_INTERH_T_AND_B_TO_C_THEN_C_TO_T_AND_B | Wipe horizontal interlace top and bottom to center then back
EFX_EFFECT_WIPE_INTERH_C_TO_T_AND_B_THEN_T_AND_B_TO_C | Wipe horizontal interlace center to top and bottom then back
EFX_EFFECT_WIPE2_LT_AND_RB_TO_C | Wipe2 left-top and right-bottom to center
EFX_EFFECT_WIPE2_LB_AND_RT_TO_C | Wipe2 left-bottom and right-top to center
EFX_EFFECT_WIPE2_C_TO_LT_AND_RB | Wipe2 center to left-top and right-bottom
EFX_EFFECT_WIPE2_C_TO_LB_AND_RT | Wipe2 center to left-bottom and right-top
EFX_EFFECT_WIPE2_LB_AND_RB_TO_T | Wipe2 left-bottom and right-bottom to top
EFX_EFFECT_WIPE2_LT_AND_RT_TO_B | Wipe2 left-top and right-top to bottom
EFX_EFFECT_WIPE2_RT_AND_RB_TO_L | Wipe2 right-top and right-bottom to left
EFX_EFFECT_WIPE2_LT_AND_LB_TO_R | Wipe2 left-top and left-bottom to right
EFX_EFFECT_WIPE2_L_T_TO_B_AND_R_B_TO_T | Wipe2 left top to bottom and right bottom to top
EFX_EFFECT_WIPE2_T_L_TO_R_AND_B_R_TO_L | Wipe2 top left to right and bottom right to left
EFX_EFFECT_WIPE4_CORNERS_OUT | Wipe4 corners out
EFX_EFFECT_WIPE4_C_TO_L_AND_R_THEN_T_AND_B | Wipe4 center to left and right then top and bottom
EFX_EFFECT_WIPE4_T_AND_B_THEN_L_AND_R_TO_C | Wipe4 top and bottom then left and right to center
EFX_EFFECT_WIPE4_L_L_L_L | Wipe4 left left left left
EFX_EFFECT_WIPE4_L_L_L_R | Wipe4 left left left right
EFX_EFFECT_WIPE4_L_L_L_T | Wipe4 left left left top
EFX_EFFECT_WIPE4_L_L_L_B | Wipe4 left left left bottom
EFX_EFFECT_WIPE4_L_L_R_L | Wipe4 left left right left
EFX_EFFECT_WIPE4_L_L_R_R | Wipe4 left left right right
EFX_EFFECT_WIPE4_L_L_R_T | Wipe4 left left right top
EFX_EFFECT_WIPE4_L_L_R_B | Wipe4 left left right bottom
EFX_EFFECT_WIPE4_L_L_T_L | Wipe4 left left top left
EFX_EFFECT_WIPE4_L_L_T_R | Wipe4 left left top right
EFX_EFFECT_WIPE4_L_L_T_T | Wipe4 left left top top
EFX_EFFECT_WIPE4_L_L_T_B | Wipe4 left left top bottom
EFX_EFFECT_WIPE4_L_L_B_L | Wipe4 left left bottom left
EFX_EFFECT_WIPE4_L_L_B_R | Wipe4 left left bottom right
EFX_EFFECT_WIPE4_L_L_B_T | Wipe4 left left bottom top
EFX_EFFECT_WIPE4_L_L_B_B | Wipe4 left left bottom bottom
EFX_EFFECT_WIPE4_L_R_L_L | Wipe4 left right left left
EFX_EFFECT_WIPE4_L_R_L_R | Wipe4 left right left right
EFX_EFFECT_WIPE4_L_R_L_T | Wipe4 left right left top
EFX_EFFECT_WIPE4_L_R_L_B | Wipe4 left right left bottom
EFX_EFFECT_WIPE4_L_R_R_L | Wipe4 left right right left
EFX_EFFECT_WIPE4_L_R_R_R | Wipe4 left right right right
EFX_EFFECT_WIPE4_L_R_R_T | Wipe4 left right right top
EFX_EFFECT_WIPE4_L_R_R_B | Wipe4 left right right bottom
EFX_EFFECT_WIPE4_L_R_T_L | Wipe4 left right top left
EFX_EFFECT_WIPE4_L_R_T_R | Wipe4 left right top right
EFX_EFFECT_WIPE4_L_R_T_T | Wipe4 left right top top
EFX_EFFECT_WIPE4_L_R_T_B | Wipe4 left right top bottom
EFX_EFFECT_WIPE4_L_R_B_L | Wipe4 left right bottom left
EFX_EFFECT_WIPE4_L_R_B_R | Wipe4 left right bottom right
EFX_EFFECT_WIPE4_L_R_B_T | Wipe4 left right bottom top
EFX_EFFECT_WIPE4_L_R_B_B | Wipe4 left right bottom bottom
EFX_EFFECT_WIPE4_L_T_L_L | Wipe4 left top left left
EFX_EFFECT_WIPE4_L_T_L_R | Wipe4 left top left right
EFX_EFFECT_WIPE4_L_T_L_T | Wipe4 left top left top
EFX_EFFECT_WIPE4_L_T_L_B | Wipe4 left top left bottom
EFX_EFFECT_WIPE4_L_T_R_L | Wipe4 left top right left
EFX_EFFECT_WIPE4_L_T_R_R | Wipe4 left top right right
EFX_EFFECT_WIPE4_L_T_R_T | Wipe4 left top right top
EFX_EFFECT_WIPE4_L_T_R_B | Wipe4 left top right bottom
EFX_EFFECT_WIPE4_L_T_T_L | Wipe4 left top top left
EFX_EFFECT_WIPE4_L_T_T_R | Wipe4 left top top right
EFX_EFFECT_WIPE4_L_T_T_T | Wipe4 left top top top
EFX_EFFECT_WIPE4_L_T_T_B | Wipe4 left top top bottom
EFX_EFFECT_WIPE4_L_T_B_L | Wipe4 left top bottom left
EFX_EFFECT_WIPE4_L_T_B_R | Wipe4 left top bottom right
EFX_EFFECT_WIPE4_L_T_B_T | Wipe4 left top bottom top
EFX_EFFECT_WIPE4_L_T_B_B | Wipe4 left top bottom bottom
EFX_EFFECT_WIPE4_L_B_L_L | Wipe4 left bottom left left
EFX_EFFECT_WIPE4_L_B_L_R | Wipe4 left bottom left right
EFX_EFFECT_WIPE4_L_B_L_T | Wipe4 left bottom left top
EFX_EFFECT_WIPE4_L_B_L_B | Wipe4 left bottom left bottom
EFX_EFFECT_WIPE4_L_B_R_L | Wipe4 left bottom right left
EFX_EFFECT_WIPE4_L_B_R_R | Wipe4 left bottom right right
EFX_EFFECT_WIPE4_L_B_R_T | Wipe4 left bottom right top
EFX_EFFECT_WIPE4_L_B_R_B | Wipe4 left bottom right bottom
EFX_EFFECT_WIPE4_L_B_T_L | Wipe4 left bottom top left
EFX_EFFECT_WIPE4_L_B_T_R | Wipe4 left bottom top right
EFX_EFFECT_WIPE4_L_B_T_T | Wipe4 left bottom top top
EFX_EFFECT_WIPE4_L_B_T_B | Wipe4 left bottom top bottom
EFX_EFFECT_WIPE4_L_B_B_L | Wipe4 left bottom bottom left
EFX_EFFECT_WIPE4_L_B_B_R | Wipe4 left bottom bottom right
EFX_EFFECT_WIPE4_L_B_B_T | Wipe4 left bottom bottom top
EFX_EFFECT_WIPE4_L_B_B_B | Wipe4 left bottom bottom bottom
EFX_EFFECT_WIPE4_R_L_L_L | Wipe4 right left left left
EFX_EFFECT_WIPE4_R_L_L_R | Wipe4 right left left right
EFX_EFFECT_WIPE4_R_L_L_T | Wipe4 right left left top
EFX_EFFECT_WIPE4_R_L_L_B | Wipe4 right left left bottom
EFX_EFFECT_WIPE4_R_L_R_L | Wipe4 right left right left
EFX_EFFECT_WIPE4_R_L_R_R | Wipe4 right left right right
EFX_EFFECT_WIPE4_R_L_R_T | Wipe4 right left right top
EFX_EFFECT_WIPE4_R_L_R_B | Wipe4 right left right bottom
EFX_EFFECT_WIPE4_R_L_T_L | Wipe4 right left top left
EFX_EFFECT_WIPE4_R_L_T_R | Wipe4 right left top right
EFX_EFFECT_WIPE4_R_L_T_T | Wipe4 right left top top
EFX_EFFECT_WIPE4_R_L_T_B | Wipe4 right left top bottom
EFX_EFFECT_WIPE4_R_L_B_L | Wipe4 right left bottom left
EFX_EFFECT_WIPE4_R_L_B_R | Wipe4 right left bottom right
EFX_EFFECT_WIPE4_R_L_B_T | Wipe4 right left bottom top
EFX_EFFECT_WIPE4_R_L_B_B | Wipe4 right left bottom bottom
EFX_EFFECT_WIPE4_R_R_L_L | Wipe4 right right left left
EFX_EFFECT_WIPE4_R_R_L_R | Wipe4 right right left right
EFX_EFFECT_WIPE4_R_R_L_T | Wipe4 right right left top
EFX_EFFECT_WIPE4_R_R_L_B | Wipe4 right right left bottom
EFX_EFFECT_WIPE4_R_R_R_L | Wipe4 right right right left
EFX_EFFECT_WIPE4_R_R_R_R | Wipe4 right right right right
EFX_EFFECT_WIPE4_R_R_R_T | Wipe4 right right right top
EFX_EFFECT_WIPE4_R_R_R_B | Wipe4 right right right bottom
EFX_EFFECT_WIPE4_R_R_T_L | Wipe4 right right top left
EFX_EFFECT_WIPE4_R_R_T_R | Wipe4 right right top right
EFX_EFFECT_WIPE4_R_R_T_T | Wipe4 right right top top
EFX_EFFECT_WIPE4_R_R_T_B | Wipe4 right right top bottom
EFX_EFFECT_WIPE4_R_R_B_L | Wipe4 right right bottom left
EFX_EFFECT_WIPE4_R_R_B_R | Wipe4 right right bottom right
EFX_EFFECT_WIPE4_R_R_B_T | Wipe4 right right bottom top
EFX_EFFECT_WIPE4_R_R_B_B | Wipe4 right right bottom bottom
EFX_EFFECT_WIPE4_R_T_L_L | Wipe4 right top left left
EFX_EFFECT_WIPE4_R_T_L_R | Wipe4 right top left right
EFX_EFFECT_WIPE4_R_T_L_T | Wipe4 right top left top
EFX_EFFECT_WIPE4_R_T_L_B | Wipe4 right top left bottom
EFX_EFFECT_WIPE4_R_T_R_L | Wipe4 right top right left
EFX_EFFECT_WIPE4_R_T_R_R | Wipe4 right top right right
EFX_EFFECT_WIPE4_R_T_R_T | Wipe4 right top right top
EFX_EFFECT_WIPE4_R_T_R_B | Wipe4 right top right bottom
EFX_EFFECT_WIPE4_R_T_T_L | Wipe4 right top top left
EFX_EFFECT_WIPE4_R_T_T_R | Wipe4 right top top right
EFX_EFFECT_WIPE4_R_T_T_T | Wipe4 right top top top
EFX_EFFECT_WIPE4_R_T_T_B | Wipe4 right top top bottom
EFX_EFFECT_WIPE4_R_T_B_L | Wipe4 right top bottom left
EFX_EFFECT_WIPE4_R_T_B_R | Wipe4 right top bottom right
EFX_EFFECT_WIPE4_R_T_B_T | Wipe4 right top bottom top
EFX_EFFECT_WIPE4_R_T_B_B | Wipe4 right top bottom bottom
EFX_EFFECT_WIPE4_R_B_L_L | Wipe4 right bottom left left
EFX_EFFECT_WIPE4_R_B_L_R | Wipe4 right bottom left right
EFX_EFFECT_WIPE4_R_B_L_T | Wipe4 right bottom left top
EFX_EFFECT_WIPE4_R_B_L_B | Wipe4 right bottom left bottom
EFX_EFFECT_WIPE4_R_B_R_L | Wipe4 right bottom right left
EFX_EFFECT_WIPE4_R_B_R_R | Wipe4 right bottom right right
EFX_EFFECT_WIPE4_R_B_R_T | Wipe4 right bottom right top
EFX_EFFECT_WIPE4_R_B_R_B | Wipe4 right bottom right bottom
EFX_EFFECT_WIPE4_R_B_T_L | Wipe4 right bottom top left
EFX_EFFECT_WIPE4_R_B_T_R | Wipe4 right bottom top right
EFX_EFFECT_WIPE4_R_B_T_T | Wipe4 right bottom top top
EFX_EFFECT_WIPE4_R_B_T_B | Wipe4 right bottom top bottom
EFX_EFFECT_WIPE4_R_B_B_L | Wipe4 right bottom bottom left
EFX_EFFECT_WIPE4_R_B_B_R | Wipe4 right bottom bottom right
EFX_EFFECT_WIPE4_R_B_B_T | Wipe4 right bottom bottom top
EFX_EFFECT_WIPE4_R_B_B_B | Wipe4 right bottom bottom bottom
EFX_EFFECT_WIPE4_T_L_L_L | Wipe4 top left left left
EFX_EFFECT_WIPE4_T_L_L_R | Wipe4 top left left right
EFX_EFFECT_WIPE4_T_L_L_T | Wipe4 top left left top
EFX_EFFECT_WIPE4_T_L_L_B | Wipe4 top left left bottom
EFX_EFFECT_WIPE4_T_L_R_L | Wipe4 top left right left
EFX_EFFECT_WIPE4_T_L_R_R | Wipe4 top left right right
EFX_EFFECT_WIPE4_T_L_R_T | Wipe4 top left right top
EFX_EFFECT_WIPE4_T_L_R_B | Wipe4 top left right bottom
EFX_EFFECT_WIPE4_T_L_T_L | Wipe4 top left top left
EFX_EFFECT_WIPE4_T_L_T_R | Wipe4 top left top right
EFX_EFFECT_WIPE4_T_L_T_T | Wipe4 top left top top
EFX_EFFECT_WIPE4_T_L_T_B | Wipe4 top left top bottom
EFX_EFFECT_WIPE4_T_L_B_L | Wipe4 top left bottom left
EFX_EFFECT_WIPE4_T_L_B_R | Wipe4 top left bottom right
EFX_EFFECT_WIPE4_T_L_B_T | Wipe4 top left bottom top
EFX_EFFECT_WIPE4_T_L_B_B | Wipe4 top left bottom bottom
EFX_EFFECT_WIPE4_T_R_L_L | Wipe4 top right left left
EFX_EFFECT_WIPE4_T_R_L_R | Wipe4 top right left right
EFX_EFFECT_WIPE4_T_R_L_T | Wipe4 top right left top
EFX_EFFECT_WIPE4_T_R_L_B | Wipe4 top right left bottom
EFX_EFFECT_WIPE4_T_R_R_L | Wipe4 top right right left
EFX_EFFECT_WIPE4_T_R_R_R | Wipe4 top right right right
EFX_EFFECT_WIPE4_T_R_R_T | Wipe4 top right right top
EFX_EFFECT_WIPE4_T_R_R_B | Wipe4 top right right bottom
EFX_EFFECT_WIPE4_T_R_T_L | Wipe4 top right top left
EFX_EFFECT_WIPE4_T_R_T_R | Wipe4 top right top right
EFX_EFFECT_WIPE4_T_R_T_T | Wipe4 top right top top
EFX_EFFECT_WIPE4_T_R_T_B | Wipe4 top right top bottom
EFX_EFFECT_WIPE4_T_R_B_L | Wipe4 top right bottom left
EFX_EFFECT_WIPE4_T_R_B_R | Wipe4 top right bottom right
EFX_EFFECT_WIPE4_T_R_B_T | Wipe4 top right bottom top
EFX_EFFECT_WIPE4_T_R_B_B | Wipe4 top right bottom bottom
EFX_EFFECT_WIPE4_T_T_L_L | Wipe4 top top left left
EFX_EFFECT_WIPE4_T_T_L_R | Wipe4 top top left right
EFX_EFFECT_WIPE4_T_T_L_T | Wipe4 top top left top
EFX_EFFECT_WIPE4_T_T_L_B | Wipe4 top top left bottom
EFX_EFFECT_WIPE4_T_T_R_L | Wipe4 top top right left
EFX_EFFECT_WIPE4_T_T_R_R | Wipe4 top top right right
EFX_EFFECT_WIPE4_T_T_R_T | Wipe4 top top right top
EFX_EFFECT_WIPE4_T_T_R_B | Wipe4 top top right bottom
EFX_EFFECT_WIPE4_T_T_T_L | Wipe4 top top top left
EFX_EFFECT_WIPE4_T_T_T_R | Wipe4 top top top right
EFX_EFFECT_WIPE4_T_T_T_T | Wipe4 top top top top
EFX_EFFECT_WIPE4_T_T_T_B | Wipe4 top top top bottom
EFX_EFFECT_WIPE4_T_T_B_L | Wipe4 top top bottom left
EFX_EFFECT_WIPE4_T_T_B_R | Wipe4 top top bottom right
EFX_EFFECT_WIPE4_T_T_B_T | Wipe4 top top bottom top
EFX_EFFECT_WIPE4_T_T_B_B | Wipe4 top top bottom bottom
EFX_EFFECT_WIPE4_T_B_L_L | Wipe4 top bottom left left
EFX_EFFECT_WIPE4_T_B_L_R | Wipe4 top bottom left right
EFX_EFFECT_WIPE4_T_B_L_T | Wipe4 top bottom left top
EFX_EFFECT_WIPE4_T_B_L_B | Wipe4 top bottom left bottom
EFX_EFFECT_WIPE4_T_B_R_L | Wipe4 top bottom right left
EFX_EFFECT_WIPE4_T_B_R_R | Wipe4 top bottom right right
EFX_EFFECT_WIPE4_T_B_R_T | Wipe4 top bottom right top
EFX_EFFECT_WIPE4_T_B_R_B | Wipe4 top bottom right bottom
EFX_EFFECT_WIPE4_T_B_T_L | Wipe4 top bottom top left
EFX_EFFECT_WIPE4_T_B_T_R | Wipe4 top bottom top right
EFX_EFFECT_WIPE4_T_B_T_T | Wipe4 top bottom top top
EFX_EFFECT_WIPE4_T_B_T_B | Wipe4 top bottom top bottom
EFX_EFFECT_WIPE4_T_B_B_L | Wipe4 top bottom bottom left
EFX_EFFECT_WIPE4_T_B_B_R | Wipe4 top bottom bottom right
EFX_EFFECT_WIPE4_T_B_B_T | Wipe4 top bottom bottom top
EFX_EFFECT_WIPE4_T_B_B_B | Wipe4 top bottom bottom bottom
EFX_EFFECT_WIPE4_B_L_L_L | Wipe4 bottom left left left
EFX_EFFECT_WIPE4_B_L_L_R | Wipe4 bottom left left right
EFX_EFFECT_WIPE4_B_L_L_T | Wipe4 bottom left left top
EFX_EFFECT_WIPE4_B_L_L_B | Wipe4 bottom left left bottom
EFX_EFFECT_WIPE4_B_L_R_L | Wipe4 bottom left right left
EFX_EFFECT_WIPE4_B_L_R_R | Wipe4 bottom left right right
EFX_EFFECT_WIPE4_B_L_R_T | Wipe4 bottom left right top
EFX_EFFECT_WIPE4_B_L_R_B | Wipe4 bottom left right bottom
EFX_EFFECT_WIPE4_B_L_T_L | Wipe4 bottom left top left
EFX_EFFECT_WIPE4_B_L_T_R | Wipe4 bottom left top right
EFX_EFFECT_WIPE4_B_L_T_T | Wipe4 bottom left top top
EFX_EFFECT_WIPE4_B_L_T_B | Wipe4 bottom left top bottom
EFX_EFFECT_WIPE4_B_L_B_L | Wipe4 bottom left bottom left
EFX_EFFECT_WIPE4_B_L_B_R | Wipe4 bottom left bottom right
EFX_EFFECT_WIPE4_B_L_B_T | Wipe4 bottom left bottom top
EFX_EFFECT_WIPE4_B_L_B_B | Wipe4 bottom left bottom bottom
EFX_EFFECT_WIPE4_B_R_L_L | Wipe4 bottom right left left
EFX_EFFECT_WIPE4_B_R_L_R | Wipe4 bottom right left right
EFX_EFFECT_WIPE4_B_R_L_T | Wipe4 bottom right left top
EFX_EFFECT_WIPE4_B_R_L_B | Wipe4 bottom right left bottom
EFX_EFFECT_WIPE4_B_R_R_L | Wipe4 bottom right right left
EFX_EFFECT_WIPE4_B_R_R_R | Wipe4 bottom right right right
EFX_EFFECT_WIPE4_B_R_R_T | Wipe4 bottom right right top
EFX_EFFECT_WIPE4_B_R_R_B | Wipe4 bottom right right bottom
EFX_EFFECT_WIPE4_B_R_T_L | Wipe4 bottom right top left
EFX_EFFECT_WIPE4_B_R_T_R | Wipe4 bottom right top right
EFX_EFFECT_WIPE4_B_R_T_T | Wipe4 bottom right top top
EFX_EFFECT_WIPE4_B_R_T_B | Wipe4 bottom right top bottom
EFX_EFFECT_WIPE4_B_R_B_L | Wipe4 bottom right bottom left
EFX_EFFECT_WIPE4_B_R_B_R | Wipe4 bottom right bottom right
EFX_EFFECT_WIPE4_B_R_B_T | Wipe4 bottom right bottom top
EFX_EFFECT_WIPE4_B_R_B_B | Wipe4 bottom right bottom bottom
EFX_EFFECT_WIPE4_B_T_L_L | Wipe4 bottom top left left
EFX_EFFECT_WIPE4_B_T_L_R | Wipe4 bottom top left right
EFX_EFFECT_WIPE4_B_T_L_T | Wipe4 bottom top left top
EFX_EFFECT_WIPE4_B_T_L_B | Wipe4 bottom top left bottom
EFX_EFFECT_WIPE4_B_T_R_L | Wipe4 bottom top right left
EFX_EFFECT_WIPE4_B_T_R_R | Wipe4 bottom top right right
EFX_EFFECT_WIPE4_B_T_R_T | Wipe4 bottom top right top
EFX_EFFECT_WIPE4_B_T_R_B | Wipe4 bottom top right bottom
EFX_EFFECT_WIPE4_B_T_T_L | Wipe4 bottom top top left
EFX_EFFECT_WIPE4_B_T_T_R | Wipe4 bottom top top right
EFX_EFFECT_WIPE4_B_T_T_T | Wipe4 bottom top top top
EFX_EFFECT_WIPE4_B_T_T_B | Wipe4 bottom top top bottom
EFX_EFFECT_WIPE4_B_T_B_L | Wipe4 bottom top bottom left
EFX_EFFECT_WIPE4_B_T_B_R | Wipe4 bottom top bottom right
EFX_EFFECT_WIPE4_B_T_B_T | Wipe4 bottom top bottom top
EFX_EFFECT_WIPE4_B_T_B_B | Wipe4 bottom top bottom bottom
EFX_EFFECT_WIPE4_B_B_L_L | Wipe4 bottom bottom left left
EFX_EFFECT_WIPE4_B_B_L_R | Wipe4 bottom bottom left right
EFX_EFFECT_WIPE4_B_B_L_T | Wipe4 bottom bottom left top
EFX_EFFECT_WIPE4_B_B_L_B | Wipe4 bottom bottom left bottom
EFX_EFFECT_WIPE4_B_B_R_L | Wipe4 bottom bottom right left
EFX_EFFECT_WIPE4_B_B_R_R | Wipe4 bottom bottom right right
EFX_EFFECT_WIPE4_B_B_R_T | Wipe4 bottom bottom right top
EFX_EFFECT_WIPE4_B_B_R_B | Wipe4 bottom bottom right bottom
EFX_EFFECT_WIPE4_B_B_T_L | Wipe4 bottom bottom top left
EFX_EFFECT_WIPE4_B_B_T_R | Wipe4 bottom bottom top right
EFX_EFFECT_WIPE4_B_B_T_T | Wipe4 bottom bottom top top
EFX_EFFECT_WIPE4_B_B_T_B | Wipe4 bottom bottom top bottom
EFX_EFFECT_WIPE4_B_B_B_L | Wipe4 bottom bottom bottom left
EFX_EFFECT_WIPE4_B_B_B_R | Wipe4 bottom bottom bottom right
EFX_EFFECT_WIPE4_B_B_B_T | Wipe4 bottom bottom bottom top
EFX_EFFECT_WIPE4_B_B_B_B | Wipe4 bottom bottom bottom bottom
EFX_EFFECT_WIPE4_LT_LT_LT_LT | Wipe4 left-top left-top left-top left-top
EFX_EFFECT_WIPE4_LT_LT_LT_LB | Wipe4 left-top left-top left-top left-bottom
EFX_EFFECT_WIPE4_LT_LT_LT_RT | Wipe4 left-top left-top left-top right-top
EFX_EFFECT_WIPE4_LT_LT_LT_RB | Wipe4 left-top left-top left-top right-bottom
EFX_EFFECT_WIPE4_LT_LT_LB_LT | Wipe4 left-top left-top left-bottom left-top
EFX_EFFECT_WIPE4_LT_LT_LB_LB | Wipe4 left-top left-top left-bottom left-bottom
EFX_EFFECT_WIPE4_LT_LT_LB_RT | Wipe4 left-top left-top left-bottom right-top
EFX_EFFECT_WIPE4_LT_LT_LB_RB | Wipe4 left-top left-top left-bottom right-bottom
EFX_EFFECT_WIPE4_LT_LT_RT_LT | Wipe4 left-top left-top right-top left-top
EFX_EFFECT_WIPE4_LT_LT_RT_LB | Wipe4 left-top left-top right-top left-bottom
EFX_EFFECT_WIPE4_LT_LT_RT_RT | Wipe4 left-top left-top right-top right-top
EFX_EFFECT_WIPE4_LT_LT_RT_RB | Wipe4 left-top left-top right-top right-bottom
EFX_EFFECT_WIPE4_LT_LT_RB_LT | Wipe4 left-top left-top right-bottom left-top
EFX_EFFECT_WIPE4_LT_LT_RB_LB | Wipe4 left-top left-top right-bottom left-bottom
EFX_EFFECT_WIPE4_LT_LT_RB_RT | Wipe4 left-top left-top right-bottom right-top
EFX_EFFECT_WIPE4_LT_LT_RB_RB | Wipe4 left-top left-top right-bottom right-bottom
EFX_EFFECT_WIPE4_LT_LB_LT_LT | Wipe4 left-top left-bottom left-top left-top
EFX_EFFECT_WIPE4_LT_LB_LT_LB | Wipe4 left-top left-bottom left-top left-bottom
EFX_EFFECT_WIPE4_LT_LB_LT_RT | Wipe4 left-top left-bottom left-top right-top
EFX_EFFECT_WIPE4_LT_LB_LT_RB | Wipe4 left-top left-bottom left-top right-bottom
EFX_EFFECT_WIPE4_LT_LB_LB_LT | Wipe4 left-top left-bottom left-bottom left-top
EFX_EFFECT_WIPE4_LT_LB_LB_LB | Wipe4 left-top left-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_LT_LB_LB_RT | Wipe4 left-top left-bottom left-bottom right-top
EFX_EFFECT_WIPE4_LT_LB_LB_RB | Wipe4 left-top left-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_LT_LB_RT_LT | Wipe4 left-top left-bottom right-top left-top
EFX_EFFECT_WIPE4_LT_LB_RT_LB | Wipe4 left-top left-bottom right-top left-bottom
EFX_EFFECT_WIPE4_LT_LB_RT_RT | Wipe4 left-top left-bottom right-top right-top
EFX_EFFECT_WIPE4_LT_LB_RT_RB | Wipe4 left-top left-bottom right-top right-bottom
EFX_EFFECT_WIPE4_LT_LB_RB_LT | Wipe4 left-top left-bottom right-bottom left-top
EFX_EFFECT_WIPE4_LT_LB_RB_LB | Wipe4 left-top left-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_LT_LB_RB_RT | Wipe4 left-top left-bottom right-bottom right-top
EFX_EFFECT_WIPE4_LT_LB_RB_RB | Wipe4 left-top left-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_LT_RT_LT_LT | Wipe4 left-top right-top left-top left-top
EFX_EFFECT_WIPE4_LT_RT_LT_LB | Wipe4 left-top right-top left-top left-bottom
EFX_EFFECT_WIPE4_LT_RT_LT_RT | Wipe4 left-top right-top left-top right-top
EFX_EFFECT_WIPE4_LT_RT_LT_RB | Wipe4 left-top right-top left-top right-bottom
EFX_EFFECT_WIPE4_LT_RT_LB_LT | Wipe4 left-top right-top left-bottom left-top
EFX_EFFECT_WIPE4_LT_RT_LB_LB | Wipe4 left-top right-top left-bottom left-bottom
EFX_EFFECT_WIPE4_LT_RT_LB_RT | Wipe4 left-top right-top left-bottom right-top
EFX_EFFECT_WIPE4_LT_RT_LB_RB | Wipe4 left-top right-top left-bottom right-bottom
EFX_EFFECT_WIPE4_LT_RT_RT_LT | Wipe4 left-top right-top right-top left-top
EFX_EFFECT_WIPE4_LT_RT_RT_LB | Wipe4 left-top right-top right-top left-bottom
EFX_EFFECT_WIPE4_LT_RT_RT_RT | Wipe4 left-top right-top right-top right-top
EFX_EFFECT_WIPE4_LT_RT_RT_RB | Wipe4 left-top right-top right-top right-bottom
EFX_EFFECT_WIPE4_LT_RT_RB_LT | Wipe4 left-top right-top right-bottom left-top
EFX_EFFECT_WIPE4_LT_RT_RB_LB | Wipe4 left-top right-top right-bottom left-bottom
EFX_EFFECT_WIPE4_LT_RT_RB_RT | Wipe4 left-top right-top right-bottom right-top
EFX_EFFECT_WIPE4_LT_RT_RB_RB | Wipe4 left-top right-top right-bottom right-bottom
EFX_EFFECT_WIPE4_LT_RB_LT_LT | Wipe4 left-top right-bottom left-top left-top
EFX_EFFECT_WIPE4_LT_RB_LT_LB | Wipe4 left-top right-bottom left-top left-bottom
EFX_EFFECT_WIPE4_LT_RB_LT_RT | Wipe4 left-top right-bottom left-top right-top
EFX_EFFECT_WIPE4_LT_RB_LT_RB | Wipe4 left-top right-bottom left-top right-bottom
EFX_EFFECT_WIPE4_LT_RB_LB_LT | Wipe4 left-top right-bottom left-bottom left-top
EFX_EFFECT_WIPE4_LT_RB_LB_LB | Wipe4 left-top right-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_LT_RB_LB_RT | Wipe4 left-top right-bottom left-bottom right-top
EFX_EFFECT_WIPE4_LT_RB_LB_RB | Wipe4 left-top right-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_LT_RB_RT_LT | Wipe4 left-top right-bottom right-top left-top
EFX_EFFECT_WIPE4_LT_RB_RT_LB | Wipe4 left-top right-bottom right-top left-bottom
EFX_EFFECT_WIPE4_LT_RB_RT_RT | Wipe4 left-top right-bottom right-top right-top
EFX_EFFECT_WIPE4_LT_RB_RT_RB | Wipe4 left-top right-bottom right-top right-bottom
EFX_EFFECT_WIPE4_LT_RB_RB_LT | Wipe4 left-top right-bottom right-bottom left-top
EFX_EFFECT_WIPE4_LT_RB_RB_LB | Wipe4 left-top right-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_LT_RB_RB_RT | Wipe4 left-top right-bottom right-bottom right-top
EFX_EFFECT_WIPE4_LT_RB_RB_RB | Wipe4 left-top right-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_LB_LT_LT_LT | Wipe4 left-bottom left-top left-top left-top
EFX_EFFECT_WIPE4_LB_LT_LT_LB | Wipe4 left-bottom left-top left-top left-bottom
EFX_EFFECT_WIPE4_LB_LT_LT_RT | Wipe4 left-bottom left-top left-top right-top
EFX_EFFECT_WIPE4_LB_LT_LT_RB | Wipe4 left-bottom left-top left-top right-bottom
EFX_EFFECT_WIPE4_LB_LT_LB_LT | Wipe4 left-bottom left-top left-bottom left-top
EFX_EFFECT_WIPE4_LB_LT_LB_LB | Wipe4 left-bottom left-top left-bottom left-bottom
EFX_EFFECT_WIPE4_LB_LT_LB_RT | Wipe4 left-bottom left-top left-bottom right-top
EFX_EFFECT_WIPE4_LB_LT_LB_RB | Wipe4 left-bottom left-top left-bottom right-bottom
EFX_EFFECT_WIPE4_LB_LT_RT_LT | Wipe4 left-bottom left-top right-top left-top
EFX_EFFECT_WIPE4_LB_LT_RT_LB | Wipe4 left-bottom left-top right-top left-bottom
EFX_EFFECT_WIPE4_LB_LT_RT_RT | Wipe4 left-bottom left-top right-top right-top
EFX_EFFECT_WIPE4_LB_LT_RT_RB | Wipe4 left-bottom left-top right-top right-bottom
EFX_EFFECT_WIPE4_LB_LT_RB_LT | Wipe4 left-bottom left-top right-bottom left-top
EFX_EFFECT_WIPE4_LB_LT_RB_LB | Wipe4 left-bottom left-top right-bottom left-bottom
EFX_EFFECT_WIPE4_LB_LT_RB_RT | Wipe4 left-bottom left-top right-bottom right-top
EFX_EFFECT_WIPE4_LB_LT_RB_RB | Wipe4 left-bottom left-top right-bottom right-bottom
EFX_EFFECT_WIPE4_LB_LB_LT_LT | Wipe4 left-bottom left-bottom left-top left-top
EFX_EFFECT_WIPE4_LB_LB_LT_LB | Wipe4 left-bottom left-bottom left-top left-bottom
EFX_EFFECT_WIPE4_LB_LB_LT_RT | Wipe4 left-bottom left-bottom left-top right-top
EFX_EFFECT_WIPE4_LB_LB_LT_RB | Wipe4 left-bottom left-bottom left-top right-bottom
EFX_EFFECT_WIPE4_LB_LB_LB_LT | Wipe4 left-bottom left-bottom left-bottom left-top
EFX_EFFECT_WIPE4_LB_LB_LB_LB | Wipe4 left-bottom left-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_LB_LB_LB_RT | Wipe4 left-bottom left-bottom left-bottom right-top
EFX_EFFECT_WIPE4_LB_LB_LB_RB | Wipe4 left-bottom left-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_LB_LB_RT_LT | Wipe4 left-bottom left-bottom right-top left-top
EFX_EFFECT_WIPE4_LB_LB_RT_LB | Wipe4 left-bottom left-bottom right-top left-bottom
EFX_EFFECT_WIPE4_LB_LB_RT_RT | Wipe4 left-bottom left-bottom right-top right-top
EFX_EFFECT_WIPE4_LB_LB_RT_RB | Wipe4 left-bottom left-bottom right-top right-bottom
EFX_EFFECT_WIPE4_LB_LB_RB_LT | Wipe4 left-bottom left-bottom right-bottom left-top
EFX_EFFECT_WIPE4_LB_LB_RB_LB | Wipe4 left-bottom left-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_LB_LB_RB_RT | Wipe4 left-bottom left-bottom right-bottom right-top
EFX_EFFECT_WIPE4_LB_LB_RB_RB | Wipe4 left-bottom left-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_LB_RT_LT_LT | Wipe4 left-bottom right-top left-top left-top
EFX_EFFECT_WIPE4_LB_RT_LT_LB | Wipe4 left-bottom right-top left-top left-bottom
EFX_EFFECT_WIPE4_LB_RT_LT_RT | Wipe4 left-bottom right-top left-top right-top
EFX_EFFECT_WIPE4_LB_RT_LT_RB | Wipe4 left-bottom right-top left-top right-bottom
EFX_EFFECT_WIPE4_LB_RT_LB_LT | Wipe4 left-bottom right-top left-bottom left-top
EFX_EFFECT_WIPE4_LB_RT_LB_LB | Wipe4 left-bottom right-top left-bottom left-bottom
EFX_EFFECT_WIPE4_LB_RT_LB_RT | Wipe4 left-bottom right-top left-bottom right-top
EFX_EFFECT_WIPE4_LB_RT_LB_RB | Wipe4 left-bottom right-top left-bottom right-bottom
EFX_EFFECT_WIPE4_LB_RT_RT_LT | Wipe4 left-bottom right-top right-top left-top
EFX_EFFECT_WIPE4_LB_RT_RT_LB | Wipe4 left-bottom right-top right-top left-bottom
EFX_EFFECT_WIPE4_LB_RT_RT_RT | Wipe4 left-bottom right-top right-top right-top
EFX_EFFECT_WIPE4_LB_RT_RT_RB | Wipe4 left-bottom right-top right-top right-bottom
EFX_EFFECT_WIPE4_LB_RT_RB_LT | Wipe4 left-bottom right-top right-bottom left-top
EFX_EFFECT_WIPE4_LB_RT_RB_LB | Wipe4 left-bottom right-top right-bottom left-bottom
EFX_EFFECT_WIPE4_LB_RT_RB_RT | Wipe4 left-bottom right-top right-bottom right-top
EFX_EFFECT_WIPE4_LB_RT_RB_RB | Wipe4 left-bottom right-top right-bottom right-bottom
EFX_EFFECT_WIPE4_LB_RB_LT_LT | Wipe4 left-bottom right-bottom left-top left-top
EFX_EFFECT_WIPE4_LB_RB_LT_LB | Wipe4 left-bottom right-bottom left-top left-bottom
EFX_EFFECT_WIPE4_LB_RB_LT_RT | Wipe4 left-bottom right-bottom left-top right-top
EFX_EFFECT_WIPE4_LB_RB_LT_RB | Wipe4 left-bottom right-bottom left-top right-bottom
EFX_EFFECT_WIPE4_LB_RB_LB_LT | Wipe4 left-bottom right-bottom left-bottom left-top
EFX_EFFECT_WIPE4_LB_RB_LB_LB | Wipe4 left-bottom right-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_LB_RB_LB_RT | Wipe4 left-bottom right-bottom left-bottom right-top
EFX_EFFECT_WIPE4_LB_RB_LB_RB | Wipe4 left-bottom right-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_LB_RB_RT_LT | Wipe4 left-bottom right-bottom right-top left-top
EFX_EFFECT_WIPE4_LB_RB_RT_LB | Wipe4 left-bottom right-bottom right-top left-bottom
EFX_EFFECT_WIPE4_LB_RB_RT_RT | Wipe4 left-bottom right-bottom right-top right-top
EFX_EFFECT_WIPE4_LB_RB_RT_RB | Wipe4 left-bottom right-bottom right-top right-bottom
EFX_EFFECT_WIPE4_LB_RB_RB_LT | Wipe4 left-bottom right-bottom right-bottom left-top
EFX_EFFECT_WIPE4_LB_RB_RB_LB | Wipe4 left-bottom right-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_LB_RB_RB_RT | Wipe4 left-bottom right-bottom right-bottom right-top
EFX_EFFECT_WIPE4_LB_RB_RB_RB | Wipe4 left-bottom right-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_RT_LT_LT_LT | Wipe4 right-top left-top left-top left-top
EFX_EFFECT_WIPE4_RT_LT_LT_LB | Wipe4 right-top left-top left-top left-bottom
EFX_EFFECT_WIPE4_RT_LT_LT_RT | Wipe4 right-top left-top left-top right-top
EFX_EFFECT_WIPE4_RT_LT_LT_RB | Wipe4 right-top left-top left-top right-bottom
EFX_EFFECT_WIPE4_RT_LT_LB_LT | Wipe4 right-top left-top left-bottom left-top
EFX_EFFECT_WIPE4_RT_LT_LB_LB | Wipe4 right-top left-top left-bottom left-bottom
EFX_EFFECT_WIPE4_RT_LT_LB_RT | Wipe4 right-top left-top left-bottom right-top
EFX_EFFECT_WIPE4_RT_LT_LB_RB | Wipe4 right-top left-top left-bottom right-bottom
EFX_EFFECT_WIPE4_RT_LT_RT_LT | Wipe4 right-top left-top right-top left-top
EFX_EFFECT_WIPE4_RT_LT_RT_LB | Wipe4 right-top left-top right-top left-bottom
EFX_EFFECT_WIPE4_RT_LT_RT_RT | Wipe4 right-top left-top right-top right-top
EFX_EFFECT_WIPE4_RT_LT_RT_RB | Wipe4 right-top left-top right-top right-bottom
EFX_EFFECT_WIPE4_RT_LT_RB_LT | Wipe4 right-top left-top right-bottom left-top
EFX_EFFECT_WIPE4_RT_LT_RB_LB | Wipe4 right-top left-top right-bottom left-bottom
EFX_EFFECT_WIPE4_RT_LT_RB_RT | Wipe4 right-top left-top right-bottom right-top
EFX_EFFECT_WIPE4_RT_LT_RB_RB | Wipe4 right-top left-top right-bottom right-bottom
EFX_EFFECT_WIPE4_RT_LB_LT_LT | Wipe4 right-top left-bottom left-top left-top
EFX_EFFECT_WIPE4_RT_LB_LT_LB | Wipe4 right-top left-bottom left-top left-bottom
EFX_EFFECT_WIPE4_RT_LB_LT_RT | Wipe4 right-top left-bottom left-top right-top
EFX_EFFECT_WIPE4_RT_LB_LT_RB | Wipe4 right-top left-bottom left-top right-bottom
EFX_EFFECT_WIPE4_RT_LB_LB_LT | Wipe4 right-top left-bottom left-bottom left-top
EFX_EFFECT_WIPE4_RT_LB_LB_LB | Wipe4 right-top left-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_RT_LB_LB_RT | Wipe4 right-top left-bottom left-bottom right-top
EFX_EFFECT_WIPE4_RT_LB_LB_RB | Wipe4 right-top left-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_RT_LB_RT_LT | Wipe4 right-top left-bottom right-top left-top
EFX_EFFECT_WIPE4_RT_LB_RT_LB | Wipe4 right-top left-bottom right-top left-bottom
EFX_EFFECT_WIPE4_RT_LB_RT_RT | Wipe4 right-top left-bottom right-top right-top
EFX_EFFECT_WIPE4_RT_LB_RT_RB | Wipe4 right-top left-bottom right-top right-bottom
EFX_EFFECT_WIPE4_RT_LB_RB_LT | Wipe4 right-top left-bottom right-bottom left-top
EFX_EFFECT_WIPE4_RT_LB_RB_LB | Wipe4 right-top left-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_RT_LB_RB_RT | Wipe4 right-top left-bottom right-bottom right-top
EFX_EFFECT_WIPE4_RT_LB_RB_RB | Wipe4 right-top left-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_RT_RT_LT_LT | Wipe4 right-top right-top left-top left-top
EFX_EFFECT_WIPE4_RT_RT_LT_LB | Wipe4 right-top right-top left-top left-bottom
EFX_EFFECT_WIPE4_RT_RT_LT_RT | Wipe4 right-top right-top left-top right-top
EFX_EFFECT_WIPE4_RT_RT_LT_RB | Wipe4 right-top right-top left-top right-bottom
EFX_EFFECT_WIPE4_RT_RT_LB_LT | Wipe4 right-top right-top left-bottom left-top
EFX_EFFECT_WIPE4_RT_RT_LB_LB | Wipe4 right-top right-top left-bottom left-bottom
EFX_EFFECT_WIPE4_RT_RT_LB_RT | Wipe4 right-top right-top left-bottom right-top
EFX_EFFECT_WIPE4_RT_RT_LB_RB | Wipe4 right-top right-top left-bottom right-bottom
EFX_EFFECT_WIPE4_RT_RT_RT_LT | Wipe4 right-top right-top right-top left-top
EFX_EFFECT_WIPE4_RT_RT_RT_LB | Wipe4 right-top right-top right-top left-bottom
EFX_EFFECT_WIPE4_RT_RT_RT_RT | Wipe4 right-top right-top right-top right-top
EFX_EFFECT_WIPE4_RT_RT_RT_RB | Wipe4 right-top right-top right-top right-bottom
EFX_EFFECT_WIPE4_RT_RT_RB_LT | Wipe4 right-top right-top right-bottom left-top
EFX_EFFECT_WIPE4_RT_RT_RB_LB | Wipe4 right-top right-top right-bottom left-bottom
EFX_EFFECT_WIPE4_RT_RT_RB_RT | Wipe4 right-top right-top right-bottom right-top
EFX_EFFECT_WIPE4_RT_RT_RB_RB | Wipe4 right-top right-top right-bottom right-bottom
EFX_EFFECT_WIPE4_RT_RB_LT_LT | Wipe4 right-top right-bottom left-top left-top
EFX_EFFECT_WIPE4_RT_RB_LT_LB | Wipe4 right-top right-bottom left-top left-bottom
EFX_EFFECT_WIPE4_RT_RB_LT_RT | Wipe4 right-top right-bottom left-top right-top
EFX_EFFECT_WIPE4_RT_RB_LT_RB | Wipe4 right-top right-bottom left-top right-bottom
EFX_EFFECT_WIPE4_RT_RB_LB_LT | Wipe4 right-top right-bottom left-bottom left-top
EFX_EFFECT_WIPE4_RT_RB_LB_LB | Wipe4 right-top right-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_RT_RB_LB_RT | Wipe4 right-top right-bottom left-bottom right-top
EFX_EFFECT_WIPE4_RT_RB_LB_RB | Wipe4 right-top right-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_RT_RB_RT_LT | Wipe4 right-top right-bottom right-top left-top
EFX_EFFECT_WIPE4_RT_RB_RT_LB | Wipe4 right-top right-bottom right-top left-bottom
EFX_EFFECT_WIPE4_RT_RB_RT_RT | Wipe4 right-top right-bottom right-top right-top
EFX_EFFECT_WIPE4_RT_RB_RT_RB | Wipe4 right-top right-bottom right-top right-bottom
EFX_EFFECT_WIPE4_RT_RB_RB_LT | Wipe4 right-top right-bottom right-bottom left-top
EFX_EFFECT_WIPE4_RT_RB_RB_LB | Wipe4 right-top right-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_RT_RB_RB_RT | Wipe4 right-top right-bottom right-bottom right-top
EFX_EFFECT_WIPE4_RT_RB_RB_RB | Wipe4 right-top right-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_RB_LT_LT_LT | Wipe4 right-bottom left-top left-top left-top
EFX_EFFECT_WIPE4_RB_LT_LT_LB | Wipe4 right-bottom left-top left-top left-bottom
EFX_EFFECT_WIPE4_RB_LT_LT_RT | Wipe4 right-bottom left-top left-top right-top
EFX_EFFECT_WIPE4_RB_LT_LT_RB | Wipe4 right-bottom left-top left-top right-bottom
EFX_EFFECT_WIPE4_RB_LT_LB_LT | Wipe4 right-bottom left-top left-bottom left-top
EFX_EFFECT_WIPE4_RB_LT_LB_LB | Wipe4 right-bottom left-top left-bottom left-bottom
EFX_EFFECT_WIPE4_RB_LT_LB_RT | Wipe4 right-bottom left-top left-bottom right-top
EFX_EFFECT_WIPE4_RB_LT_LB_RB | Wipe4 right-bottom left-top left-bottom right-bottom
EFX_EFFECT_WIPE4_RB_LT_RT_LT | Wipe4 right-bottom left-top right-top left-top
EFX_EFFECT_WIPE4_RB_LT_RT_LB | Wipe4 right-bottom left-top right-top left-bottom
EFX_EFFECT_WIPE4_RB_LT_RT_RT | Wipe4 right-bottom left-top right-top right-top
EFX_EFFECT_WIPE4_RB_LT_RT_RB | Wipe4 right-bottom left-top right-top right-bottom
EFX_EFFECT_WIPE4_RB_LT_RB_LT | Wipe4 right-bottom left-top right-bottom left-top
EFX_EFFECT_WIPE4_RB_LT_RB_LB | Wipe4 right-bottom left-top right-bottom left-bottom
EFX_EFFECT_WIPE4_RB_LT_RB_RT | Wipe4 right-bottom left-top right-bottom right-top
EFX_EFFECT_WIPE4_RB_LT_RB_RB | Wipe4 right-bottom left-top right-bottom right-bottom
EFX_EFFECT_WIPE4_RB_LB_LT_LT | Wipe4 right-bottom left-bottom left-top left-top
EFX_EFFECT_WIPE4_RB_LB_LT_LB | Wipe4 right-bottom left-bottom left-top left-bottom
EFX_EFFECT_WIPE4_RB_LB_LT_RT | Wipe4 right-bottom left-bottom left-top right-top
EFX_EFFECT_WIPE4_RB_LB_LT_RB | Wipe4 right-bottom left-bottom left-top right-bottom
EFX_EFFECT_WIPE4_RB_LB_LB_LT | Wipe4 right-bottom left-bottom left-bottom left-top
EFX_EFFECT_WIPE4_RB_LB_LB_LB | Wipe4 right-bottom left-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_RB_LB_LB_RT | Wipe4 right-bottom left-bottom left-bottom right-top
EFX_EFFECT_WIPE4_RB_LB_LB_RB | Wipe4 right-bottom left-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_RB_LB_RT_LT | Wipe4 right-bottom left-bottom right-top left-top
EFX_EFFECT_WIPE4_RB_LB_RT_LB | Wipe4 right-bottom left-bottom right-top left-bottom
EFX_EFFECT_WIPE4_RB_LB_RT_RT | Wipe4 right-bottom left-bottom right-top right-top
EFX_EFFECT_WIPE4_RB_LB_RT_RB | Wipe4 right-bottom left-bottom right-top right-bottom
EFX_EFFECT_WIPE4_RB_LB_RB_LT | Wipe4 right-bottom left-bottom right-bottom left-top
EFX_EFFECT_WIPE4_RB_LB_RB_LB | Wipe4 right-bottom left-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_RB_LB_RB_RT | Wipe4 right-bottom left-bottom right-bottom right-top
EFX_EFFECT_WIPE4_RB_LB_RB_RB | Wipe4 right-bottom left-bottom right-bottom right-bottom
EFX_EFFECT_WIPE4_RB_RT_LT_LT | Wipe4 right-bottom right-top left-top left-top
EFX_EFFECT_WIPE4_RB_RT_LT_LB | Wipe4 right-bottom right-top left-top left-bottom
EFX_EFFECT_WIPE4_RB_RT_LT_RT | Wipe4 right-bottom right-top left-top right-top
EFX_EFFECT_WIPE4_RB_RT_LT_RB | Wipe4 right-bottom right-top left-top right-bottom
EFX_EFFECT_WIPE4_RB_RT_LB_LT | Wipe4 right-bottom right-top left-bottom left-top
EFX_EFFECT_WIPE4_RB_RT_LB_LB | Wipe4 right-bottom right-top left-bottom left-bottom
EFX_EFFECT_WIPE4_RB_RT_LB_RT | Wipe4 right-bottom right-top left-bottom right-top
EFX_EFFECT_WIPE4_RB_RT_LB_RB | Wipe4 right-bottom right-top left-bottom right-bottom
EFX_EFFECT_WIPE4_RB_RT_RT_LT | Wipe4 right-bottom right-top right-top left-top
EFX_EFFECT_WIPE4_RB_RT_RT_LB | Wipe4 right-bottom right-top right-top left-bottom
EFX_EFFECT_WIPE4_RB_RT_RT_RT | Wipe4 right-bottom right-top right-top right-top
EFX_EFFECT_WIPE4_RB_RT_RT_RB | Wipe4 right-bottom right-top right-top right-bottom
EFX_EFFECT_WIPE4_RB_RT_RB_LT | Wipe4 right-bottom right-top right-bottom left-top
EFX_EFFECT_WIPE4_RB_RT_RB_LB | Wipe4 right-bottom right-top right-bottom left-bottom
EFX_EFFECT_WIPE4_RB_RT_RB_RT | Wipe4 right-bottom right-top right-bottom right-top
EFX_EFFECT_WIPE4_RB_RT_RB_RB | Wipe4 right-bottom right-top right-bottom right-bottom
EFX_EFFECT_WIPE4_RB_RB_LT_LT | Wipe4 right-bottom right-bottom left-top left-top
EFX_EFFECT_WIPE4_RB_RB_LT_LB | Wipe4 right-bottom right-bottom left-top left-bottom
EFX_EFFECT_WIPE4_RB_RB_LT_RT | Wipe4 right-bottom right-bottom left-top right-top
EFX_EFFECT_WIPE4_RB_RB_LT_RB | Wipe4 right-bottom right-bottom left-top right-bottom
EFX_EFFECT_WIPE4_RB_RB_LB_LT | Wipe4 right-bottom right-bottom left-bottom left-top
EFX_EFFECT_WIPE4_RB_RB_LB_LB | Wipe4 right-bottom right-bottom left-bottom left-bottom
EFX_EFFECT_WIPE4_RB_RB_LB_RT | Wipe4 right-bottom right-bottom left-bottom right-top
EFX_EFFECT_WIPE4_RB_RB_LB_RB | Wipe4 right-bottom right-bottom left-bottom right-bottom
EFX_EFFECT_WIPE4_RB_RB_RT_LT | Wipe4 right-bottom right-bottom right-top left-top
EFX_EFFECT_WIPE4_RB_RB_RT_LB | Wipe4 right-bottom right-bottom right-top left-bottom
EFX_EFFECT_WIPE4_RB_RB_RT_RT | Wipe4 right-bottom right-bottom right-top right-top
EFX_EFFECT_WIPE4_RB_RB_RT_RB | Wipe4 right-bottom right-bottom right-top right-bottom
EFX_EFFECT_WIPE4_RB_RB_RB_LT | Wipe4 right-bottom right-bottom right-bottom left-top
EFX_EFFECT_WIPE4_RB_RB_RB_LB | Wipe4 right-bottom right-bottom right-bottom left-bottom
EFX_EFFECT_WIPE4_RB_RB_RB_RT | Wipe4 right-bottom right-bottom right-bottom right-top
EFX_EFFECT_WIPE4_RB_RB_RB_RB | Wipe4 right-bottom right-bottom right-bottom right-bottom
EFX_EFFECT_WIPE_MAX | Number of effects in this class.

Rectangular wipe class

EFX_EFFECT_WIPE_RECTANGLE_IN | Wipe rectangle in
EFX_EFFECT_WIPE_RECTANGLE_OUT | Wipe rectangle out
EFX_EFFECT_WIPE_RECTANGLE_INTER_IN_THEN_IN | Wipe rectangle interlace in then in
EFX_EFFECT_WIPE_RECTANGLE_INTER_OUT_THEN_OUT | Wipe rectangle interlace out then out
EFX_EFFECT_WIPE_RECTANGLE_INTER_IN_THEN_OUT | Wipe rectangle interlace in then out
EFX_EFFECT_WIPE_RECTANGLE_INTER_OUT_THEN_IN | Wipe rectangle interlace out then in
EFX_EFFECT_WIPE_RECTANGLE_MAX | Number of effects in this class.

Circular wipe class

EFX_EFFECT_WIPE_CIRCLE_C_CW_FROM_L | Wipe circle center CW from left
EFX_EFFECT_WIPE_CIRCLE_C_CCW_FROM_L | Wipe circle center CCW from left
EFX_EFFECT_WIPE_CIRCLE_C_CW_FROM_R | Wipe circle center CW from right
EFX_EFFECT_WIPE_CIRCLE_C_CCW_FROM_R | Wipe circle center CCW from right
EFX_EFFECT_WIPE_CIRCLE_C_CW_FROM_T | Wipe circle center CW from top
EFX_EFFECT_WIPE_CIRCLE_C_CCW_FROM_T | Wipe circle center CCW from top
EFX_EFFECT_WIPE_CIRCLE_C_CW_FROM_B | Wipe circle center CW from bottom
EFX_EFFECT_WIPE_CIRCLE_C_CCW_FROM_B | Wipe circle center CCW from bottom
EFX_EFFECT_WIPE_CIRCLE_L_CCW_FROM_B | Wipe circle left CCW from bottom
EFX_EFFECT_WIPE_CIRCLE_L_CW_FROM_T | Wipe circle left CW from top
EFX_EFFECT_WIPE_CIRCLE_R_CW_FROM_B | Wipe circle right CW from bottom
EFX_EFFECT_WIPE_CIRCLE_R_CCW_FROM_T | Wipe circle right CCW from top
EFX_EFFECT_WIPE_CIRCLE_T_CCW_FROM_L | Wipe circle top CCW from left
EFX_EFFECT_WIPE_CIRCLE_T_CW_FROM_R | Wipe circle top CW from right
EFX_EFFECT_WIPE_CIRCLE_B_CW_FROM_L | Wipe circle bottom CW from left
EFX_EFFECT_WIPE_CIRCLE_B_CCW_FROM_R | Wipe circle bottom CCW from right
EFX_EFFECT_WIPE_CIRCLE2_C_CW_FROM_L_AND_FROM_R | Wipe circle2 center CW from left and from right
EFX_EFFECT_WIPE_CIRCLE2_C_CCW_FROM_L_AND_FROM_R | Wipe circle2 center CCW from left and from right
EFX_EFFECT_WIPE_CIRCLE2_C_CW_FROM_T_AND_FROM_B | Wipe circle2 center CW from top and from bottom
EFX_EFFECT_WIPE_CIRCLE2_C_CCW_FROM_T_AND_FROM_B | Wipe circle2 center CCW from top and from bottom
EFX_EFFECT_WIPE_CIRCLE2_L_CW_FROM_T_AND_CCW_FROM_B | Wipe circle2 left CW from top and CCW from bottom
EFX_EFFECT_WIPE_CIRCLE2_L_CCW_TO_T_AND_CW_TO_B | Wipe circle2 left CCW to top and CW to bottom
EFX_EFFECT_WIPE_CIRCLE2_R_CCW_FROM_T_AND_CW_FROM_B | Wipe circle2 right CCW from top and CW from bottom
EFX_EFFECT_WIPE_CIRCLE2_R_CW_TO_T_AND_CCW_TO_B | Wipe circle2 right CW to top and CCW to bottom
EFX_EFFECT_WIPE_CIRCLE2_T_CCW_FROM_L_AND_CW_FROM_R | Wipe circle2 top CCW from left and CW from right
EFX_EFFECT_WIPE_CIRCLE2_T_CW_TO_L_AND_CCW_TO_R | Wipe circle2 top CW to left and CCW to right
EFX_EFFECT_WIPE_CIRCLE2_B_CW_FROM_L_AND_CCW_FROM_R | Wipe circle2 bottom CW from left and CCW from right
EFX_EFFECT_WIPE_CIRCLE2_B_CCW_TO_L_AND_CW_TO_R | Wipe circle2 bottom CCW to left and CW to right
EFX_EFFECT_WIPE_CIRCLE4_C_CW_CCW_CCW_CW | Wipe circle4 center CW CCW CCW CW
EFX_EFFECT_WIPE_CIRCLE4_C_CCW_CW_CW_CCW | Wipe circle4 center CCW CW CW CCW
EFX_EFFECT_WIPE_CIRCLE_MAX | Number of effects in this class.

Push class

EFX_EFFECT_PUSH_R_TO_L | Push right to left
EFX_EFFECT_PUSH_L_TO_R | Push left to right
EFX_EFFECT_PUSH_B_TO_T | Push bottom to top
EFX_EFFECT_PUSH_T_TO_B | Push top to bottom
EFX_EFFECT_PUSH2_T_R_TO_L_AND_B_L_TO_R | Push2 top right to left and bottom left to right
EFX_EFFECT_PUSH2_T_L_TO_R_AND_B_R_TO_L | Push2 top left to right and bottom right to left
EFX_EFFECT_PUSH2_L_B_TO_T_AND_R_T_TO_B | Push2 left bottom to top and right top to bottom
EFX_EFFECT_PUSH2_L_T_TO_B_AND_R_B_TO_T | Push2 left top to bottom and right bottom to top
EFX_EFFECT_PUSH4_L_L_L_L | Push4 left left left left
EFX_EFFECT_PUSH4_L_L_L_R | Push4 left left left right
EFX_EFFECT_PUSH4_L_L_L_T | Push4 left left left top
EFX_EFFECT_PUSH4_L_L_L_B | Push4 left left left bottom
EFX_EFFECT_PUSH4_L_L_R_L | Push4 left left right left
EFX_EFFECT_PUSH4_L_L_R_R | Push4 left left right right
EFX_EFFECT_PUSH4_L_L_R_T | Push4 left left right top
EFX_EFFECT_PUSH4_L_L_R_B | Push4 left left right bottom
EFX_EFFECT_PUSH4_L_L_T_L | Push4 left left top left
EFX_EFFECT_PUSH4_L_L_T_R | Push4 left left top right
EFX_EFFECT_PUSH4_L_L_T_T | Push4 left left top top
EFX_EFFECT_PUSH4_L_L_T_B | Push4 left left top bottom
EFX_EFFECT_PUSH4_L_L_B_L | Push4 left left bottom left
EFX_EFFECT_PUSH4_L_L_B_R | Push4 left left bottom right
EFX_EFFECT_PUSH4_L_L_B_T | Push4 left left bottom top
EFX_EFFECT_PUSH4_L_L_B_B | Push4 left left bottom bottom
EFX_EFFECT_PUSH4_L_R_L_L | Push4 left right left left
EFX_EFFECT_PUSH4_L_R_L_R | Push4 left right left right
EFX_EFFECT_PUSH4_L_R_L_T | Push4 left right left top
EFX_EFFECT_PUSH4_L_R_L_B | Push4 left right left bottom
EFX_EFFECT_PUSH4_L_R_R_L | Push4 left right right left
EFX_EFFECT_PUSH4_L_R_R_R | Push4 left right right right
EFX_EFFECT_PUSH4_L_R_R_T | Push4 left right right top
EFX_EFFECT_PUSH4_L_R_R_B | Push4 left right right bottom
EFX_EFFECT_PUSH4_L_R_T_L | Push4 left right top left
EFX_EFFECT_PUSH4_L_R_T_R | Push4 left right top right
EFX_EFFECT_PUSH4_L_R_T_T | Push4 left right top top
EFX_EFFECT_PUSH4_L_R_T_B | Push4 left right top bottom
EFX_EFFECT_PUSH4_L_R_B_L | Push4 left right bottom left
EFX_EFFECT_PUSH4_L_R_B_R | Push4 left right bottom right
EFX_EFFECT_PUSH4_L_R_B_T | Push4 left right bottom top
EFX_EFFECT_PUSH4_L_R_B_B | Push4 left right bottom bottom
EFX_EFFECT_PUSH4_L_T_L_L | Push4 left top left left
EFX_EFFECT_PUSH4_L_T_L_R | Push4 left top left right
EFX_EFFECT_PUSH4_L_T_L_T | Push4 left top left top
EFX_EFFECT_PUSH4_L_T_L_B | Push4 left top left bottom
EFX_EFFECT_PUSH4_L_T_R_L | Push4 left top right left
EFX_EFFECT_PUSH4_L_T_R_R | Push4 left top right right
EFX_EFFECT_PUSH4_L_T_R_T | Push4 left top right top
EFX_EFFECT_PUSH4_L_T_R_B | Push4 left top right bottom
EFX_EFFECT_PUSH4_L_T_T_L | Push4 left top top left
EFX_EFFECT_PUSH4_L_T_T_R | Push4 left top top right
EFX_EFFECT_PUSH4_L_T_T_T | Push4 left top top top
EFX_EFFECT_PUSH4_L_T_T_B | Push4 left top top bottom
EFX_EFFECT_PUSH4_L_T_B_L | Push4 left top bottom left
EFX_EFFECT_PUSH4_L_T_B_R | Push4 left top bottom right
EFX_EFFECT_PUSH4_L_T_B_T | Push4 left top bottom top
EFX_EFFECT_PUSH4_L_T_B_B | Push4 left top bottom bottom
EFX_EFFECT_PUSH4_L_B_L_L | Push4 left bottom left left
EFX_EFFECT_PUSH4_L_B_L_R | Push4 left bottom left right
EFX_EFFECT_PUSH4_L_B_L_T | Push4 left bottom left top
EFX_EFFECT_PUSH4_L_B_L_B | Push4 left bottom left bottom
EFX_EFFECT_PUSH4_L_B_R_L | Push4 left bottom right left
EFX_EFFECT_PUSH4_L_B_R_R | Push4 left bottom right right
EFX_EFFECT_PUSH4_L_B_R_T | Push4 left bottom right top
EFX_EFFECT_PUSH4_L_B_R_B | Push4 left bottom right bottom
EFX_EFFECT_PUSH4_L_B_T_L | Push4 left bottom top left
EFX_EFFECT_PUSH4_L_B_T_R | Push4 left bottom top right
EFX_EFFECT_PUSH4_L_B_T_T | Push4 left bottom top top
EFX_EFFECT_PUSH4_L_B_T_B | Push4 left bottom top bottom
EFX_EFFECT_PUSH4_L_B_B_L | Push4 left bottom bottom left
EFX_EFFECT_PUSH4_L_B_B_R | Push4 left bottom bottom right
EFX_EFFECT_PUSH4_L_B_B_T | Push4 left bottom bottom top
EFX_EFFECT_PUSH4_L_B_B_B | Push4 left bottom bottom bottom
EFX_EFFECT_PUSH4_R_L_L_L | Push4 right left left left
EFX_EFFECT_PUSH4_R_L_L_R | Push4 right left left right
EFX_EFFECT_PUSH4_R_L_L_T | Push4 right left left top
EFX_EFFECT_PUSH4_R_L_L_B | Push4 right left left bottom
EFX_EFFECT_PUSH4_R_L_R_L | Push4 right left right left
EFX_EFFECT_PUSH4_R_L_R_R | Push4 right left right right
EFX_EFFECT_PUSH4_R_L_R_T | Push4 right left right top
EFX_EFFECT_PUSH4_R_L_R_B | Push4 right left right bottom
EFX_EFFECT_PUSH4_R_L_T_L | Push4 right left top left
EFX_EFFECT_PUSH4_R_L_T_R | Push4 right left top right
EFX_EFFECT_PUSH4_R_L_T_T | Push4 right left top top
EFX_EFFECT_PUSH4_R_L_T_B | Push4 right left top bottom
EFX_EFFECT_PUSH4_R_L_B_L | Push4 right left bottom left
EFX_EFFECT_PUSH4_R_L_B_R | Push4 right left bottom right
EFX_EFFECT_PUSH4_R_L_B_T | Push4 right left bottom top
EFX_EFFECT_PUSH4_R_L_B_B | Push4 right left bottom bottom
EFX_EFFECT_PUSH4_R_R_L_L | Push4 right right left left
EFX_EFFECT_PUSH4_R_R_L_R | Push4 right right left right
EFX_EFFECT_PUSH4_R_R_L_T | Push4 right right left top
EFX_EFFECT_PUSH4_R_R_L_B | Push4 right right left bottom
EFX_EFFECT_PUSH4_R_R_R_L | Push4 right right right left
EFX_EFFECT_PUSH4_R_R_R_R | Push4 right right right right
EFX_EFFECT_PUSH4_R_R_R_T | Push4 right right right top
EFX_EFFECT_PUSH4_R_R_R_B | Push4 right right right bottom
EFX_EFFECT_PUSH4_R_R_T_L | Push4 right right top left
EFX_EFFECT_PUSH4_R_R_T_R | Push4 right right top right
EFX_EFFECT_PUSH4_R_R_T_T | Push4 right right top top
EFX_EFFECT_PUSH4_R_R_T_B | Push4 right right top bottom
EFX_EFFECT_PUSH4_R_R_B_L | Push4 right right bottom left
EFX_EFFECT_PUSH4_R_R_B_R | Push4 right right bottom right
EFX_EFFECT_PUSH4_R_R_B_T | Push4 right right bottom top
EFX_EFFECT_PUSH4_R_R_B_B | Push4 right right bottom bottom
EFX_EFFECT_PUSH4_R_T_L_L | Push4 right top left left
EFX_EFFECT_PUSH4_R_T_L_R | Push4 right top left right
EFX_EFFECT_PUSH4_R_T_L_T | Push4 right top left top
EFX_EFFECT_PUSH4_R_T_L_B | Push4 right top left bottom
EFX_EFFECT_PUSH4_R_T_R_L | Push4 right top right left
EFX_EFFECT_PUSH4_R_T_R_R | Push4 right top right right
EFX_EFFECT_PUSH4_R_T_R_T | Push4 right top right top
EFX_EFFECT_PUSH4_R_T_R_B | Push4 right top right bottom
EFX_EFFECT_PUSH4_R_T_T_L | Push4 right top top left
EFX_EFFECT_PUSH4_R_T_T_R | Push4 right top top right
EFX_EFFECT_PUSH4_R_T_T_T | Push4 right top top top
EFX_EFFECT_PUSH4_R_T_T_B | Push4 right top top bottom
EFX_EFFECT_PUSH4_R_T_B_L | Push4 right top bottom left
EFX_EFFECT_PUSH4_R_T_B_R | Push4 right top bottom right
EFX_EFFECT_PUSH4_R_T_B_T | Push4 right top bottom top
EFX_EFFECT_PUSH4_R_T_B_B | Push4 right top bottom bottom
EFX_EFFECT_PUSH4_R_B_L_L | Push4 right bottom left left
EFX_EFFECT_PUSH4_R_B_L_R | Push4 right bottom left right
EFX_EFFECT_PUSH4_R_B_L_T | Push4 right bottom left top
EFX_EFFECT_PUSH4_R_B_L_B | Push4 right bottom left bottom
EFX_EFFECT_PUSH4_R_B_R_L | Push4 right bottom right left
EFX_EFFECT_PUSH4_R_B_R_R | Push4 right bottom right right
EFX_EFFECT_PUSH4_R_B_R_T | Push4 right bottom right top
EFX_EFFECT_PUSH4_R_B_R_B | Push4 right bottom right bottom
EFX_EFFECT_PUSH4_R_B_T_L | Push4 right bottom top left
EFX_EFFECT_PUSH4_R_B_T_R | Push4 right bottom top right
EFX_EFFECT_PUSH4_R_B_T_T | Push4 right bottom top top
EFX_EFFECT_PUSH4_R_B_T_B | Push4 right bottom top bottom
EFX_EFFECT_PUSH4_R_B_B_L | Push4 right bottom bottom left
EFX_EFFECT_PUSH4_R_B_B_R | Push4 right bottom bottom right
EFX_EFFECT_PUSH4_R_B_B_T | Push4 right bottom bottom top
EFX_EFFECT_PUSH4_R_B_B_B | Push4 right bottom bottom bottom
EFX_EFFECT_PUSH4_T_L_L_L | Push4 top left left left
EFX_EFFECT_PUSH4_T_L_L_R | Push4 top left left right
EFX_EFFECT_PUSH4_T_L_L_T | Push4 top left left top
EFX_EFFECT_PUSH4_T_L_L_B | Push4 top left left bottom
EFX_EFFECT_PUSH4_T_L_R_L | Push4 top left right left
EFX_EFFECT_PUSH4_T_L_R_R | Push4 top left right right
EFX_EFFECT_PUSH4_T_L_R_T | Push4 top left right top
EFX_EFFECT_PUSH4_T_L_R_B | Push4 top left right bottom
EFX_EFFECT_PUSH4_T_L_T_L | Push4 top left top left
EFX_EFFECT_PUSH4_T_L_T_R | Push4 top left top right
EFX_EFFECT_PUSH4_T_L_T_T | Push4 top left top top
EFX_EFFECT_PUSH4_T_L_T_B | Push4 top left top bottom
EFX_EFFECT_PUSH4_T_L_B_L | Push4 top left bottom left
EFX_EFFECT_PUSH4_T_L_B_R | Push4 top left bottom right
EFX_EFFECT_PUSH4_T_L_B_T | Push4 top left bottom top
EFX_EFFECT_PUSH4_T_L_B_B | Push4 top left bottom bottom
EFX_EFFECT_PUSH4_T_R_L_L | Push4 top right left left
EFX_EFFECT_PUSH4_T_R_L_R | Push4 top right left right
EFX_EFFECT_PUSH4_T_R_L_T | Push4 top right left top
EFX_EFFECT_PUSH4_T_R_L_B | Push4 top right left bottom
EFX_EFFECT_PUSH4_T_R_R_L | Push4 top right right left
EFX_EFFECT_PUSH4_T_R_R_R | Push4 top right right right
EFX_EFFECT_PUSH4_T_R_R_T | Push4 top right right top
EFX_EFFECT_PUSH4_T_R_R_B | Push4 top right right bottom
EFX_EFFECT_PUSH4_T_R_T_L | Push4 top right top left
EFX_EFFECT_PUSH4_T_R_T_R | Push4 top right top right
EFX_EFFECT_PUSH4_T_R_T_T | Push4 top right top top
EFX_EFFECT_PUSH4_T_R_T_B | Push4 top right top bottom
EFX_EFFECT_PUSH4_T_R_B_L | Push4 top right bottom left
EFX_EFFECT_PUSH4_T_R_B_R | Push4 top right bottom right
EFX_EFFECT_PUSH4_T_R_B_T | Push4 top right bottom top
EFX_EFFECT_PUSH4_T_R_B_B | Push4 top right bottom bottom
EFX_EFFECT_PUSH4_T_T_L_L | Push4 top top left left
EFX_EFFECT_PUSH4_T_T_L_R | Push4 top top left right
EFX_EFFECT_PUSH4_T_T_L_T | Push4 top top left top
EFX_EFFECT_PUSH4_T_T_L_B | Push4 top top left bottom
EFX_EFFECT_PUSH4_T_T_R_L | Push4 top top right left
EFX_EFFECT_PUSH4_T_T_R_R | Push4 top top right right
EFX_EFFECT_PUSH4_T_T_R_T | Push4 top top right top
EFX_EFFECT_PUSH4_T_T_R_B | Push4 top top right bottom
EFX_EFFECT_PUSH4_T_T_T_L | Push4 top top top left
EFX_EFFECT_PUSH4_T_T_T_R | Push4 top top top right
EFX_EFFECT_PUSH4_T_T_T_T | Push4 top top top top
EFX_EFFECT_PUSH4_T_T_T_B | Push4 top top top bottom
EFX_EFFECT_PUSH4_T_T_B_L | Push4 top top bottom left
EFX_EFFECT_PUSH4_T_T_B_R | Push4 top top bottom right
EFX_EFFECT_PUSH4_T_T_B_T | Push4 top top bottom top
EFX_EFFECT_PUSH4_T_T_B_B | Push4 top top bottom bottom
EFX_EFFECT_PUSH4_T_B_L_L | Push4 top bottom left left
EFX_EFFECT_PUSH4_T_B_L_R | Push4 top bottom left right
EFX_EFFECT_PUSH4_T_B_L_T | Push4 top bottom left top
EFX_EFFECT_PUSH4_T_B_L_B | Push4 top bottom left bottom
EFX_EFFECT_PUSH4_T_B_R_L | Push4 top bottom right left
EFX_EFFECT_PUSH4_T_B_R_R | Push4 top bottom right right
EFX_EFFECT_PUSH4_T_B_R_T | Push4 top bottom right top
EFX_EFFECT_PUSH4_T_B_R_B | Push4 top bottom right bottom
EFX_EFFECT_PUSH4_T_B_T_L | Push4 top bottom top left
EFX_EFFECT_PUSH4_T_B_T_R | Push4 top bottom top right
EFX_EFFECT_PUSH4_T_B_T_T | Push4 top bottom top top
EFX_EFFECT_PUSH4_T_B_T_B | Push4 top bottom top bottom
EFX_EFFECT_PUSH4_T_B_B_L | Push4 top bottom bottom left
EFX_EFFECT_PUSH4_T_B_B_R | Push4 top bottom bottom right
EFX_EFFECT_PUSH4_T_B_B_T | Push4 top bottom bottom top
EFX_EFFECT_PUSH4_T_B_B_B | Push4 top bottom bottom bottom
EFX_EFFECT_PUSH4_B_L_L_L | Push4 bottom left left left
EFX_EFFECT_PUSH4_B_L_L_R | Push4 bottom left left right
EFX_EFFECT_PUSH4_B_L_L_T | Push4 bottom left left top
EFX_EFFECT_PUSH4_B_L_L_B | Push4 bottom left left bottom
EFX_EFFECT_PUSH4_B_L_R_L | Push4 bottom left right left
EFX_EFFECT_PUSH4_B_L_R_R | Push4 bottom left right right
EFX_EFFECT_PUSH4_B_L_R_T | Push4 bottom left right top
EFX_EFFECT_PUSH4_B_L_R_B | Push4 bottom left right bottom
EFX_EFFECT_PUSH4_B_L_T_L | Push4 bottom left top left
EFX_EFFECT_PUSH4_B_L_T_R | Push4 bottom left top right
EFX_EFFECT_PUSH4_B_L_T_T | Push4 bottom left top top
EFX_EFFECT_PUSH4_B_L_T_B | Push4 bottom left top bottom
EFX_EFFECT_PUSH4_B_L_B_L | Push4 bottom left bottom left
EFX_EFFECT_PUSH4_B_L_B_R | Push4 bottom left bottom right
EFX_EFFECT_PUSH4_B_L_B_T | Push4 bottom left bottom top
EFX_EFFECT_PUSH4_B_L_B_B | Push4 bottom left bottom bottom
EFX_EFFECT_PUSH4_B_R_L_L | Push4 bottom right left left
EFX_EFFECT_PUSH4_B_R_L_R | Push4 bottom right left right
EFX_EFFECT_PUSH4_B_R_L_T | Push4 bottom right left top
EFX_EFFECT_PUSH4_B_R_L_B | Push4 bottom right left bottom
EFX_EFFECT_PUSH4_B_R_R_L | Push4 bottom right right left
EFX_EFFECT_PUSH4_B_R_R_R | Push4 bottom right right right
EFX_EFFECT_PUSH4_B_R_R_T | Push4 bottom right right top
EFX_EFFECT_PUSH4_B_R_R_B | Push4 bottom right right bottom
EFX_EFFECT_PUSH4_B_R_T_L | Push4 bottom right top left
EFX_EFFECT_PUSH4_B_R_T_R | Push4 bottom right top right
EFX_EFFECT_PUSH4_B_R_T_T | Push4 bottom right top top
EFX_EFFECT_PUSH4_B_R_T_B | Push4 bottom right top bottom
EFX_EFFECT_PUSH4_B_R_B_L | Push4 bottom right bottom left
EFX_EFFECT_PUSH4_B_R_B_R | Push4 bottom right bottom right
EFX_EFFECT_PUSH4_B_R_B_T | Push4 bottom right bottom top
EFX_EFFECT_PUSH4_B_R_B_B | Push4 bottom right bottom bottom
EFX_EFFECT_PUSH4_B_T_L_L | Push4 bottom top left left
EFX_EFFECT_PUSH4_B_T_L_R | Push4 bottom top left right
EFX_EFFECT_PUSH4_B_T_L_T | Push4 bottom top left top
EFX_EFFECT_PUSH4_B_T_L_B | Push4 bottom top left bottom
EFX_EFFECT_PUSH4_B_T_R_L | Push4 bottom top right left
EFX_EFFECT_PUSH4_B_T_R_R | Push4 bottom top right right
EFX_EFFECT_PUSH4_B_T_R_T | Push4 bottom top right top
EFX_EFFECT_PUSH4_B_T_R_B | Push4 bottom top right bottom
EFX_EFFECT_PUSH4_B_T_T_L | Push4 bottom top top left
EFX_EFFECT_PUSH4_B_T_T_R | Push4 bottom top top right
EFX_EFFECT_PUSH4_B_T_T_T | Push4 bottom top top top
EFX_EFFECT_PUSH4_B_T_T_B | Push4 bottom top top bottom
EFX_EFFECT_PUSH4_B_T_B_L | Push4 bottom top bottom left
EFX_EFFECT_PUSH4_B_T_B_R | Push4 bottom top bottom right
EFX_EFFECT_PUSH4_B_T_B_T | Push4 bottom top bottom top
EFX_EFFECT_PUSH4_B_T_B_B | Push4 bottom top bottom bottom
EFX_EFFECT_PUSH4_B_B_L_L | Push4 bottom bottom left left
EFX_EFFECT_PUSH4_B_B_L_R | Push4 bottom bottom left right
EFX_EFFECT_PUSH4_B_B_L_T | Push4 bottom bottom left top
EFX_EFFECT_PUSH4_B_B_L_B | Push4 bottom bottom left bottom
EFX_EFFECT_PUSH4_B_B_R_L | Push4 bottom bottom right left
EFX_EFFECT_PUSH4_B_B_R_R | Push4 bottom bottom right right
EFX_EFFECT_PUSH4_B_B_R_T | Push4 bottom bottom right top
EFX_EFFECT_PUSH4_B_B_R_B | Push4 bottom bottom right bottom
EFX_EFFECT_PUSH4_B_B_T_L | Push4 bottom bottom top left
EFX_EFFECT_PUSH4_B_B_T_R | Push4 bottom bottom top right
EFX_EFFECT_PUSH4_B_B_T_T | Push4 bottom bottom top top
EFX_EFFECT_PUSH4_B_B_T_B | Push4 bottom bottom top bottom
EFX_EFFECT_PUSH4_B_B_B_L | Push4 bottom bottom bottom left
EFX_EFFECT_PUSH4_B_B_B_R | Push4 bottom bottom bottom right
EFX_EFFECT_PUSH4_B_B_B_T | Push4 bottom bottom bottom top
EFX_EFFECT_PUSH4_B_B_B_B | Push4 bottom bottom bottom bottom
EFX_EFFECT_PUSH_MAX | Number of effects in this class.

Slide class

EFX_EFFECT_SLIDE_R_TO_L | Slide right to left
EFX_EFFECT_SLIDE_L_TO_R | Slide left to right
EFX_EFFECT_SLIDE_B_TO_T | Slide bottom to top
EFX_EFFECT_SLIDE_T_TO_B | Slide top to bottom
EFX_EFFECT_SLIDE_LT_TO_RB | Slide left-top to right-bottom
EFX_EFFECT_SLIDE_RT_TO_LB | Slide right-top to left-bottom
EFX_EFFECT_SLIDE_LB_TO_RT | Slide left-bottom to right-top
EFX_EFFECT_SLIDE_RB_TO_LT | Slide right-bottom to left-top
EFX_EFFECT_SLIDE_INTERH_L_TO_R_AND_R_TO_L | Slide horizontal interlace left to right and right to left
EFX_EFFECT_SLIDE_INTERV_T_TO_B_AND_B_TO_T | Slide vertical interlace top to bottom and bottom to top
EFX_EFFECT_SLIDE2_T_R_TO_L_AND_B_L_TO_R | Slide2 top right to left and bottom left to right
EFX_EFFECT_SLIDE2_T_L_TO_R_AND_B_R_TO_L | Slide2 top left to right and bottom right to left
EFX_EFFECT_SLIDE2_L_B_TO_T_AND_R_T_TO_B | Slide2 left bottom to top and right top to bottom
EFX_EFFECT_SLIDE2_L_T_TO_B_AND_R_B_TO_T | Slide2 left top to bottom and right bottom to top
EFX_EFFECT_SLIDE4_L_L_L_L | Slide4 left left left left
EFX_EFFECT_SLIDE4_L_L_L_R | Slide4 left left left right
EFX_EFFECT_SLIDE4_L_L_L_T | Slide4 left left left top
EFX_EFFECT_SLIDE4_L_L_L_B | Slide4 left left left bottom
EFX_EFFECT_SLIDE4_L_L_R_L | Slide4 left left right left
EFX_EFFECT_SLIDE4_L_L_R_R | Slide4 left left right right
EFX_EFFECT_SLIDE4_L_L_R_T | Slide4 left left right top
EFX_EFFECT_SLIDE4_L_L_R_B | Slide4 left left right bottom
EFX_EFFECT_SLIDE4_L_L_T_L | Slide4 left left top left
EFX_EFFECT_SLIDE4_L_L_T_R | Slide4 left left top right
EFX_EFFECT_SLIDE4_L_L_T_T | Slide4 left left top top
EFX_EFFECT_SLIDE4_L_L_T_B | Slide4 left left top bottom
EFX_EFFECT_SLIDE4_L_L_B_L | Slide4 left left bottom left
EFX_EFFECT_SLIDE4_L_L_B_R | Slide4 left left bottom right
EFX_EFFECT_SLIDE4_L_L_B_T | Slide4 left left bottom top
EFX_EFFECT_SLIDE4_L_L_B_B | Slide4 left left bottom bottom
EFX_EFFECT_SLIDE4_L_R_L_L | Slide4 left right left left
EFX_EFFECT_SLIDE4_L_R_L_R | Slide4 left right left right
EFX_EFFECT_SLIDE4_L_R_L_T | Slide4 left right left top
EFX_EFFECT_SLIDE4_L_R_L_B | Slide4 left right left bottom
EFX_EFFECT_SLIDE4_L_R_R_L | Slide4 left right right left
EFX_EFFECT_SLIDE4_L_R_R_R | Slide4 left right right right
EFX_EFFECT_SLIDE4_L_R_R_T | Slide4 left right right top
EFX_EFFECT_SLIDE4_L_R_R_B | Slide4 left right right bottom
EFX_EFFECT_SLIDE4_L_R_T_L | Slide4 left right top left
EFX_EFFECT_SLIDE4_L_R_T_R | Slide4 left right top right
EFX_EFFECT_SLIDE4_L_R_T_T | Slide4 left right top top
EFX_EFFECT_SLIDE4_L_R_T_B | Slide4 left right top bottom
EFX_EFFECT_SLIDE4_L_R_B_L | Slide4 left right bottom left
EFX_EFFECT_SLIDE4_L_R_B_R | Slide4 left right bottom right
EFX_EFFECT_SLIDE4_L_R_B_T | Slide4 left right bottom top
EFX_EFFECT_SLIDE4_L_R_B_B | Slide4 left right bottom bottom
EFX_EFFECT_SLIDE4_L_T_L_L | Slide4 left top left left
EFX_EFFECT_SLIDE4_L_T_L_R | Slide4 left top left right
EFX_EFFECT_SLIDE4_L_T_L_T | Slide4 left top left top
EFX_EFFECT_SLIDE4_L_T_L_B | Slide4 left top left bottom
EFX_EFFECT_SLIDE4_L_T_R_L | Slide4 left top right left
EFX_EFFECT_SLIDE4_L_T_R_R | Slide4 left top right right
EFX_EFFECT_SLIDE4_L_T_R_T | Slide4 left top right top
EFX_EFFECT_SLIDE4_L_T_R_B | Slide4 left top right bottom
EFX_EFFECT_SLIDE4_L_T_T_L | Slide4 left top top left
EFX_EFFECT_SLIDE4_L_T_T_R | Slide4 left top top right
EFX_EFFECT_SLIDE4_L_T_T_T | Slide4 left top top top
EFX_EFFECT_SLIDE4_L_T_T_B | Slide4 left top top bottom
EFX_EFFECT_SLIDE4_L_T_B_L | Slide4 left top bottom left
EFX_EFFECT_SLIDE4_L_T_B_R | Slide4 left top bottom right
EFX_EFFECT_SLIDE4_L_T_B_T | Slide4 left top bottom top
EFX_EFFECT_SLIDE4_L_T_B_B | Slide4 left top bottom bottom
EFX_EFFECT_SLIDE4_L_B_L_L | Slide4 left bottom left left
EFX_EFFECT_SLIDE4_L_B_L_R | Slide4 left bottom left right
EFX_EFFECT_SLIDE4_L_B_L_T | Slide4 left bottom left top
EFX_EFFECT_SLIDE4_L_B_L_B | Slide4 left bottom left bottom
EFX_EFFECT_SLIDE4_L_B_R_L | Slide4 left bottom right left
EFX_EFFECT_SLIDE4_L_B_R_R | Slide4 left bottom right right
EFX_EFFECT_SLIDE4_L_B_R_T | Slide4 left bottom right top
EFX_EFFECT_SLIDE4_L_B_R_B | Slide4 left bottom right bottom
EFX_EFFECT_SLIDE4_L_B_T_L | Slide4 left bottom top left
EFX_EFFECT_SLIDE4_L_B_T_R | Slide4 left bottom top right
EFX_EFFECT_SLIDE4_L_B_T_T | Slide4 left bottom top top
EFX_EFFECT_SLIDE4_L_B_T_B | Slide4 left bottom top bottom
EFX_EFFECT_SLIDE4_L_B_B_L | Slide4 left bottom bottom left
EFX_EFFECT_SLIDE4_L_B_B_R | Slide4 left bottom bottom right
EFX_EFFECT_SLIDE4_L_B_B_T | Slide4 left bottom bottom top
EFX_EFFECT_SLIDE4_L_B_B_B | Slide4 left bottom bottom bottom
EFX_EFFECT_SLIDE4_R_L_L_L | Slide4 right left left left
EFX_EFFECT_SLIDE4_R_L_L_R | Slide4 right left left right
EFX_EFFECT_SLIDE4_R_L_L_T | Slide4 right left left top
EFX_EFFECT_SLIDE4_R_L_L_B | Slide4 right left left bottom
EFX_EFFECT_SLIDE4_R_L_R_L | Slide4 right left right left
EFX_EFFECT_SLIDE4_R_L_R_R | Slide4 right left right right
EFX_EFFECT_SLIDE4_R_L_R_T | Slide4 right left right top
EFX_EFFECT_SLIDE4_R_L_R_B | Slide4 right left right bottom
EFX_EFFECT_SLIDE4_R_L_T_L | Slide4 right left top left
EFX_EFFECT_SLIDE4_R_L_T_R | Slide4 right left top right
EFX_EFFECT_SLIDE4_R_L_T_T | Slide4 right left top top
EFX_EFFECT_SLIDE4_R_L_T_B | Slide4 right left top bottom
EFX_EFFECT_SLIDE4_R_L_B_L | Slide4 right left bottom left
EFX_EFFECT_SLIDE4_R_L_B_R | Slide4 right left bottom right
EFX_EFFECT_SLIDE4_R_L_B_T | Slide4 right left bottom top
EFX_EFFECT_SLIDE4_R_L_B_B | Slide4 right left bottom bottom
EFX_EFFECT_SLIDE4_R_R_L_L | Slide4 right right left left
EFX_EFFECT_SLIDE4_R_R_L_R | Slide4 right right left right
EFX_EFFECT_SLIDE4_R_R_L_T | Slide4 right right left top
EFX_EFFECT_SLIDE4_R_R_L_B | Slide4 right right left bottom
EFX_EFFECT_SLIDE4_R_R_R_L | Slide4 right right right left
EFX_EFFECT_SLIDE4_R_R_R_R | Slide4 right right right right
EFX_EFFECT_SLIDE4_R_R_R_T | Slide4 right right right top
EFX_EFFECT_SLIDE4_R_R_R_B | Slide4 right right right bottom
EFX_EFFECT_SLIDE4_R_R_T_L | Slide4 right right top left
EFX_EFFECT_SLIDE4_R_R_T_R | Slide4 right right top right
EFX_EFFECT_SLIDE4_R_R_T_T | Slide4 right right top top
EFX_EFFECT_SLIDE4_R_R_T_B | Slide4 right right top bottom
EFX_EFFECT_SLIDE4_R_R_B_L | Slide4 right right bottom left
EFX_EFFECT_SLIDE4_R_R_B_R | Slide4 right right bottom right
EFX_EFFECT_SLIDE4_R_R_B_T | Slide4 right right bottom top
EFX_EFFECT_SLIDE4_R_R_B_B | Slide4 right right bottom bottom
EFX_EFFECT_SLIDE4_R_T_L_L | Slide4 right top left left
EFX_EFFECT_SLIDE4_R_T_L_R | Slide4 right top left right
EFX_EFFECT_SLIDE4_R_T_L_T | Slide4 right top left top
EFX_EFFECT_SLIDE4_R_T_L_B | Slide4 right top left bottom
EFX_EFFECT_SLIDE4_R_T_R_L | Slide4 right top right left
EFX_EFFECT_SLIDE4_R_T_R_R | Slide4 right top right right
EFX_EFFECT_SLIDE4_R_T_R_T | Slide4 right top right top
EFX_EFFECT_SLIDE4_R_T_R_B | Slide4 right top right bottom
EFX_EFFECT_SLIDE4_R_T_T_L | Slide4 right top top left
EFX_EFFECT_SLIDE4_R_T_T_R | Slide4 right top top right
EFX_EFFECT_SLIDE4_R_T_T_T | Slide4 right top top top
EFX_EFFECT_SLIDE4_R_T_T_B | Slide4 right top top bottom
EFX_EFFECT_SLIDE4_R_T_B_L | Slide4 right top bottom left
EFX_EFFECT_SLIDE4_R_T_B_R | Slide4 right top bottom right
EFX_EFFECT_SLIDE4_R_T_B_T | Slide4 right top bottom top
EFX_EFFECT_SLIDE4_R_T_B_B | Slide4 right top bottom bottom
EFX_EFFECT_SLIDE4_R_B_L_L | Slide4 right bottom left left
EFX_EFFECT_SLIDE4_R_B_L_R | Slide4 right bottom left right
EFX_EFFECT_SLIDE4_R_B_L_T | Slide4 right bottom left top
EFX_EFFECT_SLIDE4_R_B_L_B | Slide4 right bottom left bottom
EFX_EFFECT_SLIDE4_R_B_R_L | Slide4 right bottom right left
EFX_EFFECT_SLIDE4_R_B_R_R | Slide4 right bottom right right
EFX_EFFECT_SLIDE4_R_B_R_T | Slide4 right bottom right top
EFX_EFFECT_SLIDE4_R_B_R_B | Slide4 right bottom right bottom
EFX_EFFECT_SLIDE4_R_B_T_L | Slide4 right bottom top left
EFX_EFFECT_SLIDE4_R_B_T_R | Slide4 right bottom top right
EFX_EFFECT_SLIDE4_R_B_T_T | Slide4 right bottom top top
EFX_EFFECT_SLIDE4_R_B_T_B | Slide4 right bottom top bottom
EFX_EFFECT_SLIDE4_R_B_B_L | Slide4 right bottom bottom left
EFX_EFFECT_SLIDE4_R_B_B_R | Slide4 right bottom bottom right
EFX_EFFECT_SLIDE4_R_B_B_T | Slide4 right bottom bottom top
EFX_EFFECT_SLIDE4_R_B_B_B | Slide4 right bottom bottom bottom
EFX_EFFECT_SLIDE4_T_L_L_L | Slide4 top left left left
EFX_EFFECT_SLIDE4_T_L_L_R | Slide4 top left left right
EFX_EFFECT_SLIDE4_T_L_L_T | Slide4 top left left top
EFX_EFFECT_SLIDE4_T_L_L_B | Slide4 top left left bottom
EFX_EFFECT_SLIDE4_T_L_R_L | Slide4 top left right left
EFX_EFFECT_SLIDE4_T_L_R_R | Slide4 top left right right
EFX_EFFECT_SLIDE4_T_L_R_T | Slide4 top left right top
EFX_EFFECT_SLIDE4_T_L_R_B | Slide4 top left right bottom
EFX_EFFECT_SLIDE4_T_L_T_L | Slide4 top left top left
EFX_EFFECT_SLIDE4_T_L_T_R | Slide4 top left top right
EFX_EFFECT_SLIDE4_T_L_T_T | Slide4 top left top top
EFX_EFFECT_SLIDE4_T_L_T_B | Slide4 top left top bottom
EFX_EFFECT_SLIDE4_T_L_B_L | Slide4 top left bottom left
EFX_EFFECT_SLIDE4_T_L_B_R | Slide4 top left bottom right
EFX_EFFECT_SLIDE4_T_L_B_T | Slide4 top left bottom top
EFX_EFFECT_SLIDE4_T_L_B_B | Slide4 top left bottom bottom
EFX_EFFECT_SLIDE4_T_R_L_L | Slide4 top right left left
EFX_EFFECT_SLIDE4_T_R_L_R | Slide4 top right left right
EFX_EFFECT_SLIDE4_T_R_L_T | Slide4 top right left top
EFX_EFFECT_SLIDE4_T_R_L_B | Slide4 top right left bottom
EFX_EFFECT_SLIDE4_T_R_R_L | Slide4 top right right left
EFX_EFFECT_SLIDE4_T_R_R_R | Slide4 top right right right
EFX_EFFECT_SLIDE4_T_R_R_T | Slide4 top right right top
EFX_EFFECT_SLIDE4_T_R_R_B | Slide4 top right right bottom
EFX_EFFECT_SLIDE4_T_R_T_L | Slide4 top right top left
EFX_EFFECT_SLIDE4_T_R_T_R | Slide4 top right top right
EFX_EFFECT_SLIDE4_T_R_T_T | Slide4 top right top top
EFX_EFFECT_SLIDE4_T_R_T_B | Slide4 top right top bottom
EFX_EFFECT_SLIDE4_T_R_B_L | Slide4 top right bottom left
EFX_EFFECT_SLIDE4_T_R_B_R | Slide4 top right bottom right
EFX_EFFECT_SLIDE4_T_R_B_T | Slide4 top right bottom top
EFX_EFFECT_SLIDE4_T_R_B_B | Slide4 top right bottom bottom
EFX_EFFECT_SLIDE4_T_T_L_L | Slide4 top top left left
EFX_EFFECT_SLIDE4_T_T_L_R | Slide4 top top left right
EFX_EFFECT_SLIDE4_T_T_L_T | Slide4 top top left top
EFX_EFFECT_SLIDE4_T_T_L_B | Slide4 top top left bottom
EFX_EFFECT_SLIDE4_T_T_R_L | Slide4 top top right left
EFX_EFFECT_SLIDE4_T_T_R_R | Slide4 top top right right
EFX_EFFECT_SLIDE4_T_T_R_T | Slide4 top top right top
EFX_EFFECT_SLIDE4_T_T_R_B | Slide4 top top right bottom
EFX_EFFECT_SLIDE4_T_T_T_L | Slide4 top top top left
EFX_EFFECT_SLIDE4_T_T_T_R | Slide4 top top top right
EFX_EFFECT_SLIDE4_T_T_T_T | Slide4 top top top top
EFX_EFFECT_SLIDE4_T_T_T_B | Slide4 top top top bottom
EFX_EFFECT_SLIDE4_T_T_B_L | Slide4 top top bottom left
EFX_EFFECT_SLIDE4_T_T_B_R | Slide4 top top bottom right
EFX_EFFECT_SLIDE4_T_T_B_T | Slide4 top top bottom top
EFX_EFFECT_SLIDE4_T_T_B_B | Slide4 top top bottom bottom
EFX_EFFECT_SLIDE4_T_B_L_L | Slide4 top bottom left left
EFX_EFFECT_SLIDE4_T_B_L_R | Slide4 top bottom left right
EFX_EFFECT_SLIDE4_T_B_L_T | Slide4 top bottom left top
EFX_EFFECT_SLIDE4_T_B_L_B | Slide4 top bottom left bottom
EFX_EFFECT_SLIDE4_T_B_R_L | Slide4 top bottom right left
EFX_EFFECT_SLIDE4_T_B_R_R | Slide4 top bottom right right
EFX_EFFECT_SLIDE4_T_B_R_T | Slide4 top bottom right top
EFX_EFFECT_SLIDE4_T_B_R_B | Slide4 top bottom right bottom
EFX_EFFECT_SLIDE4_T_B_T_L | Slide4 top bottom top left
EFX_EFFECT_SLIDE4_T_B_T_R | Slide4 top bottom top right
EFX_EFFECT_SLIDE4_T_B_T_T | Slide4 top bottom top top
EFX_EFFECT_SLIDE4_T_B_T_B | Slide4 top bottom top bottom
EFX_EFFECT_SLIDE4_T_B_B_L | Slide4 top bottom bottom left
EFX_EFFECT_SLIDE4_T_B_B_R | Slide4 top bottom bottom right
EFX_EFFECT_SLIDE4_T_B_B_T | Slide4 top bottom bottom top
EFX_EFFECT_SLIDE4_T_B_B_B | Slide4 top bottom bottom bottom
EFX_EFFECT_SLIDE4_B_L_L_L | Slide4 bottom left left left
EFX_EFFECT_SLIDE4_B_L_L_R | Slide4 bottom left left right
EFX_EFFECT_SLIDE4_B_L_L_T | Slide4 bottom left left top
EFX_EFFECT_SLIDE4_B_L_L_B | Slide4 bottom left left bottom
EFX_EFFECT_SLIDE4_B_L_R_L | Slide4 bottom left right left
EFX_EFFECT_SLIDE4_B_L_R_R | Slide4 bottom left right right
EFX_EFFECT_SLIDE4_B_L_R_T | Slide4 bottom left right top
EFX_EFFECT_SLIDE4_B_L_R_B | Slide4 bottom left right bottom
EFX_EFFECT_SLIDE4_B_L_T_L | Slide4 bottom left top left
EFX_EFFECT_SLIDE4_B_L_T_R | Slide4 bottom left top right
EFX_EFFECT_SLIDE4_B_L_T_T | Slide4 bottom left top top
EFX_EFFECT_SLIDE4_B_L_T_B | Slide4 bottom left top bottom
EFX_EFFECT_SLIDE4_B_L_B_L | Slide4 bottom left bottom left
EFX_EFFECT_SLIDE4_B_L_B_R | Slide4 bottom left bottom right
EFX_EFFECT_SLIDE4_B_L_B_T | Slide4 bottom left bottom top
EFX_EFFECT_SLIDE4_B_L_B_B | Slide4 bottom left bottom bottom
EFX_EFFECT_SLIDE4_B_R_L_L | Slide4 bottom right left left
EFX_EFFECT_SLIDE4_B_R_L_R | Slide4 bottom right left right
EFX_EFFECT_SLIDE4_B_R_L_T | Slide4 bottom right left top
EFX_EFFECT_SLIDE4_B_R_L_B | Slide4 bottom right left bottom
EFX_EFFECT_SLIDE4_B_R_R_L | Slide4 bottom right right left
EFX_EFFECT_SLIDE4_B_R_R_R | Slide4 bottom right right right
EFX_EFFECT_SLIDE4_B_R_R_T | Slide4 bottom right right top
EFX_EFFECT_SLIDE4_B_R_R_B | Slide4 bottom right right bottom
EFX_EFFECT_SLIDE4_B_R_T_L | Slide4 bottom right top left
EFX_EFFECT_SLIDE4_B_R_T_R | Slide4 bottom right top right
EFX_EFFECT_SLIDE4_B_R_T_T | Slide4 bottom right top top
EFX_EFFECT_SLIDE4_B_R_T_B | Slide4 bottom right top bottom
EFX_EFFECT_SLIDE4_B_R_B_L | Slide4 bottom right bottom left
EFX_EFFECT_SLIDE4_B_R_B_R | Slide4 bottom right bottom right
EFX_EFFECT_SLIDE4_B_R_B_T | Slide4 bottom right bottom top
EFX_EFFECT_SLIDE4_B_R_B_B | Slide4 bottom right bottom bottom
EFX_EFFECT_SLIDE4_B_T_L_L | Slide4 bottom top left left
EFX_EFFECT_SLIDE4_B_T_L_R | Slide4 bottom top left right
EFX_EFFECT_SLIDE4_B_T_L_T | Slide4 bottom top left top
EFX_EFFECT_SLIDE4_B_T_L_B | Slide4 bottom top left bottom
EFX_EFFECT_SLIDE4_B_T_R_L | Slide4 bottom top right left
EFX_EFFECT_SLIDE4_B_T_R_R | Slide4 bottom top right right
EFX_EFFECT_SLIDE4_B_T_R_T | Slide4 bottom top right top
EFX_EFFECT_SLIDE4_B_T_R_B | Slide4 bottom top right bottom
EFX_EFFECT_SLIDE4_B_T_T_L | Slide4 bottom top top left
EFX_EFFECT_SLIDE4_B_T_T_R | Slide4 bottom top top right
EFX_EFFECT_SLIDE4_B_T_T_T | Slide4 bottom top top top
EFX_EFFECT_SLIDE4_B_T_T_B | Slide4 bottom top top bottom
EFX_EFFECT_SLIDE4_B_T_B_L | Slide4 bottom top bottom left
EFX_EFFECT_SLIDE4_B_T_B_R | Slide4 bottom top bottom right
EFX_EFFECT_SLIDE4_B_T_B_T | Slide4 bottom top bottom top
EFX_EFFECT_SLIDE4_B_T_B_B | Slide4 bottom top bottom bottom
EFX_EFFECT_SLIDE4_B_B_L_L | Slide4 bottom bottom left left
EFX_EFFECT_SLIDE4_B_B_L_R | Slide4 bottom bottom left right
EFX_EFFECT_SLIDE4_B_B_L_T | Slide4 bottom bottom left top
EFX_EFFECT_SLIDE4_B_B_L_B | Slide4 bottom bottom left bottom
EFX_EFFECT_SLIDE4_B_B_R_L | Slide4 bottom bottom right left
EFX_EFFECT_SLIDE4_B_B_R_R | Slide4 bottom bottom right right
EFX_EFFECT_SLIDE4_B_B_R_T | Slide4 bottom bottom right top
EFX_EFFECT_SLIDE4_B_B_R_B | Slide4 bottom bottom right bottom
EFX_EFFECT_SLIDE4_B_B_T_L | Slide4 bottom bottom top left
EFX_EFFECT_SLIDE4_B_B_T_R | Slide4 bottom bottom top right
EFX_EFFECT_SLIDE4_B_B_T_T | Slide4 bottom bottom top top
EFX_EFFECT_SLIDE4_B_B_T_B | Slide4 bottom bottom top bottom
EFX_EFFECT_SLIDE4_B_B_B_L | Slide4 bottom bottom bottom left
EFX_EFFECT_SLIDE4_B_B_B_R | Slide4 bottom bottom bottom right
EFX_EFFECT_SLIDE4_B_B_B_T | Slide4 bottom bottom bottom top
EFX_EFFECT_SLIDE4_B_B_B_B | Slide4 bottom bottom bottom bottom
EFX_EFFECT_SLIDE4_LT_LT_LT_LT | Slide4 left-top left-top left-top left-top
EFX_EFFECT_SLIDE4_LT_LT_LT_LB | Slide4 left-top left-top left-top left-bottom
EFX_EFFECT_SLIDE4_LT_LT_LT_RT | Slide4 left-top left-top left-top right-top
EFX_EFFECT_SLIDE4_LT_LT_LT_RB | Slide4 left-top left-top left-top right-bottom
EFX_EFFECT_SLIDE4_LT_LT_LB_LT | Slide4 left-top left-top left-bottom left-top
EFX_EFFECT_SLIDE4_LT_LT_LB_LB | Slide4 left-top left-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_LT_LB_RT | Slide4 left-top left-top left-bottom right-top
EFX_EFFECT_SLIDE4_LT_LT_LB_RB | Slide4 left-top left-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_LT_RT_LT | Slide4 left-top left-top right-top left-top
EFX_EFFECT_SLIDE4_LT_LT_RT_LB | Slide4 left-top left-top right-top left-bottom
EFX_EFFECT_SLIDE4_LT_LT_RT_RT | Slide4 left-top left-top right-top right-top
EFX_EFFECT_SLIDE4_LT_LT_RT_RB | Slide4 left-top left-top right-top right-bottom
EFX_EFFECT_SLIDE4_LT_LT_RB_LT | Slide4 left-top left-top right-bottom left-top
EFX_EFFECT_SLIDE4_LT_LT_RB_LB | Slide4 left-top left-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_LT_RB_RT | Slide4 left-top left-top right-bottom right-top
EFX_EFFECT_SLIDE4_LT_LT_RB_RB | Slide4 left-top left-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_LB_LT_LT | Slide4 left-top left-bottom left-top left-top
EFX_EFFECT_SLIDE4_LT_LB_LT_LB | Slide4 left-top left-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_LT_LB_LT_RT | Slide4 left-top left-bottom left-top right-top
EFX_EFFECT_SLIDE4_LT_LB_LT_RB | Slide4 left-top left-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_LT_LB_LB_LT | Slide4 left-top left-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_LT_LB_LB_LB | Slide4 left-top left-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_LB_LB_RT | Slide4 left-top left-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_LT_LB_LB_RB | Slide4 left-top left-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_LB_RT_LT | Slide4 left-top left-bottom right-top left-top
EFX_EFFECT_SLIDE4_LT_LB_RT_LB | Slide4 left-top left-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_LT_LB_RT_RT | Slide4 left-top left-bottom right-top right-top
EFX_EFFECT_SLIDE4_LT_LB_RT_RB | Slide4 left-top left-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_LT_LB_RB_LT | Slide4 left-top left-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_LT_LB_RB_LB | Slide4 left-top left-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_LB_RB_RT | Slide4 left-top left-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_LT_LB_RB_RB | Slide4 left-top left-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_RT_LT_LT | Slide4 left-top right-top left-top left-top
EFX_EFFECT_SLIDE4_LT_RT_LT_LB | Slide4 left-top right-top left-top left-bottom
EFX_EFFECT_SLIDE4_LT_RT_LT_RT | Slide4 left-top right-top left-top right-top
EFX_EFFECT_SLIDE4_LT_RT_LT_RB | Slide4 left-top right-top left-top right-bottom
EFX_EFFECT_SLIDE4_LT_RT_LB_LT | Slide4 left-top right-top left-bottom left-top
EFX_EFFECT_SLIDE4_LT_RT_LB_LB | Slide4 left-top right-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_RT_LB_RT | Slide4 left-top right-top left-bottom right-top
EFX_EFFECT_SLIDE4_LT_RT_LB_RB | Slide4 left-top right-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_RT_RT_LT | Slide4 left-top right-top right-top left-top
EFX_EFFECT_SLIDE4_LT_RT_RT_LB | Slide4 left-top right-top right-top left-bottom
EFX_EFFECT_SLIDE4_LT_RT_RT_RT | Slide4 left-top right-top right-top right-top
EFX_EFFECT_SLIDE4_LT_RT_RT_RB | Slide4 left-top right-top right-top right-bottom
EFX_EFFECT_SLIDE4_LT_RT_RB_LT | Slide4 left-top right-top right-bottom left-top
EFX_EFFECT_SLIDE4_LT_RT_RB_LB | Slide4 left-top right-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_RT_RB_RT | Slide4 left-top right-top right-bottom right-top
EFX_EFFECT_SLIDE4_LT_RT_RB_RB | Slide4 left-top right-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_RB_LT_LT | Slide4 left-top right-bottom left-top left-top
EFX_EFFECT_SLIDE4_LT_RB_LT_LB | Slide4 left-top right-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_LT_RB_LT_RT | Slide4 left-top right-bottom left-top right-top
EFX_EFFECT_SLIDE4_LT_RB_LT_RB | Slide4 left-top right-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_LT_RB_LB_LT | Slide4 left-top right-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_LT_RB_LB_LB | Slide4 left-top right-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_RB_LB_RT | Slide4 left-top right-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_LT_RB_LB_RB | Slide4 left-top right-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_LT_RB_RT_LT | Slide4 left-top right-bottom right-top left-top
EFX_EFFECT_SLIDE4_LT_RB_RT_LB | Slide4 left-top right-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_LT_RB_RT_RT | Slide4 left-top right-bottom right-top right-top
EFX_EFFECT_SLIDE4_LT_RB_RT_RB | Slide4 left-top right-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_LT_RB_RB_LT | Slide4 left-top right-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_LT_RB_RB_LB | Slide4 left-top right-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_LT_RB_RB_RT | Slide4 left-top right-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_LT_RB_RB_RB | Slide4 left-top right-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_LT_LT_LT | Slide4 left-bottom left-top left-top left-top
EFX_EFFECT_SLIDE4_LB_LT_LT_LB | Slide4 left-bottom left-top left-top left-bottom
EFX_EFFECT_SLIDE4_LB_LT_LT_RT | Slide4 left-bottom left-top left-top right-top
EFX_EFFECT_SLIDE4_LB_LT_LT_RB | Slide4 left-bottom left-top left-top right-bottom
EFX_EFFECT_SLIDE4_LB_LT_LB_LT | Slide4 left-bottom left-top left-bottom left-top
EFX_EFFECT_SLIDE4_LB_LT_LB_LB | Slide4 left-bottom left-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_LT_LB_RT | Slide4 left-bottom left-top left-bottom right-top
EFX_EFFECT_SLIDE4_LB_LT_LB_RB | Slide4 left-bottom left-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_LT_RT_LT | Slide4 left-bottom left-top right-top left-top
EFX_EFFECT_SLIDE4_LB_LT_RT_LB | Slide4 left-bottom left-top right-top left-bottom
EFX_EFFECT_SLIDE4_LB_LT_RT_RT | Slide4 left-bottom left-top right-top right-top
EFX_EFFECT_SLIDE4_LB_LT_RT_RB | Slide4 left-bottom left-top right-top right-bottom
EFX_EFFECT_SLIDE4_LB_LT_RB_LT | Slide4 left-bottom left-top right-bottom left-top
EFX_EFFECT_SLIDE4_LB_LT_RB_LB | Slide4 left-bottom left-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_LT_RB_RT | Slide4 left-bottom left-top right-bottom right-top
EFX_EFFECT_SLIDE4_LB_LT_RB_RB | Slide4 left-bottom left-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_LB_LT_LT | Slide4 left-bottom left-bottom left-top left-top
EFX_EFFECT_SLIDE4_LB_LB_LT_LB | Slide4 left-bottom left-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_LB_LB_LT_RT | Slide4 left-bottom left-bottom left-top right-top
EFX_EFFECT_SLIDE4_LB_LB_LT_RB | Slide4 left-bottom left-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_LB_LB_LB_LT | Slide4 left-bottom left-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_LB_LB_LB_LB | Slide4 left-bottom left-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_LB_LB_RT | Slide4 left-bottom left-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_LB_LB_LB_RB | Slide4 left-bottom left-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_LB_RT_LT | Slide4 left-bottom left-bottom right-top left-top
EFX_EFFECT_SLIDE4_LB_LB_RT_LB | Slide4 left-bottom left-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_LB_LB_RT_RT | Slide4 left-bottom left-bottom right-top right-top
EFX_EFFECT_SLIDE4_LB_LB_RT_RB | Slide4 left-bottom left-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_LB_LB_RB_LT | Slide4 left-bottom left-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_LB_LB_RB_LB | Slide4 left-bottom left-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_LB_RB_RT | Slide4 left-bottom left-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_LB_LB_RB_RB | Slide4 left-bottom left-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_RT_LT_LT | Slide4 left-bottom right-top left-top left-top
EFX_EFFECT_SLIDE4_LB_RT_LT_LB | Slide4 left-bottom right-top left-top left-bottom
EFX_EFFECT_SLIDE4_LB_RT_LT_RT | Slide4 left-bottom right-top left-top right-top
EFX_EFFECT_SLIDE4_LB_RT_LT_RB | Slide4 left-bottom right-top left-top right-bottom
EFX_EFFECT_SLIDE4_LB_RT_LB_LT | Slide4 left-bottom right-top left-bottom left-top
EFX_EFFECT_SLIDE4_LB_RT_LB_LB | Slide4 left-bottom right-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_RT_LB_RT | Slide4 left-bottom right-top left-bottom right-top
EFX_EFFECT_SLIDE4_LB_RT_LB_RB | Slide4 left-bottom right-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_RT_RT_LT | Slide4 left-bottom right-top right-top left-top
EFX_EFFECT_SLIDE4_LB_RT_RT_LB | Slide4 left-bottom right-top right-top left-bottom
EFX_EFFECT_SLIDE4_LB_RT_RT_RT | Slide4 left-bottom right-top right-top right-top
EFX_EFFECT_SLIDE4_LB_RT_RT_RB | Slide4 left-bottom right-top right-top right-bottom
EFX_EFFECT_SLIDE4_LB_RT_RB_LT | Slide4 left-bottom right-top right-bottom left-top
EFX_EFFECT_SLIDE4_LB_RT_RB_LB | Slide4 left-bottom right-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_RT_RB_RT | Slide4 left-bottom right-top right-bottom right-top
EFX_EFFECT_SLIDE4_LB_RT_RB_RB | Slide4 left-bottom right-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_RB_LT_LT | Slide4 left-bottom right-bottom left-top left-top
EFX_EFFECT_SLIDE4_LB_RB_LT_LB | Slide4 left-bottom right-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_LB_RB_LT_RT | Slide4 left-bottom right-bottom left-top right-top
EFX_EFFECT_SLIDE4_LB_RB_LT_RB | Slide4 left-bottom right-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_LB_RB_LB_LT | Slide4 left-bottom right-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_LB_RB_LB_LB | Slide4 left-bottom right-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_RB_LB_RT | Slide4 left-bottom right-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_LB_RB_LB_RB | Slide4 left-bottom right-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_LB_RB_RT_LT | Slide4 left-bottom right-bottom right-top left-top
EFX_EFFECT_SLIDE4_LB_RB_RT_LB | Slide4 left-bottom right-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_LB_RB_RT_RT | Slide4 left-bottom right-bottom right-top right-top
EFX_EFFECT_SLIDE4_LB_RB_RT_RB | Slide4 left-bottom right-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_LB_RB_RB_LT | Slide4 left-bottom right-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_LB_RB_RB_LB | Slide4 left-bottom right-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_LB_RB_RB_RT | Slide4 left-bottom right-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_LB_RB_RB_RB | Slide4 left-bottom right-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_LT_LT_LT | Slide4 right-top left-top left-top left-top
EFX_EFFECT_SLIDE4_RT_LT_LT_LB | Slide4 right-top left-top left-top left-bottom
EFX_EFFECT_SLIDE4_RT_LT_LT_RT | Slide4 right-top left-top left-top right-top
EFX_EFFECT_SLIDE4_RT_LT_LT_RB | Slide4 right-top left-top left-top right-bottom
EFX_EFFECT_SLIDE4_RT_LT_LB_LT | Slide4 right-top left-top left-bottom left-top
EFX_EFFECT_SLIDE4_RT_LT_LB_LB | Slide4 right-top left-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_LT_LB_RT | Slide4 right-top left-top left-bottom right-top
EFX_EFFECT_SLIDE4_RT_LT_LB_RB | Slide4 right-top left-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_LT_RT_LT | Slide4 right-top left-top right-top left-top
EFX_EFFECT_SLIDE4_RT_LT_RT_LB | Slide4 right-top left-top right-top left-bottom
EFX_EFFECT_SLIDE4_RT_LT_RT_RT | Slide4 right-top left-top right-top right-top
EFX_EFFECT_SLIDE4_RT_LT_RT_RB | Slide4 right-top left-top right-top right-bottom
EFX_EFFECT_SLIDE4_RT_LT_RB_LT | Slide4 right-top left-top right-bottom left-top
EFX_EFFECT_SLIDE4_RT_LT_RB_LB | Slide4 right-top left-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_LT_RB_RT | Slide4 right-top left-top right-bottom right-top
EFX_EFFECT_SLIDE4_RT_LT_RB_RB | Slide4 right-top left-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_LB_LT_LT | Slide4 right-top left-bottom left-top left-top
EFX_EFFECT_SLIDE4_RT_LB_LT_LB | Slide4 right-top left-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_RT_LB_LT_RT | Slide4 right-top left-bottom left-top right-top
EFX_EFFECT_SLIDE4_RT_LB_LT_RB | Slide4 right-top left-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_RT_LB_LB_LT | Slide4 right-top left-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_RT_LB_LB_LB | Slide4 right-top left-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_LB_LB_RT | Slide4 right-top left-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_RT_LB_LB_RB | Slide4 right-top left-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_LB_RT_LT | Slide4 right-top left-bottom right-top left-top
EFX_EFFECT_SLIDE4_RT_LB_RT_LB | Slide4 right-top left-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_RT_LB_RT_RT | Slide4 right-top left-bottom right-top right-top
EFX_EFFECT_SLIDE4_RT_LB_RT_RB | Slide4 right-top left-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_RT_LB_RB_LT | Slide4 right-top left-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_RT_LB_RB_LB | Slide4 right-top left-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_LB_RB_RT | Slide4 right-top left-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_RT_LB_RB_RB | Slide4 right-top left-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_RT_LT_LT | Slide4 right-top right-top left-top left-top
EFX_EFFECT_SLIDE4_RT_RT_LT_LB | Slide4 right-top right-top left-top left-bottom
EFX_EFFECT_SLIDE4_RT_RT_LT_RT | Slide4 right-top right-top left-top right-top
EFX_EFFECT_SLIDE4_RT_RT_LT_RB | Slide4 right-top right-top left-top right-bottom
EFX_EFFECT_SLIDE4_RT_RT_LB_LT | Slide4 right-top right-top left-bottom left-top
EFX_EFFECT_SLIDE4_RT_RT_LB_LB | Slide4 right-top right-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_RT_LB_RT | Slide4 right-top right-top left-bottom right-top
EFX_EFFECT_SLIDE4_RT_RT_LB_RB | Slide4 right-top right-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_RT_RT_LT | Slide4 right-top right-top right-top left-top
EFX_EFFECT_SLIDE4_RT_RT_RT_LB | Slide4 right-top right-top right-top left-bottom
EFX_EFFECT_SLIDE4_RT_RT_RT_RT | Slide4 right-top right-top right-top right-top
EFX_EFFECT_SLIDE4_RT_RT_RT_RB | Slide4 right-top right-top right-top right-bottom
EFX_EFFECT_SLIDE4_RT_RT_RB_LT | Slide4 right-top right-top right-bottom left-top
EFX_EFFECT_SLIDE4_RT_RT_RB_LB | Slide4 right-top right-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_RT_RB_RT | Slide4 right-top right-top right-bottom right-top
EFX_EFFECT_SLIDE4_RT_RT_RB_RB | Slide4 right-top right-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_RB_LT_LT | Slide4 right-top right-bottom left-top left-top
EFX_EFFECT_SLIDE4_RT_RB_LT_LB | Slide4 right-top right-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_RT_RB_LT_RT | Slide4 right-top right-bottom left-top right-top
EFX_EFFECT_SLIDE4_RT_RB_LT_RB | Slide4 right-top right-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_RT_RB_LB_LT | Slide4 right-top right-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_RT_RB_LB_LB | Slide4 right-top right-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_RB_LB_RT | Slide4 right-top right-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_RT_RB_LB_RB | Slide4 right-top right-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_RT_RB_RT_LT | Slide4 right-top right-bottom right-top left-top
EFX_EFFECT_SLIDE4_RT_RB_RT_LB | Slide4 right-top right-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_RT_RB_RT_RT | Slide4 right-top right-bottom right-top right-top
EFX_EFFECT_SLIDE4_RT_RB_RT_RB | Slide4 right-top right-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_RT_RB_RB_LT | Slide4 right-top right-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_RT_RB_RB_LB | Slide4 right-top right-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_RT_RB_RB_RT | Slide4 right-top right-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_RT_RB_RB_RB | Slide4 right-top right-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_LT_LT_LT | Slide4 right-bottom left-top left-top left-top
EFX_EFFECT_SLIDE4_RB_LT_LT_LB | Slide4 right-bottom left-top left-top left-bottom
EFX_EFFECT_SLIDE4_RB_LT_LT_RT | Slide4 right-bottom left-top left-top right-top
EFX_EFFECT_SLIDE4_RB_LT_LT_RB | Slide4 right-bottom left-top left-top right-bottom
EFX_EFFECT_SLIDE4_RB_LT_LB_LT | Slide4 right-bottom left-top left-bottom left-top
EFX_EFFECT_SLIDE4_RB_LT_LB_LB | Slide4 right-bottom left-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_LT_LB_RT | Slide4 right-bottom left-top left-bottom right-top
EFX_EFFECT_SLIDE4_RB_LT_LB_RB | Slide4 right-bottom left-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_LT_RT_LT | Slide4 right-bottom left-top right-top left-top
EFX_EFFECT_SLIDE4_RB_LT_RT_LB | Slide4 right-bottom left-top right-top left-bottom
EFX_EFFECT_SLIDE4_RB_LT_RT_RT | Slide4 right-bottom left-top right-top right-top
EFX_EFFECT_SLIDE4_RB_LT_RT_RB | Slide4 right-bottom left-top right-top right-bottom
EFX_EFFECT_SLIDE4_RB_LT_RB_LT | Slide4 right-bottom left-top right-bottom left-top
EFX_EFFECT_SLIDE4_RB_LT_RB_LB | Slide4 right-bottom left-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_LT_RB_RT | Slide4 right-bottom left-top right-bottom right-top
EFX_EFFECT_SLIDE4_RB_LT_RB_RB | Slide4 right-bottom left-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_LB_LT_LT | Slide4 right-bottom left-bottom left-top left-top
EFX_EFFECT_SLIDE4_RB_LB_LT_LB | Slide4 right-bottom left-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_RB_LB_LT_RT | Slide4 right-bottom left-bottom left-top right-top
EFX_EFFECT_SLIDE4_RB_LB_LT_RB | Slide4 right-bottom left-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_RB_LB_LB_LT | Slide4 right-bottom left-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_RB_LB_LB_LB | Slide4 right-bottom left-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_LB_LB_RT | Slide4 right-bottom left-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_RB_LB_LB_RB | Slide4 right-bottom left-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_LB_RT_LT | Slide4 right-bottom left-bottom right-top left-top
EFX_EFFECT_SLIDE4_RB_LB_RT_LB | Slide4 right-bottom left-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_RB_LB_RT_RT | Slide4 right-bottom left-bottom right-top right-top
EFX_EFFECT_SLIDE4_RB_LB_RT_RB | Slide4 right-bottom left-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_RB_LB_RB_LT | Slide4 right-bottom left-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_RB_LB_RB_LB | Slide4 right-bottom left-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_LB_RB_RT | Slide4 right-bottom left-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_RB_LB_RB_RB | Slide4 right-bottom left-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_RT_LT_LT | Slide4 right-bottom right-top left-top left-top
EFX_EFFECT_SLIDE4_RB_RT_LT_LB | Slide4 right-bottom right-top left-top left-bottom
EFX_EFFECT_SLIDE4_RB_RT_LT_RT | Slide4 right-bottom right-top left-top right-top
EFX_EFFECT_SLIDE4_RB_RT_LT_RB | Slide4 right-bottom right-top left-top right-bottom
EFX_EFFECT_SLIDE4_RB_RT_LB_LT | Slide4 right-bottom right-top left-bottom left-top
EFX_EFFECT_SLIDE4_RB_RT_LB_LB | Slide4 right-bottom right-top left-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_RT_LB_RT | Slide4 right-bottom right-top left-bottom right-top
EFX_EFFECT_SLIDE4_RB_RT_LB_RB | Slide4 right-bottom right-top left-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_RT_RT_LT | Slide4 right-bottom right-top right-top left-top
EFX_EFFECT_SLIDE4_RB_RT_RT_LB | Slide4 right-bottom right-top right-top left-bottom
EFX_EFFECT_SLIDE4_RB_RT_RT_RT | Slide4 right-bottom right-top right-top right-top
EFX_EFFECT_SLIDE4_RB_RT_RT_RB | Slide4 right-bottom right-top right-top right-bottom
EFX_EFFECT_SLIDE4_RB_RT_RB_LT | Slide4 right-bottom right-top right-bottom left-top
EFX_EFFECT_SLIDE4_RB_RT_RB_LB | Slide4 right-bottom right-top right-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_RT_RB_RT | Slide4 right-bottom right-top right-bottom right-top
EFX_EFFECT_SLIDE4_RB_RT_RB_RB | Slide4 right-bottom right-top right-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_RB_LT_LT | Slide4 right-bottom right-bottom left-top left-top
EFX_EFFECT_SLIDE4_RB_RB_LT_LB | Slide4 right-bottom right-bottom left-top left-bottom
EFX_EFFECT_SLIDE4_RB_RB_LT_RT | Slide4 right-bottom right-bottom left-top right-top
EFX_EFFECT_SLIDE4_RB_RB_LT_RB | Slide4 right-bottom right-bottom left-top right-bottom
EFX_EFFECT_SLIDE4_RB_RB_LB_LT | Slide4 right-bottom right-bottom left-bottom left-top
EFX_EFFECT_SLIDE4_RB_RB_LB_LB | Slide4 right-bottom right-bottom left-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_RB_LB_RT | Slide4 right-bottom right-bottom left-bottom right-top
EFX_EFFECT_SLIDE4_RB_RB_LB_RB | Slide4 right-bottom right-bottom left-bottom right-bottom
EFX_EFFECT_SLIDE4_RB_RB_RT_LT | Slide4 right-bottom right-bottom right-top left-top
EFX_EFFECT_SLIDE4_RB_RB_RT_LB | Slide4 right-bottom right-bottom right-top left-bottom
EFX_EFFECT_SLIDE4_RB_RB_RT_RT | Slide4 right-bottom right-bottom right-top right-top
EFX_EFFECT_SLIDE4_RB_RB_RT_RB | Slide4 right-bottom right-bottom right-top right-bottom
EFX_EFFECT_SLIDE4_RB_RB_RB_LT | Slide4 right-bottom right-bottom right-bottom left-top
EFX_EFFECT_SLIDE4_RB_RB_RB_LB | Slide4 right-bottom right-bottom right-bottom left-bottom
EFX_EFFECT_SLIDE4_RB_RB_RB_RT | Slide4 right-bottom right-bottom right-bottom right-top
EFX_EFFECT_SLIDE4_RB_RB_RB_RB | Slide4 right-bottom right-bottom right-bottom right-bottom
EFX_EFFECT_SLIDE_MAX | Number of effects in this class.

Roll class

EFX_EFFECT_ROLL_L_TO_R | Roll left to right
EFX_EFFECT_ROLL_R_TO_L | Roll right to left
EFX_EFFECT_ROLL_T_TO_B | Roll top to bottom
EFX_EFFECT_ROLL_B_TO_T | Roll bottom to top
EFX_EFFECT_ROLL2_T_R_TO_L_AND_B_L_TO_R | Roll2 top right to left and bottom left to right
EFX_EFFECT_ROLL2_T_L_TO_R_AND_B_R_TO_L | Roll2 top left to right and bottom right to left
EFX_EFFECT_ROLL2_L_B_TO_T_AND_R_T_TO_B | Roll2 left bottom to top and right top to bottom
EFX_EFFECT_ROLL2_L_T_TO_B_AND_R_B_TO_T | Roll2 left top to bottom and right bottom to top
EFX_EFFECT_ROLL4_L_L_L_L | Roll4 left left left left
EFX_EFFECT_ROLL4_L_L_L_R | Roll4 left left left right
EFX_EFFECT_ROLL4_L_L_L_T | Roll4 left left left top
EFX_EFFECT_ROLL4_L_L_L_B | Roll4 left left left bottom
EFX_EFFECT_ROLL4_L_L_R_L | Roll4 left left right left
EFX_EFFECT_ROLL4_L_L_R_R | Roll4 left left right right
EFX_EFFECT_ROLL4_L_L_R_T | Roll4 left left right top
EFX_EFFECT_ROLL4_L_L_R_B | Roll4 left left right bottom
EFX_EFFECT_ROLL4_L_L_T_L | Roll4 left left top left
EFX_EFFECT_ROLL4_L_L_T_R | Roll4 left left top right
EFX_EFFECT_ROLL4_L_L_T_T | Roll4 left left top top
EFX_EFFECT_ROLL4_L_L_T_B | Roll4 left left top bottom
EFX_EFFECT_ROLL4_L_L_B_L | Roll4 left left bottom left
EFX_EFFECT_ROLL4_L_L_B_R | Roll4 left left bottom right
EFX_EFFECT_ROLL4_L_L_B_T | Roll4 left left bottom top
EFX_EFFECT_ROLL4_L_L_B_B | Roll4 left left bottom bottom
EFX_EFFECT_ROLL4_L_R_L_L | Roll4 left right left left
EFX_EFFECT_ROLL4_L_R_L_R | Roll4 left right left right
EFX_EFFECT_ROLL4_L_R_L_T | Roll4 left right left top
EFX_EFFECT_ROLL4_L_R_L_B | Roll4 left right left bottom
EFX_EFFECT_ROLL4_L_R_R_L | Roll4 left right right left
EFX_EFFECT_ROLL4_L_R_R_R | Roll4 left right right right
EFX_EFFECT_ROLL4_L_R_R_T | Roll4 left right right top
EFX_EFFECT_ROLL4_L_R_R_B | Roll4 left right right bottom
EFX_EFFECT_ROLL4_L_R_T_L | Roll4 left right top left
EFX_EFFECT_ROLL4_L_R_T_R | Roll4 left right top right
EFX_EFFECT_ROLL4_L_R_T_T | Roll4 left right top top
EFX_EFFECT_ROLL4_L_R_T_B | Roll4 left right top bottom
EFX_EFFECT_ROLL4_L_R_B_L | Roll4 left right bottom left
EFX_EFFECT_ROLL4_L_R_B_R | Roll4 left right bottom right
EFX_EFFECT_ROLL4_L_R_B_T | Roll4 left right bottom top
EFX_EFFECT_ROLL4_L_R_B_B | Roll4 left right bottom bottom
EFX_EFFECT_ROLL4_L_T_L_L | Roll4 left top left left
EFX_EFFECT_ROLL4_L_T_L_R | Roll4 left top left right
EFX_EFFECT_ROLL4_L_T_L_T | Roll4 left top left top
EFX_EFFECT_ROLL4_L_T_L_B | Roll4 left top left bottom
EFX_EFFECT_ROLL4_L_T_R_L | Roll4 left top right left
EFX_EFFECT_ROLL4_L_T_R_R | Roll4 left top right right
EFX_EFFECT_ROLL4_L_T_R_T | Roll4 left top right top
EFX_EFFECT_ROLL4_L_T_R_B | Roll4 left top right bottom
EFX_EFFECT_ROLL4_L_T_T_L | Roll4 left top top left
EFX_EFFECT_ROLL4_L_T_T_R | Roll4 left top top right
EFX_EFFECT_ROLL4_L_T_T_T | Roll4 left top top top
EFX_EFFECT_ROLL4_L_T_T_B | Roll4 left top top bottom
EFX_EFFECT_ROLL4_L_T_B_L | Roll4 left top bottom left
EFX_EFFECT_ROLL4_L_T_B_R | Roll4 left top bottom right
EFX_EFFECT_ROLL4_L_T_B_T | Roll4 left top bottom top
EFX_EFFECT_ROLL4_L_T_B_B | Roll4 left top bottom bottom
EFX_EFFECT_ROLL4_L_B_L_L | Roll4 left bottom left left
EFX_EFFECT_ROLL4_L_B_L_R | Roll4 left bottom left right
EFX_EFFECT_ROLL4_L_B_L_T | Roll4 left bottom left top
EFX_EFFECT_ROLL4_L_B_L_B | Roll4 left bottom left bottom
EFX_EFFECT_ROLL4_L_B_R_L | Roll4 left bottom right left
EFX_EFFECT_ROLL4_L_B_R_R | Roll4 left bottom right right
EFX_EFFECT_ROLL4_L_B_R_T | Roll4 left bottom right top
EFX_EFFECT_ROLL4_L_B_R_B | Roll4 left bottom right bottom
EFX_EFFECT_ROLL4_L_B_T_L | Roll4 left bottom top left
EFX_EFFECT_ROLL4_L_B_T_R | Roll4 left bottom top right
EFX_EFFECT_ROLL4_L_B_T_T | Roll4 left bottom top top
EFX_EFFECT_ROLL4_L_B_T_B | Roll4 left bottom top bottom
EFX_EFFECT_ROLL4_L_B_B_L | Roll4 left bottom bottom left
EFX_EFFECT_ROLL4_L_B_B_R | Roll4 left bottom bottom right
EFX_EFFECT_ROLL4_L_B_B_T | Roll4 left bottom bottom top
EFX_EFFECT_ROLL4_L_B_B_B | Roll4 left bottom bottom bottom
EFX_EFFECT_ROLL4_R_L_L_L | Roll4 right left left left
EFX_EFFECT_ROLL4_R_L_L_R | Roll4 right left left right
EFX_EFFECT_ROLL4_R_L_L_T | Roll4 right left left top
EFX_EFFECT_ROLL4_R_L_L_B | Roll4 right left left bottom
EFX_EFFECT_ROLL4_R_L_R_L | Roll4 right left right left
EFX_EFFECT_ROLL4_R_L_R_R | Roll4 right left right right
EFX_EFFECT_ROLL4_R_L_R_T | Roll4 right left right top
EFX_EFFECT_ROLL4_R_L_R_B | Roll4 right left right bottom
EFX_EFFECT_ROLL4_R_L_T_L | Roll4 right left top left
EFX_EFFECT_ROLL4_R_L_T_R | Roll4 right left top right
EFX_EFFECT_ROLL4_R_L_T_T | Roll4 right left top top
EFX_EFFECT_ROLL4_R_L_T_B | Roll4 right left top bottom
EFX_EFFECT_ROLL4_R_L_B_L | Roll4 right left bottom left
EFX_EFFECT_ROLL4_R_L_B_R | Roll4 right left bottom right
EFX_EFFECT_ROLL4_R_L_B_T | Roll4 right left bottom top
EFX_EFFECT_ROLL4_R_L_B_B | Roll4 right left bottom bottom
EFX_EFFECT_ROLL4_R_R_L_L | Roll4 right right left left
EFX_EFFECT_ROLL4_R_R_L_R | Roll4 right right left right
EFX_EFFECT_ROLL4_R_R_L_T | Roll4 right right left top
EFX_EFFECT_ROLL4_R_R_L_B | Roll4 right right left bottom
EFX_EFFECT_ROLL4_R_R_R_L | Roll4 right right right left
EFX_EFFECT_ROLL4_R_R_R_R | Roll4 right right right right
EFX_EFFECT_ROLL4_R_R_R_T | Roll4 right right right top
EFX_EFFECT_ROLL4_R_R_R_B | Roll4 right right right bottom
EFX_EFFECT_ROLL4_R_R_T_L | Roll4 right right top left
EFX_EFFECT_ROLL4_R_R_T_R | Roll4 right right top right
EFX_EFFECT_ROLL4_R_R_T_T | Roll4 right right top top
EFX_EFFECT_ROLL4_R_R_T_B | Roll4 right right top bottom
EFX_EFFECT_ROLL4_R_R_B_L | Roll4 right right bottom left
EFX_EFFECT_ROLL4_R_R_B_R | Roll4 right right bottom right
EFX_EFFECT_ROLL4_R_R_B_T | Roll4 right right bottom top
EFX_EFFECT_ROLL4_R_R_B_B | Roll4 right right bottom bottom
EFX_EFFECT_ROLL4_R_T_L_L | Roll4 right top left left
EFX_EFFECT_ROLL4_R_T_L_R | Roll4 right top left right
EFX_EFFECT_ROLL4_R_T_L_T | Roll4 right top left top
EFX_EFFECT_ROLL4_R_T_L_B | Roll4 right top left bottom
EFX_EFFECT_ROLL4_R_T_R_L | Roll4 right top right left
EFX_EFFECT_ROLL4_R_T_R_R | Roll4 right top right right
EFX_EFFECT_ROLL4_R_T_R_T | Roll4 right top right top
EFX_EFFECT_ROLL4_R_T_R_B | Roll4 right top right bottom
EFX_EFFECT_ROLL4_R_T_T_L | Roll4 right top top left
EFX_EFFECT_ROLL4_R_T_T_R | Roll4 right top top right
EFX_EFFECT_ROLL4_R_T_T_T | Roll4 right top top top
EFX_EFFECT_ROLL4_R_T_T_B | Roll4 right top top bottom
EFX_EFFECT_ROLL4_R_T_B_L | Roll4 right top bottom left
EFX_EFFECT_ROLL4_R_T_B_R | Roll4 right top bottom right
EFX_EFFECT_ROLL4_R_T_B_T | Roll4 right top bottom top
EFX_EFFECT_ROLL4_R_T_B_B | Roll4 right top bottom bottom
EFX_EFFECT_ROLL4_R_B_L_L | Roll4 right bottom left left
EFX_EFFECT_ROLL4_R_B_L_R | Roll4 right bottom left right
EFX_EFFECT_ROLL4_R_B_L_T | Roll4 right bottom left top
EFX_EFFECT_ROLL4_R_B_L_B | Roll4 right bottom left bottom
EFX_EFFECT_ROLL4_R_B_R_L | Roll4 right bottom right left
EFX_EFFECT_ROLL4_R_B_R_R | Roll4 right bottom right right
EFX_EFFECT_ROLL4_R_B_R_T | Roll4 right bottom right top
EFX_EFFECT_ROLL4_R_B_R_B | Roll4 right bottom right bottom
EFX_EFFECT_ROLL4_R_B_T_L | Roll4 right bottom top left
EFX_EFFECT_ROLL4_R_B_T_R | Roll4 right bottom top right
EFX_EFFECT_ROLL4_R_B_T_T | Roll4 right bottom top top
EFX_EFFECT_ROLL4_R_B_T_B | Roll4 right bottom top bottom
EFX_EFFECT_ROLL4_R_B_B_L | Roll4 right bottom bottom left
EFX_EFFECT_ROLL4_R_B_B_R | Roll4 right bottom bottom right
EFX_EFFECT_ROLL4_R_B_B_T | Roll4 right bottom bottom top
EFX_EFFECT_ROLL4_R_B_B_B | Roll4 right bottom bottom bottom
EFX_EFFECT_ROLL4_T_L_L_L | Roll4 top left left left
EFX_EFFECT_ROLL4_T_L_L_R | Roll4 top left left right
EFX_EFFECT_ROLL4_T_L_L_T | Roll4 top left left top
EFX_EFFECT_ROLL4_T_L_L_B | Roll4 top left left bottom
EFX_EFFECT_ROLL4_T_L_R_L | Roll4 top left right left
EFX_EFFECT_ROLL4_T_L_R_R | Roll4 top left right right
EFX_EFFECT_ROLL4_T_L_R_T | Roll4 top left right top
EFX_EFFECT_ROLL4_T_L_R_B | Roll4 top left right bottom
EFX_EFFECT_ROLL4_T_L_T_L | Roll4 top left top left
EFX_EFFECT_ROLL4_T_L_T_R | Roll4 top left top right
EFX_EFFECT_ROLL4_T_L_T_T | Roll4 top left top top
EFX_EFFECT_ROLL4_T_L_T_B | Roll4 top left top bottom
EFX_EFFECT_ROLL4_T_L_B_L | Roll4 top left bottom left
EFX_EFFECT_ROLL4_T_L_B_R | Roll4 top left bottom right
EFX_EFFECT_ROLL4_T_L_B_T | Roll4 top left bottom top
EFX_EFFECT_ROLL4_T_L_B_B | Roll4 top left bottom bottom
EFX_EFFECT_ROLL4_T_R_L_L | Roll4 top right left left
EFX_EFFECT_ROLL4_T_R_L_R | Roll4 top right left right
EFX_EFFECT_ROLL4_T_R_L_T | Roll4 top right left top
EFX_EFFECT_ROLL4_T_R_L_B | Roll4 top right left bottom
EFX_EFFECT_ROLL4_T_R_R_L | Roll4 top right right left
EFX_EFFECT_ROLL4_T_R_R_R | Roll4 top right right right
EFX_EFFECT_ROLL4_T_R_R_T | Roll4 top right right top
EFX_EFFECT_ROLL4_T_R_R_B | Roll4 top right right bottom
EFX_EFFECT_ROLL4_T_R_T_L | Roll4 top right top left
EFX_EFFECT_ROLL4_T_R_T_R | Roll4 top right top right
EFX_EFFECT_ROLL4_T_R_T_T | Roll4 top right top top
EFX_EFFECT_ROLL4_T_R_T_B | Roll4 top right top bottom
EFX_EFFECT_ROLL4_T_R_B_L | Roll4 top right bottom left
EFX_EFFECT_ROLL4_T_R_B_R | Roll4 top right bottom right
EFX_EFFECT_ROLL4_T_R_B_T | Roll4 top right bottom top
EFX_EFFECT_ROLL4_T_R_B_B | Roll4 top right bottom bottom
EFX_EFFECT_ROLL4_T_T_L_L | Roll4 top top left left
EFX_EFFECT_ROLL4_T_T_L_R | Roll4 top top left right
EFX_EFFECT_ROLL4_T_T_L_T | Roll4 top top left top
EFX_EFFECT_ROLL4_T_T_L_B | Roll4 top top left bottom
EFX_EFFECT_ROLL4_T_T_R_L | Roll4 top top right left
EFX_EFFECT_ROLL4_T_T_R_R | Roll4 top top right right
EFX_EFFECT_ROLL4_T_T_R_T | Roll4 top top right top
EFX_EFFECT_ROLL4_T_T_R_B | Roll4 top top right bottom
EFX_EFFECT_ROLL4_T_T_T_L | Roll4 top top top left
EFX_EFFECT_ROLL4_T_T_T_R | Roll4 top top top right
EFX_EFFECT_ROLL4_T_T_T_T | Roll4 top top top top
EFX_EFFECT_ROLL4_T_T_T_B | Roll4 top top top bottom
EFX_EFFECT_ROLL4_T_T_B_L | Roll4 top top bottom left
EFX_EFFECT_ROLL4_T_T_B_R | Roll4 top top bottom right
EFX_EFFECT_ROLL4_T_T_B_T | Roll4 top top bottom top
EFX_EFFECT_ROLL4_T_T_B_B | Roll4 top top bottom bottom
EFX_EFFECT_ROLL4_T_B_L_L | Roll4 top bottom left left
EFX_EFFECT_ROLL4_T_B_L_R | Roll4 top bottom left right
EFX_EFFECT_ROLL4_T_B_L_T | Roll4 top bottom left top
EFX_EFFECT_ROLL4_T_B_L_B | Roll4 top bottom left bottom
EFX_EFFECT_ROLL4_T_B_R_L | Roll4 top bottom right left
EFX_EFFECT_ROLL4_T_B_R_R | Roll4 top bottom right right
EFX_EFFECT_ROLL4_T_B_R_T | Roll4 top bottom right top
EFX_EFFECT_ROLL4_T_B_R_B | Roll4 top bottom right bottom
EFX_EFFECT_ROLL4_T_B_T_L | Roll4 top bottom top left
EFX_EFFECT_ROLL4_T_B_T_R | Roll4 top bottom top right
EFX_EFFECT_ROLL4_T_B_T_T | Roll4 top bottom top top
EFX_EFFECT_ROLL4_T_B_T_B | Roll4 top bottom top bottom
EFX_EFFECT_ROLL4_T_B_B_L | Roll4 top bottom bottom left
EFX_EFFECT_ROLL4_T_B_B_R | Roll4 top bottom bottom right
EFX_EFFECT_ROLL4_T_B_B_T | Roll4 top bottom bottom top
EFX_EFFECT_ROLL4_T_B_B_B | Roll4 top bottom bottom bottom
EFX_EFFECT_ROLL4_B_L_L_L | Roll4 bottom left left left
EFX_EFFECT_ROLL4_B_L_L_R | Roll4 bottom left left right
EFX_EFFECT_ROLL4_B_L_L_T | Roll4 bottom left left top
EFX_EFFECT_ROLL4_B_L_L_B | Roll4 bottom left left bottom
EFX_EFFECT_ROLL4_B_L_R_L | Roll4 bottom left right left
EFX_EFFECT_ROLL4_B_L_R_R | Roll4 bottom left right right
EFX_EFFECT_ROLL4_B_L_R_T | Roll4 bottom left right top
EFX_EFFECT_ROLL4_B_L_R_B | Roll4 bottom left right bottom
EFX_EFFECT_ROLL4_B_L_T_L | Roll4 bottom left top left
EFX_EFFECT_ROLL4_B_L_T_R | Roll4 bottom left top right
EFX_EFFECT_ROLL4_B_L_T_T | Roll4 bottom left top top
EFX_EFFECT_ROLL4_B_L_T_B | Roll4 bottom left top bottom
EFX_EFFECT_ROLL4_B_L_B_L | Roll4 bottom left bottom left
EFX_EFFECT_ROLL4_B_L_B_R | Roll4 bottom left bottom right
EFX_EFFECT_ROLL4_B_L_B_T | Roll4 bottom left bottom top
EFX_EFFECT_ROLL4_B_L_B_B | Roll4 bottom left bottom bottom
EFX_EFFECT_ROLL4_B_R_L_L | Roll4 bottom right left left
EFX_EFFECT_ROLL4_B_R_L_R | Roll4 bottom right left right
EFX_EFFECT_ROLL4_B_R_L_T | Roll4 bottom right left top
EFX_EFFECT_ROLL4_B_R_L_B | Roll4 bottom right left bottom
EFX_EFFECT_ROLL4_B_R_R_L | Roll4 bottom right right left
EFX_EFFECT_ROLL4_B_R_R_R | Roll4 bottom right right right
EFX_EFFECT_ROLL4_B_R_R_T | Roll4 bottom right right top
EFX_EFFECT_ROLL4_B_R_R_B | Roll4 bottom right right bottom
EFX_EFFECT_ROLL4_B_R_T_L | Roll4 bottom right top left
EFX_EFFECT_ROLL4_B_R_T_R | Roll4 bottom right top right
EFX_EFFECT_ROLL4_B_R_T_T | Roll4 bottom right top top
EFX_EFFECT_ROLL4_B_R_T_B | Roll4 bottom right top bottom
EFX_EFFECT_ROLL4_B_R_B_L | Roll4 bottom right bottom left
EFX_EFFECT_ROLL4_B_R_B_R | Roll4 bottom right bottom right
EFX_EFFECT_ROLL4_B_R_B_T | Roll4 bottom right bottom top
EFX_EFFECT_ROLL4_B_R_B_B | Roll4 bottom right bottom bottom
EFX_EFFECT_ROLL4_B_T_L_L | Roll4 bottom top left left
EFX_EFFECT_ROLL4_B_T_L_R | Roll4 bottom top left right
EFX_EFFECT_ROLL4_B_T_L_T | Roll4 bottom top left top
EFX_EFFECT_ROLL4_B_T_L_B | Roll4 bottom top left bottom
EFX_EFFECT_ROLL4_B_T_R_L | Roll4 bottom top right left
EFX_EFFECT_ROLL4_B_T_R_R | Roll4 bottom top right right
EFX_EFFECT_ROLL4_B_T_R_T | Roll4 bottom top right top
EFX_EFFECT_ROLL4_B_T_R_B | Roll4 bottom top right bottom
EFX_EFFECT_ROLL4_B_T_T_L | Roll4 bottom top top left
EFX_EFFECT_ROLL4_B_T_T_R | Roll4 bottom top top right
EFX_EFFECT_ROLL4_B_T_T_T | Roll4 bottom top top top
EFX_EFFECT_ROLL4_B_T_T_B | Roll4 bottom top top bottom
EFX_EFFECT_ROLL4_B_T_B_L | Roll4 bottom top bottom left
EFX_EFFECT_ROLL4_B_T_B_R | Roll4 bottom top bottom right
EFX_EFFECT_ROLL4_B_T_B_T | Roll4 bottom top bottom top
EFX_EFFECT_ROLL4_B_T_B_B | Roll4 bottom top bottom bottom
EFX_EFFECT_ROLL4_B_B_L_L | Roll4 bottom bottom left left
EFX_EFFECT_ROLL4_B_B_L_R | Roll4 bottom bottom left right
EFX_EFFECT_ROLL4_B_B_L_T | Roll4 bottom bottom left top
EFX_EFFECT_ROLL4_B_B_L_B | Roll4 bottom bottom left bottom
EFX_EFFECT_ROLL4_B_B_R_L | Roll4 bottom bottom right left
EFX_EFFECT_ROLL4_B_B_R_R | Roll4 bottom bottom right right
EFX_EFFECT_ROLL4_B_B_R_T | Roll4 bottom bottom right top
EFX_EFFECT_ROLL4_B_B_R_B | Roll4 bottom bottom right bottom
EFX_EFFECT_ROLL4_B_B_T_L | Roll4 bottom bottom top left
EFX_EFFECT_ROLL4_B_B_T_R | Roll4 bottom bottom top right
EFX_EFFECT_ROLL4_B_B_T_T | Roll4 bottom bottom top top
EFX_EFFECT_ROLL4_B_B_T_B | Roll4 bottom bottom top bottom
EFX_EFFECT_ROLL4_B_B_B_L | Roll4 bottom bottom bottom left
EFX_EFFECT_ROLL4_B_B_B_R | Roll4 bottom bottom bottom right
EFX_EFFECT_ROLL4_B_B_B_T | Roll4 bottom bottom bottom top
EFX_EFFECT_ROLL4_B_B_B_B | Roll4 bottom bottom bottom bottom
EFX_EFFECT_ROLL_MAX | Number of effects in this class.

Rotate class

EFX_EFFECT_ROTATE_L_TO_R | Rotate left to right
EFX_EFFECT_ROTATE_R_TO_L | Rotate right to left
EFX_EFFECT_ROTATE_T_TO_B | Rotate top to bottom
EFX_EFFECT_ROTATE_B_TO_T | Rotate bottom to top
EFX_EFFECT_ROTATE4_L_L_L_L | Rotate4 left left left left
EFX_EFFECT_ROTATE4_L_L_L_R | Rotate4 left left left right
EFX_EFFECT_ROTATE4_L_L_L_T | Rotate4 left left left top
EFX_EFFECT_ROTATE4_L_L_L_B | Rotate4 left left left bottom
EFX_EFFECT_ROTATE4_L_L_R_L | Rotate4 left left right left
EFX_EFFECT_ROTATE4_L_L_R_R | Rotate4 left left right right
EFX_EFFECT_ROTATE4_L_L_R_T | Rotate4 left left right top
EFX_EFFECT_ROTATE4_L_L_R_B | Rotate4 left left right bottom
EFX_EFFECT_ROTATE4_L_L_T_L | Rotate4 left left top left
EFX_EFFECT_ROTATE4_L_L_T_R | Rotate4 left left top right
EFX_EFFECT_ROTATE4_L_L_T_T | Rotate4 left left top top
EFX_EFFECT_ROTATE4_L_L_T_B | Rotate4 left left top bottom
EFX_EFFECT_ROTATE4_L_L_B_L | Rotate4 left left bottom left
EFX_EFFECT_ROTATE4_L_L_B_R | Rotate4 left left bottom right
EFX_EFFECT_ROTATE4_L_L_B_T | Rotate4 left left bottom top
EFX_EFFECT_ROTATE4_L_L_B_B | Rotate4 left left bottom bottom
EFX_EFFECT_ROTATE4_L_R_L_L | Rotate4 left right left left
EFX_EFFECT_ROTATE4_L_R_L_R | Rotate4 left right left right
EFX_EFFECT_ROTATE4_L_R_L_T | Rotate4 left right left top
EFX_EFFECT_ROTATE4_L_R_L_B | Rotate4 left right left bottom
EFX_EFFECT_ROTATE4_L_R_R_L | Rotate4 left right right left
EFX_EFFECT_ROTATE4_L_R_R_R | Rotate4 left right right right
EFX_EFFECT_ROTATE4_L_R_R_T | Rotate4 left right right top
EFX_EFFECT_ROTATE4_L_R_R_B | Rotate4 left right right bottom
EFX_EFFECT_ROTATE4_L_R_T_L | Rotate4 left right top left
EFX_EFFECT_ROTATE4_L_R_T_R | Rotate4 left right top right
EFX_EFFECT_ROTATE4_L_R_T_T | Rotate4 left right top top
EFX_EFFECT_ROTATE4_L_R_T_B | Rotate4 left right top bottom
EFX_EFFECT_ROTATE4_L_R_B_L | Rotate4 left right bottom left
EFX_EFFECT_ROTATE4_L_R_B_R | Rotate4 left right bottom right
EFX_EFFECT_ROTATE4_L_R_B_T | Rotate4 left right bottom top
EFX_EFFECT_ROTATE4_L_R_B_B | Rotate4 left right bottom bottom
EFX_EFFECT_ROTATE4_L_T_L_L | Rotate4 left top left left
EFX_EFFECT_ROTATE4_L_T_L_R | Rotate4 left top left right
EFX_EFFECT_ROTATE4_L_T_L_T | Rotate4 left top left top
EFX_EFFECT_ROTATE4_L_T_L_B | Rotate4 left top left bottom
EFX_EFFECT_ROTATE4_L_T_R_L | Rotate4 left top right left
EFX_EFFECT_ROTATE4_L_T_R_R | Rotate4 left top right right
EFX_EFFECT_ROTATE4_L_T_R_T | Rotate4 left top right top
EFX_EFFECT_ROTATE4_L_T_R_B | Rotate4 left top right bottom
EFX_EFFECT_ROTATE4_L_T_T_L | Rotate4 left top top left
EFX_EFFECT_ROTATE4_L_T_T_R | Rotate4 left top top right
EFX_EFFECT_ROTATE4_L_T_T_T | Rotate4 left top top top
EFX_EFFECT_ROTATE4_L_T_T_B | Rotate4 left top top bottom
EFX_EFFECT_ROTATE4_L_T_B_L | Rotate4 left top bottom left
EFX_EFFECT_ROTATE4_L_T_B_R | Rotate4 left top bottom right
EFX_EFFECT_ROTATE4_L_T_B_T | Rotate4 left top bottom top
EFX_EFFECT_ROTATE4_L_T_B_B | Rotate4 left top bottom bottom
EFX_EFFECT_ROTATE4_L_B_L_L | Rotate4 left bottom left left
EFX_EFFECT_ROTATE4_L_B_L_R | Rotate4 left bottom left right
EFX_EFFECT_ROTATE4_L_B_L_T | Rotate4 left bottom left top
EFX_EFFECT_ROTATE4_L_B_L_B | Rotate4 left bottom left bottom
EFX_EFFECT_ROTATE4_L_B_R_L | Rotate4 left bottom right left
EFX_EFFECT_ROTATE4_L_B_R_R | Rotate4 left bottom right right
EFX_EFFECT_ROTATE4_L_B_R_T | Rotate4 left bottom right top
EFX_EFFECT_ROTATE4_L_B_R_B | Rotate4 left bottom right bottom
EFX_EFFECT_ROTATE4_L_B_T_L | Rotate4 left bottom top left
EFX_EFFECT_ROTATE4_L_B_T_R | Rotate4 left bottom top right
EFX_EFFECT_ROTATE4_L_B_T_T | Rotate4 left bottom top top
EFX_EFFECT_ROTATE4_L_B_T_B | Rotate4 left bottom top bottom
EFX_EFFECT_ROTATE4_L_B_B_L | Rotate4 left bottom bottom left
EFX_EFFECT_ROTATE4_L_B_B_R | Rotate4 left bottom bottom right
EFX_EFFECT_ROTATE4_L_B_B_T | Rotate4 left bottom bottom top
EFX_EFFECT_ROTATE4_L_B_B_B | Rotate4 left bottom bottom bottom
EFX_EFFECT_ROTATE4_R_L_L_L | Rotate4 right left left left
EFX_EFFECT_ROTATE4_R_L_L_R | Rotate4 right left left right
EFX_EFFECT_ROTATE4_R_L_L_T | Rotate4 right left left top
EFX_EFFECT_ROTATE4_R_L_L_B | Rotate4 right left left bottom
EFX_EFFECT_ROTATE4_R_L_R_L | Rotate4 right left right left
EFX_EFFECT_ROTATE4_R_L_R_R | Rotate4 right left right right
EFX_EFFECT_ROTATE4_R_L_R_T | Rotate4 right left right top
EFX_EFFECT_ROTATE4_R_L_R_B | Rotate4 right left right bottom
EFX_EFFECT_ROTATE4_R_L_T_L | Rotate4 right left top left
EFX_EFFECT_ROTATE4_R_L_T_R | Rotate4 right left top right
EFX_EFFECT_ROTATE4_R_L_T_T | Rotate4 right left top top
EFX_EFFECT_ROTATE4_R_L_T_B | Rotate4 right left top bottom
EFX_EFFECT_ROTATE4_R_L_B_L | Rotate4 right left bottom left
EFX_EFFECT_ROTATE4_R_L_B_R | Rotate4 right left bottom right
EFX_EFFECT_ROTATE4_R_L_B_T | Rotate4 right left bottom top
EFX_EFFECT_ROTATE4_R_L_B_B | Rotate4 right left bottom bottom
EFX_EFFECT_ROTATE4_R_R_L_L | Rotate4 right right left left
EFX_EFFECT_ROTATE4_R_R_L_R | Rotate4 right right left right
EFX_EFFECT_ROTATE4_R_R_L_T | Rotate4 right right left top
EFX_EFFECT_ROTATE4_R_R_L_B | Rotate4 right right left bottom
EFX_EFFECT_ROTATE4_R_R_R_L | Rotate4 right right right left
EFX_EFFECT_ROTATE4_R_R_R_R | Rotate4 right right right right
EFX_EFFECT_ROTATE4_R_R_R_T | Rotate4 right right right top
EFX_EFFECT_ROTATE4_R_R_R_B | Rotate4 right right right bottom
EFX_EFFECT_ROTATE4_R_R_T_L | Rotate4 right right top left
EFX_EFFECT_ROTATE4_R_R_T_R | Rotate4 right right top right
EFX_EFFECT_ROTATE4_R_R_T_T | Rotate4 right right top top
EFX_EFFECT_ROTATE4_R_R_T_B | Rotate4 right right top bottom
EFX_EFFECT_ROTATE4_R_R_B_L | Rotate4 right right bottom left
EFX_EFFECT_ROTATE4_R_R_B_R | Rotate4 right right bottom right
EFX_EFFECT_ROTATE4_R_R_B_T | Rotate4 right right bottom top
EFX_EFFECT_ROTATE4_R_R_B_B | Rotate4 right right bottom bottom
EFX_EFFECT_ROTATE4_R_T_L_L | Rotate4 right top left left
EFX_EFFECT_ROTATE4_R_T_L_R | Rotate4 right top left right
EFX_EFFECT_ROTATE4_R_T_L_T | Rotate4 right top left top
EFX_EFFECT_ROTATE4_R_T_L_B | Rotate4 right top left bottom
EFX_EFFECT_ROTATE4_R_T_R_L | Rotate4 right top right left
EFX_EFFECT_ROTATE4_R_T_R_R | Rotate4 right top right right
EFX_EFFECT_ROTATE4_R_T_R_T | Rotate4 right top right top
EFX_EFFECT_ROTATE4_R_T_R_B | Rotate4 right top right bottom
EFX_EFFECT_ROTATE4_R_T_T_L | Rotate4 right top top left
EFX_EFFECT_ROTATE4_R_T_T_R | Rotate4 right top top right
EFX_EFFECT_ROTATE4_R_T_T_T | Rotate4 right top top top
EFX_EFFECT_ROTATE4_R_T_T_B | Rotate4 right top top bottom
EFX_EFFECT_ROTATE4_R_T_B_L | Rotate4 right top bottom left
EFX_EFFECT_ROTATE4_R_T_B_R | Rotate4 right top bottom right
EFX_EFFECT_ROTATE4_R_T_B_T | Rotate4 right top bottom top
EFX_EFFECT_ROTATE4_R_T_B_B | Rotate4 right top bottom bottom
EFX_EFFECT_ROTATE4_R_B_L_L | Rotate4 right bottom left left
EFX_EFFECT_ROTATE4_R_B_L_R | Rotate4 right bottom left right
EFX_EFFECT_ROTATE4_R_B_L_T | Rotate4 right bottom left top
EFX_EFFECT_ROTATE4_R_B_L_B | Rotate4 right bottom left bottom
EFX_EFFECT_ROTATE4_R_B_R_L | Rotate4 right bottom right left
EFX_EFFECT_ROTATE4_R_B_R_R | Rotate4 right bottom right right
EFX_EFFECT_ROTATE4_R_B_R_T | Rotate4 right bottom right top
EFX_EFFECT_ROTATE4_R_B_R_B | Rotate4 right bottom right bottom
EFX_EFFECT_ROTATE4_R_B_T_L | Rotate4 right bottom top left
EFX_EFFECT_ROTATE4_R_B_T_R | Rotate4 right bottom top right
EFX_EFFECT_ROTATE4_R_B_T_T | Rotate4 right bottom top top
EFX_EFFECT_ROTATE4_R_B_T_B | Rotate4 right bottom top bottom
EFX_EFFECT_ROTATE4_R_B_B_L | Rotate4 right bottom bottom left
EFX_EFFECT_ROTATE4_R_B_B_R | Rotate4 right bottom bottom right
EFX_EFFECT_ROTATE4_R_B_B_T | Rotate4 right bottom bottom top
EFX_EFFECT_ROTATE4_R_B_B_B | Rotate4 right bottom bottom bottom
EFX_EFFECT_ROTATE4_T_L_L_L | Rotate4 top left left left
EFX_EFFECT_ROTATE4_T_L_L_R | Rotate4 top left left right
EFX_EFFECT_ROTATE4_T_L_L_T | Rotate4 top left left top
EFX_EFFECT_ROTATE4_T_L_L_B | Rotate4 top left left bottom
EFX_EFFECT_ROTATE4_T_L_R_L | Rotate4 top left right left
EFX_EFFECT_ROTATE4_T_L_R_R | Rotate4 top left right right
EFX_EFFECT_ROTATE4_T_L_R_T | Rotate4 top left right top
EFX_EFFECT_ROTATE4_T_L_R_B | Rotate4 top left right bottom
EFX_EFFECT_ROTATE4_T_L_T_L | Rotate4 top left top left
EFX_EFFECT_ROTATE4_T_L_T_R | Rotate4 top left top right
EFX_EFFECT_ROTATE4_T_L_T_T | Rotate4 top left top top
EFX_EFFECT_ROTATE4_T_L_T_B | Rotate4 top left top bottom
EFX_EFFECT_ROTATE4_T_L_B_L | Rotate4 top left bottom left
EFX_EFFECT_ROTATE4_T_L_B_R | Rotate4 top left bottom right
EFX_EFFECT_ROTATE4_T_L_B_T | Rotate4 top left bottom top
EFX_EFFECT_ROTATE4_T_L_B_B | Rotate4 top left bottom bottom
EFX_EFFECT_ROTATE4_T_R_L_L | Rotate4 top right left left
EFX_EFFECT_ROTATE4_T_R_L_R | Rotate4 top right left right
EFX_EFFECT_ROTATE4_T_R_L_T | Rotate4 top right left top
EFX_EFFECT_ROTATE4_T_R_L_B | Rotate4 top right left bottom
EFX_EFFECT_ROTATE4_T_R_R_L | Rotate4 top right right left
EFX_EFFECT_ROTATE4_T_R_R_R | Rotate4 top right right right
EFX_EFFECT_ROTATE4_T_R_R_T | Rotate4 top right right top
EFX_EFFECT_ROTATE4_T_R_R_B | Rotate4 top right right bottom
EFX_EFFECT_ROTATE4_T_R_T_L | Rotate4 top right top left
EFX_EFFECT_ROTATE4_T_R_T_R | Rotate4 top right top right
EFX_EFFECT_ROTATE4_T_R_T_T | Rotate4 top right top top
EFX_EFFECT_ROTATE4_T_R_T_B | Rotate4 top right top bottom
EFX_EFFECT_ROTATE4_T_R_B_L | Rotate4 top right bottom left
EFX_EFFECT_ROTATE4_T_R_B_R | Rotate4 top right bottom right
EFX_EFFECT_ROTATE4_T_R_B_T | Rotate4 top right bottom top
EFX_EFFECT_ROTATE4_T_R_B_B | Rotate4 top right bottom bottom
EFX_EFFECT_ROTATE4_T_T_L_L | Rotate4 top top left left
EFX_EFFECT_ROTATE4_T_T_L_R | Rotate4 top top left right
EFX_EFFECT_ROTATE4_T_T_L_T | Rotate4 top top left top
EFX_EFFECT_ROTATE4_T_T_L_B | Rotate4 top top left bottom
EFX_EFFECT_ROTATE4_T_T_R_L | Rotate4 top top right left
EFX_EFFECT_ROTATE4_T_T_R_R | Rotate4 top top right right
EFX_EFFECT_ROTATE4_T_T_R_T | Rotate4 top top right top
EFX_EFFECT_ROTATE4_T_T_R_B | Rotate4 top top right bottom
EFX_EFFECT_ROTATE4_T_T_T_L | Rotate4 top top top left
EFX_EFFECT_ROTATE4_T_T_T_R | Rotate4 top top top right
EFX_EFFECT_ROTATE4_T_T_T_T | Rotate4 top top top top
EFX_EFFECT_ROTATE4_T_T_T_B | Rotate4 top top top bottom
EFX_EFFECT_ROTATE4_T_T_B_L | Rotate4 top top bottom left
EFX_EFFECT_ROTATE4_T_T_B_R | Rotate4 top top bottom right
EFX_EFFECT_ROTATE4_T_T_B_T | Rotate4 top top bottom top
EFX_EFFECT_ROTATE4_T_T_B_B | Rotate4 top top bottom bottom
EFX_EFFECT_ROTATE4_T_B_L_L | Rotate4 top bottom left left
EFX_EFFECT_ROTATE4_T_B_L_R | Rotate4 top bottom left right
EFX_EFFECT_ROTATE4_T_B_L_T | Rotate4 top bottom left top
EFX_EFFECT_ROTATE4_T_B_L_B | Rotate4 top bottom left bottom
EFX_EFFECT_ROTATE4_T_B_R_L | Rotate4 top bottom right left
EFX_EFFECT_ROTATE4_T_B_R_R | Rotate4 top bottom right right
EFX_EFFECT_ROTATE4_T_B_R_T | Rotate4 top bottom right top
EFX_EFFECT_ROTATE4_T_B_R_B | Rotate4 top bottom right bottom
EFX_EFFECT_ROTATE4_T_B_T_L | Rotate4 top bottom top left
EFX_EFFECT_ROTATE4_T_B_T_R | Rotate4 top bottom top right
EFX_EFFECT_ROTATE4_T_B_T_T | Rotate4 top bottom top top
EFX_EFFECT_ROTATE4_T_B_T_B | Rotate4 top bottom top bottom
EFX_EFFECT_ROTATE4_T_B_B_L | Rotate4 top bottom bottom left
EFX_EFFECT_ROTATE4_T_B_B_R | Rotate4 top bottom bottom right
EFX_EFFECT_ROTATE4_T_B_B_T | Rotate4 top bottom bottom top
EFX_EFFECT_ROTATE4_T_B_B_B | Rotate4 top bottom bottom bottom
EFX_EFFECT_ROTATE4_B_L_L_L | Rotate4 bottom left left left
EFX_EFFECT_ROTATE4_B_L_L_R | Rotate4 bottom left left right
EFX_EFFECT_ROTATE4_B_L_L_T | Rotate4 bottom left left top
EFX_EFFECT_ROTATE4_B_L_L_B | Rotate4 bottom left left bottom
EFX_EFFECT_ROTATE4_B_L_R_L | Rotate4 bottom left right left
EFX_EFFECT_ROTATE4_B_L_R_R | Rotate4 bottom left right right
EFX_EFFECT_ROTATE4_B_L_R_T | Rotate4 bottom left right top
EFX_EFFECT_ROTATE4_B_L_R_B | Rotate4 bottom left right bottom
EFX_EFFECT_ROTATE4_B_L_T_L | Rotate4 bottom left top left
EFX_EFFECT_ROTATE4_B_L_T_R | Rotate4 bottom left top right
EFX_EFFECT_ROTATE4_B_L_T_T | Rotate4 bottom left top top
EFX_EFFECT_ROTATE4_B_L_T_B | Rotate4 bottom left top bottom
EFX_EFFECT_ROTATE4_B_L_B_L | Rotate4 bottom left bottom left
EFX_EFFECT_ROTATE4_B_L_B_R | Rotate4 bottom left bottom right
EFX_EFFECT_ROTATE4_B_L_B_T | Rotate4 bottom left bottom top
EFX_EFFECT_ROTATE4_B_L_B_B | Rotate4 bottom left bottom bottom
EFX_EFFECT_ROTATE4_B_R_L_L | Rotate4 bottom right left left
EFX_EFFECT_ROTATE4_B_R_L_R | Rotate4 bottom right left right
EFX_EFFECT_ROTATE4_B_R_L_T | Rotate4 bottom right left top
EFX_EFFECT_ROTATE4_B_R_L_B | Rotate4 bottom right left bottom
EFX_EFFECT_ROTATE4_B_R_R_L | Rotate4 bottom right right left
EFX_EFFECT_ROTATE4_B_R_R_R | Rotate4 bottom right right right
EFX_EFFECT_ROTATE4_B_R_R_T | Rotate4 bottom right right top
EFX_EFFECT_ROTATE4_B_R_R_B | Rotate4 bottom right right bottom
EFX_EFFECT_ROTATE4_B_R_T_L | Rotate4 bottom right top left
EFX_EFFECT_ROTATE4_B_R_T_R | Rotate4 bottom right top right
EFX_EFFECT_ROTATE4_B_R_T_T | Rotate4 bottom right top top
EFX_EFFECT_ROTATE4_B_R_T_B | Rotate4 bottom right top bottom
EFX_EFFECT_ROTATE4_B_R_B_L | Rotate4 bottom right bottom left
EFX_EFFECT_ROTATE4_B_R_B_R | Rotate4 bottom right bottom right
EFX_EFFECT_ROTATE4_B_R_B_T | Rotate4 bottom right bottom top
EFX_EFFECT_ROTATE4_B_R_B_B | Rotate4 bottom right bottom bottom
EFX_EFFECT_ROTATE4_B_T_L_L | Rotate4 bottom top left left
EFX_EFFECT_ROTATE4_B_T_L_R | Rotate4 bottom top left right
EFX_EFFECT_ROTATE4_B_T_L_T | Rotate4 bottom top left top
EFX_EFFECT_ROTATE4_B_T_L_B | Rotate4 bottom top left bottom
EFX_EFFECT_ROTATE4_B_T_R_L | Rotate4 bottom top right left
EFX_EFFECT_ROTATE4_B_T_R_R | Rotate4 bottom top right right
EFX_EFFECT_ROTATE4_B_T_R_T | Rotate4 bottom top right top
EFX_EFFECT_ROTATE4_B_T_R_B | Rotate4 bottom top right bottom
EFX_EFFECT_ROTATE4_B_T_T_L | Rotate4 bottom top top left
EFX_EFFECT_ROTATE4_B_T_T_R | Rotate4 bottom top top right
EFX_EFFECT_ROTATE4_B_T_T_T | Rotate4 bottom top top top
EFX_EFFECT_ROTATE4_B_T_T_B | Rotate4 bottom top top bottom
EFX_EFFECT_ROTATE4_B_T_B_L | Rotate4 bottom top bottom left
EFX_EFFECT_ROTATE4_B_T_B_R | Rotate4 bottom top bottom right
EFX_EFFECT_ROTATE4_B_T_B_T | Rotate4 bottom top bottom top
EFX_EFFECT_ROTATE4_B_T_B_B | Rotate4 bottom top bottom bottom
EFX_EFFECT_ROTATE4_B_B_L_L | Rotate4 bottom bottom left left
EFX_EFFECT_ROTATE4_B_B_L_R | Rotate4 bottom bottom left right
EFX_EFFECT_ROTATE4_B_B_L_T | Rotate4 bottom bottom left top
EFX_EFFECT_ROTATE4_B_B_L_B | Rotate4 bottom bottom left bottom
EFX_EFFECT_ROTATE4_B_B_R_L | Rotate4 bottom bottom right left
EFX_EFFECT_ROTATE4_B_B_R_R | Rotate4 bottom bottom right right
EFX_EFFECT_ROTATE4_B_B_R_T | Rotate4 bottom bottom right top
EFX_EFFECT_ROTATE4_B_B_R_B | Rotate4 bottom bottom right bottom
EFX_EFFECT_ROTATE4_B_B_T_L | Rotate4 bottom bottom top left
EFX_EFFECT_ROTATE4_B_B_T_R | Rotate4 bottom bottom top right
EFX_EFFECT_ROTATE4_B_B_T_T | Rotate4 bottom bottom top top
EFX_EFFECT_ROTATE4_B_B_T_B | Rotate4 bottom bottom top bottom
EFX_EFFECT_ROTATE4_B_B_B_L | Rotate4 bottom bottom bottom left
EFX_EFFECT_ROTATE4_B_B_B_R | Rotate4 bottom bottom bottom right
EFX_EFFECT_ROTATE4_B_B_B_T | Rotate4 bottom bottom bottom top
EFX_EFFECT_ROTATE4_B_B_B_B | Rotate4 bottom bottom bottom bottom
EFX_EFFECT_ROTATE_MAX | Number of effects in this class.

Zoom class

EFX_EFFECT_ZOOM_TO_C | Zoom to center
EFX_EFFECT_ZOOM_FROM_C | Zoom from center
EFX_EFFECT_ZOOM_MAX | Number of effects in this class.

Drip class

EFX_EFFECT_DRIP_T_TO_B | Drip top to bottom
EFX_EFFECT_DRIP_B_TO_T | Drip bottom to top
EFX_EFFECT_DRIP_L_TO_R | Drip left to right
EFX_EFFECT_DRIP_R_TO_L | Drip right to left
EFX_EFFECT_DRIP_MAX | Number of effects in this class.

Blind class

EFX_EFFECT_BLIND_T_TO_B | Blind top to bottom
EFX_EFFECT_BLIND_L_TO_R | Blind left to right
EFX_EFFECT_BLIND_GROWING_L_TO_R | Blind growing left to right
EFX_EFFECT_BLIND_GROWING_R_TO_L | Blind growing right to left
EFX_EFFECT_BLIND_GROWING_T_TO_B | Blind growing top to bottom
EFX_EFFECT_BLIND_GROWING_B_TO_T | Blind growing bottom to top
EFX_EFFECT_BLIND2_T_TO_B_AND_L_TO_R | Blind2 top to bottom and left to right
EFX_EFFECT_BLIND_MAX | Number of effects in this class.

Random class

EFX_EFFECT_RANDOM_BARS_R_TO_L | Random bars right to left
EFX_EFFECT_RANDOM_BARS_L_TO_R | Random bars left to right
EFX_EFFECT_RANDOM_BARS_B_TO_T | Random bars bottom to top
EFX_EFFECT_RANDOM_BARS_T_TO_B | Random bars top to bottom
EFX_EFFECT_RANDOM_LINES | Random lines
EFX_EFFECT_RANDOM_BLOCKS | Random blocks
EFX_EFFECT_RANDOM_BLOCKS_R_TO_L | Random blocks right to left
EFX_EFFECT_RANDOM_BLOCKS_L_TO_R | Random blocks left to right
EFX_EFFECT_RANDOM_BLOCKS_B_TO_T | Random blocks bottom to top
EFX_EFFECT_RANDOM_BLOCKS_T_TO_B | Random blocks top to bottom
EFX_EFFECT_RANDOM_MAX | Number of effects in this class.

Checkerboard class

EFX_EFFECT_CHECKERBOARD_T_TO_B_THEN_T_TO_B | Checkerboard top to bottom then top to bottom
EFX_EFFECT_CHECKERBOARD_B_TO_T_THEN_B_TO_T | Checkerboard bottom to top then bottom to top
EFX_EFFECT_CHECKERBOARD_L_TO_R_THEN_L_TO_R | Checkerboard left to right then left to right
EFX_EFFECT_CHECKERBOARD_R_TO_L_THEN_R_TO_L | Checkerboard right to left then right to left
EFX_EFFECT_CHECKERBOARD_T_TO_B_THEN_B_TO_T | Checkerboard top to bottom then bottom to top
EFX_EFFECT_CHECKERBOARD_B_TO_T_THEN_T_TO_B | Checkerboard bottom to top then top to bottom
EFX_EFFECT_CHECKERBOARD_L_TO_R_THEN_R_TO_L | Checkerboard left to right then right to left
EFX_EFFECT_CHECKERBOARD_R_TO_L_THEN_L_TO_R | Checkerboard right to left then left to right
EFX_EFFECT_CHECKERBOARD_MAX | Number of effects in this class.

Blocks class

EFX_EFFECT_BLOCKS_T_TO_B | Blocks top to bottom
EFX_EFFECT_BLOCKS_B_TO_T | Blocks bottom to top
EFX_EFFECT_BLOCKS_L_TO_R | Blocks left to right
EFX_EFFECT_BLOCKS_R_TO_L | Blocks right to left
EFX_EFFECT_BLOCKS_SWIRL_CW_TO_C | Blocks swirl CW to center
EFX_EFFECT_BLOCKS_SWIRL_CW_FROM_C | Blocks swirl CW from center
EFX_EFFECT_BLOCKS_SWIRL_CCW_TO_C | Blocks swirl CCW to center
EFX_EFFECT_BLOCKS_SWIRL_CCW_FROM_C | Blocks swirl CCW from center
EFX_EFFECT_BLOCKS_MAX | Number of effects in this class.

Circle class

EFX_EFFECT_CIRCLE_C_IN | Circle center in
EFX_EFFECT_CIRCLE_C_OUT | Circle center out
EFX_EFFECT_CIRCLE_L_IN | Circle left in
EFX_EFFECT_CIRCLE_L_OUT | Circle left out
EFX_EFFECT_CIRCLE_R_IN | Circle right in
EFX_EFFECT_CIRCLE_R_OUT | Circle right out
EFX_EFFECT_CIRCLE_T_IN | Circle top in
EFX_EFFECT_CIRCLE_T_OUT | Circle top out
EFX_EFFECT_CIRCLE_B_IN | Circle bottom in
EFX_EFFECT_CIRCLE_B_OUT | Circle bottom out
EFX_EFFECT_CIRCLE_C_INTER_IN_THEN_IN | Circle center interlace in then in
EFX_EFFECT_CIRCLE_C_INTER_OUT_THEN_OUT | Circle center interlace out then out
EFX_EFFECT_CIRCLE_C_INTER_IN_THEN_OUT | Circle center interlace in then out
EFX_EFFECT_CIRCLE_C_INTER_OUT_THEN_IN | Circle center interlace out then in
EFX_EFFECT_CIRCLE_L_INTER_IN_THEN_IN | Circle left interlace in then in
EFX_EFFECT_CIRCLE_L_INTER_OUT_THEN_OUT | Circle left interlace out then out
EFX_EFFECT_CIRCLE_L_INTER_IN_THEN_OUT | Circle left interlace in then out
EFX_EFFECT_CIRCLE_L_INTER_OUT_THEN_IN | Circle left interlace out then in
EFX_EFFECT_CIRCLE_R_INTER_IN_THEN_IN | Circle right interlace in then in
EFX_EFFECT_CIRCLE_R_INTER_OUT_THEN_OUT | Circle right interlace out then out
EFX_EFFECT_CIRCLE_R_INTER_IN_THEN_OUT | Circle right interlace in then out
EFX_EFFECT_CIRCLE_R_INTER_OUT_THEN_IN | Circle right interlace out then in
EFX_EFFECT_CIRCLE_T_INTER_IN_THEN_IN | Circle top interlace in then in
EFX_EFFECT_CIRCLE_T_INTER_OUT_THEN_OUT | Circle top interlace out then out
EFX_EFFECT_CIRCLE_T_INTER_IN_THEN_OUT | Circle top interlace in then out
EFX_EFFECT_CIRCLE_T_INTER_OUT_THEN_IN | Circle top interlace out then in
EFX_EFFECT_CIRCLE_B_INTER_IN_THEN_IN | Circle bottom interlace in then in
EFX_EFFECT_CIRCLE_B_INTER_OUT_THEN_OUT | Circle bottom interlace out then out
EFX_EFFECT_CIRCLE_B_INTER_IN_THEN_OUT | Circle bottom interlace in then out
EFX_EFFECT_CIRCLE_B_INTER_OUT_THEN_IN | Circle bottom interlace out then in
EFX_EFFECT_CIRCLE_L_R_INTER | Circle left right interlace
EFX_EFFECT_CIRCLE_T_B_INTER | Circle top bottom interlace
EFX_EFFECT_CIRCLE2_L_R_OUT | Circle2 left right out
EFX_EFFECT_CIRCLE2_L_R_IN | Circle2 left right in
EFX_EFFECT_CIRCLE2_T_B_OUT | Circle2 top bottom out
EFX_EFFECT_CIRCLE2_T_B_IN | Circle2 top bottom in
EFX_EFFECT_CIRCLE_MAX | Number of effects in this class.

Ellipse class

EFX_EFFECT_ELLIPSE_C_IN | Ellipse center in
EFX_EFFECT_ELLIPSE_C_OUT | Ellipse center out
EFX_EFFECT_ELLIPSE_L_IN | Ellipse left in
EFX_EFFECT_ELLIPSE_L_OUT | Ellipse left out
EFX_EFFECT_ELLIPSE_R_IN | Ellipse right in
EFX_EFFECT_ELLIPSE_R_OUT | Ellipse right out
EFX_EFFECT_ELLIPSE_T_IN | Ellipse top in
EFX_EFFECT_ELLIPSE_T_OUT | Ellipse top out
EFX_EFFECT_ELLIPSE_B_IN | Ellipse bottom in
EFX_EFFECT_ELLIPSE_B_OUT | Ellipse bottom out
EFX_EFFECT_ELLIPSE_C_INTER_IN_THEN_IN | Ellipse center interlace in then in
EFX_EFFECT_ELLIPSE_C_INTER_OUT_THEN_OUT | Ellipse center interlace out then out
EFX_EFFECT_ELLIPSE_C_INTER_IN_THEN_OUT | Ellipse center interlace in then out
EFX_EFFECT_ELLIPSE_C_INTER_OUT_THEN_IN | Ellipse center interlace out then in
EFX_EFFECT_ELLIPSE_L_INTER_IN_THEN_IN | Ellipse left interlace in then in
EFX_EFFECT_ELLIPSE_L_INTER_OUT_THEN_OUT | Ellipse left interlace out then out
EFX_EFFECT_ELLIPSE_L_INTER_IN_THEN_OUT | Ellipse left interlace in then out
EFX_EFFECT_ELLIPSE_L_INTER_OUT_THEN_IN | Ellipse left interlace out then in
EFX_EFFECT_ELLIPSE_R_INTER_IN_THEN_IN | Ellipse right interlace in then in
EFX_EFFECT_ELLIPSE_R_INTER_OUT_THEN_OUT | Ellipse right interlace out then out
EFX_EFFECT_ELLIPSE_R_INTER_IN_THEN_OUT | Ellipse right interlace in then out
EFX_EFFECT_ELLIPSE_R_INTER_OUT_THEN_IN | Ellipse right interlace out then in
EFX_EFFECT_ELLIPSE_T_INTER_IN_THEN_IN | Ellipse top interlace in then in
EFX_EFFECT_ELLIPSE_T_INTER_OUT_THEN_OUT | Ellipse top interlace out then out
EFX_EFFECT_ELLIPSE_T_INTER_IN_THEN_OUT | Ellipse top interlace in then out
EFX_EFFECT_ELLIPSE_T_INTER_OUT_THEN_IN | Ellipse top interlace out then in
EFX_EFFECT_ELLIPSE_B_INTER_IN_THEN_IN | Ellipse bottom interlace in then in
EFX_EFFECT_ELLIPSE_B_INTER_OUT_THEN_OUT | Ellipse bottom interlace out then out
EFX_EFFECT_ELLIPSE_B_INTER_IN_THEN_OUT | Ellipse bottom interlace in then out
EFX_EFFECT_ELLIPSE_B_INTER_OUT_THEN_IN | Ellipse bottom interlace out then in
EFX_EFFECT_ELLIPSE_L_R_INTER | Ellipse left right interlace
EFX_EFFECT_ELLIPSE_T_B_INTER | Ellipse top bottom interlace
EFX_EFFECT_ELLIPSE2_L_R_OUT | Ellipse2 left right out
EFX_EFFECT_ELLIPSE2_L_R_IN | Ellipse2 left right in
EFX_EFFECT_ELLIPSE2_T_B_OUT | Ellipse2 top bottom out
EFX_EFFECT_ELLIPSE2_T_B_IN | Ellipse2 top bottom in
EFX_EFFECT_ELLIPSE_MAX | Number of effects in this class.

Twirl Class

EFX_EFFECT_TWIRL_CW | Twirl clockwise
EFX_EFFECT_TWIRL_CCW | Twirl counter clockwise

Wave class

EFX_EFFECT_WAVE_TB | Wave from top to bottom
EFX_EFFECT_WAVE_BT | Wave from bottom to top
EFX_EFFECT_WAVE_LR | Wave from left to right
EFX_EFFECT_WAVE_RL | Wave from right to left

White Turnover class

EFX_EFFECT_WHITE_TURNOVER_LT_TO_RB | Left top to right bottom
EFX_EFFECT_WHITE_TURNOVER_LB_TO_RT | Left bottom to right top
EFX_EFFECT_WHITE_TURNOVER_RT_TO_LB | Right top to left bottom
EFX_EFFECT_WHITE_TURNOVER_RB_TO_LT | Right bottom to left top
EFX_EFFECT_WHITE_TURNOVER2_LT_LT | Left top and left top
EFX_EFFECT_WHITE_TURNOVER2_LT_LB | Left top and left bottom
EFX_EFFECT_WHITE_TURNOVER2_LT_RT | Left top and right top
EFX_EFFECT_WHITE_TURNOVER2_LT_RB | Left top and right bottom
EFX_EFFECT_WHITE_TURNOVER2_LB_LT | Left bottom and left top
EFX_EFFECT_WHITE_TURNOVER2_LB_LB | Left bottom and left bottom
EFX_EFFECT_WHITE_TURNOVER2_LB_RT | Left bottom and right top
EFX_EFFECT_WHITE_TURNOVER2_LB_RB | Left bottom and right bottom
EFX_EFFECT_WHITE_TURNOVER2_RT_LT | Right top and left top
EFX_EFFECT_WHITE_TURNOVER2_RT_LB | Right top and left bottom
EFX_EFFECT_WHITE_TURNOVER2_RT_RT | Right top and right top
EFX_EFFECT_WHITE_TURNOVER2_RT_RB | Right top and right bottom
EFX_EFFECT_WHITE_TURNOVER2_RB_LT | Right bottom and left top
EFX_EFFECT_WHITE_TURNOVER2_RB_LB | Right bottom and left bottom
EFX_EFFECT_WHITE_TURNOVER2_RB_RT | Right bottom and right top
EFX_EFFECT_WHITE_TURNOVER2_RB_RB | Right bottom and right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LT_LT | Left top left top left top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LT_RT | Left top left top left top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LT_RB | Left top left top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LT_LB | Left top left top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RT_LT | Left top left top right top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RT_RT | Left top left top right top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RT_RB | Left top left top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RT_LB | Left top left top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RB_LT | Left top left top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RB_RT | Left top left top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RB_RB | Left top left top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_RB_LB | Left top left top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LB_LT | Left top left top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LB_RT | Left top left top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LB_RB | Left top left top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LT_LB_LB | Left top left top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LT_LT | Left top right top left top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LT_RT | Left top right top left top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LT_RB | Left top right top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LT_LB | Left top right top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RT_LT | Left top right top right top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RT_RT | Left top right top right top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RT_RB | Left top right top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RT_LB | Left top right top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RB_LT | Left top right top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RB_RT | Left top right top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RB_RB | Left top right top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_RB_LB | Left top right top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LB_LT | Left top right top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LB_RT | Left top right top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LB_RB | Left top right top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RT_LB_LB | Left top right top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LT_LT | Left top right bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LT_RT | Left top right bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LT_RB | Left top right bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LT_LB | Left top right bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RT_LT | Left top right bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RT_RT | Left top right bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RT_RB | Left top right bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RT_LB | Left top right bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RB_LT | Left top right bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RB_RT | Left top right bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RB_RB | Left top right bottom right bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_RB_LB | Left top right bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LB_LT | Left top right bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LB_RT | Left top right bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LB_RB | Left top right bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_RB_LB_LB | Left top right bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LT_LT | Left top left bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LT_RT | Left top left bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LT_RB | Left top left bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LT_LB | Left top left bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RT_LT | Left top left bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RT_RT | Left top left bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RT_RB | Left top left bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RT_LB | Left top left bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RB_LT | Left top left bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RB_RT | Left top left bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RB_RB | Left top left bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_RB_LB | Left top left bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LB_LT | Left top left bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LB_RT | Left top left bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LB_RB | Left top left bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LT_LB_LB_LB | Left top left bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LT_LT | Right top left top left top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LT_RT | Right top left top left top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LT_RB | Right top left top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LT_LB | Right top left top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RT_LT | Right top left top right top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RT_RT | Right top left top right top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RT_RB | Right top left top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RT_LB | Right top left top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RB_LT | Right top left top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RB_RT | Right top left top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RB_RB | Right top left top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_RB_LB | Right top left top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LB_LT | Right top left top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LB_RT | Right top left top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LB_RB | Right top left top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LT_LB_LB | Right top left top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LT_LT | Right top right top left top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LT_RT | Right top right top left top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LT_RB | Right top right top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LT_LB | Right top right top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RT_LT | Right top right top right top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RT_RT | Right top right top right top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RT_RB | Right top right top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RT_LB | Right top right top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RB_LT | Right top right top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RB_RT | Right top right top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RB_RB | Right top right top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_RB_LB | Right top right top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LB_LT | Right top right top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LB_RT | Right top right top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LB_RB | Right top right top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RT_LB_LB | Right top right top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LT_LT | Right top right bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LT_RT | Right top right bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LT_RB | Right top right bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LT_LB | Right top right bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RT_LT | Right top right bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RT_RT | Right top right bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RT_RB | Right top right bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RT_LB | Right top right bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RB_LT | Right top right bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RB_RT | Right top right bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RB_RB | Right top right bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_RB_LB | Right top right bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LB_LT | Right top right bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LB_RT | Right top right bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LB_RB | Right top right bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_RB_LB_LB | Right top right bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LT_LT | Right top left bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LT_RT | Right top left bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LT_RB | Right top left bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LT_LB | Right top left bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RT_LT | Right top left bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RT_RT | Right top left bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RT_RB | Right top left bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RT_LB | Right top left bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RB_LT | Right top left bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RB_RT | Right top left bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RB_RB | Right top left bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_RB_LB | Right top left bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LB_LT | Right top left bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LB_RT | Right top left bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LB_RB | Right top left bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RT_LB_LB_LB | Right top left bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LT_LT | Right bottom left top left top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LT_RT | Right bottom left top left top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LT_RB | Right bottom left top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LT_LB | Right bottom left top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RT_LT | Right bottom left top right top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RT_RT | Right bottom left top right top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RT_RB | Right bottom left top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RT_LB | Right bottom left top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RB_LT | Right bottom left top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RB_RT | Right bottom left top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RB_RB | Right bottom left top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_RB_LB | Right bottom left top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LB_LT | Right bottom left top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LB_RT | Right bottom left top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LB_RB | Right bottom left top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LT_LB_LB | Right bottom left top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LT_LT | Right bottom right top left top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LT_RT | Right bottom right top left top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LT_RB | Right bottom right top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LT_LB | Right bottom right top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RT_LT | Right bottom right top right top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RT_RT | Right bottom right top right top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RT_RB | Right bottom right top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RT_LB | Right bottom right top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RB_LT | Right bottom right top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RB_RT | Right bottom right top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RB_RB | Right bottom right top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_RB_LB | Right bottom right top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LB_LT | Right bottom right top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LB_RT | Right bottom right top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LB_RB | Right bottom right top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RT_LB_LB | Right bottom right top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LT_LT | Right bottom right bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LT_RT | Right bottom right bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LT_RB | Right bottom right bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LT_LB | Right bottom right bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RT_LT | Right bottom right bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RT_RT | Right bottom right bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RT_RB | Right bottom right bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RT_LB | Right bottom right bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RB_LT | Right bottom right bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RB_RT | Right bottom right bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RB_RB | Right bottom right bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_RB_LB | Right bottom right bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LB_LT | Right bottom right bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LB_RT | Right bottom right bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LB_RB | Right bottom right bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_RB_LB_LB | Right bottom right bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LT_LT | Right bottom left bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LT_RT | Right bottom left bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LT_RB | Right bottom left bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LT_LB | Right bottom left bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RT_LT | Right bottom left bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RT_RT | Right bottom left bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RT_RB | Right bottom left bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RT_LB | Right bottom left bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RB_LT | Right bottom left bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RB_RT | Right bottom left bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RB_RB | Right bottom left bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_RB_LB | Right bottom left bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LB_LT | Right bottom left bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LB_RT | Right bottom left bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LB_RB | Right bottom left bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_RB_LB_LB_LB | Right bottom left bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LT_LT | Left bottom left top left top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LT_RT | Left bottom left top left top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LT_RB | Left bottom left top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LT_LB | Left bottom left top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RT_LT | Left bottom left top right top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RT_RT | Left bottom left top right top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RT_RB | Left bottom left top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RT_LB | Left bottom left top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RB_LT | Left bottom left top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RB_RT | Left bottom left top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RB_RB | Left bottom left top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_RB_LB | Left bottom left top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LB_LT | Left bottom left top left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LB_RT | Left bottom left top left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LB_RB | Left bottom left top left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LT_LB_LB | Left bottom left top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LT_LT | Left bottom right top left top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LT_RT | Left bottom right top left top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LT_RB | Left bottom right top left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LT_LB | Left bottom right top left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RT_LT | Left bottom right top right top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RT_RT | Left bottom right top right top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RT_RB | Left bottom right top right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RT_LB | Left bottom right top right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RB_LT | Left bottom right top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RB_RT | Left bottom right top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RB_RB | Left bottom right top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_RB_LB | Left bottom right top right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LB_LT | Left bottom right top right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LB_RT | Left bottom right top right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LB_RB | Left bottom right top right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RT_LB_LB | Left bottom right top left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LT_LT | Left bottom right bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LT_RT | Left bottom right bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LT_RB | Left bottom right bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LT_LB | Left bottom right bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RT_LT | Left bottom right bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RT_RT | Left bottom right bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RT_RB | Left bottom right bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RT_LB | Left bottom right bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RB_LT | Left bottom right bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RB_RT | Left bottom right bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RB_RB | Left bottom right bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_RB_LB | Left bottom right bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LB_LT | Left bottom right bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LB_RT | Left bottom right bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LB_RB | Left bottom right bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_RB_LB_LB | Left bottom right bottom left bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LT_LT | Left bottom left bottom left top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LT_RT | Left bottom left bottom left top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LT_RB | Left bottom left bottom left top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LT_LB | Left bottom left bottom left top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RT_LT | Left bottom left bottom right top left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RT_RT | Left bottom left bottom right top right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RT_RB | Left bottom left bottom right top right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RT_LB | Left bottom left bottom right top left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RB_LT | Left bottom left bottom right bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RB_RT | Left bottom left bottom right bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RB_RB | Left bottom left bottom right bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_RB_LB | Left bottom left bottom right bottom left bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LB_LT | Left bottom left bottom left bottom left top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LB_RT | Left bottom left bottom left bottom right top
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LB_RB | Left bottom left bottom left bottom right bottom
EFX_EFFECT_WHITE_TURNOVER4_LB_LB_LB_LB | Left bottom left bottom left bottom left bottom

Turnover class

EFX_EFFECT_TURNOVER_LT_TO_RB | Left top to right bottom
EFX_EFFECT_TURNOVER_LB_TO_RT | Left bottom to right top
EFX_EFFECT_TURNOVER_RT_TO_LB | Right top to left bottom
EFX_EFFECT_TURNOVER_RB_TO_LT | Right bottom to left top

Replace class

EFX_EFFECT_REPLACE_HORZ_LEFT | The old bitmap will move to the left, the new bitmap will come from the right
EFX_EFFECT_REPLACE_HORZ_RIGHT | The old bitmap will move to the right, the new bitmap will come from the left
EFX_EFFECT_REPLACE_VERT_TOP | The old bitmap will move to the top, the new bitmap will come from the bottom
EFX_EFFECT_REPLACE_VERT_BOTTOM | The old bitmap will move to the bottom, the new bitmap will come from the top

Laser class

EFX_EFFECT_LASER_LT_RB | From center to left top and from center to right bottom
EFX_EFFECT_LASER_LB_RT | From center to left bottom and from center to right top

Fade Normal class

EFX_EFFECT_FADE_NORMAL

The new bitmap will fade

Fade Black and White class

EFX_EFFECT_FADE_BW

The gray bitmap will fade first, then the colored bitmap.

Fade Color class

EFX_EFFECT_FADE_COLOR

The color level bitmap will fade first, then the color bitmap. The crWand parameter will determine the color level bitmap.


Gradients

The following values may be used for the GradientStyle property.

Value

Meaning

Linear gradient class

EFX_GRADIENT_LINE_L_TO_R | Line left to right
EFX_GRADIENT_LINE_R_TO_L | Line right to left
EFX_GRADIENT_LINE_T_TO_B | Line top to bottom
EFX_GRADIENT_LINE_B_TO_T | Line bottom to top
EFX_GRADIENT_LINE_LT_TO_RB | Line left-top to right-bottom
EFX_GRADIENT_LINE_LB_TO_RT | Line left-bottom to right-top
EFX_GRADIENT_LINE_RT_TO_LB | Line right-top to left-bottom
EFX_GRADIENT_LINE_RB_TO_LT | Line right-bottom to left-top
EFX_GRADIENT_LINE2_L_AND_R_TO_C | Line2 left and right to center
EFX_GRADIENT_LINE2_C_TO_L_AND_R | Line2 center to left and right
EFX_GRADIENT_LINE2_T_AND_B_TO_C | Line2 top and bottom to center
EFX_GRADIENT_LINE2_C_TO_T_AND_B | Line2 center to top and bottom
EFX_GRADIENT_LINE2_LT_AND_RB_TO_C | Line2 left-top and right-bottom to center
EFX_GRADIENT_LINE2_C_TO_LT_AND_RB | Line2 center to left-top and right-bottom
EFX_GRADIENT_LINE2_RT_AND_LB_TO_C | Line2 right-top and left-bottom to center
EFX_GRADIENT_LINE2_C_TO_RT_AND_LB | Line2 center to right-top and left-bottom
EFX_GRADIENT_LINE_MAX | Number of gradients in this class.

Angular gradient class

EFX_GRADIENT_ANGLE_TO_LT | Angle to left-top
EFX_GRADIENT_ANGLE_TO_LB | Angle to left-bottom
EFX_GRADIENT_ANGLE_TO_RT | Angle to right-top
EFX_GRADIENT_ANGLE_TO_RB | Angle to right-bottom
EFX_GRADIENT_ANGLE_FROM_LT | Angle from left-top
EFX_GRADIENT_ANGLE_FROM_LB | Angle from left-bottom
EFX_GRADIENT_ANGLE_FROM_RT | Angle from right-top
EFX_GRADIENT_ANGLE_FROM_RB | Angle from right-bottom
EFX_GRADIENT_ANGLE_MAX | Number of gradients in this class.

Rectangular gradient class

EFX_GRADIENT_RECTANGLE_TO_C | Rectangle to center
EFX_GRADIENT_RECTANGLE_FROM_C | Rectangle from center
EFX_GRADIENT_RECTANGLE_MAX | Number of gradients in this class.

Elliptical gradient class

EFX_GRADIENT_ELLIPSE_TO_C | Ellipse to center
EFX_GRADIENT_ELLIPSE_FROM_C | Ellipse from center
EFX_GRADIENT_ELLIPSE_MAX | Number of gradients in this class.

Conical gradient class

EFX_GRADIENT_CONE_FROM_L | Cone from left
EFX_GRADIENT_CONE_FROM_R | Cone from right
EFX_GRADIENT_CONE_FROM_T | Cone from top
EFX_GRADIENT_CONE_FROM_B | Cone from bottom
EFX_GRADIENT_CONE_FROM_LT | Cone from left-top
EFX_GRADIENT_CONE_FROM_LB | Cone from left-bottom
EFX_GRADIENT_CONE_FROM_RT | Cone from right-top
EFX_GRADIENT_CONE_FROM_RB | Cone from right-bottom
EFX_GRADIENT_CONE_MAX | Number of gradients in this class.


PatternStyles

Value | Meaning
EFX_PATTERN_SOLID | Solid filling
EFX_PATTERN_TRANSPARENT | Transparent filling (not valid for transitions)
EFX_PATTERN_HORZ_LINE | Horizontal lines (==)
EFX_PATTERN_VERT_LINE | Vertical lines (||)
EFX_PATTERN_DOWNWARD_DIAG | Downward diagonal lines (//)
EFX_PATTERN_UPWARD_DIAG | Upward diagonal lines (\\)
EFX_PATTERN_CROSS | Cross line (++)
EFX_PATTERN_DIAG_CROSS | Diagonal cross lines (XX)
EFX_PATTERN_MAX | The last pattern (for use in a loop counter).


ShapeInnerStyles

The following values may be used for the ShapeInnerBandStyle property (ILEADRasterFXD).

Value | Meaning
FXD_SHAPE_INNERSTYLE_NONE | No inner band
FXD_SHAPE_INNERSTYLE_INSET | Inner band inset
FXD_SHAPE_INNERSTYLE_RAISED | Inner band raised


ShapeOuterStyles

The following values may be used for the ShapeOuterBandStyle property (ILEADRasterFXD).

Value | Meaning
FXD_SHAPE_OUTERSTYLE_NONE | No outer band
FXD_SHAPE_OUTERSTYLE_INSET | Outer band inset
FXD_SHAPE_OUTERSTYLE_RAISED | Outer band raised


Shapes

The following values may be used for the DrawShape method.

Value

Meaning

Rectangle class

FXD_SHAPE_RECTANGLE | Rectangle
FXD_SHAPE_RECTANGLE_ROUNDED | Rounded rectangle
FXD_SHAPE_RECTANGLE_MAX | Number of shapes in this class.

Square class

FXD_SHAPE_SQUARE | Square
FXD_SHAPE_SQUARE_ROUNDED | Rounded square
FXD_SHAPE_SQUARE_MAX | Number of shapes in this class.

Parallelogram class

FXD_SHAPE_PARALLELOGRAM_L | Parallelogram left
FXD_SHAPE_PARALLELOGRAM_R | Parallelogram right
FXD_SHAPE_PARALLELOGRAM_T | Parallelogram top
FXD_SHAPE_PARALLELOGRAM_B | Parallelogram bottom
FXD_SHAPE_PARALLELOGRAM_MAX | Number of shapes in this class.

Trapezoid class

FXD_SHAPE_TRAPEZOID_L | Trapezoid left
FXD_SHAPE_TRAPEZOID_R | Trapezoid right
FXD_SHAPE_TRAPEZOID_T | Trapezoid top
FXD_SHAPE_TRAPEZOID_B | Trapezoid bottom
FXD_SHAPE_TRAPEZOID_MAX | Number of shapes in this class.

Circle class

FXD_SHAPE_CIRCLE | Circle
FXD_SHAPE_CIRCLE_90_LT | Circle 90° left-top
FXD_SHAPE_CIRCLE_90_LB | Circle 90° left-bottom
FXD_SHAPE_CIRCLE_90_RT | Circle 90° right-top
FXD_SHAPE_CIRCLE_90_RB | Circle 90° right-bottom
FXD_SHAPE_CIRCLE_180_L | Circle 180° left
FXD_SHAPE_CIRCLE_180_R | Circle 180° right
FXD_SHAPE_CIRCLE_180_T | Circle 180° top
FXD_SHAPE_CIRCLE_180_B | Circle 180° bottom
FXD_SHAPE_CIRCLE_270_LT | Circle 270° left-top
FXD_SHAPE_CIRCLE_270_LB | Circle 270° left-bottom
FXD_SHAPE_CIRCLE_270_RT | Circle 270° right-top
FXD_SHAPE_CIRCLE_270_RB | Circle 270° right-bottom
FXD_SHAPE_CIRCLE_MAX | Number of shapes in this class.

Ellipse class

FXD_SHAPE_ELLIPSE | Ellipse
FXD_SHAPE_ELLIPSE_90_LT | Ellipse 90° left-top
FXD_SHAPE_ELLIPSE_90_LB | Ellipse 90° left-bottom
FXD_SHAPE_ELLIPSE_90_RT | Ellipse 90° right-top
FXD_SHAPE_ELLIPSE_90_RB | Ellipse 90° right-bottom
FXD_SHAPE_ELLIPSE_180_L | Ellipse 180° left
FXD_SHAPE_ELLIPSE_180_R | Ellipse 180° right
FXD_SHAPE_ELLIPSE_180_T | Ellipse 180° top
FXD_SHAPE_ELLIPSE_180_B | Ellipse 180° bottom
FXD_SHAPE_ELLIPSE_270_LT | Ellipse 270° left-top
FXD_SHAPE_ELLIPSE_270_LB | Ellipse 270° left-bottom
FXD_SHAPE_ELLIPSE_270_RT | Ellipse 270° right-top
FXD_SHAPE_ELLIPSE_270_RB | Ellipse 270° right-bottom
FXD_SHAPE_ELLIPSE_MAX | Number of shapes in this class.

Triangle class

FXD_SHAPE_TRIANGLE_EQUILATERAL_L | Equilateral triangle left
FXD_SHAPE_TRIANGLE_EQUILATERAL_R | Equilateral triangle right
FXD_SHAPE_TRIANGLE_EQUILATERAL_T | Equilateral triangle top
FXD_SHAPE_TRIANGLE_EQUILATERAL_B | Equilateral triangle bottom
FXD_SHAPE_TRIANGLE_ISOSCELES_L | Isosceles triangle left
FXD_SHAPE_TRIANGLE_ISOSCELES_R | Isosceles triangle right
FXD_SHAPE_TRIANGLE_ISOSCELES_T | Isosceles triangle top
FXD_SHAPE_TRIANGLE_ISOSCELES_B | Isosceles triangle bottom
FXD_SHAPE_TRIANGLE_RIGHT_LT | Right triangle left-top
FXD_SHAPE_TRIANGLE_RIGHT_LB | Right triangle left-bottom
FXD_SHAPE_TRIANGLE_RIGHT_RT | Right triangle right-top
FXD_SHAPE_TRIANGLE_RIGHT_RB | Right triangle right-bottom
FXD_SHAPE_TRIANGLE_MAX | Number of shapes in this class.

Other polygons class

FXD_SHAPE_OCTAGON | Octagon
FXD_SHAPE_DIAMOND | Diamond
FXD_SHAPE_PENTAGON | Pentagon
FXD_SHAPE_HEXAGON | Hexagon
FXD_SHAPE_LINE | Line
FXD_SHAPE_REGION | Region
FXD_SHAPE_OTHER_MAX | Number of shapes in this class.

Star class

FXD_SHAPE_STAR4 | Star 4 points
FXD_SHAPE_STAR5 | Star 5 points
FXD_SHAPE_STAR8 | Star 8 points
FXD_SHAPE_STAR16 | Star 16 points
FXD_SHAPE_STAR24 | Star 24 points
FXD_SHAPE_STAR32 | Star 36 points
FXD_SHAPE_STAR_MAX | Number of shapes in this class.

Cross class

FXD_SHAPE_CROSS_SMALL | Cross small
FXD_SHAPE_CROSS_MEDIUM | Cross medium
FXD_SHAPE_CROSS_LARGE | Cross large
FXD_SHAPE_CROSS_MAX | Number of shapes in this class.

Arrow class

FXD_SHAPE_ARROW_L | Arrow left
FXD_SHAPE_ARROW_R | Arrow right
FXD_SHAPE_ARROW_T | Arrow top
FXD_SHAPE_ARROW_B | Arrow bottom
FXD_SHAPE_ARROW2_L_AND_R | Arrow2 left and right
FXD_SHAPE_ARROW2_T_AND_B | Arrow2 top and bottom
FXD_SHAPE_ARROW2_L_AND_T | Arrow2 left and top
FXD_SHAPE_ARROW2_L_AND_B | Arrow2 left and bottom
FXD_SHAPE_ARROW2_R_AND_T | Arrow2 right and top
FXD_SHAPE_ARROW2_R_AND_B | Arrow2 right and bottom
FXD_SHAPE_ARROW3_L_AND_T_AND_R | Arrow3 left and top and right
FXD_SHAPE_ARROW3_T_AND_R_AND_B | Arrow3 top and right and bottom
FXD_SHAPE_ARROW3_L_AND_B_AND_R | Arrow3 left and bottom and right
FXD_SHAPE_ARROW3_L_AND_T_AND_B | Arrow3 left and top and bottom
FXD_SHAPE_ARROW4_L_AND_T_AND_R_AND_B | Arrow4 left and top and right and bottom
FXD_SHAPE_ARROW_MAX | Number of shapes in this class.


Shape with a Fill Pattern and Drop Shadow

The following properties are set in this example:

ShapeBorderColor | Blue
ShadowColor | Black
ShadowXDepth | 5
ShadowYDepth | 7
ShapeBackgroundStyle | EFX_BACKSTYLE_OPAQUE
PatternStyle | EFX_PATTERN_CROSS
PatternForeColor | Red
PatternBackColor | Light blue


Shape with a Raised Inner Band

The following properties are set in this example:

ShapeInnerBandHiliteColor | Light blue
ShapeInnerBandShadowColor | Dark blue
ShapeInnerBandStyle | EFX_INNERSTYLE_RAISED
ShapeBorderColor | Black
PatternStyle | EFX_PATTERN_SOLID
PatternForeColor | Blue


Shape with an Inset Inner Band

The following properties are set in this example:

ShapeInnerBandHiliteColor | Light blue
ShapeInnerBandShadowColor | Dark blue
ShapeInnerBandStyle | EFX_INNERSTYLE_INSET
ShapeBorderColor | Black
PatternStyle | EFX_PATTERN_SOLID
PatternForeColor | Blue


Shape with an Inset Outer Band

The following properties are set in this example:

ShapeOuterBandHiliteColor | Light blue
ShapeOuterBandShadowColor | Dark blue
ShapeOuterBandStyle | EFX_OUTERSTYLE_INSET
ShapeBorderColor | Black
PatternStyle | EFX_PATTERN_SOLID
PatternForeColor | Blue


Shape with a Raised Outer Band

The following properties are set in this example:

ShapeOuterBandHiliteColor | Light blue
ShapeOuterBandShadowColor | Dark blue
ShapeOuterBandStyle | EFX_OUTERSTYLE_RAISED
ShapeBorderColor | Black
PatternStyle | EFX_PATTERN_SOLID
PatternForeColor | Blue


TextAlign Effects

The following values may be used for the TextAlign property (ILEADRasterFXD).

Value | Meaning
FXD_TEXTALIGN_LEFT_TOP | Left, top
FXD_TEXTALIGN_LEFT_VCENTER | Left, vertical center
FXD_TEXTALIGN_LEFT_BOTTOM | Left, bottom
FXD_TEXTALIGN_HCENTER_TOP | Top, horizontal center
FXD_TEXTALIGN_HCENTER_VCENTER | Vertical and horizontal center
FXD_TEXTALIGN_HCENTER_BOTTOM | Bottom, horizontal center
FXD_TEXTALIGN_RIGHT_TOP | Right, top
FXD_TEXTALIGN_RIGHT_VCENTER | Right, vertical center
FXD_TEXTALIGN_RIGHT_BOTTOM | Right, bottom
FXD_TEXTALIGN_MAX | Right, bottom


TextStyle Effects

The following values may be used for the TextStyle property (ILEADRasterFXD).

Value | Meaning
FXD_TEXTSTYLE_NORMAL | No three-dimensional effect
FXD_TEXTSTYLE_INSETLIGHT | Inset light text
FXD_TEXTSTYLE_INSETEXTRALIGHT | Inset extra light text
FXD_TEXTSTYLE_INSETHEAVY | Inset heavy text
FXD_TEXTSTYLE_INSETEXTRAHEAVY | Inset extra heavy text
FXD_TEXTSTYLE_RAISEDLIGHT | Raised light text
FXD_TEXTSTYLE_RAISEDEXTRALIGHT | Raised extra light text
FXD_TEXTSTYLE_RAISEDHEAVY | Raised heavy text
EXF_TEXTSTYLE_RAISEDEXTRAHEAVY | Raised extra heavy text
FXD_TEXTSTYLE_DROPSHADOW | Drop shadow text
FXD_TEXTSTYLE_BLOCKSHADOW | Block shadow text
FXD_TEXTSTYLE_OUTLINEBLOCK | Outline block text


Text with an Outline and Drop Shadow

The following properties are set in this example:

TextStyle | EFX_TEXTSTYLE_OUTLINEBLOCK
DrawFontColor | Blue
TextHiliteColor | Magenta
ShadowColor | Black
ShadowXDepth | 5
ShadowYDepth | 5


Text Where the Effect Disables the Drop Shadow

The following properties are set in this example:

TextStyle | EFX_TEXTSTYLE_RAISEDHEAVY
DrawFontColor | Blue
TextHiliteColor | Magenta
ShadowColor | Black
ShadowXDepth | 5 (disabled by the effect)
ShadowYDepth | 5 (disabled by the effect)


Compression Quality Factors

You can specify a quality factor when saving an image file to LEAD, JFIF, LEAD2JFIF, LEAD2JFIF, JTIF, LEAD1JTIF, and LEAD2JTIF. The quality factor (Q factor) is a number that determines the degree of loss in the compression process. You can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression.

For JFIF and JTIF compression only, you can also use a factor of 0 to produce lossless JPEG files

For LEAD CMP compression (8-bit, 12-bit and 24-bit only), you can also use one of the following enhanced options:

Q Factor | Predefined options for LEAD only
PQ1 | (-1) Perfect quality 1 This option compresses all colors of a 24-bit file and maintains the quality of the original image at a smaller file size. As the name suggests, there is no visual loss of color at this setting.
PQ2 | (-2) Perfect quality 2 This will produce a smaller file size than PQ1 while maintaining similar quality.
QFS | (-3) Quality far more important than size This option removes colors not noticed by the human eye. Most viewers cannot tell the difference between an image compressed at this level and the original image.
QMS | (-4) Quality more important than size While more colors are removed, most of them are colors or shades that are close to one another. The compressed image will appear very much like the original image. It will take some study to see the difference.
QS | (-5) Quality and size equally important This option provides the highest compression while maintaining good image quality. Try this option first, then move up or down the list accordingly to obtain acceptable compression size and image quality.
SQS | (-6) Size more important that quality (sharp) This option is recommended for images that have sharp edges. For example, an image that has a text overlay or an image with many straight lines. While it creates a larger file than the next option, it retains better edges.
SQT | (-7) Size more important than quality (less tiling) This option produces less tiling in the image than the previous options. However, it may distort text or straight lines. It is a good option for image database applications.
MCQ | (-8) Maximum compression keeping quality This option provides maximum compression while maintaining as high as possible image quality.
MC | (-9) Maximum compression This option gives maximum compression. It is equivalent to a Q factor of 255.

For the PNG format, the qFactor can be a value between 0 and 9. 0 = (default compression), 1 (fastest compression) ... 9 (highest compression ratio)

For JP2 and J2K files, the qFactor can be a value between –1 and 255. –1, and 0 represent lossless compression, while all the values between 1 and 255 are considered as compression ratios. For example a qFactor of 10 is a compression ratio of 10. A qFactor of 1 gives the best lossy quality, while a qFactor of 255 gives the highest compression. If the compression control used by the toolkit when saving J2K files is J2K_COMPRESSION_QFACTOR, then the compression used is based on the Qfactor passed to the SaveXXX method. For more information about setting the options for saving J2K files, refer to the J2KXXX properties of the ILEADRasterIO object.

For the ABC compression (FILE_ABC and FILE_TIF_ABC), the qFactor can be one of the following values:

Q Factor | Predefined options for LEAD only
ABCQ_LOSSLESS | [0] Lossless compression. This option compresses a 1-bit file and maintains image data unchanged. Highest quality.
ABCQ_VIRTUALLOSSLESS | [1] Lossy compression. This option removes the image's noisy pixels and compresses it to a smaller file size than ABCQ_LOSSLESS.
ABCQ_REMOVEBORDER | [2] Lossy compression. This option removes the image's border, if it exists, and compresses it to a smaller file size than ABCQ_ VIRTUALLOSSLESS.
ABCQ_ENHANCE | [3] Lossy compression. This option cleans up the image, removes its border if it exists, and compresses it to a smaller file size than ABCQ_REMOVEBORDER.
ABCQ_MODIFIED1 | [4] Lossy compression. This option cleans up the image, removes its border if it exists, and compresses it to a smaller file size than ABCQ_ENHANCE. However, it may distort text or straight lines.
ABCQ_MODIFIED1_FAST | [5] Same as ABCQ_MODIFIED1 without the border remove or image clean processes.
ABCQ_MODIFIED2 | [6] Lossy compression. This option cleans up the image, removes its border if it exists, and compresses it to a smaller file size than ABCQ_MODIFIED1. However, it may distort text or straight lines. Maximum compression.
ABCQ_MODIFIED2_FAST | [7] Same as ABCQ_MODIFIED2 without the border remove or image clean processes.
ABCQ_MODIFIED3 | [8] Lossy compression. Provides faster encode and decode speed than ABCQ_MODIFIED1 or ABCQ_MODIFIED2. Provides the maximum compression.
ABCQ_MODIFIED3_FAST | [9] Same as ABCQ_MODIFIED3 without the border remove or image clean processes.
ABCQ_LOSSLESS_FAST | [10] Faster lossless compression than ABCQ_LOSSLESS. This option compresses a 1-bit file and maintains image data unchanged. Highest quality. Does not produce compression ratios as high as ABCQ_LOSSLESS.
ABCQ_LOSSY_FAST | [11] Lossy compression. This is the fastest ABC lossy compression option. Does not produce compression ratios as high as the other lossy options.


Compression Quality Factors in the Mixed Raster Content Object

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

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

Text2BitCoder property

MaskCoder property

PictureCoder property

PictureQFactor property

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

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


Compression Using LEAD and JPEG Formats

Compression of color and grayscale graphic image files is useful because the files are big. They can range from 100 kilobytes to more than 200 megabytes. Compressing the image files does the following:

Dramatically decreases the storage requirements

Improves the input and output speed within a system

Improves the transmission speed over networks or phone lines

By incorporating the LEAD and JPEG image compression, you can develop applications that would be impractical otherwise. Image files can be reduced to 200 times smaller than their original size.

The LEAD CMP compression format was created by LEAD Technologies, Inc., and it delivers a much smaller file size and better image quality than other compression techniques, including JPEG.

LEAD's CMP file format allows for decompression to a 24-bit medium at 24-bit color and to an 8-bit medium at 8-bit color without sacrificing image quality. This eliminates the need to convert all images to 8 bits in order to support the low end users or to save one 8-bit file and one 24-bit file. The result is one much smaller file size that can be viewed on a 24-bit video card at 24-bit true color, as well as on an 8-bit VGA card at 256 colors.

LEAD's CMW format uses Wavelet CMP compression. Currently, 24 color images and 8, 12 and 16-bit grayscale images are supported in this format. (This is available only in the LEADTOOLS CMW Plug in. 12 and 16-bit formats also require the Document/Medical capabilities)

Summary of All Supported Image File Formats describes the LEAD and JPEG compression formats, in addition to other formats that LEADTOOLS supports.

The amount of compression is controllable, allowing the compressed image quality to match the needs of your application. Compression Quality Factors describes how the quality factors are used.

JPEG Compliant

LEADTOOLS COM object is fully JPEG compliant. Any file using compression that is compliant with the JPEG Interchange File Format can be viewed and converted.

However, some images that are not fully compliant with the JPEG specification will be displayed upside-down. (The JPEG Interchange File Format specifies that all images must be stored top-down.) You can change the orientation of an image by modifying the ViewPerspective flag in the LEAD bitmap.

JPEG 2000 Compliant

LEADTOOLS COM object can load and save JPEG 2000 files. You can load 24-48 bit color images (images with 25-47 bits/pixel will be loaded as 48-bit). You can load 8-16 bit grayscale images. Images with 9-11 bits/pixel will be loaded as 12-bit while images with 13-15 bit are loaded as 16 bits/pixel.

You can save 24 and 48-bit color images and 8, 12 and 16-bit grayscale images.

LEADTOOLS supports JPEG2000 stream (J2K) and JP2 format files. LEADTOOLS supports the mandatory boxes of the JP2 format only.

4 and 1-bit Images

JPEG and LEAD CMP compression are intended for use with high resolution images, and they are impractical for use with 4- or 1-bit images.

You can use the CCITT, LEAD 1-bit, RLE, LZW, and ZIPLib compression methods available in many of LEADTOOLS supported formats.

8 and 24-bit Images

Using JPEG, JPEG2000 and LEAD CMP or CMW compression, color images are 24 bits per pixel, and grayscale images are 8 bits per pixel. Therefore, to compress an 8-bit color image, the internal JPEG, JPEG2000 and LEAD CMP or CMW compression functions must convert the 8-bit data into raw RGB 24-bit before compressing it as a color image.

Compressing the original 24-bit image will result in a smaller file size and higher quality than compressing an optimized 8-bit color image.

LEADTOOLS functions compress 8-bit grayscale as 8-bit grayscale JPEG or CMP images.

You can use RLE, LZW and ZIPLib (PNG) compression methods available in many of LEADTOOLS supported formats.


Super Compressed Bitmaps

(Document/Medical only) Super compressed bitmaps are kept compressed in memory. Only 24-bit, 8-bit, or 1-bit bitmaps can be kept super compressed. The memory requirements for super compressed bitmaps are greatly reduced compared to uncompressed bitmaps or RLE-compressed bitmaps.

The data access for super compressed bitmaps is usually slower, compared to uncompressed bitmaps. The compression used for 24-bit and 8-bit bitmaps is lossy, which means multiple changes to the bitmap can produce some visual loss.

The data access is usually slower for super compressed bitmaps, but there are situations in which the data access is faster than for uncompressed bitmaps. When dealing with very large bitmaps, the O/S might swap to disk the bitmap data. In this case, the access for uncompressed bitmaps can be a lot slower than for super compressed bitmaps.

Any application that deals with large bitmaps of tens or hundreds of MB should consider using super compressed bitmaps.

The BitmapCompression property can be read to determine the current bitmap's current compression. Setting this property will change the compression of the bitmap to super compress 1-bit, 8-bit, or 24-bit bitmaps, as well as, uncompress bitmaps and compress 1-bit bitmaps using RLE compression.

The size of the bitmap, in bytes, can be determined by reading the BitmapSize property.


Compressing and Decompressing Buffers

ABIC Compression:

LEADTOOLS provides functionality for compressing and decompressing ABIC images in buffers.

To begin the compression process, the EncodeABIC method must be called. This method compresses the input raw data to 1-bit bi-level or 4-bit grayscale data using the ABIC encoder.

To begin the decompression process, the DecodeABIC method must be called. This method decompresses the input 1-bit bi-level or 4-bit grayscale ABIC raw data using the ABIC decoder.


Using ISIS® to Scan Images

Using ISIS® to Scan Images (Document/Medical only)

IMPORTANT NOTICE CONCERNING SUPPORT FOR ISIS DRIVERS:

LEADTOOLS TOOLKITS CONTAIN SUPPORT FOR ISIS® DRIVERS USING PIXEL TRANSLATIONS RUNTIME (PIXDFLTN. DLL) VERSION NUMBER 55.1.260.832 OR EARLIER ALLOWING LEADTOOLS TO DIRECTLY INTERFACE WITH THE ISIS DRIVERS.

LEADTOOLS TOOLKITS DO NOT DIRECTLY COMMUNICATE WITH ISIS ® DRIVERS USING PIXEL TRANSLATIONS RUNTIME (PIXDFLTN) VERSION NUMBER 56.*.*.* OR HIGHER. A LEADTOOLS APPLICATION WHICH OPERATES PROPERLY WITH THE EARLIER VINTAGE ISIS DRIVERS WILL CEASE TO OPERATE PROPERLY IF THE OLDER ISIS DRIVER IS REPLACED WITH A NEWER ISIS DRIVER REQUIRING THE PIXEL TRANSLATIONS RUNTIME DLL VERSION NUMBER 56.*.*.* OR HIGHER.

ISIS is a standard used with certain scanners. First of all, to indicates whether ISIS® support DLLs are present use IsISISAvailable property. The software includes support for ISIS scanning one or more images through its LEADTOOLS ISISAcquire method and ISISAcquireMulti method, as long as you have an ISIS driver. (The software does not include ISIS Drivers). Prior to scanning however, you must use other methods, properties and events to prepare for scanning. IsISISAvailable first tells you if ISIS support DLLs are even available for you to use. If so, load the ISIS Scanner Driver using ISISLoadDriver method. ISISSelect method displays a dialog box that will let you select the desired ISIS driver, if there is more than one. You can also add new ISIS drivers using this dialog box. To set scanner options, use ISISSetScanOptions. The current driver is set in DriverName property. ISISGetTag method and ISISSetTag method help you determine the current settings for the scanner and will let you set new values for certain tags.

To scan a single image, you can use ISISAcquire method. This will set the ILEADRaster object with the bitmap created when the image was scanned. If you wish to scan more than one image, you may wish to set EnableISISEvent property to true so the ISISPage event will be called after each page is scanned. To scan more than one image use ISISAcquireMulti method. If you set the ScanAhead tag prior to scanning multiple images, PagesDiscarded will contain the number of pages discarded if scanning is canceled by setting EnableISISEvent to FALSE. Once you have finished with ISIS support, unload the ISIS driver using ISISUnloadDriver method.

For more information, refer to the individual entries for the properties, methods and events. You may also refer to ISIS Tags to learn more about the scanner settings and scanning options.

To Displays the ISIS Scan Options dialog box use ISISSetScanOptions method.

Note:

Please note that you must get the ISIS driver from the scanner manufacturer or from Pixel Translations. The .chn or .chw file must be in your path for ISIS scanning to work.

To specifies whether LEADTOOLS generates runtime exceptions, use EnableMethodErrors property


Image Processing

The following topics describe the kinds of image processing:

Examining and Altering Bitmaps

Managing Color Separations

Combining Images

Using the Windows API

Using Histograms

Working with the Alpha Channel


Examining and Altering Bitmaps

You can make many changes to the bitmap in memory, but keep in mind that the changes do not appear on the screen until the image repaints.

Getting Bitmap Information

Get information about the bitmap from the following properties and method:

BitmapBits property

BitmapBytesPerLine property

BitmapHeight property

BitmapWidth property

BitmapXRes property

BitmapYRes property

IsGrayscale property

IsSigned property

GetColorCount method

GrayscaleExt method

ConvertToColoredGray method

Getting and Setting Pixel Values

Use the following method to get and set the values of individual pixels:

Pixel property

Fill method

Changing the Data Format

Use the following methods to change the bits per pixel and palette of a bitmap or bitmap list:

ColorRes method

ColorResList method

Use the following methods to change a bitmap to 8-bit grayscale or to a 1-bit halftone:

Grayscale method

Halftone method

Bitmap data can be signed or unsigned. If the bitmap data is signed, image processing and paint functions may not work correctly. A bitmap will not be loaded signed unless the LoadSigned property is set to TRUE before loading the image. To determine whether the bitmap loaded into the control is signed or not, check the IsSigned property. If this property is TRUE, the bitmap data is signed and should be converted.

Image data can be changed from signed to unsigned and vice versa. Signed image data may contain some negative values. Converting data from signed to unsigned, and vice versa, will be done by shifting the image data or intensity values by a specific value. The ability to shift image data back and forth between signed and unsigned is often useful in medical or analytical applications.

To change image data from signed to unsigned, which is often done before applying image processing or analysis functions, there are the following options:

ConvertUnsignedToSigned shifts the image data based on internal aspects of the image.

ShiftMinimumToZero provides the user with the value by which the image data was shifted by updating the ShiftAmount property. This information can be used later, after image processing, to return the image to signed data.

Once signed images have been converted to unsigned images image processing or analysis can be performed on the unsigned images. (Most image processing methods work only on unsigned data.) When the image processing or analysis is complete, convert the unsigned data back to signed data.

To change image data from unsigned to signed, which is often done after applying image processing or analysis methods, there are the following options:

ConvertSignedToUnsigned shifts the image data based on internal aspects of the image.

ShiftZeroToNegative gives the user the ability to specify the amount by which to shift the image data, and dictates the minimum and maximum values that are output by the function.

Windows always uses the RGB color-space model, and when loading or saving a file, LEADTOOLS converts image data to or from RGB, as necessary. Nevertheless, LEADTOOLS lets you create and merge color separations using a number of color-space models, including RGB, CMYK, CMY, HSV, and HLS. Use the ColorSeparate method to create separations, use the ColorMerge method to merge separations, and use the ColorPlanes property to access the separated planes.

Updating the Line Profiles

LineProfile method

LineProfileSize property

LineProfileRed property

LineProfileGreen property

LineProfileBlue property

Doing Geometric Transformations

Geometric transformations include resizing, trimming, rotating, shearing, flipping, or reversing a bitmap. The following geometric transformation functions are designed mainly for document imaging:

AutoTrim method

Deskew method ( Document/Medical only)

DeskewExt method

DeskewExtAngle property

FastRotate method ( Document/Medical only)

Use the following method to resize the bitmap. Keep in mind that this changes the amount of memory required for the bitmap, and it is not necessary to do this for zooming in or out.

Size method

Use the following methods to alter a bitmap in various ways:

Trim method

Rotate method

Shear method

Flip method

Reverse method

LEADTOOLS also provides the TransformFile method for performing lossless flips, rotations and reversals. However, only certain file formats are supported at this time. This function provides better results than loading an image, transforming it using the Rotate method, Flip method or Reverse method and then resaving it. For each marker that the TransformFile method encounters within a file, the TransformMarker event is triggered. Within this event the user sets the WriteMarkerAction property to indicate what action to take with the marker. If the marker is to be written to the output file, the user calls the WriteMarker method.

Lightening, Darkening, Filtering, and So Forth

A number of image processing functions let you change the values of pixels across a bitmap (or a region in the bitmap) using various algorithms and filters. You might do this to improve the appearance of the image, to analyze details in the image, or to apply artistic effects. The following topics provide details:

Changing Brightness and Contrast

Removing Noise

Detecting and Enhancing Edges and Lines

Applying Artistic Effects

Correcting Colors

Using the Perlin method

Adding Another Image to a Bitmap

The Combine method lets you add all or part of another bitmap to the target bitmap. You can pass flags to control whether the new pixels simply replace the old ones or are combined with the old ones in a specified way. You can also define a region in the target bitmap, and if you do, the function affects only the specified region. For information about regions, refer to Creating and Using a Bitmap Region. For more information on combining images, refer to Combining Images.

The Underlay method also combines images, but it has a much more specific purpose. It combines two bitmaps so that one appears to be an underlying texture for the other.

Treating the bitmap as a device context opens up many possibilities You can set the DrawPersistence property to TRUE to draw text or objects on the bitmap. For details, refer to Drawing Simple Objects and Drawing Three-Dimensional Shapes and Text.

Also, the GetBitmapDC method lets you access the bitmap as a device context. You can then use Windows GDI functions to draw lines, text, or images on the bitmap. For more information, refer to Using the Windows API.

To replace an image with an image created from images in a specified directory, use the Picturize method.

Subtracting One Bitmap From Another

The DigitalSubtract method does not combine images, but subtracts the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps.

The ColorHalfTone method creates an enlarged halftone screen for each image channel. To creates a halftone screen effect for an image while keeping its continuous range of tones the HalfTonePattern method.

Extracting Bitmaps From A Series

The Slice method is designed to extract the individual slices from radiographic scanned film. For each slice segment found, an OnSliceBitmap Event is fired. Set the ContinueSlicing property to VARIANT_FALSE to stop the slicing operation. If you set the Slice method to perform a deskewing operation, call the SliceDeskewAngle property afterwards to determine how much the Slice method rotated the image.


Changing Brightness and Contrast

Basic Brightness and Contrast Functions

With the basic brightness and contrast functions you can change the intensity or contrast using a flat scale, or you can adjust the gamma correction. Gamma correction changes brightness using a logarithmic scale to account for visual perception. You can apply the basic brightness and contrast functions either to the display or to a bitmap.

To adjust the display, use the PaintGamma, PaintIntensity, PaintContrast properties. These properties affect the display of all bitmaps. They are not really part of the image processing group, because they do not affect the bitmap. Nevertheless, these properties can be useful when the need for brightness and contrast improvement is device-specific, rather than image-specific.

To change the brightness and contrast of a bitmap, use the following methods:

GammaCorrect method

GammaCorrectExt method

Intensity method

Contrast method

The HueSaturationIntensity method can be used to change the hue, saturation and brightness of all or specified colors in the image. This method combines the functionality found in the Hue, Saturation, and Intensity method methods and allows you to change the overall hue, saturation and intensity all at one time, or adjust the parameters separately, or make adjustments in successive passes.

The MathFunction method can be used to adjust the hue, saturation and brightness of an image by applying one of five mathematical functions to a bitmap’s pixel values: square, square root, log, sine, and cosine and then multiplying the results by specified factor.

The AdaptiveContrast method performs adaptive contrast enhancement (ACE) to areas that are originally low in contrast.

The ColorIntensityBalance method changes the distribution of the red, green, or blue channels.

The ContrastBrightIntensity method applies brightness, contrast and intensity adjustments to enhance the image tonal range.

The Multiply method can be used to increase or decrease the brightness in the bitmap, by multiplying the colors in the specified bitmap by a value equal to the uFactor value divided by 100. For example, if uFactor is 131 the colors in the specified bitmap will be multiplied by 1.31.

Histogram-Based Contrast Functions

Some image processing functions use an internally generated histogram for more sophisticated contrast improvements. The histogram is a table that reflects how many times each intensity value occurs in the bitmap.

The following high-level methods are based on histograms:

HistoContrast method

StretchIntensity method

HistoEqualize method

The HistoContrast method is similar to the ordinary Contrast method, except that it uses a bitmap-specific middle value. The ordinary contrast method raises all intensity values above 128 and lowers all values below 128. The HistoContrast method first finds the median intensity value in the bitmap. It then uses that median value, instead of 128, as the middle value. With either of these methods, you pass a parameter to indicate how much to increase the contrast.

The StretchIntensity method improves the contrast of a flat image, while preserving the original number of different intensity values. Other contrast methods, where you specify the increase, can lose values at the top and bottom of the scale. This method, instead, sets the lowest intensity value to 0 and the highest to 255, then remaps the original values proportionally. If the original values already range from 0 to 255, this method has no effect.

The HistoEqualize method is often the most effective function for bringing out hidden details through contrast improvement. Like the StretchIntensity method, it remaps the intensity values to use the full range of 0 to 255. But instead of remapping the values proportionally, it uniformly redistributes the values to balance the number of pixels across the range of intensities. Thus, clusters of similar intensity values in the original image are spread out, enabling you to see differences that were too subtle in the original.

The following elements let you create your own histogram-based function:

GetHistogram method

HistogramTable property

RemapIntensity method

RemapTable property

You can use the GetHistogram method to get a bitmap's histogram. You can then create a lookup table (RemapTable) based on the entries in the HistogramTable and call the RemapIntensity method to change the bitmap's intensities through the lookup table.

The intensity values are gray-level values. When changing the intensity values of a color image, the LEADTOOLS functions are actually changing the value of each color plane. The high-level methods automatically change the values of all planes, but if you create your own function, the decision is up to you. With the GetHistogram and RemapIntensity methods, you can manipulate an individual color plane, or you can manipulate all color planes by specifying the master channel.

For 12 or 16-bit grayscale images, use the GetHistogramGray method to get the bitmap's histogram. The HistogramGrayTable property and the HistogramGrayTableSize property provide information about the histogram itself.

The AutoColorLevel method darkens dark values and lightens light values, enhancing shadows and brightening the image automatically.

The ColorLevel method applies color leveling to an image. It changes the image's shadows, midtones and highlights.

With color images, you can preserve more natural colors by first using the ColorSeparate method to do an HSV separation. You can then manipulate the value plane and recombine the color planes with the ColorMerge method.

In HSV color space, a color is represented by a hue, saturation (amount of white) and a value (amount of darkness). These can be remapped using the RemapHue method. This method uses several tables in the remapping process. These are the HTable property, the MaskTable property, the STable property and the VTable property. To get or set the length of these tables used in the remapping process, use the RemapHueTablesSize property. To convert between the HSV and RGB color space, use the following:

HSV_HfromRGB method

HSV_SfromRGB method

HSV_VfromRGB method

RGBfromHSV method

The LightControl method lightens or darkens all or part of a bitmap by remapping the pixel values. This method remaps the pixel values of the bitmap across the full range of available pixel values, in order to achieve the new average values in the LightLowerAvr, LightAvr and LightUpperAvr properties.

The LocalHistoEqualize method linearizes the number of pixels locally in a bitmap, based on the specified color space. This can be used to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Special Functions

The SubtractBackground method is useful, especially with medical images and grayscale bitmaps, in correcting nonuniform brightness. This method uses a rolling ball algorithm to determine what points are background points. A small rolling ball radius identifies small objects and a larger radius identifies both large and small objects. Because frequently the resulting image is dim, this method includes the functionality similar to that of the Multiply method in order to include the capability for increasing the brightness of the final image.

Special Functions

The DynamicBinary method converts a bitmap into a black and white image without changing its bits per pixel by using a local threshold value for each pixel of the image.

The MultiScaleEnhancement method wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).


Removing Noise

One-Step Noise Removal

The following methods let you remove noise in one step:

Despeckle method ( Document/Medical only)

Median method

Average method

The Despeckle method is designed specifically for removing specks from 1-bit images, such as FAX transmissions or scanned documents.

The Median method is an effective general function for removing salt-and-pepper noise from any kind of image. You control the strength of the method by specifying the size of the neighborhood (the surrounding pixels used for calculating the median value). This method causes minimal blurring of the image.

The Average method can be used to remove uniform and Gausian noise, but there is more blurring of the image than with the median filter. You control the strength of the method by specifying the size of the neighborhood (the surrounding pixels used for calculating the arithmetic mean).

Use the AddWeightedBitmaps method to add or average a list of bitmaps based on weighting factors. The number of weighting factors involved are set in the FactorCount property and the weighting factor values are set in the Factor property.

The GaussianFilter methodsmoothes or blurs an image by applying a Gaussian filter to each pixel of the bitmap. The amount of blur is determined by the size of the neighborhood used by the method.

Creating Your Own Noise Removal Function

The following methods let you create your own function for noise removal:

BinaryFilter method ( Document/Medical only)

MaxFilter method ( Document/Medical only)

MinFilter method ( Document/Medical only)

The binary filters (for erosion and dilation of black objects) can be used for noise removal. The BinaryFilter method applies directional binary filters. The MaxFilter and MinFilter methods let you control the neighborhood size for erosion or dilation. One noise removal technique with these functions is to create two copies of a bitmap, apply a dilation filter to one of them and an erosion filter to the other, then combine the two using Combine with the CB_OP_AVG (averaging) flag. For more information on combining images, refer to Combining Images.

(Document/Medical only) The AutoBinary method transforms the bitmap into a binary image using a threshold calculated automatically based on statistical features of the bitmap. Best results are obtained with grayscale bitmaps.

[The Deinterlace method deinterlaces video source images by removing the black lines. It proceeds by merging lines in the image together and/or blending them together.

The SmoothEdges method smoothes the edges of a bitmap.

Fourier Transforms

Fourier Transforms are useful in removing harmonic noise like:

Herringbone patterns seen in video images

Sine wave patterns

Moiré patterns

Halftone patterns

Interference patterns

Fourier Transforms are also useful in removing noise from video signals and CCDs.

Fourier transforms convert an image from one where intensity varies over space into one where the intensity varies with frequency. After an image has been described (transformed) as a series of frequencies and phase, that information can then be analyzed using a power spectrum. The power spectrum is a two-dimensional map that plots the frequency of pixel intensity values. Low frequencies lie close to the origin and high frequencies close to the edges. From the analysis suitable filters can be applied to remove those parts of the image that correspond to the noise in the image. The image can then be retransformed back into the original image, only without the noise.

A Discrete Fourier Transform is a Fourier transform that uses a series which has values that have both a real and an imaginary component. Discrete Fourier transforms reveal periodicities in the data as well as the relative strengths of those periodicities.

Discrete Fourier Transforms can take a long time to compute. To reduce computing time, Fast Fourier Transforms can be used, which reduce the number of computations from 2N2 to 2N Lg N. However, using a Fast Fourier Transform requires that the number of points in the series be a power of 2.

The following functions provide Fourier transform capabilities:

InitFourierTransformation | Initialize Fourier Transform coefficients.
DiscreteFourierTransformation | Computes the Discrete Fourier Transform of an image or the Inverse Discrete Fourier Transform, whichever is specified.
FastFourierTransformation | Computes the Fast Fourier Transform of an image or the Inverse Fast Fourier Transform, whichever is specified.
FreeFourierTransformation | Frees the storage that was allocated by InitFourierTransformation
DisplayFourierTransformation | Converts the frequency harmonics amplitude or phase to a bitmap. It allows displaying the results of FFT and DFT as a bitmap.
FrequencyFilter | Filters the frequency harmonics according to the range rectangle.
FrequencyFilterMask | Creates a mask filter for use in removing specific frequency components from a bitmap.

The DynamicBinary method converts a bitmap into a black and white image without changing its bits per pixel.

The HighPassFilter method removes low frequency details in a bitmap, resulting in a sharpened image.


Detecting and Enhancing Edges and Lines

The following methods let you detect and enhance edges and lines:

EdgeDetector method

EdgeDetectorExt method

Sharpen method

SpatialFilter method

IntensityDetect method

UnsharpMask method

EdgeDetectEffect method can be used to detect the edges in a bitmap and then replace the values of the edges with calculated values.

The Sharpen method is designed specifically to emphasize the edges (shifts in intensity) in a bitmap. It is a high-level method that can be used alone for the desired effect.

The SpatialFilter method provides several predefined filters for detecting edges or lines. These filters can be used alone in applications, such as industrial inspection systems, that analyze images. They can also be used to create an image that is combined with the original to change the appearance of lines or edges.

Choosing a filter is a subjective, application-specific decision. The filters use standard algorithms, some of which have similar purposes. You may need to experiment with them to choose the appropriate filter for your application. The following is a summary of the available filters:

Filter | Purpose
Emboss | Creates an image with an embossed appearance. (This is used for artistic effect, but is listed here because it is one of the predefined filters.)
Gradient directional | Detects edges, starting from any of eight specified directions. All pixels not on the detected edges are changed to black.
Prewitt | Detects horizontal or vertical edges. All pixels not on the detected edges are changed to black.
Sobel | Detects horizontal or vertical edges. All pixels not on the detected edges are changed to black. (The usage is the same as Prewitt, but the algorithm is different.)
Shift-and-difference | Detects horizontal, vertical, or diagonal edges. All pixels not on the detected edges are changed to black.
Laplacian | Detects lines. There are three omnidirectional filters and three bi-directional ones. All pixels not on the detected lines are changed to black.
Line-segment | Detects line segments. Possible directions are horizontal, vertical, left-to-right diagonal, and right-to-left diagonal. You can use this filter to find line discontinuities in an image. All pixels not on the detected line segments are changed to black.

To overcome the directional limitations of these filters, you can combine images that have been filtered in different ways. For example, you could make three copies of a bitmap, filter each one with a different Laplacian directional filter, and use the Combine method to create a bitmap with all of the detected lines. You could then combine this resulting bitmap with the original to enhance the lines in the original. For more information on combining images, refer to Combining Images.

The IntensityDetect method does not use a filter to detect edges or lines, but for some images it is more effective than the filters in detecting lines that are lighter or darker than other parts of the image.

The Skeleton method can be used to find the skeleton of regions or objects in a binary bitmap. The white color represents the objects and the black color represents the background. If the bitmap is not 1-bit image, the threshold will be used to transform the bitmap into a binary image before finding the skeleton.

The ContourFilter method applies a contour segment filter to the bitmap, creating a "contour map" of the bitmap.

The EdgeDetectStatistical method can be used to detect the edges in a bitmap by applying a statistical filter that analyzes the variations of colors in all directions around each pixel.

The GlowFilter method can be used to make the colored edges in a bitmap shine with a neon-like glow.

The SmoothEdges method can be used to smooth the rough edges in a bitmap.

The EdgeDetectStatistical method can be used to detect the variation of colors in the specified direction using statistical indices. It is similar to EdgeDetectStatistical method, but this method allows you to specify the direction angle.

The EdgeDetectEffect method performs edge detection on the image.


Applying Artistic Effects

The following methods are designed specifically for artistic effects:

AddNoise method

AddShadow method

Aging method

Bending method

BricksTexture method

BumpMap method

Clouds method

ColoredBall property

ColoredBallsCount property

ColoredBalls method

ColoredPencil method

Cubism method

Cylindrical method

DiceEffect method

DiffuseGlow method

DisplaceMap method

DrawStar method

Dry method

Emboss method

FreeHandShear method

FreeHandWave method

FreePlaneBend method

FreeRadBend method

FunctionalLight method

GlassEffect method

GlowFilter method

Impressionist method

LensFlare method

Light method

LightControl method

MaskConvolution method

Mosaic method

MosaicTiles method

MotionBlur method

Ocean method

Oilify method

Perlin method

Pixelate method

Plane method

PlaneBend method

PlasmaFilter method

Pointillist method

Polar method

Posterize method

Punch method

PuzzleEffect method

RadialBlur method

RadWave method

RemoveRedeye method

RevEffect method

RingEffect method

Ripple method

RomanMosaic method

SampleTarget method

Segment method

SmoothEdges method

Solarize method

Spherize method

Swirl method

TextureAlphaBlend method

Tunnel method

Underlay method

Vignette method

Wave method

Wind method

ZigZag method

ZoomBlur method

ZoomWave method

With any of these methods, except Underlay, you can limit the effect to a specified region of interest. For information about regions, refer to Creating and Using a Bitmap Region.


Correcting Colors

The following methods are designed specifically for adjusting colors in an image:

AdjustTint method

AntiAlias method

ApplyMathLogic method

AutoColorLevel method

BalanceColors method

BlueGamma property

BlueMaxInput property

BlueMaxOutput property

BlueMinInput property

BlueMinOutput property

ColorIntensityBalance method

ColorizeGray method

ColorLevel method

ColorReplace method

ColorThreshold method

GreenGamma property

GreenMaxInput property

GreenMaxOutput property

GreenMinInput property

GreenMinOutput property

Hue method

HueSaturationIntensity method

Invert method

MasterGamma property

MasterMaxInput property

MasterMaxOutput property

MasterMinOutput property

RedGamma property

RedMaxInput property

RedMaxOutput property

RedMinInput property

RedMinOutput property

Saturation method

SelectData method

SelectiveColor method

SelectiveColorBlack property

SelectiveColorCyan property

SelectiveColorMagenta property

SelectiveColorYellow property

ShiftData method

SwapColors method

ChannelMix method | Rebalances the colors in a bitmap in order to make color adjustments and to correct images which have more color than others.
SampleTarget method | Corrects color values by shifting the sample colors to the target colors.


Using the Perlin Method

The Perlin noise method was developed in the 1980s by Ken Perlin, who was working with procedural textures. He wanted to create a method that would appear to be random, but that when supplied the same input would always produce the same output, and that would feature smooth transitions between values. Ken Perlin would later win an Oscar for this work.

The Perlin method uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture. When using the Perlin method, the general process is as follows:

1. | Open any image.
2. | Use the Perlin method to create a Perlin noise. The following figures show various Perlin noise shapes resulting from the use of various flags. For these figures, the following values were also used:

lSeed = 0;
lFrequency = 16;
lDensity = 8;
lOpacity = 75;
crBackColor = RGB(0, 0, 0);
crPerlinColor = RGB(255, 0, 0);
lxCircle = image.Width / 2;
lyCircle = image.Height / 2;
lFreqLayout = 100;
lDenLayout = 1;

First: using PRL_CIRCLE:

1) PRL_PURE

2) PRL_COMBINE

3) PRL_DIFFERENCE

Second: using PRL_LINE:

1) PRL_PURE

2) PRL_COMBINE

3) PRL_DIFFERENCE

Third: using PRL_RANDOM:

1) PRL_PURE

2) PRL_COMBINE

3) PRL_DIFFERENCE

The Clouds method also makes use of Perlin noise.


Grayscale Images

LEADTOOLS provides a number of method for working with grayscale images. Many of these method work on either grayscale images or color images. Some of the LEADTOOLS functions however, are designed specifically for use with grayscale images, either creating a grayscale image, getting information about a grayscale image, or window leveling.

Creating and working with grayscale images

A color image can be converted to a grayscale image using the GrayScale method. The GrayScaleExt method converts an image to a grayscale image, but provides the user the ability to control the calculation of the grayscale pixel value by giving the R, G and B components different "weights" when calculating the grayscale value.

LEADTOOLS also provides the ConvertToColoredGray method which converts a bitmap into a grayscale bitmap, while allowing the user to add color effects. This creates an image with an "old-fashioned" look. An 8, 12 or 16-bit grayscale can also be colorized using ColorizeGray method.

(Medical only) The ShiftData method selects a specified number of bits from an 8, 12 or 16-bit grayscale bitmap into a mask and places the mask in a new 8, 12 or 16-bit grayscale bitmap. The SelectData method selects a specified number of bits of an 8, 12 or 16-bit grayscale bitmap and puts them into a mask, then colors the bitmap depending on the mask. This can show bitmap variances depending on user-defined conditions.

The BitmapAlpha property lets you get or set the alpha channel information of an image.

The GrayScaleToDuotone method converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with new colors.

The GrayScaleToMultitone method converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with one or more new colors.

The Desaturate method converts the image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

When working with grayscale images, a LookUp Table (LUT) may be used to remap pixel values. The UseLUT property determines when the LUT is used. If the UseLUT property is TRUE, then the LUT is used in all image processing methods and when saving an image. If the UseLUT property is FALSE, the LUT is used only when painting the image. The UseLUT property is used primarily with 12 and 16-bit grayscale images, and may be used in association with window leveling. For more information on window leveling, refer to the "Window Leveling" section given below.

Changing the Highlight pen and Cursor Style (Document/Medical only)

When working with grayscale images containing many midrange grays, the user may find that both the highlight pen and the cursor are difficult to see properly. In such cases, the user should set the AnnAutoHilightPen property and the AnnAutoCursor property. These two functions let the user set the default highlight pen color, used in drawing and selecting, and the cursor, respectively. By changing the default highlight pen color and the cursor style, the user can greatly improve highlight and cursor visibility.

Getting information about grayscale images

LEADTOOLS also provides method for getting information about grayscale images. The GetMinMaxBits method provides information on the minimum and maximum bit set in a 12 or 16 - bit grayscale image. The GetMinMaxVal method gets the minimum and maximum intensity values present in a 12 or 16-bit grayscale image. Please note that support for 12 and 16-bit grayscale images is only available in Document/Medical toolkits.

To determine the kind of grayscale palette associated with a bitmap, if any, check the IsGrayScale property.

Window leveling (Document/Medical only)

Window leveling is only valid for 12 and 16-bit grayscale images and is used to map grayscale intensities by specifying the bit range and/or a user defined color map. The bit range is specified by LevelLowBit property and LevelHighBit property. The user defined color map is defined by LevelLUT property. LevelLowBit property, LevelHighBit property and LevelLUT property will only affect the way the image is painted and will not affect the image data. To affect the image data, you must call the WindowLevel method. The WindowLevelBitmap property determines whether the WindowLevel method creates a new 8 or 24-bit bitmap, or leaves the bitmap as a 12 or 16-bit grayscale. The WindowLevel method applies window leveling to the bitmap, and resets LevelLowBit property, LevelHighBit property, LevelLUTLength property and LevelLUT property if a new 8 or 24-bit bitmap is created. LevelLowBit property and LevelHighBit property indicate which bits are considered image data. LevelLUT is a remapping palette that provides the colors to use when remapping the image. MinBit property, MaxBit property, MinVal property and MaxVal property can aid in setting up the LevelLUT by providing information concerning the bitmap. These values are retrieved using GetMinMaxBits method and GetMinMaxVal method. You can set the values for the MinBit and MaxBit of the bitmap data using the SetMinMaxBits method. For more information, refer to the individual entries for the properties and methods. Window leveling applied with the WindowLevel method can be saved to TIF or DICOM formats without changing the bitmap data. For more information, refer to Saving Window-Leveled Bitmaps.


Converting 16-bit Grayscale Values

If you want to use a 16-bit grayscale value in a non LEADTOOLS procedure, you need to convert the value as follows:

COLORREF color;
unsigned char gray;

color = Pixel(x,y);
if (color & COLORREF_GRAY16)
{ /*non standard colorref value, convert it to a windows COLORREF
get an 8 bit gray value corresponding to the 16 bit gray value */
gray = (color & 0xFFFF) >> 8;
/* use the standard windows RGB macro to get a windows COLORREF */
color = RGB(gray, gray, gray);
}

Please note that this is pseudocode and will have to be modified to suit the compiler you are using.


Cleaning Up 1-Bit Images

(Document/Medical) Scanned documents often contain a number of undesirable elements, including dots, blobs, lines, borders and hole punches. LEADTOOLS provides a number of properties, methods and events that will improve the appearance of scanned documents by removing dots, blobs, lines, borders, hole punches, inverted text, bumps and nicks. The properties and methods are listed below:

BorderRemove method

DocCleanSuccess property

hDocCleanRgn property

DotRemove method

HolePunchRemove method

InvertedText method

LineRemove method

Smooth method

The methods listed above each takes a number of parameters that control the performance of the corresponding removal process. Included in the parameters is a set of flags that allows you to obtain a LEAD region or a Windows region that contains all the elements removed from a document. For each element found by one of the removal methods, a corresponding event is triggered. if the EnableDocCleanEvents property is set to TRUE. These events provide a means of customizing the removal process, as well as creating your composite of the removed regions. These events are given below:

BorderRemove event

DotRemove event

HolePunchRemove event

InvertedText event

LineRemove event

Smooth event


Detecting Registration Marks

When a user scans a form, perturbations or transformations are added to the image such as rotation, zooming, reduction, and translation (shifting in position). These effects make it difficult to identify the different parts of the form, complicating the detection and recognition phases.

Registration marks can be used to help identify and localize the different parts of the form. Registration marks are predefined shapes that are added to the original form in specific locations. These marks can then be used to identify the transformations or deformation added to the original form, and then to correct a scanned form’s orientation and resize it to its original size.

Currently, there is only one type of registration mark that has been defined for use with scanned forms (more are to be added later). The valid registration mark is a T-shaped figure as shown in the following figure. It is a "T" rotated by 90 degrees counter clockwise. The P4 point must be on the center point of Line P1P2 (that is, the distance from P1 to P4 equals the distance from P2 to P4). The line width should be greater than 2 pixels(preferably 3 pixels). There are no conditions on line lengths since you provide the values for lWidth, lHeight, lMaxScale, and lMinScale. Use the IsRegistrationMark method to ensure the selected mark is a valid registration mark.

Currently, to be used with the registration marks methods a document image must consist of white objects on a black background.

To use the registration methods, begin with creating the reference document that contains the registration marks in the exact positions on the form that will be used for scanning. The registration marks should be placed in different areas of the form far enough apart on the form that good triangulation can be performed – but not where they would not always appear on the form in their entirety when the form is scanned. The registration methods are designed to use three designated registration marks as reference points. A sample reference form (reduced in size) is shown in the following figure:

After creating the reference document, scan it to obtain a document image. The reference document must be scanned in perfectly: any documents using the reference document for registration will be transformed to match its size, shifting, and rotation exactly.

The registration methods work by finding the (X, Y) positions of three labeled points and comparing them with the positions of these points on the scanned image. With that information it is possible to determine the shifting, rotation and scaling of the scanned image (6 equations with 5 unknowns). The unknowns are:

Shifting along the X-axis

Shifting along the Y-axis

Scaling on the X-axis

Scaling on the Y-axis

Rotation angle.

On the example form, registration marks have been placed in five locations on the form. Three of these marks are to be selected and the other two ignored (the registration functions use the three locations on the form in order to solve the equations). Select three registration marks.

For each registration mark, designate the searching area for that mark, and specify the maximum allowable shift, rotation and scaling. Each searching area should contain only one registration mark and it is preferable that the mark be located in an otherwise blank portion of the form. This information is designated using the following properties:

Type property | RGS_T
Width property | Registration mark’s width, in pixels.
Height property | Registration mark’s height, in pixels.
MinScale property | Minimum registration mark percentage scaling to be detected.(for example, 90,85, or 75 …etc)
MaxScale property | Maximum registration mark percentage scaling to be detected. (for example, 110,120, or 125 …etc)
Top property | specify the Top of the area to be searched for registration marks (in pixels).
Left property | specify the Left of the area to be searched for registration marks (in pixels).
Bottom property | specify the Bottom of the area to be searched for registration marks (in pixels).
Right property | specify the right of the area to be searched for registration marks (in pixels).
NumberOfExpectedMarks property | Number of expected registration marks inside the search area. Set this to 1. (Since there must be one registration mark inside each area.)
DetectectedMarkCount property | specify the number of detected registration marks inside the search area.
DetectedMarkPointX property | determine X coordinate location of the detected registration marks.
DetectedMarkPointY property | determine Y coordinate location of the detected registration marks.

With this property you can use the GetMarksCenterMass method to compute the center of mass for each of these marks.

Now you can scan forms and correct their orientation and size. The figure below shows a sample scanned form (reduced in size) with noticeable skew:

The next step is to search for the registration marks in the scanned image. Use the SearchRegMarks method on the scanned image to find the registration marks. If all of the registration marks were detected then use the GetMarksCenterMass method to compute the center of mass for each registration mark.

The next step is to determine the shifting, scaling and rotation necessary to re-orient the scanned image. To do this, Fill the ReferencePointsX and ReferencePointsY properties as well as the TransformedPointsX and TransformedPointsY before calling the GetTransformationParameters method.

To re-orient and resize the scanned image so it is like the reference image, use the values in the XTranslation, YTranslation, TransformationAngle, Xscale and Yscale properties in the ApplyTransformationParameters method. This is equivalent to shifting the image using CombineExt, rotating the image using Rotate, and scaling the image using Size.(Note: It is important to do the operations in this order. You will get an incorrect result if you change the order.) The following figure (reduced in size) shows the scanned form after it has been re-oriented and re-sized:


Drawing Shapes and Text

You can draw simple lines, rectangles, or ellipses using methods and properties that implement standard Windows drawing functions. The available drawing modes, pen styles, and fill styles make it easy to use these methods and properties with the MouseMove event for interactive drawing for LEADRasterView Control. For these methods and properties, refer to Drawing Simple Objects.

You can also draw more sophisticated three-dimensional shapes and text. However, it is not a good idea to draw these shapes and text objects in the MouseMove event, because they do not support the inverted draw mode that lets you effectively erase an old object before drawing a new one. For these methods and properties, refer to Drawing Three-Dimensional Shapes and Text.

You can draw any of the shapes or text objects in the client area of the LEADRasterView control or directly on the bitmap.


Drawing Simple Objects

You can draw a line, rectangle, or ellipse on the current bitmap or on the screen. Whether you draw to the bitmap or to the screen, drawing objects and text strings are always positioned in the LEADRasterView control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

Use the following property to specify whether to draw on the bitmap or the screen:

DrawPersistence property

Use the following properties to specify object styles and colors:

DrawMode property

DrawPenColor property

DrawPenStyle property

DrawPenWidth property

DrawFillColor property

DrawFillStyle property

Use the following methods to draw objects:

DrawLine method

DrawRectangle method

DrawEllipse method


Drawing Three-Dimensional Shapes and Text

You can draw a variety of three-dimensional shapes and text objects in the LEADRasterView control's client area or directly on the bitmap. Possible shapes are stars, rectangles, triangles, and so forth. For a complete list, refer to the DrawShape method. The text objects can be rotated to any angle, specified in tenths of degrees.

For shapes and text:

The following property determines whether the shape or text object is drawn to the control's client area or to the bitmap:

DrawPersistence property

The following properties specify the color and offsets that apply a drop shadow to the shape or text object:

ShadowColor property

ShadowXDepth property

ShadowYDepth property

To turn off the shadow, set the X and Y depths to 0.

With text objects, the drop shadow is disabled with some styles, as shown in the following examples: Style with a Shadow and Style without a Shadow.

For shapes only:

Use the following method (with related properties) to draw a specified shape.

DrawShape method

The following properties specify the position and size of the shape:

PerspectivePointsX property

PerspectivePointsY property

ShapeLeft property

ShapeTop property

ShapeWidth property

ShapeHeight property

Use the following method gives a bitmap a 3-D effect, as if it exists on a flat plane and has been skewed into a different shape

Perspective method

The following property specifies the background style of the shape:

ShapeBackgroundStyle property

The following properties let you specify a pattern or solid color:

PatternStyle property

PatternBackColor property

PatternForeColor property

The following example shows how a fill pattern can be implemented: Shape with a Fill Pattern and Drop Shadow.

If the shape uses an image as its background, the following properties specify the source rectangle that defines which part of the bitmap to use for the background:

BackgroundImageHeight property

BackgroundImageLeft property

BackgroundImageTop property

BackgroundImageWidth property

The following properties specify the primary lines of the shape:

ShapeBorderColor property

ShapeBorderStyle property

ShapeBorderThickness property

The following properties specify the inner and outer bands that give the lines of the shape a three-dimensional appearance:

ShapeInnerBandHiliteColor property

ShapeInnerBandShadowColor property

ShapeInnerBandStyle property

ShapeInnerBandThickness property

ShapeOuterBandHiliteColor property

ShapeOuterBandShadowColor property

ShapeOuterBandStyle property

ShapeOuterBandThickness property

Inner bands apply only to rectangles and squares (not other shapes). The three-dimensional effects are most effective when you specify the inner band or outer band (but not both), as shown in the following examples: Inner band raised, Inner band inset, Outer band raised, and Outer band inset.

For text only:

Use the following method (with related properties) to draw a text object:

DrawText method

You can create an image that consists of a pattern or gradient color to use as a foreground of the text. Refer to Gradients and Patterns for related properties.

The following properties specify the bounding rectangle for the text object and the alignment of the text object in the rectangle:

TextLeft property

TextTop property

TextWidth property

TextHeight property

TextAlign property

The following properties specify the font and style of the text object:

Font property

DrawFontColor property

TextStyle property

TextWordWrap property

TextAngle property

TextHiliteColor property

Use the following methods to get the width and height that are required for a specified text string using the current property settings for text objects:

DrawTextHeight method

DrawTextWidth method

These methods measure a single line of text (rotated or unrotated). They disregard the TextWordWrap property.

Use the following properties to assign the source/destination drawing area

DstLeft property

DstTop property

DstRight property

DstBottom property

SrcLeft property

SrcTop property

SrcRight property

SrcBottom property

ScaleMode property

ClientSizeX property

ClientSizeY property


Combining Images

Use the following methods to combine images from two bitmaps:

AlphaBlend method

Combine method

CombineBitmapWarp method

CombineExt method

FeatherAlphaBlend method

Underlay method

Canvas method

To combine image data from the source bitmap (the slave) into the destination bitmap (master) using a perspective warp, use the CombineBitmapWarp method. If you want to specify the areas to be combined, the operations to be performed when combining the data, and which color planes (R or G or B or R, G, and B) are used, use the CombineExt method.

Use the following methods to add or average the bitmaps:

AddBitmaps method

Fragment method

Use the following method to create a fade mask bitmap:

CreateFadedMask method

Use the following methods to picturize the bitmap:

PicturizeBitmapList method

PicturizeSingle method

Use the following method to replace an image with an image created from images present in a specific directory:

Picturize method

Use the following method to Shifts the bitmap pixels horizontally and vertically.

Offset method


Flags for the Combine Method

The following are the flags that define treatment of the source rectangle:

Value | Meaning
CB_SRC_NOP | No change.
CB_SRC_NOT | Invert the color, resulting in its complement.
CB_SRC_0 | Change all bits to 0.
CB_SRC_1 | Change all bits to 1.

The following are the flags that define treatment of the destination rectangle:

Value | Meaning
CB_DST_NOP | No change.
CB_DST_NOT | Invert the color, resulting in its complement.
CB_DST_0 | Change all bits to 0.
CB_DST_1 | Change all bits to 1.

The following are the flags that define the operation to use when combining the data:

Value | Meaning
CB_OP_AND | Combine each set of bytes using a bitwise AND (&).
CB_OP_OR | Combine each set of bytes using a bitwise OR ( | ).
CB_OP_XOR | Combine each set of bytes using a bitwise exclusive OR (^).
CB_OP_ADD | Add the byte values, allowing a maximum of 255.
CB_OP_SUBSRC | Subtract the source from the destination, allowing a minimum of 0.
CB_OP_SUBDST | Subtract the destination from the source, allowing a minimum of 0.
CB_OP_MUL | Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * dest) / 255.
CB_OP_DIVSRC | Divide the destination by the source. If source > 0, then the result is calculated as follows: result = min( (dest / source) * 255, 255 ). Otherwise, if source = 0, then result = 255.
CB_OP_DIVDST | Divide the source by the destination. If dest > 0, then the result is calculated as follows: result = min( (source / dest) * 255, 255 ). Otherwise, if dest = 0, then result = 255.
CB_OP_AVG | Use the average of the two values.
CB_OP_MIN | Use the lesser of the two values.
CB_OP_MAX | Use the greater of the two values.

The following are the flags that define treatment of the resulting image rectangle:

Value | Meaning
CB_RES_NOP | No change.
CB_RES_NOT | Invert the color, resulting in its complement.
CB_RES_0 | Change all bits to 0.
CB_RES_1 | Change all bits to 1.


Flags for the CombineExt Method

Flags for the CombineExt method

Note:

Arithmetic calculations in this table assume 24-bit image data.

The following are the flags that define treatment of the source rectangle:

Value | Meaning
CB_SRC_NOP | No change.
CB_SRC_NOT | Invert the color, resulting in its complement.
CB_SRC_0 | Change all bits to 0.
CB_SRC_1 | Change all bits to 1.

The following are the flags that define treatment of the destination rectangle:

Value | Meaning
CB_DST_NOP | No change.
CB_DST_NOT | Invert the color, resulting in its complement.
CB_DST_0 | Change all bits to 0.
CB_DST_1 | Change all bits to 1.

The following are the flags that define the operation to use when combining the data:

Value | Meaning
CB_OP_AND | Combine each set of bytes using a bitwise AND (&).
CB_OP_OR | Combine each set of bytes using a bitwise OR ( | ).
CB_OP_XOR | Combine each set of bytes using a bitwise exclusive OR (^).
CB_OP_ADD | Add the byte values, allowing a maximum of 255.
CB_OP_SUBSRC | Subtract the source from the destination, allowing a minimum of 0.
CB_OP_SUBDST | Subtract the destination from the source, allowing a minimum of 0.
CB_OP_MUL | Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * dest) / 255.
CB_OP_DIVSRC | Divide the destination by the source. If source > 0, then the result is calculated as follows: result = min( (dest / source) * 255, 255 ). Otherwise, if source = 0, then result = 255.
CB_OP_DIVDST | Divide the source by the destination. If dest > 0, then the result is calculated as follows: result = min( (source / dest) * 255, 255 ). Otherwise, if dest = 0, then result = 255.
CB_OP_AVG | Use the average of the two values.
CB_OP_MIN | Use the lesser of the two values.
CB_OP_MAX | Use the greater of the two values.
CB_OP_ABSDIF | Calculate the absolute difference between the two values.

The following are the flags that define treatment of the resulting image rectangle:

Value | Meaning
CB_RES_NOP | No change.
CB_RES_NOT | Invert the color, resulting in its complement.
CB_RES_0 | Change all bits to 0.
CB_RES_1 | Change all bits to 1.

The following are the flags that define the channel of the source image rectangle:

Value | Meaning
CB_SRC_MASTER | perform operation on all Channels.
CB_SRC_RED | perform operation on Red Channel.
CB_SRC_GREEN | perform operation on Green Channel.
CB_SRC_BLUE | perform operation on Blue Channel.

The following are the flags that define the channel of the destination image rectangle:

Value | Meaning
CB_DST_MASTER | perform operation on all Channels.
CB_DST_RED | perform operation on Red Channel.
CB_DST_GREEN | perform operation on Green Channel.
CB_DST_BLUE | perform operation on Blue Channel.

The following are the flags that define the channel of the resulting image rectangle:

Value | Meaning
CB_RES_MASTER | perform operation on all Channels.
CB_RES_RED | perform operation on Red Channel.
CB_RES_GREEN | perform operation on Green Channel.
CB_RES_BLUE | perform operation on Blue Channel.


Flags for the ApplyMathLogic method

The following flags indicate the channel that will be used:

Value | Meaning
CHANNEL_MASTER | [0x00000000] All channels.
CHANNEL_RED | [0x00000001] Red channel only.
CHANNEL_GREEN | [0x00000002] Green channel only.
CHANNEL_BLUE | [0x00000003] Blue channel only.

The following flags indicate how to treat the color value:

Value | Meaning
AML_VALUE_NOP | [0x00000000] No change.
AML_VALUE_NOT | [0x00000010] Invert the color, resulting in its complement.
AML_VALUE_0 | [0x00000020] Change all bits to 0.
AML_VALUE_1 | [0x00000030] Change all bits to 1.

The following flags indicate the mathematical operation to use. The operations are performed between each component (R, G and B) and iFactor:

Value | Meaning
AML_OP_AND | [0x00000000] Combine each pixel component value and iFactor using a bitwise AND (&).
 | (pixel = pixel & iFactor)
AML_OP_OR | [0x00000100] Combine each pixel component value and iFactor using a bitwise OR (|).
 | (pixel = pixel | iFactor)
AML_OP_XOR | [0x00000200] Combine each pixel component value and iFactor using a bitwise XOR (^).
 | (pixel = pixel ^ iFactor)
AML_OP_ADD | [0x00000300] Add pixel component value to the iFactor clamping the result to the maximum allowed pixel value.
 | (pixel = min(pixel + iFactor, MAX_PIXEL_VALUE) )
AML_OP_SUBFACT | [0x00000400] Subtract each pixel component value from the iFactor, clamping the result to the allowed pixel range.
 | (pixel = min(max(iFactor - pixel, MIN_PIXEL_VALUE), MAX_PIXEL_VALUE) )
AML_OP_SUBVALUE | [0x00000500] Subtract iFactor from each pixel component value, clamping the result to the allowed pixel range
 | (pixel = min(max(pixel – iFactor), MIN_PIXEL_VALUE, MAX_PIXEL_VALUE) )
AML_OP_ABSDIF | [0x00000600] Calculate the absolute difference between iFactor and each pixel component value.
 | (pixel = abs(pixel – iFactor))
AML_OP_MUL | [0x00000700] Multiply each pixel component value by nFactor/100.
 | (pixel = pixel * iFactor / 100)
AML_OP_DIVFACT | [0x00000800] Divide each pixel component value by nFactor/100. An error will be returned if iFactor = 0.
 | (pixel = pixel * 100 / iFactor)
AML_OP_DIVVALUE | [0x00000900] Divide iFactor by each pixel values. If the pixel values are 0, the result set to maximum allowed pixel value. (pixel = pixel ? min(iFactor / pixel, MAX_PIXEL_VALUE) : MAX_PIXEL_VALUE)
AML_OP_AVG | [0x00000A00] Use the average of the each pixel component value and iFactor.
 | (pixel = (pixel+iFactor) / 2).
AML_OP_MIN | [0x00000B00] Use the lesser of the pixel component values and iFactor:
 | (pixel = min(pixel, iFactor) )
AML_OP_MAX | [0x00000C00] Use the greater of the pixel component values and iFactor:
 | (pixel = max(pixel, iFactor) )

The way MIN_PIXEL_VALUE and MAX_PIXEL_VALUE are calculated depends on the bits per pixel and whether the bitmap is signed or unsigned:

if bitmap is unsigned (most common):

MAX_PIXEL_VALUE will be : 255 (8-bit), 4095 (12-bit) or 65535 (16-bit)

MIN_PIXEL_VALUE = 0

if the bitmap is signed (rare case):

MAX_PIXEL_VALUE will be : 127 (8-bit), 2047 (12-bit) or 32767 (16-bit)

MIN_PIXEL_VALUE will be -128 (8-bit), -2048 (12-bit) or -32768 (16-bit)

The following flags indicate how to treat the output value:

Value | Meaning
AML_RES_NOP | [0x00000000] No change.
AML_RES _NOT | [0x00001000] Invert the color, resulting in its complement.
AML_RES _0 | [0x00002000] Change all bits to 0.
AML_RES _1 | [0x00003000] Change all bits to 1.

If the lFlags is AML_OP_AND, AML_OP_OR, AML_OP_XOR, AML_OP_ADD, AML_OP_MIN, AML_OP_MUL, AML_OP_MAX, AML_OP_DIVVALUE , or AML_OP_SUBVALUE, the valid range of iFactor is:

From MIN_PIXEL_VALUE to MAX_PIXEL_VALUE.

For uFlags equal to AML_OP_SUBFACT, AML_OP_DIF, AML_OP_AVG, the valid range of iFactor is:

From 2 * MIN_PIXEL_VALUE to 2 * MAX_PIXEL_VALUE.


List of Spatial Filters

The following is a list of the predefined spatial filters that can be applied using the SpatialFilter method:

Value | Meaning
FLT_EMBOSS_N FLT_EMBOSS_NE FLT_EMBOSS_E FLT_EMBOSS_SE FLT_EMBOSS_S FLT_EMBOSS_SW FLT_EMBOSS_W FLT_EMBOSS_NW | Creates an image with an embossed appearance. (This is used for artistic effect, but is listed here because it is one of the predefined filters.) Choose the appropriate value for the direction of the effect.
FLT_GRADIENT_N FLT_GRADIENT_NE FLT_GRADIENT_E FLT_GRADIENT_SE FLT_GRADIENT_S FLT_GRADIENT_SW FLT_GRADIENT_W FLT_GRADIENT_NW | Detects edges using a Gradient directional filter. All pixels not on the detected edges are changed to black. Choose the appropriate value for the direction of the effect.
FLT_LAPLACE_1 FLT_LAPLACE_2 FLT_LAPLACE_3 FLT_LAPLACE_DIAG FLT_LAPLACE_HORZ FLT_LAPLACE_VERT | Applies Laplacian line detection. There are three omnidirectional filters and three bi-directional ones. All pixels not on the detected lines are changed to black.
FLT_SOBEL_HORZ FLT_SOBEL_VERT | Applies Sobel edge detection. All pixels not on the detected edges are changed to black. (The usage is the same as Prewitt, but the algorithm is different.) Choose the appropriate value for horizontal or vertical detection.
FLT_PREWITT_HORZ FLT_PREWITT_VERT | Applies Prewitt edge detection. All pixels not on the detected edges are changed to black. (The usage is the same as Sobel, but the algorithm is different.) Choose the appropriate value for horizontal or vertical detection.
FLT_SHIFTDIFF_DIAG FLT_SHIFTDIFF_HORZ FLT_SHIFTDIFF_VERT | Applies shift-and-difference edge detection. All pixels not on the detected edges are changed to black. Choose the appropriate value for diagonal, horizontal, or vertical detection.
FLT_LINESEG_HORZ FLT_LINESEG_VERT FLT_LINESEG_LTOR FLT_LINESEG_RTOL | Applies line segment line detection. You can use this filter to find line discontinuities in an image. All pixels not on the detected line segments are changed to black. Choose the appropriate value for horizontal, vertical, left-to-right diagonal, or right-to-left diagonal detection.


Managing Color Separations

Use the following methods to create color separations or to combine existing color separations:

ColorSeparate method

ColorMerge method

Use the following property to access the color separations:

ColorPlanes property


Printing an Image

Use the following method to print an image in any device context:

Render method

If you are using FoxPro or Access, you can use the following methods to get the device context of the printer and to control the print job.

PrintEnd method

PrintStart method

Use the following to get the printable dimensions of the default printer:

PrinterScaleHeight property

PrinterScaleWidth property

If you are using Visual Basic you can use the PrintNewPage method to eject a page and start a new page without ending the print job.


Using Histograms

The following elements let you create and use a histogram, which charts the intensity levels in a bitmap:

GetHistogram method

HistogramTable property

When working with 12 or 16-bit grayscale images, use the following to create a histogram and to determine the size of the histogram:

GetHistogramGray method

HistogramGrayTable property

HistogramGrayTableSize property

Please note that support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.


Using the Windows API

You can get the device context for the LEAD control's client area or for the bitmap in memory. Thus, you can use Windows API functions that require a device context. For example, you can use GDI drawing functions to add lines, shapes, or text to the bitmap.

Use the following methods to create and release a device context for the bitmap in memory:

GetBitmapDC method

ReleaseBitmapDC method

Use the following methods to create and release a device context for the LEAD control's client area:

GetClientDC method

ReleaseClientDC method


Image Optimization

LEADTOOLS provides functionality to optimize certain image file formats, by saving images using the optimal bits per pixel, based on specific optimization options. For more information about the file formats that can be optimized, refer to LEAD Image Optimizer Supported Formats.

To optimize an image buffer in memory use the OptimizeBuffer method.

To optimize an entire directory of images and save the optimized images to another directory, use the OptimizeDir method.

Both OptimizeBuffer and OptimizeDir, require optimization options for optimizing images. The user can get the default options by calling the DefaultOptions method.

Set the following properties in an ILEADOptimizeOptions object to customize the optimization options then pass this object to the OptimizeBuffer method.

JPEGQFactor property

PNGQFactor property

JPEGColorSpace property

Percent property

Distance property

PickSamePalette property

The DirectoryInfo property provides information about the image(s) being optimized. Use the following properties to get this information:

OrginalFileName property

OptimizedFileName property

StatusCode property

FilePercent property

TotalPercent property

TotalFolderFilesCount property

OptimizeOptions property


Creating and Using a Bitmap Region

A bitmap region is an area of interest within a bitmap. A bitmap can have only one region at a time, but the region can be complex, including, for example, multiple noncontiguous shapes.

When a bitmap has a region, the LEADTOOLS methods that modify the pixel values (for example Posterize method) act on the region, rather than the whole bitmap. For a list of these methods, refer to Raster Images: Where the Region Preempts the Bitmap.

In addition, the LEADTOOLS methods that flip, reverse, rotate, shear, or resize a bitmap also transform the region to match the bitmap. For example, if you were to shear a bitmap that had a rectangular region, the region would become a parallelogram. For a list of these methods, refer to Raster Images: Methods That Transform the Region and the Bitmap.

By default, a bitmap does not have a region. You can create a simple bitmap region using the RgnMarkingMode property, which automates region creation. You can create a more complex bitmap region by calling one or more of the SetRgn... methods. Each time you call one of these methods, you specify how the new region is to be added to the existing bitmap region (if there is one). For a description of the possibilities, refer to Flags for Setting a Region.

To create a new region, or update an existing region, based on either an HSV range or an RGB range, use SetRgnColorHSVRange method or the SetRgnColorRGBRange method. To convert between HSV and RGB color space, use the following:

HSV_HfromRGB method

HSV_SfromRGB method

HSV_VfromRGB method

RGBfromHSV method

Automatic Creation of a Region

Use the RgnMarkingMode property to enable automatic creation of a region, based on MouseDown, MouseMove, and MouseUp events. This method supports creation of a rectangle, rounded rectangle, ellipse, or freehand region. It automatically handles scaling differences between the displayed image and the bitmap. On the MouseDown event, it begins outlining where the region will appear on the screen. It updates the outline on each MouseMove event. Then, on the MouseUp event, it deletes the displayed outline and creates the bitmap region. To make an outline of the region visible at that point, you must set the RgnFrameType property.

RgnMarkingMode property

The following event occurs each time the bitmap region is created or updated. It is especially useful with the RgnMarkingMode property, which automates the creation of regions.

RgnChange event

Use the following property to display an outline of the current region:

RgnFrameType property

Creating and Using a Floater

A floater is an additional bitmap that is associated with the LEAD control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the LEAD control's client area.

The following property lets you create the floater bitmap by assigning the LEAD control's Bitmap property to it. The floater bitmap that this creates is the size of the bounding rectangle of the main bitmap's region, and it contains the same region as the main bitmap.

Floater property

The following property lets you display or hide the floater:

FloaterVisible property

If you want to paste a floater into a new position, you must assign the floater to a second LEAD control, move the first LEAD control's region to the floater's position, then use the Combine method to paste the second control's bitmap at that position. The region acts as a mask with the combine operation.

The following method lets you see whether a point in the LEAD control's client area is in the floater. It is commonly used in the MouseDown event to test whether the mouse click selects the floater.

IsPtInFloater method

Use the following methods to position and size the display of the floater by setting destination rectangles. These methods are commonly used in the MouseMove event to reposition the floater in the LEAD control's client area. If the floater is visible, its region is automatically repainted when you set the destination rectangle. If the AutoSetRects property is set to True, the destination rectangle defaults to the size of the floater bitmap, and the clipping rectangle defaults to the size of the LEAD control's client area. Therefore, you must set the destination rectangle to the desired position, but you do not have to set the clipping rectangle unless you want to display only part of the floater.

SetFloaterDstRect method

SetFloaterDstClipRect method

Use the following properties to get the current destination rectangles of the floater. (You can also set these properties, but the floater will repaint each time you set one of the properties.)

FloaterDstHeight property

FloaterDstLeft property

FloaterDstTop property

FloaterDstWidth property

FloaterDstClipHeight property

FloaterDstClipLeft property

FloaterDstClipTop property

FloaterDstClipWidth property

Use the following read-only properties to get the size of the floater bitmap:

FloaterHeight property

FloaterWidth property

If you want to paste a floater into a new position, you must assign the floater to a second LEAD control, move the first LEAD control's region to the floater's position, then use the Combine method to paste the second control's bitmap at that position. The region acts as a mask with the combine operation.

Storing, Retrieving, and Deleting Regions

Use the following methods to store a copy of the region from the floater or main bitmap, and to delete the stored region when you no longer need it. Keep in mind that the region data contains only positioning information, not the bitmap's pixel values.

GetFloaterHandle method

GetRgnHandle method

DeleteRgnHandle method

Use the following method to remove the current bitmap region and free the region data from memory:

FreeRgn method

Use the following method to add a stored region to the current bitmap region. You can either replace the current region or create a complex region by setting a Boolean flag that determines how the added region interacts with the existing region.

SetRgnHandle method

Getting Region Information

Use the following methods and properties to get information about the current bitmap region.

HasRgn property

IsPtInRgn method

GetRgnArea method

RgnHeight property

RgnLeft property

RgnTop property

RgnWidth property

Rows within a region can have 0, 1, or more segments per row. To get the segments contained within the region for a particular row, call the GetBitmapClipSegments method.

Low-Level Methods for Creating Regions

Use the following methods to add a new region to the bitmap. You can either replace the current region or create a complex region by setting a Boolean flag that determines how the added region interacts with the existing region. For a description of the possibilities, refer to Flags for Setting a Region.

The coordinates that you use with these methods are relative to the LEAD bitmap in memory, not to the client area.

These methods are for a new region with a simple shape:

SetRgnEllipse method

SetRgnRect method

SetRgnRoundRect method

This method is for a new region that consists of all pixels of a specified color:

SetRgnColor method

Use the SetRgnMagicWand method to set a region based on the color of a specified point. To create a region based on the color of a specified point and a range of tolerance values, use the SetRgnBorder method.

These methods are for a new polygonal region. You build an ordered array of points for the vertices of the polygon; then create the region based on the array. The PolygonSize property specifies the size of the array. You can either specify a large array to start with, or you can increase the size of the array when necessary (without losing the existing points).

PolygonSize property

PolygonX property

PolygonY property

SetRgnPolygon method

LEADTOOLS also provides a number of methods and properties for creating a curve region or adding a curve region to an existing bitmap region. To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

and define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

A standard curve can be converted to a series of Bezier points using the CurveToBezier method. This method updates the following properties with information about the Bezier points created:

BezierSize property

BezierX property

BezierY property

Manipulating a Region

Use the following method to move the current bitmap region. The values that you use are relative to the LEAD bitmap in memory, not to the client area.

OffsetRgn method

Set the RgnFrameColor property to display a filled, color representation of a region.

To resize a bitmap region a specific number of pixels, use the ResizeRgn method.

Use the HolesRemovalBitmapRgn method to remove holes from a bitmap region.

Regions and Masks

The CreateMaskFromRgn method creates a 1-bit mask image from the region defined in the Bitmap property, and updates the MaskBitmap property with it. In this 1-bit mask image, pixels from the region are white, and all others are black.

Use the SetRgnFromMask method to create or update a bitmap region present in the Bitmap property, by adding the region specified in the MaskBitmap property. The region in the MaskBitmap property consists of all the white pixels in the 1-bit image.

Related topics:

Saving a Region


Flags for Setting a Region

By default, a bitmap does not have a region. You create a bitmap region by calling one or more of the SetRgn... methods. Each time you call one of these methods, you specify how the new region is to be added to the existing bitmap region (if there is one). The following is a list of the options:

L_RGN_AND | The resulting region includes only the intersection of the existing region and the new one. The following example shows the result, where the rectangles represent the existing region, the ellipse represents the new one, and the shaded area represents the resulting region.
L_RGN_SET | The resulting region includes only the new region. The existing region, if any, is discarded. The following example shows the result, where the ellipse is the new region and the shaded area is the resulting region.
L_RGN_SETNOT | The resulting region includes everything in the bitmap, except the new region. The existing region, if any, is discarded. The following example shows the result, where the ellipse is the new region and the shaded area is the resulting region.
L_RGN_ANDNOTBITMAP | The resulting region includes the intersection of the area outside the existing region and the area inside the new region. The following example shows the result, where the rectangle is the existing region, the ellipse is the new one, and the shaded area is the resulting region.
L_RGN_ANDNOTRGN | The resulting region includes the intersection of the area inside the existing region and the area outside the new region. The following example shows the result, where the rectangle is the existing region, the ellipse is the new one, and the shaded area is the resulting region.
L_RGN_OR | The resulting region includes the area inside the existing region and the area inside the new region. The following example shows the result, where the rectangle is the existing region, the ellipse is the new one, and the shaded area is the resulting region.
L_RGN_XOR | The resulting region includes the area inside the existing region and the area inside the new region, except for any areas where the two intersect. The following example shows the result, where the rectangle is the existing region, the ellipse is the new one, and the shaded area is the resulting region.


Working with the Alpha Channel

Use the following property to work with a bitmap's alpha channel:

BitmapAlpha property

Typically, an alpha channel contains a mask that is used for transparency. This property, used with the region processing methods, lets you implement transparency in saved images.

Related topics:

Saving a Region


Saving a Region

Regions can be saved inside TIFF files. Whenever you save a bitmap containing a region as a TIFF file format, the region is also saved.

When you save a bitmap with a region as a CUR or ICO file, the pixels inside the region are considered to belong to the icon/cursor data. The pixels outside the region are considered transparent. If you save a bitmap without a region as a CUR or ICO file, the whole bitmap will be considered icon/cursor data. In this case, you will get a square icon or cursor.

If you save a bitmap with a region as any other file format, the region will be lost. If you want to preserve the region, you can:

Save it to a 1-bit mask using the CreateMaskFromRgn method and save the mask as a separate file. When you load the bitmap, you should load the mask bitmap and set the region using the SetRgnFromMask method.

Save it to the alpha information in a 16/32-bit image. You would convert the region to a 1-bit mask using the CreateMaskFromRgn method, after which you would set the mask to the alpha channel using the BitmapAlpha property. While loading, you would get the alpha bitmap with the BitmapAlpha property, convert it to 1-bit if necessary and then set the region with the SetRgnFromMask method.

Related topics:

Creating and Using a Bitmap Region

Raster Images: Where the Region Preempts the Bitmap

Raster Images: Methods That Transform the Region and the Bitmap


Working with the MRC Bitmap

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

LEADTOOLS also provides support for PDF compression with MRC segmentation. This compression is used to break down a page or an image into smaller segments, saving each segment using compression appropriate for that segment. Thus, one page of a PDF file may have an image JPEG compressed, some text JBIG2 compressed, and another area CCITT compressed. This whole process works to provide a PDF file with better compression and better quality than just a standard Raster PDF file.

The LEADTOOLS implementation of the MRC model involves dividing an object into segments. A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area.

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

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

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

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

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

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

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

Note:

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

For more information refer to:

Loading Capabilities

Saving Capabilities

General Segmentation

Auto-Segmentation

Manual Segmentation

Auxiliary Elements


Understanding the Mixed Raster Content (MRC) Format

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

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

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

LEADTOOLS offers the LEAD Mixed Raster Content object to handle mixed raster content files, expanding LEADTOOLS input/output functionality by adding support for color documents which contain mixed image and text components.


Saving PDF Files with MRC Segmentation

The LEADTOOLS COM provides support for PDF compression with MRC segmentation. The MRC segmentation can be used to break down a page/image into smaller segments, saving each segment using compression appropriate for that segment. Thus, one page of a PDF file may have an image JPEG compressed, some text JBIG2 compressed, and another area CCITT compressed. This whole process works to provide a PDF file with better compression and better quality than just a standard Raster PDF file.

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

Following segmentation, the PDF file can be saved, as either a single or multi-page file, using the Save, or SaveList methods. The default extension when saving PDF files is *.PDF.


Loading Capabilities

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


Saving Capabilities

The Mixed Raster Content (MRC) file can be saved using the LEAD Proprietary MRC Format, the Standard MRC format, or PDF format with MRC segmentation. To save the bitmap in the LEAD Proprietary MRC, MRC TIF, or in PDF format, call the Save method, or call SaveList to save a multi-page file. To save the bitmap in Standard MRC or in the TIF format, call the SaveT44 method.

The LEAD proprietary MRC formats used by the Save method or SaveList method differ from the Standard MRC format used by the SaveT44 method in the following ways:

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

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

Saving a given bitmap in one of the LEAD proprietary MRC formats creates a smaller file than saving the same bitmap in the Standard MRC format.

Saving a given bitmap in one of the LEAD proprietary MRC formats creates a higher quality file than saving the same bitmap in the Standard MRC format.

When saving a multi-paged file as a Standard MRC format (MRC), only one page can be saved. The LEAD Proprietary MRC formats (LEAD-MRC and LEAD-MRC2) are single page file formats.

Note:

The characteristics of the individual images differ greatly and not every image can be compressed well as Mixed Raster Content.

The LEADTOOLS implementation of the MRC model involves dividing an object into segments. A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area. Segmentation can be performed automatically, manually, or internally. Different types of compression are available, depending on which save method is being used and which segment type is being compressed.

When saving a bitmap in LEAD proprietary MRC formats, the following properties can be used to specify the compression and quality of the saved file:

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

Text2BitCoder property

The following properties may also be used to specify compression and quality characteristics used when saving a T44 file:

MaskCoder property

PictureCoder property

PictureQFactor property

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

For more information refer to:

General Segmentation

Auto-Segmentation

Manual Segmentation

With LEADTOOLS it is easy to handle the segmentation process, whether performing segmentation automatically using the AutoSegment method or the AutoSegmentExt method or manually using the CreateNewSegment method.


General Segmentation

With LEADTOOLS it is easy to handle the segmentation process, whether performing segmentation automatically or manually. A segment is a rectangular area on the bitmap. A segment's type depends on the content of its area. The segmentation process classifies the segments of a bitmap as text, grayscale or picture.

Call the StartSegmentation method to initialize the segmentation process. This method must be called each time a new segmentation process is started, whether segmentation is being performed automatically or manually. To end the segmentation process call the StopSegmentation method, which will free any memory associated with the segmentation process. Each call to StartSegmentation requires a corresponding call to StopSegmentation.


Auto-Segmentation

Calling the AutoSegment method will perform automatic segmentation using the LEADTOOLS MRC engine. LEADTOOLS segments the bitmap, classifying the segments as text, grayscale or picture. Use the following properties to control the segmentation process:

CombineFactor property

CombineFlags property

ImageType property

Sensitivity property

It is also possible to use the AutoSegmentExt method to perform automatic segmentation, or the SegmentExt method to apply manual segmentation.

To enumerate the segments, call the EnumSegments method. An EnumSegments event is fired for each segment, which provides segment boundaries and its ID. To modify a segment type or its coordinates, use the SetSegmentData method. This method will update only one segment’s data each time it is called. To delete a segment, call the DeleteSegment method. To combine two segments, call the CombineSegments method. To copy the segmentation handle and data, call the CopySegmentationHandle method.

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


Manual Segmentation

To use manual segmentation, call the CreateNewSegment method to add a new segment and customize the segment coordinates and type. To modify a segment type or its coordinates, use the SetSegmentData method. This method will update only one segment’s data each time it is called. To delete a segment, call the DeleteSegment method.

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


Auxiliary Elements

To control generating run-time exceptions with method error conditions, use the EnableMethodErrors property.


Creating a Compressed PDF File

The PDF Plug-in also provides support for the PDF Compressor. Through MRC segmentation, this compressor can be used to break down a page/image into smaller segments, saving each segment using compression appropriate for that segment. Thus, one page of a PDF file may have an image JPEG compressed, some text JBIG2 compressed, and another area CCITT compressed. This whole process works to provide a PDF file with better compression and better quality than just a standard Raster PDF file.

The PDF Compressor object is initialized by calling PDFCompInit method. In addition to initializing the compressor object, this method also creates an empty PDF file in memory. With a new PDF file created, the user may insert data to that new file. The user has the option of inserting material that has or has not been segmented using MRC Segmentation.

To insert data in the new PDF file that is MRC segmented, call PDFCompInsertMRC method. This method will use MRC segmentation to segment the data, and will compress each segment using the most suitable compression, based on PDF Compressor options. Those options are provided in the following properties:

BackGroundThreshold property

CleanSize property

ColorThreshold property

CombineThreshold property

Flags Property

ImageQuality property

OutputQuality property

SegmentQuality property

In addition to initializing the PDF Compressor, the PDFCompInit method enables or disables firing the PDFCompEvent event. The PDFCompEvent event is fired anytime a segmented bitmap is inserted by calling the PDFCompInsertMRC method or anytime an image is inserted by calling the PDFCompInsertNormal method. The user must set the EnableAddSegment property within this event to approve or cancel the addition of a segment to the PDF file. Each time this event is fired, the MRCSegmentInfo property is updated.

To insert data that is not MRC segmented in the new PDF file, call the PDFCompInsertNormal method. This method compresses the input image as one image and inserts it in the PDF file in memory.

Before inserting images or segments into a PDF file, the user should set the compression type. The PDFCompSetCompression method lets the user specify the type of compression to use for 1-bit, 2-bit and picture segments. This method must be called before inserting a compressed image into the PDF file using the PDFCompInsertNormal method, or before inserting a segment using the PDFCompInsertMRC method. If the user does not call this method before using these methods, then the default compression types are used.

The user can insert user-defined segments into a PDF file. This is done by setting the UserSegmentInfoCount to the number of user defined segments to be added, setting the actual segment data in the UserSegmentInfo Property, and then calling the PDFCompInsertSegments method. The UserSegmentInfo property is a pointer to an ILTSegmentInfo object that contains the properties listed below. It is these properties that are set with the user-defined segment information.

SegmentBottom

SegmentColors

SegmentColorsCount

SegmentLeft

SegmentRight

SegmentTop

SegmentType

After all data has been written to the file in memory, the file in memory should be written to a file on disk using the PDFCompWrite method. Once the file has been written to disk somewhere, the user must free all the memory allocated by the PDF compressor object by calling the PDFCompFree method. Please note that if PDFCompFree is called before the file in memory has been written to a file on disk, the PDF file in memory will be destroyed and all the data in that file will be lost.


Implementing Annotations

Note:

This topic is for Document/Medical only.

LEADTOOLS maintains annotations separately from bitmaps. Annotations, which are based on vectored drawing functions, are associated with a bitmap only as an overlay of the displayed image. Ordinarily, your application code is responsible for maintaining the relationships between images and annotations. For example, the annotation example that ships with LEADTOOLS, creates an annotation file that has the same name as its associated image file, but with a different extension. When the image file is loaded, the program looks for an associated annotation file and loads it as well.

The LEAD control implements annotations by turning on automated features. You can set the following property to let a user add annotations (in design mode) or view annotations (in run mode). You can also use this property to make the annotations invisible.

AnnUserMode property

In design mode, the following property lets you select an annotation tool:

AnnTool property

Run mode activation of a hot spot or button annotation generates the following event where you can add your own code:

AnnClicked event

If your application requires you to uniquely identify an annotation object, you can use the following methods to maintain numeric tags, and retrieve an object based on that tag:

AnnSetTag method

AnnGetTag method

AnnGetObjectFromTag method

The following method lets you identify the type of the specified annotation object:

AnnGetType method

To determine the number of items present in an object, use the following:

AnnEnumerate event

AnnEnumerate method

The following events let you add code to adapt your application to the automated annotation features:

AnnChange event

AnnCreate event

AnnDestroy event

AnnDrawn event

AnnSelect event

The following properties let you get the boundaries of the bounding rectangle of the specified annotation object:

AnnBoundingRectHeight property

AnnBoundingRectLeft property

AnnBoundingRectTop property

AnnBoundingRectWidth property

The following methods let you flip, reverse, rotate, or move annotations programmatically:

AnnFlip method

AnnReverse method

AnnRotate method

AnnMove method

AnnRectHeight property

AnnRectLeft property

AnnRectTop property

AnnRectWidth property

AnnBringToFront method

AnnSendToBack method

The following properties and methods let you create, manipulate and destroy annotation objects:

AnnAutoUpdate property

AnnCreate method

AnnCreateItem method

AnnDefine method

AnnDestroy method

AnnGetVisible method

AnnInsert method

AnnRectLeft property

AnnRectHeight property

AnnRectLeft property

AnnRectWidth property

AnnSetAutoDefaults method

AnnSetSelected method

AnnSetVisible method

AnnRemove method

AnnAlpha property

AnnAutoCursor property

AnnAutoSnapCursor property

AnnCalibrateRuler method

AnnFillMode property

AnnGetAutoBackColor method

AnnGetFillMode method

AnnGetFillModeExt method

AnnGetOptions method

AnnRectLeft property

AnnRectTop property

AnnRectHeight property

AnnRectWidth property

AnnGetRotateOptions method

AnnGetShowFlags method

AnnGetTextOptions method

AnnSetAutoBackColor method

AnnSetFillMode method

AnnSetFillModeExt method

AnnSetOptions method

AnnSetRotateOptions method

AnnSetShowFlags method

AnnSetTextOptions method

AnnSetVisible method

AnnShowBorder property

AnnShowRotateHandles property

AnnShowText property

AnnTextColor property

AnnTextEdit method

LEADTOOLS provides support for displaying annotations within a magnifying glass. For more information on this, refer to Customizing Magnifying Glass Painting.

The following methods let you group or ungroup annotations:

AnnGetGrouping method

AnnGroup method

AnnSetGrouping method

AnnUngroup method

For more information on grouping and ungrouping annotations, refer to Grouping and Ungrouping Annotation Objects.

The following methods and properties provide selection capabilities:

AnnCut method

AnnGetContainer method

AnnGetSelectCount method

AnnGetSelected method

AnnGetTopContainer method

AnnGetType method

AnnHitTestExt method

AnnInsert method

AnnRemove method

AnnSelectPoint method

AnnSelectRectHeight property

AnnSelectRect method

AnnSelectRectLeft property

AnnSelectRectTop property

AnnSelectRectWidth property

AnnSetSelected method

AnnShowLockedIcon property

You can manipulate the mouse when working with annotations using the following:

AnnMouseDown event

AnnMouseMove event

AnnMouseUp event

SetMousePos method

The following method lets you apply annotations to the bitmap, itself.

AnnRealize method

The following method lets you restore the background of redact objects.

AnnUnrealize method

The following methods let you load annotations from a file or save them to a file:

AnnLoad method

AnnDataPath method

AnnLoadArray method

AnnLoadMemory method

AnnSave method

AnnSaveArray method

AnnSaveMemory method

The following method lets you save annotations in a Wang compatible TIFF tag:

AnnSaveTag method

The following methods and property support Windows clipboard operations:

AnnCopy method

AnnCut method

AnnPasteReady property

AnnPaste method

The following properties and methods let you control and customize the menus and other text strings that appear in automation mode:

AnnAutoDialogFontSize property

AnnAutoMenuEnable property

AnnAutoDrawEnable property

AnnGetAutoText method

AnnSetAutoText method

AnnGetAutoMenuItemEnable method

AnnSetAutoMenuItemEnable method

For information on modifying the annotation automation menu through the AnnMenu object, refer to Annotation Menu.

To undo changes made to objects or automation operations, use the following methods and properties:

AnnAddUndoNode method

AnnUndo method

AnnUndoDepth property

AnnUndoEnable property

For more information on undoing operations, refer to Undoing Automation Operations.

The following methods let you handle a region:

AnnGetArea method

AnnGetRgnHandle method

The following methods let you work with the Ruler object:

AnnGetDistance method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY method

AnnGetGaugeLength method

AnnSetGaugeLength method

The following methods let you handle the annotation object characteristics:

AnnAlpha property

AnnAutoSnapCursor property

AnnCalibrateRuler method

AnnFillMode property

AnnGetAutoBackColor method

AnnGetBackColor method

AnnGetFillMode method

AnnGetFillModeExt method

AnnGetFillPattern method

AnnGetFontBold method

AnnGetFontItalic method

AnnGetFontName method

AnnGetFontSize method

AnnGetFontStrikeThrough method

AnnGetFontUnderline method

AnnGetForeColor method

AnnGetLineStyle method

AnnGetLineWidth method

AnnGetMetafile method

AnnGetNodes method

AnnGetOptions method

AnnGetPolyFillMode method

AnnGetPredefinedMetafile method

AnnGetRotateOptions method

AnnGetSelected method

AnnGetText method

AnnGetTextOptions method

AnnGetUnit method

AnnHitTest method

AnnSelectPoint method

AnnSetAutoBackColor method

AnnSetBackColor method

AnnSetFillMode method

AnnSetFillModeExt method

AnnSetFillPattern method

AnnSetFontBold method

AnnSetFontItalic method

AnnSetFontName method

AnnSetFontSize method

AnnSetFontStrikeThrough method

AnnSetFontUnderline method

AnnSetForeColor method

AnnSetLineStyle method

AnnSetLineWidth method

AnnSetMetafile method

AnnSetNameOptions method

AnnSetNameOptions method

AnnSetNodes method

AnnSetOptions method

AnnSetPolyFillMode method

AnnSetPredefinedMetafile method

AnnSetRotateOptions method

AnnSetText method

AnnSetTextOptions method

AnnShowBorder property

AnnShowRotateHandles property

AnnShowText property

AnnTextColor property

AnnTextEdit method

The following methods let you use ROP2:

AnnGetROP2 method

AnnSetROP2 method

The following properties and methods let you control and customize the rotation options:

AnnSetRotateOptions method

AnnGetRotateOptions method

AnnShowRotateHandles property

The following methods let you handle the bitmap:

AnnGetBitmap method

AnnGetTransparentColor method

AnnSetBitmap method

AnnSetBitmapDpiX method

AnnSetBitmapDpiY method

AnnSetTransparentColor method

AnnGetTransparent method

AnnSetTransparent method

AnnGetSecondaryBitmap method

AnnSetSecondaryBitmap method

Use the AnnSetOptions method and the AnnGetOptions method to control the following features:

Rubber Stamp Display Style

XP Style Annotation Toolbar

Alpha Background Fill Option

Annotation Rotate Option

Annotation Side Handles

Annotation Multiselect

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

When painting annotations on a bitmap, normally, the image is painted first, and then the annotations are rendered. This can cause flicker, and, it allows the portion under the annotation objects, for example a Redact object, to be visible. To avoid this flicker, enable double buffer image display by setting the DoubleBuffer property to TRUE.

The following methods and properties let you select annotation objects relative to a window:

AnnSelectPoint method

AnnSelectRect method

AnnSelectRectHeight property

AnnSelectRectLeft property

AnnSelectRectTop property

AnnSelectRectWidth property

You can use LEADTOOLS DLL functions to further customize the automated annotation features. Keep in mind, however, that the COM Object relies on particular ways of identifying, scaling and positioning annotation objects. Modifying the behavior with DLL functions can break the automated features. The following methods, properties can be helpful when using DLL functions:

AnnContainer property

AnnGetContainer method

AnnGetTopContainer method

AnnAutomation property

AnnGetSelectCount method

AnnGetSelectList method

AnnGetPointCount method

AnnGetPointX method

AnnGetPointY method

User Interface for Annotations

In design mode, you can select tools using the AnnTool property and draw annotation objects over the image in the window. You can then use the right mouse button to get a pop-up menu that is tailored to each object type. You can include the Annotation Toolbar to make tool selection easier. The toolbar and the pop-up menu appear as shown in the following example:

The popup menu is context sensitive. It lists only the properties that can be changed on the selected object or objects. If you use the popup menu to change a property, the value that you specify is applied to the current selection, and it becomes the default for the next object.

The following topics describe the automated annotation features for particular objects and tools:

Setting Defaults

Selection Pointer Tool

Line Tool

Rectangle Tool

Ellipse Tool

Polyline Tool

Polygon Tool

Pointer Tool

Freehand Line Tool

Highlight Tool

Redaction Tool

Text Tool

Note Tool

Stamp Tool

Hot spot Tool

Button Tool

Audio Clip Tool

Ruler Tool

Cross product Tool

Point Tool

Protractor Tool

PushPin Tool

Freehand Hot Spot Tool

Rubber Stamp Tools

Curve Tool

Closed Curve Tool

Rich Text Tool

PolyRuler Tool

Encrypt Tool

Text Pointer Tool

See Also

Grouping and Ungrouping Annotation Objects

Annotation Toolbar

Annotation Menu

New Annotation Features of Version 14.5

Calibrating Annotation Ruler Objects


Annotation Files

Note:

This topic is for Document/Medical only.

LEADTOOLS maintains annotations separately from bitmaps. The user's application code is responsible for maintaining the relationships between images and annotations. For example, the annotation example that ships with LEADTOOLS creates an annotation file that has the same name as its associated image file, but with a different extension. When the image file is loaded, the program looks for an associated annotation file and loads it as well.

LEADTOOLS provides several properties and methods for handling annotation files. Annotation files can be stored on a disk, in memory or they may be embedded in another file. To load annotation files in these varied locations, LEAD provides the following:

AnnLoad method

AnnLoadArray method

AnnLoadMemory method

Each annotation file contains information about the annotations stored in that file. This information can be obtained using the following functions:

AnnFileInfo method

AnnFileInfoMemory method

AnnFileInfoArray method

These methods each update the following properties:

AnnInfoFormat property

AnnInfoTotalPages property

AnnInfoVersion property

Annotation files may contain a single page, or they may be multi-page. In a multi-page file, pages may be deleted using the following methods:

AnnDeletePage method

AnnDeletePageMemory method

AnnDeletePageArray method

Finally, annotation files may be saved to disk, to memory, or embedded within another file, using the following methods:

AnnSave method

AnnSaveMemory method

AnnSaveArray method


Annotation Menu

Note: This topic is for Document/Medical only.

LEADTOOLS provides an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event. This object lets you modify the annotation automation menu. The object can be modified using the following methods and properties:

AddItem

Count

DeleteItem

GetSubMenu

ItemChecked

ItemEnabled

ItemID

ItemString

ItemType

SetAnnMenu method

When a user-defined annotation automation menu item is clicked, an AnnUserMenu event is fired. If the user-defined menu item was added using the AddItem method, then the AnnUserMenu event receives the same item ID that was passed to the AddItem method.


Annotation Toolbar

Note: This topic is for Document/Medical only.

LEADTOOLS provides properties, methods for creating and modifying an annotation toolbar.

To create the toolbar call the Create method.

To make the toolbar visible or invisible, set the Visible property.

The ToolbarhWnd property contains the handle to the window of the toolbar, and the ParenthWnd property contains the handle to the parent window of the toolbar.

The currently selected tool can be found in the Tool property.

Beginning with Version 14.5, two different toolbar styles are available, the original style and a new XP style.

The following figure displays a sample of the original style and the new style:

{bmc XPtoolbar.bmp]

Note:

In Version 14.5, you need to first enable the display of the XP style toolbar by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_TOOLBAR flag set. For more information, refer to New Annotation Features of Version 14.5.

If you are using the new style annotation toolbar, the dimensions of the bitmap should be 24 by 24 pixels. The bitmap should be 32 bits per pixel (24 bits per pixel with an 8 bit alpha channel. Pixel values in the alpha channel range from 0x00 (completely transparent) to 0xFF (completely opaque).

For determining the number of toolbar buttons present and the orientation, use the following:

ButtonCount property

ButtonColumns property

ButtonRows property

To modify individual buttons on the toolbar, use the following:

ButtonTool

ButtonToolCount

ButtonMenuTool

ButtonMenuText

ButtonMenuTextID

ButtonBitmapDown

ButtonBitmapUp

ButtonToolTipText

ButtonToolTipTextID

ButtonVisible

Events associated with the toolbar:

AnnToolChecked event

AnnToolDestroy event


Annotation Toolbar Buttons

The following are constants for the available Annotation Toolbar Buttons but the Annotation Video Object for Com toolkit is not supported:

The following are constants for the available Annotation Toolbar Buttons.

Value | Meaning
ANN_TOOL_SELECT | [0] Selection Pointer Tool
ANN_TOOL_LINE | [1] Line Tool
ANN_TOOL_RECT | [2] Rectangle Tool
ANN_TOOL_ELLIPSE | [3] Ellipse Tool
ANN_TOOL_POLYLINE | [4] Polyline Tool
ANN_TOOL_POLYGON | [5] Polygon Tool
ANN_TOOL_POINTER | [6] Pointer Tool
ANN_TOOL_FREEHAND | [7] Freehand Line Tool
ANN_TOOL_HILITE | [8] Highlight Tool
ANN_TOOL_REDACT | [9] Redaction Tool
ANN_TOOL_TEXT | [10] Text Tool
ANN_TOOL_NOTE | [11] Note Tool
ANN_TOOL_STAMP | [12] Stamp Tool
ANN_TOOL_BUTTON | [13] Button Tool
ANN_TOOL_HOTSPOT | [14] Hot spot Tool
ANN_TOOL_AUDIO | [15] Audio Clip Tool
ANN_TOOL_RULER | [16] Ruler Tool
ANN_TOOL_CROSSPRODUCT | [17] Cross product Tool
ANN_TOOL_POINT | [18] Point Tool
ANN_TOOL_PROTRACTOR | [19] Protractor Tool
ANN_TOOL_PUSHPIN | [21] PushPin Tool
ANN_TOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot Tool
ANN_TOOL_CURVE | [23] Curve Tool
ANN_TOOL_CURVECLOSED | [24] Closed Curve Tool
ANN_TOOL_ENCRYPT | [25] Encrypt Tool
ANN_TOOL_TEXTPOINTER | [26] Text Pointer Tool
ANN_TOOL_POLYRULER | [27] Polyruler Tool
ANN_TOOL_RTF | [28] Rich Text Tool
ANN_TOOL_STAMP_FIRST | [29] First Stamp /* define that marks the first rubber stamp */
ANNTOOL_STAMP_APPROVED | [29] Approved Stamp
ANNTOOL_STAMP_ASSIGNED | [30] Assigned Stamp
ANNTOOL_STAMP_CHECKED | [31] Checked Stamp
ANNTOOL_STAMP_CLATPRV | [32] Client Attorney Privilege
ANNTOOL_STAMP_COPY | [33] Copy Stamp
ANNTOOL_STAMP_DRAFT | [34] Draft Stamp
ANNTOOL_STAMP_EXTENDED | [35] Extended Stamp
ANNTOOL_STAMP_FAX | [36] Fax Stamp
ANNTOOL_STAMP_FAXED | [37] Faxed Stamp
ANNTOOL_STAMP_IMPORTANT | [38] Important Stamp
ANNTOOL_STAMP_INVOICE | [39] Invoice Stamp
ANNTOOL_STAMP_NOTICE | [40] Notice Stamp
ANNTOOL_STAMP_OFFICIAL | [41] Official Stamp
ANNTOOL_STAMP_ONFILE | [42] On File Stamp
ANNTOOL_STAMP_PAID | [43] Paid Stamp
ANNTOOL_STAMP_PASSED | [44] Passed Stamp
ANNTOOL_STAMP_PENDING | [45] Pending Stamp
ANNTOOL_STAMP_PROCESSED | [46] Processed Stamp
ANNTOOL_STAMP_RECEIVED | [47] Received Stamp
ANNTOOL_STAMP_REJECTED | [48] Rejected Stamp
ANNTOOL_STAMP_RELEASE | [49] Release Stamp
ANNTOOL_STAMP_SENT | [50] Sent Stamp
ANNTOOL_STAMP_SHIPPED | [51] Shipped Stamp
ANNTOOL_STAMP_TOPSECRET | [52] Top Secret Stamp
ANNTOOL_STAMP_URGENT | [53] Urgent Stamp
ANNTOOL_STAMP_VOID | [54] Void Stamp
ANNTOOL_STAMP_LAST | [55] /* define that marks the last rubber stamp */
ANNTOOL_LAST | [56]
ANN_TOOL_USER | [0x0100] First user defined tool
ANN_TOOL_USERLAST | [0x0200] Last allowed user defined tools


Changing the Annotation Automation Background Colors

When working with automated annotations, the background color of most objects created by a particular automation object can be changed by calling the AnnSetBackColor method for that automation object. However, the Note, Push-pin, Redact and Hilite objects cannot be changed using this method and must be handled differently.

The automation object contains 4 background color values:

one color for the Note and Push-pin objects

one color for the Hilite object

one color for the Redact object

one color for all other objects

When the automation object creates an object, it uses the corresponding background color. For example, if the automation object creates a Redact object, it uses the color stored for Redact objects. If the background for an object type is changed using the automation, the corresponding background color value stored for that object type is updated. Consequently, the next time the automation object creates an object of that type, the updated background color is used.

To change the background colors stored in the automation object:

right click with no objects selected. All the default properties for objects created by the automation object can then be changed.

OR

call the AnnSetAutoBackColor method. This lets the user programmatically change the background color of objects created by the automation object.

To determine the current background colors stored within the automation object, use the AnnGetAutoBackColor method.

To change the color of the pen used for highlighting and selection, set the AnnAutoHilightPen property to the desired color.


Changing the Annotation Automation Pen Highlight Color

The default highlight pen has an OLE_COLOR value of 0xFFFFFF (white). This color will not work well with images that have many mid-range gray colors. A better selection for such cases would be 0xC0C0C0 (silver).

When working with automated annotations, change the color of the pen that is used for highlighting and selecting by calling the AnnAutoHilightPen property for that automation object.

To change the highlight color back to the default color after changing the highlight color, you must set the AnnAutoHilightPen property to use an OLE_COLOR value of 0xFFFFFF (white).


Converting Annotation Automation Dialogs to Other Languages

Note: This topic is for Document/Medical only.

The annotation DLL provided with the English version of LEADTOOLS produces annotation automation dialogs with English strings. To convert the annotation automation dialogs to other languages, it is necessary to modify the dialog strings and, depending on the language, the font size and name. For languages that use English characters, the dialogs can be translated by just changing the dialog strings. This can be done as follows:

LEAD1.AnnAutoDialogFontSize = 15

For some languages, such as Japanese and Chinese, special fonts are required to display the characters of that language. These characters are often larger than English characters. Consequently, it is necessary to change the dialog strings, the font name and the font size. For example, to use Japanese strings with the English annotation DLL, the following must be done:

1.

Change the font size and name for the automation dialogs as follows:

// Change the font size.
// The English version uses 8 as a default.
// The Japanese version uses 9.
LEAD1.AnnAutoDialogFontSize = 9;

//Change the font name.
AnnSetAutoText ANNAUTOTEXT_DIALOG_FONT, "Japanese Font Name"

2.

Change all the automation strings as follows:

AnnSetAutoText ANNAUTOTEXT_XXX, "New Japanese String."


Fixed Annotations

Most annotation objects can be "fixed". When an annotation is ‘fixed’, it gets painted using a default annotation container transform. The container transform is manipulated using the following functions:

Scaling factors:

AnnSetScalarX

AnnSetScalarY

AnnGetScalarX

AnnGetScalarY

Offsets:

AnnSetOffsetX

AnnSetOffsetY

AnnGetOffsetX

AnnGetOffsetY

Changing the container transform is primarily used for scrolling and zooming annotations on an image.

The effect of fixing an annotation is that it is frozen on the window. Zooming and scrolling will move the underlying image and non-fixed annotations, but fixed annotations will not move. The annotation can still be moved by selecting and dragging the annotation with the mouse.

Fixing an annotation is easily accomplished using automation. Right-click the annotation, select the Fixed menu item, and the following dialog appears:

Select the Fixed check box, and click OK. Now when you zoom or scroll the underlying image, the fixed annotation stays in place. Again, the Fixed option works best when double buffering is enabled.

Leave the Adjust check box selected. This automatically adjusts the size and location of the object before fixing or un-fixing the annotation object. The result is the annotation object will not jump around as you change its fixed state.

Fixing an annotation programmatically is accomplished using the following functionality:

AnnFixed

AnnPushFixedState

AnnPopFixedState

AnnIsFixedRectAnnIsFixedRectproperty

Fixing an annotation can be very useful. For example, a physician might want the patient information displayed using a text annotation in the upper right hand corner of the window, regardless of how the image is scrolled or zoomed. Or you might want a button that never moves out of view even when the image is scrolled. Fixing a ruler or polyruler annotation is very useful because the ruler can be used to measure any part of an image. The tic marks and displayed units of the ruler will automatically adjust based on the zoom factor.

The following annotations cannot be fixed:

ANN_OBJECT_CONTAINER

ANN_OBJECT_REDACT

ANN_OBJECT_ENCRYPT


Grouping and Ungrouping Annotation Objects

Note: This topic is for Document/Medical only.

If more than one object is selected when the right mouse button is pressed, the "Group" menu option appears and lets you group the selected objects. From that moment on, all the grouped objects are acted on as one in automation mode. When you select one object, all objects become selected. When you unselect an object belonging to a group, all objects in that group are unselected.

To select only one object in a group, you must ungroup them. When you select a "grouped" set of objects and press the right mouse button, the "Ungroup" option appears in the menu. Selecting that option "ungroups" the objects. After that, objects are independent (you can select one without selecting the others).

Each container has a "Grouping" feature, which determines whether the objects contained in that container are treated as a group by the automation. If the "Grouping" feature is TRUE, then all the objects in the container should be treated as a group. If the "Grouping" feature is FALSE, then the objects in the container can be selected and changed independently. The "Grouping" feature of a container can be set using the AnnSetGrouping method. To determine the status of the "Grouping" feature of a container, call the AnnGetGrouping method.

The AnnGroup method does the following:

creates a sub-container

moves the objects to this sub-container

sets the Grouping feature for the sub-container to TRUE

Setting the Grouping feature to FALSE by calling the AnnSetGrouping method with bAutoGroup set to FALSE is similar to calling the AnnUngroup method.

To change only one object within a group, do the following:

find the object's container.

set the grouping property to FALSE for the container.

change the object.

set the grouping feature to TRUE for the container.

To programmatically move all the objects belonging to a group you have two choices:

1. Move the subcontainer, which contains all the objects (not the best solution)

2. Move all the objects present in that container (the better solution).

The problem with moving the container is that objects are clipped to their container. So if the subcontainer has an offset of 100 and you try to move the objects in the automated mode, then you cannot move the objects all the way to the left. You will be able to move the objects in the automated mode, but their left side will disappear.

This means that if you are going to use subcontainers and automated mode at the same time, then you should create the subcontainers so that they have the same size as the main container. Or, you can keep track of the mouse notifications. And move the subcontainer whenever the mouse moves.

To create a group of objects, you can create a container, insert all the objects in it and insert that container in the main container (without stripping the container).


Implementing Annotation Hyperlinks

Note: This topic is for Document/Medical only.

LEADTOOLS provides several properties, methods and events that allow you to hyperlink annotations. Annotations may be hyperlinked to run a program, access a Web page, or send a user-defined message. Hyperlinks that run a program or access a Web page are generated using AnnSetHyperlinkString method. AnnSetHyperlinkMsg method lets you create a hyperlink to send a user defined message to the AnnHyperlink event. To determine the type of hyperlink associated with an annotation use AnnGetHyperlinkType method. If the hyperlink runs a program or accesses a Web page, you can retrieve the name of the program, with all required command line parameters, or you can retrieve the URL of the Web page using AnnGetHyperlinkString method. Hyperlinks to the AnnHyperlink event may have parameters. The AnnGetHyperlinkParam method lets you retrieve the parameters. AnnHyperlinkMenuEnable property enables or disables the hyperlink menu item for automated annotations. AnnHyperlinkMenu event occurs when the user selects the hyperlink menu item for automated annotations.


Implementing Annotation Security

Note: This topic is for Document/Medical only.

LEADTOOLS provides annotation security through a number of properties, methods AnnLock method and AnnUnlock method let you lock and unlock annotations using a key. Locking an object through the automated mode generates an AnnLocked event and unlocking an object through the automated mode generates an AnnUnlocked event. If AnnShowLockedIcon property is set to VARIANT_TRUE, any locked object will be drawn with a padlock icon on top of it. AnnGetLocked method also provides a means of determining if an object is locked.

You can also secure annotations by using AnnSetUser method. By setting the user for an annotation, modification to the annotation cannot be made unless the correct user is known.

Related topics:

Redaction Annotation Object

Encrypt Annotation Object


Setting Defaults

Note:

This topic is for Document/Medical only.

When using automated annotations, you can change the default properties of the user interface and the objects in the container by clicking on the container with the right mouse button. The popup menu lets you do the following:

Undo the last user action.

Cut, copy and paste objects using the Windows clipboard.

Delete all selected objects.

Select all annotation objects in the container.

Arrange the layering of an object or group of objects.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the default line width and style properties. See Line Dialog Box for Annotations.

Change the ROP2 code property. See ROP2 Dialog Box for Annotations.

Change whether transparency is used.

Change the transparent color. See Color Dialog Box for Annotations.

Change the default fill mode (transparent, translucent, or opaque) and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

Change the default foreground and background colors. See Color Dialog Box for Annotations.

Change the background color used by Note, Redact, or Hilite objects. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Change the Button font selection and font characteristics. See Font Dialog Box for Annotations.

Change the metafile to be used by Hotspot objects. See Hotspot Metafile Dialog Box for Annotations.

Change the metafile to be used by Encrypt objects. See Encrypt Metafile Dialog Box for Annotations.

Change the metafile to be used by Decrypt objects. See Decrypt Metafile Dialog Box for AnnotationsDecrypt.

Change the default Ruler properties (length, gauge, tic marks, measurement units, precision). See Ruler Dialog Box for Annotations.

Change the node properties for objects that have nodes (whether to display the nodes and which nodes to display). See Nodes Dialog Box for Annotations.

Change the default Protractor properties (whether to draw the inside or outside angle, how far out to draw the angle, whether to use radians or degrees, which unit abbreviation, and precision). See Protractor Dialog Box for Annotations.

Change the default Point properties (whether to use a bitmap, whether to use transparency, transparent color, border color, radius, fill color, fixed size). See Point Default Properties Dialog Box for Annotations.

Change the default Encrypt properties (key, type (encryptor or decryptor), and location). See Encrypt Dialog Box for Annotations.

Change the default Fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

The default background color does not affect highlight, redaction, and note objects. To change the default background color for these objects, you have to use the appropriate menu item, such as Redact Background Color.

For information about grouping selected objects, refer to Grouping and Ungrouping Annotation Objects.

Use the AnnSetAutoMenuItemEnable method to enable or disable a menu item for one or more annotation objects.

Use the AnnSetOptions method and the AnnGetOptions method to control the following features:

Rubber Stamp Display Style

XP Style Annotation Toolbar

Alpha Background Fill Option

Annotation Rotate Option

Annotation Side Handles

Annotation Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the AnnGetTextOptions method and the AnnSetTextOptions method to set the objects to show or hide the text and to set the color of the text. In addition, if the annotation objects are text or stamp objects these methods can set the objects to show or hide the borders of the object. In version 14.5, note that these features must be enabled using the AnnSetOptions method.

Use the AnnSetFillMode method and the AnnGetFillMode method to manage the fill mode used by annotation objects. The AnnSetFillModeExt method and the AnnGetFillModeExt method extends the original methods to support the ANN_FILLMODE_ALPHA fill mode. Before calling these two methods, enable the alpha background fill mode by calling the AnnSetOptions method.

For more information about these features, refer to New Annotation Features of Version 14.5.

For low-level implementation details, refer to Container Annotation Object and Annotation Automation Object.

The default background color does not affect highlight, redaction, and note objects.


Low-Level Coordinates System for annotation

Low-Level Coordinate System for Annotations

Note:

This topic is for Document/Medical only.

The coordinates for defining and positioning LEADTOOLS annotations are stored in floating point values that are translated to device coordinates only when the annotations are displayed. Each annotation object is defined and positioned relative to its container. The root container sets the frame of reference.

At the time of display, the coordinates are first multiplied by the values of the X and Y scalar properties (scaling factors), and are then offset by the values of the X and Y offset properties. Thus, the scaling factors translate the internal values to the coordinate system of the display space, and the offsets position the scaled object in the display space.

The LEADTOOLS automated annotation functions use this system to match annotations to a displayed image as follows:

1. | The root container's coordinates are set as follows: 0, 0, bitmap width -1, bitmap height -1.
2. | The X and Y scaling factors of the root container are set using the source and destination rectangles of the LEADTOOLS painting function. For example, the X scaling factor would be calculated by dividing the width of the destination rectangle by the width of the source rectangle. For an explanation of the source and destination rectangles, refer to Concepts and Definitions.
3. | The X and Y offsets of the root container are set to the same values as the left and top fields of the painting function's destination rectangle.
4. | Each time the image is zoomed or scrolled, the scaling factors and offsets of the root container are updated, and annotation objects are redrawn in the window.

This system provides flexibility in storing and transporting annotations. You can adapt the annotations to any unit of measure, such as twips or millimeters. You can also set the root container's width and height to arbitrary measurements, such as 1000 by 1000, that you adjust when applying the container's annotations to a bitmap image.

Note:

Scaling factors and offsets can be applied to objects other than the root container, but that is not necessary for matching the annotations to the displayed image. The scaling factors and offsets of a container apply to all objects within the container.

Scaling factors:

AnnSetScalarX method

AnnSetScalarY method

AnnGetScalarX method

AnnGetScalarY method

Offsets:

AnnGetOffsetX method

AnnGetOffsetY method

AnnSetOffsetX method

AnnSetOffsetY method

Related topics:

Implementing Annotations

Types of Annotations


Moving the Name of Annotation

Moving the Name of an Annotation

LEADTOOLS provides a number of properties and methods for positioning the name of an annotation object. First, the name may be restricted. If a name is restricted, then it will fully appear on the bitmap. By restricting the name, the offsets used to position the name are therefore limited, based on the name of the annotation object and the font that is being used.

To get the current restriction status for an annotation object, call the AnnGetNameRestrict method . To change the restriction status of an annotation object, call the AnnSetNameRestrict method .

The annotation name can be positioned by setting its offset values. These values are relative to the upper left corner of the bounding box of the annotation object. To get the current offset values of the name of an annotation object call the AnnGetNameOffsetX method and the AnnGetNameOffsetY method

To change the position of the name of the annotation object, call the AnnSetNameOffsetX method and the AnnSetNameOffsetY method.

The name of an annotation has both a defining rectangle and a bounding rectangle. The defining rectangle is specified by the following read only properties:

AnnNameRectHeight property

AnnNameRectLeft property

AnnNameRectTop property

AnnNameRectWidth property

The bounding rectangle is specified by the following read only properties:

AnnNameBoundingRectHeight property

AnnNameBoundingRectLeft property

AnnNameBoundingRectTop property

AnnNameBoundingRectWidth property

For an explanation of the difference between the defining rectangle and the bounding rectangle, refer to any of the AnnNameBoundingRectXXX properties.


Types of Annotations

Note: This topic is for Document/Medical only.

LEADTOOLS supports the following types of annotation objects:

Constant | Meaning
ANN_OBJECT_CONTAINER | [0] Container Annotation
ANN_OBJECT_TEXT | [15] Text Annotation
ANN_OBJECT_NOTE | [9] Note Annotation
ANN_OBJECT_LINE | [8] Line Annotation
ANN_OBJECT_POLYLINE | [11] Polyline Annotation
ANN_OBJECT_FREEHAND | [5] Freehand Line Annotation
ANN_OBJECT_RECT | [12] Rectangle Annotation
ANN_OBJECT_ELLIPSE | [4] Ellipse Annotation
ANN_OBJECT_POLYGON | [10] Polygon Annotation
ANN_OBJECT_POINTER | [1] Pointer Annotation
ANN_OBJECT_BUTTON | [3] Button Annotation
ANN_OBJECT_STAMP | [14] Stamp Annotation
ANN_OBJECT_HILITE | [6] Highlight Annotation
ANN_OBJECT_REDACT | [13] Redaction Annotation
ANN_OBJECT_AUDIO | [2] Audio Clip Annotation
ANN_OBJECT_HOTSPOT | [7] Hot Spot Annotation
ANN_OBJECT_AUTOMATION | [16] Annotation Automation
ANN_OBJECT_RULER | [17] Ruler Annotation
ANN_OBJECT_CROSSPRODUCT | [18] Cross Product Annotation
ANN_OBJECT_POINT | [19] Point Annotation
ANN_OBJECT_PROTRACTOR | [20] Protractor Annotation
ANN_OBJECT_PUSHPIN | [22] PushPin Annotation
ANN_OBJECT_FREEHANDHOTSPOT | [23] Freehand Hotspot Annotation
ANN_OBJECT_ALL | [-1] All annotation object types
ANN_OBJECT_CURVE | [24] Curve Annotation Object
ANN_OBJECT_CURVECLOSED | [25] Closed Curve Annotation Object
ANN_OBJECT_ENCRYPT | [26] Encrypt Annotation Object
ANN_OBJECT_TEXTPOINTER | [27] Text Pointer Annotation Object
ANN_OBJECT_POLYRULER | [28] Polyruler Annotation Object
ANN_OBJECT_RTF | [29] Rich Text Annotation Object


Undoing Automation Operations

The LEADTOOLS ILEADRasterAnnotation features include an Undo engine for undoing annotation automation operations. The undo depth determines the number of operations that can be undone. There is only one undo depth value per root container. Subcontainers do not have their own separate values.

LEADTOOLS provides a number of methods and properties for handling the undo capabilities.

The undo depth for the automation handle is contained in the AnnUndoDepth property.

The AnnUndo method undoes the last automation operation performed, including changes made to object properties.

Generally, operations are undone one operation at a time. If the last operation performed cut several objects from a container, undoing that operation would return the objects to the container. Occasionally, it may be best to group several operations, such as object additions or property changes, together so that calling AnnUndo undoes the whole group of operations and not just the last operation performed. This can be accomplished by:

1. | Set the number of undo actions that can take place using the AnnUndoDepth property. This property defaults to 5.
2. | Call the AnnAddUndoNode method to add an undo node to the automation object.
3. | Disable the undo feature by setting the AnnUndoEnable property to FALSE.
4. | Perform the operations or changes to be combined into one undo.
5. | Re-enable the undo feature by setting the AnnUndoEnable property to TRUE.

Now, all three operations can be undone with one call to the AnnUndo method instead of several calls to the AnnUndo method.


Annotation Objects - Default Values

Note:

This topic is for Document/Medical only.

LEADTOOLS supports a number of annotation types. Each annotation type has certain properties associated with it. For a brief explanation of the annotation type or tool, and a list of associated defaults, refer to the following list:

Annotation Automation Object

Audio Clip Annotation Object

Button Annotation Object

Container Annotation Object

Cross product Annotation Object

Ellipse Annotation Object

Freehand Hot Spot Annotation Object

Freehand Line Annotation Object

Highlight Annotation Object

Hot Spot Annotation Object

Line Annotation Object

Note Annotation Object

Point Annotation Object

Pointer Annotation Object

Polygon Annotation Object

Polyline Annotation Object

Protractor Annotation Object

PushPin Annotation Object

Rectangle Annotation Object

Redaction Annotation Object

Rubber Stamp Annotation Object

Ruler Annotation Object

Stamp Annotation Object

Text Annotation Object


Annotation Objects - Automated Features

Note:

This topic is for Document/Medical only.

When working with automated annotations, you have the option of using automated pop-up menus when you right click in design mode. These menus allow you to set certain properties of the annotation object. The following topics describe the automated annotation features for particular objects and tools:

User Interface for Container and Automation Objects

Audio Clip Tool

Button Tool

Cross product Tool

Ellipse Tool

Freehand Hot Spot Tool

Freehand Line Tool

Highlight Tool

Hot spot Tool

Line Tool

Note Tool

Point Tool

Pointer Tool

Polygon Tool

Polyline Tool

Protractor Tool

PushPin Tool

Rectangle Tool

Redaction Tool

Rubber Stamp Tool

Ruler Tool

Selection Pointer Tool

Stamp Tool

Text Tool

Curve Tool

Closed Curve Tool

RTF Tool

PolyRuler Tool

Encrypt Tool

Text Pointer Tool


The Annotation Text Token Table

This feature applies to the text annotation objects that support tokens, namely the following:

ANN_OBJECT_AUTOMATION,

ANN_OBJECT_BUTTON,

ANN_OBJECT_NOTE,

ANN_OBJECT_TEXT,

ANN_OBJECT_TEXTPOINTER,

ANN_OBJECT_STAMP,

A token is a special text string that can be translated into another more meaningful text string. For example, a user may wish to display the current date or the name of their company in their text annotations. Rather than type out the date or the name of the company, a text token can be typed instead.

Tokens are two-character strings of the form:

#{any character}

Any token (except for ##) can be defined to mean anything. LEAD defines the following set of constants to represent functions that can be mapped to any token.

ANNTOKEN_NONE | [0] String not treated as a token
ANNTOKEN_SEPARATOR | [1] Add a separator to the automation token menu
ANNTOKEN_TEXT | [2] A text string
ANNTOKEN_DATE_YYYY | [3] Current four digit year
ANNTOKEN_DATE_YY | [4] Current two digit year
ANNTOKEN_DATE_MM | [5] Two digit representation of current month
ANNTOKEN_DATE_DD | [6] Two digit representation of current day
ANNTOKEN_DATE_MONTH_NAME | [7] Current month name (for example, January)
ANNTOKEN_DATE_DAY_OF_WEEK | [8] Current day of week (for example, Monday)
ANNTOKEN_TIME_HH_12 | [9] Current hour,using a 12 hour clock
ANNTOKEN_TIME_HH_24 | [10] Current hour, using a 24 hour clock
ANNTOKEN_TIME_MM | [11] Current minute (00-59)
ANNTOKEN_TIME_SS | [12] Current second (00-59)
ANNTOKEN_TIME_MILLISECONDS | [13] Current milliseconds (000-999)
ANNTOKEN_AM_PM | [14] Time of day indicator (AM or PM)

LEAD defines a predefined text token table that you can use, or you can define your own. The predefined text tokens table is listed below.

Default Text Token Table

#Y | "Four digit year"
#y | "Two digit year"
#M | "Two digit month"
#d | "Two digit day"
#N | "Month Name"
#D | "Day of week name"
#h | "Current time: 12-Hour (01-12),
#H | "Current time: 24-Hour (00-23),
#m | "Current time: minutes"
#s | "Current time: seconds"
#f | "Current time: milliseconds "
#t | "Current time: AM or PM"
## | "#"

The text token table is displayed in the automation text dialog. The following figure displays the default text token table.

The default annotation text token table can be easily changed using the following functions:

AnnClearTokenTable

AnnDeleteTokenTable

AnnEnumerateTextToken

AnnTextExpandTokens property

AnnInsertTokenTable

AnnTextExpandTokens property

Use AnnClearTokenTable to remove all tokens from the text token table.

Use AnnDeleteTokenTable to delete a text token from the annotation text token table.

Use AnnEnumerateTextToken to examine the contents of the annotation text token table.

Use AnnTextExpandTokens property to get the text expand token property of an annotation.

Use AnnInsertTokenTable to insert a text token into the text token table.

Use AnnTextExpandTokens property to set the text expand token property of an annotation.

Additionally, you can define your own user-defined text tokens. User-defined text tokens can consist of new text strings, or any combination of existing text tokens. The following figure displays a user-defined text token table.


Using Annotation Bitmap Objects

The following annotation objects utilize bitmaps or metafiles as part of the annotation:

ANN_OBJECT_ENCRYPT

ANN_OBJECT_FREEHANDHOTSPOT

ANN_OBJECT_HOTSPOT

ANN_OBJECT_POINT

ANN_OBJECT_PUSHPIN

ANN_OBJECT_STAMP

In addition, the Automation object (ANN_OBJECT_AUTOMATION) stores bitmap or metafile settings along with the other object default settings.

LEADTOOLS provides the following functions to work with bitmaps or metafiles associated with annotation objects:

AnnSetBitmap method - Use this function with the ANN_OBJECT_STAMP, ANN_OBJECT_POINT, and ANN_OBJECT_PUSHPIN objects to set the bitmap for the object. The ANN_OBJECT_STAMP (including the different Rubber Stamp tools) object can display text, a bitmap, or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two. Initially, the ANN_OBJECT_STAMP displays text. In automation, there are different Rubber Stamp tools available: these are ANN_OBJECT_STAMP objects set up to use the different metafiles for each rubber stamp selection (instead of text). The ANN_OBJECT_PUSHPIN object displays a bitmap in design mode and a secondary bitmap in run mode.

AnnGetBitmap method - Use this function with the ANN_OBJECT_STAMP, ANN_OBJECT_POINT, and ANN_OBJECT_PUSHPIN objects to get the handle for bitmap being used for the object. The ANN_OBJECT_STAMP (including the different Rubber Stamp tools) objects can display text, a bitmap, or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two. Initially, the ANN_OBJECT_STAMP displays text. In automation, there are different Rubber Stamp tools available, which are ANN_OBJECT_STAMP objects set up to use the different metafiles for each rubber stamp selection (instead of text). The ANN_OBJECT_PUSHPIN object displays a bitmap in design mode and a secondary bitmap in run mode.

AnnSetMetafile – Use this function with the ANN_OBJECT_STAMP (including the Rubber Stamp tools), ANN_OBJECT_HOTSPOT, ANN_OBJECT_FREEHANDHOTSPOT, and ANN_OBJECT_ENCRYPT objects to change the metafile for the selected objects. This function changes the metafile for the specified objects, but any new objects will still use the default metafiles. To reset a metafile to its original metafile, call the AnnSetPredefinedMetafile function and pass NULL to hMetafile.

AnnGetMetafile method – Use this function with the ANN_OBJECT_STAMP, ANN_OBJECT_HOTSPOT, ANN_OBJECT_FREEHANDHOTSPOT, and ANN_OBJECT_ENCRYPT objects and the Rubber Stamp tools to retrieve the metafile for the selected objects.

AnnSetSecondaryBitmap method - Sets the secondary bitmap used by the specified annotation object. Only PushPin objects (ANN_OBJECT_POINT) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the AnnSetBitmap method and the AnnGetBitmap method) which displays whenever the text is shown, and a secondary bitmap, changed using the AnnSetSecondaryBitmap method. The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized. In design mode, the ANN_OBJECT_PUSHPIN object shows the text and displays the primary bitmap. In the run mode the object shows or hides the text when clicked.

AnnGetSecondaryBitmap method - Gets the secondary bitmap used by the specified annotation object. Only PushPin objects (ANN_OBJECT_POINT) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the AnnSetBitmap method and the AnnGetBitmap method) which displays whenever the text is shown, and a secondary bitmap, changed using the AnnSetSecondaryBitmap method. The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized. In design mode, the ANN_OBJECT_PUSHPIN object shows the text and displays the primary bitmap. In the run mode the object shows or hides the text when clicked.

AnnPredefinedRaster property- Gets or sets a copy of the specified predefined bitmap, used for the annotation Point object (ANN_OBJECT_POINT).

AnnGetSecondaryMetafile method- Gets the metafile handle associated with an ANN_OBJECT_ENCRYPT object when it is in the ‘decryptor’ state. The encrypt object has two states: Encryptor and Decryptor. Each state is displayed with its own metafile.

AnnSetPredefinedMetafile method - Sets the default metafiles used by the following object types:

ANN_OBJECT_ENCRYPT

ANN_OBJECT_FREEHANDHOTSPOT

ANN_OBJECT_HOTSPOT

ANN_OBJECT_STAMP (including the Rubber Stamp tools)

AnnGetPredefinedMetafile method – Gets the default metafiles used by the following object types:

ANN_OBJECT_ENCRYPT

ANN_OBJECT_FREEHANDHOTSPOT

ANN_OBJECT_HOTSPOT

ANN_OBJECT_STAMP

Rubber Stamp Tools


Using Rulers in Annotation Objects

The following annotation objects utilize one or more rulers as part of the annotation:

ANN_OBJECT_CROSSPRODUCT

ANN_OBJECT_POLYRULER

ANN_OBJECT_PROTRACTOR

ANN_OBJECT_RULER

In addition, the Automation object (ANN_OBJECT_AUTOMATION) stores default ruler settings along with the other object default settings.

To determine the unit of measure for each ruler as well as its precision, call the AnnGetUnit method, which fills the AnnUnit property with the unit of measure. Read the AnnUnit property and the AnnPrecision property after calling the AnnGetUnit method to get the current Unit and Precision. The default unit of measure for Ruler, Polyruler, and Crossproduct objects is Smart English. With the smart units, the unit changes with the length. For example, if the length is 11 inches (assuming the default precision of 2 is being used), "11.00 in" displays whereas if the length is 15 inches, "1 ft 3.00 in" displays. Call the AnnSetUnit method to set the unit of measurement and its precision for the ruler. The precision indicates how many digits to display to the right of the decimal point in the length.

There are two methods that can be used to get the length of a ruler: the AnnGetDistance method and the AnnGetDistance2 method. The AnnGetDistance method can be used with up to 2 rulers, whereas the AnnGetDistance2 method can be used on any of the ruler objects. Call the AnnGetDistance2 method to get the length of all the rulers in a ANN_OBJECT_POLYRULER object. If the annotation object is type ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR or ANN_OBJECT_POLYRULER, the AnnGetDistance2 method provides more information on the length of each ruler, the number of rulers, the unit of measure of each ruler and the total length of all rulers. The AnnGetDistance2 method is meant to replace the AnnGetDistance method, which is being phased out.

At each end of the ruler is a perpendicular line called a gauge. Use the AnnSetGaugeLength method to set the length of the gauge. The length is expressed in pixels, not in points. The length extends from one end point of the gauge, through the end point of the ruler, to the other end point of the gauge. Use the AnnGetGaugeLength method to get the length of the gauge.

Along the length of the ruler are tic marks. The tic marks are the perpendicular lines that measure the units. The length of these tick marks can be set using the AnnTicMarkLength property. The length of the tic mark is expressed in pixels, not in points. Call the AnnGetShowFlags method to determine how the rulers are being displayed. Call the AnnSetShowFlags method to set whether ruler length, gauge and tic marks will be displayed.

Please note that when loading or pasting Automation objects or any objects that use rulers from the clipboard, it is necessary to call the AnnSetBitmapDpiY method and set the vertical Bitmap DPI value to the bitmap's Y resolution. Likewise, call the AnnSetBitmapDpiX method and set the horizontal Bitmap DPI value to the bitmap's X resolution. Doing so ensures that the distances shown by the ruler objects will be accurate.

Call the AnnCalibrateRuler method to calibrate an ANN_OBJECT_RULER object by assigning a specified length to it. Note that although this method only works on ANN_OBJECT_RULER objects, it can be used to indirectly calibrate other objects. For more information, refer to Calibrating Annotation Ruler Objects. In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_CALIBRATE_RULER flag set. For more information, refer to New Annotation Features of Version 14.5.


Displaying and Manipulating Annotation Objects

Note:

This topic is for Document/Medical only.

If the annotation object(s) are Stamp or Point objects and are using a bitmap, the user can call the following functions to set the bitmap transparency:

AnnGetTransparent method

AnnGetTransparentColor method

AnnSetTransparent method

AnnSetTransparentColor method

Use the AnnSetOptions method and the AnnGetOptions method to control the following features:

Rubber Stamp Display Style

XP Style Annotation Toolbar

Alpha Background Fill Option

Annotation Rotate Option

Annotation Side Handles

Annotation Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the AnnGetTextOptions method and the AnnSetTextOptions method to set the objects to show or hide the text and to set the color of the text. In addition, if the annotation objects are text or stamp objects these methods can set the objects to show or hide the borders of the object. In version 14.5, note that these features must be enabled using the AnnSetOptions method.

Use the AnnSetFillMode method and the AnnGetFillMode method to manage the fill mode used by annotation objects. The AnnSetFillModeExt method and the AnnGetFillModeExt method extends the original methods to support the ANN_FILLMODE_ALPHA fill mode. Before calling these two methods, enable the alpha background fill mode by calling the AnnSetOptions method.

Set the color display options of any annotation object by calling the following functions:

AnnGetROP2 method

AnnSetROP2 method

Perform geometric transformations on an annotation object by calling the following functions:

AnnBringToFront method

AnnDefine2 method

AnnDefine method

AnnFlip method

AnnMove method

AnnReverse method

AnnRotate method

AnnSendToBack method


Obtaining Annotation Object Information

Note:

This topic is for Document/Medical only.

LEADTOOLS provides many functions that allow the user to extract information from annotation objects. Once that information has been extracted, it can be modified using any of a number of functions provided by LEADTOOLS.

The AnnEnumerate method is a special function that processes each object in a specified container using a designated callback function. Once an object is obtained, many of the functions listed below can be called to obtain the desired information.

The following functions are general in nature and apply to the majority of annotation objects. For more information, refer to the individual function's documentation.

AnnBoundingRectHeight property

AnnBoundingRectLeft property

AnnBoundingRectTop property

AnnBoundingRectWidth property

AnnGetBackColor method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY

AnnGetContainer method

AnnGetFillMode method

AnnGetFillPattern method

AnnGetFontBold method

AnnGetFontItalic method

AnnGetFontName method

AnnGetFontSize method

AnnGetFontStrikeThrough method

AnnGetFontUnderline method

AnnGetForeColor method

AnnGetLineStyle method

AnnGetLineWidth method

AnnGetNameOptions method

AnnGetObjectFromTag method

AnnGetOffsetX method

AnnGetOffsetY method

AnnGetPredefinedMetafile method

AnnGetROP2 method

AnnGetSecondaryBitmap method

AnnGetSecondaryMetafile method

AnnGetSelectCount method

AnnGetSelected method

AnnGetSelectList method

AnnGetTag method

AnnGetText method

AnnGetTopContainer method

AnnGetType method

AnnGetUnit method

AnnGetUserData method

AnnGetUserHandle method

AnnGetUserHandles method

AnnGetVisible method

AnnGetWnd method

AnnPredefinedRaster property

AnnUserMode property

This next set of functions is more specialized, applying only to certain annotation objects. For more information, refer to the individual function's documentation.

AnnGetAngle method

AnnGetBitmap method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY method

AnnGetDistance2 method

AnnGetDistance method

AnnGetEncryptOptions method

AnnGetGaugeLength method

AnnGetMetafile method

AnnGetNodes method

AnnGetPointCount method

AnnGetPointOptions method

AnnGetPolyFillMode method

AnnGetProtractorOptions method

AnnGetRgnHandle method

AnnGetSecondaryMetafile method

AnnGetShowFlags method

AnnGetTransparent method

AnnGetTransparentColor method

This final set of functions applies only to automation annotation objects.

AnnAutoCursor property

AnnAutoDialogFontSize property

AnnAutoDrawEnable property

AnnAutoHilightPen property

AnnAutoMenuEnable property

AnnAutoMenuItemEnable property

AnnGetAutoBackColor method

AnnGetAutoText method


Flipping, Reversing, and Rotating Annotation Objects

Note:

This topic is for Document/Medical only.

LEADTOOLS provides several methods for manipulating annotation objects so they are flipped, reversed, or rotated.

Use the AnnFlip method to flip one or more annotation objects, top to bottom. Objects that contain text cannot be flipped or reversed. If one or more such objects are in a group of objects that is flipped or reversed on a common axis, the text will move to the new position, but will retain its orientation.

Use the AnnReverse method to reverse one or more annotation objects, left to right. Objects that contain text cannot be flipped or reversed. If one or more such objects are in a group of objects that is flipped or reversed on a common axis, the text will move to the new position, but will retain its orientation.

Use the AnnRotate method to rotate one or more annotation objects. Certain objects cannot be rotated (see the following list). If one or more such objects are in a group of objects that is rotated around a common center, those objects will move to new positions, but will retain their orientation.

New with Version 14.5 of LEADTOOLS are the AnnGetRotateOptions method and the AnnSetRotateOptions method to control the interface used for performing rotations. For Version 14.5 of LEADTOOLS, enable these methods by calling the AnnSetOptions method and passing OPTIONS_NEW_ROTATE. For more information, refer to New Annotation Features of Version 14.5.

Flipping and Reversing:

All annotation objects flip or reverse with the following notes:

ANN_OBJECT_AUDIO - metafile does not flip/reverse

ANN_OBJECT_BUTTON - text itself does not flip/reverse

ANN_OBJECT_ENCRYPT - metafile does not flip/reverse

ANN_OBJECT_FREEHANDHOTSPOT -- metafile does not flip/reverse

ANN_OBJECT_HOTSPOT - metafile does not flip/reverse

ANN_OBJECT_NOTE - text itself does not flip/reverse

ANN_OBJECT_POINT - if the point uses an image, the image does not flip/reverse

ANN_OBJECT_PUSHPIN - text itself does not flip/reverse

ANN_OBJECT_RTF - text itself does not flip/reverse

ANN_OBJECT_STAMP – the text flips/reverses, but the image and metafile do not flip/reverse

ANN_OBJECT_TEXT - text itself does not flip/reverse

ANN_OBJECT_TEXTPOINTER - the tail flips, but the text does not flip/reverse

ANN_OBJECT_VIDEO - metafile does not flip/reverse

Rotating:

All objects rotate EXCEPT for the following objects:

ANN_OBJECT_AUDIO

ANN_OBJECT_BUTTON

ANN_OBJECT_ENCRYPT

ANN_OBJECT_FREEHANDHOTSPOT – the object rotates, but not the metafile

ANN_OBJECT_HOTSPOT

ANN_OBJECT_NOTE

ANN_OBJECT_POINT

ANN_OBJECT_PUSHPIN

ANN_OBJECT_RTF

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_VIDEO

See Also

Annotations (Document/Medical only): Object Manipulation


Calibrating Annotation Ruler Objects

Calibrating a ruler means assigning a specific length to it. For example, on a digital X-ray of a hand, you may draw an annotation ruler object along one of the fingers. You know that this distance is supposed to be exactly 6.5 cm. Using the new calibration functionality you can calibrate this ruler, all existing rulers, and all newly created rulers so that they would precisely measure this distance to be 6.5 cm.

In non-automated mode, use the AnnCalibrateRuler method to calibrate ruler objects.

In automated mode, calibration is accomplished as follows:

1. | Draw an ANN_OBJECT_RULER object.
2. | In the design mode, right-click the object.
3. | Choose Ruler Properties and then Ruler.
4. | Click the Calibrate button to display the dialog below.
5. | In the Ruler Length edit box, enter the length to which the ruler is to be assigned.
6. | In the Measurement Units combo box, select the corresponding unit of measure.
7. | In most cases, you can leave the values in the Advanced Options'as they are.
 | The first time you calibrate a ruler, the Current dpi will give the horizontal and vertical resolutions of the image in dots per inch. For most images, these values will be equal, and the dpi Ratio will be 1:1. However, for some images (i.e. some fax images) the horizontal and vertical resolutions are different. This will be automatically reflected in both the Current dpi and dpi Ratio settings. If you need to change the dpi ratio, enter a new ratio. This ratio must be between (1/100) and 100 inclusive.
8. | If you want the calibration to apply to all newly created rulers, select the corresponding check box. If you select this option, all rulers, polyrulers, cross-products and protractors will adopt the new calibrated values.
9 | If you want the calibration to apply to all existing rulers, select this option. Again, if you use this option, all rulers, polyrulers, cross-products and protractors will be affected.
10. | Click the OK button when you are satisfied with the calibration values.
11. | Note that the calibration does not take an effect until you click the Apply button on the parent dialog.

Note: In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_CALIBRATE_RULER flag set. For more information, refer to New Annotation Features of Version 14.5.


New Annotation Features of Version 14.5

Note:

This topic is for Document/Medical only.

With this release of LEADTOOLS version 14.5, many new features are being introduced to the annotations. Some of these features alter the way annotations are displayed. Other features change or enhance the user interface. To maintain backward compatibility within version 14, most of these features must be enabled by calling the AnnSetOptions method. In LEADTOOLS version 15, these options will be enabled by default.

The following features are being introduced:

New Rubber Stamp Display Style

New XP Style Annotation Toolbar

New Alpha Background Fill Option

New Annotation Rotate Option

New Annotation Side Handles

New Annotation Multi-select

New Annotation Cursors

New ESC to Cancel

New Calibrate Ruler Feature

New Dot Dash Lines

New XML Format

New Text Annotation Options

The following paragraphs describe each feature in more detail.

New Rubber Stamp Display Style

In previous versions of LEADTOOLS, you could draw any of 26 predefined rubber stamp annotations. While any of these metafiles can be changed, users have asked for more contemporary-looking defaults. LEADTOOLS has responded and developed new default images. The following figure displays a sample of the original style and the new style:

The new rubber stamp style can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_STAMP_METAFILES)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_STAMP_METAFILES);
}

New XP Style Annotation Toolbar

The annotation toolbar has been updated to have a Windows-XP look and feel. As with previous versions of LEADTOOLS, the annotation toolbar can be customized with your own images. The following figure displays a sample of the original style and the new style:

For more information on toolbars, see the documentation for

ButtonBitmapDown property

ButtonBitmapUp property

ButtonColumns property

ButtonCount property

ButtonMenuText property

ButtonMenuTextID property

ButtonMenuTool property

ButtonRows property

ButtonTool property

ButtonToolCount property

ButtonToolTipText property

ButtonToolTipTextID property

ButtonVisible property

The new XP-style annotation toolbar can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_TOOLBAR)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_TOOLBAR);
}

New Alpha Background Fill Option:

Previous versions of LEADTOOLS supported annotations with translucent backgrounds. With version 14.5, there is an alpha option that allows you to specify an alpha value from 0 (completely transparent background) to 255 (completely opaque background) inclusive.

The new alpha background fill option can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_ALPHA)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_ALPHA);
}

When enabled, you can right-click an annotation object to display the Fill dialog with the new alpha option. Here you can enter an alpha value from 0 – 255 inclusive. The following figure displays the Fill dialog for the Stamp object:

The following figure displays rectangle annotation objects using different alpha values:

For more information, see the documentation for the AnnGetFillModeExt method and the AnnSetFillModeExt method.

New Annotation Rotate Option

In previous versions of LEADTOOLS, annotation objects could be rotated by holding the <SHIFT> key while dragging a handle. With the new rotate options, two rotate handles are displayed on a selected object. One of the handles is the "gripper" handle, which rotates the object when dragged. The other handle is the "center" handle, which determines the center of rotation. The center of rotation can be moved by dragging. The gripper handle can be moved anywhere by dragging.

The following figure illustrates a rotate by dragging the "gripper" handle:

The following figure illustrates moving the "center" handle:

The rotate handles can be reset to a default location by right-clicking the annotation object, and selecting the Reset Rotate Handles option, as shown in the following figure:

The rotate handles can be globally hidden or displayed by right-clicking on the image (not an annotation object), and selecting the Hide Rotate Handles For All Objects option, as shown in the following figure:

The new annotation rotate object can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_ROTATE)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_ROTATE);
}

New Annotation Side Handles

In previous versions of LEADTOOLS, rectangular annotation objects were displayed with four handles to manipulate the object. With this new feature, rectangular objects are displayed with four additional side handles. Dragging the side handles resizes the annotation object only in one dimension. Dragging the corner handles resizes the object in two dimensions, preserving the aspect ratio.

The new annotation side handles can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_SIDE_HANDLES)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_SIDE_HANDLES);
}

The following figure displays a sample of the original style and the new style:

New Annotation Multi-select

In previous versions of LEADTOOLS, you could select multiple objects and manipulate the objects by dragging any handle of any object. When moving a handle, the results were often not intuitive. With the new multi-select option, all selected objects are outlined with a multi-select border. The multi-select border has eight resize handles, and two rotate handles. Now, moving, resizing, and rotating multiply select objects is clear and easy to do.

The new annotation multi-select feature can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_ MULTI_SELECT)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_MULTI_SELECT);
}

The following figure displays a sample of the original style and the new style:

New Annotation Cursors

This new feature displays different cursors for many tasks in automated annotation mode. This feature displays unique annotation cursors in the following situations:

When hovering over a rotation gripper handle

When hovering over a rotation center handle

When hovering over any of the eight size handles—an appropriate arrow cursor is displayed depending on the handle and the rotation of the annotation object.

When dragging a selection

When using any of the 30 annotation tools.

All annotation cursors can be changed to your own custom cursors by calling the AnnAutoCursor property.

The new annotation cursors can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_CURSORS)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_CURSORS);
}

The following figure displays some of the new cursors:

New ESC to Cancel

In previous versions of LEADTOOLS, the ESC key was not set to cancel actions in annotation automation mode. With this new feature, a user can press the ESC key to cancel many actions in annotation automation mode. For example, when drawing an annotation, pressing ESC will cancel the annotation completely. When rotating, resizing, or moving an annotation, pressing ESC will cancel the action leaving the annotation unchanged.

The new ESC to Cancel feature can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_CURSORS)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_CURSORS);
}

New Calibrate Ruler Feature

With this feature, a user can automatically calibrate a ruler to the desired size. This is useful when a user wants to interactively measure something in an image. Note that there are four annotations objects used for measuring:

ANN_OBJECT_RULER

ANN_OBJECT_POLYRULER

ANN_OBJECT_CROSSPRODUCT

ANN_OBJECT_PROTRACTOR

Any of these objects can be calibrated. To calibrate a ruler:

1. | Load desired image
2. | Draw an ANN_OBJECT_RULER object and size to desired size. In this example, we will calibrate the diagonal to be 2 feet. The following figure displays an uncalibrated ruler:

3.

Right-click the ANN_OBJECT_RULER object and select Ruler Properties, and then Ruler, as shown in the following figure:

The following figure appears:

4.

Click the Calibrate button to open the Calibrate Ruler dialog. The following figure displays:

 | In the Calibrate dialog, set the Ruler Length to 2 and the Ruler Measurement to feet. Select the Apply to Newly Created Rulers check box. Click the OK button to close the Calibrate dialog. Click the OK button to save your selections and close the Ruler Properties dialog.
5. | Draw a new ruler to measure any part of the image, as shown in the following figure:

The new calibrate ruler feature can be enabled using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_CALIBRATE_RULER)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_CALIBRATE_RULER);
}

For more information on calibrating rulers, see the documentation for the AnnCalibrateRuler method, and the topic Calibrating Annotation Ruler Objects.

New Dot Dash Lines

Most of the LEAD annotation objects have a Line Width and Line Style option. This can be used to draw the annotations with thick lines, and change the line style from solid to dashed or dotted. In previous versions of LEADTOOLS, drawing annotations with thick lines (line width more than 1 pixel) required that the line style be Solid. This is due to a limitation of Windows GDI. In version 14.5, this limitation has been removed. Now annotation objects can be drawn with thick lines of any style. The following example illustrates this:

This feature can be enabled using the following code snippet.

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_DOT_DASH_LINES)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_DOT_DASH_LINES);
}

New XML Format

Prior to version 14.5, annotations could be saved in one of two formats:

ANN_FMT_NATIVE – a text based file format for storing annotations

ANN_FMT_ENCODED – a binary file format for storing annotations

In version 14.5, there is a new text-based format for annotations – ANN_FMT_XML. This is a new text based format for storing LEAD annotations that follows the XML (Extensible Markup Language) format.

There are many advantages of using the ANN_FMT_XML format:

Unlike the ANN_FMT_NATIVE, ANN_FMT_XML is both forward- and backward-compatible.

It is human readable.

Files using the ANN_FMT_XML format can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

This option does not need to be enabled using the AnnSetOptions method. To use this feature, simply pass the flag ANN_FMT_XML to the annotation save functions. For more information, see the documentation for the AnnSave method, the AnnSaveMemory method, the AnnLoad method, and the AnnLoadMemory method.

New Text Annotation Options

For the following text-based annotations, you can now change the text color so that it is different from the border color. Also, you can optionally show or hide the text.

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_STAMP

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

For the following text based annotations, you can now optionally show or hide the border.

ANN_OBJECT_TEXT

ANN_OBJECT_STAMP

These properties can also be set for the following annotation objects for purposes of recursion:

ANN_OBJECT_CONTAINER

ANN_OBJECT_AUTOMATION

ANN_OBJECT_BUTTON

To see these new features:

1. | Draw an ANN_OBJECT_TEXT object
2. | Right-click the object
3. | Select Text Properties and then Text
4. | In the Text dialog, select the Show Border check box
5. | Click the Text Color button to change the color to blue. The following figure displays the Text dialog:

6.

The following figure displays the original text object before and after changing the text color to blue:

This feature can be enabled using the following code snippet.

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_TEXT_OPTIONS)
End Sub

VC++ Example:

void CAnnCOMView:: ExampleEnableOption ()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_TEXT_OPTIONS);
}

For more information, see the documentation for the AnnSetTextOptions method and the AnnGetTextOptions method.


Annotation Automation Audio Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_AUDIOFILE_CAPTION | "Audio File"
ANN_AUTOTEXT_AUDIOFILE_FILTER | "Wave Files (*.wav)|*.wav|All Files (*.*)|*.*|"


Annotation Automation Capture Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_CAPTUREFILE_CAPTION | "Choose a File Name"
ANN_AUTOTEXT_CAPTUREFILE_FILTER | "AVI Files (*.AVI)\0*.avi\0All Files (*.*)\0*.*\0\0"
ANN_AUTOTEXT_CAPTUREWINDOW_CAPTION | "Capture Window"
ANN_AUTOTEXT_CAPTURE_CAPTION | "Capture Dialog"
ANN_AUTOTEXT_CAPTURE_CAPTUREDRIVERS | "Capture Drivers"
ANN_AUTOTEXT_CAPTURE_DISPLAYMODE | "Display Mode"
ANN_AUTOTEXT_CAPTURE_NONE | "None"
ANN_AUTOTEXT_CAPTURE_NONEOVERLAY | "Overlay"
ANN_AUTOTEXT_CAPTURE_PREVIEW | "Preview"
ANN_AUTOTEXT_CAPTURE_PREVIEWFRAMESPERSEC | "Frames Per Sec"
ANN_AUTOTEXT_CAPTURE_OPTIONS | "Capture Options"
ANN_AUTOTEXT_CAPTURE_TIMELIMIT | "Time Limit (sec)"
ANN_AUTOTEXT_CAPTURE_CAPTUREFRAMESPERSEC | "Frames Per Sec"
ANN_AUTOTEXT_CAPTURE_STARTCAPTURE | "Start Capture"
ANN_AUTOTEXT_CAPTURE_ENDCAPTURE | "End Capture"
ANN_AUTOTEXT_CAPTURE_FRAMESCAPTURED | "Frames Captured"
ANN_AUTOTEXT_CAPTURE_AUDIOOPTIONS | "Audio Options"
ANN_AUTOTEXT_CAPTURE_CAPTUREAUDIO | "Capture Audio"
ANN_AUTOTEXT_CAPTURE_SYNCAUDIO | "Sync Audio to Video"
ANN_AUTOTEXT_CAPTURE_CAPTUREFILE | "Capture File"
ANN_AUTOTEXT_CAPTURE_BROWSE | "Browse..."
ANN_AUTOTEXT_CAPTURE_FILESIZE | "File Size (bytes)"
ANN_AUTOTEXT_CAPTURE_OK | "OK"
ANN_AUTOTEXT_CAPTURE_CANCEL | "Cancel"
ANN_AUTOTEXT_CAPTURE_WAV_1M08 | "11.025 kHz, Mono, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_1S08 | "11.025 kHz, Stereo, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_1M16 | "11.025 kHz, Mono, 16-bit"
ANN_AUTOTEXT_CAPTURE_WAV_1S16 | "11.025 kHz, Stereo, 16-bit"
ANN_AUTOTEXT_CAPTURE_WAV_2M08 | "22.050 kHz, Mono, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_2S08 | "22.050 kHz, Stereo, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_2M16 | "22.050 kHz, Mono, 16-bit"
ANN_AUTOTEXT_CAPTURE_WAV_2S16 | "22.050 kHz, Stereo, 16-bit"
ANN_AUTOTEXT_CAPTURE_WAV_4M08 | "44.100 kHz, Mono, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_4S08 | "44.100 kHz, Stereo, 8-bit"
ANN_AUTOTEXT_CAPTURE_WAV_4M16 | "44.100 kHz, Mono, 16-bit"
ANN_AUTOTEXT_CAPTURE_WAV_4S16 | "44.100 kHz, Stereo, 16-bit"
ANN_AUTOTEXT_CAPTURE_DEFAULTNAME | "c:\\capture.avi"
ANN_AUTOTEXT_CAPTURE_NODRIVERS | "No Capture Drivers Available"


Annotation Automation Encrypt Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText methods. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANNAUTOTEXT_ENCRYPT_CAPTION | "Encrypt"
ANNAUTOTEXT_ENCRYPT_KEY | "&Key"
ANNAUTOTEXT_ENCRYPT_TYPE | "Ty&pe"
ANNAUTOTEXT_ENCRYPT_RADIO_ENCRYPTOR | "&Encryptor"
ANNAUTOTEXT_ENCRYPT_RADIO_DECRYPTOR | "&Decryptor"
ANNAUTOTEXT_ENCRYPT_LOCATION | "&Location"
ANNAUTOTEXT_ENCRYPT_LOCATION_LEFT | "&Left"
ANNAUTOTEXT_ENCRYPT_LOCATION_TOP | "&Top"
ANNAUTOTEXT_ENCRYPT_LOCATION_RIGHT | "&Right"
ANNAUTOTEXT_ENCRYPT_LOCATION_BOTTOM | "&Bottom"
ANNAUTOTEXT_ENCRYPT_OK | "OK"
ANNAUTOTEXT_ENCRYPT_CANCEL | "Cancel"


Annotation Automation Encrypt Metafile Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText methods. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANNAUTOTEXT_ENCRYPTMETAFILE_CAPTION | "Encrypt Metafile"
ANNAUTOTEXT_ENCRYPTMETAFILE_FILTER | "All metafiles (*.wmf;*.emf|*.wmf;*.emf|WMF files (*.wmf)|*.wmf|EMF files (*.emf)|*.emf|All Files (*.*)|*.*|")
ANNAUTOTEXT_DECRYPTMETAFILE_CAPTION | "Decrypt Metafile"
ANNAUTOTEXT_DECRYPTMETAFILE_FILTER | "All metafiles (*.wmf;*.emf|*.wmf;*.emf|WMF files (*.wmf)|*.wmf|EMF files (*.emf)|*.emf|All Files (*.*)|*.*|")


Annotation Automation Fixed Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText methods. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANNAUTOTEXT_FIXED_CAPTION | "Fixed"
ANNAUTOTEXT_FIXED_FIXED | "&Fixed"
ANNAUTOTEXT_FIXED_ADJUST | "&Adjust"
ANNAUTOTEXT_FIXED_OK | "OK"
ANNAUTOTEXT_FIXED_CANCEL | "Cancel"
ANNAUTOTEXT_TOOLTIP_SELECT | "Select"
ANNAUTOTEXT_TOOLTIP_LINE | "Line"
ANNAUTOTEXT_TOOLTIP_RECT | "Rect"
ANNAUTOTEXT_TOOLTIP_ELLIPSE | "Ellipse"
ANNAUTOTEXT_TOOLTIP_POLYLINE | "Polyline"
ANNAUTOTEXT_TOOLTIP_POLYGON | "Polygon"
ANNAUTOTEXT_TOOLTIP_POINTER | "Pointer"
ANNAUTOTEXT_TOOLTIP_FREEHAND | "Freehand"
ANNAUTOTEXT_TOOLTIP_HILITE | "Hilite"
ANNAUTOTEXT_TOOLTIP_REDACT | "Redact"
ANNAUTOTEXT_TOOLTIP_TEXT | "Text"
ANNAUTOTEXT_TOOLTIP_NOTE | "Note"
ANNAUTOTEXT_TOOLTIP_STAMP | "Stamp"
ANNAUTOTEXT_TOOLTIP_RUBBERSTAMP | "Rubber Stamp"
ANNAUTOTEXT_TOOLTIP_HOTSPOT | "Hotspot"
ANNAUTOTEXT_TOOLTIP_FREEHANDHOTSPOT | "Freehand Hotspot"
ANNAUTOTEXT_TOOLTIP_AUDIO | "Audio"
ANNAUTOTEXT_TOOLTIP_BUTTON | "Button"
ANNAUTOTEXT_TOOLTIP_RULER | "Ruler"
ANNAUTOTEXT_TOOLTIP_CROSSPRODUCT | "Crossproduct"
ANNAUTOTEXT_TOOLTIP_POINT | "Point"
ANNAUTOTEXT_TOOLTIP_PROTRACTOR | "Protractor"
ANNAUTOTEXT_TOOLTIP_VIDEO | "Video"
ANNAUTOTEXT_TOOLTIP_PUSHPIN | "Pushpin"
ANNAUTOTEXT_TOOLTIP_CURVE | "Curve"
ANNAUTOTEXT_TOOLTIP_CURVECLOSED | "Closed Curve"
ANNAUTOTEXT_TOOLTIP_ENCRYPT | "Encrypt"
ANNAUTOTEXT_TOOLTIP_TEXTPOINTER | "Text Pointer"
ANNAUTOTEXT_TOOLTIP_POLYRULER | "Poly Ruler"
ANNAUTOTEXT_TOOLTIP_RTF | "RTF"
ANNAUTOTEXT_TRANSPARENTCOLOR_CAPTION | "Pick transparent color"
ANNAUTOTEXT_TRANSPARENTCOLOR_ARRAYFRAME | "Bitmap colors"
ANNAUTOTEXT_TRANSPARENTCOLOR_CURRENTCOLORFRAME | "Current color"
ANNAUTOTEXT_TRANSPARENTCOLOR_COLOR | "Color:"
ANNAUTOTEXT_TRANSPARENTCOLOR_RED | "Red:"
ANNAUTOTEXT_TRANSPARENTCOLOR_GREEN | "Green:"
ANNAUTOTEXT_TRANSPARENTCOLOR_BLUE | "Blue:"
ANNAUTOTEXT_TRANSPARENTCOLOR_OK | "OK"
ANNAUTOTEXT_TRANSPARENTCOLOR_CANCEL | "Cancel"
ANNAUTOTEXT_CAPTUREFILE_CAPTION | "Choose a File Name"
ANNAUTOTEXT_CAPTUREFILE_FILTER | "AVI Files (*.AVI\0*.avi\0All Files (*.*)\0*.*\0\0")
ANNAUTOTEXT_CAPTUREWINDOW_CAPTION | "Capture Window"
ANNAUTOTEXT_CAPTURE_CAPTION | "Capture Dialog"
ANNAUTOTEXT_CAPTURE_CAPTUREDRIVERS | "Capture Drivers"
ANNAUTOTEXT_CAPTURE_VIDEODIALOGS | "Capture Driver Dialogs"
ANNAUTOTEXT_CAPTURE_VIDEOFORMAT | "Video Format"
ANNAUTOTEXT_CAPTURE_VIDEODISPLAY | "Video Display"
ANNAUTOTEXT_CAPTURE_VIDEOSOURCE | "Video Source"
ANNAUTOTEXT_CAPTURE_VIDEOCOMPRESSION | "Video Compression"
ANNAUTOTEXT_CAPTURE_DISPLAYMODE | "Display Mode"
ANNAUTOTEXT_CAPTURE_NONE | "None"
ANNAUTOTEXT_CAPTURE_NONEOVERLAY | "Overlay"
ANNAUTOTEXT_CAPTURE_PREVIEW | "Preview"
ANNAUTOTEXT_CAPTURE_PREVIEWFRAMESPERSEC | "Frames Per Sec"
ANNAUTOTEXT_CAPTURE_OPTIONS | "Capture Options"
ANNAUTOTEXT_CAPTURE_TIMELIMIT | "Time Limit (sec")
ANNAUTOTEXT_CAPTURE_CAPTUREFRAMESPERSEC | "Frames Per Sec"
ANNAUTOTEXT_CAPTURE_STARTCAPTURE | "Start Capture"
ANNAUTOTEXT_CAPTURE_ENDCAPTURE | "End Capture"
ANNAUTOTEXT_CAPTURE_FRAMESCAPTURED | "Frames Captured"
ANNAUTOTEXT_CAPTURE_AUDIOOPTIONS | "Audio Options"
ANNAUTOTEXT_CAPTURE_CAPTUREAUDIO | "Capture Audio"
ANNAUTOTEXT_CAPTURE_SYNCAUDIO | "Sync Audio to Video"
ANNAUTOTEXT_CAPTURE_CAPTUREFILE | "Capture File"
ANNAUTOTEXT_CAPTURE_BROWSE | "Browse..."
ANNAUTOTEXT_CAPTURE_FILESIZE | "File Size (bytes")
ANNAUTOTEXT_CAPTURE_OK | "OK"
ANNAUTOTEXT_CAPTURE_CANCEL | "Cancel"
ANNAUTOTEXT_CAPTURE_WAV_1M08 | "11.025 kHz Mono 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_1S08 | "11.025 kHz Stereo 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_1M16 | "11.025 kHz Mono 16-bit"
ANNAUTOTEXT_CAPTURE_WAV_1S16 | "11.025 kHz Stereo 16-bit"
ANNAUTOTEXT_CAPTURE_WAV_2M08 | "22.050 kHz Mono 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_2S08 | "22.050 kHz Stereo 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_2M16 | "22.050 kHz Mono 16-bit"
ANNAUTOTEXT_CAPTURE_WAV_2S16 | "22.050 kHz Stereo 16-bit"
ANNAUTOTEXT_CAPTURE_WAV_4M08 | "44.100 kHz Mono 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_4S08 | "44.100 kHz Stereo 8-bit"
ANNAUTOTEXT_CAPTURE_WAV_4M16 | "44.100 kHz Mono 16-bit"
ANNAUTOTEXT_CAPTURE_WAV_4S16 | "44.100 kHz Stereo 16-bit"
ANNAUTOTEXT_CAPTURE_DEFAULTNAME | "c:\\capture.avi"
ANNAUTOTEXT_CAPTURE_NODRIVERS | "No Capture Drivers Available"
ANNAUTOTEXT_DIALOG_FONT | "MS Sans Serif"


Annotation Automation Hotspot Metafile Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANNAUTOTEXT_HOTSPOTMETAFILE_CAPTION | "Hotspot Metafile"
ANNAUTOTEXT_HOTSPOTMETAFILE_FILTER | "All metafiles (*.wmf;*.emf|*.wmf;*.emf|WMF files (*.wmf)|*.wmf|EMF files (*.emf)|*.emf|All Files (*.*)|*.*|")


Annotation Automation Fill Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_FILL_CAPTION | "Fill"
ANN_AUTOTEXT_FILL_MODE | "&Mode"
ANN_AUTOTEXT_FILL_PATTERNS | "&Patterns"
ANN_AUTOTEXT_FILL_POLYGON | "Pol&ygon"
ANN_AUTOTEXT_FILL_OK | "OK"
ANN_AUTOTEXT_FILL_CANCEL | "Cancel"
ANN_AUTOTEXT_FILL_APPLY | "Apply"
ANN_AUTOTEXT_FILL_TRANSPARENT | "Transparent"
ANN_AUTOTEXT_FILL_TRANSLUCENT | "Translucent"
ANN_AUTOTEXT_FILL_OPAQUE | "Opaque"
ANN_AUTOTEXT_FILL_SOLID | "Solid"
ANN_AUTOTEXT_FILL_BACKWARDDIAGONAL | "Backward Diagonal"
ANN_AUTOTEXT_FILL_CROSS | "Cross"
ANN_AUTOTEXT_FILL_DIAGONALCROSS | "Diagonal Cross"
ANN_AUTOTEXT_FILL_FORWARDDIAGONAL | "Forward Diagonal"
ANN_AUTOTEXT_FILL_HORIZONTAL | "Horizontal"
ANN_AUTOTEXT_FILL_VERTICAL | "Vertical"
ANN_AUTOTEXT_FILL_WINDING | "Winding"
ANN_AUTOTEXT_FILL_ALTERNATE | "Alternate"


Annotation Automation Line Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_LINE_CAPTION | "Line"
ANN_AUTOTEXT_LINE_WIDTH | "&Width (points)"
ANN_AUTOTEXT_LINE_STYLE | "&Style"
ANN_AUTOTEXT_LINE_OK | "OK"
ANN_AUTOTEXT_LINE_CANCEL | "Cancel"
ANN_AUTOTEXT_LINE_APPLY | "Apply"
ANN_AUTOTEXT_LINE_SOLID | "Solid"
ANN_AUTOTEXT_LINE_DASH | "Dash"
ANN_AUTOTEXT_LINE_DOT | "Dot"
ANN_AUTOTEXT_LINE_DASHDOT | "Dash-Dot"
ANN_AUTOTEXT_LINE_DASHDOTDOT | "Dash-Dot-Dot"
ANN_AUTOTEXT_LINE_NULL | "Null"


Annotation Automation Lock/Unlock Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_LOCK_CAPTION | "Password"
ANN_AUTOTEXT_LOCK_TEXT | "&Password"
ANN_AUTOTEXT_LOCK_OK | "OK"
ANN_AUTOTEXT_LOCK_CANCEL | "Cancel"
ANN_AUTOTEXT_UNLOCK_CAPTION | "Password"
ANN_AUTOTEXT_UNLOCK_TEXT | "&Password"
ANN_AUTOTEXT_UNLOCK_OK | "OK"
ANN_AUTOTEXT_UNLOCK_CANCEL | "Cancel"


Annotation Automation Menu Strings

AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_MENU_UNDO | "&Undo"
ANN_AUTOTEXT_MENU_CUT | "Cu&t"
ANN_AUTOTEXT_MENU_COPY | "&Copy"
ANN_AUTOTEXT_MENU_PASTE | "&Paste"
ANN_AUTOTEXT_MENU_DELETE | "&Delete"
ANN_AUTOTEXT_MENU_SELECTALL | "Select &All"
ANN_AUTOTEXT_MENU_BRINGTOFRONT | "Bring to &Front"
ANN_AUTOTEXT_MENU_SENDTOBACK | "Send to &Back"
ANN_AUTOTEXT_MENU_DEFAULTPROPERTIES | "Default Pr&operties"
ANN_AUTOTEXT_MENU_SELECTEDPROPERTIES | "Selected Pr&operties"
ANN_AUTOTEXT_MENU_CONTAINERPROPERTIES | "Container Pr&operties"
ANN_AUTOTEXT_MENU_POINTERPROPERTIES | "Pointer Pr&operties"
ANN_AUTOTEXT_MENU_AUDIOPROPERTIES | "Audio Pr&operties"
ANN_AUTOTEXT_MENU_BUTTONPROPERTIES | "Button Pr&operties"
ANN_AUTOTEXT_MENU_ELLIPSEPROPERTIES | "Ellipse Pr&operties"
ANN_AUTOTEXT_MENU_FREEHANDPROPERTIES | "Freehand Pr&operties"
ANN_AUTOTEXT_MENU_HILITEPROPERTIES | "Hilite Pr&operties"
ANN_AUTOTEXT_MENU_HOTSPOTPROPERTIES | "Hotspot Pr&operties"
ANN_AUTOTEXT_MENU_LINEPROPERTIES | "Line Pr&operties"
ANN_AUTOTEXT_MENU_NOTEPROPERTIES | "Note Pr&operties"
ANN_AUTOTEXT_MENU_POLYGONPROPERTIES | "Polygon Pr&operties"
ANN_AUTOTEXT_MENU_POLYLINEPROPERTIES | "Polyline Pr&operties"
ANN_AUTOTEXT_MENU_RECTANGLEPROPERTIES | "Rectangle Pr&operties"
ANN_AUTOTEXT_MENU_REDACTPROPERTIES | "Redact Pr&operties"
ANN_AUTOTEXT_MENU_STAMPPROPERTIES | "Stamp Pr&operties"
ANN_AUTOTEXT_MENU_TEXTPROPERTIES | "Text Pr&operties"
ANN_AUTOTEXT_MENU_AUTOMATIONPROPERTIES | "Automation Pr&operties"
ANN_AUTOTEXT_MENU_RULERPROPERTIES | "Ruler Pr&operties"
ANN_AUTOTEXT_MENU_CROSSPRODUCTPROPERTIES | "Cross-Product Pr&operties"
ANN_AUTOTEXT_MENU_POINTPROPERTIES | "Point Pr&operties"
ANN_AUTOTEXT_MENU_PROTRACTORPROPERTIES | "Protractor Pr&operties"
ANN_AUTOTEXT_MENU_PUSHPINPROPERTIES | "PushPin Pr&operties"
ANN_AUTOTEXT_MENU_FREEHANDHOSPOTPROPERTIES | "Freehand Hotspot Pr&operties"
ANN_AUTOTEXT_MENU_CURVEPROPERTIES | "Curve Pr&operties"
ANN_AUTOTEXT_MENU_CURVECLOSEDPROPERTIES | "Closed Curve Pr&operties"
ANN_AUTOTEXT_MENU_ENCRYPTPROPERTIES | "Encrypt Pr&operties"
ANN_AUTOTEXT_MENU_TEXTPOINTERPROPERTIES | "Text Pointer Pr&operties"
ANN_AUTOTEXT_MENU_POLYRULERPROPERTIES | "Polyruler Pr&operties"
ANN_AUTOTEXT_MENU_RTFPROPERTIES | "Rich Text Pr&operties"
ANN_AUTOTEXT_MENU_LINE | "&Line..."
ANN_AUTOTEXT_MENU_FILL | "&Fill..."
ANN_AUTOTEXT_MENU_FOREGROUNDCOLOR | "F&oreground Color..."
ANN_AUTOTEXT_MENU_BACKGROUNDCOLOR | "&Background Color..."
ANN_AUTOTEXT_MENU_FONT | "Fo&nt..."
ANN_AUTOTEXT_MENU_BITMAP | "&Bitmap..."
ANN_AUTOTEXT_MENU_TEXT | "&Text..."
ANN_AUTOTEXT_MENU_FILE | "F&ile..."
ANN_AUTOTEXT_MENU_ROP2 | "ROP&2..."
ANN_AUTOTEXT_MENU_TRANSPARENT | "Tr&ansparent"
ANN_AUTOTEXT_MENU_LOCK | "&Lock..."
ANN_AUTOTEXT_MENU_UNLOCK | "&Unlock..."
ANN_AUTOTEXT_MENU_LOCKALL | "&Lock All..."
ANN_AUTOTEXT_MENU_UNLOCKALL | "&Unlock All..."
ANN_AUTOTEXT_MENU_HYPERLINK | "&Hyperlink..."
ANN_AUTOTEXT_MENU_NOTEBACKGROUNDCOLOR | "No&te Background Color..."
ANN_AUTOTEXT_MENU_REDACTBACKGROUNDCOLOR | "&Hilite Background Color..."
ANN_AUTOTEXT_MENU_HILITEBACKGROUNDCOLOR | "&Redact Background Color..."
ANN_AUTOTEXT_MENU_HOTSPOTMETAFILE | "&Hotspot Metafile..."
ANN_AUTOTEXT_MENU_ENCRYPTMETAFILE | "Encrypt Metafile..."
ANN_AUTOTEXT_MENU_DECRYPTMETAFILE | "Decrypt Metafile..."
ANN_AUTOTEXT_MENU_RULER | "&Ruler... "
ANN_AUTOTEXT_MENU_RULERPROPERTIES | "Ruler Pr&operties"
ANN_AUTOTEXT_MENU_BUTTONFONT | "B&utton Font"
ANN_AUTOTEXT_MENU_GROUP | "&Group"
ANN_AUTOTEXT_MENU_UNGROUP | "U&ngroup"
ANN_AUTOTEXT_MENU_NODES | "No&des..."
ANN_AUTOTEXT_MENU_SHOWRULER | "&Show Rulers"
ANN_AUTOTEXT_MENU_PROTRACTOR | "&Protractor …"
ANN_AUTOTEXT_MENU_NAME | "Name…"
ANN_AUTOTEXT_MENU_ENCRYPT | "Encrypt..."
ANN_AUTOTEXT_MENU_POINT | "Point..."
ANN_AUTOTEXT_MENU_METAFILE | "&Metafile..."
ANN_AUTOTEXT_MENU_SECONDARYMETAFILE | "S&econdary Metafile..."
ANN_AUTOTEXT_MENU_SECONDARYFILE | "&Secondary Bitmap..."
ANN_AUTOTEXT_MENU_TRANSPARENTCOLOR | "&Transparent Color..."
ANN_AUTOTEXT_MENU_DELETENODE | "D&elete node"
ANN_AUTOTEXT_MENU_ADDNODE | "Add &node"
ANN_AUTOTEXT_MENU_CAPTURE | "Capture..."
ANN_AUTOTEXT_MENU_FIXED | "Fi&xed..."
ANN_AUTOTEXT_MENU_STAMP_APPROVED | "Approved"
ANN_AUTOTEXT_MENU_STAMP_ASSIGNED | "Assigned"
ANN_AUTOTEXT_MENU_STAMP_CHECKED | "Checked"
ANN_AUTOTEXT_MENU_STAMP_CLATPRV | "Client Attorney Privilege"
ANN_AUTOTEXT_MENU_STAMP_COPY | "Copy"
ANN_AUTOTEXT_MENU_STAMP_DRAFT | "Draft"
ANN_AUTOTEXT_MENU_STAMP_EXTENDED | "Extended"
ANN_AUTOTEXT_MENU_STAMP_FAX | "Fax"
ANN_AUTOTEXT_MENU_STAMP_FAXED | "Faxed"
ANN_AUTOTEXT_MENU_STAMP_IMPORTANT | "Important"
ANN_AUTOTEXT_MENU_STAMP_INVOICE | "Invoice"
ANN_AUTOTEXT_MENU_STAMP_NOTICE | "Notice"
ANN_AUTOTEXT_MENU_STAMP_OFFICIAL | "Official"
ANN_AUTOTEXT_MENU_STAMP_ONFILE | "On File"
ANN_AUTOTEXT_MENU_STAMP_PAID | "Paid"
ANN_AUTOTEXT_MENU_STAMP_PASSED | "Passed"
ANN_AUTOTEXT_MENU_STAMP_PENDING | "Pending"
ANN_AUTOTEXT_MENU_STAMP_PROCESSED | "Processed"
ANN_AUTOTEXT_MENU_STAMP_RECEIVED | "Received"
ANN_AUTOTEXT_MENU_STAMP_REJECTED | "Rejected"
ANN_AUTOTEXT_MENU_STAMP_RELEASE | "Release"
ANN_AUTOTEXT_MENU_STAMP_SENT | "Sent"
ANN_AUTOTEXT_MENU_STAMP_SHIPPED | "Shipped"
ANN_AUTOTEXT_MENU_STAMP_TOPSECRET | "Top Secret"
ANN_AUTOTEXT_MENU_STAMP_URGENT | "Urgent"
ANN_AUTOTEXT_MENU_STAMP_VOID | "Void"


Annotation Automation Miscellaneous Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_ITEM_DEFAULTTEXT | "AaBbYyZz"
ANN_AUTOTEXT_ITEM_DEFAULTNAME | ""


Annotation Automation Name Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_NAME_CAPTION | "Name"
ANN_AUTOTEXT_NAME_SHOW | "&Show Name"
ANN_AUTOTEXT_NAME_OFFSET | "Name &Offset"
ANN_AUTOTEXT_NAME_OFFSET_X | "X"
ANN_AUTOTEXT_NAME_OFFSET_Y | "Y"
ANN_AUTOTEXT_NAME_RESTRICT | "Name &Restrict"
ANN_AUTOTEXT_NAME_OK | "OK"
ANN_AUTOTEXT_NAME_CANCEL | "Cancel"
ANN_AUTOTEXT_NAME_APPLY | "Apply"


Annotation Automation Nodes Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_NODES_CAPTION | "Nodes"
ANN_AUTOTEXT_NODES_DISPLAYNODES | "&Display Nodes"
ANN_AUTOTEXT_NODES_GAP | "&Gap between nodes:"
ANN_AUTOTEXT_NODES_OK | "OK"
ANN_AUTOTEXT_NODES_CANCEL | "Cancel"
ANN_AUTOTEXT_NODES_APPLY | "Apply"


Annotation Automation Point Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_POINTFILE_CAPTION | "Point File"
ANN_AUTOTEXT_POINTFILE_FILTER | "All Files (*.*)|*.*|"
ANN_AUTOTEXT_POINT_CAPTION | "Point"
ANN_AUTOTEXT_POINT_USE_BITMAP | "&Use Bitmap"
ANN_AUTOTEXT_POINT_NO_BITMAP | "&No Bitmap"
ANN_AUTOTEXT_POINT_BITMAP | "&Bitmap..."
ANN_AUTOTEXT_POINT_TRANSPARENT_COLOR | "&Transparent Color"
ANN_AUTOTEXT_POINT_RADIUS | "&Radius"
ANN_AUTOTEXT_POINT_BORDER_COLOR | "Bor&der Color"
ANN_AUTOTEXT_POINT_FILL_COLOR | "&Fill Color"
ANN_AUTOTEXT_POINT_TRANSPARENT | "Trans&parent"
ANN_AUTOTEXT_POINT_FIXED_SIZE | "Fixed &Size"


Annotation Automation Protractor Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_PROTRACTOR_CAPTION | "Protractor"
ANN_AUTOTEXT_PROTRACTOR_ACUTE | "&Acute"
ANN_AUTOTEXT_PROTRACTOR_UNITS | "&Measurement Units"
ANN_AUTOTEXT_PROTRACTOR_ABBREV | "&Unit Abbreviation"
ANN_AUTOTEXT_PROTRACTOR_PRECISION | "&Precision"
ANN_AUTOTEXT_PROTRACTOR_ARCRADIUS | "Arc &radius"
ANN_AUTOTEXT_PROTRACTOR_OK | "OK"
ANN_AUTOTEXT_PROTRACTOR_CANCEL | "Cancel"
ANN_AUTOTEXT_PROTRACTOR_APPLY | "Apply"
ANN_AUTOTEXT_PROTRACTOR_DEGREES | "Degrees"
ANN_AUTOTEXT_PROTRACTOR_RADIANS | "Radians"
ANN_AUTOTEXT_NAME_CAPTION | "Name"
ANN_AUTOTEXT_NAME_SHOW | "&Show Name"
ANN_AUTOTEXT_NAME_LOCATION | "&Location"
ANN_AUTOTEXT_NAME_OFFSET | "&Name Offset"
ANN_AUTOTEXT_NAME_OFFSET_X | "&X"
ANN_AUTOTEXT_NAME_OFFSET_Y | "&Y"
ANN_AUTOTEXT_NAME_RESTRICT | "Name &Restrict"
ANN_AUTOTEXT_NAME_FONT | "Fo&nt"
ANN_AUTOTEXT_NAME_SAMPLE | "&Sample"
ANN_AUTOTEXT_NAME_SAMPLE_TEXT | "AaBbZz"
ANN_AUTOTEXT_NAME_COLORS | "&Colors"
ANN_AUTOTEXT_NAME_FOREGROUNDCOLOR | "&Foreground Color"
ANN_AUTOTEXT_NAME_BACKGROUNDCOLOR | "&Background Color"
ANN_AUTOTEXT_NAME_TRANSPARENT | "&Transparent"
ANN_AUTOTEXT_NAME_OK | "OK"
ANN_AUTOTEXT_NAME_CANCEL | "Cancel"
ANN_AUTOTEXT_NAME_APPLY | "Apply"


Annotation Automation Pushpin Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_PUSHPINFILE_CAPTION | "Pushpin File"
ANN_AUTOTEXT_PUSHPINFILE_FILTER | "All Files (*.*)|*.*|"
ANN_AUTOTEXT_PUSHPINSECONDARYFILE_CAPTION | "Pushpin Secondary File"
ANN_AUTOTEXT_PUSHPINSECONDARYFILE_FILTER | "All Files (*.*)|*.*|"


Annotation Automation ROP2 Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_ROP2_CAPTION | "ROP2"
ANN_AUTOTEXT_ROP2_TEXT | "ROP2"
ANN_AUTOTEXT_ROP2_OK | "OK"
ANN_AUTOTEXT_ROP2_CANCEL | "Cancel"
ANN_AUTOTEXT_ROP2_APPLY | "Apply"
ANN_AUTOTEXT_ROP2_COPY | "Copy (normal)"
ANN_AUTOTEXT_ROP2_AND | "And (highlight)"
ANN_AUTOTEXT_ROP2_XOR | "XOR (invert)"


Annotation Automation Ruler Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_RULER_CAPTION | "Ruler"
ANN_AUTOTEXT_RULER_UNITS | "&Measurement units"
ANN_AUTOTEXT_RULER_ABBREV | "&Unit abbreviation"
ANN_AUTOTEXT_RULER_PRECISION | "Precision"
ANN_AUTOTEXT_RULER_LENGTH | "&Gauge length"
ANN_AUTOTEXT_RULER_OK | "OK"
ANN_AUTOTEXT_RULER_CANCEL, | "Cancel"
ANN_AUTOTEXT_RULER_APPLY | "Apply"
ANN_AUTOTEXT_RULER_INCHES | "inches"
ANN_AUTOTEXT_RULER_FEET | "feet"
ANN_AUTOTEXT_RULER_YARDS | "yards"
ANN_AUTOTEXT_RULER_MICROMETERS | "micrometers"
ANN_AUTOTEXT_RULER_MILLIMETERS | "millimeters"
ANN_AUTOTEXT_RULER_CENTIMETERS | "centimeters"
ANN_AUTOTEXT_RULER_METERS | "meters"
ANN_AUTOTEXT_RULER_TWIPS | "twips"
ANN_AUTOTEXT_RULER_POINTS | "points"
ANN_AUTOTEXT_RULER_PIXELS | "pixels"
ANN_AUTOTEXT_RULER_SMART_METRIC | "smart metric"
ANN_AUTOTEXT_RULER_SMART_ENGLISH | "smart english"
ANN_AUTOTEXT_RULER_SHOWLENGTH | "&Show Length"
ANN_AUTOTEXT_RULER_SHOWGAUGE | "S&how Gauge"
ANN_AUTOTEXT_RULER_SHOWTICMARKS | "Show &Tic Marks"


Annotation Automation Stamp Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_STAMPFILE_CAPTION | "Stamp File"
ANN_AUTOTEXT_STAMPFILE_FILTER | "All Files (*.*)|*.*|"


Annotation Automation Stamp Metafile Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_STAMPMETAFILE_CAPTION | "Stamp Metafile"
ANN_AUTOTEXT_STAMPMETAFILE_FILTER | "All metafiles (*.wmf;*.emf)|*.wmf;*.emf|WMF files (*.wmf)|*.wmf|EMF files (*.emf)|*.emf|All Files (*.*)|*.*|"


Annotation Automation Strings

Note: This topic is for Document/Medical only.

This is a list of the available Annotation Automation Dialog Strings. These strings are used in association with the AnnSetAutoText mpethod, AnnGetAutoText method, ButtonMenuTextID property, and ButtonToolTipTextID property.

Annotation Automation Menu Strings

Annotation Automation Line Dialog Strings

Annotation Automation Fill Dialog Strings

Annotation Automation Text Dialog Strings

Annotation Automation Audio Dialog Strings

Annotation Automation Stamp Dialog Strings

Annotation Automation ROP2 Dialog Strings

Annotation Automation Lock/Unlock Dialog Strings

Annotation Automation Miscellaneous Dialog Strings

Annotation Automation Ruler Dialog Strings

Annotation Automation Point Dialog Strings

Annotation Automation Push Pin Dialog Strings

Annotation Automation Nodes Dialog Strings

Annotation Automation Protractor Dialog Strings

Annotation Automation Name Dialog Strings

Annotation Automation Stamp Metafile Dialog Strings

Annotation Automation ToolTip Dialog Strings

Annotation Automation Transparent Color Dialog Strings

Annotation Automation Capture Dialog Strings

Annotation Automation Hotspot Metafile Dialog Strings

Annotation Automation Encrypt Metafile Dialog Strings

Annotation Automation Encrypt Dialog Strings

Annotation Automation Fixed Dialog Strings


Annotation Automation Text Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_TEXT_IMPORT | "From &Text File..."
ANN_AUTOTEXT_TEXT_CAPTION | "Text"
ANN_AUTOTEXT_TEXT_FILE_CAPTION | "Import Text From File"
ANN_AUTOTEXT_TEXT_FILE_FILTER | "Text files (*.txt|*.txt|All Files (*.*)|*.*|")
ANN_AUTOTEXT_TEXT_INSERT_TOKEN | "&Insert Token >>"
ANN_AUTOTEXT_TEXT_ALIGN | "&Alignment"
ANN_AUTOTEXT_TEXT_ALIGN_LEFT | "&Left"
ANN_AUTOTEXT_TEXT_ALIGN_CENTER | "&Center"
ANN_AUTOTEXT_TEXT_ALIGN_RIGHT | "&Right"
ANN_AUTOTEXT_TEXT_ROTATION | "R&otation (degrees")
ANN_AUTOTEXT_TEXT_ROTATE_0 | "&None"
ANN_AUTOTEXT_TEXT_ROTATE_90 | "&90 (Counter-clockwise")
ANN_AUTOTEXT_TEXT_ROTATE_180 | "&180"
ANN_AUTOTEXT_TEXT_ROTATE_270 | "&270 (Counter-clockwise")
ANN_AUTOTEXT_TEXT_FIXED_POINTER | "&Fixed Pointer"
ANN_AUTOTEXT_TEXT_EXPAND_TOKENS | "&Expand Tokens"
ANN_AUTOTEXT_TEXT_OK | "OK"
ANN_AUTOTEXT_TEXT_CANCEL | "Cancel"
ANN_AUTOTEXT_TEXT_APPLY | "Apply"


Annotation Automation ToolTip Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_TOOLTIP_SELECT | "Select"
ANN_AUTOTEXT_TOOLTIP_LINE | "Line"
ANN_AUTOTEXT_TOOLTIP_RECT | "Rect"
ANN_AUTOTEXT_TOOLTIP_ELLIPSE | "Ellipse"
ANN_AUTOTEXT_TOOLTIP_POLYLINE | "Polyline"
ANN_AUTOTEXT_TOOLTIP_POLYGON | "Polygon"
ANN_AUTOTEXT_TOOLTIP_POINTER | "Pointer"
ANN_AUTOTEXT_TOOLTIP_FREEHAND | "Freehand"
ANN_AUTOTEXT_TOOLTIP_HILITE | "Hilite"
ANN_AUTOTEXT_TOOLTIP_REDACT | "Redact"
ANN_AUTOTEXT_TOOLTIP_TEXT | "Text"
ANN_AUTOTEXT_TOOLTIP_NOTE | "Note"
ANN_AUTOTEXT_TOOLTIP_STAMP | "Stamp"
ANN_AUTOTEXT_TOOLTIP_RUBBERSTAMP | "Rubber Stamp"
ANN_AUTOTEXT_TOOLTIP_HOTSPOT | "Hotspot"
ANN_AUTOTEXT_TOOLTIP_FREEHANDHOTSPOT | "Freehand Hotspot"
ANN_AUTOTEXT_TOOLTIP_AUDIO | "Audio"
ANN_AUTOTEXT_TOOLTIP_BUTTON | "Button"
ANN_AUTOTEXT_TOOLTIP_RULER | "Ruler"
ANN_AUTOTEXT_TOOLTIP_CROSSPRODUCT | "Crossproduct"
ANN_AUTOTEXT_TOOLTIP_POINT | "Point"
ANN_AUTOTEXT_TOOLTIP_PROTRACTOR | "Protractor"
ANN_AUTOTEXT_TOOLTIP_PUSHPIN | "Pushpin"


Annotation Automation Transparent Color Dialog Strings

The following are constants and their default values. You can get the current value using the AnnGetAutoText method. You can modify the string using the AnnSetAutoText method.

Constant | Default String
ANN_AUTOTEXT_TRANSPARENTCOLOR_CAPTION | "Pick transparent color"
ANN_AUTOTEXT_TRANSPARENTCOLOR_COLORARRAYFRAME | "Bitmap colors"
ANN_AUTOTEXT_TRANSPARENTCOLOR_CURRENTCOLORFRAME | "Current color"
ANN_AUTOTEXT_TRANSPARENTCOLOR_COLOR | "Color:"
ANN_AUTOTEXT_TRANSPARENTCOLOR_RED | "Red:"
ANN_AUTOTEXT_TRANSPARENTCOLOR_GREEN | "Green:"
ANN_AUTOTEXT_TRANSPARENTCOLOR_BLUE | "Blue:"
ANN_AUTOTEXT_TRANSPARENTCOLOR_OK | "OK"
ANN_AUTOTEXT_TRANSPARENTCOLOR_CANCEL | "Cancel"


Audio File Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you specify the WAV file for an audio clip annotation object. It is implemented using the Windows common dialog box.


Color Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you change the foreground or background color property of an annotation object. It is implemented using the Windows common dialog box. To see how the foreground and background colors affect the appearance of an object, refer to Illustration of Fill Options for Annotations.


Encrypt Dialog Box For Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Encrypt on the Encrypt properties menu of an Encrypt annotation object. This dialog is used to set the key, type (encryptor or decryptor), and location of the encrypt object.


Encrypt Metafile Dialog Box For Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you specify the metafile or secondary metafile for an encryptor or decryptor annotation object. It is implemented using the Windows common dialog box.


Decrypt Metafile Dialog Box For Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when the Decrypt Metafile item on the Default Properties menu is selected. It is implemented using the Windows common dialog box.


Fill Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The Fill dialog box appears in automation mode when you change the fill properties of an annotation object. The following figure displays the Fill dialog for the Stamp object:

Previous versions of LEADTOOLS supported annotations with translucent backgrounds. Version 14.5 of LEADTOOLS adds an alpha option that allows you to specify an alpha value from 0 (completely transparent background) to 255 (completely opaque background) inclusive.

When enabled using the AnnSetOptions method, you can right-click an annotation object to display the Fill dialog with the new alpha option. Here you can enter an alpha value from 0 – 255 inclusive.

The following figure displays rectangle annotation objects using different alpha values:

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations. For possible polygon fill modes, refer to Illustration of the Polygon Fill Mode for Annotations.

For more information, see the documentation for the AnnGetFillModeExt method and the AnnSetFillModeExt method.


Fixed Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Fixed on the Properties menu of an annotation object that can be Fixed.


Font Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you change the font properties of an annotation object. It is implemented using the Windows common dialog box. The font size is based on the associated bitmap's physical resolution (DPI), so that it matches the scale of the original scanned image.


Hotspot Metafile Dialog Box For Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you update the metafile property of a Hotspot or Freehand Hotspot tool. It is implemented using the Windows common dialog box.


Illustration of Fill Options for Annotations

Note: This topic is for Document/Medical only.

Previous versions of LEADTOOLS supported annotations with translucent backgrounds. Version 14.5 of LEADTOOLS adds an alpha option that allows you to specify an alpha value from 0 (completely transparent background) to 255 (completely opaque background) inclusive.

When enabled using the AnnSetOptions method, you can right-click an annotation object to display the Fill dialog with the new alpha option. Here you can enter an alpha value from 0 – 255 inclusive. The following figure displays the Fill dialog for the Stamp object:

The following figure displays rectangle annotation objects using different alpha values:

For more information, see the documentation for the AnnGetFillModeExt method and the AnnSetFillModeExt method.

The following rectangle annotation objects illustrate the available fill modes and patterns. The foreground and background colors help to illustrate the effects.

Back row:

Fill mode: Opaque
Fill pattern: Solid
Fore color: Black
Back color: Yellow

Fill mode: Opaque
Fill pattern: Cross
Fore color: Black
Back color: Yellow

Fill mode: Opaque
Fill pattern: Backward diagonal
Fore color: Black
Back color: Yellow

Fill mode: Opaque
Fill pattern: Vertical
Fore color: Black
Back color: Yellow

Front row:

Fill mode: Translucent
Fill pattern: Forward diagonal
Fore color: Black
Back color: Green

Fill mode: Transparent
Fill pattern: Diagonal cross
Fore color: Black
Back color: Green

Fill mode: Opaque
Fill pattern: Horizontal
Fore color: Red
Back color: Green


Illustration of Line Styles for Annotations

Note: This topic is for Document/Medical only.

The following rectangle annotation objects illustrate the available line styles. Note that Windows displays all lines greater than 1 pixel as solid.

Back row: | Solid | Dash | Dot
Front row: | Dash-dot | Dash-dot-dot | Null


Illustration of the Polygon Fill Mode for Annotations

Note: This topic is for Document/Medical only.

The following polygon annotation objects illustrate the available polygon fill modes.

Winding | The area inside the resulting exterior lines is filled.
Alternae | The filled area includes the area between odd-numbered and even-numbered polygon sides on each scan line.


Line Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you change the line properties of an annotation object. The line width is based on the associated bitmap's physical resolution (DPI), so that it matches the scale of the original scanned image. Setting the width to a small number will not make the line disappear. On any output device, lines will always be at least one pixel wide. To see the possible line styles, refer to Illustration of Line Styles for Annotations.


Name Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you change the name properties of an annotation object.


Nodes Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Nodes on the automation menu of an annotation object. This dialog is used to set the options displaying nodes for the object.


Password Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in Automation mode when you lock or unlock an object or group of objects.


Point Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Point on the Point Properties menu of a point annotation object.


Point File Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Bitmap on the Point Properties menu of a point annotation object. It is implemented using the Windows common dialog box.


Protractor Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Protractor on the Protractor properties menu of a protractor annotation object. This dialog is used to set the protractor options for the object.


Push pin File Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Bitmap on the Pushpin Properties menu of a Pushpin annotation object. This dialog is used to set the primary bitmap for the object, which displays in the top-left corner of the note along with the text when in design mode.

The following dialog box appears in automation mode when you select Secondary Bitmap on the Pushpin Properties menu of a Pushpin annotation object. This dialog is used to set the secondary bitmap for the object. The secondary bitmap is shown by itself when the note is minimized. In design mode, the ANN_OBJECT_PUSHPIN object shows the text and displays the primary bitmap. In the run mode the object shows or hides the text when clicked.


ROP2 Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in Automation mode when you select the ROP2 option on the "Default properties" menu item.

Selecting "Copy" draws the object using the object's color.

Selecting "And" draws the object, performing an AND between the object's color and the background color. This creates a highlight effect. White objects become transparent.

Selecting "XOR" draws the object, performing an XOR between the object's color and the background color. This creates an inverted effect. Black objects become transparent.


Ruler Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in Automation mode when you select the Ruler option on the "Default properties" menu item.


Stamp Bitmap Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you update the Bitmap property of a Stamp (including the Rubber Stamp tools) annotation object or one of the Rubber Stamp tools. It is implemented using the Windows common dialog box.

Note that Stamp (including the Rubber Stamp tools) objects can display text, a bitmap or a metafile. Setting an object to display one of these destroys any settings that exist for the other two.


Stamp Metafile Dialog Box For Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you update the metafile property of a Stamp or Rubber Stamp tool. It is implemented using the Windows common dialog box.

Note that these objects can display text, a bitmap or a metafile (only one of these can be displayed at any time). Setting an object to display one of these destroys any settings that exist for the other two.


Text Dialog Box for Annotations

Note: This topic is for Document/Medical only.

The following dialog box appears in automation mode when you change the text property of an annotation object. Word wrap is implemented in the dialog box and in the rectangle that defines the annotation object.


Annotation Automation Object

Note:

This topic is for Document/Medical only.

The annotation automation object (ANN_OBJECT_AUTOMATION) is an object that lets you maintain default properties when using the automated annotation functions. This object has no position or dimensions. It is never placed in a container, but is associated with a root container accessed through the AnnContainer property.

Any properties that you set in the automation object become the default values for any new objects that are inserted into the associated container. In addition to the properties of other object types, the automation object also has properties, such as the default toolbar selection, that control the automated user interface.

This object has an automation tool property that you can use without implementing the toolbar. For example, if you want to supply your own toolbar or menu options, you can use the automation object alone to keep track of the tool selection.

Applicable properties have the following defaults, which you can change:

Automation tool | Defaults to the selection pointer. It can be changed using the AnnTool property.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the AnnSetROP2 method.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the AnnSetTransparent method.
Transparent Color | Defaults to White. It can be changed using the AnnSetTransparentColor method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Polygon fill mode | Defaults to winding. It can be changed using the AnnSetPolyFillMode method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect Highlight, Redaction, or Note objects.
Note Background Color | Defaults to yellow. It can be changed using the AnnSetAutoBackColor method.
Redact Background Color | Defaults to black. It can be changed using the LAnnSetAutoBackColor method.
Hilite Background Color | Defaults to yellow. It can be changed using the AnnSetAutoBackColor method.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Button Font | Defaults to a regular MS Sans Serif red font at 10 points.
Hotspot Metafile | Defaults to a campfire graphic. It can be changed using the AnnSetPredefinedMetafile method.
Encrypt Metafile | Defaults to an image of a black skeleton key. It can be changed using the AnnSetPredefinedMetafile method.
Decrypt Metafile | Defaults to an image of a red skeleton key. It can be changed using the AnnSetPredefinedMetafile method.
Ruler | Defaults to Show Length and Show Tic Marks, using smart English as the measurement unit with a precision of 2, and a tic mark length of 30. These options can be changed using the AnnSetShowFlags method, the AnnSetGaugeLength method, and the AnnSetUnit method.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Protractor | Defaults to drawing the inside angle in degrees with a precision of 2 and at an arc radius of 30. These options can be changed using the AnnSetProtractorOptions method and the AnnSetShowFlags method.
Point | Defaults to using a bitmap and not using transparent color. These options can be changed using the AnnSetTransparent method, the AnnSetTransparentColor method, the AnnPredefinedRaster property, and the AnnSetBitmap method.
Encrypt | Defaults to Encryptor. Set encryption options using the AnnSetEncryptOptions method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Menus enabled | Defaults to TRUE. It can be changed using the AnnAutoMenuEnable property.
Automation text strings | Default to hard-coded strings for menus and dialog boxes. Strings can be changed using the AnnSetAutoText method.
Highlight Pen Color | Defaults to white. It can be changed using the AnnAutoHilightPen property.

Use the AnnSetOptions method and the AnnGetOptions method to control the following features:

Rubber Stamp Display Style

XP Style Annotation Toolbar

Alpha Background Fill Option

Annotation Rotate Option

Annotation Side Handles

Annotation Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the AnnGetTextOptions method and the AnnSetTextOptions method to set the objects to show or hide the text and to set the color of the text. In addition, if the annotation objects are text or stamp objects these methods can set the objects to show or hide the borders of the object. In version 14.5, note that these features must be enabled using the AnnSetOptions method.

Use the AnnSetFillMode method and the AnnGetFillMode method to manage the fill mode used by annotation objects. The AnnSetFillModeExt method and the AnnGetFillModeExt method extends the original methods to support the ANN_FILLMODE_ALPHA fill mode. Before calling these two methods, enable the alpha background fill mode by calling the AnnSetOptions method.

Related topics:

New Annotation Features of Version 14.5

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects

Using Annotation Bitmap Objects


Audio Clip Annotation Object

Note:

This topic is for Document/Medical only.

The audio clip annotation object (ANN_OBJECT_AUDIO) is a rectangle containing a scaled image that can be activated to play a WAV file. With the automated functions, in design mode, the user clicks and drags to specify the rectangle in the current window. A dialog box then lets the user specify the WAV file. In run mode, clicking on the icon plays the WAV file.

When you save this type of annotation, the WAV file is not saved. Only its path, specified in the text property, is saved.

You cannot flip, reverse, or rotate an audio clip. If you flip, reverse, or rotate a container that includes an audio clip, the object will move to the new position, but will retain its orientation.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Name | Defaults to empty string. It can be changed using AnnSetNameOptions.
Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Text | Defaults to an empty string. It can be changed to the path of the WAV file using the AnnSetText method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Button Annotation Object

Note:

This topic is for Document/Medical only.

The Button annotation object (ANN_OBJECT_BUTTON) is an image of a standard Windows button that can be activated. With the automated functions, the user clicks and drags to specify the rectangle in the current window. A dialog box then lets the user enter the text for the Button. In run mode, clicking on the button triggers an AnnClicked event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method.
Font | Defaults to a regular MS Sans Serif red font at 10 points. It can be changed using the AnnSetFontSize method, the AnnSetFontUnderline method, the AnnSetFontStrikeThrough method, the AnnSetFontItalic method, the AnnSetFontBold method, and the AnnSetFontName method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnSetText method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the AnnTextExpandTokens property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Closed Curve Annotation Object

The Closed Curve annotation object (ANN_OBJECT_CURVECLOSED) is a sequence of points that are joined by cubic polynomials such that adjacent polynomials are continuous at the first and second derivates. Unlike the Curve annotation object, the first and last endpoints are also joined by a curve. The result is a smooth, continuous closed curve going through all the points.

With the automated functions, each curve is formed with a mouse click, and the object is completed on a double click.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Polygon fill mode | Defaults to winding. It can be changed using the AnnSetPolyFillMode method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features


Container Annotation Object

Note:

This topic is for Document/Medical only.

The container annotation object (ANN_OBJECT_CONTAINER) is a rectangle that is normally transparent, with a NULL line style. With the automated functions, its only purpose is to group other objects, including other container objects.

With low-level functions, you can insert and remove objects from a container, and you must specify the coordinates of an object relative to the container that it is in. The outermost (root) container establishes the frame of reference for all other objects, as explained in Low-Level Coordinate System for Annotations.

With low-level functions, you must specify the defining rectangle. Other applicable properties for the container have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method .
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method .
Foreground color | Defaults to black. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method.
Name | Defaults to empty string. It can be changed using AnnSetNameOptions.
Line width | Defaults to 1. It can be changed using the AnnSetLineWidth method. (Values equate to a minimum of 1 pixel when displayed.)
Line style | Defaults to NULL. It can be changed using the AnnSetLineStyle method .
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method .
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillMode method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method. To retrieve its value, use the AnnGetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property .
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property

Use the AnnSetOptions method and the AnnGetOptions method to control the following features:

Rubber Stamp Display Style

XP Style Annotation Toolbar

Alpha Background Fill Option

Annotation Rotate Option

Annotation Side Handles

Annotation Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the AnnGetTextOptions method and the AnnSetTextOptions method to set the objects to show or hide the text and to set the color of the text. In addition, if the annotation objects are text or stamp objects these methods can set the objects to show or hide the borders of the object. In version 14.5, note that these features must be enabled using the AnnSetOptions method.

Use the AnnSetFillMode method and the AnnGetFillMode method to manage the fill mode used by annotation objects. The AnnSetFillModeExt method and the AnnGetFillModeExt method extends the original methods to support the ANN_FILLMODE_ALPHA fill mode. Before calling these two methods, enable the alpha background fill mode by calling the AnnSetOptions method.

Related topics:

New Annotation Features of Version 14.5

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations


Crossproduct Annotation Object

Note:

This topic is for Document/Medical only.

The CrossProduct annotation object (ANN_OBJECT_CROSSPRODUCT) consists of two rulers intersecting at right angles. With the automated functions, the CrossProduct is started on a mouse-down event and completed on a mouse-up event.

With low-level functions, the points must be defined by calling the AnnSetPoints method. The points are ordered as follows:

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Ruler show flags | Defaults to Show Length and Show Tic Marks, using smart English as the measurement unit with a precision of 2, and a tic mark length of 30. These options can be changed using the AnnSetShowFlags method, the AnnSetGaugeLength method, and the AnnSetUnit method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Using Rulers in Annotation Objects


Curve Annotation Object

The Curve annotation object (ANN_OBJECT_CURVE) is a sequence of points that are joined by cubic polynomials such that adjacent polynomials are continuous at the first and second derivates. The result is a smooth, continuous curve going through all the points.

With the automated functions, each curve is formed with a mouse click, and the object is completed on a double click.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features


Ellipse Annotation Object

Note:

This topic is for Document/Medical only.

The ellipse annotation object (ANN_OBJECT_ELLIPSE) is a simple ellipse. With the automated functions, the user clicks and drags to specify the ellipse in the current window.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Encrypt Annotation Object

The Encrypt annotation object (ANN_OBJECT_ENCRYPT) is a rectangluar object that is used to encrypt rectangular portions of a bitmap.

It can also be used to encrypt the entire bitmap. In automated mode, the Encrypt object is created by clicking and dragging the mouse to create the rectangular encrypt object. In design mode, the Encrypt object is visible but partially transparent to show the part of the image that it covers. In run mode, the encrypt object is invisible.

You must call the AnnEncryptApply method to apply the Encrypt object. Once applied, the portion of the bitmap under the Encrypt object becomes scrambled, and the Encrypt object state changes to decryptor. Using different keys before calling this function gives different scrambling patterns. The decryptor state differs from the encryptor state in that a decryptor cannot be moved, and cannot be changed to an encryptor. The scrambling can be removed by calling the AnnEncryptApply method on the decrypt object with the appropriate arguments. If successful, the decryptor state changes to encryptor. An Encrypt object in the encryptor state can be moved, can have its key changed, and can be changed to a decrypt object.

The Encrypt object is useful for encrypting portions of a bitmap. After encrypting, the scrambled bitmap cannot easily be unscrambled without the associated annotation file. The scrambling can be removed by using the associated annotation file, or by using automation mode to manually change the state from encryptor to a decryptor, position it correctly, and setting the key appropriately.

Overlapping regions can be encrypted. When encrypting overlapping regions, note the following points:

All annotation objects have an order in which they are drawn (the Z-order).

The encryptors are encrypted from the front of the Z-order to the back.

Those that are drawn first are encrypted first. Those that are drawn last ("on top" of other encryptors) are encrypted last.

The Z-order can be changed through automation by right-clicking and choosing "Send To Front" or "Send To Back".

The Decrypt objects are decrypted in reverse order of the Encrypt objects.

Use the AnnGetEncryptOptions method to get the encrypt options of an Encrypt or a Decrypt object. These options are in an ILEADRasterAnnotation Interface.

Use the AnnSetEncryptOptions method to set the encrypt options of an Encrypt or a Decrypt object. These options are in an ILEADRasterAnnotation Interface.

Use the AnnGetSecondaryMetafile method to retrieve the current metafile for an Encrypt object in a ‘decryptor’ state.

Use the AnnGetMetafile method to retrieve the current metafile for an Encrypt object in an ‘encryptor’ state.

Use the AnnSetMetafile method to change the metafile for an Encrypt or Decrypt object.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Metafile | Defaults to a black skeleton key. It can be changed using the AnnSetMetafile method.
Secondary Metafile | Defaults to a red skeleton key. It can be changed using the AnnSetMetafile method.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

AnnGetEncryptOptions

AnnSetEncryptOptions

AnnEncryptApply

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Freehand Hot Spot Annotation Object

Note:

This topic is for Document/Medical only.

The Freehand Hot Spot annotation object (ANN_OBJECT_FREEHANDHOTSPOT) is an array of points that create a sequence of joined lines. With the automated functions, in design mode, each line segment is formed with a mouse move event when the left button is down, and the object is completed on a mouse up event. In run mode, the object is transparent, but the mouse pointer changes to a hand when it is over the object. on the button triggers an AnnClicked event.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Metafile | Defaults to a campfire graphic. It can be changed using the AnnSetMetafile method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Freehand Line Annotation Object

Note:

This topic is for Document/Medical only.

The freehand annotation object (ANN_OBJECT_FREEHAND) is an array of points that create a sequence of joined lines. With the automated functions, each line segment is formed with a mouse move event when the left button is down, and the object is completed on a mouse up event.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Highlight Annotation Object

Note:

This topic is for Document/Medical only.

The Highlight annotation object (ANN_OBJECT_HILITE) is a rectangle with default properties that are appropriate for highlighting an area. With the automated functions, the user clicks and drags to specify the rectangle in the current window.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Background color | Defaults to Yellow - RGB(255, 255, 0). It can be changed using the AnnSetAutoBackColor method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Hot Spot Annotation Object

Note:

This topic is for Document/Medical only.

The Hot Spot annotation object (ANN_OBJECT_HOTSPOT) is a rectangle that can be activated for an application-defined purpose. With the automated functions, in design mode, the rectangle contains a scaled image. The user clicks and drags to specify the rectangle in the current window. In run mode, the object is transparent, but the mouse pointer changes to a hand when it is over the object. Clicking on the button triggers an AnnClicked event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Metafile | Defaults to a campfire graphic. It can be changed using the AnnSetMetafile method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Line Annotation Object

Note:

This topic is for Document/Medical only.

The line annotation object (ANN_OBJECT_LINE) is a simple line. With the automated functions, the line is started on a mouse-down event and completed on a mouse-up event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the line. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Note Annotation Object

Note:

This topic is for Document/Medical only.

The Note annotation object (ANN_OBJECT_NOTE) is a rectangle with a shadow border and color background (yellow by default). It contains a character string with font properties. The text will wrap on word breaks within the object's specified rectangle. With the automated functions, the user clicks and drags to specify the rectangle in the current window. A dialog box then lets the user enter the text.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to yellow - RGB(255, 555, 0). It can be changed using the AnnSetBackColor method.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnSetText method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Text Alignment | Defaults to left alignment. It can be changed using the AnnTextAlign property.
Text Rotate | Defaults to no rotation. It can be changed using the AnnTextRotate property.
Text Pointer | The pointer part of the text pointer does not move when the object moves. It can be changed using the AnnTextPointerFixed property.
Expand Tokens | Defaults to expand tokens. It can be changed using the AnnTextExpandTokens property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Point Annotation Object

Note:

This topic is for Document/Medical only.

The hot spot annotation object (ANN_OBJECT_POINT) is single point. With the automated functions, in design mode, each point is formed with a mouse click event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the point by calling the AnnSetPoints method. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Transparent option | Defaults To Use Transparent Color. It can be changed using the AnnSetTransparent method.
Transparent Color | Defaults to White. It can be changed using the AnnSetTransparentColor method.
Bitmap | Defaults to NULL. It can be changed using the AnnSetBitmap method.
Point | Defaults to a bitmap of a cross inside a circle. It can be changed using the AnnPredefinedRaster property function.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Using Annotation Bitmap Objects


Pointer Annotation Object

Note:

This topic is for Document/Medical only.

The Pointer annotation object (ANN_OBJECT_POINTER) is defined by two points with an arrow at the first point. With the automated functions, the user clicks and drags to specify the points in the current window.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the points of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Polygon Annotation Object

Note:

This topic is for Document/Medical only.

The Polygon annotation object (ANN_OBJECT_POLYGON) is an array of points that defines the vertices of a polygon. With the automated functions, each line segment is formed with a mouse click, and the object is completed on a double click, which closes the polygon with a line from the last point to the first point.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Polygon fill mode | Defaults to winding. It can be changed using the AnnSetPolyFillMode method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Polyline Annotation Object

Note:

This topic is for Document/Medical only.

The Polyline annotation object (ANN_OBJECT_POLYLINE) is an array of points that creates a sequence of joined lines. With the automated functions, each line segment is formed with a mouse click, and the object is completed on a double click.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Nodes | Defaults to displaying every node. It can be changed using the AnnSetNodes method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Polyruler Annotation Object

Note: This topic is for Document/Medical only.

The Polyruler annotation object (ANN_OBJECT_POLYRULER) is an array of points that create a sequence of joined rulers. In design mode, each line segment is formed with a mouse click, and the object is completed on a double click.

The Polyruler can be used to measure the distance of an irregularly shaped object. As ruler segments are added, removed, or changed in length, a running total of the total distance is displayed.

The points can be changed using the AnnGetPointX method, AnnGetPointY method and AnnSetPoints method.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the shape of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Ruler show flags | Defaults to Show Length and Show Tic Marks, using smart English as the measurement unit with a precision of 2, and a tic mark length of 30. These options can be changed using the AnnSetShowFlags method, the AnnSetGaugeLength method, and the AnnSetUnit method.
Gauge length | Defaults to 30. It can be changed using the AnnSetGaugeLength method.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the AnnSetUnit method.
Unit abbreviation | Varies depending on the length shown. It can be changed using the AnnSetUnit method.
Precision | Defaults to 2. It can be changed using the AnnSetUnit method.
Tic Marks | Defaults to Show Tic Marks. It can be changed using the AnnSetUnit method.
Tic Mark Length | Defaults to 30. Can be changed using the AnnTicMarkLength property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

New Annotation Features of Version 14.5

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features

Using Rulers in Annotation Objects


Protractor Annotation Object

Note:

This topic is for Document/Medical only.

The protractor annotation object (ANN_OBJECT_PROTRACTOR) consists of two simple lines joined at a vertex to create an angle. With the automated functions, the first line of the protractor is started on a mouse-down event and completed on a second mouse-down event. The second line is completed on a third mouse-down event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Ruler show flags | Defaults to not show the Length, the Gauge or the Tic Marks. These options can be changed using the AnnSetShowFlags method, the AnnSetGaugeLength method, and the AnnSetUnit method.
Protractor | Defaults to displaying the inside (acute) angle, measured in degrees, to a precision of two places right of the decimal, and an arc radius of 30. These settings can be changed using the AnnSetProtractorOptions method. To retrieve the current values, use the AnnGetProtractorOptions method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

To get the angle of the Protractor object in the object's unit of measurement, use AnnGetAngle method

Related topics:

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Using Rulers in Annotation Objects


PushPin Annotation Object

Note:

This topic is for Document/Medical only.

The PushPin annotation object (ANN_OBJECT_PUSHPIN) is a rectangle containing a scaled image that can be activated to show a hidden note. With the automated functions, in design mode, the user clicks and drags to specify the rectangle in the current window. A dialog box then lets the user specify the preferred options. In run mode, clicking on the icon display the hidden note.

A pushpin object has a primary bitmap, (manipulated using the AnnSetBitmap method/AnnGetBitmap method ) when the text is shown, and a secondary bitmap, changed using AnnSetSecondaryBitmap method . The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized.

In design mode, the PushPin object shows the text and displays the primary bitmap. In run mode, the object shows/hides the text when clicked. The pushpin object has the active mode property. When the mode is ANNACTIVE_ENABLED, the text is shown and the primary bitmap is painted in the top-left corner of the note.

When the mode is ANNACTIVE_DISABLED, the text is hidden and the secondary bitmap is displayed.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to yellow. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnSetText method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Bitmap | Defaults to NULL. It can be changed using the AnnSetBitmap method.
SecondaryBitmap | Defaults to a Push pin bitmap. It can be changed using the AnnSetSecondaryBitmap method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Using Annotation Bitmap Objects


Rectangle Annotation Object

Note:

This topic is for Document/Medical only.

The rectangle annotation object (ANN_OBJECT_RECT) is a simple rectangle. With the automated functions, the user clicks and drags to specify the rectangle in the current window.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Redaction Annotation Object

Note:

This topic is for Document/Medical only.

The Redaction annotation object (ANN_OBJECT_REDACT) is a rectangle with default properties that are appropriate for blacking out an area. With the automated functions, the user clicks and drags to specify the rectangle in the current window.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Background color | Defaults to Black
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Rich Text Annotation Object

Note: This topic is for Document/Medical only.

The Rich Text annotation object (ANN_OBJECT_RTF) is a rectangle containing text that supports the Rich Text Format (RTF) file format.

In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the text annotation square. A dialog box then lets the user enter the text. A menu also appears for further formatting of text. Formatting support includes:

Font

Font size

Bold

Italic

Underline

Foreground Color

Background Color

Bullets

Numbering

Indenting

Alignment

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the rectangle that contains the text. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnRTFText property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features


Rubber Stamp Annotation Object

Note:

This topic is for Document/Medical only.

The Rubber Stamp tool is a Stamp object that uses a predefined metafile. For more information about the stamp tool, refer to Stamp Tool.

For each Rubber Stamp there is a corresponding tool that can be set using the AnnTool property. The Rubber Stamp tools use the ANNTOOL_STAMP_XXX values.

Related topics:

Using Annotation Bitmap Objects


Ruler Annotation Object

Note:

This topic is for Document/Medical only.

The ruler annotation object (ANN_OBJECT_RULER) is a simple line with gauges on both ends for measuring distance. With the automated functions, the ruler is started on a mouse-down event and completed on a mouse-up event.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must provide the points that define the ruler. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Ruler show flags | Defaults to Show Length and Show Tic Marks, using smart English as the measurement unit with a precision of 2, and a tic mark length of 30. These options can be changed using the AnnSetShowFlags method, the AnnSetGaugeLength method, and the AnnSetUnit method.
Gauge length | Defaults to 30. It can be changed using the AnnSetGaugeLength method.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the AnnSetUnit method.
Unit abbreviation | Varies depending on the length shown. It can be changed using the AnnSetUnit method.
Precision | Defaults to 2. It can be changed using the AnnSetUnit method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

Related topics:

New Annotation Features of Version 14.5

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Using Rulers in Annotation Objects


Stamp Annotation Object

Note:

This topic is for Document/Medical only.

The Stamp annotation object (ANN_OBJECT_STAMP) can be a bitmap image, a metafile, or a text string in a rectangular frame. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two. Initially, the ANN_OBJECT_STAMP displays text. With the automated functions, the user clicks and drags to specify a rectangle. Then, if the user specifies a text string, the text is centered in the rectangle. If the user specifies a bitmap, the bitmap is scaled to fit the rectangle.

On a device that displays 256 colors or less, you should use a fixed palette when displaying bitmaps. Otherwise, a palette shift will occur on stamp objects containing bitmaps.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the AnnSetTransparent method.
Transparent Color | Defaults to White. It can be changed using the AnnSetTransparentColor method.
Fill pattern | Defaults to solid. It can be changed using the AnnSetFillPattern method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using AnnSetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the AnnTextExpandTokens property.
Bitmap | Defaults to Empty. It can be changed using the AnnSetBitmap method.
Metafile | Defaults to Empty. It can be changed using the AnnSetMetafile method.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Text Pointer Annotation Object

Note: This topic is for Document/Medical only.

The Text Pointer annotation object (ANN_OBJECT_TEXTPOINTER) is a rectangle with a line that starts from one of the four corners. The other endpoint of the line can be moved to point to anything on the underlying image. The rectangle contains a character string with font properties. The text will wrap on word breaks within the object's specified rectangle.

With the automated functions, the user clicks and drag to specify the rectangle in the current window. After letting up on the mouse button, the rectangle is specified. Moving the mouse now specifies the line, with a final mouse click defining the line.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the rectangle that contains the text, and the pointer endpoint of the line. See the AnnSetPoints method for more details. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Line width | Defaults to 0.75 points. It can be changed using the AnnSetLineWidth method. (Note that when displayed, the line must have a minimum width of 1 pixel.)
Line style | Defaults to solid. It can be changed using the AnnSetLineStyle method.
ROP2 code | Defaults to ANN_ROP2_COPY. It can be changed using the AnnSetROP2 method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnSetText method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Text Alignment | Defaults to left alignment. It can be changed using the AnnTextAlign property.
Text Rotate | Defaults to no rotation. It can be changed using the AnnTextRotate property.
Text Pointer | The pointer part of the text pointer does not move when the object moves. It can be changed using the AnnTextPointerFixed property.
Expand Tokens | Defaults to expand tokens. It can be changed using the AnnTextExpandTokens property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations

Annotation Objects - Automated Features


Text Annotation Object

Note:

This topic is for Document/Medical only.

The text annotation object (ANN_OBJECT_TEXT) is a rectangle containing a character string with font properties. The text will wrap on word breaks within the object's specified rectangle. With the automated functions, the user clicks and drags to specify the rectangle in the current window. A dialog box then lets the user enter the text.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must specify the rectangle that contains the text. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the AnnSetVisible method.
Selected | Defaults to FALSE. It can be changed using the AnnSetSelected method.
Name | Defaults to an empty string. It can be changed using the AnnSetNameOptions method.
Fill mode | Defaults to transparent. It can be changed using the AnnSetFillModeExt method. For version 14.5, before calling this method enable the alpha background fill mode by calling the AnnSetOptions method.
Foreground color | Defaults to red. It can be changed using the AnnSetForeColor method.
Background color | Defaults to white. It can be changed using the AnnSetBackColor method. The default does not affect highlight, redaction, or note objects.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the AnnSetFontSize method.
Font underline | Defaults to FALSE. It can be changed using the AnnSetFontUnderline method.
Font strikethrough | Defaults to FALSE. It can be changed using the AnnSetFontStrikeThrough method.
Font italic | Defaults to FALSE. It can be changed using the AnnSetFontItalic method.
Font bold | Defaults to FALSE. It can be changed using the AnnSetFontBold method.
Font name | Defaults to "Arial". It can be changed using the AnnSetFontName method.
Text | Defaults to "AaBbYyZz". It can be changed using the AnnSetText method.
Text Displayed* | Defaults to Show text. It can be changed using AnnSetTextOptions method.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using AnnSetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using AnnSetTextOptions.
Text Alignment | Defaults to left alignment. It can be changed using the AnnTextAlign property.
Expand Tokens | Defaults to expand tokens. It can be changed using the L AnnTextExpandTokens property.
Fixed State | Defaults to not fixed. It can be changed using the AnnFixed property.
Hyperlink | Defaults to None. It can be changed using the AnnSetHyperlinkString method.
Tag (identifier) | Defaults to 0. It can be changed using the AnnSetTag method.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the AnnSetWnd method.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the AnnUserMode property.

* Note that in version 14.5, these features must be enabled using the AnnSetOptions method.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Audio Clip Tool

Note: This topic is for Document/Medical only.

The audio clip annotation object is a rectangle containing a scaled image that can be activated to play a WAV file. In design mode, you can click and drag to specify the rectangle in the current window. A dialog box then lets you specify the WAV file. In run mode, clicking on the icon plays the WAV file.

In design mode, you can click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Select a WAV file to load into the object. See Audio File Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

When you save this type of annotation, the WAV file is not saved. Only its path, specified in the text property, is saved.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Audio Clip Annotation Object.


Button Tool

Note: This topic is for Document/Medical only.

The button annotation object is an image of a standard Windows button that can be activated. In design mode, you can click and drag to specify the size of the button in the current window. A dialog box then lets you enter the text for the button. In run mode, clicking on the button triggers an LtAnnEvent with wParam ANN_EVENT_AUTOCLICKED. You can add code to process the event. (The example program merely pops up a message box.)

In design mode, you can then click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations. Note: Only certain font characteristics can be changed for the button tool.

Edit the text. See Text Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Button Annotation Object.


Crossproduct Tool

Note: This topic is for Document/Medical only.

The CrossProduct annotation object (ANN_OBJECT_CROSSPRODUCT) consists of two simple lines intersecting at right angles. With the automated functions, the CrossProduct is started on a mouse-down event and completed on a mouse-up event. Holding down the Shift key while drawing the CrossProduct will make the CrossProduct annotation square.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Change the measurement units, precision and gauge length. Set show flags See Ruler Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to CrossProduct Annotation Object.

Related Topics:

New Annotation Features of Version 14.5


Closed Curve Tool

Note: This topic is for Document/Medical only.

The closed curve annotation object (ANN_OBJECT_CURVECLOSED) is a sequence of points that are joined by cubic polynomials such that adjacent polynomials are continuous at the first and second derivates. Unlike the curve annotation object, the first and last endpoints are also joined by a curve. The result is a smooth, continuous closed curve going through all the points.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operations (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Curve Annotation Object.


Curve Tool

Note: This topic is for Document/Medical only.

The curve annotation object (ANN_OBJECT_CURVE) is a sequence of points that are joined by cubic polynomials such that adjacent polynomials are continuous at the first and second derivates. The result is a smooth, continuous curve going through all the points.

In design mode, each curve is formed with a mouse click, and the object is completed on a double click.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Curve Annotation Object.


Ellipse Tool

Note: This topic is for Document/Medical only.

The Ellipse annotation object is a simple ellipse. In design mode, click and drag to specify the ellipse in the current window. Holding down the Shift key while drawing the ellipse will make the ellipse annotation circular.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode and the fill pattern. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Ellipse Annotation Object.


Encrypt Tool

Note: This topic is for Document/Medical only.

The encrypt annotation object (ANN_OBJECT_ENCRYPT) is a rectangular object that is used to encrypt rectangular portions of a bitmap. It can also be used to encrypt the entire bitmap.

In design mode, the Encrypt object is created by selecting the Encrypt tool and then clicking and dragging the mouse to create the rectangular Encrypt object. Then while the object is selected, right-click the object and select the Encrypt item on the Encrypt Properties menu, enter the key in the Encrypt Properties dialog that appears, and then click Apply. After creating the Encrypt object it is necessary to call the AnnEncryptApply method to scramble the pixels underneath the object. In design mode, the Encrypt object is visible but partially transparent to show the part of the bitmap that it covers.

In run mode, the encrypt object is invisible. In run mode, if an encrypt object (state encryptor) has been applied to the bitmap, the pixels underneath the encryptor’s location are physically scrambled in a manner that depends upon the key used when the encrypt object was created.

An encrypt annotation has two metafiles--one for when it is an encryptor, and one for when it is a decryptor.

The encryptor metafile is changed with the Metafile option (in automation) or the AnnSetMetafile method. The default image is shown in the figure below:

The decryptor metafile is changed with the Secondary Metafile option (in automation) or the AnnSetMetafile method. The default image is shown in the figure below:

If you have one or more encrypt objects selected and you change the "Metafile" then the encryptor metafile changes for all of the selected encrypt objects.

You can also change the metafile and secondary metafiles for all newly created encrypt objects by right-clicking on the image (but not on an annotation), selecting Default Properties and changing the primary/secondary metafiles.

Overlapping regions can be encrypted. When encrypting overlapping regions, note the following points:

All annotation objects have an order in which they are drawn (the Z-order).

The encryptors are encrypted from the front of the Z-order to the back.

Those that are drawn first are encrypted first. Those that are drawn last ("on top" of other encryptors) are encrypted last.

The Z-order can be changed through automation by right-clicking and choosing "Send To Front" or "Send To Back".

The decryptors are decrypted in reverse order of the encryptors.

After creating an encrypt object by designating its key and location, you must call AnnEncryptApply to apply the encrypt object. Once applied, the portion of the bitmap under the encrypt object becomes scrambled, and the encrypt object changes state to become a decryptor. Using different keys before calling this function gives different scrambling patterns The decryptor state differs from the encryptor state in that a decryptor cannot be moved, and cannot be changed to an encryptor. The scrambling can be removed by calling AnnEncryptApply on the decryptor with the appropriate arguments. If successful, the decryptor state changes to encryptor. An encrypt object in that encrytpor state can be moved, can have its key changed, and can be changed to a decryptor.

The encrypt object is useful for encrypting portions of a bitmap. After encrypting, the scrambled bitmap cannot easily be unscrambled without the associated annotation file. The scrambling can be removed by using the associated annotation file, or by using automation mode to manually change the encryptor to a decryptor, position it correctly, and setting the key appropriately.

When a bitmap that has had portion(s) of the bitmap encrypted is saved, the encryption information is saved with the rest of the annotation information in the associated annotation information file.

With low-level functions, you must define the size and position of the rectangle. In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Select a metafile or secondary metafile to load into the object. See Metafile Dialog Box for Annotations.

Change the Encrypt properties. See Encrypt Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Encrypt Annotation Object.


Polyruler Tool

Note: This topic is for Document/Medical only.

The polyruler annotation object is an array of points that create a sequence of joined rulers. In design mode, each line segment is formed with a mouse click, and the object is completed on a double click.

The polyruler can be used to measure the distance of an irregularly shaped object. As ruler segments are added, removed, or changed in length, a running total of the total distance is displayed.

Holding down the Shift key while drawing the rulers will draw the rulers at an angle that is a multiple of 45 degrees.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See the Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Change the measurement units, precision and gauge length. See Ruler Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed state. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Polyruler Annotation Object.


Rich Text Tool

Note: This topic is for Document/Medical only.

The Rich Text annotation object is a rectangle containing containing text that supports Rich Text Format (RTF).

In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the text annotation square. A dialog box then lets the user enter the text. A menu also appears to allow further formatting of text. Formatting support includes:

Font

Font size

Bold

Italic

Underline

Foreground Color

Background Color

Bullets

Numbering

Indenting

Alignment

As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a text object to edit the text. This can be achieved programmatically by calling the AnnTextEdit method.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Rich Text Annotation Object.


Freehand Hot Spot Tool

Note: This topic is for Document/Medical only.

The freehand hot spot annotation object (ANN_OBJECT_FREEHANDHOTSPOT) is an array of points that create a sequence of joined lines. With the automated functions, in design mode, each line segment is formed with a mouse move when the left button is down, and the object is completed on a mouse up. In run mode, the object is transparent, but the mouse pointer changes to a hand when it is over the object. Clicking on the button triggers an LtAnnEvent.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the name. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Select a metafile to load into the Freehand Hotspot. See Metafile Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Freehand Hot Spot Annotation Object.


Freehand Line Tool

The freehand line annotation object is an array of points that create a sequence of joined lines. In design mode, each line segment is formed with a mouse move event when the left button is down, and the object is completed on a mouse up event.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operations (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Freehand Line Annotation Object.


Highlight Tool

Note: This topic is for Document/Medical only.

The highlight annotation object is a rectangle with default properties that are appropriate for highlighting an area. In design mode, you can click and drag to specify the rectangle in the current window.

You can then click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the background color. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Highlight Annotation Object.


Hot Spot Tool

Note: This topic is for Document/Medical only.

The HotSpot annotation object is a rectangle that can be activated for an application-defined purpose. In design mode, the rectangle contains a scaled image. Click and drag to specify the rectangle. Holding down the Shift key while drawing the hot spot will make the HotSpot annotation square. In run mode, the object is transparent, but the mouse pointer changes to a hand when it is over the object. In run mode, clicking on the button triggers an event LtAnnEvent. You can add code to process the event. (The example program merely pops up a message box.)

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Select a metafile to load into the stamp. See Metafile Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Hot Spot Annotation Object.


Line Tool

Note: This topic is for Document/Medical only.

The Line annotation object is a simple line. In design mode, the line is started on a mouse-down event and completed on a mouse-up event. Holding down the Shift key while drawing the line will draw the line at an angle that is a multiple of 45 degrees.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the default Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Line Annotation Object.


Note Tool

Note: This topic is for Document/Medical only.

The Note annotation object is a rectangle with a shadow border and color background (yellow by default). It contains a character string with font properties. The text will wrap on word breaks within the object's specified rectangle. In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the note will make the Note annotation square. A dialog box then lets the user enter the text.

As soon as the Note object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a text object to edit the text. This can be achieved programmatically by calling the AnnTextEdit method.

As soon as the Note object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a note object to edit the text.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Edit the text. See Text Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Note Annotation Object.


Point Tool

Note: This topic is for Document/Medical only.

The hot spot annotation object (ANN_OBJECT_POINT) is single point. With the automated functions, in design mode, each point is formed with a mouse click.

In design mode, you can click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Paste the object.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations

Change the name properties. See Name Dialog Box for Annotations.

Change the line properties. See Line Dialog Box for Annotations.

Change the ROP2 properties. See ROP2 Dialog Box for Annotations.

Make the point transparent or not transparent.

Change the transparent color. See Color Dialog Box for Annotations.

Select a bitmap file. See Point File Dialog Box for Annotations.

Change the point properties. See Point Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects. Note: The actual management of a hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

Flip the object.

For low-level implementation details, refer to Point Annotation Object.


Pointer Tool

Note: This topic is for Document/Medical only.

The Pointer annotation object is defined by two points, with the an arrow at the first point. In design mode, click and drag to specify the points in the current window. Holding down the Shift key while drawing the pointer will draw the pointer annotation object at an angle that is a multiple of 45 degrees.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operations (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Pointer Annotation Object.


Polygon Tool

Note:

This topic is for Document/Medical only.

The Polygon annotation object is an array of points that define the vertices of a polygon. In design mode, each line segment is formed with a mouse click, and the object is completed on a double click, which closes the polygon with a line from the last point to the first point.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Polygon Annotation Object.


Polyline Tool

Note:

This topic is for Document/Medical only.

The Polyline annotation object is an array of points that create a sequence of joined lines. In design mode, each line segment is formed with a mouse click, and the object is completed on a double click.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the node properties. See Nodes Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

(If the object has multiple nodes) Add or delete nodes. Add a node by clicking on the spot where you wish to add a node, then select Add Node. To delete a node, click on the node you wish to delete and select Delete Node.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Polyline Annotation Object.


Protractor Tool

Note: This topic is for Document/Medical only.

The Protractor annotation object (ANN_OBJECT_PROTRACTOR) consists of two simple lines joined at a vertex to create an angle. With the automated functions, the first line of the protractor is started on a mouse-down event and completed on a second mouse-down event. The second line is completed on a third mouse-down event. Holding down the Shift key while drawing either of the two lines will draw the line at an angle that is a multiple of 45 degrees.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the measurement units, precision and gauge length. Set show flags See Ruler Dialog Box for Annotations.

Set the protractor options. See Protractor Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Protractor Annotation Object.

Related Topics:

New Annotation Features of Version 14.5


Push Pin Tool

Note: This topic is for Document/Medical only.

The PushPin annotation object (ANN_OBJECT_PUSHPIN) is a rectangle containing a scaled image that can be activated to show a hidden note. With the automated functions, in design mode, the user clicks and drags to specify the rectangle in the current window. Holding down the Shift key while drawing the PushPin will make the PushPin annotation square. A dialog box then lets the user specify the preferred options. In run mode, clicking on the icon display the hidden note.

A PushPin object has a primary bitmap, (manipulated using the AnnSetBitmap method and the AnnGetBitmap method) when the text is shown, and a secondary bitmap, changed using the AnnPredefinedRaster property. The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized.

In design mode, the PushPin object shows the text and displays the primary bitmap. In run mode, the object shows/hides the text when clicked.

As soon as the PushPin object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a PushPin object to edit the text. This can be achieved programmatically by calling the AnnTextEdit method. To get out of edit mode:

Press escape. This cancels the changes.

Press Ctrl-Enter. This accepts the changes.

Click outside the edit box. This accepts the changes.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Edit the text. See Text Dialog Box for Annotations.

Set the primary and secondary bitmaps. See Push pin Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Push pin Annotation Object.


Rectangle Tool

Note: This topic is for Document/Medical only.

The Rectangle annotation object is a simple rectangle. In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the rectangle annotation square.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode and the fill pattern. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Rectangle Annotation Object.


Redaction Tool

Note: This topic is for Document/Medical only.

The Redaction annotation object is a rectangle with default properties that are appropriate for blacking out an area. In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the Redaction annotation square.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See the Name Dialog Box for Annotations.

Change the background color. See Color Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Redaction Annotation Object.


Rubber Stamp Tool

Note: This topic is for Document/Medical only.

The rubber stamp annotation object is a stamp object that has a metafile. For more information about the stamp tool, refer to Stamp Tool.

Change the fixed properties. See Fixed Dialog Box for Annotations.

For each Rubber Stamp, there is a corresponding tool that can be set using AnnTool property. The Rubber Stamp tools are ANN_TOOL_STAMP_XXX.


Ruler Tool

Note: This topic is for Document/Medical s only.

The ruler annotation object is a line that can be used to measure the distance between two points of the original image.

In design mode, you can click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Change the measurement units, precision and gauge length. Set the show flags. See Ruler Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Ruler Annotation Object.


Selection Pointer Tool

Note: This topic is for Document/Medical only.

The selection pointer is the mouse pointer for selecting and manipulating annotation objects in design mode.

With the selection pointer, you can select one or more objects as follows:

You can select a single object by clicking on the object.

You can click and drag to form a rectangular selection area that will select all objects that are completely contained within it.

You can hold down the shift key and click on several objects one-at-a-time to select them all.

Change the fixed properties. See Fixed Dialog Box for Annotations.

When an object is selected, handles appear on the corners of its bounding rectangle. You can click on the body of the object and drag it to another position. You can click on a handle and drag to resize the object. If more than one object is selected, all of them are moved or resized.

In addition, you can use this pointer to rotate an object. If you hold down the shift key, click on a handle, and drag the mouse, the object rotates. If more than one object is selected, all of them are rotated, using the center of the group as the center of rotation. You cannot rotate a note, button, or audio clip. If you rotate a group that includes one of these objects, the object will move to the new position, but will retain its orientation.

The popup menu is also affected if more than one object is selected. In that case, when you click the right mouse button, the popup menu lets you change the properties of all the selected objects, and it lets you delete all the selected objects.


Stamp Tool

Note: This topic is for Document/Medical only.

The Stamp annotation object (ANN_OBJECT_STAMP) can be a bitmap image, a metafile, or a text string in a rectangular frame. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two. Initially, the ANN_OBJECT_STAMP displays text. In design mode, click and drag to specify a rectangle. Holding down the Shift key while drawing the rectangle will make the Stamp annotation square. Then, if a text string is specified, the text is centered in the rectangle. If a bitmap or metafile is specified, the bitmap or metafile is scaled to fit the rectangle.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operations (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode and the fill pattern. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Edit the text.See Text Dialog Box for Annotations.

Select an image file to load into the stamp. See Stamp Bitmap Dialog Box for Annotations.

Select a metafile to load into the stamp. See Metafile Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

On a device that displays 256 colors or less, you should use a fixed palette when displaying bitmaps. Otherwise, a palette shift will occur on stamp objects that contain bitmaps.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Stamp Annotation Object.


Text Tool

Note: This topic is for Document/Medical only.

The Text annotation object is a rectangle containing a character string with font properties. The text will wrap on word breaks within the object's specified rectangle. In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the text annotation square. A dialog box then lets the user enter the text.

As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a text object to edit the text. This can be achieved programmatically by calling the AnnTextEdit method.

As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double click on a text object to edit the text.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Edit the text. See Text Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Text Annotation Object.


Text Pointer Tool

Note: This topic is for Document/Medical only.

The text pointer annotation object (ANN_OBJECT_TEXTPOINTER) is a rectangle with a line that starts from one of the four corners. The other endpoint of the line can be moved to point to anything on the underlying image. The rectangle contains a character string with font properties. The text will wrap on word breaks within the object's specified rectangle.

In design mode, click and drag to specify the rectangle in the current window. After letting up on the mouse button, the rectangle is specified. Moving the mouse now specifies the line, with a final mouse click defining the line.

Holding down the Shift key while drawing the rectangle will make the text annotation square. Holding down the Shift Key will snap the line to angles of 45 degrees.

After the text pointer is defined, a dialog box then lets the user enter the text. As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double-click on a text object to edit the text. This can be achieved programmatically by calling the AnnTextEdit method.

When moving a text pointer, the pointer endpoint of the line can remain fixed, or move with the rest of the text pointer. To change this setting in automation mode, select or deselect the Fixed Pointer check box on the Text Dialog Box for Annotations.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Move the object to the front of the Z-order.

Move the object to the back of the Z-order.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line properties. See Line Dialog Box for Annotations.

Change the binary raster operations (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode. See Fill Dialog Box for Annotations.

Change the foreground and background colors. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Edit the text.See Text Dialog Box for Annotations.

Change the fixed state. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects.

Note:

The actual management of hyperlink must be done through low-level implementation. Only the Menu Item "Hyperlink" and an associated event are provided through the automation object. For more information, refer to Implementing Annotation Hyperlinks.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

For low-level implementation details, refer to Text Pointer Annotation Object.


Markers

Some file formats (TIFF, GIF, PNG, Exif, DICOM, JPEG, LEAD, and IPTC) can contain metadata of various types. "Metadata" refers to extra information that is stored with an image, but is not necessary for decoding the image. For instance, metadata can contain information about the camera used to take the image, the author, date and time the image was taken, where the image was taken, whether the camera has GPS capabilities, etc. When an image is modified, you should preserve the original information, if possible. Metadata includes markers, tags and comments. This topic will deal primarily with markers. For more information on tags and comments, refer to the following topics:

Implementing TIFF Tags

Types of File Comments

JPEG files contain metadata information in user-defined markers. The user-defined markers are in the range 0xE0 to 0xFE. These markers can have a maximum size of 0xFFFD, or 65533 bytes. The markers below 0xE0 are reserved for the encoding of the image and inserting a reserved marker can make a file invalid. Therefore, you should not use reserved markers unless you are well acquainted with markers and image encoding in JPEG files.

TIFF files do not contain markers, however, LEADTOOLS provides a "workaround" for transferring Exif comments from JPEG files to TIFF files, and vice versa. The Exif metadata information from a TIFF file will be loaded as an APP1 marker. Therefore, you can load Exif metadata from an uncompressed file and store it in a compressed Exif file. You can also take metadata information from a compressed Exif file and store it in an uncompressed Exif file. Please note however, that some information cannot be stored inside uncompressed Exif files. For example, audio data is stored in APP2 markers and there is no built-in support for saving APP2 markers in TIFF files. However, you can still save the audio data yourself, using a custom tag. For more information on saving custom tags, refer to Implementing TIFF Tags.

Handling Markers

LEADTOOLS provides several functions for loading, creating, setting, modifying, getting information from and freeing markers.

To load markers from an existing JPEG file, call the Load method. Although TIFF files do not support markers, LEADTOOLS provides limited support through the use of APP1 Exif markers. When you call the Load method for a TIFF file, an APP1 marker is created and all the TIFF, GPS and Exif comments will be stored in it. In addition, any other tag with an ID greater than 0x8000 (32768) will be stored in the APP1 marker. The other information will be considered as being useful only for the image and will not be loaded into the APP1 marker. The only exception is the resolution information, which will be loaded in the APP1 marker.

The CreateMarkers method lets you create a collection of markers from scratch. You can then insert markers with the InsertMarker method. After you call InsertMarker once, you can call EnumMarkers and insert markers using the EnumerateMarkers event.

Markers, like tags and comments can be set so that when a file is saved using the SaveXXX methods, the markers, tags and/or comments that have been set will be saved too. Set the markers to save using the SetMarkers method. Once the markers have been set using SetMarkers, all the save operations from the current thread will use these markers. If you do not want to save any markers, call SetMarkers with the Marker parameter set to NULL. To get the markers that were set by the last call to SetMarkers, call the GetMarkers method.

Please note that both the SetMarkers method and GetMarkers method use copies of the list of markers.

Markers set using SetMarkers can also be written to files using the WriteComment and WriteTag methods. The comments or tags being written by these two methods will overwrite any similar comments or tags contained in the markers. The WriteMetaData method can also be used to write markers, tags and comments to a file. The following is a summary of the methods and the type of data each method writes:

Method | Type of Data
WriteComment | Comments and Markers
WriteTag | Tags and Markers
WriteMetaData | Comments, Tags and Markers

Markers are generally modified by deleting all markers of a certain type. To delete all markers of a certain type, use the DeleteMarker method. To delete a marker at a specific index, use the DeleteMarkerAt method.

The EnumMarkers method can be used to enumerate and modify a marker collection. It is a powerful method, used internally by most marker manipulation functions. For each marker enumerated by EnumMarkers, an EnumerateMarkers event is fired. This event lets you delete markers from or insert markers to the marker collection being enumerated. This allows you to modify the marker collection enumerated by the EnumMarkers method. To insert a new marker in a marker collection, use InsertMarker. You can get a marker by index using the GetMarker method. You can also get individual markers using the EnumMarkers method and the EnumerateMarkers event.

Each marker may consist of one or more elements. When getting a marker using the GetMarker method, the ElementCount property is updated with the number of elements in the marker and the Element property is updated with the actual element(s) that make up that marker. The Type property is updated with type of marker retrieved by the GetMarker method. When inserting a marker using the InsertMarker method, set the desired marker information in the ElementCount, Element and Type properties before calling InsertMarker.

To determine how many markers are in a collection, see the Count property.

Finally, to create a copy of a marker collection and obtain a handle to the new marker collection, use CopyMarkers method.


Implementing TIFF Tags

Only TIFF files support tags. The TIFF 6.0 Specification sets aside a range of private tags that developers can define. The TIFF specification reserved tags 1 to 32767 for general use (restricted tags) and recommends that tags 32768 to 65535 should be used for application use (user-defined tags). To avoid conflicts with files created by other developers, you can register your tag by contacting Adobe Developer Relations. (The E-Mail address posted on The Unofficial TIFF Home Page is gapdevsup@adobe.com.)

To define and set a tag, use the SetTag method.

To read tag data from a file, use the ReadTag method.

To read the tag data from file that is stored in memory, use ReadTagMemory method.

To get information about a tag, use the following:

GetTagData method

GetTagType method

GetTagCount method

To write tag(s) to a file, use the WriteTag method.

To read a comment from a file at a specified location, use the ReadFileCommentOffset method.

You can enumerate tags using the EnumFileTags method. The EnumFileTags method enumerates all tags in a TIFF or Exif file. For each tag enumerated, the EnumTags event is called. Through this event, you can obtain information about, or otherwise process, each tag that is enumerated. Pass FALSE to the StopFireEnumTags property to continue firing the EnumTags event, and pass TRUE to stop firing the EnumTags event.

You can delete a specified tag from the file using the DeleteTag method.


Implementing GeoKeys (GeoTIFF tags)

GeoTIFF files are TIFF files containing a few extra TIFF tags, describing the image location, scale at which the picture was taken and many other information useful for topographic applications.

The GeoTIFF extra data is stored using six standard tags. The following three tags contain scaling information:

ModelTiepointTag = 33922 (0x8482)

ModelPixelScaleTag = 33550 (0x830E)

ModelTransformationTag = 33920 (0x8480)

The following three tags contain many extra values. We will refer to these values stored in these three tags as "GeoKeys":

GeoKeyDirectoryTag 34375 (0x87AF) – This tag will store all the keys and the SHORT values.

GeoDoubleParamsTag 34736 (0x87B0) – This tag will store the DOUBLE values.

GeoAsciiParamsTag 34737 (0x87B1) – This tag will store the ASCII values.

There are 65536 possible GeoKeys values. The GeoTIFF specification recommends you to use the following ranges (domains) for the GeoTIFF data:

0..1023 | Do not use; reserved for future use
1024..2047 | GeoTIFF configuration keys.
2048..3071 | Geographic/Geocentric CS Parameter Keys
3072..4095 | Projected CS Parameter Keys
4096..5119 | Vertical CS Parameter keys
5120..32767 | Reserved
32768..65535 | Private use – use to store your own data

For more information on the GeoTIFF tags and for the complete list of the predefined GeoKeys values; refer to the GeoTIFF specifications found on http://home.earthlink.net/~ritter/geotiff/geotiff.html or http://www.remotesensing.org/geotiff/geotiff.html URLs.

GeoTIFF files also support standard TIFF tags. For more information on standard TIFF tags, refer to Implementing TIFF Tags.

The GeoKeys can be set in preparation for writing or saving files with SetGeoKey method. The GeoKey information will be available in the following properties:

GeoKeyType property

GeoKeyCount property

GeoKeyData property

You can obtain the list of GeoKeys that have been set using GetGeoKey method.

The user can write the GeoKeys in two ways:

1. | When saving a new image as FILE_GEOTIFF with Save method.
2. | You can update an existing file, using WriteFileGeoKeys or WriteMetaData methods.

You can enumerate the GeoKeys from an existing file using EnumFileGeoKeys method. For each GeoKeys enumerated by EnumFileGeoKeys, an EnumGeoKeys event is called. To stop firing the EnumGeoKeys event, set the value of StopFireEnumGeoKeys property to TRUE.

You can read a particular GeoKey from a file using ReadFileGeoKey method.


ISIS Tags

These ISIS Scanner Driver Tags are used to retrieve and set information concerning the scanner and scanning options. They are set using the ISISSetTag method and retrieved using the ISISGetTag method. Possible tags are given below. Not all tags are supported by all drivers and not all values are supported by all drivers. For more information on using ISIS, refer to Using ISIS to Scan Images.

Value | Meaning
TAG_XRESOLUTION | [0x011A] Gets or sets the horizontal resolution in PixelsPerInch.
TAG_YRESOLUTION | [0x011B] Gets or sets the vertical resolution in PixelsPerInch.
TAG_FEEDER | [0x0503] [Read Only] Gets information about the scanner's flatbed and/or feeder. Values may be:
 | TAG_FEEDER_FEED [0x00000001L] Scanner has feeder.
 | TAG_FEEDER_FLAT [0x00000002L] Scanner has flatbed.
 | TAG_FEEDER_TELLFLAT [0x00020000L] Can detect page on flatbed.
 | TAG_FEEDER_TELLFEED [0x00010000L] Can detect page in feeder.
 | TAG_FEEDER_TELLSCAN [0x00040000L] Can only detect by committing.
 | TAG_FEEDER_CENTERFEED [0x00080000L] Can center page in feeder.
 | TAG_FEEDER_CENTERFLAT [0x00100000L] Can detect if page is centered in flatbed.
TAG_XPOSITION | [0x011E] Gets or sets distance from left edge of page to start of image in pixels.
TAG_YPOSITION | [0x011F] Gets or sets distance from top edge of page to start of image in pixels.
TAG_IMAGELENGTH | [0x0101] Gets or sets the number of rows (height) of the image in pixels.
TAG_IMAGEWIDTH | [0x0100] Gets or sets the number of columns (width) of the image in pixels.
TAG_SAMPLESPERPIXEL | [0x0115] Samples per pixel of the scanned image.
TAG_BITSPERSAMPLE | [0x0102] Bits per pixel of the scanned image.
TAG_PHOTOMETRICINTERPRETATION | [0x0106] Indicates whether the image should be interpreted as grayscale or color. Possible values are:
 | TAG_PHOTOMETRIC_WHITE0 [0x0000] binary - 0 represents white
 | TAG_PHOTOMETRIC_WHITE1 [0x0001] binary - 1 represents white
 | TAG_PHOTOMETRIC_RGB [0x0002] RGB
 | TAG_PHOTOMETRIC_PALETTE [0x0003] PALLETTE
 | TAG_PHOTOMETRIC_BGR [0x0120] BGR

Settings for TAG_SAMPLESPERPIXEL, TAG_BITSPERSAMPLE and TAG_PHOTOMETRICINTERPRETATION, and the corresponding color format are given below.

TAG_SCANORIENTATION | [0x0113] [Read Only] Orientation of the page in the scanner's feeder. Values can be:
 | TAG_SCANORIENTATION_PORT [0x0001] portrait.
 | TAG_SCANORIENTATION_LAND [0x0002] landscape.
 | TAG_SCANORIENTATION_180 [0x0003] upside-down portrait.
 | TAG_SCANORIENTATION_270 [0x0004] upside-down landscape.
 | TAG_SCANORIENTATION_PORTM [0x0005] portrait mirrored.
 | TAG_SCANORIENTATION_LANDM [0x0006] landscape mirrored.
 | TAG_SCANORIENTATION_180M [0x0007] upside-down portrait mirrored.
 | TAG_SCANORIENTATION_270M [0x0008] upside-down landscape mirrored.
TAG_SCANTYPE | [0x0514] Specifies the scanning source. Possible values are:
 | TAG_SCANTYPE_AUTOMATIC [0x0000] default - scan from ADF if pages are detected, otherwise scan from flatbed
 | TAG_SCANTYPE_TRANSPARENCY [0x0001] scan from the transparency unit
 | TAG_SCANTYPE_FLATBED [0x0002] scan from the flatbed
 | TAG_SCANTYPE_FEEDER [0x0003] scan only the front side of the page from the feeder
 | TAG_SCANTYPE_FRONTONLY [0x0003] scan only the front side of the page from the feeder
 | TAG_SCANTYPE_DUPLEX [0x0004] scan in duplex mode from the feeder
 | TAG_SCANTYPE_FRONTBACK [0x0004] scan in duplex mode from the feeder
 | TAG_SCANTYPE_BACKFRONT [0x0005] scan in duplex and return back side of the page first from the feeder
 | TAG_SCANTYPE_BACKONLY [0x0006] scan only the back side of the page from the feeder
TAG_SCANAHEAD | [0x050d] State of the ScanAhead feature of the scanner. Possible values are:
 | TAG_SCANAHEAD_NO [0x0000] ScanAhead not enabled.
 | TAG_SCANAHEAD_YES [0x0001] ScanAhead enabled.
TAG_SCANAHEAD_MAXPAGES | [0x057c] Gets or sets the number of pages to buffer.
TAG_MAXPAGES | [0x0504] [Read Only] Gets the number of pages the ADF can hold.
TAG_COMPRESSION | [0x0103] Gets or sets the type of compression to use, if the scanner supports
 | compression. Possible values are:
 | TAG_COMPRESSION_NONE [0x0001] No compression
 | TAG_COMPRESSION_MG3 [0x0002] CCITT compression
 | TAG_COMPRESSION_G3 [0x0003] CCITT G3 1-DIM
 | TAG_COMPRESSION_G4 [0x0004] Standard G4
 | TAG_COMPRESSION_LZW [0x0005] LZW compression
 | TAG_COMPRESSION_JPEG [0x0006] JPEG compression, not supported by LEAD.
 | TAG_COMPRESSION_32771 [0x8003] Packbits compression
 | TAG_COMPRESSION_PACK [0x8005] Packbits compression, not supported by LEAD.
 | TAG_COMPRESSION_JBIG [0x8765] JBIG compression.
 | TAG_COMPRESSION_PCX [0xC350] PCX compression, not supported by LEAD.
 | TAG_COMPRESSION_4BYTE [0xC351] No compression, not supported by LEAD.
 | TAG_COMPRESSION_GIF [0xC355] GIF compression, not supported by LEAD.
 | TAG_COMPRESSION_BMP [0xC356] BMP compression, not supported by LEAD.
TAG_CONTRAST | [0x0501] Gets or sets the contrast value if scanner supports it. Possible values
 | are:
 | TAG_CONTRAST_AUTO [0x0000] AutoContrast or no support
 | > 0 Specific Contrast setting
TAG_BRIGHTNESS | [0x0502] Gets or set the brightness value. Possible values are:
 | TAG_BRIGHTNESS_AUTO [0xFFFFFFFD] AutoBrightness control
 | TAG_BRIGHTNESS_DARKEN [0xFFFFFFFE] Lighten page relative to TAG_BRIGHTNESS_NORM
 | TAG_BRIGHTNESS_NORM [0xFFFFFFFF] Selects "normal" brightness
 | TAG_BRIGHTNESS_LIGHTEN [0x00000000] Darken page relative to TAG_BRIGHTNESS_NORM.
 | Some scanners also support values 1 - 127.
TAG_GAMMA | [0x050f] Gets or sets the Gamma Curve Adjustment value. Possible values are:
 | TAG_GAMMA_AUTO [0x0000] AutoGammaCorrection
 | TAG_GAMMA_DOWNLOAD1 [0x0001] 1st gamma correction table
 | TAG_GAMMA_DOWNLOAD2 [0x0002] 2nd gamma correction table
 | TAG_GAMMA_DOWNLOAD3 [0x0003] 3rd gamma correction table
 | TAG_GAMMA_DOWNLOAD4 [0x0004] 4th gamma correction table
 | TAG_GAMMA_DOWNLOAD5 [0x0005] 5th gamma correction table
 | TAG_GAMMA_DOWNLOAD6 [0x0006] 6th gamma correction table


Maintaining File Comments

Some file formats can contain comments, and some cannot, and each file format has its own set of comment types, as described in Types of File Comments.

An array of comments can be maintained in memory. These comments can be written to a file, along with the control's loaded bitmap, when the file is saved. The comments can also be written to an existing file, without overwriting the stored image. You can maintain an array of comments in memory, and when you save a file, the comments from the array are written to the file. There is an array of comments for each ILEADRasterIO object. You control the contents of the array; loading or saving a file does not initialize the array. You can use the following property to get and set the value of any comment in the array:

Comment property

To read the existing comments from a file, use the following method:

ReadComment method

To write comments to an existing file, without overwriting the stored image with the control's loaded bitmap, use the following method:

WriteComment method


Non-Image Data

Several formats allow you to store non-image data such as comments, tags, and markers. These are discussed in more detail in the following topics:

Markers

Implementing TIFF Comments and Tags

Types of File Comments

In addition, you can also add text or file messages to bitmaps. To add a message to a bitmap, use the AddMessage method. A message that has been added using the AddMessage method can be retrieved using the ExtractMessage method. The following properties are used for getting or setting Information on the message itself:

Message property

Password property

FileName property

Directory property

StartX property

StartY property


Types of File Comments

Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. For applicable comment types, refer to the following:

DICOM File Comments

Exif File Comments

GIF File Comments

IPTC Comments

JPEG and LEAD File Comments

PNG File Comments

TIFF File Comments


GIF File Comments

When reading or updating GIF comments, you can specify only one type of comment.

Value | Meaning
CMNT_SZDESC | Description of the image. This a variable-length character string. The maximum length is 32K.


IPTC Comments

The IPTC-NAA comments are standardized by the International Press Telecommunications Council in collaboration with Newspaper Association of America. More information about these comments can be found on IPTC’s web site (http://www.iptc.org). Many comments have to follow a particular format, so refer to the IPTC documentation to make sure you are writing valid comments.

LEADTOOLS will verify that the size of the comment is within the limits specified by the standard. Comments with invalid length will NOT be written in the file. LEADTOOLS will NOT verify the contents of the data (it will not verify that the numerical comments contain only digits, etc.).

Some of these comments are repeatable (ie you can have more than one comment of this type). To write two or more values for a repeatable comment, concatenate the comments using the IPTC_SEPARATOR as the separator. IPTC_SEPARATOR has an Ascii code of 1 and cannot appear in any comment, so there is not a possibility of confusion about this character is the separator or part of the comment. Do not confuse this with the character ‘1’, whose Ascii code is 49!

When reading a repeatable comment with more than one value, LEADTOOLS will concatenate all the values and use the IPTC_SEPARATOR to separate the values. Therefore, when a comment that might be repeatable is retrieved, it is best to search for the separator.

CMNT_IPTC_KEYWORDS is the best example of a comment that is repeatable. If the file has three keywords (keyword1, keyword2 and keyword3), they will be returned as the following string:

"keyword1\001keyword2\001keyword3".

Every IPTC comment is identified by x:y, where x is the Record number and y is the DataSet number. For example, CMNT_IPTC_KEYWORDS is identified as 2:15. We will list the corresponding "x:y" identifier for every comment supported in LEADTOOLS, together with the length limits.

All the date comments use the format YYYYMMDD, so July 4, 2001 is "20010704".

All the time comments use the format HHMMSS±HHMM, following the ISO 8601 standard. The part after ± is the reference to the Universal Time Format. For example, 3PM Eastern USA time is "150000-0500".

Please note that the IPTC_SEPARATOR is not a comment, it is only a define used for the separator!

IPTC_SEPARATOR ‘\001’ A separator used for repeatable comments.

IPTC comments can be saved inside TIFF and JPEG files.

Value | Meaning
CMNT_IPTC_FIRST | [181] The first IPTC comment To get all IPTC comments, use the comment type constant as a loop counter. The first constant is CMNT_IPTC_FIRST and the last is CMNT_IPTC_ LAST.
CMNT_IPTC_LAST | [226] The last IPTC comment
CMNT_IPTC_VERSION | [181] 2:0, the version of IPTC comments (read-only). Non-repeatable, (min=2 bytes, max=2). This is the only comment that is binary. The first byte is the lower version number (usually 0) and the second byte is the high version number (the current version is 4 - binary 4, not ascii ‘4’). LEADTOOLS writes 4 here.
CMNT_IPTC_OBJECTTYPEREFERENCE | [182] 2:3, Object type reference. Non repeatable. Length = 3..67.
CMNT_IPTC_OBJECTATTRIBUTEREFERENCE | [183] 2:4, Object Attribute Reference. Repeatable. Length = 4..68.
CMNT_IPTC_OBJECTNAME | [184] 2:5, Object name. Non repeatable. Length = 1..64.
CMNT_IPTC_EDITSTATUS | [185] 2:7, Edit status. Non repeatable. Length = 1..64.
CMNT_IPTC_EDITORIALUPDATE | [186] 2:8, Editorial update. Non repeatable. Length = 2..2.
CMNT_IPTC_URGENCY | [187] 2:10, Urgency. Non repeatable. ‘1’ is most urgent, ‘5’ = Normal, ‘8’ is least urgent. Length = 1..1.
CMNT_IPTC_SUBJECTREFERENCE | [188] 2:12, Subject reference. Repeatable. Length = 13..236.
CMNT_IPTC_CATEGORY | [189] 2:15, Category. Non repeatable. Length = 1..3.
CMNT_IPTC_SUPPLEMENTALCATEGORY | [190] 2:20, Supplemental category. Repeatable. Length = 1..32.
CMNT_IPTC_FIXTUREIDENTIFIER | [191] 2:22, Fixture identifier. Non repeatable. Length = 1..32.
CMNT_IPTC_KEYWORDS | [192] 2:25, Keywords. Repeatable. Length = 1..64.
CMNT_IPTC_CONTENTLOCATIONCODE | [193] 2:26, Content location code. Repeatable. Length = 3..3.
CMNT_IPTC_CONTENTLOCATIONNAME | [194] 2:27, Content location name. Repeatable. Length = 1..64.
CMNT_IPTC_RELEASEDATE | [195] 2:30, Release date. Non repeatable. Length = 8..8.
CMNT_IPTC_RELEASETIME | [196] 2:35, Release time. Non repeatable. Length = 11..11.
CMNT_IPTC_EXPIRATIONDATE | [197] 2:37, Expiration date. Non repeatable. Length = 8..8.
CMNT_IPTC_EXPIRATIONTIME | [198] 2:38, Expiration time. Non repeatable. Length = 11..11.
CMNT_IPTC_SPECIALINSTRUCTIONS | [199] 2:40, Special instructions. Non repeatable. Length = 1..256.
CMNT_IPTC_ACTIONADVISED | [200] 2:42, Action advised. Non repeatable. Length = 2..2.
CMNT_IPTC_REFERENCESERVICE | [201] 2:45, Reference service. Repeatable. Length = 1..10.
CMNT_IPTC_REFERENCEDATE | [202] 2:47, Reference date. Repeatable. Length = 8..8.
CMNT_IPTC_REFERENCENUMBER | [203] 2:50, Reference number. Repeatable. Length = 8..8.
CMNT_IPTC_DATECREATED | [204] 2:55, Date created. Non repeatable. Length = 8..8.
CMNT_IPTC_TIMECREATED | [205] 2:60, Time created. Non repeatable. Length = 11..11.
CMNT_IPTC_DIGITALCREATIONDATE | [206] 2:62, Digital creation date. Non repeatable. Length = 8..8.
CMNT_IPTC_DIGITALCREATIONTIME | [207] 2:63, Digital creation time. Non repeatable. Length = 11..11.
CMNT_IPTC_ORIGINATINGPROGRAM | [208] 2:65, Originating program. Non repeatable. Length = 1..32.
CMNT_IPTC_PROGRAMVERSION | [209] 2:70, Program version. Non repeatable. Length = 1..10.
CMNT_IPTC_OBJECTCYCLE | [210] 2:75, Object cycle. Non repeatable. Length = 1..1.
CMNT_IPTC_BYLINE | [211] 2:80, By-line. Repeatable. Length = 1..32.
CMNT_IPTC_BYLINETITLE | [212] 2:85, By-line title. Repeatable. Length = 1..32.
CMNT_IPTC_CITY | [213] 2:90, City Non repeatable. Length = 1..32.
CMNT_IPTC_SUBLOCATION | [214] 2:92, Sub-location. Non repeatable. Length = 1..32.
CMNT_IPTC_PROVINCE_STATE | [215] 2:95, Province/State. Non repeatable. Length = 1..32.
CMNT_IPTC_PRIMARYLOCATIONCODE | [216] 2:100, Country/Primary location code. Non repeatable. Length = 3..3.
CMNT_IPTC_PRIMARYLOCATIONNAME | [217] 2:101, Country/Primary location name. Non repeatable. Length = 1..64.
CMNT_IPTC_ORIGINALTRANSMISSIONREFERENCE | [218] 2:103, Original transmission reference. Non repeatable. Length = 1..32.
CMNT_IPTC_HEADLINE | [219] 2:105, Headline. Non repeatable. Length = 1..256.
CMNT_IPTC_CREDIT | [220] 2:110, Credit. Non repeatable. Length = 1..32.
CMNT_IPTC_SOURCE | [221] 2:115, Source. Non repeatable. Length = 1..32.
CMNT_IPTC_COPYRIGHT | [222] 2:116, Copyright Notice. Non repeatable. Length = 1..128.
CMNT_IPTC_CONTACT | [223] 2:118, Contact. Repeatable. Length = 1..128.
CMNT_IPTC_CAPTION | [224] 2:120, Caption/Abstract. Non repeatable. Length = 1..2000.
CMNT_IPTC_AUTHOR | [225] 2:122, Writer/Editor. Repeatable. Length = 1..32.
CMNT_IPTC_LANGUAGEIDENTIFIER | [226] 2:135, Language identifier. Non repeatable. Length = 2..3.


JPEG, J2K and LEAD File Comments

You can save comments in JPEG files, J2K files and in progressive LEAD CMP files (but not in non-progressive CMP files). When reading or updating these comments, you can specify only one type of comment.

Please note that LEADTOOLS also supports IPTC Comments, which can be saved inside JPEG files. For more information, refer to IPTC Comments.

Value | Meaning
CMNT_SZDESC | [3] Description of the image. This a variable-length character string. The maximum length is 64K.

J2K Comments

CMNT_J2K_BINARY | [179] JPEG 2000 Binary comment
CMNT_J2K_LATIN | [180] JPEG 2000 Latin comment


PNG File Comments

PNG has MMX optimized code for load/save and supports comments as well. The following comments are supported:

Value | Meaning
CMNT_SZARTIST | [0] Person who created the image.
CMNT_SZCOPYRIGHT | [1] Copyright notice.
CMNT_SZDATETIME | [2] Date and time (YYYY:MM:DD HH:MM:SS). The field length is 20, counting the NULL terminator.
CMNT_SZDESC | [3] Description of the image.
CMNT_SZMAKE | [5] Manufacturer of the equipment used to create the image.
CMNT_SZTITLE | [175] Title of the image.
CMNT_SZSOFTWARE | [9] Name and version of software package used to create the image.
CMNT_SZDISCLAIMER | [176] String containing the disclaimer of the software used to create the image.
CMNT_SZWARNING | [177] Warning statement associated with the software that created the image.
CMNT_MISC | [178] Miscellaneous information.


TIFF File Comments

When reading or updating TIFF comments, you must specify the comment type using the following constants.

For a loop counter:

Value | Meaning
CMNT_LAST | Last defined number for comments. To get all comments, you can use the comment type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.

For TIFF files: Each comment field can contain a character string. The maximum field size is 32K, except for the date-time field, which is always 20.

Please note that LEADTOOLS also supports IPTC Comments, which can be saved inside TIFF files. For more information, refer to IPTC Comments.

Value | Meaning
CMNT_SZARTIST | Person who created the image.
CMNT_SZCOPYRIGHT | Copyright notice.
CMNT_SZDATETIME | Date and time (YYYY:MM:DD HH:MM:SS). The field length is 20, counting the NULL terminator.
CMNT_SZDESC | Description of the image.
CMNT_SZHOSTCOMP | Computer and operating system in use.
CMNT_SZMAKE | Manufacturer of the equipment used to create the image.
CMNT_SZMODEL | Model name and number of the equipment.
CMNT_SZNAMEOFDOC | Name of the document from which the image was scanned.
CMNT_SZNAMEOFPAGE | Page name from which the image was scanned.
CMNT_SZSOFTWARE | Name and version of the software package used to create the image.


DICOM File Comments

Note: This topic is for the Medical Imaging only.

When reading or updating DICOM file comments, you must specify the comment type using one of the following constants.

For a loop counter:

Value | Meaning
CMNT_LAST | Last defined number for comments. To get all comments, you can use the comment type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.

For DICOM comments:

Value | Meaning
CMNT_SZPATIENTNAME | Patient name.
CMNT_SZPATIENTID | Patient ID.
CMNT_SZPATIENTBIRTHDATE | Patient birth date.
CMNT_SZPATIENTSEX | Patient sex.
CMNT_SZSTUDYINSTANCE | Study instance ID.
CMNT_SZSTUDYDATE | Study date.
CMNT_SZSTUDYTIME | Study time.
CMNT_SZSTUDYREFERRINGPHYSICIAN | Referring physician.
CMNT_SZSERIESMODALITY | Series modality. This comment determines the type of DICOM file read, or the type of DICOM file to save. It is a NULL terminated string consisting of two bytes. For a list of possible values, refer to Modalities. If you set the comment to anything other than a value listed in Modalities, the DICOM filter will ignore the comment and write "OT" instead.
CMNT_SZSERIESID | Series ID.
CMNT_SZSERIESNUMBER | Series number.


Modalities

Value | Meaning
CR | computed radiography
CT | computed tomography
DS | digital subtraction angiography
MR | magnetic resonance
NM | nuclear medicine
US | ultrasound
OT | other
AS | angioscopy
BI | biomagnetic imaging
CD | color flow doppler
CF | cinefluorography
CP | culposcopy
CS | cystoscopy
DD | duplex doppler
DF | digital fluoroscopy
DG | diaphanography
DM | digital microscopy
EC | echocardiography
ES | endoscopy
FA | fluorescein angiography
FS | fundoscopy
LP | laparoscopy
LS | laser surface scan
MA | magnetic resonance angiography
MS | magnetic resonance spectroscopy
PT | positron emission tomography
RG | radiographic imaging
ST | single photon emission computed tomography
TG | thermography
VF | videofluorography


Exif File Comments

When reading or updating Exif comments, you must specify the comment type using the following constants.

For a loop counter:

Value | Meaning
CMNT_LAST | Last defined number for comments. To get all comments, you can use the comment type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.

TIFF comments in Exif files: All Exif files (TIFF and JPG) can contain the following TIFF comments. Each TIFF comment field can contain a character string. The maximum field size is 32K, except for the date-time field, which is always 20.

Value | Meaning
CMNT_SZARTIST | Person who created the image.
CMNT_SZCOPYRIGHT | Copyright notice.
CMNT_SZDATETIME | Date and time (YYYY:MM:DD HH:MM:SS). The field length is 20, counting the NULL terminator.
CMNT_SZDESC | Description of the image.
CMNT_SZHOSTCOMP | Computer and operating system in use.
CMNT_SZMAKE | Manufacturer of the equipment used to create the image.
CMNT_SZMODEL | Model name and number of the equipment.
CMNT_SZNAMEOFDOC | Name of the document from which the image was scanned.
CMNT_SZNAMEOFPAGE | Page name from which the image was scanned.
CMNT_SZSOFTWARE | Name and version of software package used to create the image.

General Exif comments: Exif files can contain the following general comments. Each comment field is constrained by its Exif data type.

Value | Meaning
CMNT_EXIFVERSION | Exif version. LEADTOOLS always writes this value as 0100, meaning version 1. Data type: UNDEFINED. Length: 4.
CMNT_SZSUBSECTIME | Decimal extension for seconds that are specified in the CMNT_SZDATETIME field. Data type: ASCII. Length: variable.
CMNT_SZDATETIMEORIGINAL | Date and time the original image is captured. The format is YYYY:MM:DD HH:MM:SS. The time is in a 24-hour format, and a blank space is left between the date and the time. Data type: ASCII. Length: 20.
CMNT_SZSUBSECTIMEORIGINAL | Decimal extension for seconds that are specified in the CMNT_SZDATETIMEORIGINAL field. Data type: ASCII. Length: variable.
CMNT_SZDATETIMEDIGITIZED | Date and time the file is generated. If the file is generated directly, as with a digital camera, this is the same as the time the original image is captured. Data type: ASCII. Length: 20.
CMNT_SZSUBSECTIMEDIGITIZED | Decimal extension for seconds that are specified in the CMNT_SZDATETIMEDIGITIZED field. Data type: ASCII. Length: variable.
CMNT_SHUTTERSPEEDVALUE | Shutter speed. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.
CMNT_APERTURE | Aperture value. This is the ratio of lens aperture for the focal length. The unit of measure is APEX. Data type: RATIONAL. Length: 1.
CMNT_BRIGHTNESS | Brightness value. Data type: SRATIONAL. Length: 1.
CMNT_EXPOSUREBIAS | Exposure bias. This is the value for correcting a biased exposure. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.
CMNT_MAXAPERTURE | Minimum lens f-number. Data type: RATIONAL. Length: 1.
CMNT_SUBJECTDISTANCE | Distance from lens to subject (in meters). Data type: RATIONAL. Length: 1.
CMNT_METERINGMODE | Photometry mode. Possible values are
 | 0 = Unidentified
 | 1 = Average
 | 2 = Center Weighted Average
 | 3 = Spot
 | 4 = MultiSpot
 | 5 = Pattern
 | 6 = Partial
 | 255 = Others
 | Data type: SHORT. Length: 1.
CMNT_LIGHTSOURCE | Light source. Possible values are
 | 0 = Unidentified
 | 1 = Daylight
 | 2 = Florescence light
 | 3 = Tungsten Lamp
 | 17 = Standard light source A
 | 18 = Standard light source B
 | 19 = Standard light source C
 | 20 = D55
 | 21 = D65
 | 22 = D75
 | 255 = Others
 | Data type: SHORT. Length: 1.
CMNT_FLASH | Flash On/Off. Possible values are 1 for on or 0 for off. Data type: SHORT. Length: 1.
CMNT_FOCALLENGTH | Focal length, measured in millimeters. Data type: RATIONAL. Length: 1.
CMNT_EXPOSURETIME | Exposure time, expressed as a fraction of a second. Data type: RATIONAL. Length: 1.
CMNT_FNUMBER | The actual lens F stop (ratio of lens aperture to focal length). Data type: RATIONAL. Length: 1.
CMNT_MAKERNOTE | Maker note. Data type: UNDEFINED. The creator of the file determines the data format.
CMNT_USERCOMMENT | User comment. Data type: UNDEFINED. Length: variable. The first eight bytes specify the data format, and the remainder of the comment is in the specified format. The first eight bytes can be any of the following:
 | 41 53 43 49 49 00 00 00 = ASCII
 | 4A 49 53 00 00 00 00 00 = JIS (Japanese)
 | 00 00 00 00 00 00 00 00 = Undefined
CMNT_SUPPORTEDFLASHPIXVERSION | Supported FlashPix version (Exif 2.0). LEADTOOLS always writes 0100 here. Data type: UNDEFINED. Length: 4
CMNT_COLORSPACE | Color space (Exif 2.0). Specifies whether the color is calibrated or not. LEADTOOLS always writes this value as 1. Data type: SHORT. Length: 1 Possible values are:
 | 1 = sRGB (PC monitor conditions)
 | 0xFFFF = Uncalibrated
 | Other = reserved
CMNT_EXPOSUREPROGRAM | Exposure program (Exif 2.0) The class of the program used by the camera to set exposure when the picture is taken. Data type: SHORT. Length = 1. Possible values are:
 | 0 = Not defined
 | 1 = Manual
 | 2 = Aperture priority
 | 4 = Shutter priority
 | 5 = Creative program (biased toward depth of field)
 | 6 = Action program (biased toward fast shutter speed)
 | 7 = Portrait mode (for closeup photos with the background out of focus)
 | Other = reserved
CMNT_SZSPECTRALSENSITIVITY | Spectral sensitivity (Exif) - The spectral sensitivity of each channel of the camera used. It is an ASCII string compatible with the standard developed by the ASTM technical committee. Data type: ASCII. Length: any
CMNT_ISOSPEEDRATINGS | ISO speed ratings (Exif) - the ISO speed and the ISO Latitude of the camera or input device as specified in ISO 12232 Data type: SHORT. Length: any
CMNT_OPTOELECTRICCOEFFICIENT | Optoelectric coefficient (Exif) - Opto-Electric Conversion function specified in ISO 14524. OECF is the relationship between the camera optical input and the image values. Data type: UNDEFINED. Length: ANY. This is an array of m rows and n columns. For information on how it is recorded, refer to OECF.
CMNT_SZRELATEDSOUNDFILE | Related audio file (Exif) - the name of an audio file related to the image data. The name should be 8 ASCII chars + '.' + 3 chars for extension + NULL. Data type: ASCII. Length: 13.
CMNT_FLASHENERGY | Flash energy (Exif) - the strobe energy at the time the image iscaptured, as measured in Beam Candle Power Seconds (BPCS) Data type: RATIONAL. Length: 1
CMNT_SPATIALFREQUENCYRESPONSE | Spatial frequency response (Exif) - the camera or input device spatial frequency table and SFR values in the direction of image width, image height and diagonal direction, as specified in ISO 12233. Data type: UNDEFINED. Length: ANY This is an array of m rows and n columns.For information on how this is recorded, refer to SFR.
CMNT_FOCALPLANEXRESOLUTION | Focal plane X Resolution (Exif) - the number of dots per resolution unit on the camera focal plane in the image width (X) direction. The resolution unit is given by CMNT_FOCALPLANERESOLUTIONUNIT. If CMNT_FOCALPLANERESOLUTIONUNIT is not set, the unit will be considered to be 2 ("dots per inch"). Data type: RATIONAL. Length: 1
CMNT_FOCALPLANEYRESOLUTION | Focal plane Y Resolution (Exif) - the number of dots per resolution unit on the camera focal plane in the image height (Y) direction. The resolution unit is given by CMNT_FOCALPLANERESOLUTIONUNIT. If CMNT_FOCALPLANERESOLUTIONUNIT is not set, the unit will be considered to be 2 (“dots per inch”). Data type: RATIONAL. Length: 1
CMNT_SUBJECTLOCATION | Subject location (Exif) - the location of the main subject in the scene. The first value is the X column number and the second is the Y row number. Data type: SHORT. Length: 2
CMNT_EXPOSUREINDEX | Exposure index (Exif) - the image sensor type on the camera or input device. Data type: SHORT. Length: 1
CMNT_SENSINGMETHOD | Sensing method (Exif) - the image sensor type on the camera or input device. Data type: SHORT. Length: 1 Possible values are:
 | 1 = not defined
 | 2 = one-chip color area sensor
 | 3 = two-chip color area sensor
 | 4 = three-chip color area sensor
 | 5 = color sequential area sensor
 | 7 = trilinear sensor
 | 8 = color sequential sensor
 | other = reserved
CMNT_FILESOURCE | File source (Exif) - the image source. If a digital camera recorded the image, the value will always be 3, to indicate that the image was recorded on a digital camera. Data type: SHORT. Length: 1 Possible values are:
 | 3 = image recorded on a DSC (Digital Still Camera)
 | other = reserved
CMNT_SCENETYPE | Scene type (Exif) - the type of scene. If a DSC recorded the image, this value will always be 1, indicating that the image was directly photographed. Data type: UNDEFINED. Length: 1 Possible values are:
 | 1 = a directly photographed image
 | other = reserved
CMNT_CFAPATTERN | CFA Pattern (Exif) - the color filter array (CFA) geometric pattern of the image sensor when a one-chip color sensor was applied. It does not apply to any other sensing methods. Data type: UNDEFINED. Length: ANY This is an array m x n (horz x vertical), where the pattern is repeated every m pixels on the horizontal and n pixels on the vertical. For a table of the layout, refer to CFA.
CMNT_SUBJECTAREA | Location and area of the main subject in the overall scene. Data type: SHORT. Count: 2 (Location of the subject is given in X, Y coordinates), 3 (Area of the main subject is given as a circle, X, Y, D, where X and Y are the center coordinates and D is the diameter.) and 4 (Area of the main subject is given as a rectangle, X, Y, W, H, where X and Y are the center coordinates, W is the width or the rectangle and H is the height of the rectangle.).
CMNT_CUSTOMRENDERED | Use of special processing on image data, such as rendering geared toward output. When special processing is performed, the reader is expected to disable or minimize any further processing. Data type: SHORT; Count: 1; Possible Values: 0 (Normal process), 1 (Custom process), Other (Reserved). Default: 0;
CMNT_EXPOSUREMODE | Exposure mode set when the image was shot. In auto-bracketing mode the camera shoots a series of frames of the same scene at different exposure settings. Tag: 41986; Data type: SHORT; Count: 1; Possible values are: 0 (Auto exposure), 1 (Manual exposure), 2 (Auto-bracket), Other (Reserved); Default: none.
CMNT_WHITEBALANCE | White balance mode set when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Auto white balance), 1 (Manual white balance), Other (Reserved); Default: none.
CMNT_DIGITALZOOMRATIO | Digital zoom ratio set when the image was shot. If the numerator of the recorded value is 0, the digital zoom was not used. Data type: RATIONAL; Count: 1; Default: none.
CMNT_FOCALLENGTHIN35MMFILM | Equivalent focal length, assuming a 35mm film camera, in mm. A value of 0 means the focal length is unknown. Note that this comment is different from the CMNT_FOCALLENGTH comment. Data type: SHORT; Count: 1; Default: none.
CMNT_SCENECAPTURETYPE | Type of scene that was shot. It can also be used to record the mode in which the image was shot. Note that this differs from the CMNT_SCENETYPE comment. Data type: SHORT; Count: 1; Possible values are: 0 (Standard), 1 (Landscape), 2 (Portrait), 3 (Night scene), Other (Reserved); Default: 0.
CMNT_GAINCONTROL | Degree of overall image gain adjustment. Data type: SHORT; Count: 1; Possible values are: 0 (None), 1 (Low gain up), 2 (High gain up), 3 (Low gain down), 4 (High gain down), Other (Reserved); Default: none.
CMNT_CONTRAST | Direction of contrast processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Soft), 2 (Hard), Other (Reserved); Default: 0.
CMNT_SATURATION | Direction of saturation processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Low saturation), 2 (High saturation), Other (Reserved); Default: 0.
CMNT_SHARPNESS | Direction of sharpness processing applied by the camera when the image was shot. Data type: SHORT; Count: 1; Possible values are: 0 (Normal), 1 (Soft), 2 (Hard), Other (Reserved); Default: 0.
CMNT_DEVICESETTINGSDESCRIPTION | Information on the picture-taking conditions of a particular camera model. Used only to indicate the picture-taking conditions in the reader. Data type: UNDEFINED; Count: Any; The data is recorded in Unicode using SHORT fro the number of display rows and columns and UNDEFINED for the camera settings. The Unicode (UCS –2) string including Signature is NULL terminated. The specifics of the Unicode string are as given in ISO/IEC 10464-1. Default: none.
CMNT_SUBJECTDISTANCERANGE | Distance to the subject. Data type: SHORT; Count: 1; Possible values are: 0 (Unknown), 1 (Macro), 2 (Close view), 3 (Distant view), Other (Reserved); Default: none.
CMNT_SZIMAGEUNIQUEID | Identifier assigned uniquely to each image. It is recorded as an ASCII string equivalent to hexadecimal notation and 128-bit fixed length. Tag: 42016; Data type: ASCII; Count: 33; Default: none

Exif GPS comments. Exif files can contain the following GPS (Global Positioning System) comments:

Value | Meaning
CMNT_GPSVERSIONID | Version number of the GPS image file directory (IFD). The current version is 2.0.0.0. This comment must be included when any GPS comments are used. Unlike the CMNT_EXIFVERSION comment, this comment is written in bytes. A version written as 2.0.0.0 is actually 0x02000000 when coded. Data type: BYTE. Length: 4.
CMNT_GPSLATITUDEREF | North or south latitude. Possible values are "N" for north and "S" for south. Data type: ASCII. Length: 2.
CMNT_GPSLATITUDE | Latitude, expressed as three RATIONAL values. When expressed in degrees, minutes, and seconds, latitude is written as dd/1,mm/1,ss/1. If degrees and minutes are used as the units, and minutes are written with fractions to two decimal places, then latitude is expressed as dd/1,mmmm/100,0/1. Data type: RATIONAL. Length: 3.
CMNT_GPSLONGITUDEREF | East or west longitude. Possible values are "E" for east and "W" for west. Data type: ASCII. Length: 2.
CMNT_GPSLONGITUDE | The longitude, expressed as three RATIONAL values. When expressed in degrees, minutes and seconds, longitude is written as ddd/1,mm/1,ss/1. If degrees and minutes are used as the units, and minutes are written with fractions to two decimal places, then longitude is expressed as dd/1,mmmm/100,0/1. Data type: RATIONAL. Length: 3.
CMNT_GPSALTITUDEREF | Reference altitude. In the current version, sea level is used as the reference, which must be zero. The reference unit is meters. Data type: BYTE. Length: 1.
CMNT_GPSALTITUDE | Altitude, in meters, relative to the reference altitude. Data type: RATIONAL. Length: 1.
CMNT_GPSTIMESTAMP | Time stamp in UTC (Coordinated Universal Time) time. The time is expressed as three RATIONAL values, for hours, minutes, and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSSATELLITES | GPS satellites used for measurement. The coding format is not stipulated. This comment can be used to code information such as the number of satellites, the satellite number, the satellite's angle of elevation, its azimuth, and its SNR. If the GPS receiver cannot make a measurement, this comment is NULL. Data type: ASCII. Length: variable.
CMNT_GPSSTATUS | Status of the GPS receiver at when the image is recorded. Possible values are "A" when measurement in progress and "V" when measurement is interrupted. Data type: ASCII. Length: 2.
CMNT_GPSMEASUREMODE | GPS measurement mode. A value of "2" denotes two-dimensional measurement, and "3" denotes three-dimensional measurement. Data type: ASCII. Length: 2.
CMNT_GPSDOP | DOP (data precision) value. This comment is an HDOP value during two-dimensional measurement and a PDOP value during three-dimensional measurement. Data type: RATIONAL. Length: 1.
CMNT_GPSSPEEDREF | Unit for measuring speed. Possible values are "K" for kilometers, "M" for miles, and "N" for knots. Data type: ASCII. Length: 2.
CMNT_GPSSPEED | Speed of the GPS receiver. Data type: RATIONAL. Length: 1.
CMNT_GPSTRACKREF | Reference for direction of movement. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2
CMNT_GPSTRACK | Direction of GPS receiver movement. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSIMGDIRECTIONREF | Reference for the direction of photography in the recorded image. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2.
CMNT_GPSIMGDIRECTION | Direction of photography in the recorded image. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSMAPDATUM | Geodetic survey data used by the receiver. If the geodetic survey data is restricted to Japan, this tag value is "TOKYO" or "WGS-84". Data type: ASCII. Length: variable.
CMNT_GPSDESTLATITUDEREF | North or south latitude for the destination point. Possible values are "N" for north and "S" for south. Data type: ASCII. Length: 2.
CMNT_GPSDESTLATITUDE | Latitude of the destination point. The latitude is expressed as three RATIONAL values, indicating degrees, minutes and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSDESTLONGITUDERE | East or west longitude for the destination point. Possible values are "E" for east and "W" for west. Data type: ASCII. Length: 2.
CMNT_GPSDESTLONGITUDE | Longitude of the destination point. The longitude is expressed as three RATIONAL values, indicating degrees, minutes and seconds. Data type: RATIONAL. Length: 3.
CMNT_GPSDESTBEARINGREF | Reference for the bearing to the destination point. Possible values are "T" for a true direction and "M" for a magnetic. Data type: ASCII. Length: 2.
CMNT_GPSDESTBEARING | Bearing to the destination point. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSDESTDISTANCEREF | Unit for measuring distance to the destination point. Possible values are "K" for kilometers, "M" for miles, and "N" for nautical miles. Data type: ASCII. Length: 2.
CMNT_GPSDESTDISTANCE | Distance to the destination point. Data type: RATIONAL. Length: 1.
CMNT_GPSPROCESSINGMETHOD | Processing method. Data type: Byte. Length: Any.
CMNT_GPSAREAINFORMATION | Area. Data type: Byte. Length: Any.
CMNT_GPSDATESTAMP | Date. Data type: SZ. Length: 11.
CMNT_GPSDIFFERENTIAL | Differential. Data type: Short. Length: 1.


CFA

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
1 | BYTE | CFA[0,0]
1 | BYTE | CFA[0,1]
: | : | :
1 | BYTE | CFA[0,n-1]
1 | BYTE | CFA[1,0]
: | : | :
1 | BYTE | CFA[1,n-1]
: | : | :
1 | BYTE | CFA[m-1,n-1]

where CFA[i,j] is the color filter value for row i, col j and can have one of these values:

CFA value | Filter color
0 | RED
1 | GREEN
2 | BLUE
3 | CYAN
4 | MAGENTA
5 | YELLOW
6 | WHITE


OECF

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
Any | ASCII | first column item name (NULL terminated)
: | : | :
Any | ASCII | last column item name (NULL terminated)
8 | SRATIONAL | OECF[0,0]
8 | SRATIONAL | OECF[0, 1]
: | : | :
8 | SRATIONAL | OECF[0,n-1]
: | : | :
8 | SRATIONAL | OECF[m-1,0]
8 | SRATIONAL | OECF[m-1,1]
: | : | :
8 | SRATIONAL | OECF[m-1,n-1]

where OECF[i,j] is the OECF coefficient for row i, column j


SFR

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
Any | ASCII | first column item name (NULL terminated)
: | : | :
Any | ASCII | last column item name (NULL terminated)
8 | RATIONAL | SFR[0, 0]
8 | RATIONAL | SFR[0, 1]
: | : | :
8 | RATIONAL | SFR[0, n-1]
: | : | :
8 | RATIONAL | SFR[m-1, 0]
8 | RATIONAL | SFR[m-1, 1]
: | : | :
8 | RATIONAL | SFR[m-1,n-1]

where SFR[i,j] is the SFR coefficient for row i, column j


Notes on Exif Data Types

The Exif standard defines the following data types for comments. Usage is dependent of your development system. To see the usage, refer to the code example for your system.

Data type | Description
UNDEFINED | The data type is determined by the field.
SHORT | Integer.
LONG | Long integer.
ASCII | Character string.
BYTE | Array of bytes.
RATIONAL | An array of two unsigned long integers that express a fraction. The first value is the numerator, and the second is the denominator. (Visual Basic does not recognize unsigned long integers and will interpret large values, as negative values.)
SRATIONAL | An array of two signed long integers that express a fraction. The first value is the numerator, and the second is the denominator.

The length of a comment is based on the data type. For example, an SRATIONAL with a length of 3 is an array of 6 long integers.

When you set a comment that requires an array, the array can be zero-based or 1-based (where the first element has an index of 1). When you get a comment that is an array, it will always be zero-based (where the first element has an index of 0).

When you assign comments, the ActiveX does data type conversions for you. For example, if a comment is a RATIONAL with a length of 3, you can assign an array of six integers. If you assign an invalid value, the value is ignored.


Exif Examples

Exif example for Visual Basic

Exif example for Visual C++ 4.0


Implementing Internet Features

LEADTOOLS offers the following alternatives for Internet support:

To support your own input stream you can use the LEADTOOLS COM Objects with the methods described in Loading a Bitmap from Your Own Buffer.

For asynchronous loading through Microsoft Internet Explorer you can use the capabilities described in the remainder of this topic.

Loading a Bitmap over the Internet

The ILEADRasterIO object is a net-aware COM object. This means you can support new image formats and image processing on your web pages by adding the ILEADRasterIO object to your in HTML code. For examples using HTML with Java and VB Script, refer to the EXAMPLES\COM\WEBDEMOS subdirectory.

Use the following elements to manage asynchronous loading of a bitmap from a local file or from an Internet URL. Note that these elements require version 3.01 of the Microsoft Internet Explorer, which is available from http://www.microsoft.com.

BitmapDataPath method

ReadyStateChange event

ReadyState property

Use the AutoSetRects property and its related properties to simplify the display rectangles when loading an image from the Internet.

Note: When using the LEAD RasterView Control on a web page, you should set the OLEDropAllowed property to False (0) in the Unload Event. For example, in VBScript this is done as follows:

Sub Window_OnUnload
LEADRasterView1.OLEDropAllowed = False
end Sub

Using the LTOCX14.LIC file on the Internet

The LEADTOOLS RasterView Control requires the correct license string in order to load properly. In a development environment, the string is made available to the ActiveX control when the LTOCX14.LIC file is placed in the same directory as the ActiveX control. When creating an executable program, the development environment will extract the correct string from the ActiveX control and place it in the generated code. When the executable code is run, it provides the license string to the control. This allows the executable program to function properly without the LTOCX14.LIC file.

Since you cannot redistribute the LTOCX14.LIC file with HTML script, special handling is required for Internet web page development to insure proper operation. You can unlock support for certain LEADTOOLS features by including the keys in the .LIC file. Edit the LTOCX14.LIC file and append at the end of a line, and on the same line, one or more pairs in the form |L_SUPPORT_xxx=key. The keys that you can specify are :

L_SUPPORT_BARCODES_1D
L_SUPPORT_BARCODES_PDF_READ
L_SUPPORT_BARCODES_PDF_WRITE
L_SUPPORT_BARCODES_DATAMATRIX_READ
L_SUPPORT_BARCODES_DATAMATRIX_WRITE
L_SUPPORT_BITONAL
L_SUPPORT_CMW
L_SUPPORT_DICOM
L_SUPPORT_DIGITALPAINT
L_SUPPORT_DOCUMENT
L_SUPPORT_EXTGRAY
L_SUPPORT_GIFLZW
L_SUPPORT_J2K
L_SUPPORT_MEDICAL
L_SUPPORT_MEDICAL_NET
L_SUPPORT_MEDICAL_SECURITY
L_SUPPORT_MRC
L_SUPPORT_OCR
L_SUPPORT_TIFLZW
L_SUPPORT_VECTOR
L_SUPPORT_VECTOR_ALL
L_SUPPORT_VECTOR_DWF
L_SUPPORT_VECTOR_DWG
L_SUPPORT_VECTOR_DXF
L_SUPPORT_VECTOR_MISC
L_SUPPORT_VECTOR_VIEW

For example, if you wanted to unlock GIFLZW and TIFLZW support, you would include the following at the end of the first line:

|L_SUPPORT_GIFLZW=gifkey|L_SUPPORT_TIFLZW=tifkey

After editing the LTOCX14.LIC file, you must create an LPK file using Microsoft's LPK_TOOL.EXE (Available in the ActiveX SDK from Microsoft at http://www.microsoft.com/intdev/default.htm). This helps generate an encrypted LPK file containing all of the license strings that are required by your script's controls. This allows the use of the ActiveX and certain features in web pages, without putting the license keys in the web page. Microsoft's Internet Explorer only honors one LPK file per page, so you should generate a LPK file including license strings for every control that you intend to use. You should then insert the following into your HTML script:

<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<param name="LPKPath" value="Relative URL path to LPK file">
</object>

Using a Cabinet File

LEADTOOLS provides many cabinet files (\REDIST\COM\CABS) that package the LEADTOOLS COM Objects, File Filter DLLs, and the required code-signing information. You can reference these cabinet file in the CODEBASE attribute of the <OBJECT> tag of your HTML code as shown in the following example:

<object
ID="Raster"
name="Raster"
classid="CLSID:00140700-B1BA-11CE-ABC6-F5B2E79D9E3F"
codebase="controls/Ltr14n.cab">
</object>

For more information about redistribution, refer to Files To Be Included With Your Application.

If you need to create your own cabinet file, refer to MFC 4.2b Component Download Information at http://www.microsoft.com/visualc/download/mfcdnld.htm.


Implementing JBIG Features

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 now completely supports all three types of images, giving you the ability to make full use of this powerful compression.

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. You can use the ReadLoadResolutions method to examine which sizes are available in a file. You can then use the SetLoadResolution method to specify which size to load. (The GetLoadResolution method only gets the last width and height values that were set with the SetLoadResolution method.). When saving a file, you can use the SaveResolutionHeight and SaveResolutionWidth properties to set resolutions for the next save operation . To set the number of resolutions to save, set the SaveResolutionCount property.

To achieve the highest compression ratios available in the JBIG format, LEAD now takes full advantage of all the functional blocks of this robust standard:

The Adaptive Arithmetic Encoder , which presents the heart of this format, has the ability to predict and hence encode future data symbols based on the data which is being currently encoded.

The Adaptive Template Block provides real coding gain for images rendered by grayscale with halftoning. This gain ratio approaches 80% in some situations.

This feature is useful for dealing with grayscale image data.

The Typical Prediction Block speeds implementations and provides some coding gain.

The Resolution Reduction Block is used to get a lower resolution version of an image so that no loss of data is encountered. This is mainly important for bi-level images, to avoid any deletion of thin lines.

The Deterministic Prediction Block provides good coding gain when saving more than one resolution layer in the same file.

All the free parameters specified by the JBIG standard are applied in LEAD to achieve maximal compression and the highest speed for any saving or loading operation.

LEADTOOLS currently supports more than 1 bit plane and more than 1 resolution layer in JBIG files. However, we do not support saving different ordering of strips inside the JBIG file. The JBIG filter is built now such that it supports the optimum ordering of strips inside the JBIG file such that as soon as you open the file you find the lowest resolution layer.

JBIG supports progressive loading of an image. This is done by loading the lowest resolution available in a file and then loading the next resolution, and so on, up to the last available resolution. To implement progressive loading of a JBIG image, use the ProgressivePasses property. Progressive loading will be implemented as follows:

1) If only one resolution exists in the JBIG File, then the ProgressStatus event will be called for that resolution as it is decompressed. The percentages sent to the ProgressStatus event will be 0 to 100.

2) If the image contains more than one resolution and (ProgressivePasses >= nResolutions, where nResolutions represents the number of resolutions present in the file) then the ProgressStatus event will be generated for each resolution layer that is loaded. The image data will be padded to the remaining width (that is, the size of the last resolution available in the file) with 0s. This will be repeated nResolution times, until the entire image (that is, the last resolution available) is loaded. Setting ProgressivePasses to PROGRESSIVEPASSES_WHEN_MEANINGFUL or PROGRESSIVEPASSES_ALWAYS has the same effect.

The percentages passed to the ProgressStatus event represent what percentage that resolution is of the whole. For example, if there are three resolutions present in the file (nResolutions = 3), the dimensions of the first resolution layer are one-fourth the dimensions of the top resolution layer. The dimensions of the second resolution layer are one-half the dimensions of the top resolution layer. Consequently, when the first resolution layer is loaded, the percentages sent to the ProgressStatus event are from 0 to 25. When the second resolution layer is loaded, the percentages sent to the ProgressStatus event are from 0 to 50. When the top resolution layer is loaded, the percentages sent to the ProgressStatus event are 0 to 100.

3) If the image contains more than one resolution and (ProgressivePasses is < nResolutions) then the process is the same as in case 2, except loading starts with the first resolution available, continues with the 2nd resolution, and so on, up to resolution Passes-1, and then loading is completed with the decompression of the last resolution available in the file. Again, the percentages sent to the ProgressStatus event represent what percentage that resolution is of the whole. For example, if there are three resolutions present in the file, (nResolutions = 3), and the ProgressivePasses property is 2, the smallest resolution will be loaded first. The percentages sent to the ProgressStatus event will be 0 to 25. The second resolution level will be skipped and the top resolution level loaded. The percentages sent to the ProgressStatus event for the top resolution level will be 0 to 100.

JBIG support is available only with the JBIG Module. To unlock JBIG support, UnlockSupport must be called with the key found on the JBIG Module Certificate, which will be e-mailed to you. UnlockSupport(L_SUPPORT_JBIG, "JBIG Certificate key") tells the package to unlock JBIG support and passes the key for verification. For more information about required files, refer to Files To Be Included With Your Application.


Implementing PDF Plug in Features

Overview:

The PDF module enhances the input/output functionality in LEADTOOLS by supporting a number of new powerful and complex file formats including:

PDF PDF stands for Portable Document Format. It was developed by Adobe Corporation to allow users to exchange and view their electronic documents in an easy and reliable way , independent of the environment in which these documents were created. A PDF file will look the same on the screen and in print regardless of what kind of machine you are using or which software package was used to create that file. One major advantage of PDF is that a large document can be compressed small enough to download very quickly, and still displays content as if you were looking at the original source such as a book or magazine.

PDF is emerging as a powerful format for reproducing documents over the web. Because of its high precision and accuracy in representing text and pictures along with its "hyper" nature, PDF is becoming a popular alternative to HTML and Postscript.

PS Postscript is a simple interpretive page description language. Its primary application is to describe the appearance of text, graphical shapes, and sampled images on printed or displayed pages. Some of the page description and interactive graphics capabilities of the PostScript language include arbitrary shapes, painting operators, text fully integrated with graphics and sampled images derived from natural sources. Postscript is the language that most advanced laser printers use in order to render electronic information on a printed page.

EPS EPS stands for encapsulated PostScript .An EPS file is a PostScript language program describing the appearance of a single page. Usually, the purpose of the EPS file is to be embedded inside another PostScript language page description. The EPS file can contain any combination of text, graphics, and images, and it is the same as any other PostScript language page description with only a few limitations.

Occasionally, a customer may install two separate software applications that use two different versions of the LEADTOOLS® PDF filter. If both applications use the default PDF initialization directories, the runtime library of the second application installed will overwrite the runtime library of the first application installed. This can be avoided by setting the PDFInitDir property to some location other than the default.

Loading Capabilities.

The LEADTOOLS PDF plug-in has the following import capabilities:

1. | Loads essentially all PDF 1.3 (Acrobat 4.x compatible) files.
2. | Loads all PostScript Language Level 3 files.
3. | Loads any EPS file.

The loading support is of course multi-page, where you can specify which page to load from the file and to find the number of pages in a certain document.

The plug-in gives the user a number of control options in order to customize the resulting rasterized page. These options include:

1. | Pixel depth. Valid values are 1,4,8 and 24 .The default value for this control parameter is 24. This value is set in the PDFDisplayDepth property.
2. | Horizontal resolution in dots per inch with a default value of 96. This value is set in the PDFXResolution property.
3. | Vertical resolution in dots per inch with a default value of 96. This value is set in the PDFYResolution property.
4. | Ability to use either library installed fonts (fonts installed by the plug in) or system fonts. The default value of this control option is to use library installed fonts. This value is set in the PDFUseLibFonts property.
5. | Font anti-aliasing. Valid values are 1bit(no anti-aliasing) , 2 and 4-bit anti-aliasing. The default value is 4, which gives maximum anti-aliasing. This value is set in the PDFTextAlpha property.
6. | Graphics anti-aliasing. Valid values are 1bit(no anti-aliasing) , 2 and 4-bit anti-aliasing. The default value is 1. This value is set in the PDFGraphicsAlpha property.

Saving Capabilities.

Full multi-page write support is provided by this module for the PDF format. This plug in lets you append, insert, replace or delete specific pages in a PDF file.

The plug-in gives you a wide range of control options for the resulting image data in terms of compression, including:

1. | No compression
2. | Compressed using CCITT Group 3, 1 dimension. For 1-bit images.
3. | Compressed using CCITT Group 3, 2 dimensions. For 1-bit images.
4. | Compressed using CCITT Group 4. For 1-bit images.
5. | JPEG compression and YUV 4:4:4 color space loss-less. Bits per pixel: 8 for grayscale, 24 for color.
6. | JPEG compression and YUV 4:2:2 color space. Bits per pixel: 8 for grayscale, 24 for color.
7. | JPEG compression and YUV 4:1:1 color space. Bits per pixel: 8 for grayscale, 24 for color.

To save a PDF file using the DPI values of the loaded bitmap, set the PDFSaveUseDPI property to TRUE.

To try to use less memory when creating PDF files with either JPEG or Fax compression, set the PDFSaveLowMemory property to TRUE before saving the file.

A number of new save format constants have been added to LEADTOOLS in order to support types of files created by the PDF plug-in. For a list of these, please refer to Formats of Output Files.

LEADTOOLS supports several properties that let the user control the security of and access to the PDF file that is saved. These include the EnablePDF128bit property, the PDFEncryptFlags property, the PDFOwnerPassword property, and the PDFUserPassword property.

Distributing an application built using the PDF Module

The PDF plug-in needs some initialization files in order to work properly. Before distributing an application built using this plug-in, you need to setup the end-user machine with appropriate directories and files. Please follow the steps below:

1. | Create a main directory (referred to later as MAIN) on the hard-drive to contain the files. For example "C:\Pdf".
2. | Create 3 subdirectories within this "MAIN" directory, please name them "Lib, "Fonts", and "Resource".
3. | Copy the contents of the directory "Redist\Pdf\Fonts" to the "Fonts" directory.
4. | Copy the contents of the directory "Redist\Pdf\Lib" to the "Lib" directory.
5. | Copy the contents of the directory "Redist\Pdf\Resource" to the "Resource" directory.
6. | Setup the registry configuration below:
 | a. | Create the following registry key:

"HKEY_LOCAL_MACHINE\SOFTWARE\LEAD Technologies, Inc.\Pdf"

b. | Under this key create a string value and give it the name "GS_LIB".
c. | Now set the value data of the "GS_LIB" value as follows:

"MAIN\Lib;MAIN\Fonts;MAIN\Resource"

If MAIN stands for "C:\Pdf" then this would become

"C:\ Pdf\Lib;C:\ Pdf\Fonts;C:\Resource"


Implementing JPEG 2000 Plug in Features

JPEG 2000 is a wavelet based compression stored in a hierarchical format which contains several stored resolutions of the image in the same file without duplication. For that reason, a JPEG 2000 compressed image can then be sent to a device in the resolution that best fits, without additional storage overhead.

The LEADTOOLS JPEG 2000 Plug in provides support for loading and saving the JPEG 2000 file formats. The JPEG 2000 file formats provide greater flexibility and better image quality, especially at higher compression, than standard JPEG. The greater flexibility includes the ability to control:

whether or not to transform RGB images to YUV prior to compression

the type of quantization to use when determining the quantization step size

the amount of compression

the size and location of tiles

the number of resolution levels in the file

the progression order

the code block height and width

whether to use markers to help detect corruption during transmission

etc.

LEADTOOLS provides a several properties for controlling the JPEG 2000 features listed above. These properties are:

J2KCBS_ErrorResilienceSymbol property

J2KCBS_PredictableTermination property

J2KCBS_ResetContextOnBoundaries property

J2KCBS_SelectiveACBypass property

J2KCBS_TerminationOnEachPass property

J2KCBS_VerticallyCausalContext property

J2KCodBlockHeight property

J2KCodBlockWidth property

J2KCompressionControl property

J2KCompressionRatio property

J2KDecompLevel property

J2KDerivedBaseExponent property

J2KDerivedBaseMantissa property

J2KDerivedQuantization property

J2KGuardBits property

J2KProgressOrder property

J2KROIControl property

J2KROIHeight property

J2KROILeft property

J2KROITop property

J2KROIWidth property

J2KSetDefaults method

J2KTargetFileSize property

J2KUseColorTransform property

J2KUseEPHMarker property

J2KUseROI property

J2KUseSOPMarker property

J2KXOsiz property

J2KXTOsiz property

J2KXTsiz property

J2KYOsiz property

J2KYTOsiz property

J2KYTsiz property

To update the properties listed above with the default values used when saving a JPEG 2000 file, call the J2KSetDefaults method. To change the JPEG 2000 features, set the properties themselves.

A region of interest can now be used for a J2K image. The J2KUseROI property indicates whether or not to use a region of interest. If this is TRUE, then the region of interest is defined based on the J2KROIControl property. If the J2KUseROI property is TRUE and the J2KROIControl property is set to J2K_USELEAD_REGION, then the region of interest is designated by the LEAD bitmap region. If the J2KUseROI property is TRUE and the J2KROIControl property is set to J2K_USEOPTION_RECT, then the region of interest is designated by the rectangle defined by the J2KROILeft, J2KROITop, J2KROIHeight, and J2KROIWidth properties.

This support is available only in the LEADTOOLS JPEG 2000 Plug in, and must be unlocked. For more information on unlocking this support, refer to JPEG 2000 Plug In Support Instructions.

Please note that LEAD also offers the LEADTOOLS JPEG 2000 COM Object for IE, which lets you view JPEG 2000 images in ActiveX enabled web browsers, such as Internet Explorer. For more information, refer to LEADTOOLS JPEG 2000 COM Object for IE in the Products help file.


Implementing PhotoCD and FlashPix Features

A Kodak PhotoCD or FlashPix file can contain more than one copy of the same image, each at a different physical resolution (width and height in pixels). For PhotoCD files, the resolutions are based on fixed sizes. As a result, all PhotoCD files have the same aspect ratio. For FlashPix files, the aspect ratio can vary; so there is not a list of fixed sizes.

For PhotoCD files, which LEADTOOLS can read but not write, you can use the InfoPCDRes property to examine which of the fixed sizes are available in a file. You can then use the PCDRes property to specify which of the fixed sizes to load.

LEADTOOLS can read and write FlashPix files.

When loading FlashPix files, there are some newer methods and properties, which can also be used with the PhotoCD files. You can use the following method and properties to examine which sizes are available in a file:

ReadLoadResolutions method

LoadResolutionCount property

LoadResolutionHeight property

LoadResolutionWidth property

You can then use the following method to specify which size to load:

SetLoadResolution method

The following method gets the last width and height values that were set with the SetLoadResolution method:

GetLoadResolution method

Special considerations when saving FlashPix files:

LEADTOOLS does not support the multi-resolution update features of the FlashPix format. The LEADTOOLS save functions always create a new file from the current bitmap, and the highest resolution in the new FlashPix file has the dimensions of the current bitmap. Therefore, if you overwrite an existing FlashPix file, you can lose any resolutions with larger dimensions than the current bitmap.

The format constant that you specify when saving a FlashPix file determines the type of compression. The following are the possible choices:

Format Constant | Meaning
FILE_FPX | FlashPix, with no compression
FILE_FPX_SINGLE_COLOR | FlashPix, compressed with the single color method, which is a FlashPix-specific compression method
FILE_FPX_JPEG | FlashPix, compressed with JPEG, using the FlashPix default Q factor
FILE_FPX_JPEG_QFACTOR | FlashPix, compressed with JPEG, using the specified Q factor

The compression is done by the Kodak support DLLs (LFKODAK.DLL and LFFPX7.DLL). You can use the same Q factors as with LEAD's JPEG engine (setting a value from 2 to 255, where 2 is the highest quality and 255 is the most compression), but the compression engine is not the same as LEAD's. You cannot use the InfoCompress property to determine the compression method in a FlashPix file.

Other considerations for PhotoCD and FlashPix files:

LEADTOOLS can only read PhotoCD and FlashPix files directly from disk files. Therefore, the methods for loading files from memory and saving files to memory are not applicable.

The FlashPix format requires OLE support. Therefore, you may need to include OLE support files, such as MSVCRT40.DLL, MFC40.DLL, and OLEPRO32.DLL, with your application.

Implementing PhotoCD and FlashPix Features


Layers in Files

Certain files may contain layers. Currently, only PSD files support layers, although not all PSD files contain layers. Layers are numbered starting with 0. Therefore, the first layer in the file is layer 0. The next layer in the file is layer 1, etc. To load a layer from a file, call the LoadLayer method. Once the layer is loaded, the LayerLeft(0) and LayerTop(0) properties are updated with positioning information on the loaded layer.

The number of layers present in a file can be determined by calling the GetFileInfo method for a particular file. This method updates the InfoLayers property with the number of layers present in the file.

Each layer may have certain properties associated with it. These can be set or retrieved using the following properties:

LayerBlendModeKey property

LayerClipping property

LayerOpacity property

Bitmaps may also be saved to a file as layers by setting the SaveLayers property to TRUE. If the SaveLayers property is set to TRUE, then the next time a PSD file is saved, all bitmaps are saved as layers. Prior to saving a PSD file, the LayerLeft(x) and LayerTop(x) properties can be set to contain the positioning information for each layer. When the PSD file is saved, this positioning information is used to save the layers.


Working with the RAW File Filter

The RAW File Filter can be used to load and save raw uncompressed data. The raw data can have

any offset in the file

any bits per pixel

any width/height

each line padded to 4 bytes

any view perspective

BGR or RGB color order

Loading a file with the RAW filter

Parameters for loading raw uncompressed data are set through the LoadInfo event in the ILEADRasterIO COM object.

Inside the LoadInfo event (or prior to the call of the LoadInfo event),set the LoadInfoBits property to FILE_RAW. Valid values must also be set for the following properties: LoadInfoWidth , LoadInfoHeight, LoadInfoBits , LoadInfoOffset (byte location in file where raw data begins). If each line of RAW data is padded so that the number of bytes is a multiple of 4 (as is the case with raw Windows BMP data), include LOADINFO_PAD4 in the LoadInfoFlags property. Include an orientation flag in the LoadInfoFlags property to load the image with the proper orientation. For example, raw Windows BMP data is stored with a BOTTOM_LEFT orientation. If the orientation is unknown, include the TOP_LEFT flag. If the raw data is 8 bits per pixel or less, then the image is palettized and a palette must be generated. If this is the case, include the LOADINFO_PALETTE flag, and fill in the first (2 bits per pixel) entries of the IOPalette property

If the color order is ORDER_RGB then include this flag. If the ORDER_RGB flag is not included, the data will be loaded as ORDER_BGR.

Saving a file with the RAW filter

To save raw uncompressed data, an image must already be loaded into a ILEADRasterView control. When saving raw uncompressed data, the raw data will be correspond to the width, height, bits per pixel, and view perspective of the image when it was loaded. For example, if a Window BMP file that is 300x400 24-bit color is loaded and then saved as raw uncompressed data, the raw data is 24-bit, ORDER_BGR, with a view perspective BOTTOM_LEFT (the first bytes in the file correspond to the bottom-left of the image). The total size of the raw data file will be 300x400x3 = 360,000 bytes.

You can affect the way the raw data is saved by setting certain properties in the ILEADRasterIO COM object. The bits in each byte can be reversed by setting the SaveLSB property to TRUE. Each line of raw data can be padded so that the length is a multiple of four bytes by setting the SavePad4 property to TRUE. The raw data can be saved at any offset in the file by using SaveOffset method.

When using the Save method or the SaveOffset method (ILEADRasterIO)to save RAW data that is 8 bits per pixel or less, no palette information is saved. Consequently, after loading RAW data, it is necessary to supply a palette.(see Loading a file with the RAW filter)

For examples that demonstrate how to load and save raw uncompressed data, refer to:

RawLoad example for Visual Basic

RawLoad example for Visual C++ 4.0 and later

RawSave example for Visual Basic

RawSave example for Visual C++ 4.0 and later


Files To Be Included With Your Application

Note:

You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.

Note:

You may not distribute the header files with your application, and you may not provide software development capabilities in your application. For information on where to find the redistributable files, refer to Installation Directory.

You may not provide software development capabilities in your application. In particular, this means that you must not distribute the LTOCX14.LIC license file.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions. Most files in the table are optional. These files are referred to as "Redistributables" in the License Agreement.

If your application uses ODBC, the target system must have the appropriate drivers, which are described in Using ODBC. If necessary, you can include the required ODBC drivers with your application.

A Special Note about UNICODE Support.

Please note that LTR and LTRVR are required for all COM applications.

Note: All Unicode versions of LEADTOOLS require Microsoft Unicode Layer for Windows (UNICOWS.DLL) in order to function on Windows 95/98/Me. You can obtain MSUL from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_mslu.asp.

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:

LTCLR

LEADTOOLS Color Conversion. This DLL is used with some Common Dialog functions. This DLL is also required for loading JPEG CMYK images and for loading and saving JPEG LAB images.

DLL:
LTCLR14S.DLL

DLL:
LTCLR14SU.DLL

DLL:
LTCLR14SE.DLL

DLL:
LTCLR14SEU.DLL

LTDIC

Medical Imaging editions only) DICOM file support.

DLL:
LTDIC14S.DLL

Unicode is not supported.

DLL:
LTDIC14SE.DLL

Unicode is not supported.

LTR

ILEADRaster, required in all applications. Your installation procedure must register the COM Object DLL. For information about the "nag" message and the "no-nag" LTR DLL, refer to LEADTOOLS Nag Message. Your installation procedure must register the COM Object DLL.

DLL:
LTR14N.DLL

DLL:
LTR14NU.DLL

DLL:
LTR14E.DLL

DLL:
LTR14EU.DLL

LTRAN

ILEADRasterAnnotation, Annotation support. (Document/Medical only). Your installation procedure must register the COM Object DLL.

DLL:
LTRAN14N.DLL

DLL:
LTRAN14NU.DLL

DLL:
LTRAN14E.DLL

DLL:
LTRAN14EU.DLL

LTRBC

ILEADRasterODBC, ODBC DataBase Support. Your installation procedure must register the COM Object DLL.

DLL:
LTRBC14N.DLL

DLL:
LTRBC14NU.DLL

DLL:
LTRBC14E.DLL

DLL:
LTRBC14EU.DLL

LTRFD

ILEADRasterFXD, 3D drawing effects support. Your installation procedure must register the COM Object DLL.

DLL:
LTRFD14N.DLL

DLL:
LTRFD14NU.DLL

DLL:
LTRFD14E.DLL

DLL:
LTRFD14EU.DLL

LTRIO

ILEADRasterIO, file read and write support. Your installation procedure must register the COM Object DLL.

DLL:
LTRIO14SN.DLL

DLL:
LTRIO14NU.DLL

DLL:
LTRIO14E.DLL

DLL:
LTRIO14EU.DLL

LTRIS

LEADRasterISIS , LEAD ISIS COM Object incorporating ISIS scanner control. Your installation procedure must register the COM Object DLL.

DLL:
LTRIS14N.DLL

Unicode is not supported.

DLL:
LTRIS14E.DLL

Unicode is not supported.

LTRLS

LEADRasterImageList, LEAD Image List COM Object. Your installation procedure must register the COM Object DLL.

DLL:
LTRLS14N.OCX

DLL:
LTRLS14NU.OCX

DLL:
LTRLS14E.OCX

DLL:
LTRLS14EU.OCX

LTRMR

LEADRasterImageList, LEAD Raster Mixed Raster Content Object. Your installation procedure must register the COM Object DLL.

DLL:
LTRMR14N.DLL

DLL:
LTRMR14NU.DLL

DLL:
LTRMR14E.DLL

DLL:
LTRMR14EU.DLL

LTRNT

ILEADRasterInet, LEAD Internet COM Object.
Additional required files are installed by WS2SETUP.EXE (Winsock 2.0). Your installation procedure must register the COM Object DLL.

DLL:
LTRNT14N.DLL

DLL:
LTRNT14NU.DLL

DLL:
LTRNT14E.DLL

DLL:
LTRNT14EU.DLL

LTROD

ILEADRasterOLEDB, (ADO) Data Binding Support. Your installation procedure must register the COM Object DLL.

DLL:
LTROD14N.OCX

DLL:
LTROD14NU.OCX

DLL:
LTROD14E.OCX

DLL:
LTROD14EU.OCX

LTROP

ILEADRasterImgOpt, image optimization support. Your installation procedure must register the COM Object DLL.

DLL:
LTROP14N.DLL

DLL:
LTROP14NU.DLL

DLL:
LTROP14E.DLL

DLL:
LTROP14EU.DLL

LTRPC

ILEADPDFCompressor, advanced PDF compression support. Your installation procedure must register the COM Object DLL.

DLL:
LTRPC14N.DLL

DLL:
LTRPC14NU.DLL

DLL:
LTRPC14E.DLL

DLL:
LTRPC14EU.DLL

LTRPR

ILEADRasterProcess, image processing support. Your installation procedure must register the COM Object DLL.

DLL:
LTRPR14N.DLL

DLL:
LTRPR14NU.DLL

DLL:
LTRPR14E.DLL

DLL:
LTRPR14EU.DLL

LTRTM

ILEADRasterThumbnail, thumbnail browser support. Your installation procedure must register the COM Object DLL.

DLL:
LTRTM14N.DLL

DLL:
LTRTM14NU.DLL

DLL:
LTRTM14E.DLL

DLL:
LTRTM14EU.DLL

LTRTN
LTRTW

ILEADRasterTwain, TWAIN support. The LTRTN DLL is used with the other COM Objects. The LTRTW DLL is used with ActiveX Controls. Information on the ILEADRasterTwain Object can now be found in the LEADTOOLS TWAIN COM Help File (Lttwncomn.chm) in the HELP directory. Your installation procedure must register the COM Object DLL.

DLL:
LTRTN14N.DLL

LTRTW14N.DLL

DLL:
LTRTN14NU.DLL

Unicode is not supported for ActiveX.

DLL:
LTRTN14E.DLL

LTRTW14E.DLL

DLL:
LTRTN14EU.DLL

Unicode is not supported for ActiveX.

LTRVR

ILEADRasterVariant, LEAD Variant COM Object. Required in all applications. Your installation procedure must register the COM Object DLL.

DLL:
LTRVR14N.DLL

DLL:
LTRVR14NU.DLL

DLL:
LTRVR14E.DLL

DLL:
LTRVR14EU.DLL

LTRVW

ILEADRasterView, image display support. This also requires: LTR, LTRIO, LTRPR and LTRVR. Your installation procedure must register the COM Object DLL.

OCX:
LTRVW14N.OCX

OCX:
LTRVW14NU.OCX

OCX:
LTRVW14E.OCX

OCX:
LTRVW14EU.OCX

LTRDXX

Common Dialog Support. Information on the ILEADRasterDlg Object can now be found in the LEADTOOLS Common Dialog COM Help File (Ltdlgcomn.chm) in the HELP directory.

MSVCRT.DLL
OLE32.DLL
OLEAUT32.DLL
OLEPRO32.DLL

Windows files required in all applications for OLE support.

The LEADTOOLS installation updates these files in your Windows System folder. Do not use earlier versions of these files. (You may encounter a problem with the Visual Basic 4.0 Setup Toolkit as noted in Limitations with Visual Basic.)

Your application may require additional Windows files. (For example the LEADTOOLS example programs require additional files as noted in System Files Updated.) Refer to your development system's documentation for information about creating and distributing OLE 2.0 applications.

The same files are used for all versions.

The same files are used for all versions.

The same files are used for all versions.

The same files are used for all versions.

File Formats:

File Format Constant(s)

Description:

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:

FILE_ABC

ABC Format

LFABC14S.DLL

LFABC14SU.DLL

LFABC14SE.DLL

LFABC14SEU.DLL

FILE_ABIC

ABIC Format

LFABI14S.DLL

LFABI14SU.DLL

LFABI14SE.DLL

LFABI14SEU.DLL

FILE_AFP

AFP File Format

LFAFP14S.DLL

LFAFP14SU.DLL

LFAFP14SE.DLL

LFAFP14SEU.DLL

FILE_AFPICA_IBM_MMR

FILE_AFPICA_UNCOMPRESSED

FILE_AFP_G3_1D

FILE_AFP_G3_2D

FILE_AFP_G4

Image Object Content Architecture Format

LFICA14S.DLL

LFICA14SU.DLL

LFICA14SE.DLL

LFICA14SEU.DLL

FILE_ANI

Windows Animated Cursor

LFANI14S.DLL

LFANI14SU.DLL

LFANI14SE.DLL

LFANI14SEU.DLL

FILE_AVI

Windows AVI File Format (read only)

LFAVI14S.DLL

LFAVI14SU.DLL

LFAVI14SE.DLL

LFAVI14SEU.DLL

FILE_AWD

Windows FAX Format (AWD)

LFAWD14S.DLL
AWVIEW32.DLL
AWDENC32.DLL
AWDCXC32.DLL
AWCODC32.DLL
AWRESX32.DLL

LFAWD14SU.DLL
AWVIEW32.DLL
AWDENC32.DLL
AWDCXC32.DLL
AWCODC32.DLL
AWRESX32.DLL

LFAWD14SE.DLL
AWVIEW32.DLL
AWDENC32.DLL
AWDCXC32.DLL
AWCODC32.DLL
AWRESX32.DLL

LFAWD14SEU.DLL
AWVIEW32.DLL
AWDENC32.DLL
AWDCXC32.DLL
AWCODC32.DLL
AWRESX32.DLL

FILE_BMP

FILE_BMP_RLE

Windows Bitmap Format

LFBMP14S.DLL

LFBMP14SU.DLL

LFBMP14SE.DLL

LFBMP14SEU.DLL

FILE_CALS

FILE_CALS2

FILE_CALS3

FILE_CALS4

CALS Raster File Format

LFCAL14S.DLL

LFFAX14S.DLL

LFCAL14SU.DLL

LFFAX14SU.DLL

LFCAL14SE.DLL

LFFAX14SE.DLL

LFCAL14SEU.DLL

LFFAX14SEU.DLL

FILE_CCITT

FILE_CCITT_GROUP3_1DIM

FILE_CCITT_GROUP3_2DIM

FILE_CCITT_GROUP4

TIFF Tagged Image File Format

LFTIF14S.DLL

LFFAX14S.DLL

LFTIF14S.DLL

LFFAX14SU.DLL

LFTIF14SE.DLL

LFFAX14SE.DLL

LFTIF14SEU.DLL

LFFAX14SEU.DLL

FILE_CGM

Computer Graphics Metafile

LFCGM14S.DLL

LFCGM14SU.DLL

LFCGM14SE.DLL

LFCGM14SEU.DLL

FILE_CIN

KODAK Cineon Format

LFCIN14S.DLL

LFCIN14SU.DLL

LFCIN14SE.DLL

LFCIN14SEU.DLL

FILE_CLP
FILE_CLP_RLE

Windows Clipboard Format

LFCLP14S.DLL

LFCLP14SU.DLL

LFCLP14SE.DLL

LFCLP14SEU.DLL

FILE_CMP

LEAD CMP Format

LFCMP14S.DLL

LFCMP14SU.DLL

LFCMP14SE.DLL

LFCMP14SEU.DLL

FILE_CMW

LEAD Wavelet Format

LFCMW14S.DLL

LFCMW14SU.DLL

LFCMW14SE.DLL

LFCMW14SEU.DLL

FILE_CMX

Corel Presentation Exchange Format

LFCMX14S.DLL

LFCMX14SU.DLL

LFCMX14SE.DLL

LFCMX14SEU.DLL

FILE_CRW

Canon Raw Format

LFCRW14S.DLL

LFCMP14S.DLL

Canon Runtime Files

LFCRW14SU.DLL

LFCMP14SU.DLL

Canon Runtime Files

LFCRW14SE.DLL

LFCMP14SE.DLL

Canon Runtime Files

LFCRW14SEU.DLL

LFCRW14SEU.DLL

Canon Runtime Files

FILE_CUT

Dr. Halo Format

LFCUT14S.DLL

LFCUT14SU.DLL

LFCUT14SE.DLL

LFCUT14SEU.DLL

FILE_DCR

Kodak Professional Digital Camera Format

LFDCR14S.DLL

DCSPROBACK.DLL

DCSPRO3SLR.DLL

DCSProductLook.icm

sRGB Color Space.icm

LFDCR14SU.DLL

DCSPROBACK.DLL

DCSPRO3SLR.DLL

DCSProductLook.icm

sRGB Color Space.icm

LFDCR14SE.DLL

DCSPROBACK.DLL

DCSPRO3SLR.DLL

DCSProductLook.icm

sRGB Color Space.icm

LFDCR14SEU.DLL

DCSPROBACK.DLL

DCSPRO3SLR.DLL

DCSProductLook.icm

sRGB Color Space.icm

FILE_DCS

Kodak Professional Digital Camera Format

LFDCS14S.DLL

PDC_SDK.DLL

EKFPIXJPEG140.DLL

ProFire.DLL

LFDCS14SU.DLL

PDC_SDK.DLL

EKFPIXJPEG140.DLL

ProFire.DLL

LFDCS14SE.DLL

PDC_SDK.DLL

EKFPIXJPEG140.DLL

ProFire.DLL

LFDCS14SEU.DLL

PDC_SDK.DLL

EKFPIXJPEG140.DLL

ProFire.DLL

FILE_DICOM_GRAY

FILE_DICOM_COLOR

FILE_DICOM_RLE_GRAY

FILE_DICOM_RLE_COLOR

DICOM Format

LTDIC14S.DLL

Not Supported

LTDIC14SE.DLL

Not Supported

FILE_DICOM_JPEG_GRAY

FILE_DICOM_JPEG_COLOR

DICOM Format

LTDIC14S.DLL

LFCMP14S.DLL

Not Supported

LTDIC14SE.DLL

LFCMP14SE.DLL

Not Supported

FILE_DICOM_J2K_GRAY

FILE_DICOM_J2K_COLOR

DICOM Format

LTDIC14S.DLL

LFJ2K14S.DLL

Not Supported

LTDIC14SE.DLL

LFJ2K14SE.DLL

Not Supported

FILE_DJVU

DjVu Format

LFDJV14S.DLL

LFDJV14SU.DLL

LFDJV14SE.DLL

LFDJV14SEU.DLL

FILE_DRW

Micrografx Designer DRaWing

LFDRW14S.DLL

LFDRW14SU.DLL

LFDRW14SE.DLL

LFDRW14SEU.DLL

FILE_DWF

FILE_DWF_TEXT_AS_POLYLINE

AutoCAD DWF Format

LFDWF14S.DLL

LFDWF14SU.DLL

LFDWF14SE.DLL

LFDWF14SEU.DLL

FILE_DWG

AutoCAD DWG Format

(LFACS is required to allow DWG filters to load ACIS data embedded in this format.)

LFDWG14S.DLL

LFACS14S.DLL

LFDWG14SU.DLL

LFACS14SU.DLL

LFDWG14SE.DLL

LFACS14SE.DLL

LFDWG14SEU.DLL

LFACS14SEU.DLL

FILE_DXF_R12

FILE_DXF_R13

AutoCAD DXF Format

(LFACS is required to allow DWG filters to load ACIS data embedded in this format.)

LFDXF14S.DLL

LFACS14S.DLL

LFDXF14SU.DLL

LFACS14SU.DLL

LFDXF14SE.DLL

LFACS14SE.DLL

LFDXF14SEU.DLL

LFACS14SEU.DLL

FILE_ECW

Enhanced Compressed Wavelet Format

LFECW14S.DLL

NCSECW.DLL

NCSECWC.DLL

NCSUTIL.DLL

NCSCNET.DLL

LFECW14SU.DLL

NCSECW.DLL

NCSECWC.DLL

NCSUTIL.DLL

NCSCNET.DLL

LFECW14SE.DLL

NCSECW.DLL

NCSECWC.DLL

NCSUTIL.DLL

NCSCNET.DLL

LFECW14SEU.DLL

NCSECW.DLL

NCSECWC.DLL

NCSUTIL.DLL

NCSCNET.DLL

FILE_EMF

Windows Enhanced Metafile

LFWMF14S.DLL

LFWMF14SU.DLL

LFWMF14SE.DLL

LFWMF14SEU.DLL

FILE_EPS

Encapsulated PostScript

LFEPS14S.DLL

LFEPS14SU.DLL

LFEPS14SE.DLL

LFEPS14SEU.DLL

FILE_EPSTIFF

Encapsulated PostScript

LFEPS14S.DLL

LFTIF14S.DLL

LFEPS14SU.DLL

LFTIF14SU.DLL

LFEPS14SE.DLL

LFTIF14SE.DLL

LFEPS14SEU.DLL

LFTIF14SEU.DLL

FILE_EPSWMF

Encapsulated PostScript

LFEPS14S.DLL

LFWMF14S.DLL

LFEPS14SU.DLL

LFWMF14SU.DLL

LFEPS14SE.DLL

LFWMF14SE.DLL

LFEPS14SEU.DLL

LFWMF14SEU.DLL

FILE_EPSPOSTSCRIPT

Encapsulated PostScript

LFEPS14S.DLL

LFPDF14S.DLL

PDFDLL32.DLL

LFEPS14SU.DLL

LFPDF14SU.DLL

PDFDLL32.DLL

LFEPS14SE.DLL

LFPDF14SE.DLL

PDFDLL32.DLL

LFEPS14SEU.DLL

LFPDF14SEU.DLL

PDFDLL32.DLL

FILE_EXIF

FILE_EXIF_YCC

FILE_EXIF_JPEG_411

FILE_EXIF_JPEG_422

Exif Format

LFTIF14S.DLL

LFCMP14S.DLL

LFTIF14SU.DLL

LFCMP14SU.DLL

LFTIF14SE.DLL

LFCMP14SE.DLL

LFTIF14SEU.DLL

LFCMP14SEU.DLL

FILE_FAX_G3_1D

FILE_FAX_G3_1D_NOEOL

FILE_FAX_G3_2D

FILE_FAX_G4

Raw FAX Formats

LFFAX14S.DLL

LFFAX14SU.DLL

LFFAX14SE.DLL

LFFAX14SEU.DLL

FILE_FIT

Flexible Image Transport System Format

LFFIT14S.DLL

LFFIT14SU.DLL

LFFIT14SE.DLL

LFFIT14SEU.DLL

FILE_FLC

FILE_FLI

Flic Animation

LFFLC14S.DLL

LFFLC14SU.DLL

LFFLC14SE.DLL

LFFLC14SEU.DLL

FILE_FPX

FILE_FPX_SINGLE_COLOR

FILE_FPX_JPEG

FILE_FPX_JPEG_QFACTOR

Kodak FlashPix support

LFFPX14S.DLL
LFFPX7.DLL
LFKODAK.DLL

LFFPX14SU.DLL
LFFPX7.DLL
LFKODAK.DLL

LFFPX14SE.DLL
LFFPX7.DLL
LFKODAK.DLL

LFFPX14SEU.DLL
LFFPX7.DLL
LFKODAK.DLL

FILE_GERBER

Gerber File Format

LFGBR14S.DLL

LFGBR14SU.DLL

LFGBR14SE.DLL

LFGBR14SEU.DLL

FILE_GIF

Compuserve GIF Format

LFGIF14S.DLL

LFGIF14SU.DLL

LFGIF14SE.DLL

LFGIF14SEU.DLL

FILE_IFF_ILBM

FILE_IFF_CAT

FILE_IFF_ILBM_UNCOMPRESSED

FILE_IFF_CAT_UNCOMPRESSED

Interchange File Format

LFIFF14S.DLL

LFIFF14SU.DLL

LFIFF14SE.DLL

LFIFF14SEU.DLL

FILE_IMG

GEM Image Format

LFIMG14S.DLL

LFIMG14SU.DLL

LFIMG14SE.DLL

LFIMG14SEU.DLL

FILE_INTERGRAPH_RLE

FILE_INTERGRAPH_CCITT_G4

Intergraph Format

LFITG14S.DLL

LFFAX14S.DLL

LFITG14SU.DLL

LFFAX14SU.DLL

LFITG14SE.DLL

LFFAX14SE.DLL

LFITG14SEU.DLL

LFFAX14SEU.DLL

FILE_INTERGRAPH_VECTOR

Intergraph MicroStation and Interactive Graphics Design System Format

LFDGN14S.DLL

LFDGN14SU.DLL

LFDGN14SE.DLL

LFDGN14SEU.DLL

FILE_ICA_IBM_MMR

FILE_ICA_UNCOMPRESSED

Image Object Content Architecture Format

LFICA14S.DLL

LFICA14SU.DLL

LFICA14SE.DLL

LFICA14SEU.DLL

FILE_ICA_G3_1D

FILE_ICA_G3_2D

FILE_ICA_G4

Image Object Content Architecture Format

LFICA14S.DLL

LFFAX14S.DLL

LFICA14SU.DLL

LFFAX14SU.DLL

LFICA14SE.DLL

LFFAX14SE.DLL

LFICA14SEU.DLL

LFFAX14SEU.DLL

FILE_ICA_ABIC

Image Object Content Architecture Format

LFICA14S.DLL

LFABI14S.DLL

LFICA14SU.DLL

LFABI14SU.DLL

LFICA14SE.DLL

LFABI14SE.DLL

LFICA14SEU.DLL

LFABI14SEU.DLL

FILE_J2K
FILE_JP2

JPEG 2000 Format

LFJ2K14S.DLL

LFJ2K14SU.DLL

LFJ2K14SE.DLL

LFJ2K14SEU.DLL

FILE_JBIG2

JBIG2 Format

LFJB214S.DLL

LFJB214SU.DLL

LFJB214SE.DLL

LFJB214SEU.DLL

FILE_JBIG

JBIG Format

LFJBG14S.DLL

LFJBG14SU.DLL

LFJBG14SE.DLL

LFJBG14SEU.DLL

FILE_JPEG

FILE_JPEG_411

FILE_JPEG_422

FILE_JPEG_RGB

FILE_JPEG_LAB

FILE_JPEG_LAB_411

FILE_JPEG_LAB_422

JPEG File Interchange Format (If you are loading or saving files that use CMYK or LAB color space, you will also need LTCLR.)

LFCMP14S.DLL

LFCMP14SU.DLL

LFCMP14SE.DLL

LFCMP14SEU.DLL

FILE_KDC

FILE_KDC_120

FILE_KDC_40

FILE_KDC_50

Kodak Digital Camera Format

LFKDC14S.DLL

DC120V154_32.DLL

LFKDC14SU.DLL

DC120V154_32.DLL

LFKDC14SE.DLL

DC120V154_32.DLL

LFKDC14SEU.DLL

DC120V154_32.DLL

FILE_LASERDATA

LaserView LaserData Fromat (read only)

LFFAX14S.DLL

LFFAX14SU.DLL

LFFAX14SE.DLL

LFFAX14SEU.DLL

FILE_LEAD1BITA

LEAD 1-bit Compressed Format

LFLMA14S.DLL

LFLMA14SU.DLL

LFLMA14SE.DLL

LFLMA14SEU.DLL

FILE_LEAD1BIT

LEAD 1-bit Compressed Format

LFLMB14S.DLL

LFLMB14SU.DLL

LFLMB14SE.DLL

LFLMB14SEU.DLL

FILE_MAC

Macintosh Paint Format

LFMAC14S.DLL

LFMAC14SU.DLL

LFMAC14SE.DLL

LFMAC14SEU.DLL

FILE_MPEG1

FILE_MPEG2

MPEG Video Format (read only)

LFMPG14S.DLL

LFMPG14SU.DLL

LFMPG14SE.DLL

LFMPG14SEU.DLL

FILE_MRC

Mixed Raster Content

LTSGM14N.DLL
LFCMP14S.DLL
LFFAX14S.DLL

LTSGM14NU.DLL
LFCMP14SU.DLL
LFFAX14SU.DLL

LTSGM14E.DLL
LFCMP14SE.DLL
LFFAX14SE.DLL

LTSGM14EU.DLL
LFCMP14SEU.DLL
LFFAX14SEU.DLL

FILE_LEAD_MRC

Mixed Raster Content

LTSGM14N.DLL
LFCMP14S.DLL
LFFAX14S.DLL
LFJBG14S.DLL

LTSGM14NU.DLL
LFCMP14SU.DLL
LFFAX14SU.DLL
LFJBG14SU.DLL

LTSGM14E.DLL
LFCMP14SE.DLL
LFFAX14SE.DLL
LFJBG14SE.DLL

LTSGM14EU.DLL
LFCMP14SEU.DLL
LFFAX14SEU.DLL
LFJBG14SEU.DLL

FILE_PDF_LEAD_MRC

Mixed Raster Content

LTSGM14N.DLL
LCMRC14S.DLL
LCPDF14S.DLL
LCENC14S.DLL
LCZIB.DLL
LFCMP14S.DLL
LFJB214S.DLL

LTSGM14NU.DLL
LCMRC14SU.DLL
LCPDF14SU.DLL
LCENC14SU.DLL
LCZIB.DLL
LFCMP14SU.DLL
LFJB214SU.DLL

LTSGM14E.DLL
LCMRC14SE.DLL
LCPDF14SE.DLL
LCENC14SE.DLL
LCZIB.DLL
LFCMP14SE.DLL
LFJB214SE.DLL

LTSGM14EU.DLL
LCMRC14SEU.DLL
LCPDF14SEU.DLL
LCENC14SEU.DLL
LCZIB.DLL
LFCMP14SEU.DLL
LFJB214SEU.DLL

FILE_MSP

Microsoft Paint Format

LFMSP14S.DLL

LFMSP14SU.DLL

LFMSP14SE.DLL

LFMSP14SEU.DLL

FILE_OS2

FILE_OS2_2

OS/2 Bitmap Format

LFBMP14S.DLL

LFBMP14SU.DLL

LFBMP14SE.DLL

LFBMP14SEU.DLL

FILE_PBM_BINARY

FILE_PBM_ASCII

FILE_PGM_BINARY

FILE_PGM_ASCII

FILE_PPM_BINARY

FILE_PPM_ASCII

Portable Bitmap Utilities Format

LFPNM14S.DLL

LFPNM14SU.DLL

LFPNM14SE.DLL

LFPNM14SEU.DLL

FILE_PCD

Kodak PhotoCD Format (read only)

LFPCD14S.DLL

PCDLIB32.DLL

PCDLIB.DLL

LFPCD14SU.DLL

PCDLIB32.DLL

PCDLIB.DLL

LFPCD14SE.DLL

PCDLIB32.DLL

PCDLIB.DLL

LFPCD14SEU.DLL

PCDLIB32.DLL

PCDLIB.DLL

FILE_PDF_LEAD_MRC

Mixed Raster Content

LTRMR14N.DLL
LFCMP14S.DLL
LFFAX14S.DLL
LFJB214S.DLL
LFPDF14S.DLL
PDFDLL32.DLL

LTRMR14NU.DLL
LFCMP14SU.DLL
LFFAX14SU.DLL
LFJB214SU.DLL
LFPDF14SU.DLL
PDFDLL32.DLL

LTRMR14E.DLL
LFCMP14SE.DLL
LFFAX14SE.DLL
LFJB214SE.DLL
LFPDF14SE.DLL
PDFDLL32.DLL

LTRMR14EU.DLL
LFCMP14SEU.DLL
LFFAX14SEU.DLL
LFJB214SEU.DLL
LFPDF14SEU.DLL
PDFDLL32.DLL

FILE_PCL

FILE_PCL_TEXT_AS_POLYLINE

FILE_PLT

Printer Command Language Format

LFPCL14S.DLL

LFPCL14SU.DLL

LFPCL14SE.DLL

LFPCL14SEU.DLL

FILE_PCT

Macintosh Pict

LFPCT14S.DLL

LFPCT14SU.DLL

LFPCT14SE.DLL

LFPCT14SEU.DLL

FILE_PCX

ZSoft PCX Format

LFPCX14S.DLL

LFPCX14SU.DLL

LFPCX14SE.DLL

LFPCX14SEU.DLL

FILE_PLT

PLT / HPGL Format

LFPCL14S.DLL

LFPCL14SU.DLL

LFPCL14SE.DLL

LFPCL14SEU.DLL

FILE_PNG

Portable Network Graphics Format

LFPNG14S.DLL

LFPNG14SU.DLL

LFPNG14SE.DLL

LFPNG14SEU.DLL

FILE_POSTSCRIPT

Postscript Document Format

LFPDF14S.DLL

PDFDLL32.DLL

PDF Redist Files: For reading PDF files, you must follow the instructions outlined in the "Distributing an application built using the PDF Module" section of Implementing PDF Plug in Features.

LFPDF14SU.DLL

PDFDLL32.DLL

PDF Redist Files: For reading PDF files, you must follow the instructions outlined in the "Distributing an application built using the PDF Module" section of Implementing PDF Plug in Features.

LFPDF14SE.DLL

PDFDLL32.DLL

PDF Redist Files: For reading PDF files, you must follow the instructions outlined in the "Distributing an application built using the PDF Module section of Implementing PDF Plug in Features.

LFPDF14SEU.DLL

PDFDLL32.DLL

PDF Redist Files: For reading PDF files, you must follow the instructions outlined in the "Distributing an application built using the PDF Module section of Implementing PDF Plug in Features.

FILE_PSD

PhotoShop 3.0 Format

LFPSD14S.DLL

LFPSD14SU.DLL

LFPSD14SE.DLL

LFPSD14SEU.DLL

FILE_PSP

FILE_PSP_RLE

Paint Shop Pro Format

LFPSP14S.DLL

LFPSP14SU.DLL

LFPSP14SE.DLL

LFPSP14SEU.DLL

FILE_PTOCA

Presentation Text Object Content Architecture Format

LFPTK14S.DLL

LFPTK14SU.DLL

LFPTK14SE.DLL

LFPTK14SEU.DLL

FILE_RAS

FILE_RAS_RLE

SUN Raster Format

LFRAS14S.DLL

LFRAS14SU.DLL

LFRAS14SE.DLL

LFRAS14SEU.DLL

FILE_RAS_PDF

(Read Support)

Portable Document Format (PDF)

LFPDF14S.DLL

PDFDLL32.DLL

PDF Redist Files

LFPDF14SU.DLL

PDFDLL32.DLL

PDF Redist Files

LFPDF14SE.DLL

PDFDLL32.DLL

PDF Redist Files

LFPDF14SEU.DLL

PDFDLL32.DLL

PDF Redist Files

FILE_RAS_PDF

FILE_RAS_PDF_LZW

(Write Support)

Portable Document Format (PDF)

LFPDF14S.DLL

LFPDF14SU.DLL

LFPDF14SE.DLL

LFPDF14SEU.DLL

FILE_RAS_PDF_G3_1D

FILE_RAS_PDF_G3_2D

FILE_RAS_PDF_G4

(Write Support)

Portable Document Format (PDF)

LFPDF14S.DLL

LFFAX14S.DLL

LFPDF14SU.DLL

LFFAX14SU.DLL

LFPDF14SE.DLL

LFFAX14SE.DLL

LFPDF14SEU.DLL

LFFAX14SEU.DLL

FILE_RAS_PDF_JPEG

FILE_RAS_PDF_JPEG_422

FILE_RAS_PDF_JPEG_411

(Write Support)

Portable Document Format (PDF)

LFPDF14S.DLL

LFCMP14S.DLL

LFPDF14SU.DLL

LFCMP14SU.DLL

LFPDF14SE.DLL

LFCMP14SE.DLL

LFPDF14SEU.DLL

LFCMP14SEU.DLL

FILE_RAS_PDF_JBIG2 (Write Support)

Portable Document Format (PDF)

LFPDF14S.DLL

LFJB214S.DLL

LFPDF14SU.DLL

LFJB214SU.DLL

LFPDF14SE.DLL

LFJB214SE.DLL

LFPDF14SEU.DLL

LFJB214SEU.DLL

FILE_RAW
FILE_RAW_RGB
FILE_RAW_RLE4
FILE_RAW_RLE8
FILE_RAW_BITFIELDS
FILE_RAW_PACKBITS
FILE_RAW_JPEG
FILE_FAX_G31D_NOEOL
FILE_RAW_CCITT
FILE_RAW_LZW

RAW Data

LFRAW14S.DLL

LFFAX14S.DLL

LFRAW14SU.DLL

LFFAX14SU.DLL

LFRAW14SE.DLL

LFFAX14SE.DLL

LFRAW14SEU.DLL

LFFAX14SEU.DLL

FILE_RAWICA_IBM_MMR

FILE_RAWICA_UNCOMPRESSED

Image Object Content Architecture Format

LFICA14S.DLL

LFICA14SU.DLL

LFICA14SE.DLL

LFICA14SEU.DLL

FILE_RAWICA_G3_1D

FILE_RAWICA_G3_2D

FILE_RAWICA_G4

Image Object Content Architecture Format

LFICA14S.DLL

LFFAX14S.DLL

LFICA14SU.DLL

LFFAX14SU.DLL

LFICA14SE.DLL

LFFAX14SE.DLL

LFICA14SEU.DLL

LFFAX14SEU.DLL

FILE_RTF_RASTER

Rich Text Format

LFRTF14S.DLL

LFRTF14SU.DLL

LFRTF14SE.DLL

LFRTF14SEU.DLL

FILE_SCT

Scitex Continuous Tone Format

LFSCT14S.DLL

LTCLR14S.DLL

LFSCT14SU.DLL

LTCLR14S.DLL

LFSCT14SE.DLL

LTCLR14S.DLL

LFSCT14SEU.DLL

LTCLR14S.DLL

FILE_SFF

Structured Fax Format

LFSFF14S.DLL

LFFAX14S.DLL

LFSFF14SU.DLL

LFFAX14SU.DLL

LFSFF14SE.DLL

LFFAX14SE.DLL

LFSFF14SEU.DLL

LFFAX14SEU.DLL

FILE_SGI

FILE_SGI_RLE

Silicon Graphics Format

LFSGI14S.DLL

LFSGI14SU.DLL

LFSGI14SE.DLL

LFSGI14SEU.DLL

FILE_SHP

ESRI Shape Format

LFSHP14S.DLL

LFSHP14SU.DLL

LFSHP14SE.DLL

LFSHP14SEU.DLL

FILE_SID

MrSid Format

LFSID14S.DLL

LFSID14S.DLL

LFSID14S.DLL

LFSID14S.DLL

FILE_SMP

FILE_SMP_G3_1D

FILE_SMP_G3_2D

FILE_SMP_G4

Xionics Format

LFSMP14S.DLL

LFFAX14S.DLL

LFSMP14SU.DLL

LFFAX14SU.DLL

LFSMP14SE.DLL

LFFAX14SE.DLL

LFSMP14SEU.DLL

LFFAX14SEU.DLL

FILE_SVG

Scalable Vector Graphics Format

LFSVG14S.DLL

LFSVG14SU.DLL

LFSVG14SE.DLL

LFSVG14SEU.DLL

FILE_TGA

FILE_TGA_RLE

Truvision Targa Format

LFTGA14S.DLL

LFTGA14SU.DLL

LFTGA14SE.DLL

LFTGA14SEU.DLL

FILE_TIF

FILE_TIF_YCC

FILE_TIF_PACKBITS

FILE_TIF_PACKBITS_YCC

FILE_TIFLZW

FILE_TIFLZW_YCC

FILE_GEOTIFF

FILE_TIF_UNKNOWN

FILE_TIF_CUSTOM

TIFF Tagged Image File Format

LFTIF14S.DLL

If you are loading TIF files that use LAB color space, you will also need LTCLR.

LFTIF14SU.DLL

If you are loading TIF files that use LAB color space, you will also need LTCLR.

LFTIF14SE.DLL

If you are loading TIF files that use LAB color space, you will also need LTCLR.

LFTIF14SEU.DLL

If you are loading TIF files that use LAB color space, you will also need LTCLR.

FILE_CCITT

FILE_CCITT_GROUP3_1DIM

FILE_CCITT_GROUP3_2DIM

FILE_CCITT_GROUP4

TIFF Tagged Image File Format

LFTIF14S.DLL

LFFAX14S.DLL

LFTIF14S.DLL

LFFAX14SU.DLL

LFTIF14SE.DLL

LFFAX14SE.DLL

LFTIF14SE.DLL

LFFAX14SEU.DLL

FILE_TIF_CMYK

FILE_TIF_PACKBITS_CMYK

FILE_TIFLZW_CMYK

TIFF Tagged Image File Format

LFTIF14S.DLL

LTCLR14S.DLL

LFTIF14S.DLL

LTCLR14SU.DLL

LFTIF14S.DLL

LTCLR14SE.DLL

LFTIF14S.DLL

LTCLR14SEU.DLL

FILE_TIF_JPEG

FILE_TIF_JPEG_422

FILE_TIF_JPEG_411

FILE_TIF_CMP

TIFF Tagged Image File Format

LFTIF14S.DLL

LFCMP14S.DLL

LFTIF14S.DLL

LFCMP14SU.DLL

LFTIF14S.DLL

LFCMP14SE.DLL

LFTIF14S.DLL

LFCMP14SEU.DLL

FILE_TIF_JBIG2

TIFF Tagged Image File Format

LFTIF14S.DLL

LFJB214S.DLL

LFTIF14SU.DLL

LFJB214SU.DLL

LFTIF14SE.DLL

LFJB214SE.DLL

LFTIF14SEU.DLL

LFJB214SEU.DLL

FILE_TIF_JBIG

TIFF Tagged Image File Format

LFTIF14S.DLL

LFJBG14S.DLL

LFTIF14S.DLL

LFJBG14SU.DLL

LFTIF14S.DLL

LFJBG14SE.DLL

LFTIF14S.DLL

LFJBG14SEU.DLL

FILE_TIF_DXF_R12

FILE_TIF_DXF_R13

TIFF Tagged Image File Format

LFTIF14S.DLL

LFDXF14S.DLL

LFTIF14S.DLL

LFDXF14SU.DLL

LFTIF14S.DLL

LFDXF14SE.DLL

LFTIF14S.DLL

LFDXF14SEU.DLL

FILE_TIF_J2K

TIFF Tagged Image File Format

LFTIF14S.DLL

LFJ2K14S.DLL

LFTIF14S.DLL

LFJ2K14SU.DLL

LFTIF14S.DLL

LFJ2K14SE.DLL

LFTIF14S.DLL

LFJ2K14SEU.DLL

FILE_TIFX_JBIG

FILE_TIFX_JBIG_T43

FILE_TIFX_JBIG_T43_ITULAB

FILE_TIFX_JBIG_T43_GS

Xerox Internet Fax Format

LFTFX14S.DLL

LFJBG14S.DLL

LFTFX14S.DLL

LFJBG14SU.DLL

LFTFX14S.DLL

LFJBG14SE.DLL

LFTFX14S.DLL

LFJBG14SEU.DLL

FILE_TIFX_FAX_G3_1D

FILE_TIFX_FAX_G3_2D

FILE_TIFX_FAX_G4

Xerox Internet Fax Format

LFTFX14S.DLL

LFFAX14S.DLL

LFTFX14S.DLL

LFFAX14SU.DLL

LFTFX14S.DLL

LFFAX14SE.DLL

LFTFX14S.DLL

LFFAX14SEU.DLL

FILE_TIFX_JPEG

Xerox Internet Fax Format

LFTFX14S.DLL

LFCMP14S.DLL

LFTFX14S.DLL

LFCMP14SU.DLL

LFTFX14S.DLL

LFCMP14SE.DLL

LFTFX14S.DLL

LFCMP14SEU.DLL

FILE_TIF_CMW

TIFF Tagged Image File Format

LFTIF14S.DLL

LFCMW14S.DLL

LFTIF14S.DLL

LFCMW14SU.DLL

LFTIF14S.DLL

LFCMW14SE.DLL

LFTIF14S.DLL

LFCMW14SEU.DLL

FILE_TIF_ABC

TIFF Tagged Image File Format

LFTIF14S.DLL

LFABC14S.DLL

LFTIF14S.DLL

LFABC14SU.DLL

LFTIF14S.DLL

LFABC14SE.DLL

LFTIF14S.DLL

LFABC14SEU.DLL

FILE_TIF_ABIC

TIFF Tagged Image File Format

LFTIF14S.DLL

LFABI14S.DLL

LFTIF14SU.DLL

LFABI14SU.DLL

LFTIF14SE.DLL

LFABI14SE.DLL

LFTIF14SEU.DLL

LFABI14SEU.DLL

FILE_TIF_MRC

TIFF Tagged Image File Format

LFTIF14S.DLL

LTSGM14S.DLL

LFCMP14S.DLL

LFFAX14S.DLL

LFTIF14S.DLL

LTSGM14SU.DLL

LFCMP14SU.DLL

LFFAX14SU.DLL

LFTIF14S.DLL

LTSGM14SE.DLL

LFCMP14SE.DLL

LFFAX14SE.DLL

LFTIF14S.DLL

LTSGM14SEU.DLL

LFCMP14SEU.DLL

LFFAX14SEU.DLL

FILE_TIF_LEAD_MRC

TIFF Tagged Image File Format

LFTIF14S.DLL

LTSGM14S.DLL

LFCMP14S.DLL

LFFAX14S.DLL

LFJBG14S.DLL

LFTIF14S.DLL

LTSGM14SU.DLL

LFCMP14SU.DLL

LFFAX14SU.DLL

LFJBG14SU.DLL

LFTIF14S.DLL

LTSGM14SE.DLL

LFCMP14SE.DLL

LFFAX14SE.DLL

LFJBG14SE.DLL

LFTIF14S.DLL

LTSGM14SEU.DLL

LFCMP14SEU.DLL

LFFAX14SEU.DLL

LFJBG14SEU.DLL

FILE_TXT

ASCII Text Files (Read only)

LFTXT14S.DLL

LFTXT14SU.DLL

LFTXT14SE.DLL

LFTXT14SEU.DLL

FILE_VWPG

WordPerfect Vector Format

LFVPG14S.DLL

LFVPG14SU.DLL

LFVPG14SE.DLL

LFVPG14SEU.DLL

FILE_WBMP

Wireless Bitmap Format

LFWMP14S.DLL

LFWMP14SU.DLL

LFWMP14SE.DLL

LFWMP14SEU.DLL

FILE_WFX_G3_1D

FILE_WFX_G4

Delrina WinFax Format

LFWFX14S.DLL

LFFAX14S.DLL

LFWFX14SU.DLL

LFFAX14SU.DLL

LFWFX14SE.DLL

LFFAX14SE.DLL

LFWFX14SEU.DLL

LFFAX14SEU.DLL

FILE_WIN_ICO

FILE_WIN_CUR

Windows icon and cursor Format

LFBMP14S.DLL

LFBMP14SU.DLL

LFBMP14SE.DLL

LFBMP14SEU.DLL

FILE_WMF

Windows Metafile

LFWMF14S.DLL

LFWMF14SU.DLL

LFWMF14SE.DLL

LFWMF14SEU.DLL

FILE_WMZ

Compressed Windows Metafile Format

LFWMZ14S.DLL

LFWMZ14SU.DLL

LFWMZ14SE.DLL

LFWMZ14SEU.DLL

FILE_WPG

WordPerfect Graphic Format

LFWPG14S.DLL

LFWPG14SU.DLL

LFWPG14SE.DLL

LFWPG14SEU.DLL

FILE_XBM

XWindows XBitMap Format

LFXBM14S.DLL

LFXBM14SU.DLL

LFXBM14SE.DLL

LFXBM14SEU.DLL

FILE_XPM

X Window PixMap Format

LFXPM14S.DLL

LFXPM14SU.DLL

LFXPM14SE.DLL

LFXPM14SEU.DLL

FILE_XWD10
FILE_XWD11

X Window Dump Format

LFXWD14S.DLL

LFXWD14SU.DLL

LFXWD14SE.DLL

LFXWD14SEU.DLL

Canon Runtime files required for CRW support:

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.

Canon, Inc. publishes these DLLs. If you wish to obtain a license to distribute these files, contact Canon and license the free Canon Digital Camera Software Developer Kit at http://www.powershot.com/powershot2/customer/develop1.html. These files are included for demonstration and testing purposes. You must obtain a license from canon prior to distributing these files.

Canon, Inc. suggests that the user of their CRW SDK MUST place the required DLLs/Libraries in the working folder of the EXE application that is using it, and not in the SYSTEM folder. LEADTOOLS tested this in the system folder and it worked fine. But to follow Canon's instructions, we recommend the users of CANON DLLs/Libraries to place them in the working folder of his/her application to avoid any problems/conflicts, which may result from ignoring this recommendation.

PDF Runtime Files:

For reading PDF files you must follow the instructions outlined in the "Distributing an application built using the PDF Module" section of Implementing PDF Plug in Features.


Installation Directory

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

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

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

BIN | Executable files for the demonstration programs.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\RES | Resource files for the example programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
IMPORTANT FORMS | Contracts, Pricing Schedules, Runtime Agreements, etc.
INCLUDE | Header files, BAS files, and the COM Object's MFC interface files for versions of Visual C++ earlier than 5.0.
REDIST\COM | Redistributable files. These are copies of the LEADTOOLS COM Object 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.
REDIST\COM\NONAG | This directory contains the LEADRaster COM Object DLL that must be distributed with your application.For more information about the nag and no-nag versions of the LEADRaster COM Object DLL, refer to Document/Medical Support and Licensing Requirements . For non-royalty products, the extra licensing requirements do not apply, simply distribute the LEADRaster COM Object DLL from REDIST\COM\NONAG.


System Files Updated

The LEADTOOLS installation procedure adds the DLL files and all of the required driver files to your WINDOWS\SYSTEM directory. For a list of these files, refer to Files To Be Included With Your Application.

In addition, the installation procedure, as noted in the remainder of this topic, updates Windows system files that are required by the LEADTOOLS example programs.

The LEADTOOLS WIN32 installation procedure adds the following Windows files to your WINDOWS\SYSTEM directory. If your system has an earlier version of any of these files, the installation procedure overwrites it with the newer version.

COMDLG32.OCX
CTL3D32.DLL
MFC40.DLL
MFC42.DLL
MSVCRT20.DLL
MSVCRT40.DLL
MSVCRT.DLL
OC30.DLL
OLE32.DLL
OLEAUT32.DLL
OLEPRO32.DLL
STDOLE2.TLB
VB40032.DLL
VEN2232.OLB


LEADTOOLS API Integration Functions

The LEADTOOLS ActiveX is sold either as a stand-alone product or as an addition to the LEADTOOLS API for C programmers. The API not only provides the ActiveX, but also lets you access structures and functions in the LEADTOOLS DLLs.

L_OCXADD.BAS, which is distributed with the LEADTOOLS API, contains the LEAD structure definitions and function prototypes for the LEAD DLLs in Visual Basic format.


Summary of All Supported Image File Formats

Raster Color and Grayscale

ABIC - ABIC Format

AFP - AFP Format

ANI - Windows Animated Cursor

AVI - Windows AVI Format

BMP - Windows Bitmap Formats

CIN - Cineon Format

CLP - Microsoft Windows Clipboard Format

CMP - LEAD Compressed

CMW - LEAD Wavelet Compressed

CRW - Canon RAW Format

CUR - Windows Cursors

CUT - Dr. Halo Format

DCR - Kodak Professional Digital Camera Format

DCS - Kodak Professional Digital Camera System Format

DCX - DCX Format

DICOM - DICOM Format

DJVU - DjVu Format

ECW - Enhanced Compressed Wavelet Format

EMF - Windows Metafile Formats

EPS - Encapsulated PostScript Format

EXIF - Exif Formats

FIT - FITS Format

FLC - Flic Animation Format

FPX - Kodak Format

GIF - Compuserve GIF Format

ICO - Windows Icons

IFF - Interchange File Formats

JBG - JBIG Format

JPG - JPEG Compressed

JP2 - JPEG 2000 Compressed

KDC - Kodak Digital Camera Format

MRC - Mixed Raster Content

MPG - MPEG Video Format

PBM - Portable Bitmap Utilities Format

PCD - Kodak Format

PCT - Macintosh Pict Format

PCX - PCX Format

PDF - Portable Document Format

PNG - Portable Network Graphics Format

PSD - PhotoShop 3.0 Format

PSP - Paint Shop Pro Format

PTK - PTOCA Format

RAS - SUN Raster Format

SCT - Scitex Continuous Tone Format

SFF - Structured Fax File Format

SGI - Silicon Graphics Image Format

SID - MrSid Format

TGA - Truevision TARGA Format

TIFF - Tagged Image File Format

TXT - Text Format

WBMP - Wireless Bitmap Format

WMF - Windows Metafile Formats

WPG - WordPerfect Format

XPM - XPicMap

XWD - X WindowDump

Raster Bitonal (1-Bit)

ABC - ABC Format

AWD - Microsoft FAX Format

CAL - CALS Raster Format

CMP - LEAD 1-Bit Format

FAX - Raw Fax Format

FAX - LaserView LaserData Format

ICA - Image Object Content Architecture (IOCA/MODCA)

IMG - GEM Image Format

ITG - Intergraph Format

MAC - MacPaint Format

MSP - Microsoft Paint

SMP - Xionics Format

TIFF - Tagged Image File Format / CCITT

TIFX - Xerox Internet Fax File Format

WFX - WinFax Format

XBM - XBitMap Format

Vector

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

WMF - Windows Metafile Formats

WMZ - Compressed Windows Metafile Format


File Formats: ABC (ABC)

ABC (ABC)

ABC is the best 1 bit lossless compression provided by LEAD. It gives better results than JBIG, or CCITT G4, and it gives better compression for computer or electronic generated documents than for scanned documents. You can read and write files in this format.

With LMC, there are also lossy options. For more information on qFactor values to control the ABC compression, refer to Compression Quality Factors

This format is available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.

The default extension used by this format is: ABC.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ABC | 1 BPP | 1 BPP | [32] LEAD ABC 1 bit, lossless compression.
FILE_TIF_ABC | 1 BPP | 1 BPP | [180] TIFF with LEAD ABC 1 bit, lossless compression.

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

Related Formats: CMP - LEAD 1-Bit Format, FAX - Raw Fax Format, TIFF - Tagged Image File Format / CCITT.


File Formats: ABIC Format (ABIC, ICA)

ABIC Format (ABIC, ICA)

LEADTOOLS reads and writes ABIC files.

The ABIC file format is a raster file format created by IBM. This file format consists of ABIC compression/decompression algorithms that uses an arithmetic coding technique to produce lossless data compression, these algorithms called ABIC (Bi-level Q-Coder) compression algorithm and Concatenated ABIC (Grayscale) compression algorithm.

LEADTOOLS can Load/Save (compression/decompression) ABIC Raw data separately.

The default extension used by this format is: ICA, ABIC (for raw data).

This file format does not support progressive loads and saves, multi-page files, stamps, or Lossless JPEG compression.

Support for this file format can be unlocked using the following support constant: L_KEY_ABIC_READ, L_KEY_ABIC_SAVE.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ABIC | 1, 4 BPP | 1, 4 BPP | [185] Raw ABIC compressed data

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

Related Formats: IOCA/MODCA - Image Object Content Architecture Format


File Formats: AFP (AFP)

AFP Format (AFP)

The AFP format is part of IBM's document imaging system. It is a raster format, created to add enhanced formatting and indexing capabilities to documents for print applications in finance, retail, insurance and other industries. LEAD provides support for the user to open MODCA/PTOCA or AFP/PTOCA documents.

The default extension used by this format is: AFP.

This format is used by the IBM plug in.

This file format does not support stamps or Lossless JPEG compression, but it does support multi-page files.

LEADTOOLS supports functions that let you set the DPI for the opened image file. Please refer to the PTK Options functions.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_AFP | 24 BPP | None | [252] IBM This format is part of IBM's document imaging system.
FILE_AFPICA_G3_1D | 1 BPP | 1 BPP | [309] IOCA, G3 1D compressed.
FILE_AFPICA_G3_2D | 1 BPP | 1 BPP | [310] IOCA, G3 2D compressed.
FILE_AFPICA_G4 | 1 BPP | 1 BPP | [311] IOCA, G4 compressed.
FILE_AFPICA_UNCOMPRESSED | 1 BPP | 1 BPP | [312] IOCA, uncompressed.
FILE_AFPICA_IBM_MMR | 1 BPP | 1 BPP | [313] IOCA, IBM MMR compressed.

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

Currently, LEAD does not save AFP files, but these files can be saved to IOCA.

Related Formats: FAX - Raw Fax Format, ICA - Image Object Content Architecture (IOCA/MODCA), PTK - PTOCA Format, TIFF - Tagged Image File Format / CCITT.


File Formats: BMP Formats

BMP Formats

LEADTOOLS reads and writes the following BMP formats:

Windows Bitmap (BMP). This is a file format created by Microsoft. Some BMP images are compressed with an RLE-type compression.

OS/2 Bitmap (OS/2 BMP). These are files created on an OS/2 operating system. LEADTOOLS supports both 1.x and 2.x formats.

File constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_BMP | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [6] Windows BMP, with no compression.
FILE_BMP_RLE | 4, 8 BPP | 4, 8 BPP | [84] Windows BMP, with RLE compression.
FILE_OS2 | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [14] OS/2 BMP version 1.x.
FILE_OS2_2 | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [74] OS/2 BMP version 2.x.

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

Related Formats: PBM - Portable Bitmap Utilities Format, PCX - PCX Format, WBMP - Wireless Bitmap Format, XPM - XPicMap, XBM - XBitMap Format.


Canon RAW Format (CRW)

The Canon Raw file format is a raster file format created by Canon digital cameras. It is a raw dump of CCD pixels with no compression. This format is supported by POLYVIEW.

LEADTOOLS can read and view, using the Canon Digital Camera SDK (CD-SDK), CRW files generated by the following digital cameras:

Power Shot | IXY DIGITAL | DIGITAL IXUS | EOS
Power Shot A10 Power Shot A20 Power Shot A30 Power Shot A40 Power Shot A100 Power Shot S10 Power Shot S20 Power Shot S30 Power Shot S40 Power Shot S100 Power Shot S110 Power Shot S200 Power Shot S300 Power Shot S330 Power Shot G1 Power Shot G2 Power Shot Pro90 IS | IXY DIGITAL IXY DIGITAL 200 IXY DIGITAL 200a IXY DIGITAL 300 IXY DIGITAL 300a | DIGITAL IXUS DIGITAL IXUS v DIGITAL IXUS v2 DIGITAL IXUS 300 DIGITAL IXUS 300 | EOS D30 EOS D60 EOS-1D

The default extension used by this format is: CRW.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CRW | 24 BPP | None | [296] Cannon raw format.

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

Related Formats: DCR - Kodak Professional Digital Camera Format, DCS - Kodak Professional Digital Camera System Format, EXIF - Exif Formats, FPX - Kodak Format, KDC - Kodak Digital Camera Format, PCD - Kodak Format.


File Formats: Cineon Format (CIN)

Cineon Format (CIN)

KODAK Cineon Format (CIN) files are raster format files created by Kodak and supported by XnView and PixEdit. They are designed to better represent film imagery in a digital format. Cineon files store data in a 10-bit logarithmic scale. Therefore, each color component has a range of 0 to 1023. LEADTOOLS supports version 4.5 of this format.

The default extension used by this format is: CIN.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CIN | 24 BPP | 24 BPP | [298] Kodak Cineon Format.

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


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.

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

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, WMF - Windows Metafile Formats.


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: DjVu Format (DJVU)

DjVu Format (DJVU)

The DjVu format is a raster file representing a new image compression technology that allows the distribution on the Internet of very high resolution images of scanned documents, digital documents and photographs. This format was developed by LizardTech and is supported by the LizardTech SDK. LEADTOOLS, using the LizardTech SDK 3.6, can load DJVU files. LEADTOOLS does not save DJVU files.

LEADTOOLS® supports the loading of DJVU files at different resolutions, depending on the user's preference. In the COM the DJVResolution property lets the programmer manipulate the resolution for DJVU files.

The default extensions used by this format are: DJV, DJVU.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DJVU | 1, 8, 24 BPP | None | [308] LizardTech DjVu.

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


File Formats: DICOM Format (DIC)

DICOM Format (DIC)

Note:

This format is supported only in Document/Medical.

DICOM (DIC) files are commonly used in medical images. LEADTOOLS reads a broad range of DICOM formats, converting them to LEAD-supported bits-per-pixel as necessary. LEADTOOLS writes DICOM files in the LEAD-supported bits-per-pixel. DICOM files can contain many comment fields of various types. You can use the ReadComment method to read comments in an existing file. Before writing a file, you can use the Comment property to create an array of comments to be saved in the file.

You can read DICOM files as follows:

Grayscale files in the 1- to 16-bit range are loaded as they are in the original file.

Palettized color files in the 1- to 16-bit range are converted to 8-bit palettized or 24-bit unpalettized. By default, they are converted to 24-bit only if the palette contains more than 256 colors.

Unpalettized color files (RGB, ARGB, or CMYK) with 1 to 16 bits per plane are converted to 24-bit RGB.

Read multipage DICOM files by setting the page number when calling the Load method (ILEADRasterIO)..

You can write DICOM files as 8, 12, or 16-bit grayscale, 8-bit palettized color, or 24-bit RGB color (8 bits per plane).

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DICOM_GRAY | 1 to 16 BPP (Grayscale) | 1 to 16 BPP (Grayscale) | [89] Grayscale DICOM uncompressed.
FILE_DICOM_COLOR | 8, 24 BPP | 8, 24 BPP | [90] Color DICOM uncompressed.
FILE_DICOM_RLE_GRAY | xxxx | xxxx | [125] Grayscale DICOM RLE compressed.
FILE_DICOM_RLE_COLOR | xxxx | xxxx | [126] Color DICOM RLE compressed.
FILE_DICOM_JPEG_GRAY | 8, 16 BPP (Grayscale) | 8, 16 BPP (Grayscale) | [127] Grayscale DICOM JPEG compressed.
FILE_DICOM_JPEG_COLOR | 24 BPP | 24 BPP | [128] Color DICOM JPEG compressed.
FILE_DICOM_J2K_GRAY | 8, 16 BPP (Grayscale) | 8, 16 BPP (Grayscale) | [293] Grayscale DICOM JPEG 2000 compressed.
FILE_DICOM_J2K_COLOR | 24 BPP | 24 BPP | [294] Color DICOM JPEG 2000 compressed.

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

Related Formats: EXIF - Exif Formats, JPG - JPEG Compressed, JP2 - JPEG 2000 Compressed, TIFF - Tagged Image File Format.


File Formats: Dr. Halo (CUT)

Dr Halo (CUT)

Dr. Halo files are device-independent images. The image is stored in one file (.CUT) and the palette is stored in a separate file (PAL). If the image has no corresponding .PAL file, it is considered a grayscale image.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CUT | 8 BPP | 8 BPP | [108] Dr. Halo.

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

For CUT files, you can read and write the following bits per pixel: 8.

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).


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.

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

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: 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: Encapsulated PostSript (EPS)

Encapsulated PostScript (EPS)

PostScript Raster (Encapsulated PostScript). These files are used primarily on PostScript printers. These printers usually offer more variety of fonts and higher resolution than standard laser printers. EPS files will work on any PostScript compatible printer and any end-user application that supports placement of EPS files in its work space.

The image that you read from an EPS file can be a PostScript image, a PostScript raster image, an embedded TIFF image, or an embedded WMF image. The image that you write to an EPS file is always a PostScript raster image.

These files can be forced to open thumbnails instead of the PostScript data by setting ELO_FORCE_EPS_THUMBNAIL.

For a PostScript image, you can read the following bits per pixel, using various DPI options: 1, 2, 4, 8, 24. This requires the PDF filter.

For a PostScript raster image, you can read the following bits per pixel: 1, 8, 24.

For an embedded TIFF image, you can read the following bits per pixel: 1, 4, 8, 16, 24, 32.

For an embedded WMF file, you can read the following bits per pixel: 24.

You can write only an 8-bit PostScript raster image, which is grayscale.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_EPSPOSTSCRIPT | 1, 2, 4, 8, 24 BPP | None | [300] Encapsulated PostScript.
FILE_EPSTIFF | 1, 4, 8, 16, 24, 32 BPP | None | [63] Encapsulated PostScript with TIFF preview.
FILE_EPSWMF | 24 BPP | None | [64] Encapsulated PostScript with WMF preview.
FILE_EPS | 1, 8, 24 BPP | 8 BPP (Grayscale) | [16] Encapsulated PostScript.

Required DLLs: LFEPS14N.DLL. This format also requires one or more of the following, for loading, depending on the content of the file: LFTIFF14N.DLL, LFWMF14N.DLL, LFPDF14N.DLL (This DLL also requires PDFDLL32.DLL.).

Related Formats: PCL - Printer Command Language Format, PDF - Portable Document Format, PLT - PLT / HPGL Format, PS - PostScript Document Format, RTF - Rich Text Format.


Enhanced Compressed Wavelet Formats (ECW)

Enhanced Compressed Wavelet Format (ECW)

The Enhanced Compressed Wavelet file format is a raster file format created by the ER Mapper Company.

The ECW format uses wavelet compression, which results in small, high quality image files that can be loaded and saved quickly. This format is supported by ER Viewer and the Plug in for Adobe Photoshop. LEADTOOLS uses the ECW SDK to compress and decompress ECW images. This SDK has the following two restrictions:

The maximum sized image that can be compressed is 500MB.

An image must be at least 128 X 128 to be compressed.

LEADTOOLS supports V2.0 of this file format.

The default extension used by this format is: ECW.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ECW | 24 BPP | 24 BPP | [277] ER Mapper Enhanced Compressed Wavelet.

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).


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: FITS Format (FIT)

FITS Format (FIT)

FITS, the Flexible Image Transport System, is the standard astron data format endorsed by NASA and the IAU. It is a raster format designed to store scientific data sets, which consist of multi-dimensional arrays and 2-dimensional tables. The FITS format was developed by NASA and is supported by XnView and fv Desktop Manager. This file format is available in the Medical toolkits. It can be unlocked using L_SUPPORT_EXTGRAY. Support for the 16-bit grayscale is available in Medical toolkits and must be unlocked using L_SUPPORT_MEDICAL.

The default extensions used by this format are: FIT, FTS and FITS.

The file format supports multi-page files. LEADTOOLS can load the FITS multi-page files.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_FIT | 8 BPP (unsigned binary integer - gray) 16 BPP (twos complement signed integers - gray) 32 BPP (twos complement signed integers - color) | 8 BPP (unsigned binary integer - gray) 16 BPP (twos complement signed integers - gray) 32 BPP (twos complement signed integers - color) | [295] Flexible Image Transport System.

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


File Formats: Exif Formats (TIFF and JPG)

Exif Formats (TIFF and JPG)

Exif is a standard for image files created with digital cameras and other input devices. The standard is set by the Japan Electronic Industry Development Association, and formally it is called the Digital Still Camera Image File Format Standard.

Exif files contain either uncompressed TIFF images or compressed JPEG images. In addition, these files can contain many comment fields of various types. You can use the ReadComment method to read comments in an existing file. Before writing a file, you can use the Comment property to create an array of comments to be saved in the file.

LEADTOOLS reads and writes the following Exif formats:

TIFF. This is a tag-based file format designed to promote universal interchanges of digital image data. You can save any image size.

JPG. This is the JPEG format with YUV 4:2:2 sampling. You can save any image size.

For more information, refer to Compression Using LEAD and JPEG Formats.

If you are working with compressed (JPEG) Exif files, the stamp size has been restricted to 160x120x24. When you call the SaveWithStamp method and specify that you want to save a compressed Exif file, the StampWidth, StampHeight and StampBits parameters are ignored. They are assumed to be 160 (StampWidth), 120 (StampHeight) and 24 (StampBits). That limitation has been imposed in order to conform with the ExifR98 interoperability rules imposed by Japanese digital camera manufacturers.

If you are working with uncompressed (TIFF) Exif files, the stamp size is (width x height x 24 bpp), with no limitations on width and height.

The stamp image can be retrieved by calling the LoadStamp method.

File constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_EXIF | 24 BPP | 24 BPP | [96] Exif file containing a TIFF image, with no compression and with RGB color space.
FILE_EXIF_YCC | 24 BPP | 24 BPP | [97] Exif file containing a TIFF image, with no compression and with YCbCr color space.
FILE_EXIF_JPEG_422 | 24 BPP | 24 BPP | [98] Exif file containing a JPEG compressed image and YUV 4:2:2 color space.
FILE_EXIF_JPEG_411 | 24 BPP | 24 BPP | [101] Exif file containing a JPEG compressed image and YUV 4:1:1 color space.

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

Related Formats: JPG - JPEG Compressed, TIFF - Tagged Image File Format.


File Formats: Flic Animation (FLC)

Flic Animation (FLC)

The Flic file is an animation file created by Auto-desk. This file supports image data but not audio data.

The frames of this file can be of 8bpp image data. The maximum number of frames is 4000.

This file has two versions. The FLI file types support 320 X 200 images with a maximum of 64 colors per image. The FLC file types support up to 64k X 64k images with 256 colors per image.

LEAD supports loading and saving multi-page files in this format.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_FLC | 8 BPP | 8 BPP | [134] Flic Animation 256 color.
FILE_FLI | 8 BPP | none | [61] Flic Animation 64 color.

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

Related Formats: GIF - Compuserve GIF 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: Compuserve GIF

Compuserve GIF

GIF. This is the Graphics Interchange Format created by CompuServe for storing and exchanging color raster images.

Animated GIF. This is a multipage GIF format that can be played as an animation by displaying the images sequentially. LEADTOOLS lets you create and play the animations.

These files are LZW compressed.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_GIF | 1, 2, 3, 4, 5, 6, 7, 8 BPP | 1, 2, 3, 4, 5, 6, 7, 8 BPP | [2] CompuServe GIF.

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

Related Formats: FLC - Flic Animation Format, PNG - Portable Network Graphics Format.


File Formats: Icons and Cursors

Icons and Cursors (ICO and CUR)

LEADTOOLS reads and writes Windows Icon and Cursor files. LEADTOOLS is not designed as an icon editor, but this file support lets you create a bitmap from an icon or cursor, or create an icon or cursor from a bitmap. The library (DLL) to support these formats is the same as for BMP files.

Windows Icon (ICO). This is a multi-page file format for storing one or more Windows icons. The background color when you read these images is always black. The size when you write these images can be no larger than 255-by-255 pixels. (Neither the width nor height can be greater than 255.) You can read and write single-page or multi-page files.

Windows Cursor (CUR). This is a file format for storing Windows cursors (mouse pointers). LEADTOOLS loads or saves transparency information using the region. The size when you write these images should be exactly 32-by-32 pixels. LEAD supports loading and saving multi-page files in this format.

The file constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_WIN_ICO | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [91] Windows Icon.
FILE_WIN_CUR | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [92] Windows Cursor.
FILE_ANI | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [119] Windows Animated Cursor.

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

Related Formats: ANI - Windows Animated Cursor, CLP - Microsoft Windows Clipboard Format.


File Formats: Image Object Content Architecture (IOCA/MODCA)

Image Object Content Architecture Format (IOCA/MODCA)

The Image Object Content Architecture format was developed by IBM. This architecture provides a consistent way to represent images, including conventions and directions for processing and interchanging image information. LEADTOOLS supports single and multi-page files in a MO:DCA wrapper with embedded 1-bit CCITT, Group 3 or Group 4 images, IBM MMR and uncompressed IOCA. LEAD also supports IOCA files without the MO:DCA wrapper. LEAD loads and saves all these formats.

The default extension used by this format is: ICA.

This file format does not support stamps or Lossless JPEG compression, but it does support multi-page files. For this file format, LEAD supports CCITT, G3(1D, 2D), CCIT G4, and IBM MMR compression. LEAD does not support ABIC, RL4, and Color Compression used by OS/2.

LEAD supports loading and saving multi-page files in this format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ICA_G3_1D | 1 BPP | 1 BPP | [71] IOCA, compressed using CCITT group 3, 1 dimension.
FILE_ICA_G3_2D | 1 BPP | 1 BPP | [72] IOCA, compressed using CCITT group 3, 2 dimensions.
FILE_ICA_G4 | 1 BPP | 1 BPP | [73] IOCA, compressed using CCITT group 4.
FILE_ICA_IBM_MMR | 1 BPP | 1 BPP | [117] IOCA, compressed using IBM MMR, with the MO:DCA wrapper.
FILE_ICA_UNCOMPRESSED | 1 BPP | 1 BPP | [253] IOCA, uncompressed, with the MO:DCA wrapper.
FILE_RAWICA_G3_1D | 1 BPP | 1 BPP | [77] IOCA, compressed using CCITT group 3, 1 dimension, without the MO:DCA wrapper.
FILE_RAWICA_G3_2D | 1 BPP | 1 BPP | [78] IOCA, compressed using CCITT group 3, 2 dimensions, without the MO:DCA wrapper.
FILE_RAWICA_G4 | 1 BPP | 1 BPP | [79] IOCA, compressed using CCITT group 4, without the MO:DCA wrapper.
FILE_RAWICA_IBM_MMR | 1 BPP | 1 BPP | [118] IOCA, compressed using IBM MMR, without the MO:DCA wrapper.
FILE_RAWICA_UNCOMPRESSED | 1 BPP | 1 BPP | [254] IOCA, uncompressed, without the MO:DCA wrapper.

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

Related Formats: AFP - AFP Format, PTK - PTOCA Format, CAL - CALS Raster Format, FAX - Raw Fax Format, TIFF - Tagged Image File Format / CCITT.


File Formats: Interchange File Format (IFF)

Interchange File Format (IFF)

IFF (Amiga Interchange) is a general-purpose data storage format (raster), developed by Electronic Arts, Inc. and Commodore-Amiga, Inc. that can associate and store multiple types of data. It is used by ACD FotoCanvas Lite 2.0 and XnView applications.

IFF reads and writes RLE, and non-compressed images. IFF CAT supports multipage files.

The default extension for this format is: IFF.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_IFF_ILBM | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | [111] Interchange File - RLE Compressed.
FILE_IFF_CAT | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | [112] Interchange File - multiple images per file-RLE Compressed.
FILE_IFF_ILBM_UNCOMPRESSED | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | [303] Interchange File - Uncompressed.
FILE_IFF_CAT_UNCOMPRESSED | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 24 BPP | [304] Interchange File - multiple images per file-Uncompressed.

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).


File Formats: IntergraphRLE (ITG)

IntergraphRLE (ITG)

Intergraph is a monochrome bitmap format developed by Intergraph. LEADTOOLS supports the RLE and CIT versions of this file format.

The default extensions used by this format are: ITG and CIT.

This file format does not support stamps or Lossless JPEG compression. For this file format, LEAD supports CCITT G4 and RLE compression.

Currently LEAD writes the ITG and CIT format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_INTERGRAPH_RLE | 1 BPP | 1 BPP | [122] ITG, Intergraph RLE compressed file.
FILE_INTERGRAPH_CCITT_G4 | 1 BPP | 1 BPP | [301] ITG, Intergraph CCITT G4 compressed file.

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


File Formats: JBIG Format (JBG)

JBIG Format (JBG)

JBIG (JBG) is an industry standard lossless compressed file format for bi-tonal (black and white), grayscale and color images. LEAD’s JBIG support is comprehensive and handles the various flavors and bits per pixel as defined by the specification including progressive, where you can store and send multiple representations of images at different resolutions without any extra storage overhead. In order to achieve highest compression ratios available by the JBIG format, LEAD also takes full advantage of all the functional blocks of this robust standard including the Adaptive Arithmetic Encoder, the Adaptive Template Block, the Typical Prediction Block, the Resolution Reduction Block, and the Deterministic Prediction Block. Saving images in a JBIG format results in smaller image files sizes when compared to other industry standard compressed formats such as CCITT G3 or G4.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_JBIG | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | [115] JBIG.
FILE_TIF_JBIG | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | [139] TIFF with JBIG compression.

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


File Formats: JBIG2 Format (JB2)

JBIG2 Format (JB2)

LEADTOOLS reads and writes JBIG2 files.

The JBIG2 file format is a raster file format created by ISO/IEC 14492. This format is supported by Image Power. This format is an industry standard lossless, lossy and lossy to lossless compressed file format for bi-tonal (black and white) images. LEAD’s JBIG2 support handles the various flavor of generic region encoding/decoding procedure based on sequential coding of the image pixels using arithmetic coding (lossless). The generic region encoding/decoding procedure encodes/decodes a bitmap, treating it simply as an array of binary pixels. In order to achieve highest compression ratios available by the generic region encoding procedure of JBIG2 format, LEAD also takes full advantage of all the functional blocks of this robust standard including the Adaptive Arithmetic Encoder, the Adaptive Template Pixels, and the Typical Prediction Block. Saving images in a JBIG2 format results in smaller image files sizes when compared to other industry standard compressed formats such as JBIG, CCITT G3 or G4. JBIG2 can compress bi-tonal images 2 - 5 times more than the same image compressed with the CCITT G4 compression.

The default extension used by this format is: JB2.

This file format does not support progressive loads and saves, stamps, or Lossless JPEG compression.

Support for this file format can be unlocked using the following support constant: L_KEY_JBIG2.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_JBIG2 | 1 BPP | 1 BPP | [183] JBIG2.

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

Related Formats: JBG - JBIG Format.


File Formats: JPEG and LEAD Compressed (JPG, J2K, JP2, CMP, and CMW)

JPEG and LEAD Compressed (JPG, J2K, JP2, CMP, and CMW)

LEADTOOLS reads and writes the following LEAD and JPEG compressed formats:

LEAD. This is the LEAD CMP compressed format for grayscale and color images. This format results in smaller files and better image quality than industry-standard formats. In addition, LEAD also supports CMW files, which use Wavelet CMP compression in 8, 12, and 16-bit grayscale and 24-bit color.

Progressive LEAD. This is a LEAD format that is useful for transmitting images, because the first part of the file contains the full dimensions of the image. Therefore, in a paint-while-load routine, you can display the whole image, then progressively clarify it as the rest of the file loads. In this format you can read and write 8 or 24 bits per pixel, where 8 is for grayscale and 24 is for color.

Lossy JFIF. This is the JPEG File Interchange Format. LEADTOOLS supports YUV 4:4:4, 4:2:2, and 4:1:1 color spacing, and YUV 4:0:0 for grayscale.

Lossless JFIF. This is the JPEG File Interchange Format. LEADTOOLS supports 8, 12, and 16-bit grayscale and 24-bit color spacing. Please note that not all applications support Lossless JPEG. Before saving a file using Lossless JPEG, make sure your reader supports it.

Both JPEG 4:4:4 and Lossless JPEG will be recognized when getting file information.

12 and 16-bit grayscale images are only supported in the Document/Medical toolkits.

Progressive JPEG. This is a JFIF format that is useful for transmitting images, because the first part of the file contains the full dimensions of the image. Therefore, in a paint-while-load routine, you can display the whole image, then progressively clarify it as the rest of the file loads. LEADTOOLS supports YUV 4:4:4, 4:2:2, and 4:1:1 color spacing, and YUV 4:0:0 for grayscale.

Lossy JTIF. This is the JPEG Tagged Interchange Format. LEADTOOLS supports YUV 4:4:4, 4:2:2, and 4:1:1 color spacing, and YUV 4:0:0 for grayscale.

Lossless JTIF. This is the JPEG Tagged Interchange Format. LEADTOOLS supports 8, 12, and 16-bit grayscale and 24-bit color spacing. Please note that not all applications support Lossless JPEG. Before saving a file using Lossless JPEG, make sure your reader supports it.

Both TIFF JPEG 4:4:4 and Lossless JPEG will be recognized when getting file information.

12 and 16-bit grayscale images are only supported in the Document/Medical toolkits.

J2K – Lossy or Lossless. This is a JPEG 2000 Format. LEADTOOLS can read 8, 12, and 16-bit grayscale and 24 and 48--bit color images. LEADTOOLS can save 8 - 16-bit grayscale and 24, 27, 30, 33, 36, 39, 42, 45 and 48--bit color images. The J2K format contains only a stream of image data. Support for this format is only available in the LEADTOOLS JPEG 2000 Plug in. (12 and 16-bit grayscale support is only in Document/Medical toolkits)

JP2 – Lossy or Lossless. This is a JPEG 2000 Format. LEADTOOLS can read 8, 12, and 16-bit grayscale and 24 and 48--bit color images. LEADTOOLS can save 8 - 16-bit grayscale and 24, 27, 30, 33, 36, 39, 42, 45 and 48--bit color images. The JP2 format contains a stream of image data, plus extra data about the organization and contents of the file. Support for this format is only available in the LEADTOOLS JPEG 2000 Plug in.

TIF J2K – Lossy or Lossless. This is a Tagged Image File with JPEG 2000 Compression. This file format contains only a stream of image data. LEADTOOLS supports 8, 12, and 16-bit grayscale and 24-bit color spacing. Support for this format is only available in the LEADTOOLS JPEG 2000 Plug in. (12 and 16-bit grayscale support is only in Document/Medical toolkits)

For general information, refer to Compression Using LEAD and JPEG Formats. JPEG and LEAD files can contain many comment fields of various types. You can use the ReadComment method to read comments in an existing file. Before writing a file, you can use the Comment property to create an array of comments to be saved in the file.

Please note that the LTCLR DLL is required for loading JPEG CMYK images and for loading and saving JPEG LAB images.

For more information about the LEADTOOLS JPEG 2000 Plug in, refer to Implementing JPEG 2000 Plug in Features.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CMP | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [5] LEAD CMP compressed format.
FILE_JPEG | 8, 12, 16 BPP (Grayscale) 24 BPP | 8, 12, 16 BPP (Grayscale) 24 BPP | [10] JPEG File Interchange Format.
FILE_JPEG_411 | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [21] JPEG File Interchange Format, 4:1:1.
FILE_JPEG_422 | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [21] JPEG File Interchange Format, 4:2:2.
FILE_JPEG_LAB | 24 BPP | 24 BPP | [171] JPEG File Interchange Format, CieLAB 4:4:4.
FILE_JPEG_LAB_411 | 24 BPP | 24 BPP | [172] JPEG File Interchange Format, CieLAB 4:1:1.
FILE_JPEG_LAB_422 | 24 BPP | 24 BPP | [173] JPEG File Interchange Format, CieLAB 4:2:2.
FILE_JPEG_RGB | 24 BPP | 24 BPP | [182] JPEG File Interchange Format, RGB 4:4:4.
FILE_JP2 | 8, 16 BPP (Grayscale) 24, 27, 30, 33, 36, 39, 42, 45, 48 BPP | 8, 16 BPP (Grayscale) 24, 27, 30, 33, 36, 39, 42, 45, 48 BPP | [163] JPEG 2000 File.
FILE_J2K | 8, 16 BPP (Grayscale) 24, 27, 30, 33, 36, 39, 42, 45, 48 BPP | 8, 16 BPP (Grayscale) 24, 27, 30, 33, 36, 39, 42, 45, 48 BPP | [164] JPEG 2000 Stream.
FILE_CMW | 8, 12, 16 BPP (Grayscale) 24 BPP | 8, 12, 16 BPP (Grayscale) 24 BPP | [165] LEAD Wavelet CMP compressed format.

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

Related Formats: EXIF - Exif Formats, FPX - Kodak Format, TIFF - Tagged Image File Format.


File Formats: Kodak Digital Camera Format (KDC)

Kodak Digital Camera Format (KDC)

The Kodak Digital Camera format files are raster files created by Kodak digital cameras. This format was developed by Kodak and is supported by PaintShop Pro and ACDSee. LEADTOOLS can read and view, using the Kodak SDK, the full image of KDC files of type 40, 50 and 120, which are generated by the Kodak DC40, DC50 and DC120 digital cameras. LEADTOOLS can load all versions of the KDC 40, KDC 50 and KDC 120 files. LEADTOOLS does not save KDC files.

The default extension used by this format is: KDC.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_KDC_120 | 24 BPP | None | [263] KDC DC120.
FILE_KDC_40 | 24 BPP | None | [264] KDC DC40.
FILE_KDC_50 | 24 BPP | None | [265] KDC DC50.

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

Related Formats: CRW - Canon RAW Format, DCR - Kodak Professional Digital Camera Format, DCS - Kodak Professional Digital Camera System Format, EXIF - Exif Formats, FPX - Kodak Format, PCD - Kodak Format.


File Formats: Kodak Formats (PCD and FPX)

Kodak Formats (PCD and FPX)

LEADTOOLS supports the following Kodak formats:

PhotoCD (PCD). This is a common high-resolution format for images on CD-ROM. An image file can contain one or more physical resolutions, with fixed dimensions. You can choose which resolution to load, and thus control the size of the resulting bitmap.

You cannot write PhotoCD files. They are read-only.

FlashPix (FPX). The FlashPix file format was developed through the combined efforts of Eastman Kodak Company, Microsoft Corporation, Hewlett-Packard Company, and Live Picture Inc. It combines the best features of existing formats with object orientation to make the use of digital color images easier.

The format of a FlashPix file is based on compound object storage, which allows storage of various kinds of data. A FlashPix file may consist of several "pages" where each "page" has storage for a source image, non-image data in the form of comments, transform data, and a stamp or thumbnail. Each image is stored as an entire multi-resolution hierarchy where each resolution in the hierarchy differs from the next highest resolution by a factor of 2 in the x dimension and in the y dimension. Non-image data are treated as comments in FlashPix file format. Comments are used to store information pertaining to the image, not actual pixel data. This information may include image title, image subject, camera manufacturer, scan software version number, and so forth. In addition to the image itself, FlashPix files store transform information. This data indicates transformations which may be performed on the source image. By storing the transforms, the source image may be stored in its original state and transformed, using the stored transforms, at your discretion. A stamp, or thumbnail, provides a small bitmap representation of a FlashPix image.

File constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_PCD | 8, 24 BPP | None | [57] Kodak PhotoCD.
FILE_FPX | 8, 24 BPP | 8, 24 BPP | [80] FlashPix, with no compression.
FILE_FPX_SINGLE_COLOR | 8, 24 BPP | 8, 24 BPP | [81] FlashPix, compressed with the single color method.
FILE_FPX_JPEG | 8, 24 BPP | 8, 24 BPP | [82] FlashPix, compressed with JPEG, using the default Q factor.
FILE_FPX_JPEG_QFACTOR | 8, 24 BPP | 8, 24 BPP | [83] FlashPix, compressed with JPEG, using a specified Q factor.

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

Related Formats: CRW - Canon RAW Format, DCR - Kodak Professional Digital Camera Format, DCS - Kodak Professional Digital Camera System Format, EXIF - Exif Formats, KDC - Kodak Digital Camera Format.


File Formats: Kodak Professional Digital Camera System Format (DCS)

Kodak Professional Digital Camera System Format (DCS)

The Kodak Professional Digital Camera format files are raster files created by Kodak digital cameras. This format was developed by Kodak. LEADTOOLS can read and view, using the Kodak SDK, the full image of DCR files generated by the following digital cameras:

SCSI:

  • NC2000 EOS DC53

  • DCS 410 DCS 420

  • EOS DCS5 DCS 460

  • DCS 465 EOS DCS1

IEEE 1394:

  • DCS 520 EOS D2000

  • DCS 315 DCS 330

  • DCS 560 EOS D6000

  • DCS 620 DCS 620x

  • DCS 660 DCS 660M

LEADTOOLS supports the SDK V 1.8.2. LEADTOOLS does not save DCS files.

The default extension used by this format is: DCS, TIF, TIFF.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DCS | 16 (Grayscale), 24 BPP | None | [266] Kodak Professional Digital Camera System Format

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

Related Formats: CRW - Canon RAW Format, DCR - Kodak Professional Digital Camera Format, EXIF - Exif Formats, FPX - Kodak Format, KDC - Kodak Digital Camera Format, PCD - Kodak Format.


File Formats: Kodak Professional Digital Camera Format (DCR)

Kodak Professional Digital Camera Format (DCR)

The Kodak Professional Digital Camera format files are raster files created by Kodak digital cameras. This format was developed by Kodak. LEADTOOLS can read and view, using the Kodak SDK, the full image of DCR files generated by the Kodak DCS 720x, DCS760, DCS 760M, DCS Pro back, DCS Pro Back Plus and DCS Pro Back 645 (M, C, and H models) digital cameras. LEADTOOLS supports the Pro SLR SDK V 2.0.0.8 and ProBack SDK V 2.0.0.8. LEADTOOLS does not save DCR files.

The default extension used by this format is: DCR.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DCR | 48 BPP | None | [292] Kodak Professional Digital Camera Format

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

Related Formats: CRW - Canon RAW Format, DCS - Kodak Professional Digital Camera System Format, EXIF - Exif Formats, FPX - Kodak Format, KDC - Kodak Digital Camera Format, PCD - Kodak Format.


File Formats: LEAD 1-Bit Format (CMP)

LEAD 1-Bit Format (CMP)

LEAD 1BIT is a proprietary 1-bit LEAD compressed format that has better compression and performance than CCITT G4, but not as good as the newer LEAD LMC. Type B provides better compression ratios than Type A.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_LEAD1BITA | 1 BPP | 1 BPP | [31] LEAD Proprietary 1-bit Compression Format, type A.
FILE_LEAD1BIT | 1 BPP | 1 BPP | [26] LEAD Proprietary 1-bit Compression Format, type B.

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

Related Formats: FAX - Raw Fax Format, LMC - LEAD 1-Bit Format, TIFF - Tagged Image File Format / CCITT.


File Formats: LEADTOOLS Mixed Raster Content (LEAD MRC)

LEADTOOLS Mixed Raster Content (MRC)

The Mixed Raster Content format was defined for use of color and grayscale fax. LEADTOOLS offers the LEADTOOLS MRC (Mixed Raster Content) format. The LEADTOOLS Mixed Raster Content enables most different coding methods and a lot of resolutions (such as one bit, two bit, grayscale, and pictures) to be used within a single page by defining a 3-layer image model for structuring and combining the scanned image data.

The image is segmented and each segment assigned a type based on the number of colors used in that segment. Segments can be combined and compressed using different compression schemes to create a file that balances quality with compression.

The default extension used by this format is: MRC.

LEADTOOLS supports Load and save for this format.

Keys that must be unlocked to enable this format support:

L_SUPPORT_DOCUMENT

Multi-page is supported through TIFF format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_LEAD_MRC | 24 BPP | N/A (see note below) | [314] LEAD Mixed Raster Content.

NOTE: MRC is made up of different segments, which can be of various BitsPerPixel. When you request file information on an MRC file, it will be reported as 24-bit. When you save MRC files, various segments will be saved with different BitsPerPixel, based on the content.

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

Related Formats: MRC Format, TIFF - Tagged Image File Format.


File Formats: LEADTOOLS Vector Dump Format (VEC)

LEADTOOLS Vector Dump Format (VEC)

This is an internal vector format, used by the LEADTOOLS® Vector toolkit. The main advantage of using this format is the speed of writing and the capability of maintaining all the details of the vector data. It can be used to save the status of the vector toolkit, which can provide undo and redo capabilities.

Two versions of this format exist, version 12 and version 13. LEADTOOLS will maintain compatibility between different versions.

This format supports layers, grouping of objects and embedded raster objects.

The default extension used by this format is: VEC.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_VECTOR_DUMP | Yes | Yes | [144] LEADTOOLS Vector Dump format.

When VEC 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
Chord | Supported | Supported
Circle | Supported | Supported
Clone | Supported | Supported
Ellipse | Supported | Supported
Elliptical Arc | Supported | Supported
HPolyBezier | Supported | Supported
Lines | Supported | Supported
Pie | Supported | Supported
PolyDraw | Supported | Supported
Polygons | Supported | Supported
Polyline | Supported | Supported
Raster | Supported | Supported
Rectangle | Supported | Supported
Spline | Supported | Supported
Text | Supported | Supported
Vertex | Supported | Supported

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

This format also requires LVKRN14N.DLL.

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, 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: Microsoft Windows Clipboard (CLP)

Microsoft Windows Clipboard (CLP)

CLP stands for Microsoft Windows Clipboard. This file format is used to store the contents of the clipboard to disk. The clipboard is an area of memory shared by the Windows operating system, and it is a simple mechanism for exchanging data between applications.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CLP | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [114] Microsoft Windows Clipboard Uncompressed.
FILE_CLP_RLE | 4, 8 BPP | 8 BPP | [291] Microsoft Windows Clipboard RLE Compressed.

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

Related Formats: ANI - Windows Animated Cursor, CUR - Windows Cursors, ICO - Windows Icons.


File Formats: Mixed Raster Content Format (MRC)

Mixed Raster Content Format (MRC)

The Mixed Raster Content format was defined for use of color and grayscale fax as part of the RFC-2301, File Format for Internet Fax. The Mixed Raster Content mode (T.44) enables different coding methods and resolutions to be used within a single page by defining a 3-layer image model for structuring and combining the scanned image data. The image is segmented and each segment assigned a type based on the number of colors used in that segment. Segments can be combined and compressed using different compression schemes to create a file that balances quality with compression.

The default extension used by this format is: MRC.

LEADTOOLS supports Load and save for this format.

Keys that must be unlocked to enable this format support:

L_SUPPORT_DOCUMENT

Multi-page is supported through TIFF format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MRC | 24 BPP | N/A (see note below) | [168] Mixed Raster Content.

NOTE: MRC is made up of different segments, which can be of various BitsPerPixel. When you request file information on an MRC file, it will be reported as 24-bit. When you save MRC files, various segments will be saved with different BitsPerPixel, based on the content.

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

Related Formats: LEAD MRC Format, TIFF - Tagged Image File Format.


File Formats: MPEG Video Format (MPG)

MPEG Video Format (MPG)

MPEG Video Format (MPG) is a file format used for multimedia files. These files store both audio and video data.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MPEG1 | 24 BPP | None | [243] MPEG-1 (video) file.
FILE_MPEG2 | 24 BPP | None | [246] MPEG-2 (video) file.

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

Related Formats: AVI - Windows AVI Format.


File Formats: MrSid Format (SID)

MrSid Format (SID)

The MrSid file format is a raster format developed by LizardTech and supported by the MrSid Viewer from LizardTech. LEADTOOLS can read and view the full image using the MrSID SDK V 3.1.4. Various levels of the MrSid file can be loaded using the GetLoadResolution, ReadLoadResolutions and SetLoadResolution methods.

The default extension used by this format is: SID.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SID | 24 BPP | 24 BPP | [306] MrSid Format.

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


File Formats: Miscellaneous 1-Bit Formats (MAC, IMG, and MSP)

Miscellaneous 1-Bit Formats (MAC, IMG, and MSP)

LEADTOOLS supports reading and writing of the following 1-bit formats:

MacPaint (MAC). These Macintosh Paint files are commonly used for monochrome clip art.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MAC | 1 BPP | 1 BPP | [51] MacPaint - Macintosh Paint.

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

GEM Image (IMG). These files are native to the Graphical Environment Manager developed by Digital Research.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_IMG | 1 BPP | 1 BPP | [52] GEM Image.

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

Microsoft Paint (MSP). These files from early versions of Windows are used for black-and-white drawings and clip art.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MSP | 1 BPP | 1 BPP | [53] Microsoft Paint.

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


File Formats: Paint Shop Pro Formats (PSP)

Paint Shop Pro Format (PSP)

PSP is a raster format created by JASC Software. It supports uncompressed, RLE compressed, LZ77 compressed, and JPEG compressed files (including Lossless JPEG). LEADTOOLS supports all these compression types. LEADTOOLS supports versions 5, 6 and 7 of this format. Version 7 supports the Vector Shapes layer, which LEADTOOLS views as raster.

For PSP files, you can read the following bits per pixel: 1 (gray), 4 (gray), 8 (gray or color), 24 (color). For all compression type (uncompressed, RLE compressed, LZ77 compressed, and JPEG compressed files (including Lossless JPEG).

For PSP files, you can write the following bits per pixel: 1 (gray), 4 (gray), 8 (gray or color), 24 (color). With this compression type only (uncompressed, RLE compressed, and JPEG compressed files (including Lossless JPEG).

The default extension used by this format is: PSP.

This file format does support layers. With LEADTOOLS, layers may be loaded individually using the LoadLayer method, or all at once, using the Load method (ILEADRasterIO).

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PSP | 1, 4, 8 BPP (Grayscale) 8, 24 BPP (Color) | 1, 4, 8 BPP (Grayscale) 8, 24 BPP (Color) | [267] PaintShop Pro Format.
FILE_PSP_RLE | 1, 4, 8 BPP (Grayscale) 8, 24 BPP (Color) | 1, 4, 8 BPP (Grayscale) 8, 24 BPP (Color) | [268] PaintShop Pro Format - RLE Compressed.

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


File Formats: PCX Formats (PCX and DCX)

PCX Formats (PCX and DCX)

LEADTOOLS reads and writes the following PCX formats:

PCX. This is a file format created by ZSoft. This format compresses its image data with the RLE type compression.

DCX. This is a multipage PCX format that enables a file to contain more than one image. It is handled the same as a regular PCX file, except for the multipage feature.

For PCX and DCX files, you can read and write the following bits per pixel: 1, 4, 8, 24.

LEAD supports loading and saving multi-page files in this format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PCX | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [1] ZSoft PCX.

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


File Formats: PhotoShop 3.0 Format (PSD)

PhotoShop 3.0 Format (PSD)

Photoshop 3.0 (PSD) is the format produced by the Adobe Photoshop graphics editor.

LEAD supports RLE Compression for this file format.

For PSD files, you can read the following modes with the following bits per pixel:

Mode | Bits Per Channel | LEAD Bits Per Pixel
Bitmap | 0 | 1
Grayscale | 8 | 8
Grayscale | 16 | 16
CMYK | 8 | 24
CMYK | 16 | 24
Indexed Color | 8 | 8
RGB with 3 & 4 Channels | 8 | 24/32
RGB | 16 | 64
Duotone | 8 | 8 Grayscale
LAB | 8 | 24
LAB | 16 | 24

You can also read and write layers to this file with the following bits per pixel: 8 (GrayScale), 24, and 32.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PSD | 1, 8, 16, 24 BPP | 1, 8, 24 BPP | [76] Adobe Photoshop 3.0.

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


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.

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

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: Portable Bitmap Utilities (PBM)

Portable Bitmap Utilities (PBM)

The Portable Bitmap Utilities consists of Portable Greymap Utilities (PGM), Portable Pixmap Utilities (PPM), and Portable Anymap Utilities (PNM). Their source is the UNIX environment.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PBM_BINARY | 1 BPP | 1 BPP | [103] Portable Bitmap - Binary File.
FILE_PBM_ASCII | 1 BPP | 1 BPP | [102] Portable Bitmap - ASCII File.
FILE_PGM_BINARY | 8 BPP (Grayscale) | 8 BPP (Grayscale) | [105] Portable Greymap - Binary File.
FILE_PGM_ASCII | 8 BPP (Grayscale) | 8 BPP (Grayscale) | [104] Portable Greymap - ASCII File.
FILE_PPM_BINARY | 24 BPP | 24 BPP | [107] Portable Pixelmap - Binary File.
FILE_PPM_ASCII | 24 BPP | 24 BPP | [106] Portable Pixelmap - ASCII File.

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

Related Formats: BMP - Windows Bitmap Formats.


File Formats: Portable Document Format (PDF)

Portable Document Format (PDF)

Portable Document Format (PDF). PDF was developed by the Adobe Corporation to allow the exchange and viewing of electronic documents easily and reliably, independent of the environment in which they were created. This format lets you compress large documents to a size small enough to download very quickly. It is also becoming a powerful format for reproducing documents over the web.

LEAD supports versions 1.2, 1.3 and 1.4 of this format. LEAD also supports loading and saving multi-page files in this format.

The PDF Filter loads AI (Adobe Illustrator) files from version 7 to version 10, which only have PDF data.

This filter can also save large images by setting the PDFSaveLowMemory property (ILEADRasterIO). It can also load files that are stored in memory (memory files). It can both load and save PDF files that are JPEG, LZW, CCITT G1 1D, CCITT G3 2D, or CCITT G4 compressed, or are uncompressed. In addition, this filter supports JBIG2 compressed PDF files. (Note that not all flavors of JBIG2 decompression are supported.)

This filter can load files that are stored in memory (memory files). In addition, it supports an option that disables the cropping of files, by setting the PDFDisableCropping property (ILEADRasterIO), and an option that disables the use of CIE colors, by setting the PDFDisableCieColors property (ILEADRasterIO). Disabling the use of CIE colors will result in faster loading of PDF files.

Support for this format is available in the Barcode PDF modules and the PDF Plug in. For more information on the available products, refer to Topic Selection. Support for this file format can be unlocked using one of the following support constants: L_KEY_PDF, L_KEY_PDF_SAVE, L_KEY_OCR_PDF_OUTPUT, L_KEY_BARCODES_PDF_READ, or L_KEY_BARCODES_PDF_WRITE.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_RAS_PDF | Yes* | 1, 2, 4, 8, 24 BPP | [146] Raster PDF uncompressed.
FILE_RAS_PDF_G3_1D | N/A* | 1 BPP | [147] Raster PDF with G3 1D Compression.
FILE_RAS_PDF_G3_2D | N/A* | 1 BPP | [148] Raster PDF with G3 2D Compression.
FILE_RAS_PDF_G4 | N/A* | 1 BPP | [149] Raster PDF with G4 Compression.
FILE_RAS_PDF_LZW | N/A* | 1, 2, 4, 8, 24 BPP | [179] Raster PDF with LZW Compression.
FILE_RAS_PDF_JPEG | N/A* | 8 BPP (Grayscale) 24 BPP | [150] Raster PDF with JPEG 4:4:4 Compression.
FILE_RAS_PDF_JPEG_422 | N/A* | 24 BPP | [151] Raster PDF with JPEG 4:2:2 Compression.
FILE_RAS_PDF_JPEG_411 | N/A* | 24 BPP | [152] Raster PDF with JPEG 4:1:1 Compression.

Required DLL: LFPDF. The files required for reading PDF and writing PDF are different . For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

*NOTE: When you request file information on a PDF file, FILE_RAS_PDF will always be returned for the file format, regardless of the composition of the PDF file. LEADTOOLS can read PDF documents that are made up of both text and images. The text and images are rasterized into one raster image for each page of the document. LEADTOOLS can write PDF documents that are made up of raster images only.

Related Formats: PCL - Printer Command Language Format, PLT - PLT / HPGL Format, PS - PostScript Document Format, RTF - Rich Text Format.


File Formats: Portable Network Graphics Format (PNG)

Portable Network Graphics Format (PNG)

PNG (Portable Network Graphics) is a replacement for the GIF format. It is a full-featured (non-LZW) compressed format intended for widespread use without legal restraints.

LEADTOOLS supports reading (but not writing) interlaced PNG files. To implement the paint-while-load feature, set the ProgressivePasses property (ILEADRasterIO) to paint the image in more than one pass.

You can read the following bits per pixel: 1, 4, 8, 16, 24, 32.

You can write the following bits per pixel: 1, 4, 8, 24, 32.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PNG | 1, 4, 8, 16, 24, 32 BPP | 1, 4, 8, 24, 32 BPP | [75] Portable Network Graphics (PNG).

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

Related Formats: GIF - Compuserve GIF Format, JPG - JPEG Compressed.


File Formats: PostSript Document (PS)

PostScript Document Format (PS)

PostScript (PostScript). PostScript is a simple interpretive page description language, also known as PDL, that is used to describe the appearance of text, graphical shapes and sampled images on printed or displayed pages. The page description and graphical capabilities of this language include arbitrary shapes, painting operators, fully integrated text and graphics, and sampled images derived from natural sources. Most advanced laser printers use PostScript in order to render electronic information on a printed page.

This filter can load files that are stored in memory (memory files). In addition, it supports an option that disables the cropping of files, by setting the PDFDisableCropping property (ILEADRasterIO), and an option that disables the use of CIE colors, by setting the PDFDisableCieColors property (ILEADRasterIO). Disabling the use of CIE colors will result in faster loading of PS files.

Support for this format is available in the Barcode PDF modules and the PDF Plug in. For more information on the available products, refer to Topic Selection. Support for this file format can be unlocked using one of the following support constants: L_KEY_PDF, L_KEY_PDF_SAVE, L_KEY_OCR_PDF_OUTPUT, L_KEY_BARCODES_PDF_READ, or L_KEY_BARCODES_PDF_WRITE.

For a PostScript image, you can read the following bits per pixel, using various DPI options: 1, 2, 4, 8, 24.

For a PS file, you can read the following bits per pixel, using various DPI options: 1, 2, 4, 8, 24.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_POSTSCRIPT | 1, 2, 4, 8, 24 BPP | None | [222] PostScript Document.

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

Postscript files that are included in PJL files can also be loaded. This requires the PCL filter.

You can write only an 8-bit PostScript raster image, using the LEAD EPS filter.

Related Formats: PCL - Printer Command Language Format, PDF - Portable Document Format, PLT - PLT / HPGL Format, PS - PostScript Document Format, RTF - Rich Text 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: PTOCA (PTOCA)

PTOCA Format (PTOCA)

The Presentation Text Object Content Architecture (PTOCA) is the data object used in document processing environments for representing text, which has been prepared for presentation. Each file contains one or more pages of text and is always included as part of a document in a MODCA file. Each page may reference a PTOCA Overlay, which is merged with the text as a background. PTOCA overlays can be merged to recreate the original document and many configurable settings including font properties.

There is no default extension.

This format originated at IBM.

This file format does not support QFactor, progressive loads and saves, stamps or Lossless JPEG compression, but it does support multi-page files.

LEADTOOLS supports callbacks to load specific overlay files from a specific path. LEADTOOLS also supports functions to let you set the DPI for the opened image file. Please refer to the PTK Options functions or callbacks.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_PTOCA | 24 BPP | None | [249] Presentation Text Object Content Architecture format.

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

Related Formats: ICA - Image Object Content Architecture (IOCA/MODCA).


File Formats: Rich Text Format (RTF)

Rich Text Format (RTF)

The Rich Text Format (RTF) specification is a method of encoding formatted text and graphics for easy transfer between applications. Currently, users depend on special translation software to move word-processing documents between different MS-DOS®, Windows, OS/2, Macintosh, and Power Macintosh applications. This raster format was developed by Microsoft and is used by WordPad.

RTF uses the ANSI, PC-8, Macintosh, or IBM PC character set to control the representation and formatting of a document, both on the screen and in print. With the RTF Specification, documents created under different operating systems and with different software applications can be transferred between those operating systems and applications. LEADTOOLS can load versions 1, 2, and 3.

For information on known problems with the RTF filter on Windows 98 machines, refer to Using the RTF Filter in Windows 98.

The default extension used by this format is: RTF.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_RTF_RASTER | 24 BPP | None | [305] Rich Text Format.

When RTF files are rasterized, they are 24 BPP.

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

Related Formats: PCL - Printer Command Language Format, PDF - Portable Document Format, PLT - PLT / HPGL Format, PS - PostScript Document 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: Scitex Continuous Tone Format (SCT)

Scitex Continuous Tone Format (SCT)

The Scitex Continuous Tone file format was developed by Scitex and is used for high-end image processing. The SCT/CT files are used primarily to store CMY and CMYK color space for the image. For saving the SCT file format, LEAD saves it as CMY instead of CMYK. This maintains the image quality, since the conversion from RGB to CMYK will result in some loss of data.

The default extensions used by this format are: SCT and CT.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SCT | 24 BPP | 24 BPP | [250] Scitex Continuous Tone Format.

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


File Formats: Silicon Graphics Image Format (SGI)

Silicon Graphics Image Format (SGI)

The SGI file format was developed at Silicon Graphics, and is used for black and white, gray-scale and color images. LEADTOOLS supports both uncompressed SGI and RLE compressed SGI.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SGI | 8, 24, 32 BPP | 8, 24, 32 BPP | [142] Silicon Graphics Image - uncompressed
FILE_SGI_RLE | 8, 24, 32 BPP | 8, 24, 32 BPP | [143] Silicon Graphics Image - RLE compressed

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


File Formats: SMP (SMP)

SMP Format (SMP)

The SMP file contains a 1-bit raster bitmap. It may be uncompressed, compressed using CCITT Group 3 or compressed using CCITT Group 4. LEADTOOLS supports loading and saving for all these types.

The default extension is .SMP.

This format was created by Xionics and is used in PixEdit for Techsoft.

This file format does not support QFactor, progressive loads and saves, multi-page files, stamps or Lossless JPEG compression.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SMP | 1 BPP | 1 BPP | [256] Xionics format.
FILE_SMP_G3_1D | 1 BPP | 1 BPP | [257] Xionics format, compressed using CCITT Group 3 1D.
FILE_SMP_G3_2D | 1 BPP | 1 BPP | [258] Xionics format, compressed using CCITT Group 3 2D.
FILE_SMP_G4 | 1 BPP | 1 BPP | [259] Xionics format, compressed using CCITT Group 4.

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


File Formats: Structured Fax File Format (SFF)

Structured Fax File Format (SFF)

The Structured Fax File format is a raster 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 is used by COMMON-ISDN-API (CAPI) and is supported by IrfanView and PMView 2000. LEADTOOLS supports Version 1 of this file format.

The default extension used by this format is: SFF.

LEADTOOLS supports the multi-page SFF files.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_SFF | 1 BPP | 1 BPP | [302] Structured Fax File Format.

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


File Formats: SUN Raster Format (RAS)

SUN Raster Format (RAS)

SUN Raster (RAS) is a format native to Sun UNIX platforms.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_RAS | 1, 4, 8, 24, 32 BPP | 1, 4, 8, 24, 32 BPP | [55] Sun Raster, uncompressed.
FILE_RAS_RLE | 1, 4, 8, 24, 32 BPP | 1, 4, 8, 24, 32 BPP | [288] Sun Raster, RLE compressed.

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


File Formats: TIFF (Tagged Image File Format)

TIFF (Tagged Image File Format)

TIFF is a tag-based file format designed to promote universal interchanges of digital image data. Because TIFF files do not have a single way to store image data, there are many versions of TIFF. LEADTOOLS supports the most common TIFF formats. The usual file extension is TIFF for single-image files, and MPT for multipage files (which can contain many images). TIFF files can contain many comment fields of various types. You can use the ReadComment method to read comments in an existing file. Before writing a file, you can use the Comment property to create an array of comments to be saved in the file.

LEADTOOLS also supports the ability to save a vector image as a DXF within a TIFF.

LEAD supports loading and saving multi-page files in this format.

LEADTOOLS can read and write TIFF files that use RGB, CMYK, or YCbCr color space. LEADTOOLS can also read and write files with PackBits compression.

LEADTOOLS can also read and write files with Lossless JPEG compression for 8, 12, and 16-bit grayscale and 24-bit color spacing.

You can read and write 12- bit grayscale. (Document/Medical toolkits only)

You can read and write 16- bit grayscale. (Document/Medical toolkits only)

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_TIF | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | [3] Tagged Image File Format, with no compression and with RGB color space.
FILE_TIF_CMYK | 24, 32 BPP | 24, 32 BPP | [85] Tagged Image File Format, with no compression and with CMYK color space.
FILE_TIF_YCC | 24 BPP | 24 BPP | [93] Tagged Image File Format, with no compression and with YCbCr color space.
FILE_TIF_PACKBITS | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32 BPP | [87] Tagged Image File Format with PackBits Compression and RGB color space.
FILE_TIF_PACKBITS_CMYK | 24, 32 BPP | 24, 32 BPP | [88] Tagged Image File Format with PackBits Compression and CMYK color space.
FILE_TIF_PACKBITS_YCC | 24 BPP | 24 BPP | [95] Tagged Image File Format with PackBits Compression and color YCbCr space.
FILE_TIFLZW | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | [17] Tagged Image File Format with LZW Compression and RGB color space.
FILE_TIFLZW_CMYK | 24, 32 BPP | 24, 32 BPP | [86] Tagged Image File Format with LZW Compression and CMYK color space
FILE_TIFLZW_YCC | 24 BPP | 24 BPP | [94] Tagged Image File Format with LZW Compression and YCbCr color space.
FILE_TIF_JPEG | 8, 12 16 BPP (Grayscale) 24 BPP | 8, 12 16 BPP (Grayscale) 24 BPP | [11] Tagged Image File Format with JPEG compression and YUV 4:4:4 color space Lossless.
FILE_TIF_JPEG_422 | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [24] Tagged Image File Format with JPEG compression and YUV 4:2:2 color space.
FILE_TIF_JPEG_411 | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [22] Tagged Image File Format with JPEG compression and YUV 4:1:1 color space.[
FILE_TIF_CMP | 8 BPP (Grayscale) 24 BPP | 8 BPP (Grayscale) 24 BPP | [138] Tagged Image File Format with CMP Compression.
FILE_TIF_JBIG | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32 BPP | [139] Tagged Image File Format with JBIG Compression.
FILE_TIF_DXF_R12 | 8 BPP | 8 BPP | [176] Tagged Image File Format with a vector image saved as a DXF Release 12.
FILE_TIF_DXF_R13 | 8 BPP | 8 BPP | [140] Tagged Image File Format with a vector image saved as a DXF Release 13.
FILE_TIF_J2K | 8, 12, 16 BPP (Grayscale) 24 BPP | 8, 12, 16 BPP (Grayscale) 24 BPP | [166] Tagged Image File Format with JPEG 2000 Compression. This file format contains only a stream of image data.
FILE_TIF_CMW | 8, 12, 16 BPP (Grayscale) 24 BPP | 8, 12, 16 BPP (Grayscale) 24 BPP | [167] Tagged Image File Format with Wavelet CMP Compression.
FILE_GEOTIFF | 16 BPP (Grayscale) | 16 BPP (Grayscale) | [174] GeoTIFF file format.
FILE_EXIF | 24 BPP | 24 BPP | [96] Exif file containing a TIFF image, with no compression and with RGB color space.
FILE_EXIF_YCC | 24 BPP | 24 BPP | [97] Exif file containing a TIFF image, with no compression and with YCbCr color space.
FILE_EXIF_JPEG_422 | 24 BPP | 24 BPP | [98] Exif file containing a JPEG compressed image.
FILE_EXIF_JPEG_411 | 24 BPP | 24 BPP | [101] Exif 2.0 file containing a JPEG compressed image.
FILE_CCITT | 1 BPP | 1 BPP | [25] Tagged Image File Format, compressed using CCITT.
FILE_CCITT_GROUP3_1DIM | 1 BPP | 1 BPP | [27] Tagged Image File Format, compressed using CCITT, group 3, 1 dimension.
FILE_CCITT_GROUP3_2DIM | 1 BPP | 1 BPP | [28] Tagged Image File Format, compressed using CCITT, group 3, 2 dimensions.
FILE_CCITT_GROUP4 | 1 BPP | 1 BPP | [29] Tagged Image File Format, compressed using CCITT, group 4.
FILE_TIF_UNKNOWN | NA | NA | [141] Tagged Image File Format, with unknown compression.
FILE_TIF_ABC | 1 BPP | 1 BPP | [180] Tagged Image File Format with ABC compression.
FILE_TIF_MRC | 1 BPP | 1 BPP | [177] Tagged Image File Format with MRC compression.
FILE_TIF_LEAD_MRC | 1 BPP | 1 BPP | [315] Tagged Image File Format with LEAD MRC compression.

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

For loading or saving CMYK files or LAB color space files, you will also need the LTCLR DLL.

Related Formats: CMP - LEAD Compressed, , CMP - LEAD 1-Bit Format, EXIF - Exif Formats, JPG - JPEG Compressed, JP2 - JPEG 2000 Compressed, TIFX - Xerox Internet Fax File Format.


File Formats: TIFF CCITT and Other FAX Formats

TIFF CCITT and Other FAX Formats

LEADTOOLS supports reading and writing of the following 1-bit formats that are commonly used in FAX transmissions:

TIFF

TIFF CCITT. These are compressed TIFF files that are commonly used for FAX transmission and document imaging.

TIFF CCITT Group 3. These are TIFF CCITT files in a format that is more advanced and more compressed than TIFF CCITT. LEADTOOLS supports both 1-dimension and 2-dimension variations of this format.

TIFF CCITT Group 4. These are TIFF CCITT files in a format that is more advanced and more compressed than TIFF CCITT Group 3.

For more information refer to Tagged Image File Format (TIFF).

CALS

CALS Raster (Type 1, 2, 3, and 4). These are CCITT Group 4 CALS raster files. CALS is a United States government standard. CALS3 are multipage files.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CALS | 1 BPP | 1 BPP | [50] CALS Raster file.
FILE_CALS2 | 1 BPP | 1 BPP | [130] CALS CCITT G4 compressed.
FILE_CALS3 | 1 BPP | 1 BPP | [131] CALS Fax Group 4 compressed.
FILE_CALS4 | 1 BPP | 1 BPP | [129] CALS CCITT G4 Tiled.

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

IOCA

IOCA (ICA). This is the Image Object Content Architecture developed by IBM. LEADTOOLS supports these files in an MO:DCA wrapper with embedded 1-bit CCITT Group 3 or Group 4 images. LEADTOOLS also supports IOCA files without an MO:DCA wrapper.

For more information refer to Image Object Content Architecture Format (IOCA/MODCA).

WinFax

WinFax Group 3. This is a FAX format created by Delrina for Group 3 support.

WinFax Group 4. This is a FAX format created by Delrina for Group 4 support.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_WFX_G3_1D | 1 BPP | 1 BPP | [69] Winfax, compressed using CCITT group 3, 1 dimension
FILE_WFX_G4 | 1 BPP | 1 BPP | [70] Winfax, compressed using CCITT group 4.

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

Raw FAX

FAX Group 3. This is a raw FAX format (without a header) for Group 3 support. LEADTOOLS supports both 1-dimension and 2-dimension variations of this format.

FAX Group 4. This is a raw FAX format (without a header) for Group 4 support.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_FAX_G3_1D | 1 BPP | 1 BPP | [66] Raw FAX, compressed using CCITT group 3, 1 dimension.
FILE_FAX_G3_1D_NOEOL | 1 BPP | 1 BPP | [162] Raw FAX, compressed using CCITT group 3, 1 dimension.with no EOL.
FILE_FAX_G3_2D | 1 BPP | 1 BPP | [67] Raw FAX, compressed using CCITT group 3, 2 dimensions.
FILE_FAX_G4 | 1 BPP | 1 BPP | [68] Raw FAX, compressed using CCITT group 4.

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

Related Formats: TIFF - Tagged Image File Format.

Microsoft Fax

AWD. This is a Microsoft FAX format.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_AWD | 1 BPP | 1 BPP | [99] Microsoft FAX format.

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

This format does not support LEAD's redirected IO feature, therefore it cannot be used with LoadMemory method (ILEADRasterIO), LoadArray method (ILEADRasterIO), SaveMemory method (ILEADRasterIO), SaveArray method (ILEADRasterIO), or FeedLoad method (ILEADRasterIO).

TIFF-FX

TIFF-FX. These are Internet Fax files developed and used by Xerox. This format supports several types of compression, which allows the user or developer to use the compression that best suits his or her needs. In addition, this file format can be extended as the need arises. The following modes are supported:

Minimal Black and White: This mode uses binary MH compression (T.4).

Extended Black and White: This mode uses binary MH, MR and MMR compression (T.4 and T.6).

Lossless JBIG Black and White: This mode uses JBIG compression (T.85, T.82).

Lossy Color and Grayscale: This mode uses JPEG compression (T.42, T.81).

Lossless Color and Grayscale: This mode uses JBIG compression (T.43, T.82).

The default extensions used by this format is: TIFX, TIFF.

This file format does support multipage files.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_TIFX_JBIG | 1 BPP | 1 BPP | [269] TIFF-FX format. JBIG compressed.
FILE_TIFX_JBIG_T43 | 3 BPP | 3 BPP | [270] TIFF-FX format. JBIG compressed.
FILE_TIFX_JBIG_T43_ITULAB | 8 BPP | 8 BPP | [271] TIFF-FX format. JBIG compressed.
FILE_TIFX_JBIG_T43_GS | 1 BPP | 1 BPP | [272] TIFF-FX format. JBIG compressed.
FILE_TIFX_FAX_G4 | 1 BPP | 1 BPP | [273] TIFF-FX format, compressed using CCITT group 4.
FILE_TIFX_FAX_G3_1D | 1 BPP | 1 BPP | [274] TIFF-FX format, compressed using CCITT group 3, 1 dimension.
FILE_TIFX_FAX_G3_2D | 1 BPP | 1 BPP | [275] TIFF-FX format, compressed using CCITT group 3, 2 dimensions.
FILE_TIFX_JPEG | 8 BPP (Grayscale), 24 BPP | 8 BPP (Grayscale), 24 BPP | [276] TIFF-FX format. JPEG compressed.

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

Related Formats: TIFF - Tagged Image File Format.

LaserView LaserData

LaserView LaserData. The LaserData file format is a legacy Group 4 compressed FAX format.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_LASERDATA | 1 BPP | None | [121] LaserData CCITT G4

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


File Formats: Truevision TARGA Format (TGA)

Truevision TARGA Format (TGA)

Truevision TGA (TARGA) is a file format created by Truevision Inc. LEADTOOLS supports all uncompressed and RLE compressed TGA file formats.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_TGA | 8, 16, 24, 32 BPP | 8, 16, 24, 32 BPP | [4] TARGA, uncompressed.
FILE_TGA_RLE | 8, 16, 24, 32 BPP | 8, 16, 24, 32 BPP | [262] TARGA, RLE compressed.

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


File Formats: TXT (TXT)

ASCII Text format (TXT)

A text file in which each byte represents one character according to the ASCII code. Contrast with a binary file, in which there is no one-to-one mapping between bytes and characters. Files that have been formatted with a word processor must be stored and transmitted as binary files to preserve the formatting. ASCII files are sometimes called plain text files.

LEADTOOLS supports loading only for this format.

This format is available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.

The default extension used by this format is: TXT.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_TXT | 24 BPP | N/A | [316] ASCII Text format.

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

Related Formats: RTF - Rich Text Format


File Formats: Windows Animated Cursor (ANI)

Windows Animated Cursor (ANI)

ANI is an animated cursor (animated mouse pointer). This file format is used for reading and storing Windows Animated Cursors. The LEADTOOLS filter does not support transparency information within these files.

LEAD supports loading and saving multi-page files in this format. Multipage ANI files will have a cursor as each page.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ANI | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [119] Windows Animated Cursor.

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

Related Formats: CUR - Windows Cursors, CLP - Microsoft Windows Clipboard Format, ICO - Windows Icons.


File Formats: Windows AVI Format (AVI)

Windows AVI Format (AVI)

Windows AVI (AVI) is a file format created by Microsoft and used for multimedia files. These files store both audio and video data.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_AVI | 24 BPP | None | [59] Windows AVI (video) file.

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

Related Formats: MPG - MPEG Video 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: Wireless Bitmap Format (WBMP)

Wireless Bitmap Format (WBMP)

The Wireless Bitmap file format is a 1-bit format used to send graphical information to a variety of handsets. It is terminal independent and describes only graphical information.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_WBMP | 1 BPP | 1 BPP | [170] Wireless Bitmap.

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


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.


File Formats: XBitMap (XBM)

XBitMap (XBM)

XBM is a monochrome bitmap format in which data is stored as a C language data array. It is primarily used for the storage of cursor and icon bitmaps, for use in the X graphical user interface.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_XBM | 1 BPP | 1 BPP | [110] XWindows XBitMap.

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

Related Formats: BMP - Windows Bitmap Formats.


File Formats: XPicMap Format (XPM)

XPicMap Format (XPM)

XPM files are used to store X Window PixMap information to disk. They are capable of storing black-and-white, grayscale, and color images. XPM stores image data in the form of ASCII text formatted as a standard C character string array.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_XPM | 8, 16, 24, 32 BPP | 8, 16, 24, 32 BPP | [109] XWindows XPicMap.

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


File Formats: X Window Dump (XWD)

X Window Dump (XWD)

XWD stands for X Window dump. This file format is used to store and restore screen window images. Two versions of this file exist, the X10 window dump and the X11 window dump. These versions differ slightly in the format of the data (i.e. headers and bits per pixel).

The version X10 XWD file cannot have more than 8 BPP image data.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_XWD10 | 1, 4, 8 BPP | 1, 4, 8 BPP | [132] XWindows X Window dump, version 10.
FILE_XWD11 | 1, 4, 8, 16. 24, 32 BPP | 1, 4, 8, 16. 24, 32 BPP | [133] XWindows X Window dump, version 11.

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


Formats of Input Files

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


Formats of Output Files

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


Multipage File Formats

LEADTOOLS supports the following file formats which support multipage files. These formats are:

Animated Cursor | Animated Gif
CALS3 | DCX
DICOM (Read Only) | FlashPix
FLC | GIF
IFF | IOCA/MODCA
PCX | PDF
Tiff(MPT) | ABC

When loading a multipage file, you can load all pages using the Load method (ILEADRasterIO). If you wish to load only one of the pages, set the lPage parameter when calling the Load method (ILEADRasterIO). For more information on loading a multi-page file, refer to Loading a Bitmap from a File.


LEAD Supported JPEG Formats

The following JPEG image file formats are currently supported by the Image Optimizer COM Object:

JPEG File (FILE_JPEG), Bits per pixel: 8 for grayscale, 24 for color.

JPEG 411 File (FILE_JPEG_411), Bits per pixel: 8 for grayscale, 24 for color

JPEG 422 File (FILE_JPEG_422), Bits per pixel: 8 for grayscale, 24 for color.

EXIF JPEG 4:1:1 File (FILE_EXIF_JPEG_411), Bits per pixel: 24 (color only).

EXIF JPEG 4:2:2 File (FILE_EXIF_JPEG_422), Bits per pixel: 24 (color only).


LEAD Supported BMP Formats

The following BMP file formats are the currently supported by the Image Optimizer COM Object:

BMP Without RLE Compression File (FILE_BMP), (Bits per pixel: 1, 4, 8, 16, 24, and 32).

BMP With RLE Compression File (FILE_BMP_RLE), (Bits per pixel: 4, and 8).


LEAD Image Optimizer Supported Formats

The following formats are currently supported by the Image Optimizer COM Object:

JPEG File (FILE_JPEG), Bits per pixel: 8 for grayscale, 24 for color.

JPEG 411 File (FILE_JPEG_411), Bits per pixel: 8 for grayscale, 24 for color.

JPEG 422 File (FILE_JPEG_422), Bits per pixel: 8 for grayscale, 24 for color.

EXIF JPEG 4:1:1 File (FILE_EXIF_JPEG_411), Bits per pixel: 24 (color only).

EXIF JPEG 4:2:2 File (FILE_EXIF_JPEG_422), Bits per pixel: 24 (color only).

GIF File (FILE_GIF), (Bits per pixel: 1, 2, 3, 4, 5, 6, 7, and 8).

PNG File (FILE_PNG), (Bits per pixel: 1, 4, 8, 24, and 32).

BMP Without RLE Compression File (FILE_BMP), (Bits per pixel: 1, 4, 8, 16, 24, and 32).

BMP With RLE Compression File (FILE_BMP_RLE), (Bits per pixel: 4, and 8).


A Special Note About UNICODE Support

LEADTOOLS now provides UNICODE support. However, in order to utilize the examples and tutorials in this help file with UNICODE, you must make a few substitutions for class names, IDs, event names, etc. This is true for VB, MFC, Delphi and C++ Builder. Before attempting to compile the samples or tutorials in this help file for UNICODE, replace the class name, ID name, event name, etc. in the first column below, with the corresponding name in the second column. As you can see, this just involves adding "_U" to the end of the class name, ID name, event name, etc.

General Notes For VC++ Programmers:

1.

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
ILEADRasterXXXX | ILEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

For example:

ILEADRasterIO_U *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO_U, NULL, CLSCTX_ALL, IID_ILEADRasterIO_U, (void**)&pRasterIO);

2.

For importing (.DLL) or (.OCX) files in your project:

Replace: | With:
LTRXXXN.OCX | LTRXXXNU.OCX
LTRXXXN.DLL | LTRXXXNU.DLL

For example:

#import "c:\\winnt\\system32\\ltrvr14nu.dll" no_namespace, named_guids

#import "c:\\winnt\\system32\\ltrvw14nu.ocx" no_namespace, named_guids

General Notes For VB Programmers:

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
LEADRasterXXXX | LEADRasterXXXX_U
LEADRasterXXXX_EventName | LEADRasterXXXX_U_EventName
LEADRasterXXXX.LEADRasterXXXX | LEADRasterXXXX_U.LEADRasterXXXX_U

When adding a Reference or Component to a Visual Basic project, be sure that the desired Reference or Component name ends with (_U).

For example:

To add the Unicode version of LEAD RasterView Control to your project, you have to select LEAD Raster View_U Control (14.5).

General Notes For Delphi and C++ Builder Programmers:

Replace: | With:
LTRASTERXXXLib_TLB | LTRASTERXXXLib_U_TLB
ILEADRasterXXXX | ILEADRasterXXXX_U
CLASS_LEADRasterXXXX | CLASS_LEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

Note:

When adding an ActiveX Control or Import type library to a Delphi or C++ Builder project, be sure that the desired ActiveX Control or Library name ends with (_U).

For example:

To add the Unicode version of LEAD Raster View Control to your project, you have to select LEAD Raster View_U Control (14.5).


Tutorial for Visual Basic Programmers

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

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Using ODBC to Access Image Data

Implementing a Database with the MS ADO Data Control

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Cropping a Bitmap 2

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Using the Magnifying Glass

Using the Magnifying Glass (2) (Visual Basic)

Using a PanWindow

Print a Real Image Size in Inches

Combining Images with Regions

Miscellaneous Examples


Loading and Displaying an Image (Visual Basic)

Take the following steps to start a project and to add some code that displays an image on the main form:

1. | Start Visual Basic.
2. | Add the LEAD RasterView Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
5. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
6. | Add a command button to your form and name it as follows:
 | Name | Caption
 | LoadLead | Load Image
7. | Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
'Set defaults for displaying the image.
'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_FLAT
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
End Sub

8.

Code the LoadLead button's click procedure as follows:

Private Sub LoadLead_Click()
Dim RasterIO As New LEADRasterIO
RasterIO.Load LEADRasterView1.Raster, "v:\images\arcade.bmp", 0, 0, 1
End Sub

9. | Run your program to test it.
10. | Save the project be used as a starting point for other tasks in this tutorial.


Loading and Saving Images Using Databases (Visual Basic)

Take the following steps to start a project and to add some code that demonstrates adding images to or deleting images from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start Visual Basic.
2. | Add the LEAD RasterView Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
5. | Add the Microsoft ActiveX Data Object 2.6 Library to your project.
 | On the Project pull-down menu, use the References option, and select the Microsoft ActiveX Data Object 2.6 Library.
6. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
7. | Add six command buttons to your form and name them as follows:
 | Name | Caption
 | cmdAddRecord | Add Record
 | cmdMoveNext | Move Next
 | cmdMovePrevious | Move Previous
 | cmdDeleteRecord | Delete Record
 | cmdConnect | Connect to Database
 | cmdDisconnect | Disconnect From Database
8. | Declare the following variables as Global variables:

Dim RasterIO As New LEADRasterIO
Dim Recordset As New ADODB.Recordset
Dim Connection As New ADODB.Connection
Dim strConnect As String

9.

Add the following initialization code to the main form's Load procedure.

RasterIO.Load LEADRasterView1.Raster, "c:\parrots.jpg", 0, 0, 1

cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdAddRecord.Enabled = False
cmdDeleteRecord.Enabled = False

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\DB1.mdb"

10.

Code the cmdAddRecord button's Click procedure as follows:

Dim ByteArray() As Byte
Dim RasterVariant As New LEADRasterVariant
Dim i As Long

If Connection.State = adStateClosed Then
MsgBox "Connection closed", vbInformation, "Save error"
Exit Sub
End If

Recordset.AddNew

Set RasterVariant = RasterIO.SaveArray(LEADRasterView1.Raster, FILE_BMP, 0, 0)

ReDim ByteArray(0 To RasterVariant.ItemCount - 1) As Byte

For i = 0 To RasterVariant.ItemCount – 1
ByteArray(i) = RasterVariant.ShortItemValue(i)
Next I

Recordset.Fields("Image").Value = ByteArray
Recordset.Fields("Size").Value = RasterVariant.ItemCount

If Not Recordset.BOF Then Recordset.MoveFirst

Recordset.Update

If Recordset.RecordCount > 0 Then
cmdMoveNext.Enabled = True
cmdMovePrevious.Enabled = True
cmdDeleteRecord.Enabled = True
End If

11.

Code the cmdMoveNext button's Click procedure as follows:

Dim RasterVariant As New LEADRasterVariant
Dim i As Long
Dim nSize As Long
Dim Data As Variant

If Not Recordset.EOF Then Recordset.MoveNext

If (Recordset.EOF) Then
MsgBox "Unable to get the Image from db"
Recordset.MovePrevious
Else
nSize = Recordset.Fields("Size").Value
Data = Recordset.Fields("Image").Value
RasterVariant.Type = VALUE_ARRAY_BYTE
RasterVariant.ItemCount = nSize
For i = 0 To nSize – 1
RasterVariant.ShortItemValue(i) = Data(i)
Next I

RasterIO.LoadArray LEADRasterView1.Raster, RasterVariant, 0, 1, -1, nSize
End If

12.

Code the cmdMovePrevious button's Click procedure as follows:

Dim RasterVariant As New LEADRasterVariant
Dim i As Long
Dim nSize As Long
Dim Data As Variant

If Not Recordset.BOF Then Recordset.MovePrevious

If (Recordset.BOF) Then
MsgBox "Unable to get the Image from db"
Recordset.MoveNext
Else
nSize = Recordset.Fields("Size").Value
RasterVariant.Type = VALUE_ARRAY_BYTE
RasterVariant.ItemCount = nSize
Data = Recordset.Fields("Image").Value
For i = 0 To nSize – 1
RasterVariant.ShortItemValue(i) = Data(i)
Next

RasterIO.LoadArray LEADRasterView1.Raster, RasterVariant, 0, 1, -1, nSize
End If

13.

Code the cmdDeleteRecord button's Click procedure as follows:

If Connection.State = adStateClosed Then
MsgBox "Connection closed", vbInformation, "Delete error"
Exit Sub
End If
If Not Recordset.BOF Or Not Recordset.EOF Then
Recordset.MoveLast
Recordset.Delete
Recordset.Update

If Recordset.RecordCount <= 0 Then
cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdDeleteRecord.Enabled = False
End If
End If

14.

Code the cmdConnect button's Click procedure as follows:

If Connection.State = adStateClosed Then
Connection.Open strConnect
End If

If Recordset.State = adStateOpen Then Recordset.Close
Set Recordset.ActiveConnection = Connection
Recordset.Open "SELECT * FROM Images", Connection, adOpenKeyset, adLockOptimistic

If Not Recordset.BOF Then Recordset.MoveFirst

If Not Recordset.EOF Then
cmdMoveNext.Enabled = True
cmdMovePrevious.Enabled = True
cmdDeleteRecord.Enabled = True
End If

cmdAddRecord.Enabled = True

15.

Code the cmdDisconnect button's Click procedure as follows:

If Connection.State = adStateOpen Then Connection.Close
If Recordset.State = adStateOpen Then Recordset.Close
cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdAddRecord.Enabled = False
cmdDeleteRecord.Enabled = False

16.

Run your program to test it.


Zooming Out and Zooming In (Visual Basic)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD RasterView control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add two command buttons to your form and name them as follows:
 | Name | Caption
 | ZoomIn | Zoom In
 | ZoomOut | Zoom Out
3. | Code the ZoomIn button's click procedure as follows:

Private Sub ZoomIn_Click()
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor + 10
End Sub

4.

Code the ZoomOut button's click procedure as follows:

Private Sub ZoomOut_Click()
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM
If LEADRasterView1.PaintZoomFactor > 10 Then
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor - 10
End If
End Sub

5.

Run your program to test it.


Dynamically Positioning the Control (Visual Basic)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the LeadLoad button's click procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying an Image.

Private Sub LoadLead_Click()
Dim RasterIO As New LEADRasterIO
'Declare variables used for preserving aspect ratios.
Dim HeightFactor As Long
Dim WidthFactor As Long
Dim HeightAllowed As Long
Dim WidthAllowed As Long
'Position and size the main form so that it takes up most of the screen.
Width = Screen.Width * 0.9
Height = Screen.Height* 0.8
Left = (Screen.Width - Width) / 2
TOP = (Screen.Height - Height) / 2
'Turn off automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = False
LEADRasterView1.BackErase = False
'Load the bitmap. This hard-coded path name may be different on your system.
RasterIO.Load LEADRasterView1.Raster, "v:\images\arcade.bmp", 0, 0, 1
'Set the variables used for preserving the aspect ratio.
'Allow for a border of 1/8 of the form size.
'The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
HeightAllowed = ScaleHeight * 3/4
WidthAllowed = ScaleWidth * 3/4
'Center the LEAD control on the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
LEADRasterView1.Left = ScaleWidth / 8
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor
LEADRasterView1.TOP = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.TOP = ScaleHeight / 8
LEADRasterView1.Height = HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor
LEADRasterView1.Left = (ScaleWidth - LEADRasterView1.Width) / 2
End If
'Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetSrcRect 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight
LEADRasterView1.SetSrcClipRect 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight
'Turn on automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoScroll = True
End Sub

3.

Run your program to test it.


Zooming In on a Selection (Visual Basic)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | In the LEADRasterView1 control's MouseDown procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
'Enable AutoRubberBand
LEADRasterView1.AutoRubberBand = True
LEADRasterView1.MousePointer = 2
End Sub

3.

In the LEADRasterView1 control's Rubberband procedure, add the following code.

Private Sub LEADRasterView1_RubberBand ()
Dim zoomleft As Integer
Dim zoomtop As Integer
Dim zoomwidth As Integer
Dim zoomheight As Integer
LEADRasterView1.MousePointer = 0
'Zoom in on the selection.
zoomleft = LEADRasterView1.RubberBandLeft
zoomtop = LEADRasterView1.RubberBandTop
zoomwidth = LEADRasterView1.RubberBandWidth
zoomheight = LEADRasterView1.RubberBandHeight
'Zoom in on the rectangle defined by the rubberband
LEADRasterView1.ZoomToRect zoomleft, zoomtop, zoomwidth, zoomheight
LEADRasterView1.ForceRepaint
End Sub

4.

Run your program to test it.


Outlining, Dragging, and Pasting a Region (Visual Basic)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a second LEAD RasterView control, name it LEADRasterView2, and set its Visible property to False. NOTE: for simplicity, this example uses 2 controls. In order to save memory, your application could use a dynamically created ILEADRaster object instead of the 2nd LEAD Raster View control.
3. | Add the following form-level variables to the declarations procedure of the general object in your main form. In online help, you can use the Edit pull-down menu to copy the block of code.

Dim ReadyToDrag As Boolean 'The state after marking the region but before dragging
Dim Dragging As Boolean 'The state when the mouse is used for dragging the floater
Dim StartX As Single 'Starting X position in screen twips
Dim StartY As Single 'Starting Y position in screen twips
Dim FloaterX As Single 'Floater X position in screen twips
Dim FloaterY As Single 'Floater Y position in screen twips
Dim ZoomFactorX As Single 'Used for translating positioning information
Dim ZoomFactorY As Single 'Used for translating positioning information

4. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
5. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | SelRgnBtn | Select Region
 | PasteFloaterBtn | Paste Floater
6. | Add the following code to the SelRgnBtn control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub SelRgnBtn_Click()
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
LEADRasterView1.Raster.RefBitmap = False
LEADRasterView1.RgnMarkingMode = RGNMARK_FREEHAND
MsgBox "Draw a freehand region"
End Sub

7.

Add the following code to the PasteFloaterBtn control's Click procedure:

Private Sub PasteFloaterBtn_Click()
Dim RasterProc As New LEADRasterProcess
Dim LCRgnX As Single
Dim LCRgnY As Single
Dim LCRgnWidth As Single
Dim LCRgnHeight As Single
Dim LBRgnX As Single
Dim LBRgnY As Single
Dim LBRgnWidth As Single
Dim LBRgnHeight As Single
Dim MyOp As CombineConstants

'Do nothing if there is no floater.
If LEADRasterView1.Floater = 0 Then Exit Sub
'Get the floater into another bitmap
LEADRasterView2.Raster.RefBitmap = False
LEADRasterView2.ScaleMode = LEADRasterView1.ScaleMode
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Floater
'Get the floater's client coordinates into local variables.
LCRgnX = LEADRasterView1.FloaterDstLeft
LCRgnY = LEADRasterView1.FloaterDstTop
LCRgnWidth = LEADRasterView1.FloaterDstWidth
LCRgnHeight = LEADRasterView1.FloaterDstHeight
'Delete the floater.
LEADRasterView1.FloaterVisible = False
LEADRasterView1.Floater = 0
'Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft
LBRgnY = ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop
LBRgnWidth = LCRgnWidth / ZoomFactorX
LBRgnHeight = LCRgnHeight / ZoomFactorY
'Reposition the region be used as a mask for the Combine method.
LEADRasterView1.Raster.OffsetRgn LBRgnX - LEADRasterView1.Raster.rgnleft, LBRgnY - LEADRasterView1.Raster.rgntop
'Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0 'Operation flags for a simple paste.
RasterProc.Combine LEADRasterView1.Raster, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2.Raster, 0, 0, MyOp
'Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False
'Free the region.
LEADRasterView1.Raster.FreeRgn
End Sub

8.

In the LEADRasterView1 control's MouseDown procedure, add the following code:

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim BitmapX As Single
Dim BitmapY As Single
Dim NewX As Single
Dim NewY As Single
Dim NewWidth As Single
Dim NewHeight As Single
'Do nothing if we are drawing a region.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then Exit Sub
' Save the starting position, in case we need it.
StartY = y
StartX = x
'If we are ready to drag the selection, get a floater.
If ReadyToDrag = True Then
'Translate the current mouse coordinates.
'These coordinates account for the zoom factor and offset.
ZoomFactorX = LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth
ZoomFactorY = LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight
BitmapX = (x / ZoomFactorX) - (LEADRasterView1.DstLeft / ZoomFactorX) _
+ LEADRasterView1.SrcLeft
BitmapY = (y / ZoomFactorY) - (LEADRasterView1.DstTop / ZoomFactorY) _
+ LEADRasterView1.SrcTop
'Continue to create the floater if the mouse is pointing to the region we marked.

If LEADRasterView1.Raster.IsPtInRgn(BitmapX, BitmapY) Then
'Hide the region frame.
LEADRasterView1.RgnFrameType = RGNFRAME_NONE
'Create the floater bitmap, which will be the part of the main bitmap that is
'in the region's bounding rectangle.
LEADRasterView1.Floater = LEADRasterView1.Raster.Bitmap
'Translate the bitmap region coordinates to client area coordinates.
NewY = ((LEADRasterView1.Raster.RgnTop - LEADRasterView1.SrcTop) * ZoomFactorY) _
+ LEADRasterView1.DstTop
NewX = ((LEADRasterView1.Raster.RgnLeft - LEADRasterView1.SrcLeft) * ZoomFactorX) _
+ LEADRasterView1.DstLeft
NewWidth = LEADRasterView1.Raster.RgnWidth* ZoomFactorX
NewHeight = LEADRasterView1.Raster.RgnHeight * ZoomFactorY
'Set the initial display position of the floater.
LEADRasterView1.SetFloaterDstRect NewX, NewY, NewWidth, NewHeight
'Set form-level variables.
FloaterY = LEADRasterView1.FloaterDstTop
FloaterX = LEADRasterView1.FloaterDstLeft
LEADRasterView1.FloaterVisible = True
Dragging = True
ReadyToDrag = False
End If
End If
End Sub

9.

In the LEADRasterView1 control's MouseMove procedure, add the following code.

Private Sub LEADRasterView1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim xDelta As Single
Dim yDelta As Single
Dim NewX As Single
Dim NewY As Single
Dim NewWidth As Single
Dim NewHeight As Single
'Do nothing if we are drawing a region.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then Exit Sub
'Reposition the floater if we are dragging it.
If Dragging = True And Button = 1 And LEADRasterView1.Floater <> 0 Then
If LEADRasterView1.IsPtInFloater(x, y) Then
'Update the position variables.
xDelta = x - StartX
yDelta = y - StartY
NewX = FloaterX + xDelta
NewY = FloaterY + yDelta
NewWidth = LEADRasterView1.FloaterDstWidth
NewHeight = LEADRasterView1.FloaterDstHeight
'Reposition the floater.
LEADRasterView1.SetFloaterDstRect NewX, NewY, NewWidth, NewHeight
'Save the form-level position variables.
FloaterY = NewY
FloaterX = NewX
StartY = y
StartX = x
End If
End If
EndSub

10.

In the LEADRasterView1 control's MouseUp procedure, add the following code.

Private Sub LEADRasterView1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
' If we were drawing a region, set up for the next operation.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then
LEADRasterView1.RgnMarkingMode = RGNMARK_NONE
LEADRasterView1.RgnFrameType = RGNFRAME_STATIC
ReadyToDrag = True
MsgBox "Now, drag the selection to another place."
End If
End Sub

11.

Run your program to test it.


Creating and Using Annotations (Visual Basic)

Note: This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the LEAD Raster Annotation Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Annotation Object Library
3. | Add the following code to the general declarations section of your project

Public WithEvents RasterAnn As LEADRasterAnnotation
Public RasAnnToolbar As LEADRasterAnnToolBar

4.

Add the following code to the main form's Load procedure

Set RasterAnn = New LEADRasterAnnotation
Set RasAnnToolbar = New LEADRasterAnnToolBar

'Unlock annotation support
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT

'Connect the raster annotation object to the RasterView control
RasterAnn.AnnParentRasterView = LEADRasterView1

'Enable left button drawing of annotations
RasterAnn.AnnAutoDrawEnable = True

'Enable right-click to display annotation menus
RasterAnn.AnnAutoMenuEnable = True

5. | At the top of your main form, add four command buttons and name them as follows:
 | Name | Caption
 | AnnToggle | Start
 | IOToggle | Save
 | ClipboardToggle | Copy
 | Realize | Realize
6. | Code the AnnToggle control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub AnnToggle_Click()
'Use the button to toggle between design mode and run mode
If AnnToggle.Caption = "Start" Then
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.AnnTool = ANN_TOOL_BUTTON
'Make run mode the next thing.
AnnToggle.Caption = "Run Mode"
MsgBox "In design mode now. Draw a button object."
ElseIf AnnToggle.Caption = "Design Mode" Then
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.AnnTool = ANN_TOOL_BUTTON
'Make run mode the next thing.
AnnToggle.Caption = "Run Mode"
Else 'The button takes us to run mode
RasterAnn.AnnUserMode = ANN_USERMODE_RUN
MsgBox "Click on your new button"
AnnToggle.Caption = "Design Mode"
End If
End Sub

7.

Code the IOToggle control's Click procedure as follows:

Private Sub IOToggle_Click()
Dim nRet As Integer

'Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = False
'Use the button to toggle between saving and loading annotations
If IOToggle.Caption = "Save" Then
'Do nothing if there are no annotations.
If RasterAnn.AnnContainer = 0 Then Exit Sub
'Save the all annotations.
nRet = RasterAnn.AnnSave("c:\lead\images\tmp.ann", ANN_FMT_NATIVE, False, SAVE_OVERWRITE, 0)
If nRet = 0 Then
IOToggle.Caption = "Load"
MsgBox "Use the right mouse button to delete any annotations, then click Load"
Else
MsgBox "Error code: " + Str(nRet)
End If
Else 'We are loading annotations
'Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
'Load the annotations.
nRet = RasterAnn.AnnLoad("c:\lead\images\tmp.ann", 1)
If nRet = 0 Then
IOToggle.Caption = "Save"
Else
MsgBox "No annotations to load"
End If
End If
End Sub

8.

Code the ClipboardToggle control's Click procedure as follows. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)

Private Sub ClipboardToggle_Click()
Dim nRet As Integer
'Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = False
'Use the button to toggle between copying and pasting annotations
If ClipboardToggle.Caption = "Copy" Then
'Do nothing if there are no annotations.
If RasterAnn.AnnContainer = 0 Then Exit Sub
'Copy all annotations to the clipboard.
nRet = RasterAnn.AnnCopy(ANN_FMT_NATIVE, False, True)
If nRet = 0 Then
'Make pasting the next thing.
ClipboardToggle.Caption = "Paste"
MsgBox "Use the right mouse button to delete any annotations, then click Paste"
Else
MsgBox "Error code: " + Str(nRet)
End If
Else 'We are pasting annotations
'Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
'Paste the annotations
If RasterAnn.AnnPasteReady Then
nRet = RasterAnn.AnnPaste
ClipboardToggle.Caption = "Copy"
Else
MsgBox "No annotations to paste"
End If
End If
End Sub

9.

Code the Realize control's Click procedure (which renders the annotation objects to the bitmap) as follows:

Private Sub Realize_Click()
RasterAnn.AnnRealize False
LEADRasterView1.ForceRepaint
MsgBox "Annotations are now rendered to the bitmap"
End Sub

10.

Code the RasterAnn object's AnnCreate procedure as follows:

Private Sub RasterAnn_OnAnnCreate(ByVal hAnnObject As Long)
Dim hObject As Long
Dim ObjectType As AnnObjectType
' Update the tag if we need one.
Static NewTag As Integer
RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType
If ObjectType = ANN_OBJECT_BUTTON Or ObjectType = ANN_OBJECT_HOTSPOT Then
NewTag = NewTag + 1
RasterAnn.AnnSetTag hObject, NewTag
End If
End Sub

11.

Code the RasterAnn object's AnnDrawn procedure as follows:

Private Sub RasterAnn_OnAnnDrawn(ByVal hAnnObject As Long)
RasterAnn.AnnTool = ANN_TOOL_SELECT
MsgBox "Use the right mouse button to modify this object; then click on Run Mode to test it."
End Sub

12.

Code the RasterAnn object's AnnClicked procedure as follows:

Private Sub RasterAnn_OnAnnClicked(ByVal hAnnObject As Long)
Dim lTag As Long
RasterAnn.AnnGetTag hAnnObject
lTag = RasterAnn.AnnTag
MsgBox "This is what we do for the button tagged " + Str(lTag)
End Sub

13.

Code the RasterAnn object's AnnDestroy procedure as follows:

Private Sub RasterAnn_OnAnnDestroy(ByVal hAnnObject As Long)
Dim lTag As Long
RasterAnn.AnnGetTag hAnnObject
lTag = RasterAnn.AnnTag
MsgBox "The object tagged " + Str(lTag) + " is deleted."
End Sub

14.

Run your program to test it.


Loading and Saving Annotations Using Databases (Visual Basic)

Note: This topic is for Document/Medical only.

Take the following steps to start a project and to add some code that demonstrates adding annotation objects to or deleting annotation objects from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start Visual Basic.
2. | Add the LEAD RasterView Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
5. | Add the LEAD Raster Annotation Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Annotation Object Library (14.5).
6. | Add the Microsoft ActiveX Data Object 2.6 Library to your project.
 | On the Project pull-down menu, use the References option, and select the Microsoft ActiveX Data Object 2.6 Library.
7. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
8. | Add six command buttons to your form and name them as follows:
 | Name | Caption
 | cmdAddRecord | Add Record
 | cmdMoveNext | Move Next
 | cmdMovePrevious | Move Previous
 | cmdDeleteRecord | Delete Record
 | cmdConnect | Connect to Database
 | cmdDisconnect | Disconnect From Database
9. | Declare the following variables as Global variables:

Dim RasterIO As New LEADRasterIO
Dim RasterAnn As New LEADRasterAnnotation
Dim RasterAnnToolBar As New LEADRasterAnnToolBar
Dim Recordset As New ADODB.Recordset
Dim Connection As New ADODB.Connection
Dim strConnect As String

10.

Add the following initialization code to the main form's Load procedure.

LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT
RasterIO.Load LEADRasterView1.Raster, "c:\parrots.jpg", 0, 0, 1
RasterAnn.AnnParentRasterView = Me.LEADRasterView1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN

RasterAnnToolBar.AnnParentRasterView = LEADRasterView1

RasterAnnToolBar.Visible = True
RasterAnnToolBar.Create 0, 0, ANN_TOOLALIGN_TOP

cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdAddRecord.Enabled = False
cmdDeleteRecord.Enabled = False

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\ DB1.mdb "

11.

Code the cmdAddRecord button's Click procedure as follows:

Dim ByteArray() As Byte
Dim RasterVariant As New LEADRasterVariant
Dim i As Integer

If Connection.State = adStateClosed Then
MsgBox "Connection closed", vbInformation, "Save error"
Exit Sub
End If

Recordset.AddNew

RasterAnn.AnnSaveArray ANN_FMT_NATIVE, False, RasterVariant, SAVE_OVERWRITE, 0

ReDim ByteArray(0 To RasterVariant.ItemCount - 1) As Byte

For i = 0 To RasterVariant.ItemCount – 1
ByteArray(i) = RasterVariant.ShortItemValue(i)
Next I

Recordset.Fields("Image").Value = ByteArray
Recordset.Fields("Size").Value = RasterVariant.ItemCount

If Not Recordset.BOF Then Recordset.MoveFirst

Recordset.Update

If Recordset.RecordCount > 0 Then
cmdMoveNext.Enabled = True
cmdMovePrevious.Enabled = True
cmdDeleteRecord.Enabled = True
End If

12.

Code the cmdMoveNext button's Click procedure as follows:

Dim RasterVariant As New LEADRasterVariant
Dim i As Integer
Dim nSize As Integer

If Not Recordset.EOF Then Recordset.MoveNext

If (Recordset.EOF) Then
MsgBox "Unable to get the annotation from the database"
Recordset.MovePrevious
Else
nSize = Recordset.Fields("Size").Value
RasterVariant.Type = VALUE_ARRAY_BYTE
RasterVariant.ItemCount = nSize
For i = 0 To nSize – 1
RasterVariant.ShortItemValue(i) = Recordset.Fields("Image").Value(i)
Next
RasterAnn.AnnLoadArray RasterVariant, nSize, 1
End If

13.

Code the cmdMovePrevious button's Click procedure as follows:

Dim RasterVariant As New LEADRasterVariant
Dim i As Integer
Dim nSize As Integer

If Not Recordset.BOF Then Recordset.MovePrevious

If (Recordset.BOF) Then
MsgBox "Unable to get the annotation from the database"
Recordset.MoveNext
Else
nSize = Recordset.Fields("Size").Value
RasterVariant.Type = VALUE_ARRAY_BYTE
RasterVariant.ItemCount = nSize
For i = 0 To nSize – 1
RasterVariant.ShortItemValue (i) = Recordset.Fields("Image").Value(i)
Next
RasterAnn.AnnLoadArray RasterVariant, nSize, 1
End If

14.

Code the cmdDeleteRecord button's Click procedure as follows:

If Connection.State = adStateClosed Then
MsgBox "Connection closed", vbInformation, "Delete error"
Exit Sub
End If
If Not Recordset.BOF Or Not Recordset.EOF Then
Recordset.MoveLast
Recordset.Delete
Recordset.Update

If Recordset.RecordCount <= 0 Then
cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdDeleteRecord.Enabled = False
End If
End If

15.

Code the cmdConnect button's Click procedure as follows:

If Connection.State = adStateClosed Then
Connection.Open strConnect
End If

If Recordset.State = adStateOpen Then Recordset.Close
Set Recordset.ActiveConnection = Connection
Recordset.Open "SELECT * FROM Images", Connection, adOpenKeyset, adLockOptimistic

If Not Recordset.BOF Then Recordset.MoveFirst

If Not Recordset.EOF Then
cmdMoveNext.Enabled = True
cmdMovePrevious.Enabled = True
cmdDeleteRecord.Enabled = True
End If

cmdAddRecord.Enabled = True

16.

Code the cmdDisconnect button's Click procedure as follows:

If Connection.State = adStateOpen Then Connection.Close
If Recordset.State = adStateOpen Then Recordset.Close
cmdMoveNext.Enabled = False
cmdMovePrevious.Enabled = False
cmdAddRecord.Enabled = False
cmdDeleteRecord.Enabled = False

17.

Run your program to test it.


Using ODBC to Access Image Data (Visual Basic)

This lesson describes how to use the LEADTOOLS ODBC features to maintain images in a table with other data. In this lesson, you accomplish the following:

Create a database with one table containing images and names for the images.

Create an ODBC data source that references the table.

Use a data control to manage the table and to access the names.

Use the LEADTOOLS methods to access the images through the ODBC data source.

Use SQL SELECT statements to maintain a sorted view of the records.

Synchronize the record pointers so that the two views of the same table are always correct.

Note:

The ILEADRasterODBC Object requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Start Visual Basic.
2. | On the Add Ins menu, select the Data Manager option (Visual Data Manager in VB5).
3. | Create a new database.
 | On the File menu, select New Database, and specify Microsoft Access 7.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | Add a table.
 | Use the right mouse button, and select the New Table menu option.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary (or Binary). Size: N/A.
7. | Close the Database Manager.
8. | Add a data control to the bottom of your form and change its properties as follows:
 | a. | Set the DatabaseName property to leadpic.mdb. (Use the browser to get the full path name.)
 | b. | Set the RecordSource property to the following:
 |  | SELECT who FROM people ORDER BY who
 | c. | Set the Name property to Dpeople.
9. | On the Tools pull-down menu, use the Custom Controls option to add the LEAD RasterView Control to your project.
10. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
11. | In the Properties box for the LEADRasterView control, make the following changes:
 | a. | Set the BorderStyle property to 1. This adds a 1-pixel border to the control.
 | b. | Set the Name property to LeadRasterView1.
12. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
13. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
14. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
15. | Add the LEAD Raster ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
16. | Add the LEAD Raster Annotation ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Annotation Object Library (14.5).
17. | Add the following code to the general declarations section of your project.

Public RasterIO As LEADRasterIO
Public RasterProc As LEADRasterProcess
Public WithEvents LeadRasODBC As LEADRasterODBC
Public RasAnn As LEADRasterAnnotation

18.

Add the following code to the end of the Form_Load event handler.

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO ")
'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess ")
'Create the RasterODBC Object
Set LeadRasODBC = CreateObject("LEADRasterODBC.LEADRasterODBC ")

'Create the RasAnn Object
Set RasAnn = CreateObject("LEADRasterAnnotation.LEADRasterAnnotation")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
RasAnn.AnnParentRasterView = LEADRasterView1
RasAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasAnn.AnnTool = ANN_TOOL_SELECT
LeadRasODBC.AnnContainer = RasAnn.AnnContainer

19. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the DataField property to who.
 | c. | Set the Name property to Cwho.
20. | From the Windows Control Panel, create the ODBC data source as follows:
 | a. | Open the ODBC administrator and click the Add button.
 | b. | Select Microsoft Access driver and click the OK button.
 | c. | Enter the name LEADODBC.
 | d. | Click the Select directory button and select the path to the database that you created.
 | e. | Click the OK button; click the next OK button; then click the Close button.
21. | In Visual Basic, add the following code to your form's general declarations. In online help, you can use the Edit pull-down menu to copy the block of code.

' The Windows Sleep function lets us synchronize requeries on adds and deletes
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
' These are variables for implementing the dbMove method
Public OldPosition, NewPosition As Long
' This variable lets us make the dbMove method conditional
Public NormalMove As Boolean

22.

Add the following code to the form's Load procedure.

LeadRasODBC.EnableMethodErrors = FALSE
On Error GoTo ERRORHANDLER
' Turn off automatic scrolling and repainting
LeadRasterView1.AutoScroll = False
LeadRasterView1.AutoRepaint = False
' Open the database.
' Use the same SELECT statement that is used for the data control.
' Note that the image field must be listed first in the SELECT statement.
DString = "ODBC;DSN=LEADODBC"
SelString = "SELECT photo,* FROM people ORDER BY who"
LeadRasODBC.Raster = LEADRasterView1.Raster
LeadRasODBC.dbOpen DString, SelString, "photo", DB_OPENOPTIONS_NONE
' Set the LEAD control's database properties
LeadRasODBC.dbLoadBits = 24
LeadRasODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
' Enable use of the dbMove method in the data control's Reposition event
If (LeadRasODBC.dbIsBOF And LeadRasODBC.dbIsEOF) = False Then
NormalMove = True
End If
Exit Sub
ERRORHANDLER:
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

23.

Add the following code to the form's Unload procedure.

LeadRasODBC.dbClose

24. | Add a Microsoft CommonDialog control to your form.
25. | Add a CommandButton control to your form, change its Caption property to Add Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Get an image file
' This filter list is complete, except for GIF.
CommonDialog1.Filter = "Graphics|*.cmp; *.jpg; *.jff; *.jtf; *.bmp; *.tif; *.tga; *.pcx; *.cal; *.mac; *.mac; *.img; *.msp; *.wpg; *.wpg; *.ras; *.pct; *.pcd; *.eps; *.wmf"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DialogTitle = "Open File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
Myfile = CommonDialog1.filename
' Suspend use of the dbMove method in the data control's Reposition event
NormalMove = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Hide the LEAD control to avoid unnecessary repaints
LeadRasterView1.Visible = False
' Add and update the record, without inserting the image
Dpeople.Recordset.AddNew
Cwho = Myfile
Dpeople.Recordset.Update
' Wait for the update to take effect
Call Sleep(5000)
' Requery the data control's recordset
Dpeople.Recordset.Requery
' Requery the LEAD RasterODBC object's recordset and make sure it is
' synchronized with the data control.
LeadRasODBC.dbRequery
NormalMove = True ' Do normal record synchronization
Dpeople.Recordset.MoveLast
If LeadRasODBC.dbCurrentRecord <> Dpeople.Recordset.AbsolutePosition Then
MsgBox "Synchronization error!" + Chr(13) + "Delete the record and exit"
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
Screen.MousePointer = 0
Exit Sub
End If
' Go to the new record, and show the LEAD control
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
LeadRasterView1.Visible = True
' Load the image file and update the recordset
LeadRasODBC.dbEdit
RasterIO.Load LeadRasterView1.Raster, Myfile, 0, 0, 1
LeadRasODBC.Raster = LeadRasterView1.Raster
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscales
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

26.

Add another CommandButton control to your form, change its Caption property to Delete Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Disable the normal record synchronization and hide the LEAD ODBC control.
NormalMove = False
LeadRasterView1.Visible = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Save the current position
RecMarker = Dpeople.Recordset.AbsolutePosition
' Delete the record and wait for the deletion to take effect
Dpeople.Recordset.Delete
Call Sleep(5000)
' Requery the recordsets, move to the last record,
' and initialize the NewPosition global variable.
Dpeople.Recordset.Requery
LeadRasODBC.dbRequery
Dpeople.Recordset.MoveLast
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition
' Make sure the LEADODBC control is on the last record.
LeadRasODBC.dbMoveNext
If LeadRasODBC.dbIsEOF Then
LeadRasODBC.dbMovePrev
Else
MsgBox "Synchronization error!" + Chr(13) + "Restart the application"
Exit Sub
End If
' Return to the old record position, if possible.
NormalMove = True
LeadRasterView1.Visible = True
RelativePosition = RecMarker - NewPosition
If RelativePosition < 0 Then
Dpeople.Recordset.Move RelativePosition
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

27.

Add another CommandButton control to your form, change its Caption property to Flip Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Flip the image and update the record
RasterProc.Flip LeadRasterView1.Raster
LeadRasODBC.dbEdit
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscale
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
Exit Sub
ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditInProgress Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

28.

Add the following code to the LEAD RasterView control'sChange event:

' Avoid processing events that occur before the bitmap is fully loaded
If LEADRasterView1.Raster.Bitmap = 0 Then
LEADRasterView1.ForceRepaint
Exit Sub
End If
RasAnn.AnnContainer = LeadRasODBC.AnnContainer
LeadRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
LeadRasterView1.ForceRepaint

29.

Add the following code to the LEAD RasterODBC object's Change event:

' Avoid processing events that occur before the bitmap is fully loaded
If LeadRasterView1.Raster.Bitmap = 0 Then
LeadRasterView1.ForceRepaint
Exit Sub
End If
RasAnn.AnnContainer = LeadRasODBC.AnnContainer
LeadRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
LeadRasterView1.ForceRepaint

30.

Add the following code to the Dpeople control's Validate event:

' Set the OldPosition, which is used in a calculation in the Reposition event
OldPosition = Dpeople.Recordset.AbsolutePosition

31.

Add the following code to the Dpeople control's Reposition event:

' Use the dbMove method to move the LEAD control to the current record
If NormalMove Then
' The current position is the NewPosition
' The OldPosition is set in the Validate event
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition - OldPosition
End If

32.

Run your program to test it.


Implementing a Database with the MS ADO Data Control (Visual Basic)

In Visual Basic, the LEADTOOLS OLEDB control is a OLEDB data bound control. This means you can associate the LEADTOOLS OLEDB control with an ADO data control so that the LEADTOOLS OLEDB control's bitmap is bound to a specified field in the data control's recordset.

Take the following steps to start a project and to add some code that associates the LEADTOOLS OLEDB control with an ADO data control:

1. | Start Visual Basic.
2. | On the Add-Ins menu, select the Visual Data Manager option.
3. | On the Data Manager window's Select File menu, select the New Database option.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | In the Database Manager window, click the New button.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary. Size: N/A.
7. | Close the Database Manager
8. | Add the LEAD RasterProcess Object Library to your project.

On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).

9. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
10. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
11. | Add the L_OCXERR.bas module to your project. (Found in the LEADTOOLS \Include folder.)
12. | On the Project pull-down menu, use the Components option to add the MS ADO data control to your project. Then add an ADO control to the bottom of your form and change its properties as follows:
a. | Set the ConnectionString property to connect to leadpic.mdb. (Use the browser to properly build the connection string using the OLEDB ODBC Provider.)
b. | Set the RecordSource by setting the CommandType to adCommandTable and the table to the "people" table.
c. | Set the Name property to Dpeople.
13. | On the Project pull-down menu, use the Components option to add the LEADRasterView Control module to your project.
14. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
15. | On the Project pull-down menu, use the Components option to add the LEADTOOLS Raster OLE DB Custom Control module to your project. Select the LEADTOOLS Raster OLE DB control; then add the control to your main form.
16. | In the Properties box for the LEADTOOLS Raster OLE DB control, make the following changes:
 | a. | Set the DataSource property to Dpeople.
 | b. | Leave the DataMember property empty, in order to use the default for this data source.
17. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the Name property to Cwho.

18. | Add three command buttons to your form and name them as follows:
 | Name | Caption
 | AddPhoto | Add Photo
 | DeletePhoto | Delete Photo
 | FlipPhoto | Flip Photo
19. | On the Project pull-down menu, use the Components option to add the LEAD Raster Common Dialog Control to your project.
20. | Add a LEAD Raster Common Dialog Control to your form.
21. | Add the following code to the form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_FLAT
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

'databind performed at design-time except for datafield
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataField = "photo"
Cwho.DataField = "who"

' Set the data properties on the LEAD Raster OLE DB control
LEADRasterOLEDB1.DataLoadBits = 0
LEADRasterOLEDB1.DataSaveBits = 24
LEADRasterOLEDB1.DataSaveFormat = FILE_LEAD
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
LEADRasterOLEDB1.EnableMethodErrors = True

22.

Code the AddPhoto button's Click event as follows:

Dim Myfile$
Const BUFFERSIZE = 1024
Dim buffer(BUFFERSIZE - 1) As Byte
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim RasterVar As New LEADRasterVariant
Dim RasterKrn As New LEADRasterDlgKrn
Dim RasterFile As New LEADRasterDlgFile

RasterKrn.InitDlg INIT_WITH_COLOR

On Error GoTo ERRORHANDLER
'release any reference
LEADRasterView1.Raster.Bitmap = 0

RasterFile.Filter = "Graphics|*.cmp;*.jpg;*.jff;*.jtf;*.bmp;*.tif;*.tga;*.pcx;*.cal;*.mac;*.mac;*.img;*.msp;*.wpg;*.wpg;*.ras;*.pct;*.pcd;*.eps;*.wmf"
RasterFile.FileDlgFlags = 0 'cdlOFNFileMustExist
RasterFile.DialogTitle = "Open File"
RasterFile.UIFlags = OPEN_SHOW_FILEINFO + OPEN_SHOW_PREVIEW + OPEN_USEFILESTAMP

LEADRasterDlg1.ShowOpenDlg hWnd
Myfile = LEADRasterDlg1.FileName
If Myfile = "" Then Exit Sub

Dpeople.Recordset.AddNew
RasterIO.Load LEADRasterView1.Raster, Myfile, 0, 1, 1
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True
Cwho = Myfile
Dpeople.Recordset.Update

Open Myfile For Binary Access Read As #1
Do
Get #1, , buffer
Dpeople.Recordset!photo.AppendChunk buffer
Loop Until EOF(1)

Close #1

RasterIO.StartFeedLoad LEADRasterView1.Raster, 0, 1, 1
Do
RasterVar.Type = VALUE_STRING
RasterVar.ShortValue = Dpeople.Recordset!photo.GetChunk(BUFFERSIZE)

If RasterVar.Type <> vbNull Then
RasterIO.FeedLoad RasterVar, BUFFERSIZE
End If
Loop Until RasterVar.Type = vbNull

RasterIO.StopFeedLoad

' Requery the data control's recordset
Dpeople.Recordset.Requery
Exit Sub

ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
If (Err.Number <> ERROR_DLG_CANCELED) Then
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description
End If

RasterKrn.FreeDlg

23.

Code the DeletePhoto button's Click event as follows:

Dpeople.Recordset.Delete
Dpeople.Recordset.MoveFirst

24.

Code the FlipPhoto button's Click event as follows:

RasterProc.Flip LeadRasterView1.Raster
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True

25.

Add the following code to the LEAD Raster OLEDB control's DataLoaded event:

If (nStatus = 0) Then
LEADRasterView1.ForceRepaint
LEADRasterOLEDB1.DataDirty = False
ElseIf (nStatus = ERROR_FILENOTFOUND) Then 'if it's an empty record
LEADRasterView1.Raster.Bitmap = 0
ElseIf (nStatus <> ERROR_FILENOTFOUND) Then 'if it's not an empty record
LEADRasterView1.Raster.Bitmap = 0
MsgBox "Error loading from database!"
End If
LEADRasterView1.ForceRepaint
LEADRasterOLEDB1.DataDirty = False

26.

Add the following code to the LEAD Raster OLEDB control's DataSaved event:

If (nStatus <> 0) Then
LEADRasterView1.Raster.Bitmap = 0 'free the current bitmap
LEADRasterView1.ForceRepaint
MsgBox "Error saving to database!"
End If

27.

Run your program to test it.


Printing Multiple Images (Visual Basic)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
3. | In the Properties box, change the CommandButton control's Caption property to Print Twice on One Page.
4. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.
 | Notice that LEAD measures the printing surface in pixels, while Visual Basic uses twips. The measurements must be converted before using them together.

Private Sub Command3_Click()
Dim RasterProc As New LEADRasterProcess
'Declare the variable for printed text
Dim Msg As String
'Declare the variables for pixel measurements
Dim TextHeightInPixels
Dim UsableWidth
Dim UsableHeight
Dim MaxImageHeight
'Declare the variables for sizing and positioning the image
Dim PrintLeft As Long
Dim PrintTop As Long
Dim PrintHeight As Long
Dim PrintWidth As Long
'Declare variables used for preserving aspect ratios
Dim WidthFactor
Dim HeightFactor
'Set the variables used for preserving the aspect ratio
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
'Set the pointer to an hourglass
Screen.MousePointer = 11
'Get the page width and height in pixels (dots)
UsableWidth = Printer.Width / Printer.TwipsPerPixelX
UsableHeight = Printer.Height / Printer.TwipsPerPixelY
'Print a title at the top of the page
Msg = "This is a print example using LEADTOOLS COM."
Printer.Print Msg
'Get the maximum height of one image,
'assuming two equal-size images and space for 12 lines of text
TextHeightInPixels = TextHeight(Msg) / Printer.TwipsPerPixelY
MaxImageHeight = (UsableHeight - (12 * TextHeightInPixels)) / 2
'Size and position the first image, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight Then
PrintLeft = 1
PrintTop = Printer.CurrentY / Printer.TwipsPerPixelX
PrintWidth = UsableWidth
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor
Else
PrintLeft = 1
PrintTop = Printer.CurrentY / Printer.TwipsPerPixelX
PrintHeight = MaxImageHeight
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor
End If
'Print the first image
LEADRasterView1.Render Printer.hdc, PrintLeft, PrintTop, PrintWidth, PrintHeight
'Update the current printing position
Printer.CurrentY = Printer.CurrentY + (PrintHeight * Printer.TwipsPerPixelY)
'Print a blank line, then print a caption for the next picture
Msg = " "
Printer.Print Msg
Msg = "This is the second picture, which is modified before printing:"
Printer.Print Msg
'Stretch the intensity of the bitmap for the second printing
'to show the difference between the second picture and the first
RasterProc.StretchIntensity LEADRasterView1.Raster
'Size and position the second image, preserving the aspect ratio.
'The coding is the same as for the first image.
If ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight Then
PrintLeft = 1 'This is for flush left. Use 0 for centering.
PrintTop = Printer.CurrentY / Printer.TwipsPerPixelX
PrintWidth = UsableWidth
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor
Else
PrintLeft = 1 'This is for flush left. Use 0 for centering.
PrintTop = Printer.CurrentY / Printer.TwipsPerPixelX
PrintHeight = MaxImageHeight
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor
End If
'Print the second image
LEADRasterView1.Render Printer.hdc, PrintLeft, PrintTop, PrintWidth, PrintHeight
'Finish the page and finish the print job
Printer.NewPage
Printer.EndDoc
'Set the mouse pointer back to the default
Screen.MousePointer = 0
End Sub

5.

Run your program to test it.


Writing and Reading Multipage Files (Visual Basic)

Take the following steps to create a multipage file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support multipage files.

1. | Start Visual Basic.
2. | Add the LEAD RasterView Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
5. | Select the LEAD RasterView control; then add two controls to your main form. The size and position does not matter.
6. | Add the following code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code. This code loads two bitmaps, saves them both into a single multipage TIFF file, loads them again from the TIFF file, and displays them side-by-side.

Private Sub Form_Load()
Dim RasterIO1 As New LEADRasterIO
Dim RasterIO2 As New LEADRasterIO
Dim HeightFactor1, WidthFactor1, HeightFactor2, WidthFactor2
Dim HeightAllowed, WidthAllowed
Dim ImageWidth1, ImageHeight1
Dim ImageWidth2, ImageHeight2

'Disable automatic repainting of the image.
LEADRasterView1.AutoRepaint = False
LEADRasterView2.AutoRepaint = False
'Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll = False
LEADRasterView2.AutoScroll = False
'Position and size the main form so that it takes up most of the screen.
Width = Screen.Width * 0.9
Height = Screen.Height * 0.8
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
'Display the form and set the mouse pointer to an hourglass.
Show
Screen.MousePointer = 11
'Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load LEADRasterView1.Raster, "d:\lead14\dist\images\image1.cmp", 0, 0, 1
RasterIO2.Load LEADRasterView2.Raster, "d:\lead14\dist\images\image2.cmp", 0, 0, 1
'Save the bitmaps to a single multipage TIFF file
RasterIO1.Save LEADRasterView1.Raster, "d:\temp\combined.mpt", FILE_TIF, 24, 0, SAVE_OVERWRITE
RasterIO2.Save LEADRasterView2.Raster, "d:\temp\combined.mpt", FILE_TIF, 24, 0, SAVE_APPEND
'Get information about the images so that we can size the controls.
RasterIO1.GetFileInfo LEADRasterView1.Raster, "d:\temp\combined.mpt", 1, 0
RasterIO2.GetFileInfo LEADRasterView2.Raster, "d:\temp\combined.mpt", 2, 0
'Clear the bitmaps from memory
LEADRasterView1.Raster.Bitmap = 0
LEADRasterView2.Raster.Bitmap = 0
'Make the controls visible so that we can size and position them.
'They will not really appear until we load an image and paint it.
LEADRasterView1.Visible = True
LEADRasterView2.Visible = True
'Set the variables used for preserving the aspect ratio.
HeightFactor1 = RasterIO1.InfoHeight
WidthFactor1 = RasterIO1.InfoWidth
HeightFactor2 = RasterIO2.InfoHeight
WidthFactor2 = RasterIO2.InfoWidth
HeightAllowed = ScaleHeight * 0.8
WidthAllowed = ScaleWidth * 0.45
'Center each LEAD control on half of the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed Then
LEADRasterView1.Left = (ScaleWidth / 4) - (WidthAllowed / 2)
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor1) / WidthFactor1
LEADRasterView1.Top = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView1.Height = HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor1) / HeightFactor1
LEADRasterView1.Left = (ScaleWidth / 4) - (LEADRasterView1.Width / 2)
End If
If (WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed Then
LEADRasterView2.Left = (ScaleWidth * 3 / 4) - (WidthAllowed / 2)
LEADRasterView2.Width = WidthAllowed
LEADRasterView2.Height = (LEADRasterView2.Width * HeightFactor2) / WidthFactor2
LEADRasterView2.Top = (ScaleHeight - LEADRasterView2.Height) / 2
Else
LEADRasterView2.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView2.Height = HeightAllowed
LEADRasterView2.Width = (LEADRasterView2.Height * WidthFactor2) / HeightFactor2
LEADRasterView2.Left = (ScaleWidth * 3 / 4) - (LEADRasterView2.Width / 2)
End If
'Load the bitmaps from the multipage TIFF file
RasterIO1.Load LEADRasterView1.Raster, "d:\temp\combined.mpt", 24, 1, 1
RasterIO2.Load LEADRasterView2.Raster, "d:\temp\combined.mpt", 24, 2, 1
'Set the image display sizes to match the LEAD controls
ImageWidth1 = LEADRasterView1.ScaleWidth
ImageHeight1 = LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstRect 0, 0, ImageWidth1, ImageHeight1
LEADRasterView1.SetDstClipRect 0, 0, ImageWidth1, ImageHeight1
'Set the image display sizes to match the LEAD controls
ImageWidth2 = LEADRasterView2.ScaleWidth
ImageHeight2 = LEADRasterView2.ScaleHeight
LEADRasterView2.SetDstRect 0, 0, ImageWidth2, ImageHeight2
LEADRasterView2.SetDstClipRect 0, 0, ImageWidth2, ImageHeight2
'Display the images
LEADRasterView1.ForceRepaint
LEADRasterView2.ForceRepaint
'Set the mouse pointer back to the default
Screen.MousePointer = 0
End Sub

7.

Run your program to test it.


Drawing Simple Lines and Shapes (Visual Basic)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the LEAD Raster 3D DrawEffect Object Library (14.5) to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster 3D DrawEffect Object Library (14.5).
3. | Add the following code to the general declarations section of your project.

Public RasterFxd As LEADRasterFXD

4.

Add the following code to the end of the Form_Load event handler.

'Create the RasterFxd Object
Set RasterFxd = CreateObject("LEADRasterFXD.LEADRasterFXD.")

5.

Add the following form-level variables to the declarations procedure of the general object in your main form:

Dim DrawObject As Integer 'The object we are drawing
Dim StartX As Single 'Starting X position
Dim StartY As Single 'Starting Y position
Dim EndX As Single 'Ending X position
Dim EndY As Single 'Ending Y position

6.

Code the LEADRasterView control's MouseDown event as follows. This code selects a different drawing object each time the event occurs.

'Save the starting position.
StartX = x
StartY = y
EndX = x
EndY = y
'Cycle through the types of drawing objects.
Select Case DrawObject
Case 0
DrawObject = 1 'Line
Case 1
DrawObject = 2 'Rectangle
Case 2
DrawObject = 0 'Ellipse
Case Else
DrawObject = 0
End Select
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.DstWidth
RasterFxd.DstBottom = LEADRasterView1.DstHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.ScaleMode = 3

7.

Code the LEADRasterView control's MouseMove event as follows. This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one.

'Declare local variables.
Dim OldEndX, OldEndY
Dim OldDrawX, OldDrawY, OldWidth, OldHeight
Dim DrawX, DrawY, NewWidth, NewHeight
Dim hDC As Long
If Button = 1 Then
'Set the drawing styles.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawMode = DRAWMODE_INVERT
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_TRANSPARENT
RasterFxd.DrawPersistence = False 'On the window, not the bitmap
'Save the previous ending mouse position.
OldEndX = EndX
OldEndY = EndY
'Get the current mouse position.
EndX = x
EndY = y
'Calculate the origin of the current object.
If EndX > StartX Then
DrawX = StartX
Else
DrawX = EndX
End If
If EndY > StartY Then
DrawY = StartY
Else
DrawY = EndY
End If
'Calculate the origin of the previous object.
If OldEndX > StartX Then
OldDrawX = StartX
Else
OldDrawX = OldEndX
End If
If OldEndY > StartY Then
OldDrawY = StartY
Else
OldDrawY = OldEndY
End If
'Calculate the height and width of the current object.
NewHeight = Abs(StartY - EndY)
NewWidth = Abs(StartX - EndX)
'Calculate the height and width of the previous object.
OldHeight = Abs(StartY - OldEndY)
OldWidth = Abs(StartX - OldEndX)
'Erase the old object and draw the new one.
hDC = LEADRasterView1.GetClientDC()
Select Case DrawObject
Case 0 'Ellipse
RasterFxd.DrawEllipse Nothing, hDC, OldDrawX, OldDrawY, OldWidth, OldHeight
RasterFxd.DrawEllipse Nothing, hDC, DrawX, DrawY, NewWidth, NewHeight
Case 1 'Line
RasterFxd.DrawLine Nothing, hDC, StartX, StartY, OldEndX, OldEndY
RasterFxd.DrawLine Nothing, hDC, StartX, StartY, EndX, EndY
Case 2 'Rectangle
RasterFxd.DrawRectangle Nothing, hDC, OldDrawX, OldDrawY, OldWidth, OldHeight
RasterFxd.DrawRectangle Nothing, hDC, DrawX, DrawY, NewWidth, NewHeight
Case Else
End Select
LEADRasterView1.ReleaseClientDC
End If

8.

Code the LEADRasterView control's MouseUp event as follows. This code sets the drawing style and draws the object on the bitmap.

'Declare local variables.
Dim DrawX, DrawY, NewWidth, NewHeight
'Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawPenWidth = 2
RasterFxd.DrawPenColor = RGB(255, 0, 0) 'Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN
RasterFxd.DrawFillColor = RGB(0, 255, 0) 'Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE
RasterFxd.DrawPersistence = True 'On the bitmap
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the object.
If EndX > StartX Then
DrawX = StartX
Else
DrawX = EndX
End If
If EndY > StartY Then
DrawY = StartY
Else
DrawY = EndY
End If
'Determine the height and width of the object.
NewHeight = Abs(StartY - EndY)
NewWidth = Abs(StartX - EndX)
'Draw the object
Select Case DrawObject
Case 0 'Ellipse
RasterFxd.DrawEllipse LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight
Case 1 'Line
RasterFxd.DrawLine LEADRasterView1.Raster, 0, StartX, StartY, EndX, EndY
Case 2 'Rectangle
RasterFxd.DrawRectangle LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight
Case Else
End Select
LEADRasterView1.ForceRepaint

6.

Run your program to test it.


Cropping a Displayed Image and Copying It to a Bitmap (Visual Basic)

Cropping a Bitmap (Visual Basic)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following form-level variables to the declarations procedure of the general object in your main form:

Dim Cropping 'The state when the mouse is used for cropping
Dim StartX As Integer 'Starting X position in screen pixels
Dim StartY As Integer 'Starting Y position in screen pixels
Dim EndX As Integer 'Ending X position in screen pixels
Dim EndY As Integer 'Ending Y position in screen pixels

3. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
4. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
5. | In the Properties box, change the CommandButton control's Caption property to Select Rectangle.
6. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Command4_Click()
'Set the scale mode to twips so that we do not have to
'translate mouse coordinates
LEADRasterView1.ScaleMode = 1
'Initialize cropping so that you can do it more than once
If Cropping = True Then
'Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect LEADRasterView1.DstLeft, _
LEADRasterView1.DstTop, _
LEADRasterView1.DstWidth, _
LEADRasterView1.DstHeight
'Display the image
LEADRasterView1.ForceRepaint
End If
'Set a global variable to let other events know that you are cropping
Cropping = True
'Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2
End Sub

7.

In the LEADRasterView1 control's MouseDown procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
'Save the starting position
StartX = x
StartY = y
'Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = False
End Sub

8.

In the LEADRasterView1 control's MouseMove procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseMove (ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim rbX, rbY, rbWidth, rbHeight
If Cropping = True And Button = 1 Then
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
If EndX > StartX Then
rbX = StartX
Else
rbX = EndX
End If
If EndY > StartY Then
rbY = StartY
Else
rbY = EndY
End If
'Determine the height and width of the rubberband rectangle
rbHeight = Abs(StartY - EndY)
rbWidth = Abs(StartX - EndX)
'Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect rbX, rbY, rbWidth, rbHeight
'Alternatively, you could use the following properties to set the
'rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight
LEADRasterView1.RubberBandLeft = rbX
LEADRasterView1.RubberBandTop = rbY
LEADRasterView1.RubberBandWidth = rbWidth
'Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = True
End If
End Sub

9.

In the LEADRasterView1 control's MouseUp procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseUp (ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim CropLeft, CropTop, CropWidth, CropHeight
If Cropping = True Then
'Get the current mouse position
EndX = x
EndY = y
'Get the origin of the clipping rectangle.
'Allow for different mouse drag directions
If StartX < EndX Then
CropLeft = StartX
Else
CropLeft = EndX
End If
If StartY < EndY Then
CropTop = StartY
Else
CropTop = EndY
End If
'Get the height and width of the cropped area
CropWidth = Abs(EndX - StartX)
CropHeight = Abs(EndY - StartY)
'Crop and repaint the image
LEADRasterView1.SetDstClipRect CropLeft, CropTop, CropWidth, CropHeight
LEADRasterView1.ForceRepaint
LEADRasterView1.RubberBandVisible = False
LEADRasterView1.MousePointer = 0 'Default
End If
End Sub

10. | Select the CommandButton control; then add another control to your main form. Put the control at the top of the form to keep it away from the image.
11. | In the Properties box, change the CommandButton control's Caption property to Trim. This command button will be used to trim the bitmap in memory and redisplay the bitmap.
12. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Command5_Click()
Dim XFactor, YFactor
Dim NewLeft, NewTop, NewWidth, NewHeight
Dim HeightFactor, WidthFactor
Dim HeightAllowed, WidthAllowed
Dim RasterProc As New LEADRasterProcess
Screen.MousePointer = 11 'hourglass
'Use the clipping rectangle's percentage offsets in the image rectangle
'to determine the trimmed rectangle in the bitmap.
'Using percentages allows for the possibility that the image is zoomed.
XFactor = LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.DstWidth
YFactor = LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.DstHeight
NewTop = (LEADRasterView1.DstClipTop - LEADRasterView1.DstTop) * YFactor
NewLeft = (LEADRasterView1.DstClipLeft - LEADRasterView1.DstLeft) * XFactor
NewWidth = LEADRasterView1.DstClipWidth * XFactor
NewHeight = LEADRasterView1.DstClipHeight * YFactor
'Make sure display rectangles are automatically adjusted.
LEADRasterView1.AutoSetRects = True
'Trim the bitmap.
RasterProc.Trim LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight
'Size and redisplay the control, using the new bitmap size.
'Set the variables used for preserving the aspect ratio.
'Allow for a border of 1/8 of the form size.
'The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
HeightAllowed = ScaleHeight - (ScaleHeight / 4)
WidthAllowed = ScaleWidth - (ScaleWidth / 4)
'Center the LEAD control on the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
LEADRasterView1.Left = ScaleWidth / 8
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor
LEADRasterView1.Top = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.Top = ScaleHeight / 8
LEADRasterView1.Height= HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor
LEADRasterView1.Left = (ScaleWidth - LEADRasterView1.Width) / 2
End If
'Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll = False
'Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
'Display the image
LEADRasterView1.ForceRepaint
Screen.MousePointer = 0 'Default
End Sub

13.

Run your program to test it.


Cropping a Bitmap 2 (Visual Basic)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following form-level variables to the declarations procedure of the general object in your main form:

Dim Cropping 'The state when the mouse is used for cropping
Dim StartX As Integer 'Starting X position in screen pixels
Dim StartY As Integer 'Starting Y position in screen pixels
Dim EndX As Integer 'Ending X position in screen pixels
Dim EndY As Integer 'Ending Y position in screen pixels

3. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
4. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
5. | In the Properties box, change the CommandButton control's Caption property to Select Rectangle.
6. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Command4_Click()
LEADRasterView1.EnableFireMouse2Event = True
'Set the scale mode to twips so that we do not have to
'translate mouse coordinates
LEADRasterView1.ScaleMode = 3
'Initialize cropping so that you can do it more than once
If Cropping = True Then
'Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect LEADRasterView1.DstLeft, _
LEADRasterView1.DstTop, _
LEADRasterView1.DstWidth, _
LEADRasterView1.DstHeight
'Display the image
LEADRasterView1.ForceRepaint
End If
'Set a global variable to let other events know that you are cropping
Cropping = True
'Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2
End Sub

7.

In the LEADRasterView1 control's MouseDown2 procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseDown2(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
'Save the starting position
StartX = x
StartY = y
'Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = False
End Sub

8.

In the LEADRasterView1 control's MouseMove2 procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseMove2(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim rbX, rbY, rbWidth, rbHeight
If Cropping = True And Button = 1 Then
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
If EndX > StartX Then
rbX = StartX
Else
rbX = EndX
End If
If EndY > StartY Then
rbY = StartY
Else
rbY = EndY
End If
'Determine the height and width of the rubberband rectangle
rbHeight = Abs(StartY - EndY)
rbWidth = Abs(StartX - EndX)
'Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect rbX, rbY, rbWidth, rbHeight
'Alternatively, you could use the following properties to set the
'rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight
LEADRasterView1.RubberBandLeft = rbX
LEADRasterView1.RubberBandTop = rbY
LEADRasterView1.RubberBandWidth = rbWidth
'Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = True
End If
End Sub

9.

In the LEADRasterView1 control's MouseUp2 procedure, add the following code. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub LEADRasterView1_MouseUp2(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim CropLeft, CropTop, CropWidth, CropHeight
If Cropping = True Then
'Get the current mouse position
EndX = x
EndY = y
'Get the origin of the clipping rectangle.
'Allow for different mouse drag directions
If StartX < EndX Then
CropLeft = StartX
Else
CropLeft = EndX
End If
If StartY < EndY Then
CropTop = StartY
Else
CropTop = EndY
End If
'Get the height and width of the cropped area
CropWidth = Abs(EndX - StartX)
CropHeight = Abs(EndY - StartY)
'Crop and repaint the image
LEADRasterView1.SetDstClipRect CropLeft, CropTop, CropWidth, CropHeight
LEADRasterView1.ForceRepaint
LEADRasterView1.RubberBandVisible = False
LEADRasterView1.MousePointer = 0 'Default
End If
End Sub

10. | Select the CommandButton control; then add another control to your main form. Put the control at the top of the form to keep it away from the image.
11. | In the Properties box, change the CommandButton control's Caption property to Trim. This command button will be used to trim the bitmap in memory and redisplay the bitmap.
12. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Command5_Click()
Dim XFactor, YFactor
Dim NewLeft, NewTop, NewWidth, NewHeight
Dim HeightFactor, WidthFactor
Dim HeightAllowed, WidthAllowed
Dim RasterProc As New LEADRasterProcess
Screen.MousePointer = 11 'hourglass
'Use the clipping rectangle's percentage offsets in the image rectangle
'to determine the trimmed rectangle in the bitmap.
'Using percentages allows for the possibility that the image is zoomed.
XFactor = LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.DstWidth
YFactor = LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.DstHeight
NewTop = (LEADRasterView1.DstClipTop - LEADRasterView1.DstTop) * YFactor
NewLeft = (LEADRasterView1.DstClipLeft - LEADRasterView1.DstLeft) * XFactor
NewWidth = LEADRasterView1.DstClipWidth * XFactor
NewHeight = LEADRasterView1.DstClipHeight * YFactor
'Make sure display rectangles are automatically adjusted.
LEADRasterView1.AutoSetRects = True
'Trim the bitmap.
RasterProc.Trim LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight
'Size and redisplay the control, using the new bitmap size.
'Set the variables used for preserving the aspect ratio.
'Allow for a border of 1/8 of the form size.
'The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
HeightAllowed = ScaleHeight - (ScaleHeight / 4)
WidthAllowed = ScaleWidth - (ScaleWidth / 4)
'Center the LEAD control on the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
LEADRasterView1.Left = ScaleWidth / 8
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor
LEADRasterView1.Top = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.Top = ScaleHeight / 8
LEADRasterView1.Height= HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor
LEADRasterView1.Left = (ScaleWidth - LEADRasterView1.Width) / 2
End If
'Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll = False
'Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
'Display the image
LEADRasterView1.ForceRepaint
Screen.MousePointer = 0 'Default
End Sub

13.

Run your program to test it.


Creating, Viewing, and Merging Color Separations (Visual Basic)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
3. | In the Properties box, change the CommandButton control's Caption property to Do Separations.
4. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
5. | Add the following code to the general declarations section of your project.

Public RasterProc As LEADRasterProcess

6.

Add the following code to the end of the Form_Load event handler.

'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")

7.

Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Sub Command6_Click ()
Dim msg As String
' Count the button clicks and take the next step with each click
Static ClickCount As Integer
MousePointer = 11 ' hourglass
'Turn off the automatic display rectangles.
LEADRasterView1.AutoSetRects = False
LEADRasterView1.Raster.RefBitmap = False
Select Case ClickCount
Case 0
RasterProc.ColorSeparate LEADRasterView1.Raster, COLORSEP_CMYK
'Just for fun, add contrast to the K plane
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(3) 'Copy the K plane
RasterProc.Contrast LEADRasterView1.Raster, 300 'Increase the contrast
RasterProc.ColorPlanes(3) = LEADRasterView1.Raster.Bitmap 'Update the K plane
msg = "Separated. Keep clicking to see separations, then merge"
MsgBox msg
Case 1
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(0) 'Cyan
LEADRasterView1.ForceRepaint
Case 2
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(1) ' Magenta
LEADRasterView1.ForceRepaint
Case 3
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(2) ' Yellow
LEADRasterView1.ForceRepaint
Case 4
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(3) ' K
LEADRasterView1.ForceRepaint
Case 5
RasterProc.ColorMerge LEADRasterView1.Raster, COLORSEP_CMYK
LEADRasterView1.ForceRepaint
RasterProc.ColorPlanes(0) = 0
RasterProc.ColorPlanes(1) = 0
RasterProc.ColorPlanes(2) = 0
RasterProc.ColorPlanes(3) = 0
msg = "Merged, with more contrast in the K plane"
MsgBox msg
Case Else
ClickCount = -1
msg = "Cycle is finished"
MsgBox msg
End Select
ClickCount = ClickCount + 1
MousePointer = 0 ' default
End Sub

8.

Run your program to test it. Notice that you can click the button several times to create the separations, view each of them, and merge them to recreate the original bitmap.


Updating a Gauge and Detecting a User Interrupt (Visual Basic)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
3. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
4. | In the Properties box, change the CommandButton control's Caption property to Do Median.
5. | Select the CommandButton control; then add another control to your main form. Put the control at the top of the form to keep it away from the image.
6. | In the Properties box, change the CommandButton control's Caption property to Quit.
7. | Build a gauge consisting of a horizontal line [image] (Line1) inside a rectangle [image] (Shape1). Put the gauge at the top of the form next to the Quit button.
8. | Add the following code to the general declarations:

Dim fEscape As Integer 'Use to indicate the user interrupt
Dim fInProc As Integer 'Use to avoid closing the form during processing
Public WithEvents RasterProc As LEADRasterProcess

9.

Now, add the following to the Form's Load event to create the ILEADRasterProcess object

'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")

10.

Add the following code to the first CommandButton control's Click procedure:

Private Sub Command1_Click ()
'Enable the ProgressStatus event
RasterProc.EnableProgressEvent = True
'Initialize the indicators
fEscape = False 'The user does not want to quit
fInProc = True 'Processing is taking place
'Perform a relatively slow median filter
RasterProc.Median LEADRasterView1.Raster, 4
'Clean up
fInProc = False 'Processing is no longer taking place
LEADRasterView1.ForceRepaint
End Sub

11.

Add the following code to handle the RasterProc object's ProgressStatus procedure:

RasterProc_ProgressStatus(ByVal iPercent As Integer)
Dim LineLength
DoEvents 'Detect Windows events
If Not fEscape Then ' Look for the Click on the Quit button
LineLength = Form1.Shape1.Width * iPercent / 100 'Udpate the gauge
Me.Line1.X1 = Me.Shape1.Left
Me.Line1.X2 = Me.Line1.X1 + LineLength
Else
RasterProc.EnableProgressEvent = False 'Cancel the task
End If
End Sub

12.

Add the following code to the second CommandButton control's Click procedure:

Private Sub Command2_Click ()
fEscape = True 'The user wants to quit
Me.Line1.X2 = Me.Line1.X1 'Set the gauge back to the beginning
End Sub

13.

Add the following code to the main form's QueryUnload procedure:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If fInProc Then 'If processing is taking place
Cancel = 1 'Do not let the user close the form
End If
End Sub

14.

Run your program to test it.


Using the Magnifying Glass (Visual Basic)

Take the following steps to enable the generation of the MagGlassExt event and update the zoomed image using the LEADTOOLS Internet toolkit.

1. | Start Visual Basic. Select Standard EXE and click Open.
2. | Add the LEAD RasterView Control (14.5) to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Internet Object Library (14.5) to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Internet Object Library (14.5).
4. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
5. | Add the LEAD RasterIO Object Library to your project..
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
6. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
7. | Add seven command buttons to your main form and name them as follows:

 | Name | Caption
 | StartUpServer | Start Up Server
 | ShutDownServer | Shut Server Down
 | ConnectToRemoteServer | Connect To Remote Server
 | DisconnectFromRemoteServer | Disconnect From Remote Server
 | LoadRemoteImage | Load Remote Image
 | StartMagnifyingGlass | Start Magnifying Glass
 | StopMagnifyingGlass | Stop Magnifying Glass
8. | Add a Text box to your main form and name it as follows:
 | Name
 | RemoteComputer.
9. | Set the Text property to the name of the computer you will use as a server, or set it to 10.0.32.241.
10. | Define the following global variables:

Dim hServer As Integer ' handle to server

Dim gnCommandID As Long

Dim bMagGlass As Boolean

Public WithEvents RasterIO As LEADRasterIO

Public WithEvents LEADNet1 As LEADRasterInet

11.

Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Dim Factory As New LEADRasterFactory
Dim LEADRaster As LEADRaster
Dim szLic As String

' Initialize some variables
hServer = 0
gnCommandID = 0
bMagGlass = False

' Set defaults for displaying the image.
' These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = APPEARANCE_FLAT
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

' Create the Raster IO and Raster Inet objects
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO")
Set LEADNet1 = CreateObject("LEADRasterInet.LEADRasterInet")

' Create a temp LEADRaster object and use it
' to unlock support for the Inet object
szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LEADRaster = Factory.CreateObject("LEADRaster.LEADRaster", szLic)
LEADRaster.UnlockSupport L_SUPPORT_INTERNET, "TestKey"

' Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
' RasterIO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1.EnableMethodErrors = False
RasterIO.EnableMethodErrors = False
LEADNet1.EnableMethodErrors
   = False
End Sub

12.

Code the main form's Form_Unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
Dim num As Integer

' Disconnect all connections
num = LEADNet1.ConnectListNum
For i = 0 To LEADNet1.ConnectListNum - 1
LEADNet1.InetDisconnect
  LEADNet1.ConnectList(i)
Next i

If bMagGlass Then
LEADRasterView1.StopMagGlass
End If
End Sub

13.

Code the StartUpServer button's click procedure as follows:

Private Sub StartUpServer_Click()

    Dim nRet As Integer

' Initialize server on port 1000
nRet = LEADNet1.InetServerInit
 ( 1000)
HServer = LEADNet1.InetServerHandle

If nRet <> 0 Then
MsgBox "Error Initializing server: " + CStr(nRet)
End If
End Sub

14.

Code the ShutDownServer button's click procedure as follows:

Private Sub ShutDownServer_Click()
Dim nRet As Integer

If hServer <> 0 Then
nRet = LEADNet1.InetServerClose (hServer)

If nRet <> 0 Then
MsgBox "Error Shutting Down server: " + CStr(nRet)
Else
hServer = 0
End If
End If
End Sub

15.

Code the LEADNet1_InetAccept event as follows:

Private Sub LEADNet1_InetAccept (ByVal iServer As Integer)
Dim hComputer As Integer
Dim hName As String

nRet = LEADNet1.InetAcceptConnect (hServer)
hComputer = LEADNet1.InetConnectedComputer

If nRet <> 0 Then
MsgBox "Error accepting connection: " + CStr(nRet)
Exit Sub
End If

LEADNet1.InetGetHostName hComputer, HOST_NAME_DESCRP
hName = LEADNet1.InetHostName
' Add to our list
LEADNet1.SendList (LEADNet1.SendListNum ) = hComputer
MsgBox "Connection accepted from: " + hName
End Sub

16.

Code the ConnectToRemoteServer button's click procedure as follows:

Private Sub ConnectToRemoteServer_Click()
Dim nRet As Integer

' Connect to remote computer on port 1000
nRet = LEADNet1.InetConnect (RemoteComputer.Text, 1000)

If nRet <> 0 Then
MsgBox "Error connecting to " + RemoteComputer.Text + ": " + CStr(nRet)
End If
End Sub

17.

Code the DisconnectFromRemoteServer button's click procedure as follows:

Private Sub DisconnectFromRemoteServer_Click()
Dim nRet As Integer

' We are assuming only one connection in this example.
' Therefore, the handle to the remote computer will be
' in the first position in the SendList
nRet = LEADNet1.InetDisconnect (LEADNet1.SendList (0))

If nRet <> 0 Then
MsgBox "Error disconnecting from remote: " + CStr(nRet)
End If
End Sub

18.

Code the LEADNet1_InetConnected event as follows:

Private Sub LEADNet1_InetConnected (ByVal iComputer As Integer)
Dim sRemote As String

' Get remote host name
LEADNet1.InetGetHostName iComputer, HOST_NAME_DESCRP
SRemote = LEADNet1.InetHostName

' Add this connection to our SendList
LEADNet1.SendList (LEADNet1.SendListNum ) = iComputer
MsgBox "Successfully connected to remote computer: " + sRemote
End Sub

19.

Code the LEADNet1_InetDisconnected event as follows:

Private Sub LEADNet1_InetDisconnected (ByVal iComputer As Integer)
If hServer = 0 Then
MsgBox "Disconnect from remote server"
Else
MsgBox "Connection to remote computer closed"
End If
End Sub

20.

Code the LoadRemoteImage button's click procedure as follows:

Private Sub LoadRemoteImage_Click()
Dim nRet As Integer

nRet = LEADNet1.InetSendLoadCmd
 (999, "v:\images\eagle.cmp", 0, 1)

If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendLoadCmd."
End If
End Sub

21.

Code the StartMagnifyingGlass button's click procedure as follows:

Private Sub StartMagnifyingGlass_Click()
Dim nRet As Integer

If LEADRasterView1.Raster.Bitmap <> 0 And hServer = 0 Then
' Enable MagGlassExt event.
If LEADRasterView1.EnableMagGlassEvent = False Then
LEADRasterView1.EnableMagGlassEvent = True
End If

LEADRasterView1.RgnFrameType = 0

' Start the Magnifying Glass
nRet = LEADRasterView1.StartMagGlass(100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True)

If nRet = 0 Then
bMagGlass = True
End If
End If
End Sub

22.

Code the StopMagnifyingGlass button's click procedure as follows:

Private Sub StopMagnifyingGlass_Click()
Dim nRet As Integer

If LEADRasterView1.Raster.Bitmap <> 0 And hServer = 0 Then
nRet = LEADRasterView1.StopMagGlass

If nRet = 0 Then
bMagGlass = False
End If
End If
End Sub

23.

Code the LEADRasterView1_MagGlassExt event as follows:

Private Sub LEADRasterView1_MagGlassExt(ByVal nMaskPlaneStart As Long, ByVal nMaskPlaneEnd As Long, ByVal vMaskPlane As LEADRasterVariant)
Dim nRet As Integer

gnCommandID = gnCommandID + 1

nRet = LEADNet1.InetSendGetMagGlassDataCmd (gnCommandID, 0, (vMaskPlane), nMaskPlaneStart, nMaskPlaneEnd)

If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendGetMagGlassDataCmd."
End If
End Sub

24.

Code the LEADNet1_InetReceiveCmd event as follows:

Private Sub LEADNet1_InetReceiveCmd (ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nStatus As Integer
Dim vColorBuffer As LEADRasterVariant

nStatus = ERROR_FEATURE_NOT_SUPPORTED

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_LOAD
' check the validity of the parameters
If ((Params.ParamCount = 4) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_UINT32)) Then
nStatus = RasterIO.Load(LEADRasterView1.Raster, Params.ParamValue(0).StringValue, Params.ParamValue(1).LongValue, 1, 1)

If nStatus <> 0 Then
MsgBox "Load Bitmap failed with error code: " & CStr(nRet)
Else
nStatus = LEADNet1.InetSendBitmap (LEADRasterView1.Raster, FILE_CMP, 0, QFACTOR_PQ2)

If nStatus <> 0 Then
MsgBox "SendBitmap failed with error code: " & CStr(nRet)
End If
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameters
End If

LEADNet1.InetSendLoadRsp nCommandID, 0, 0, Null, nStatus
Exit Sub

Case INETCMD_GET_MAGGLASS_DATA
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_UINT32) And (Params.ParamType(2) = PARAM_TYPE_USTRING) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
If LEADRasterView1.Raster.Bitmap <> 0 Then
nStatus = LEADNet1.InetGetMagGlassData (LEADRasterView1.Raster, vColorBuffer, Params.ParamValue(2).StringValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue)

If nStatus <> 0 Then
MsgBox "InetGetMagGlassData failed with error code: " & CStr(nStatus)
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameter
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameters
End If

LEADNet1.InetSendGetMagGlassDataRsp nCommandID, vColorBuffer.StringValue, Params.ParamValue(2).StringValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue, 0, Null, nStatus
Exit Sub
End Select
End If

LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub

25.

Code the LEADNet1_InetReceiveRsp event as follows:

Private Sub LEADNet1_InetReceiveRsp (ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal nStatus As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer

If (nError <> 0) Then Exit Sub

Select Case InetCommand
Case INETCMD_LOAD:
If nStatus <> 0 Then
MsgBox "Load failed with error code: " + CStr(nStatus)
End If

Case INETCMD_GET_MAGGLASS_DATA
If (nStatus = 0) Then
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_USTRING) And (Params.ParamType(2) = PARAM_TYPE_UINT32) _
And (Params.ParamType(3) = PARAM_TYPE_USTRING) And (Params.ParamType(4) = PARAM_TYPE_INT32)) _
And (Params.ParamType(5) = PARAM_TYPE_INT32) Then

nRet = LEADRasterView1.UpdateMagGlass(CVar(Params.ParamValue(1)), CVar(Params.ParamValue(3)), Params.ParamValue(4), Params.ParamValue(5), True)

If (nRet <> 0) Then
MsgBox "UpdateMagGlass failed with error code: " & CStr(nRet)
End If
Else
MsgBox "Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response"
End If
Else
MsgBox "Get MagGlass Data from server with error code " & CStr(nStatus)
End If
End Select
End Sub

26.

Code the LEADNet1_InetReceiveBitmap event as follows:

Private Sub LEADNet1_InetReceiveBitmap (ByVal iComputer As Integer, ByVal hBitmap As Long)
LEADRasterView1.Raster.Bitmap = hBitmap
End Sub

27. | On the main menu, select File > Make .exe, specify a path for the exe file then press OK.
28. | Run the exe file two times to execute two applications.
29. | In the first application press Start Up Server button.
30. | In the second application fill the edit box with the IP address of the remote computer on which you started the first application as a server. Then, press the Connect To Remote Server button to connect to the specified address.
31. | Next, press the Load Remote Image button of application number two to load an image on the server. Then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support. Press the left mouse button and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using the Magnifying Glass (2) (Visual Basic)

Take the following steps to enable the generation of the MagGlassExt2 event and update the zoomed image using the LEADTOOLS Internet toolkit.

1. | Start Visual Basic. Select Standard EXE and click Open.
2. | Add the LEAD RasterView Control (14.5) to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD Raster Internet Object Library (14.5) to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Internet Object Library (14.5).
4. | Add the LEAD Raster Object Library (14.5) to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
5. | Add the LEAD RasterIO Object Library (14.5) to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
6. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
7. | Add seven command buttons to your main form and name them as follows:

 | Name | Caption
 | StartUpServer | Start Up Server
 | ShutDownServer | Shut Server Down
 | ConnectToRemoteServer | Connect To Remote Server
 | DisconnectFromRemoteServer | Disconnect From Remote Server
 | LoadRemoteImage | Load Remote Image
 | StartMagnifyingGlass | Start Magnifying Glass
 | StopMagnifyingGlass | Stop Magnifying Glass
8. | Add a Text box to your main form and name it as follows:
 | Name
 | RemoteComputer
9. | Set the Text property to the name of the computer you will use as a server, or set it to 10.0.32.241.
10. | Define the following global variables:

Dim hServer As Integer ' handle to server
Dim gnCommandID As Long
Dim bMagGlass As Boolean
Public WithEvents RasterIO As LEADRasterIO
Public WithEvents LEADNet1 As LEADRasterInet

11.

Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Dim Factory As New LEADRasterFactory
Dim LEADRaster As LEADRaster
Dim szLic As String

' Initialize some variables
hServer = 0
gnCommandID = 0
bMagGlass = False

' Set defaults for displaying the image.
' These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = 1
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

' Create the Raster IO and Raster Inet objects
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO")
Set LEADNet1 = CreateObject("LEADRasterInet.LEADRasterInet")

' Create a temp LEADRaster object and use it
' to unlock support for the Inet object
szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LEADRaster = Factory.CreateObject("LEADRaster.LEADRaster", szLic)
LEADRaster.UnlockSupport L_SUPPORT_LTPRO, "TestKey"

' Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
' RasterIO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1.EnableMethodErrors = False
RasterIO.EnableMethodErrors = False
LEADNet1.EnableMethodErrors
   = False
End Sub

12.

Code the main form's Form_Unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
Dim num As Integer

' Disconnect all connections
num = LEADNet1.ConnectListNum
For i = 0 To LEADNet1.ConnectListNum – 1
LEADNet1.InetDisconnect LEADNet1.ConnectList (i)
Next I

If bMagGlass Then
LEADRasterView1.StopMagGlass
End If
End Sub

13.

Code the StartUpServer button's click procedure as follows:

Private Sub StartUpServer_Click()
Dim nRet As Integer

' Initialize server on port 1000
nRet = LEADNet1.InetServerInit
  (1000)
hServer = LEADNet1.InetServerHandle

If nRet <> 0 Then
MsgBox "Error Initializing server: " + CStr(nRet)
End If
End Sub

14.

Code the ShutDownServer button's click procedure as follows:

Private Sub ShutDownServer_Click()
Dim nRet As Integer

If hServer <> 0 Then
nRet = LEADNet1.InetServerClose (hServer)

If nRet <> 0 Then
MsgBox "Error Shutting Down server: " + CStr(nRet)
Else
hServer = 0
End If
End If
End Sub

15.

Code the LEADNet1_InetAccept event as follows:

Private Sub LEADNet1_InetAccept (ByVal iServer As Integer)
Dim hComputer As Integer
Dim hName As String
Dim nRet As Integer

nRet = LEADNet1.InetAcceptConnect (hServer)
hComputer = LEADNet1.InetConnectedComputer

If nRet <> 0 Then
MsgBox "Error accepting connection: " + CStr(nRet)
Exit Sub
End If

LEADNet1.InetGetHostName hComputer, HOST_NAME_DESCRP
hName = LEADNet1.InetHostName
' Add to our list
LEADNet1.SendList (LEADNet1.SendListNum ) = hComputer
MsgBox "Connection accepted from: " + hName
End Sub

16.

Code the ConnectToRemoteServer button's click procedure as follows:

Private Sub ConnectToRemoteServer_Click()
Dim nRet As Integer

' Connect to remote computer on port 1000
nRet = LEADNet1.InetConnect (RemoteComputer.Text, 1000)

If nRet <> 0 Then
MsgBox "Error connecting to " + RemoteComputer.Text + ": " + CStr(nRet)
End If
End Sub

17.

Code the DisconnectFromRemoteServer button's click procedure as follows:

Private Sub DisconnectFromRemoteServer_Click()
Dim nRet As Integer

' We are assuming only one connection in this example.
' Therefore, the handle to the remote computer will be
' in the first position in the SendList
nRet = LEADNet1.InetDisconnect (LEADNet1.SendList (0))

If nRet <> 0 Then
MsgBox "Error disconnecting from remote: " + CStr(nRet)
End If
End Sub

18.

Code the LEADNet1_InetConnected event as follows:

Private Sub LEADNet1_InetConnected (ByVal iComputer As Integer)
Dim sRemote As String

' Get remote host name
LEADNet1.InetGetHostName iComputer, HOST_NAME_DESCRP
sRemote = LEADNet1.InetHostName

' Add this connection to our SendList
LEADNet1.SendList (LEADNet1.SendListNum ) = iComputer
MsgBox "Successfully connected to remote computer: " + sRemote
End Sub

19.

Code the LEADNet1_InetDisconnected event as follows:

Private Sub LEADNet1_InetDisconnected (ByVal iComputer As Integer)
If hServer = 0 Then
MsgBox "Disconnect from remote server"
Else
MsgBox "Connection to remote computer closed"
End If
End Sub

20.

Code the LoadRemoteImage button's click procedure as follows:

Private Sub LoadRemoteImage_Click()
Dim nRet As Integer

nRet = LEADNet1.InetSendLoadCmd
  (999, "v:\images\eagle.cmp", 0, 1)

If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendLoadCmd."
End If
End Sub

21.

Code the StartMagnifyingGlass button's click procedure as follows:

Private Sub StartMagnifyingGlass_Click()
Dim nRet As Integer

If LEADRasterView1.Raster.Bitmap <> 0 And hServer = 0 Then
' Enable MagGlassExt event.
If LEADRasterView1.EnableMagGlassEvent = False Then
LEADRasterView1.EnableMagGlassEvent = True
End If

LEADRasterView1.RgnFrameType = 0

' Start the Magnifying Glass
nRet = LEADRasterView1.StartMagGlass(100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True)

If nRet = 0 Then
bMagGlass = True
End If
End If
End Sub

22.

Code the StopMagnifyingGlass button's click procedure as follows:

Private Sub StopMagnifyingGlass_Click()
Dim nRet As Integer

If LEADRasterView1.Raster.Bitmap <> 0 And hServer = 0 Then
nRet = LEADRasterView1.StopMagGlass

If nRet = 0 Then
bMagGlass = False
End If
End If
End Sub

23.

Code the LEADRasterView1_MagGlassExt2 event as follows:

Private Sub LEADRasterView1_MagGlassExt2(ByVal nMaskPlaneStart As Long, ByVal nMaskPlaneEnd As Long, ByVal vMaskPlane As Variant)
Dim nRet As Integer

gnCommandID = gnCommandID + 1

nRet = LEADNet1.InetSendGetMagGlassDataCmd2 (gnCommandID, 0, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendGetMagGlassDataCmd."
End If
End Sub

24.

Code the LEADNet1_InetReceiveCmd2 event as follows:

Private Sub LEADNet1_InetReceiveCmd2 (ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nStatus As Integer
Dim vColorBuffer As Variant
Dim nRet As Integer

nStatus = ERROR_FEATURE_NOT_SUPPORTED

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_LOAD
' check the validity of the parameters
If ((Params.ParamCount = 4) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_UINT32)) Then
nStatus = RasterIO.Load(LEADRasterView1.Raster, Params.ParamValue(0), Params.ParamValue(1), 1, 1)

If nStatus <> 0 Then
MsgBox "Load Bitmap failed with error code: " & CStr(nRet)
Else
nStatus = LEADNet1.InetSendBitmap (LEADRasterView1.Raster, FILE_CMP, 0, QFACTOR_PQ2)

If nStatus <> 0 Then
MsgBox "SendBitmap failed with error code: " & CStr(nRet)
End If
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameters
End If

LEADNet1.InetSendLoadRsp2 nCommandID, 0, 0, Null, nStatus
Exit Sub
Case INETCMD_GET_MAGGLASS_DATA
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_UINT32) And (Params.ParamType(2) = PARAM_TYPE_USTRING) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
If LEADRasterView1.Raster.Bitmap <> 0 Then
nStatus = LEADNet1.InetGetMagGlassData2 (LEADRasterView1.Raster, vColorBuffer, CVar(Params.ParamValue2(2)), Params.ParamValue2(3), Params.ParamValue2(4))
If nStatus <> 0 Then
MsgBox "InetGetMagGlassData failed with error code: " & CStr(nStatus)
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameter
End If
Else
nStatus = ERROR_INV_PARAMETER ' Invalid parameters
End If

LEADNet1.InetSendGetMagGlassDataRsp2 nCommandID, CVar(vColorBuffer), CVar(Params.ParamValue2(2)), Params.ParamValue2(3), Params.ParamValue2(4), 0, Null, nStatus
Exit Sub
End Select
End If
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub

25.

Code the LEADNet1_InetReceiveRsp2 event as follows:

Private Sub LEADNet1_InetReceiveRsp2 (ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal nStatus As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer

If (nError <> 0) Then Exit Sub

Select Case InetCommand
Case INETCMD_LOAD:
If nStatus <> 0 Then
MsgBox "Load failed with error code: " + CStr(nStatus)
End If
Case INETCMD_GET_MAGGLASS_DATA
If (nStatus = 0) Then
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_USTRING) And (Params.ParamType(2) = PARAM_TYPE_UINT32) _
And (Params.ParamType(3) = PARAM_TYPE_USTRING) And (Params.ParamType(4) = PARAM_TYPE_INT32)) _
And (Params.ParamType(5) = PARAM_TYPE_INT32) Then
nRet = LEADRasterView1.UpdateMagGlass2(CVar(Params.ParamValue2(1)), CVar(Params.ParamValue2(3)), Params.ParamValue2(4), Params.ParamValue2(5), True)

If (nRet <> 0) Then
MsgBox "UpdateMagGlass failed with error code: " & CStr(nRet)
End If
Else
MsgBox "Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response"
End If
Else
MsgBox "Get MagGlass Data from server with error code " & CStr(nStatus)
End If
End Select
End Sub

26.

Code the LEADNet1_InetReceiveBitmap event as follows:

Private Sub LEADNet1_InetReceiveBitmap (ByVal iComputer As Integer, ByVal hBitmap As Long)
LEADRasterView1.Raster.Bitmap = hBitmap
End Sub

27. | On the main menu, select File > Make .exe, specify a path for the exe file then press OK.
28. | Run the exe file two times to execute two applications.
29. | In the first application press Start Up Server button.
30. | In the second application fill the edit box with the IP address of the remote computer on which you started the first application as a server. Then, press the Connect To Remote Server button to connect to the specified address.
31. | Next, press the Load Remote Image button of application number two to load an image on the server. Then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support. Press the left mouse button and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using a PanWindow (Visual Basic)

1. | Start Visual Basic. Select Standard EXE and click Open.
2. | Add the LEAD Raster View Control and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD Raster View Control (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
3. | Select the LEAD RasterView Control and add the control to your main form. Size and position the control as you want it to appear at run time. You may want to size it small so you can observe the changes that occur as you move the PanWin rect
4. | Add an Option Button to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | Check1 | Pan Window
5. | Add a Command Button to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | PanWindow | Show Pan Window
6. | Add the LEAD RasterIO Object to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
7. | Code the Form_Load procedure as follows:

Private Sub Form_Load()
Dim RasterIO As New LEADRasterIO
'change the path and filename to something present on your system.
RasterIO.Load LEADRasterView1.Raster, "d:\temp\24bit.bmp", 0, 0, 1
End Sub

8.

Code the PanWindow_Click() procedure as follows:

Private Sub PanWindow_Click()
With LEADRasterView1
.BackErase = False
'set the location of the PanWindow
.PanWinX = 100
.PanWinY = 100
'set the size of the PanWindow
'requested width
.PanWinWidth= 150
'requested height
.PanWinHeight = 200
'use the icon already being used for LEADRasterView1.
.PanWinIcon = Icon
'set custom pointer
.PanWinPointer = 99
'use an ICO file present on your system
.PanWinCursor = LoadPicture("d:\temp\snow.ico")
.PanWinTitle = "PanWindow"
.PanWinRectColor = RGB(0, 0, 255)
.PanWinSysMenu = True
'use the settings for LEADRasterView1.
.PanWinPaintPalette = .PaintPalette
.PanWinBitonalScaling = .BitonalScaling
.PanWinPaintScaling = .PaintScaling
.PanWinPaintDither = .PaintDither
'show the Pan Window
.ShowPanWin True
End With
Check1.Value = 1
End Sub

9.

Code the LEADRasterView1_PanWin procedure as follows:

Private Sub LEADRasterView1_PanWin(ByVal hPanWin As Long, ByVal iFlag As Integer)
If (iFlag = PANWIN_DESTROYED) Then
Check1.Value = False 'indicate no more Pan Window
End If
End Sub

10.

Run your program to test it.


Print a Real Image Size in Inches (Visual Basic)

Take the following steps to start a project and to add some code that prints an image:

1. | Start Visual Basic.
2. | Add the LEAD RasterView Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.5).
3. | Add the LEAD RasterIO Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
5. | Add the following variables to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Dim fRealWidth As Double ' Image real width in inches
Dim fRealHeight As Double ' Image real height in inches
Dim fPrnDPIX As Double ' Number of pixels per logical inch along the screen width
Dim fPrnDPIY As Double ' Number of pixels per logical inch along the screen height
Dim hdc As Long
Dim LEADRstIO As New LEADRasterIO

6.

Add the following code to the main form's Load procedure to load the image. Suppose to you have an image somewhere, then load it:

LEADRstIO.Load LEADRasterView1.Raster, "c:\image1.cmp", 0, 0, 1

7.

You should now calculate the real width and height of the bitmap in inches. Add the following code to the main form's Load procedure:

fRealWidth = LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.Raster.BitmapXRes
fRealHeight = LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.Raster.BitmapYRes

8.

Now you are ready to print the image with real size in inches. Add the following code to the main form's Load procedure:

hdc = LEADRasterView1.PrintStart

LEADRasterView1.Render hdc, 1, 1, Printer.PrintQuality * fRealWidth, Printer.PrintQuality * fRealHeight

LEADRasterView1.PrintEnd (hdc)

9. | Run your program to test it.
10. | Save the project be used as a starting point for other tasks in this tutorial.


Combining Images with Regions (Visual Basic)

Take the following steps to start a project and to add some code that combines two images with a region:

1. | Start Visual Basic.
2. | Add the LEAD Raster View Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD Raster View Control (14.5).
3. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.5).
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14.5).
4. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
5. | Add the LEAD Raster Process Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Process Object Library (14.5).
6. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
7. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
8. | Select the second LEAD control, and pull-down the View menu and select Properties Window.
9. | Make the Visible property is set to FALSE.
10. | Add the following code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Dim LEADRasIO As New LEADRasterIO
Dim LEADRasterProc As New LEADRasterProcess

LEADRasIO.Load LEADRasterView1.Raster, "c:\sample1.cmp", 0, 0, 1
LEADRasIO.Load LEADRasterView2.Raster, "c:\sample2.cmp", 0, 0, 1

LEADRasterView1.Raster.SetRgnRect 100, 100, 300, 300, L_RGN_SET
LEADRasterProc.Combine LEADRasterView1.Raster, 100, 100, 300, 300, LEADRasterView2.Raster, 0, 0, CB_OP_ADD + CB_DST_0

LEADRasterView1.Raster.FreeRgn
End Sub

11. | Run your program to test it.
12. | Save the project be used as a starting point for other tasks in this tutorial.


Miscellaneous Examples (Visual Basic)

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test any of the following examples by adding a command button to one of the previous lessons in the tutorial, and pasting the sample code in the Click procedure.

In most cases, you can add the button after the first lesson Loading and Displaying an Image. In cases where you need to zoom in or zoom out, you must first finish Zooming Out and Zooming In.

AboutBox example for Visual Basic

AdaptiveContrast Example for Visual Basic

AddBitmaps example for Visual Basic

AddBorder example for Visual Basic

AddFrame example for Visual Basic

AddMessage Example for Visual Basic

AddNoise example for Visual Basic

AddShadow example for Visual Basic

AddWeightedBitmaps example for Visual Basic

AdjustTint Example for Visual Basic

Aging Example for Visual Basic

AlphaBlend example for Visual Basic

Animate Example for Visual Basic

AnimationEnable Example for Visual Basic

AnnAddUndoNode Example for Visual Basic

AnnAddUserHandle example for Visual Basic

AnnAdjustPoint example for Visual Basic

AnnAutoCursor example for Visual Basic

AnnAutoDialogFontSize Example for Visual Basic

AnnAutoDrawEnable Example for Visual Basic

AnnAutoHilightPen Example for Visual Basic

AnnAutomation Example for Visual Basic

AnnAutoMenuEnable Example for Visual Basic

AnnBoundingRect... Example for Visual Basic

AnnChange example for Visual Basic

AnnChangeUserHandle example for Visual Basic

AnnContainer Example for Visual Basic

AnnDataPath example for Visual Basic

AnnDefine2 example for Visual Basic

AnnDeletePage Example for Visual Basic

AnnDeletePageArray Example for Visual Basic

AnnDeletePageMemory Example for Visual Basic

AnnDeleteUserHandle example for Visual Basic

AnnDestroy example for Visual Basic

AnnEnableZoomView Example for Visual Basic

AnnEncryptApply example for Visual Basic

AnnEnumerate example for Visual Basic

AnnEnumerate method example for Visual Basic

AnnEnumerateHandle example for Visual Basic

AnnEnumerateTextToken example for Visual Basic

AnnFixed example for Visual Basic

AnnGetAutoMenuItemEnable example for Visual Basic

AnnGetContainer Example for Visual Basic

AnnGetDistance2 example for Visual Basic

AnnGetGrouping example for Visual Basic

AnnGetHyperlinkParam example for Visual Basic

AnnGetHyperlinkString example for Visual Basic

AnnGetHyperlinkType example for Visual Basic

AnnGetNameOffsetX Example for Visual Basic

AnnGetNameRestrict Example for Visual Basic

AnnGetObjectFromTag example for Visual Basic

AnnGetPoint... example for Visual Basic

AnnGetProtractorOptions Example for Visual Basic

AnnGetRgnHandle Example for Visual Basic

AnnGetScalarX Example for Visual Basic

AnnGetSecondaryMetaFile example for Visual Basic

AnnGetSelectList example for Visual Basic

AnnGetUserData example for Visual Basic

AnnGetUserHandles example for Visual Basic

AnnGetVisible example for Visual Basic

AnnGroup example for Visual Basic

AnnHandle example for Visual Basic

AnnHitTest Example for Visual Basic

AnnHitTestExt example for Visual Basic

AnnHyperlink example for Visual Basic

AnnHyperlinkMenu example for Visual Basic

AnnHyperlinkMenuEnable example for Visual Basic

AnnInsert example for Visual Basic

AnnInsertTokenTable example for Visual Basic

AnnIsFixedRect example for Visual Basic

AnnLoadArray example for Visual Basic

AnnLock example for Visual Basic

AnnLocked example for Visual Basic

AnnMenu example for Visual Basic

AnnMouseDown example for Visual Basic

AnnMove example for Visual Basic

AnnNameBoundingRectLeft Example for Visual Basic

AnnNameOptions example for Visual Basic

AnnNameRectLeft Example for Visual Basic

Annotation Colors Example for Visual Basic

AnnParentRasterView example for Visual Basic

AnnPointOptions example for Visual Basic

AnnPopFixedState example for Visual Basic

AnnPredefinedRaster example for Visual Basic

AnnPushFixedState example for Visual Basic

AnnRectLeft example for Visual Basic

AnnRestrictCursor example for Visual Basic

AnnRotate example for Visual Basic

AnnRotateAngle example for Visual Basic

AnnRTFText example for Visual Basic

AnnSaveArray example for Visual Basic

AnnSaveMemory example for Visual Basic

AnnSaveTag example for Visual Basic

AnnSelect example for Visual Basic

AnnSelectRect Example for Visual Basic

AnnSetAutoMenuItemEnable Example for Visual Basic

AnnSetAutoText Example for Visual Basic

AnnSetMetafile Example for Visual Basic

AnnSetPolyFillMode Example for Visual Basic

AnnSetROP2 Example for Visual Basic

AnnSetSecondaryBitmap Example for Visual Basic

AnnSetUnit Example for Visual Basic

AnnSetUser Example for Visual Basic

AnnSetWnd Example for Visual Basic

AnnShowLockedIcon Example for Visual Basic

AnnTextAlign example for Visual Basic

AnnTextExpandTokens example for Visual Basic

AnnTextPointerFixed example for Visual Basic

AnnTextRotate example for Visual Basic

AnnTicMarkLength example for Visual Basic

AnnToolChecked Example for Visual Basic

AnnToolDestroy Example for Visual Basic

AnnUndo Example for Visual Basic

AnnUndoEnable Example for Visual Basic

AnnUngroup Example for Visual Basic

AnnUnlock Example for Visual Basic

AnnUnlocked Example for Visual Basic

AnnUnrealize Example for Visual Basic

AnnTextEdit Example for Visual Basic

AnnCalibrateRuler Example for Visual Basic

AnnSetOptions Example for Visual Basic

AnnGetRotateOptions Example for Visual Basic

AnnSetTextOptions Example for Visual Basic

AnnAutoSnapCursor Example for Visual Basic

AnnSetFillModeExt Example for Visual Basic

AntiAlias example for Visual Basic

Appearance Example for Visual Basic

ApplyMathLogic Example for Visual Basic

ApplyModalityLUT Example for Visual Basic

ApplyModalityLUT2 Example for Visual Basic

ApplyVOILUT Example for Visual Basic

ApplyVOILUT2 Example for Visual Basic

AutoAnimate Example for Visual Basic

AutoBinary Example for Visual Basic

AutoColorLevel Example for Visual Basic

AutoPan Example for Visual Basic

AutoSegment example for Visual Basic

AutoSize Example for Visual Basic

AutoTrim example for Visual Basic

Average example for Visual Basic

BackColor (ILEADRasterImgList) example for Visual Basic

BackColor example for Visual Basic

BackErase example for Visual Basic

BalanceColors example for Visual Basic

Bending Example for Visual Basic

BinaryFilter example for Visual Basic

BitmapAlpha example for Visual Basic

BitmapBytesPerLine example for Visual Basic

BitmapCompression example for Visual Basic

BitmapDataPath Example for Visual Basic

BitmapDpi Example for Visual Basic

BitmapToClient example for Visual Basic

BitmapXres and BitmapYres example for Visual Basic

BitonalScaling (ILEADRasterImgList) example for Visual Basic

BitonalScaling example for Visual Basic

BooleanItemValue example for Visual Basic

BooleanValue example for Visual Basic

BorderColor example for Visual Basic

BorderRemove example for Visual Basic

BorderStyle example for Visual Basic

BricksTexture Example for Visual Basic

BrowseDir example for Visual Basic

BumpMap Example for Visual Basic

ButtonColumns example for Visual Basic

ButtonMenuTool example for Visual Basic

ButtonRows example for Visual Basic

ButtonVisible example for Visual Basic

Canvas Example for Visual Basic

Capture example for Visual Basic

CenterImage example for Visual Basic

Change example for Visual Basic

ChannelMix Example for Visual Basic

Clear example for Visual Basic

Click and MouseIcon example for Visual Basic

ClientToBitmap example for Visual Basic

Clouds Example for Visual Basic

CMYKRaster Example for Visual Basic

ColoredBalls Example for Visual Basic

ColoredPencil Example for Visual Basic

ColorHalfTone Example for Visual Basic

ColorIntensityBalance Example for Visual Basic

ColorizeGray Example for Visual Basic

ColorLevel Example for Visual Basic

ColorReplace example for Visual Basic

ColorRes example for Visual Basic

ColorResList Example for Visual Basic

ColorSpace Example for Visual Basic

ColorThreshold example for Visual Basic

Combine example for Visual Basic

CombineBitmapWarp example for Visual Basic

CombineExt example for Visual Basic

Comment example for Visual Basic

CompactFile Example for Visual Basic

ContinueBrowse example for Visual Basic

ContourFilter example for Visual Basic

Contrast example for Visual Basic

ContrastBrightIntensity Example for Visual Basic

ControlWindow Example for Visual Basic

ConvertToColoredGray example for Visual Basic

ConvertUnsignedToSigned Example for Visual Basic

CopyMarkers example for Visual Basic

Correlation Example for Visual Basic

CorrelationList Example for Visual Basic

CountLUTColors example for Visual Basic

Create Bitmap, Size, and Combine example for Visual Basic

Create example for Visual Basic

CreateMaskFromRgn Example for Visual Basic

CreateThumbnailFromFile example for Visual Basic

CreateUserBitmap example for Visual Basic

CreateUserBitmap2 example for Visual Basic

CreateZoomView Example for Visual Basic

Cubism Example for Visual Basic

CurveToBezier example for Visual Basic

Cylindrical Example for Visual Basic

dbCan... example for Visual Basic

DblClick (ILEADRasterImgList) example for Visual Basic

DblClick example for Visual Basic

DDB example for Visual Basic

Deinterlace Example for Visual Basic

DeleteBitmapListItems example for Visual Basic

DeleteMarker example for Visual Basic

DeleteMarkerAt example for Visual Basic

DeletePage example for Visual Basic

DeleteTag Example for Visual Basic

Desaturate Example for Visual Basic

Deskew example for Visual Basic

DeskewExt Example for Visual Basic

Despeckle example for Visual Basic

DestroyZoomView Example for Visual Basic

DIB example for Visual Basic

DecodeABIC Example for Visual Basic

DiceEffect Example for Visual Basic

DiffuseGlow Example for Visual Basic

DigitalSubtract Example for Visual Basic

DirectionEdgeStatistical example for Visual Basic

Directory example for Visual Basic

DiscreteFourierTransformation example for Visual Basic

DispatchValue example for Visual Basic

DisplaceMap Example for Visual Basic

DisplayFourierTransformation example for Visual Basic

DJVResolution example for Visual Basic

DlgHelpEvent example for Visual Basic

DocCleanSuccess example for Visual Basic

DoubleBuffer Example for Visual Basic

DoubleItemValue example for Visual Basic

DoubleValue example for Visual Basic

DrawShape example for Visual Basic

DrawStar Example for Visual Basic

DrawText example for Visual Basic

Dry Example for Visual Basic

Dst... example for Visual Basic

DynamicBinary Example for Visual Basic

EdgeDetectEffect Example for Visual Basic

EdgeDetector example for Visual Basic

EdgeDetectorExt example for Visual Basic

EdgeDetectStatistical Example for Visual Basic

EffectSpeed Example for Visual Basic

Emboss example for Visual Basic

EnableKeyboard example for Visual Basic

EnableLoadInfoEvent Example for Visual Basic

EnableMethodErrors (ILEADRasterImgList) example for Visual Basic

EnableMethodErrors (ILEADRasterThumbnail) example for Visual Basic

EnableMethodErrors example for Visual Basic

EnableOCRDrawing Example for Visual Basic

EnableOLEDragMethod Example for Visual Basic

EnablePaint example for Visual Basic

EnableRestrictToContainer example for Visual Basic

EnableZoomInRect example for Visual Basic

EncodeABIC Example for Visual Basic

EnumerateMarkers example for Visual Basic

EnumGeoKeys Example for Visual Basic

EnumFileTags Example for Visual Basic

Exif example for Visual Basic

ExportBitmapList Example for Visual Basic

ExtractMessage Example for Visual Basic

FastFourierTransformation example for Visual Basic

FastLoad Example for Visual Basic

FastRotate example for Visual Basic

FeatherAlphaBlend example for Visual Basic

FeedLoad example for Visual Basic

FileName example for Visual Basic

FilePage Event Example for Visual Basic

Fill example for Visual Basic

Flip example for Visual Basic

FloaterDstClip... example for Visual Basic

FloatItemValue example for Visual Basic

FloatValue example for Visual Basic

Font (ILEADRasterImgList) example for Visual Basic

Font example for Visual Basic

ForeColor example for Visual Basic

Fragment Example for Visual Basic

Frame... example for Visual Basic

FreeHandShear Example for Visual Basic

FreeHandWave Example for Visual Basic

FreePlaneBend Example for Visual Basic

FreeRadBend Example for Visual Basic

FrequencyFilter example for Visual Basic

FrequencyFilterMask example for Visual Basic

FunctionalLight Example for Visual Basic

GammaCorrect example for Visual Basic

GammaCorrectExt Example for Visual Basic

GaussianFilter example for Visual Basic

GetBitmapClipSegments example for Visual Basic

GetBitmapDC example for Visual Basic

GetBitmapStatisticsInfo example for Visual Basic

GetColorCount Example for Visual Basic

GetDIB2 Example for Visual Basic

GetFeretsDiameter example for Visual Basic

GetFileInfo example for Visual Basic

GetFloaterHandle example for Visual Basic

GetFunctionalLookupTable example for Visual Basic

GetGeoKey Example for Visual Basic

GetHistogram example for Visual Basic

GetHistogramGray example for Visual Basic

GetLayerMaskBitmap example for Visual Basic

GetLinearVOILUT example for Visual Basic

GetMarkers example for Visual Basic

GetMemoryInfo Example for Visual Basic

GetMemoryThresholds Example for Visual Basic

GetMinMaxBits Example for Visual Basic

GetMinMaxVal Example for Visual Basic

GetObjectInfo example for Visual Basic

GetOverlayBitmap example for Visual Basic

GetOverlayCount example for Visual Basic

GetPicture and SetPicture example for Visual Basic

GetRgnHandle example for Visual Basic

GetRgnPerimeterLength example for Visual Basic

GetServerBitmap example for Visual Basic

GetTransformationParameters Example for Visual Basic

GetUserLookupTable example for Visual Basic

GlassEffect Example for Visual Basic

GlowFilter Example for Visual Basic

Grayscale example for Visual Basic

GrayscaleExt example for Visual Basic

GrayScaleToDuotone Example for Visual Basic

GrayScaleToMultitone Example for Visual Basic

Halftone example for Visual Basic

HalfTonePattern Example for Visual Basic

HasMagGlass example for Visual Basic

hDocCleanRgn example for Visual Basic

HighPassFilter Example for Visual Basic

HistoContrast example for Visual Basic

HistoEqualize example for Visual Basic

HistogramTableSize example for Visual Basic

HolesRemovalBitmapRgn Example for Visual Basic

HScrollInfo example for Visual Basic

HSV_HfromRGB example for Visual Basic

Hue example for Visual Basic

HueSaturationIntensity example for Visual Basic

IgnoreFilters example for Visual Basic

Impressionist Example for Visual Basic

InfoBits example for Visual Basic

InfoHasAlpha example for Visual Basic

InfoLayers example for Visual Basic

InfoViewPerspective Example for Visual Basic

Insert example for Visual Basic

InsertAt example for Visual Basic

InsertBitmapListItem Example for Visual Basic

InsertFromBitmapList example for Visual Basic

InsertMarker example for Visual Basic

Intensity example for Visual Basic

IntensityDetect example for Visual Basic

Invert example for Visual Basic

InvertedText example for Visual Basic

IsGrayscale example for Visual Basic

ISISAcquire example for Visual Basic

ISISAcquireMulti example for Visual Basic

IsISISAvailable example for Visual Basic

ISISSelect example for Visual Basic

ISISSetScanOptions example for Visual Basic

IsRegistrationMark Example for Visual Basic

IsSigned example for Visual Basic

Item example for Visual Basic

ItemBackgroundColor example for Visual Basic

ItemSelected example for Visual Basic

ItemUnSelected example for Visual Basic

ItemWidth example for Visual Basic

J2KCompressionControl example for Visual Basic

J2KCompressionRatio example for Visual Basic

J2KROIControl example for Visual Basic

J2KSetDefaults example for Visual Basic

J2KTargetFileSize example for Visual Basic

JBIG2GBATX1 Example for Visual Basic

KeyDown example for Visual Basic

KeyPress (ILEADRasterImgList) example for Visual Basic

KeyPress example for Visual Basic

KeyUp example for Visual Basic

LensFlare Example for Visual Basic

LevelHighBit example for Visual Basic

LevelLowBit example for Visual Basic

LevelLUT example for Visual Basic

LevelLUTLength example for Visual Basic

Light Example for Visual Basic

LightControl Example for Visual Basic

LineProfile example for Visual Basic

LineRemove example for Visual Basic

Load (ILEADMarkers) example for Visual Basic

Load example for Visual Basic

LoadArray example for Visual Basic

LoadArray2 example for Visual Basic

LoadCompressed example for Visual Basic

LoadDatabase example for Visual Basic

LoadFromFile example for Visual Basic

LoadICCProfile Example for Visual Basic

LoadICCProfile2 Example for Visual Basic

LoadIFD example for Visual Basic

LoadInfo... example for Visual Basic

LoadMemory example for Visual Basic

LoadOffset example for Visual Basic

LoadResize example for Visual Basic

LoadStatus Example for Visual Basic

LoadUseViewPerspective example for Visual Basic

LocalHistoEqualize Example for Visual Basic

LongItemValue example for Visual Basic

LongValue example for Visual Basic

LZWAutoClear Example for Visual Basic

MagGlassOwnerDraw Example for Visual Basic

MagGlassPaintIntensity Example for Visual Basic

MaskConvolution Example for Visual Basic

MathFunction example for Visual Basic

MaxFilter example for Visual Basic

MaxVal example for Visual Basic

Median example for Visual Basic

MinFilter example for Visual Basic

MinVal example for Visual Basic

Mosaic example for Visual Basic

MosaicTiles Example for Visual Basic

MotionBlur example for Visual Basic

MouseDown example for Visual Basic

MouseMove example for Visual Basic

MousePointer example for Visual Basic

MouseUp example for Visual Basic

MouseWheel example for Visual Basic

Multiply Example for Visual Basic

MultiScaleEnhancement Example for Visual Basic

NumberFramesInOverlay example for Visual Basic

Ocean Example for Visual Basic

ODBC Example for Visual Basic

Offset Example for Visual Basic

Oilify example for Visual Basic

OLECompleteDrag Example for Visual Basic

OLEDropAllowed example for Visual Basic

OLEDropFile example for Visual Basic

OLEStartDrag (ILEADRasterImgList) example for Visual Basic

OptimizeBuffer Example for Visual Basic

OptimizeDir Example for Visual Basic

OriginX example for Visual Basic

OwnerDrawItem event example for Visual Basic

OwnerDrawItems example for Visual Basic

Paint event example for Visual Basic

PaintContrast example for Visual Basic

PaintDither (ILEADRasterImgList) example for Visual Basic

PaintDither example for Visual Basic

PaintEffect example for Visual Basic

PaintEffectMaxPasses example for Visual Basic

PaintGamma example for Visual Basic

PaintIntensity example for Visual Basic

PaintPalette example for Visual Basic

PaintROP3 example for Visual Basic

PaintScaling (ILEADRasterImgList) example for Visual Basic

PaintScaling Example for Visual Basic

PaintSizeMode Example for Visual Basic

PaintSizeUseDPI example for Visual Basic

PaintTransitionMaxPasses example for Visual Basic

PaintWhileLoad example for Visual Basic

PaintZoomFactor Example for Visual Basic

Password example for Visual Basic

PatternStyle (ILEADRasterFXD) example for Visual Basic

PatternStyle example for Visual Basic

PCDRes example for Visual Basic

PDFCompInsertMRC Example for Visual Basic

PDFCompInsertNormal Example for Visual Basic

PDFEncryptFlags example for Visual Basic

PDFInitDir example for Visual Basic

PDFSaveLowMemory example for Visual Basic

PDFSaveUseDPI example for Visual Basic

PDFXResolution example for Visual Basic

Perlin Example for Visual Basic

Perspective Example for Visual Basic

Picturize example for Visual Basic

PicturizeBitmapList example for Visual Basic

PicturizeSingle example for Visual Basic

Pixel example for Visual Basic

Pixelate Example for Visual Basic

PixelData example for Visual Basic

Plane Example for Visual Basic

PlaneBend Example for Visual Basic

PlasmaFilter Example for Visual Basic

PLTPenColor Example for Visual Basic

Pointillist Example for Visual Basic

Polar Example for Visual Basic

Posterize example for Visual Basic

PreferredLoadFormat Example for Visual Basic

PreLoadFilters Example for Visual Basic

PrinterScaleHeight Example for Visual Basic

PrintNewPage Example for Visual Basic

ProgressivePasses Example for Visual Basic

PTKResolution Example for Visual Basic

Punch Example for Visual Basic

PuzzleEffect Example for Visual Basic

RadialBlur Example for Visual Basic

RadWave Example for Visual Basic

RasterizeViewMode Example for Visual Basic

RawLoad Example for Visual Basic

RawSave Example for Visual Basic

ReadFileCommentOffset Example for Visual Basic

ReadLoadResolutions Example for Visual Basic

ReadTagMemory example for Visual Basic

ReadyState Example for Visual Basic

RefBitmap Example for Visual Basic

RefBitmapList Example for Visual Basic

RemapHue example for Visual Basic

RemapTableSize example for Visual Basic

Remove example for Visual Basic

RemoveRedeye example for Visual Basic

Resize (ILEADRasterImgList) example for Visual Basic

Resize event example for Visual Basic

ResizeRgn example for Visual Basic

RevEffect example for Visual Basic

RGBfromHSV example for Visual Basic

RgnChange example for Visual Basic

RgnFrameColor example for Visual Basic

RingEffect Example for Visual Basic

Ripple Example for Visual Basic

ROIMean example for Visual Basic

RomanMosaic Example for Visual Basic

Rotate example for Visual Basic

RowCount example for Visual Basic

Rows example for Visual Basic

RTFPaperHeight Example for Visual Basic

SampleTarget Example for Visual Basic

Saturation example for Visual Basic

Save (ILEADRasterMrc) example for Visual Basic

Save example for Visual Basic

SaveArray example for Visual Basic

SaveBuffer example for Visual Basic

SaveICCProfile Example for Visual Basic

SaveICCProfile2 Example for Visual Basic

SaveIFD example for Visual Basic

SaveInterlaced example for Visual Basic

SaveLayers example for Visual Basic

SaveList Example for Visual Basic

SaveLSB example for Visual Basic

SaveMemory example for Visual Basic

SaveMemory2 example for Visual Basic

SaveNoPalette example for Visual Basic

SavePage example for Visual Basic

SaveResolutionCount example for Visual Basic

SaveTileWidth example for Visual Basic

SaveToFile example for Visual Basic

SaveWithStamp example for Visual Basic

ScaleMode example for Visual Basic

Scroll (ILEADRasterImgList) example for Visual Basic

Scroll event example for Visual Basic

ScrollItems example for Visual Basic

ScrollStyle example for Visual Basic

Segment example for Visual Basic

SegmentExt Example for Visual Basic

SelectData Example for Visual Basic

SelectedItems example for Visual Basic

SelectionStyle example for Visual Basic

SelectiveColor Example for Visual Basic

SetGeoKey Example for Visual Basic

SetMemoryInfo example for Visual Basic

SetMemoryThresholds example for Visual Basic

SetMinMaxBits Example for Visual Basic

SetOverlayAttributes example for Visual Basic

SetRgn... example for Visual Basic

SetRgnBorder Example for Visual Basic

SetRgnColorHSVRange example for Visual Basic

SetRgnColorRGBRange example for Visual Basic

SetRgnFromMask Example for Visual Basic

SetRgnMagicWand example for Visual Basic

SetSelectionBitmap example for Visual Basic

SetSrcClipRect example for Visual Basic

SetSrcRect example for Visual Basic

SetTag example for Visual Basic

Sharpen example for Visual Basic

Shear example for Visual Basic

ShiftData Example for Visual Basic

ShiftMinimumToZero Example for Visual Basic

ShortItemValue example for Visual Basic

ShortValue example for Visual Basic

Skeleton Example for Visual Basic

SkipFile example for Visual Basic

Slice Example for Visual Basic

Smooth example for Visual Basic

SmoothEdges Example for Visual Basic

Solarize example for Visual Basic

Sort example for Visual Basic

SortExt Example for Visual Basic

SpatialFilter example for Visual Basic

Spherize Example for Visual Basic

Src... example for Visual Basic

Stable example for Visual Basic

StopMagGlass example for Visual Basic

StretchIntensity example for Visual Basic

StringItemValue example for Visual Basic

StringValue example for Visual Basic

SubtractBackground example for Visual Basic

SwapColors example for Visual Basic

Swirl Example for Visual Basic

TempDirectory Example for Visual Basic

TextureAlphaBlend Example for Visual Basic

TextWordWrap example for Visual Basic

Tool example for Visual Basic

TransitionEffect example for Visual Basic

Transparent example for Visual Basic

Trim example for Visual Basic

Tunnel Example for Visual Basic

TXTTopMarg Example for Visual Basic

Type example for Visual Basic

Underlay example for Visual Basic

UnsharpMask example for Visual Basic

UpdateMagGlassFromHandle Example for Visual Basic

UpdateMagGlassShape example for Visual Basic

UpdateOverlayBits example for Visual Basic

UpdateZoomView Example for Visual Basic

UseFastConversion Example for Visual Basic

UseLUT example for Visual Basic

UserFilter example for Visual Basic

UserPalette and BitmapPalette example for Visual Basic

UserSegmentInfo Example for Visual Basic

UserShape Example for Visual Basic

ViewSize example for Visual Basic

Vignette Example for Visual Basic

VTable example for Visual Basic

vType example for Visual Basic

Wave Example for Visual Basic

Wind Example for Visual Basic

Window example for Visual Basic

WindowLevel example for Visual Basic

WindowLevelFillLUT example for Visual Basic

WMFResolution example for Visual Basic

WriteComment example for Visual Basic

WriteGeoKey Example for Visual Basic

WriteMarkerAction example for Visual Basic

WriteMetaData example for Visual Basic

ZigZag Example for Visual Basic

ZoomBlur Example for Visual Basic

ZoomIn example for Visual Basic

ZoomInDone example for Visual Basic

ZoomWave Example for Visual Basic


AboutBox example for Visual Basic

Note: Also works with Access 95 and 97.

' This example displays the LEADTOOLS COM RasterView Control information.
LEADRasterView1.AboutBox


AdaptiveContrast Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.AdaptiveContrast LEADRasterView1.Raster, 9, 200, _
ADAPTIVE_LIN


AddBitmaps example for Visual Basic

Raster2.Bitmap = 0
For i = 0 To 4
Raster2.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.Rotate Raster2, 7200 * i, 0, RGB(255, 0, 0)
LEADRasterView2.Raster.InsertBitmapListItem -1, Raster2.Bitmap
Next i
RasterProc.AddBitmaps LEADRasterView2.Raster, BC_AVG


AddBorder example for Visual Basic

RasterProc.AddBorder LEADRasterView1.Raster, 30, 30, 30, 30, BORDER_OUTSIDE, BORDER_STYLE_OPAQUE, BORDER_EFFECT_CURVEDIN, Nothing, BORDER_GRAD_INSIDEOUT, RGB(200, 150, 150), 0, 200, False, False, 0, BORDER_SHADOW_LEFT, False


AddFrame example for Visual Basic

RasterProc.AddFrame LEADRasterView1.Raster, Raster2, False, False, 0, 0, FRAME_OUTSIDE, FRAME_QUALITY_LOW


AddMessage Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Message = " LEAD Technologies, Inc "
RasterProc.AddMessage LEADRasterView1.Raster


AddNoise example for Visual Basic

Note: Also works with Access 95 and 97.

This example adds red noise and redisplays the bitmap.

Dim Rasterproc As New LEADRasterProcess
RasterProc.AddNoise LEADRasterView1.Raster, 500, CHANNEL_RED
LEADRasterView1.ForceRepaint


AddShadow example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.AddShadow LEADRasterView1.Raster, SHADOW_SE, 0, SHADOW_CLR_GRAY


AddWeightedBitmaps example for Visual Basic

Dim Raster As New LEADRaster
Dim RasterProc As New LEADRasterProcess
Dim ListCount As Integer
Dim i As Integer

ListCount = 4
RasterProc.FactorCount = ListCount

For i = 0 To ListCount - 1
Raster.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.Rotate Raster, 720 * i, 0, RGB(255, 0, 0)
LEADRasterView1.Raster.InsertBitmapListItem -1, Raster.Bitmap
RasterProc.Factor(i) = 100
Next i

RasterProc.AddWeightedBitmaps LEADRasterView1.Raster, BC_AVG


AdjustTint Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.AdjustTint LEADRasterView1.Raster, -6500, 2500


Aging Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Aging LEADRasterView1.Raster, 10, 2, 50, 2, 5, 6, _
RGB(255, 255, 0), _
RGB(0, 0, 0), _
RGB(0, 0, 255), _
AGING_ADD_VSCRATCH Or _
AGING_ADD_PITS Or _
AGING_SCRATCH_INV Or _
AGING_PITS_CLR


AlphaBlend example for Visual Basic

Raster2.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.IntensityDetect Raster2, 150, 250
RasterProc.AlphaBlend LEADRasterView1.Raster, 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, Raster2, 0, 0, 128


Animate Event Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

Private Sub LEADRasterView1_Animate(ByVal bEnable As Boolean)
If bEnable = True Then
Command1.Caption = "&Stop Animation"
Else
Command1.Caption = "&Start animation"
End If
End Sub
Private Sub Command1_Click()
If LEADRasterView1.AnimationEnable = True Then
LEADRasterView1.AnimationEnable = False
Else
LEADRasterView1.AnimationEnable = True
End If
End Sub


AnimationEnable Example for Visual Basic

Note: Also works with Access 95 and 97.

This example loads and plays an animated file. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

Dim RasterIO As New LEADRasterIO
' Load all pages of a GIF file.
RasterIO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\eye.gif", 0, 1, -1
' Set properties for a scaled animation.
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSetRects = False
' Set the image display size to match the LEAD control.
LEADRasterView1.SetDstRect 0, 0, _
LEADRasterView1.ScaleWidth, _
LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, _
LEADRasterView1.ScaleWidth, _
LEADRasterView1.ScaleHeight
' Allow a continuous loop.
LEADRasterView1.AnimationLoop = True
' Start the animation.
LEADRasterView1.AnimationEnable = True


AnnAddUndoNode Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example creates two annotation notes as a single undo operation
Private Sub Command12_Click()
Dim hObject1 As Long
Dim hObject2 As Long

'Call the AddUndoNode method to add an undo node to the container.
RasterAnn.AnnAddUndoNode

'Disable the undo feature
RasterAnn.AnnUndoEnable = False

'Perform the operations to be combined into one undo.
RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject1 = RasterAnn.AnnObject
RasterAnn.AnnRectLeft (hObject1) = 0
RasterAnn.AnnRectTop (hObject1) = 0
RasterAnn.AnnRectWidth (hObject1) = 100
RasterAnn.AnnRectHeight (hObject1) = 100

RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject2 = RasterAnn.AnnObject

RasterAnn.AnnRectLeft(hObject2) = 0
RasterAnn.AnnRectTop(hObject2) = 100
RasterAnn.AnnRectWidth(hObject2) = 100
RasterAnn.AnnRectHeight(hObject2) = 100

'Re-enable the undo feature
RasterAnn.AnnUndoEnable = True
End Sub


AnnAddUserHandle example for Visual Basic

Private Sub ExampleAddAnnUserHandle(hRect As Long)
Dim AnnHandle As Long
Dim ObjectType As AnnObjectType
Dim RectTop As Double
Dim RectLeft As Double
Dim RectWidth As Double
Dim RectHeight As Double

RasterAnn.AnnGetType hRect
ObjectType = RasterAnn.AnnType

If ObjectType = ANN_OBJECT_RECT Then
RectTop = RasterAnn.AnnRectTop(hRect)
RectLeft = RasterAnn.AnnRectLeft(hRect)
RectWidth = RasterAnn.AnnRectWidth(hRect)
RectHeight = RasterAnn.AnnRectHeight(hRect)

RasterAnn.AnnHandle.ID = 100
RasterAnn.AnnHandle.EnableVisible = True
RasterAnn.AnnHandle.PenColor = RGB(0, 0, 0)
RasterAnn.AnnHandle.FillColor = RGB(255, 0, 0)
RasterAnn.AnnHandle.Shape = ANN_HANDLE_SHAPE_CIRCLE
RasterAnn.AnnHandle.hCursor = 0

RasterAnn.AnnHandle.Flags = ANN_HANDLE_ID Or _
ANN_HANDLE_LOCATION Or _
ANN_HANDLE_CONTAINER_COORDINATES Or _
ANN_HANDLE_VISIBLE Or _
ANN_HANDLE_PEN_COLOR Or _
ANN_HANDLE_FILL_COLOR Or _
ANN_HANDLE_SHAPE

RasterAnn.AnnHandle.ContainerX = RectLeft + (RectWidth / 2)
RasterAnn.AnnHandle.ContainerY = RectTop

RasterAnn.AnnAddUserHandle hRect

RasterAnn.AnnHandle.ContainerX = RectLeft + (RectWidth / 2)
RasterAnn.AnnHandle.ContainerY = RectTop + RectHeight

Else
MsgBox "Annotation object must be rectangle"
End If

End Sub


AnnAdjustPoint example for Visual Basic

Private Sub ExampleAnnAdjustPoint(hObject As Long, AnchorX As Double, AnchorY As Double, MoveX As Double, MoveY As Double)

Dim Angle As Double

Angle = RasterAnn.AnnGetAngle(hObject)

RasterAnn.AnnAdjustPoint AnchorX, AnchorY, MoveX, MoveY, Angle, ANN_ADJUST_HORIZONTAL

End Sub


AnnAutoCursor example for Visual Basic

' This sample swaps the Default and Move annotation cursors
Private Sub SampleAnnAutoCursors ()
Dim hCursorMove As IPictureDisp
Dim hCursorDefault As IPictureDisp

' Get copy of original cursors
hCursorDefault = RasterAnn.AnnAutoCursor(ANN_AUTOCURSOR_DEFAULT)
hCursorMove = RasterAnn.AnnAutoCursor(ANN_AUTOCURSOR_MOVE)

' Change
RasterAnn.AnnAutoCursor(ANN_AUTOCURSOR_DEFAULT) = hCursorMove
RasterAnn.AnnAutoCursor(ANN_AUTOCURSOR_MOVE) = hCursorDefault

End Sub


AnnAutoDialogFontSize Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example will set the dialog fonts to use Courier 15
Private Sub Command7_Click()
RasterAnn.AnnSetAutoText ANN_AUTOTEXT_DIALOG_FONT, "Courier New"
RasterAnn.AnnAutoDialogFontSize = 15
End Sub


AnnAutoDrawEnable Example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example toggles the AnnAutoDrawEnable property.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

If (RasterAnn.AnnAutoDrawEnable = True) Then
RasterAnn.AnnAutoDrawEnable = False
Else
RasterAnn.AnnAutoDrawEnable = True
End If


AnnAutoHilightPen Example for Visual Basic

RasterAnn.AnnAutoHilightPen = RGB(192,192,192)


AnnAutomation Property Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example shows how you can use the AnnAutomation property
'to access the automation object through API functions.

Private Sub AnnAutomation_Click()
Dim nRet As Integer
Dim IsBold As Long ' Is the object's text bold
Dim hAnnObject As Long
hAnnObject = RasterAnn.AnnAutomation

' Toggle the default font bold property
L_AnnGetFontBold hAnnObject, IsBold
If IsBold <> 0 Then
MsgBox "Removing bold", 0, "Notice"
Else
MsgBox "Making bold", 0, "Notice"
End If
nRet = L_AnnSetFontBold(hAnnObject, Not IsBold, 0)
If (nRet <> 1) Then
MsgBox "L_AnnSetFontBold failed: " & nRet
End If
End Sub


AnnAutoMenuEnable Example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example toggles the AnnAutoMenuEnable property.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

If (RasterAnn.AnnAutoMenuEnable = True) Then
RasterAnn.AnnAutoMenuEnable = False
Else
RasterAnn.AnnAutoMenuEnable = True
End If


AnnAutoSnapCursor Example for Visual Basic

' The following example toggles the automation cursor snap state.
' The cursor snap state affects whether the cursor snaps to a container border
' when creating annotations by clicking outside the annotation container.
Private Sub ExampleAnnSetAutoSnapCursor_Click()
Dim nRet As Integer
Dim szMsg As String
Dim hObject As Long
Dim bSnap As Boolean

RasterAnn.AnnCreate ANN_OBJECT_TEXT, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft (hObject) = 0
RasterAnn.AnnRectTop (hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100

bSnap = RasterAnn.AnnAutoSnapCursor
RasterAnn.AnnAutoSnapCursor = Not bSnap

szMsg = "Automation Snap Cursor State changed from " + Str(bSnap) + " to " + Str(RasterAnn.AnnAutoSnapCursor)
MsgBox szMsg
End Sub


AnnBoundingRect... Example for Visual Basic

Dim RasterVarX As New LEADRasterVariant
Dim RasterVarY As New LEADRasterVariant
Dim RasterIO As New LEADRasterIO
Dim hObj As Long
Dim hObj2 As Long

LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, ""
RasterAnn.AnnParentRasterView = LEADRasterView1
RasterIO.Load LEADRasterView1.Raster, "c:\image1.jpg", 0, 0, 1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN

hObj = RasterAnn.AnnCreateItem(RasterAnn.AnnContainer, ANN_OBJECT_PROTRACTOR, True)
hObj2 = RasterAnn.AnnCreateItem(RasterAnn.AnnContainer, ANN_OBJECT_POLYGON, True)

' Assign values for x and y from 1 through 3
RasterVarX.Type = VALUE_ARRAY_FLOAT
RasterVarY.Type = VALUE_ARRAY_FLOAT
RasterVarX.ItemCount = 4
RasterVarY.ItemCount = 4
RasterVarX.FloatItemValue (1) = 10
RasterVarX.FloatItemValue(2) = 100
RasterVarX.FloatItemValue(3) = 200
RasterVarY.FloatItemValue(1) = 20
RasterVarY.FloatItemValue(2) = 200
RasterVarY.FloatItemValue(3) = 100

RasterAnn.AnnSetPoints hObj, RasterVarX, RasterVarY, 3
RasterVarX.FloatItemValue(0) = 50 ' SetPoints starts at 0 because No. of points set to 4
RasterVarY.FloatItemValue(0) = 220

RasterAnn.AnnSetPoints hObj2, RasterVarX, RasterVarY, 4
RasterAnn.AnnSetFillMode hObj2, ANN_FILLMODE_OPAQUE, False
Form1.Caption = "Protractor Bounding Rectangle, Left:" & RasterAnn.AnnBoundingRectLeft(hObj) & ", Top:" & _
RasterAnn.AnnBoundingRectTop(hObj) & ", Width:" & RasterAnn.AnnBoundingRectWidth(hObj) & ", Height:" & RasterAnn.AnnBoundingRectHeight(hObj)
RasterAnn.AnnBringToFront hObj2
MsgBox "Brought Polygon to front"
Form1.Caption = "Polygon Area:" & RasterAnn.AnnGetArea(hObj2)
RasterAnn.AnnSendToBack hObj2
MsgBox "Sent Polygon to back"
RasterAnn.AnnCut hObj2, ANN_FMT_WMF, False, True
Form1.Caption = "Angle:" & RasterAnn.AnnGetAngle(hObj)


AnnCalibrateRuler Example for Visual Basic

' The following example calibrates a ruler object (hObject)
' so that it measures 10 inches with a DPI ratio of 1:1 and
' then sets this calibration to ALL ruler objects
' (ANN_OBJECT_RULER, ANN_OBJECT_POLYRULER, ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR)
' in the container:

Private Sub ExampleAnnCalibrateRuler_Click()
Dim nRet As Integer
Dim lObjectType As Long
Dim dDpiX As Double
Dim dDpiY As Double

Dim hObjectRuler As Long

nRet = RasterAnn.AnnCreate(ANN_OBJECT_RULER, True, True)
hObjectRuler = RasterAnn.AnnObject
RasterAnn.AnnDefine hObjectRuler, 0, 0, ANN_DEFINE_BEGINSET
RasterAnn.AnnDefine hObjectRuler, 100, 100, ANN_DEFINE_END

nRet = RasterAnn.AnnGetType(hObjectRuler)
If (nRet <> 0) Then Exit Sub
lObjectType = RasterAnn.AnnType

If (lObjectType <> ANN_OBJECT_RULER) Then
MsgBox "Error: AnnCalibrateRuler only works on ANNOBJECT_RULER objects"
Exit Sub
End If

nRet = RasterAnn.AnnCalibrateRuler(hObjectRuler, 10, ANN_UNIT_INCHES, 1#)
If (nRet <> 0) Then Exit Sub

MsgBox "Ruler has been calibrated to have a length of 10 inches. Now all existing and newly created ruler objects will be matched to this calibration."

dDpiX = RasterAnn.AnnGetBitmapDpiX(hObjectRuler)
dDpiY = RasterAnn.AnnGetBitmapDpiY (hObjectRuler)

'Match calibration to existing objects in container
nRet = RasterAnn.AnnSetBitmapDpiX(hObjectRuler, dDpiX, False)
nRet = RasterAnn.AnnSetBitmapDpiY(hObjectRuler, dDpiY, False)

'Set automation defaults so that all newly created objects have this calibration
nRet = RasterAnn.AnnSetBitmapDpiX(RasterAnn.AnnAutomation, dDpiX, False)
nRet = RasterAnn.AnnSetBitmapDpiY(RasterAnn.AnnAutomation, dDpiY, False)
End Sub


AnnChange example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example tests the AnnChange event.
Private Sub RasterAnn_OnAnnChange(ByVal hAnnObject As Long)
Dim Buffer As String
Dim nTag As Long
RasterAnn.AnnGetTag hAnnObject
nTag = RasterAnn.AnnTag
Buffer = " This is a change for the button tagged " + CStr(nTag)
MsgBox Buffer, 0, "NOTE"
End Sub


AnnChangeUserHandle example for Visual Basic

Private Sub ExampleAnnChangeUserHandle(hObject As Long)
Dim Count As Long

RasterAnn.AnnGetUserHandles(hObject)
Count = RasterAnn.UserHandleCount

If Count > 0 Then
RasterAnn.AnnGetUserHandle hObject, 0

RasterAnn.AnnHandle.ContainerX = RasterAnn.AnnHandle.ContainerX + 10
RasterAnn.AnnHandle.FillColor = RGB(0, 0, 255)
RasterAnn.AnnHandle.Shape = ANN_HANDLE_SHAPE_SQUARE
RasterAnn.AnnHandle.Flags = ANN_HANDLE_FILL_COLOR Or _
ANN_HANDLE_SHAPE Or _
ANN_HANDLE_LOCATION

RasterAnn.AnnChangeUserHandle hObject, 0

Else
MsgBox "No User Handle"
End If

End Sub


AnnContainer example for Visual Basic

Private Sub LEADRasterOLEDB1_DataLoaded(ByVal nStatus As Integer)

If (nStatus = 0) Then
RasterAnn.AnnContainer = 0
RasterAnn.AnnContainer = LEADRasterOLEDB1.AnnContainer
ElseIf (nStatus = ERROR_FILENOTFOUND) Then 'if it's an empty record
ElseIf (nStatus <> ERROR_FILENOTFOUND) Then 'if it's not an empty record
MsgBox "Error loading from database!"
End If
LEADRasterView1.ForceRepaint
End Sub


AnnDataPath example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example shows how to load an annotation file from the Internet.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

RasterAnn.AnnUserMode = ANN_USERMODE_RUN
RasterAnn.AnnDataPath "http://www.leadtools.com/images/test.ann"


AnnDefine2 example for Visual Basic

'This example uses static variables to simulate user input to
'rotate/resize a rectangle around a point on the bottom center line of the rectangle.
'Intially the rectangle must not be rotated.
Private Sub ExampleAnnDefine2(hRect As Long)
Dim hContainer As Long
Dim ObjectType As AnnObjectType
Dim Angle As Double
Dim CallCount As Long
Dim RectTop As Double
Dim RectLeft As Double
Dim RectWidth As Double
Dim RectHeight As Double
Dim RectRight As Double
Dim RectBottom As Double

Dim AnchorX As Double
Dim AnchorY As Double
Dim MoveX As Double
Dim MoveY As Double
Dim AnnPointX As Double
Dim AnnPointY As Double

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_RECT Then
MsgBox "This Object is not Rect Object"
End If

Angle = RasterAnn.AnnRotateAngle(hRect)

If Angle <> 0 Then
MsgBox "Object must not be rotated"
End If

CallCount = CallCount + 1
Select Case CallCount

Case 1
RectTop = RasterAnn.AnnRectTop(hObject)
RectLeft = RasterAnn.AnnRectLeft(hObject)
RectWidth = RasterAnn.AnnRectWidth(hObject)
RectHeight = RasterAnn.AnnRectHeight(hObject)

RectRight = RectWidth + RectLeft
RectBottom = RectHeight + RectTop

AnchorX = (RectLeft + RectRight) / 2
AnchorY = RectBottom

AnnPointX = (RectLeft + RectRight) / 2
AnnPointY = RectTop

RasterAnn.AnnDefine2 hRect, AnchorX, AnchorY, ANN_DEFINE_SETANCHORPOINT
RasterAnn.AnnDefine2 hRect, AnnPointX, AnnPointY, ANN_DEFINE_BEGINMOVEPOINT

Case 2
RectTop = RasterAnn.AnnRectTop(hObject)
RectLeft = RasterAnn.AnnRectLeft(hObject)
RectWidth = RasterAnn.AnnRectWidth(hObject)
RectHeight = RasterAnn.AnnRectHeight(hObject)
RectRight = RectWidth + RectLeft
RectBottom = RectHeight + RectTop

RasterAnn.PointsCount = 1
RasterAnn.ContainerPointX = RectRight
RasterAnn.ContainerPointY = RectTop

hContainer = RasterAnn.AnnGetContainer(hRect)

RasterAnn.AnnConvert hContainer, ANN_CONVERT_TO_CLIENT

RasterAnn.PointIndex = 0
MoveX = RasterAnn.ClientPointX
MoveY = RasterAnn.ClientPointY
RasterAnn.AnnDefine2 hRect, MoveX, MoveY, ANN_DEFINE_END

CallCount = 0
End Select

End Sub


AnnDeletePage Example for Visual Basic

'This sample saves the annotations as the first page of a multipage annotation file
'The format is specified by the 'uFormat' parameter (either ANN_FMT_NATIVE or ANN_FMT_ENCODED)
'The annotations are flipped, and saved as the second page
'The annotations are rotated, and saved as the third page
'Information is displayed about the annotation file
'The second page is deleted, and information is again displayed about the annotation file
Private Sub SampleAnnSave(strFileName As String, uFormat As AnnFMTConstants)
Dim nRet As Integer
Dim strFormat As String
Dim strMsg As String

'Save as the first page of the annotation file
RasterAnn.AnnSave strFileName, uFormat, False, SAVE_OVERWRITE, 0

'Flip the container, and save as the second page (insert before page 2)
RasterAnn.AnnFlip True, LEADRasterView1.Raster.BitmapHeight / 2, False
RasterAnn.AnnSave strFileName, uFormat, False, SAVE_INSERT, 2

'Rotate the container, and save as the third page
'Here we could pass the SAVE_INSERT flag and 3 for nPage,
'but instead we will use the SAVE_APPEND flag
RasterAnn.AnnRotate False, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 45, False
RasterAnn.AnnSave strFileName, uFormat, False, SAVE_APPEND, 0

'Verify contents of file
nRet = RasterAnn.AnnFileInfo (strFileName)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = "File: " + strFileName + Chr(13)
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation File: " + strFileName
End If

'Now delete the second page, and display information
RasterAnn.AnnDeletePage strFileName, 2

'Verify contents of file
nRet = RasterAnn.AnnFileInfo (strFileName)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE ' Cut command.
strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF ' Copy command.
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED ' Clear command.
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = "File: " + strFileName + Chr(13)
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation File: " + strFileName
End If
End Sub


AnnDeletePageArray Example for Visual Basic

'This sample saves the annotations as the first page of a multipage annotation file in memory
'The annotations are flipped, and saved as the second page
'The annotations are rotated, and saved as the third page
'Information is displayed about the annotation file
'The second page is deleted, and information is again displayed about the annotation file
'Assume this global declaration:
' Dim AnnVariant as VARIANT
Private Sub SampleAnnFileInfoArray_Click()
Dim nRet As Integer
Dim strFormat As String
Dim strMsg As String
Dim uFormat As AnnFMTConstants
Dim RasterVar As New LEADRasterVariant

uFormat = ANN_FMT_ENCODED

'Save as the first page of the annotation file
nRet = RasterAnn.AnnSaveArray(uFormat, False, RasterVar, SAVE_OVERWRITE, 0)

'Flip the container, and save as the second page (insert before page 2)
RasterAnn.AnnFlip True, LEADRasterView1.Raster.BitmapHeight / 2, False
nRet = RasterAnn.AnnSaveArray(uFormat, False, RasterVar, SAVE_INSERT, 2)

'Rotate the container, and save as the third page
'Here we could pass the SAVE_INSERT flag and 3 for nPage,
'but instead we will use the SAVE_APPEND flag
RasterAnn.AnnRotate False, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 45, False
RasterAnn.AnnSaveArray uFormat, False, RasterVar, SAVE_APPEND, 0

'Verify contents of file
nRet = RasterAnn.AnnFileInfoArray(RasterVar)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE
strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = ""
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation Memory File"
End If

'Now delete the second page, and display information
RasterAnn.AnnDeletePageArray RasterVar, 2

'Verify contents of file
nRet = RasterAnn.AnnFileInfoArray(RasterVar)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE ' Cut command.
strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF ' Copy command.
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED ' Clear command.
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = ""
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation File"
End If
'If finished with AnnVariant, then free the memory by setting to empty
End Sub


AnnDeletePageMemory Example for Visual Basic

'This sample saves the annotations as the first page of a multipage annotation file in memory
'The annotations are flipped, and saved as the second page
'The annotations are rotated, and saved as the third page
'Information is displayed about the annotation file
'The second page is deleted, and information is again displayed about the annotation file
'Assume this global declaration:
Private Sub SampleAnnFileInfoMemory_Click()
Dim nRet As Integer
Dim strFormat As String
Dim strMsg As String
Dim lSize As Long
Dim uFormat As AnnFMTConstants

uFormat = ANN_FMT_NATIVE
'Save as the first page of the annotation file
Dim hGlobal As Long
hGlobal = 0
RasterAnn.AnnSaveMemory hGlobal, uFormat, False, lSize, SAVE_OVERWRITE, 0

'Flip the container, and save as the second page (insert before page 2)
RasterAnn.AnnFlip True, LEADRasterView1.Raster.BitmapHeight / 2, False
RasterAnn.AnnSaveMemory hGlobal, uFormat, False, lSize, SAVE_INSERT, 2

'Rotate the container, and save as the third page
'Here we could pass the SAVE_INSERT flag and 3 for nPage,
'but instead we will use the SAVE_APPEND flag
RasterAnn.AnnRotate False, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 45, False
RasterAnn.AnnSaveMemory hGlobal, uFormat, False, lSize, SAVE_APPEND, 0

'Verify contents of file
nRet = RasterAnn.AnnFileInfoMemory (hGlobal, lSize)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE
strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = ""
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)
strMsg = strMsg + "Total Size: " + Str(lSize) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation Memory File"
End If

'Now delete the second page, and display information
RasterAnn.AnnDeletePageMemory hGlobal, 2
lSize = RasterAnn.AnnPageMemorySize
'Verify contents of file
nRet = RasterAnn.AnnFileInfoMemory (hGlobal, lSize)
If (nRet = 0) Then
Select Case RasterAnn.AnnInfoFormat
Case ANN_FMT_NATIVE ' Cut command.
strFormat = "ANN_FMT_NATIVE"
Case ANN_FMT_WMF ' Copy command.
strFormat = "ANN_FMT_WMF"
Case ANN_FMT_ENCODED ' Clear command.
strFormat = "ANN_FMT_ENCODED"
Case Else
strFormat = "Unknown"
End Select

strMsg = ""
strMsg = strMsg + "Format: " + strFormat + Chr(13)
strMsg = strMsg + "Version: " + Str(RasterAnn.AnnInfoVersion) + Chr(13)
strMsg = strMsg + "Total Pages: " + Str(RasterAnn.AnnInfoTotalPages) + Chr(13)
strMsg = strMsg + "Total Size: " + Str(lSize) + Chr(13)

MsgBox strMsg
Else
MsgBox "Invalid Annotation File"
End If

'If finished with hGlobal, then free the memory by calling GlobalFree
End Sub


AnnDeleteUserHandle example for Visual Basic

'This examples deletes the first user handles of an object
Private Sub ExampleAnnDeleteUserHandle(hObject As Long)
Dim Count As Long

RasterAnn.AnnGetUserHandles(hObject)
Count = RasterAnn.UserHandleCount

If Count > 0 Then
RasterAnn.AnnDeleteUserHandle hObject, 0
Else
MsgBox "No User Handle"
End If

End Sub


AnnDestroy example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub Command4_Click()
RasterAnn.AnnDestroy RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED
End Sub


AnnEnableZoomView Example for Visual Basic

Dim RasterAnn As LEADRasterAnnotation
Private Sub CreateZoomView_Click()
Dim RasterIO As New LEADRasterIO
Dim ZoomView As New LEADRasterZoomView
Dim nBitmapWidth, nBitmapHeight As Long
Dim nZoomViewWidth, nZoomViewHeight As Long

Set RasterAnn = New LEADRasterAnnotation

'Loading Annotation File
RasterIO.Load LEADRasterView1.Raster, "C:\Ann.tif", 0, 0, 1
LEADRasterView1.DoubleBuffer = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
RasterAnn.AnnParentRasterView = LEADRasterView1
RasterAnn.AnnUserMode = ANN_USERMODE_RUN
RasterAnn.AnnEnableZoomView = True
RasterAnn.AnnLoad "c:\Ann.tif", 0

'Create the source rectangle in the center of the bitmap
ZoomView.SrcTop = 0
ZoomView.SrcLeft = 0
ZoomView.SrcHeight = 200 * 100
ZoomView.SrcWidth = 200 * 100

'Zoom View destination rectangle will be to the left of the source rectangle
ZoomView.DstTop = 0
ZoomView.DstLeft = ZoomView.SrcLeft + 50 * 100

'Setting Zoom View destination rectangle properties
ZoomView.BorderStyle = ZOOM_VIEW_BORDERSTYLE_3D

'Setting Zoom View Source rectangle properties
ZoomView.SrcBorderStyle = SOURCE_BORDERSTYLE_3D
ZoomView.ZoomFactor = 200
ZoomView.Enabled = True
ZoomView.ForceDst = False

'Assign Annotation Container to the Zoom View
ZoomView.AnnContainer = RasterAnn.AnnContainer
LEADRasterView1.CreateZoomView ZoomView
End Sub


AnnEncryptApply example for Visual Basic

Private Sub ExampleEncrypter(hObject As Long)

Dim ObjectType As AnnObjectType

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_ENCRYPT Then
MsgBox "This Object is not an Encrypt Object"
End If

RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_ALL
RasterAnn.AnnGetEncryptOptions hObject

If IsNull(RasterAnn.AnnEncryptOptions.EncryptRaster) Then
MsgBox "The encrypt object is not associated with a bitmap."
Exit Sub
End If
If RasterAnn.AnnEncryptOptions.EnableEncryptor = False Then
MsgBox "This object is a decryptor"
End If

'change the key to 123
RasterAnn.AnnEncryptOptions.Key = 123
RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_KEY
RasterAnn.AnnEncryptOptions.EnableSaveEncryptorKey = True
RasterAnn.AnnEncryptOptions.EnableSaveDecryptorKey = True
RasterAnn.AnnEncryptOptions.EnableClearEncryptorKey = True
RasterAnn.AnnEncryptOptions.EnableClearDecryptorKey = True
RasterAnn.AnnEncryptOptions.EnableNeverEncrypted = False
RasterAnn.Flags = 0
RasterAnn.AnnSetEncryptOptions hObject

RasterAnn.AnnEncryptApply hObject, ANN_ENCRYPTAPPLY_ENCRYPTOR

nRet = MsgBox("Encryptor has been applied. Would you like to remove the encryption?", vbYesNo)

If nRet = vbYes Then
RasterAnn.AnnEncryptApply hObject, ANN_ENCRYPTAPPLY_DECRYPTOR
End If

End Sub


AnnEnumerate example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example causes the AnnEnumerate event to get fired for all annotations in the container.
Private Sub AnnEnumerate_Click()
RasterAnn.AnnEnumerate RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, ""
End Sub

Private Sub RasterAnn_OnAnnEnumerate(ByVal hObject As Long)
MsgBox "Annotation Handle: " & Hex(hObject)
End Sub


AnnEnumerate method example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example enumerates through all objects in the AnnContainer
'For each object, the AnnEnumerate event is fired
Private Sub AnnEnumerate_Click()
RasterAnn.AnnEnumerate RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, ""
End Sub


AnnEnumerateHandle example for Visual Basic

Private Sub ExampleAnnEnumerateHandles(hObject As Long)

RasterAnn.EnableFireEnumerateHandleEvent = True
RasterAnn.AnnEnumerateHandle hObject

End Sub

Private Sub RasterAnn_OnEnumerateHandle(ByVal hObject As Long, ByVal AnnHandleInfo As LTANNLib.ILEADRasterAnnHandleInfo)

AnnHandleInfo.EnableVisible = True

If AnnHandleInfo.Type = ANN_HANDLE_TYPE_DEFAULT_HANDLE Then
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_SQUARE
AnnHandleInfo.FillColor = RGB(0, 0, 255)
AnnHandleInfo.PenColor = RGB(0, 255, 0)
AnnHandleInfo.ID = 100
AnnHandleInfo.ClientX = 20
AnnHandleInfo.ClientY = 20
AnnHandleInfo.ContainerX = 100
AnnHandleInfo.ContainerY = 100

Else
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_CIRCLE
AnnHandleInfo.FillColor = RGB(0, 255, 0)
AnnHandleInfo.PenColor = RGB(0, 0, 255)
AnnHandleInfo.ID = 50
AnnHandleInfo.ClientX = 10
AnnHandleInfo.ClientY = 10
AnnHandleInfo.ContainerX = 50
AnnHandleInfo.ContainerY = 50

End If
MsgBox "The handle with index = " + Str(AnnHandleInfo.Index) + "was updated"
MsgBox "The Total number of handles = " + Str(AnnHandleInfo.TotalHandles)
RasterAnn.StopFireEnumerateHandleEvent = False

End Sub


AnnEnumerateTextToken example for Visual Basic

Private Sub ExampleAnnEnumerateTextTokenTable(hObject As Long)

RasterAnn.EnableFireEnumerateTextTokenTableEvent = True
RasterAnn.AnnEnumerateTextToken

End Sub

Private Sub RasterAnn_OnEnumerateTextTokenTable(ByVal nTextTokenCount As Long, ByVal bstrToken As String, ByVal bstrDescription As String, ByVal bstrTokenString As String, ByVal TokenType As LTANNLib.AnnTokenTextType)

If TokenType = ANN_TOKEN_TEXT Then
bstrToken = "F"
bstrDescription = "Company Name"
bstrTokenString = "Your Company Name"
Else
bstrDescription = "Not ANN_TOKEN_TEXT"
End If

RasterAnn.StopFireEnumerateTextTokenTableEvent = False

End Sub


AnnFixed example for Visual Basic

Private Sub ExampleAnnFixed(hObject As Long)
Dim bFixed As Boolean

bFixed = RasterAnn.AnnFixed(hObject)

bFixed = Not bFixed

RasterAnn.EnableAdjust = True

RasterAnn.AnnFixed(hObject) = bFixed

If bFixed = True Then
MsgBox "Fixed"
Else
MsgBox "Not Fixed"
End If

End Sub


AnnGetAutoMenuItemEnable example for Visual Basic

'This example disables the "delete" menu item from the annotation hGlobalAnn.
'Global Declaration: Dim long hGlobalAnn
Private Sub AnnGetAutoMenuEnable_Click()
Dim iEnable As AnnMenuConstants

RasterAnn.AnnSetAutoMenuItemEnable hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, ""
RasterAnn.AnnGetAutoMenuItemEnable hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE
iEnable = RasterAnn.AnnAutoMenuItemEnable
Select Case iEnable
Case ANN_MENU_ENABLED:
MsgBox "ANN_MENU_ENABLED"
Case ANN_MENU_DISABLED
MsgBox "ANN_MENU_DISABLED"
Case ANN_MENU_DEFAULT
MsgBox "ANN_MENU_DEFAULT"
End Select
End Sub


AnnGetContainer Example for Visual Basic

Dim hPin As Long, h1 As Long, h2 As Long, hCont As Long
RasterAnn.AnnCreate ANN_OBJECT_CONTAINER, True, False
hCont = RasterAnn.AnnObject

If hCont <> 0 Then
hPin = RasterAnn.AnnCreateItem (hCont, ANN_OBJECT_PUSHPIN, False)
h1 = RasterAnn.AnnGetContainer (hCont)
h2 = RasterAnn.AnnGetTopContainer (hPin)
If h1 = h2 And h1 = RasterAnn.AnnContainer Then
MsgBox "root container is same as that of RasterAnn"
End If
End If


AnnGetDistance2 example for Visual Basic

Private Sub ExampleAnnGetDistance2(hObject As Long)

Dim ObjectType As AnnObjectType
Dim Count As Long
Dim TotalDistnation As Double
Dim TotalRulerUnit As Long
Dim TotalSmartUnit As Long
Dim Distance As Double
Dim RulerUnit As Long
Dim SmartUnit As Long
Dim szResult As String

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_RULER Then
MsgBox "This Object is not an RULER Object"
End If

RasterAnn.AnnGetDistance2 hObject

Count = RasterAnn.DistanceCount

TotalDistance = RasterAnn.TotalDistance
TotalRulerUnit = RasterAnn.TotalRulerUnit
TotalSmartUnit = RasterAnn.TotalSmartUnit

szResult = "Total Distance = " + Str(TotalDistance) + Chr$(13) + _
"Total Ruler Unit = " + Str(TotalRulerUnit) + Chr$(13) + _
"Total Smart Unit = " + Str(TotalSmartUnit)

MsgBox szResult

For i = 0 To Count - 1
Distance = RasterAnn.Distance(i)
RulerUnit = RasterAnn.RulerUnit(i)
SmartUnit = RasterAnn.SmartUnit(i)

szResult = "Distance Index = " + Str(i) + Chr$(13) + _
"Distance = " + Str(Distance) + Chr$(13) + _
"Ruler Unit = " + Str(RulerUnit) + Chr$(13) + _
"Smart Unit = " + Str(SmartUnit)

MsgBox szResult

Next i

End Sub


AnnGetGrouping example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example toggles the 'group' state of all objects in the main container
Private Sub Command15_Click()
Dim bGroup As Boolean

'Get current group state
bGroup = RasterAnn.AnnGetGrouping (RasterAnn.AnnContainer)

'Toggle the group state
RasterAnn.AnnSetGrouping RasterAnn.AnnContainer, Not bGroup, 0

'Display the group state
If RasterAnn.AnnGetGrouping(RasterAnn.AnnContainer) Then
MsgBox "Objects in AnnContainer are grouped"
Else
MsgBox "Objects in AnnContainer are not grouped"
End If
End Sub


AnnGetHyperlinkParam example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example retrieves parameters using AnnGetHyperlinkParam.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub AnnGetHyperlinkParam_Click()
Dim nParam0 As Long
Dim nParam1 As Long
Dim nParam2 As Long
Dim nParam3 As Long
Dim nParam4 As Long

RasterAnn.AnnSetHyperlinkMsg hGlobalAnn, ANN_LINK_ANNEVENT5, 1, 2, 3, 4, 5

RasterAnn.AnnGetHyperlinkParam hGlobalAnn, 0
nParam0 = RasterAnn.AnnHyperlinkParam
RasterAnn.AnnGetHyperlinkParam hGlobalAnn, 1
nParam1 = RasterAnn.AnnHyperlinkParam
RasterAnn.AnnGetHyperlinkParam hGlobalAnn, 2
nParam2= RasterAnn.AnnHyperlinkParam
RasterAnn.AnnGetHyperlinkParam hGlobalAnn, 3
nParam3 = RasterAnn.AnnHyperlinkParam
RasterAnn.AnnGetHyperlinkParam hGlobalAnn, 4
nParam4 = RasterAnn.AnnHyperlinkParam

MsgBox "HyperlinkParams: " & nParam0 & "," & nParam1 & "," & nParam2 & "," & nParam3 & "," & nParam4
End Sub


AnnGetHyperlinkString example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This examples assumes that hGlobalAnn is a handle to a button annotation.
'A hyperlink string is set and retrieved
Private Sub AnnGetHyperlinkString_Click()
Dim szString As String
RasterAnn.AnnSetHyperlinkString hGlobalAnn, ANN_LINK_WEBPAGE, "http://www.leadtools.com"
RasterAnn.AnnGetHyperlinkString hGlobalAnn
szString = RasterAnn.AnnHyperlinkString
MsgBox szString
End Sub


AnnGetHyperlinkType example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This examples determines the type of the hyperlink and then displays the
'params if the type is ANN_LINK_ANNEVENT or ANN_LINK_ANNEVENT5

Private Sub RasterAnn_OnAnnHyperLink(ByVal hObject As Long, ByVal iParamCount As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParam3 As Long, ByVal lParam4 As Long, ByVal lParam5 As Long)
Dim msgStr As String
Dim nType As Integer

RasterAnn.AnnGetHyperlinkType hObject
nType = RasterAnn.AnnHyperlinkType
If ((nType = ANN_LINK_ANNEVENT5) Or (nType = ANN_LINK_ANNEVENT)) Then
If iParamCount >= 0 Then
msgStr = CStr(iParamCount) & " params are valid" & Chr(13)
End If
If iParamCount >= 1 Then
msgStr = msgStr & "Param1: " & CStr(lParam1) & Chr(13)
End If
If iParamCount >= 2 Then
msgStr = msgStr & "Param2: " & CStr(lParam2) & Chr(13)
End If
If iParamCount >= 3 Then
msgStr = msgStr & "Param3: " & CStr(lParam3) & Chr(13)
End If
If iParamCount >= 4 Then
msgStr = msgStr & "Param4: " & CStr(lParam4) & Chr(13)
End If
If iParamCount = 5 Then
msgStr = msgStr & "Param5: " & CStr(lParam5) & Chr(13)
End If
Else
msgStr = "Invalid Type"
End If
MsgBox msgStr
End Sub


AnnGetNameOffsetX Example for Visual Basic

'This sample shifts the NameOffset of the annotation object hObject
'two pixels in the X direction and one pixel in the Y direction
Private Sub SampleNameOffset(hObject As Long)
Dim OffsetX As Long
Dim OffsetY As Long
OffsetX = RasterAnn.AnnGetNameOffsetX(hObject)
OffsetY = RasterAnn.AnnGetNameOffsetY (hObject)

OffsetX = OffsetX + 2
OffsetY = OffsetY + 1
MsgBox "Shifting Name Offset to " + CStr(OffsetX) + "," + CStr(OffsetY)

RasterAnn.AnnSetNameOffsetX hObject, OffsetX, False
RasterAnn.AnnSetNameOffsetY hObject, OffsetY, False
End Sub


AnnGetNameRestrict Example for Visual Basic

'This sample toggles the bNameRestrict property of the annotation object hObject
Private Sub SampleNameRestrict(hObject As Long)
Dim bNameRestrict As Boolean
bNameRestrict = RasterAnn.AnnGetNameRestrict (hObject)
MsgBox "Changing bNameRestrict property to " + Str(Not bNameRestrict)
RasterAnn.AnnSetNameRestrict hObject, Not bNameRestrict, False
End Sub


AnnGetObjectFromTag example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example retrieves the annotation handle for any tag
Private Sub AnnGetObjectFromTag_Click()
Dim hTagObject As OLE_HANDLE
Dim sTag As String
Dim lTag As Long
sTag = InputBox("Which tag should I find?")
RasterAnn.AnnGetObjectFromTag RasterAnn.AnnContainer, CInt(sTag), False
hTagObject = RasterAnn.AnnTagObject

RasterAnn.AnnGetTag hTagObject
lTag = RasterAnn.AnnTag

If (CInt(sTag) = lTag) Then
MsgBox "Annotation Found with tag " & CInt(sTag) & ": " & Hex(hTagObject)
Else
MsgBox "Annotation NOT found with tag " & CInt(sTag)
End If
End Sub


AnnGetPoint... example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'In the AnnDrawn event, this example checks to see if the annotation object is a polygon.
'If it is a polygon, the example gets the number of points that define the object;
'then it gets the arrays of X and Y coordinates and displays the points in a message box.
Private Sub RasterAnn_OnAnnDrawn(ByVal hAnnObject As Long)
Dim nType As Long
Dim a As Integer
Dim RasterVarX As New LEADRasterVariant
Dim RasterVarY As New LEADRasterVariant
Dim nPoints As Long 'number of points in the object
Dim msgStr
RasterAnn.AnnGetType hAnnObject
nType = RasterAnn.AnnType
If nType = ANN_OBJECT_POLYGON Then 'Is the object a polygon?
MsgBox "Object is a Polygon"
RasterAnn.AnnGetPointCount hAnnObject
nPoints = RasterAnn.AnnPointCount 'get the number of points
RasterAnn.AnnGetPointX hAnnObject, RasterVarX 'get the X coordinates
RasterAnn.AnnGetPointY hAnnObject, RasterVarY 'get the Y coordinates
msgStr = "("
For a = 1 To nPoints
msgStr = msgStr & "{" & CStr(RasterVarX.FloatValue(a - 1)) & "," & CStr(RasterVarY.FloatValue(a - 1)) & "}"
Next
msgStr = msgStr & ")"
MsgBox msgStr, vbOKOnly, "The Polygon's " & CStr(nPoints) & " points are:"
End If
End Sub


AnnGetProtractorOptions Example for Visual Basic

Dim ArcRadius As Single, bAcute As Boolean, nUnit As Integer, nPrecision As Integer, abbr As String
abbr = RasterAnn.AnnGetProtractorOptions (hProt)
bacute = RasterAnn.AnnProtractorAcute
nunit = RasterAnn.AnnProtractorUnit
nprecision = RasterAnn.AnnProtractorPrecision
arcRadius = RasterAnn.AnnProtractorArcRadius
RasterAnn.AnnSetProtractorOptions hProt, bAcute = False, 1 - ANN_ANGLE_DEGREES, abbr, (nPrecision + 1) Mod 5, ArcRadius, False
RasterAnn.AnnSetShowFlags hProt, (RasterAnn.AnnGetShowFlags (hProt) + 1) Mod 4, False


AnnGetRgnHandle Example for Visual Basic

LEADRasterView1.Raster.SetRgnHandle RasterAnn.AnnGetRgnHandle (hPlgn), 1, 1, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED


AnnGetRotateOptions Example for Visual Basic

Private Sub ExampleAnnGetRotateOptions()
' This example displays if the annotation object displays
' rotate handles. If displaying rotate handles, the object
' is changed so that it does not display rotate handles.
' If not displaying rotate handles, the object is changed
' so that it displays rotate handles
Dim nRet As Integer
Dim szMsg As String
Dim hObject As Long

RasterAnn. AnnCreate ANN_OBJECT_TEXT, True, True
hObject = RasterAnn. AnnObject
RasterAnn. AnnRectLeft (hObject) = 0
RasterAnn. AnnRectTop (hObject) = 0
RasterAnn. AnnRectWidth (hObject) = 100
RasterAnn. AnnRectHeight (hObject) = 100

nRet = RasterAnn. AnnGetRotateOptions (hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES)
If (nRet <> 0) Then Exit Sub

MsgBox "Old State: AnnShowRotateHandles: " + Str(RasterAnn. AnnShowRotateHandles )

' Change the state
nRet = RasterAnn. AnnSetRotateOptions (hObject, Not RasterAnn.AnnShowRotateHandles, 0, ANN_ROTATE_SHOW_ROTATE_HANDLES, False)
If (nRet <> 0) Then Exit Sub

nRet = RasterAnn.AnnGetRotateOptions(hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES)
If (nRet <> 0) Then Exit Sub

MsgBox "New State: AnnShowRotateHandles: " + Str(RasterAnn.AnnShowRotateHandles)
End Sub


AnnGetScalarX Example for Visual Basic

MsgBox "ScalarX: " & RasterAnn.AnnGetScalarX (hCont) & ", ScalarY: " & RasterAnn.AnnGetScalarY (hCont) & ", OffsetX: " & RasterAnn.AnnGetOffsetX (hCont) & ", OffsetY: " & RasterAnn.AnnGetOffsetY (hCont)
RasterAnn.AnnSetScalarX hCont, 1.5, False
RasterAnn.AnnSetScalarY hCont, 1.5, False
RasterAnn.AnnSetOffsetX hCont, 10, False
RasterAnn.AnnSetOffsetY hCont, 20, False
MsgBox "ScalarX: " & RasterAnn.AnnGetScalarX (hCont) & ", ScalarY: " & RasterAnn.AnnGetScalarY (hCont) & ", OffsetX: " & RasterAnn.AnnGetOffsetX (hCont) & ", OffsetY: " & RasterAnn.AnnGetOffsetY (hCont)


AnnGetSecondaryMetaFile example for Visual Basic

Private Sub ExampleAnnGetSecondryMetafile(hObject As Long)

Dim hMetafile1 As Long
Dim hMetafile2 As Long
Dim ObjectType As AnnObjectType
Dim bEncryptorOriginal As Boolean

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_ENCRYPT Then
MsgBox "This Object is not an encryptor."
End If

hMetafile1 = RasterAnn.AnnGetMetafile(hObject)
hMetafile2 = RasterAnn.AnnGetSecondaryMetafile(hObject)

RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_ALL
RasterAnn.AnnGetEncryptOptions(hObject)

bEncryptorOriginal = RasterAnn.AnnEncryptOptions.EnableEncryptor

'Set state to Decryptor and set Decryptor metafile
RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_TYPE
RasterAnn.Flags = 0
RasterAnn.AnnEncryptOptions.EnableEncryptor = True
RasterAnn.AnnSetEncryptOptions (hObject)
RasterAnn.AnnSetMetafile hObject, hMetafile2, ANN_METAFILE_USER, False

'Set state to Decryptor and set Decryptor metafile
RasterAnn.Flags = 0
RasterAnn.AnnEncryptOptions.EnableEncryptor = True
RasterAnn.AnnSetEncryptOptions (hObject)
RasterAnn.AnnSetMetafile hObject, hMetafile2, ANN_METAFILE_USER, False

RasterAnn.AnnEncryptOptions.EnableEncryptor = bEncryptorOriginal
RasterAnn.Flags = 0
RasterAnn.AnnSetEncryptOptions (hObject)

End Sub


AnnGetSelectList example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example gets the number of selected annotation objects; then it gets an array of the selected object handles and checks to see if any of the objects in the array are polygons.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1
Dim lType As Long
Dim a As Integer
Dim bSelected As Boolean
Dim uCount As Integer
Dim RasterVar As New LEADRasterVariant
bSelected = False
RasterAnn.AnnGetSelectCount
uCount = RasterAnn.AnnSelectCount 'get number of selected objects
RasterAnn.AnnGetSelectList RasterVar 'get the handles of the selected objects
MsgBox CStr(uCount) & " objects were selected"
For a = 1 To uCount
RasterAnn.AnnGetType RasterVar.LongItemValue(a - 1)
lType = RasterAnn.AnnType
If lType = ANN_OBJECT_POLYGON Then 'Is the object a polygon?
bSelected = True
End If
Next
If bSelected <> True Then
MsgBox "No Polygon Objects were selected"
End If


AnnGetUserData example for Visual Basic

Private Sub SampleAnnUserData(hObject As Long)

Dim UserData As New LEADRasterVariant
UserData.Type = VALUE_STRING
UserData.StringValue = "This is Sample Code"

RasterAnn.Flags = ANN_FLAG_NOINVALIDATE
RasterAnn.AnnSetUserData hObject, UserData

UserData.Type = VALUE_STRING
RasterAnn.AnnGetUserData hObject, UserData

MsgBox UserData.StringValue

End Sub


AnnGetUserHandles example for Visual Basic

Private Sub ExampleAnnUserHandles(hObject As Long)
Dim Count As Long

RasterAnn.AnnGetUserHandles(hObject)
Count = RasterAnn.UserHandleCount

If Count > 0 Then
For i = 0 To Count - 1

MsgBox "uIndex = " + Str(i) + Chr$(13) _
+ "nID = " + Str(RasterAnn.UserHandle(i).ID) + Chr(13) _
+ "ContainerX = " + Str(RasterAnn.UserHandle(i).ContainerX) + Chr(13) _
+ "ContainerY = " + Str(RasterAnn.UserHandle(i).ContainerY) + Chr(13) _
+ "CliantX = " + Str(RasterAnn.UserHandle(i).ClientX) + Chr(13) _
+ "ClientY = " + Str(RasterAnn.UserHandle(i).ClientY) + Chr(13) _
+ "bVisible = " + Str(RasterAnn.UserHandle(i).EnableVisible) + Chr(13) _
+ "PenColor = " + Str(RasterAnn.UserHandle(i).PenColor) + Chr(13) _
+ "FillColor = " + Str(RasterAnn.UserHandle(i).FillColor) + Chr(13) _
+ "Shape = " + Str(RasterAnn.UserHandle(i).Shape) + Chr(13)
Next i

Else
MsgBox "No User Handles"
End If

End Sub


AnnGetVisible example for Visual Basic

'This example toggles the visible state of the annotation container.
Private Sub GetVisible_Click()
Dim bVisible As Boolean
RasterAnn.AnnGetVisible RasterAnn.AnnContainer
bVisible = RasterAnn.AnnVisible
RasterAnn.AnnSetVisible RasterAnn.AnnContainer, Not bVisible, ANN_FLAG_RECURSE, ""
RasterAnn.AnnGetVisible RasterAnn.AnnContainer
bVisible= RasterAnn.AnnVisible
MsgBox "AnnGetVisible: " & bVisible
End Sub


AnnGroup example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub Command6_Click()
RasterAnn.AnnGroup RasterAnn.AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, ""
End Sub


AnnHandle example for Visual Basic

Private Sub ExampleAnnUserHandle(hObject As Long)
Dim Count As Long

RasterAnn.AnnGetUserHandles(hObject)
Count = RasterAnn.UserHandleCount

If Count > 0 Then
RasterAnn.AnnGetUserHandle hObject, 0

MsgBox "uIndex = " + Str(0) + Chr$(13) _
+ "nID = " + Str(RasterAnn.AnnHandle.ID) + Chr(13) _
+ "ContainerX = " + Str(RasterAnn.AnnHandle.ContainerX) + Chr(13) _
+ "ContainerY = " + Str(RasterAnn.AnnHandle.ContainerY) + Chr(13) _
+ "CliantX = " + Str(RasterAnn.AnnHandle.ClientX) + Chr(13) _
+ "ClientY = " + Str(RasterAnn.AnnHandle.ClientY) + Chr(13) _
+ "bVisible = " + Str(RasterAnn.AnnHandle.EnableVisible) + Chr(13) _
+ "PenColor = " + Str(RasterAnn.AnnHandle.PenColor) + Chr(13) _
+ "FillColor = " + Str(RasterAnn.AnnHandle.FillColor) + Chr(13) _
+ "Shape = " + Str(RasterAnn.AnnHandle.Shape) + Chr(13)

Else
MsgBox "No User Handles"
End If

End Sub


AnnHitTest Example for Visual Basic

If RasterAnn.AnnHitTest (RasterAnn.AnnContainer, 100, 100) = ANN_HIT_BODY Then
hObj = RasterAnn.AnnHitTestObject
RasterAnn.AnnSetName hObj, True, "AnnHitFound", False
Dim objType As AnnObjectType
RasterAnn.AnnGetType hObj
ObjType = RasterAnn.AnnType
If objType = ANN_OBJECT_TEXT Then
CommonDialog1.FontBold = RasterAnn.AnnGetFontBold (hObj)
CommonDialog1.FontItalic = RasterAnn.AnnGetFontItalic (hObj)
CommonDialog1.FontStrikethru = RasterAnn.AnnGetFontStrikeThrough (hObj)
CommonDialog1.FontUnderline = RasterAnn.AnnGetFontUnderline (hObj)
CommonDialog1.FontName = RasterAnn.AnnGetFontName (hObj)
CommonDialog1.FontSize = RasterAnn.AnnGetFontSize (hObj)
CommonDialog1.Flags = cdlCFBoth
CommonDialog1.ShowFont
RasterAnn.AnnSetFontBold hObj, CommonDialog1.FontBold, False
RasterAnn.AnnSetFontItalic hObj, CommonDialog1.FontItalic, False
RasterAnn.AnnSetFontStrikeThrough hObj, CommonDialog1.FontStrikethru, False
RasterAnn.AnnSetFontUnderline hObj, CommonDialog1.FontUnderline, False
RasterAnn.AnnSetFontName hObj, CommonDialog1.FontName, False
RasterAnn.AnnSetFontSize hObj, CommonDialog1.FontSize, False
Dim bShow As Boolean
RasterAnn.AnnSetText hObj, RasterAnn.AnnGetText(hObj) + RasterAnn.AnnGetName (hObj, bShow), False
End If
End If


AnnHitTestExt example for Visual Basic

'This example uses the caller's mouse coordinates to get the handle
' to the annotation object at the specified coordinates.
' The part of the clicked annotation is displayed in the Output window.
' If the result of the hittest is a user handle, additional information about the handle is displayed.
Private Sub ExampleAnnHitTestExt(hContainer As Long, PointToTestX As Long, PointToTestY As Long, hAnnObject As Long)

Dim szResult As String

RasterAnn.AnnHitTestExt hContainer, PointToTestX, PointToTestY
If RasterAnn.ObjectHitHandle = 0 Then
MsgBox "There is no object to hit test."
Exit Sub
End If

Select Case RasterAnn.PositionResult
Case ANN_HIT_NONE
szResult = "ANN_HIT_NONE"

Case ANN_HIT_BODY
szResult = "ANN_HIT_BODY"

Case ANN_HIT_NAME
szResult = "ANN_HIT_NAME"

Case ANN_HIT_HANDLE
szResult = "ANN_HIT_HANDLE HandleIndex = " + Chr(RasterAnn.HandleIndex) + "HandleId = " + Chr(RasterAnn.HandleID)

Case ANN_HIT_USER_HANDLE
szResult = "ANN_HIT_USER_HANDLE HandleIndex = " + Chr(RasterAnn.HandleIndex) + "HandleId = " + Chr(RasterAnn.HandleID)

End Select

MsgBox szResult

End Sub


AnnHyperlink example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub RasterAnn_OnAnnHyperLink(ByVal hObject As Long, ByVal iParamCount As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParam3 As Long, ByVal lParam4 As Long, ByVal lParam5 As Long)
Dim msgstr As String
Dim nType As Integer

RasterAnn.AnnGetHyperlinkType hObject
nType = RasterAnn.AnnHyperlinkType
If ((nType = ANN_LINK_ANNEVENT5) Or (nType = ANN_LINK_ANNEVENT)) Then
If iParamCount >= 0 Then
msgstr = CStr(iParamCount) & " params are valid" & Chr(13)
End If
If iParamCount >= 1 Then
msgstr = msgstr & "Param1: " & CStr(lParam1) & Chr(13)
End If
If iParamCount >= 2 Then
msgstr = msgstr & "Param2: " & CStr(lParam2) & Chr(13)
End If
If iParamCount >= 3 Then
msgstr = msgstr & "Param3: " & CStr(lParam3) & Chr(13)
End If
If iParamCount >= 4 Then
msgstr = msgstr & "Param4: " & CStr(lParam4) & Chr(13)
End If
If iParamCount = 5 Then
msgstr = msgstr & "Param5: " & CStr(lParam5) & Chr(13)
End If
Else
msgstr = "Invalid Type"
End If
MsgBox msgstr
End Sub


AnnHyperlinkMenu example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'The AnnHyperLinkMenu event occurs whenever the user clicks on the Hyperlink menu item provided for automated annotations.
'The menu item is enabled and disabled using AnnHyperlinkMenuEnable property.
'The following is an example of AnnHyperlinkMenu event code, which includes a call to AnnSetHyperlinkMsg.
Private Sub RasterAnn_OnAnnHyperLinkMenu(ByVal aObjects As LEADRasterVariant, ByVal uCount As Integer)
Dim x As Integer

'set HyperLink to type ANNLINK_ANNEVENT5
'and set the 5 params to some values.
For x = 0 To uCount - 1
RasterAnn.AnnSetHyperlinkMsg aObjects.LongItemValue(x), ANN_LINK_ANNEVENT5, 5, 4, 3, 2, 1
Next

End Sub


AnnHyperlinkMenuEnable example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example toggles the AnnHyperlinkMenuEnable property .

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'toggle AnnHyperLinkMenu item and event
RasterAnn.AnnHyperlinkMenuEnable = Not RasterAnn.AnnHyperlinkMenuEnable
MsgBox "AnnHyperlinkMenuEnable: " & RasterAnn.AnnHyperlinkMenuEnable


AnnInsert example for Visual Basic

Note: This topic is for Document/Medical only.

'This example
'1. creates an ellipse annotation object
'2. sizes the ellipse
'3. inserts the ellipse into the annotation container
Private Sub AnnInsert_Click()
Dim hEllipseObject As Long
RasterAnn.AnnCreate ANN_OBJECT_ELLIPSE, False, True
hEllipseObject = RasterAnn.AnnObject

RasterAnn.AnnRectLeft(hEllipseObject) = 0
RasterAnn.AnnRectTop(hEllipseObject) = 0
RasterAnn.AnnRectWidth(hEllipseObject) = 100
RasterAnn.AnnRectHeight(hEllipseObject) = 100

RasterAnn.AnnInsert RasterAnn.AnnContainer, hEllipseObject, False
End Sub


AnnInsertTokenTable example for Visual Basic

Private Sub ExampleAnnTextToken()
RasterAnn.Token = "A"
RasterAnn.Description = "Two Digit Month"
RasterAnn.TokenString = " "
RasterAnn.TokenType = ANN_TOKEN_DATE_MM

RasterAnn.AnnInsertTokenTable

RasterAnn.Token = "B"
RasterAnn.Description = "Two Digit day"
RasterAnn.TokenString = " "
RasterAnn.TokenType = ANN_TOKEN_DATE_DD

RasterAnn.AnnInsertTokenTable

RasterAnn.Token = "C"
RasterAnn.Description = "Two Digit day"
RasterAnn.TokenString = " "
RasterAnn.TokenType = ANN_TOKEN_DATE_YYYY

RasterAnn.AnnInsertTokenTable

RasterAnn.AnnDeleteTokenTable "B"

RasterAnn.Token = "D"
RasterAnn.Description = " "
RasterAnn.TokenString = " "
RasterAnn.TokenType = ANN_TOKEN_SEPARATOR

RasterAnn.AnnClearTokenTable

End Sub


AnnIsFixedRect example for Visual Basic

Private Sub ExampleAnnIsFixedInRect(hObject As Long, WndLeft As Long, WndTop As Long, WndRight As Long, WndBottom As Long)
Dim bFixedInRect As Boolean

RasterAnn.Flags = ANN_FLAG_RECURSE
bFixedInRect = RasterAnn.AnnIsFixedRect(hObject, WndLeft, WndTop, WndRight, WndBottom)

If bFixedInRect = True Then
MsgBox "There are Fixed annotations visible."
Else
MsgBox "There are No Fixed annotations visible."
End If

End Sub


AnnLoadArray example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub AnnLoadArray_Click()
Dim RasterVar As New LEADRasterVariant
RasterVar.Type = VALUE_STRING
Open "c:\test.ann" For Binary Access Read As #1
RasterVar.StringValue = Input(4000, #1)
RasterAnn.AnnLoadArray RasterVar, 4000, 1
Close #1
End Sub


AnnLock example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example locks objects of type ANN_OBJECT_ELLIPSE using the key "IkeStarnes".
Private Sub AnnLock_Click()
Dim lType As Long
Dim a As Integer
Dim bSelected As Boolean
Dim uCount As Integer
Dim RasterVar As New LEADRasterVariant

'lock only the ellipse objects that are selected

bSelected = False
RasterAnn.AnnGetSelectCount
uCount = RasterAnn.AnnSelectCount 'get number of selected objects
RasterAnn.AnnGetSelectList RasterVar 'get the handles of the selected objects
For a = 1 To uCount
RasterAnn.AnnGetType RasterVar.LongItemValue(a - 1)
lType = RasterAnn.AnnType

If lType = ANN_OBJECT_ELLIPSE Then 'Is the object an ellipse?
bSelected = True
RasterAnn.AnnLock RasterVar.LongItemValue(a - 1), "IkeStarnes", False
End If
Next
If bSelected <> True Then
MsgBox "No Ellipse Objects were selected"
End If
End Sub


AnnLocked example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'The following is an example of an AnnLocked event.
Private Sub RasterAnn_OnAnnLocked(ByVal hAnnObject As Long)
MsgBox "AnnObject: " & CStr(hAnnObject) & " was locked!"
End Sub


AnnMenu example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub RasterAnn_OnAnnMenu(ByVal hMenu As Long)
Dim szout As String
Dim nID As Integer
Dim RasAnnMenu As LEADRasterAnnMenu
Dim AnnPopupMenu As LEADRasterAnnMenu
Dim x As Integer

Set RasAnnMenu = CreateObject("LEADRasterAnnMenu.LEADRasterAnnMenu. ")

RasAnnMenu.SetAnnMenu hMenu
RasAnnMenu.EnableMethodErrors = False
szout = "There are " + CStr(RasAnnMenu.Count) + " Items"
MsgBox szout
szout = "Original Text for item#2: "
szout = szout + RasAnnMenu.ItemString(1)
MsgBox szout
'set new string
RasAnnMenu.ItemString(1) = "TestText"
szout = "Custom Text for item#2: "
szout = szout + RasAnnMenu.ItemString(1)
MsgBox szout

'make 3rd and 4th menu items have the same command id
nID = RasAnnMenu.ItemID(3)
RasAnnMenu.ItemID(2) = nID

'check all unchecked menu items that are not popup submenus
'disable all enabled menu items that are not popup submenus
For x = 0 To RasAnnMenu.Count
If RasAnnMenu.ItemType(x) = ANN_MENUITEMTYPE_NORMAL Then
If RasAnnMenu.ItemChecked(x) Then
RasAnnMenu.ItemChecked(x) = True
End If
If RasAnnMenu.ItemEnabled(x) Then
RasAnnMenu.ItemEnabled(x) = False
End If
End If
Next x

'insert 2 user-defined menu items
RasAnnMenu.AddItem "Test&1", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 0, RasAnnMenu.Count - 1
RasAnnMenu.AddItem "Test&2", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 1, RasAnnMenu.Count - 1

'delete the last menu item
RasAnnMenu.DeleteItem (RasAnnMenu.Count - 1)

'delete the first menu item
RasAnnMenu.DeleteItem (0)

'insert a popup menu
RasAnnMenu.AddItem "Popup", ANN_MENUITEMTYPE_SUBMENU, 0, RasAnnMenu.Count

'get the new item, and add some items to it
RasAnnMenu.GetSubMenu RasAnnMenu.Count - 1, AnnPopupMenu

AnnPopupMenu.AddItem "Popup&1", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 2, AnnPopupMenu.Count
AnnPopupMenu.AddItem "Popup&2", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 3, AnnPopupMenu.Count

End Sub

Private Sub RasterAnn_OnAnnUserMenu(ByVal nID As Long)
If nID = ANN_EVENT_MENUFIRST Then
RasterAnn.AnnFlip False, 0, True
Else
MsgBox "nID = ANN_EVENT_MENUFIRST + " + CStr(nID - ANN_EVENT_MENUFIRST)
End If
End Sub


AnnMouseDown example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example shows
'1.
'How to create a custom annotation (circle inside a square)
'Set the AnnTool property to ANN_TOOL_USER_FIRST to see how this works

'2.
'How to restrict the rectangle annotation to be a square
'Set AnnTool property to ANN_TOOL_RECTANGLE to see how this works

'Global declarations
Dim hRectObject As Long
Dim hEllipseObject As Long
Dim x0 As Long
Dim y0 As Long

Private Sub RasterAnn_OnAnnMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
x0 = x
y0 = y
Select Case RasterAnn.AnnTool
Case ANN_TOOL_USER_FIRST
' create the objects
RasterAnn.AnnSetSelected RasterAnn.AnnContainer, False, True
'Add an undo node to undo the creation of these objects.
RasterAnn.AnnAddUndoNode

RasterAnn.AnnCreate ANN_OBJECT_RECT, True, True
hRectObject = RasterAnn.AnnObject

RasterAnn.AnnCreate ANN_OBJECT_ELLIPSE, True, True
hEllipseObject = RasterAnn.AnnObject

' set the automation defaults to the objects newly created
RasterAnn.AnnSetAutoDefaults hRectObject, 0
RasterAnn.AnnSetAutoDefaults hEllipseObject, 0
' start defining them from the x, y coordinate
RasterAnn.AnnDefine hRectObject, x, y, ANN_DEFINE_BEGINSET
RasterAnn.AnnDefine hEllipseObject, x, y, ANN_DEFINE_BEGINSET
End Select

End Sub

Private Sub RasterAnn_OnAnnMouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
If Button = 1 Then
Select Case RasterAnn.AnnTool
Case ANN_TOOL_USER_FIRST
' update the objects from the x, y coordinate
RasterAnn.AnnDefine hRectObject, x, y, ANN_DEFINE_UPDATE
RasterAnn.AnnDefine hEllipseObject, x, y, ANN_DEFINE_UPDATE
Case ANN_TOOL_RECT
AdjustMousePos Shift, x, y
End Select
End If

End Sub

Private Sub RasterAnn_OnAnnMouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Select Case RasterAnn.AnnTool
Case ANN_TOOL_USER_FIRST
RasterAnn.AnnDefine hRectObject, x, y, ANN_DEFINE_END
RasterAnn.AnnDefine hEllipseObject, x, y, ANN_DEFINE_END
RasterAnn.AnnSetSelected hRectObject, True, False
RasterAnn.AnnSetSelected hEllipseObject, True, False
RasterAnn.AnnGroup RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, ""
hEllipseObject = 0
hRectObject = 0
Case ANN_TOOL_RECT
AdjustMousePos Shift, x, y
End Select

End Sub

Private Sub AdjustMousePos(ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim dx As Integer
Dim dy As Integer
If Shift = 1 Then
' if shift key is down, force the creation of squares
dx = Abs(x - x0)
dy = Abs(y - y0)
If (dx > dy) Then
' adjust y to be as far from y0 as x is from x0
If y > y0 Then y = y0 + dx Else y = y0 - dx
Else
' adjust x to be as far from x0 as y is from y0
If x > x0 Then x = x0 + dy Else x = x0 - dy
End If
' set the mouse cursor and update its position
RasterAnn.SetMousePos x, y, False
End If

End Sub


AnnMove example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example moves one or more selected annotation objects.
Private Sub AnnMove_Click()
Dim DeltaX As Integer
Dim DeltaY As Integer

'Use pixels
LEADRasterView1.ScaleMode = SCALEMODE_PIXEL

'Specify arbitrary delta values.
DeltaX = 20
DeltaY = -20

'Move the selected annotations.
RasterAnn.AnnMove DeltaX, DeltaY, True
End Sub


AnnNameBoundingRectLeft Example for Visual Basic

Private Sub ExampleAnnNameBoundingRect(hObject As Long)
Dim left, top, width, height As String
left = Str(RasterAnn.AnnNameBoundingRectLeft (hObject))
top = Str(RasterAnn.AnnNameBoundingRectTop (hObject))
width = Str(RasterAnn.AnnNameBoundingRectWidth (hObject))
height = Str(RasterAnn.AnnNameBoundingRectHeight (hObject))
MsgBox "Ann Name Bounding Rect: left[" + left + "], top[" + top + "], width[" + width + "], height[" + height + "]"
End Sub


AnnNameOptions example for Visual Basic

Private Sub ExampleAnnSetNameOptions(hObject As Long)
RasterAnn.AnnEnumerate hObject, ANN_FLAG_RECURSE Or ANN_FLAG_NOTCONTAINER, ""
End Sub

Private Sub RasterAnn_OnAnnEnumerate(ByVal hObject As Long)
Dim ObjectType As AnnObjectType

RasterAnn.AnnNameOptions.Flags = ANN_NAME_ALL
RasterAnn.AnnGetNameOptions hObject

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType = ANN_OBJECT_BUTTON Then
RasterAnn.AnnNameOptions.EnableShowName = False
RasterAnn.AnnNameOptions.AnnotationName = " Name Restricted"
RasterAnn.AnnNameOptions.EnableNameRestrict = False
RasterAnn.AnnNameOptions.EnableFontBold = False
RasterAnn.AnnNameOptions.EnableFontItalic = False
RasterAnn.AnnNameOptions.EnableFontStrikeOut = False
RasterAnn.AnnNameOptions.EnableFontUnderline = False
RasterAnn.AnnNameOptions.EnableNameBackTransparent = False
Else
RasterAnn.AnnNameOptions.EnableShowName = True
RasterAnn.AnnNameOptions.AnnotationName = " Name UnRestricted"
RasterAnn.AnnNameOptions.EnableNameRestrict = True
RasterAnn.AnnNameOptions.EnableFontBold = True
RasterAnn.AnnNameOptions.EnableFontItalic = True
RasterAnn.AnnNameOptions.EnableFontStrikeOut = True
RasterAnn.AnnNameOptions.EnableFontUnderline = True
RasterAnn.AnnNameOptions.EnableNameBackTransparent = True

End If

RasterAnn.AnnNameOptions.X = 10
RasterAnn.AnnNameOptions.Y = 10
RasterAnn.AnnNameOptions.FaceNameColor = RGB(0, 0, 0)
RasterAnn.AnnNameOptions.BackNameColor = RGB(255, 255, 255)
RasterAnn.AnnNameOptions.FontName = "Arial"
RasterAnn.AnnNameOptions.FontSize = 12

RasterAnn.AnnNameOptions.Flags = ANN_NAME_ALL
RasterAnn.AnnSetNameOptions hObject

End Sub


AnnNameRectLeft Example for Visual Basic

Private Sub ExampleAnnNameRect(hObject As Long)
Dim left, top, width, height As String
left = Str(RasterAnn.AnnNameRectLeft (hObject))
top = Str(RasterAnn.AnnNameRectTop (hObject))
width = Str(RasterAnn.AnnNameRectWidth (hObject))
height = Str(RasterAnn.AnnNameRectHeight (hObject))
MsgBox "Ann Name Rect: left[" + left + "], top[" + top + "], width[" + width + "], height[" + height + "]"


Annotation Colors Example for Visual Basic

Dim cr As Long
RasterIO.Load Raster1, "C:\TEMP\flagsel.bmp", 0, 1, 1
RasterAnn.AnnSetBitmap hStamp, Raster1, False
RasterAnn.AnnSetAutoBackColor RasterAnn.AnnAutomation, ANN_OBJECT_ALL, RGB(40, 80, 160)
cr = RasterAnn.AnnGetAutoBackColor (RasterAnn.AnnAutomation, ANN_OBJECT_POLYGON)
MsgBox "AutoBackColor: " & Hex(cr)

If RasterAnn.AnnGetTransparent (hStamp) = False Then
RasterAnn.AnnSetTransparent hStamp, True, False
End If

RasterAnn.AnnSetTransparentColor hStamp, vbGreen, False
cr = RasterAnn.AnnGetTransparentColor (hStamp)
MsgBox "TransparentColor: " & Hex(cr)

RasterAnn.AnnSetBackColor hPlgn, vbMagenta, False
cr = RasterAnn.AnnGetBackColor (hPlgn)
MsgBox "BackColor: " & Hex(cr)

RasterAnn.AnnSetForeColor hPlgn, vbCyan, False
cr = RasterAnn.AnnGetForeColor (hPlgn)
MsgBox "ForeColor: " & Hex(cr)
RasterAnn.AnnGetBitmap hStamp, LEADRasterView1.Raster


AnnParentRasterView example for Visual Basic

'This sample shows the minimal code to use the LEAD Annotation COM object
'LEADRasterView1 is a LEAD Raster View control
'Public WithEvents RasterAnn As LEADRasterAnnotation
Private Sub AnnParentRasterView_Click()

Set RasterAnn = New LEADRasterAnnotation

'Unlock the annotation support
'Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT

'Attach the annotation object to the raster view control
RasterAnn.AnnParentRasterView = LEADRasterView1

'Automatically update annotations with raster changes
RasterAnn.AnnAutoUpdate = True

'...
'... the rest of the program
'...
End Sub


AnnPointOptions example for Visual Basic

Private Sub ExampleAnnSetPointOptions(hObject As Long)

Dim ObjectType As AnnObjectType

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_POINT Then
MsgBox "This Object is not an Point Option"
End If

RasterAnn.AnnPointOptions.Flags = ANN_POINT_ALL
RasterAnn.AnnGetPointOptions(hObject)
If IsNull(RasterAnn.AnnPointOptions.PointRaster) Then
MsgBox "There is no raster associated. "
Exit Sub
End If

If RasterAnn.AnnPointOptions.EnablePointUseBitmap = True Then
RasterAnn.AnnPointOptions.EnablePointUseBitmap = False
RasterAnn.AnnPointOptions.EnablePointFixedSize = False
RasterAnn.AnnPointOptions.EnablePointTransparentFill = False
RasterAnn.AnnPointOptions.PointBorderColor = RGB (0, 0, 0)
RasterAnn.AnnPointOptions.PointFillColor = RGB (255, 255, 0)
RasterAnn.AnnPointOptions.PointRadius = 12
RasterAnn.AnnPointOptions.Flags = ANN_POINT_USE_BITMAP Or _
ANN_POINT_RADIUS Or _
ANN_POINT_BORDER_COLOR Or _
ANN_POINT_FILL_COLOR Or _
ANN_POINT_TRANSPARENT_FILL Or _
ANN_POINT_FIXED_SIZE
Else
'Change Point appearance to a bitmap
RasterAnn.AnnPointOptions.EnablePointUseBitmap = True
RasterAnn.AnnPointOptions.EnablePointBitmapTransparent = True
RasterAnn.AnnPointOptions.PointBitmapTransparentColor = RGB(255, 255, 255)
End If

RasterAnn.Flags = 0
RasterAnn.AnnSetPointOptions(hObject)

End Sub


AnnPopFixedState example for Visual Basic

'This example enables the"fixed" property for all objects in the container that
'have been temporarily disabled with a call to L_AnnPushFixedState.
' For an example using the magnifying glass, see the source code
' for the main COM annotation demo.
Private Sub SampleAnnPopFixedState(hContainer As Long)

RasterAnn.Flags = ANN_FLAG_RECURSE + ANN_FLAG_NOINVALIDATE
RasterAnn.AnnPopFixedState(hContainer)

End Sub


AnnPredefinedRaster example for Visual Basic

Private Sub ExampleGetPredefineRaster()

RasterAnn.AnnPredefinedRaster(ANN_BITMAP_POINT) = LEADRasterView1.Raster

LEADRasterView1.Raster = RasterAnn.AnnPredefinedRaster(ANN_BITMAP_POINT)

RasterProc.Invert(LEADRasterView1)

End Sub


AnnPushFixedState example for Visual Basic

' This example temporarily disables the"fixed" property of all objects in the container.
' This is useful when fixed objects need to be temporarly painted larger or smaller than
' the fixed size. For an example using the magnifying glass, see the source code
' for the main COM annotation demo.
Private Sub SampleAnnPushFixedState(hContainer As Long)

RasterAnn.Flags = ANN_FLAG_RECURSE + ANN_FLAG_NOINVALIDATE
RasterAnn.AnnPushFixedState (hContainer)

End Sub


AnnRectLeft example for Visual Basic

Note: This topic is for Document/Medical only.

'Declare the RasterAnn as follows
Public WithEvents RasterAnn As LEADRasterAnnotation

'This example creates two annotation notes as a single undo operation
Private Sub AnnAddUndoNode_Click()
Dim hObject1 As Long
Dim hObject2 As Long

'Call the AddUndoNode method to add an undo node to the container.
RasterAnn.AnnAddUndoNode

'Disable the undo feature
RasterAnn.AnnUndoEnable = False

'Perform the operations to be combined into one undo.
RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject1 = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject1) = 0
RasterAnn.AnnRectTop(hObject1) = 0
RasterAnn.AnnRectWidth(hObject1) = 100
RasterAnn.AnnRectHeight(hObject1) = 100

RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject2 = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject2) = 0
RasterAnn.AnnRectTop(hObject2) = 100
RasterAnn.AnnRectWidth(hObject2) = 100
RasterAnn.AnnRectHeight(hObject2) = 100

'Re-enable the undo feature
RasterAnn.AnnUndoEnable = True
End Sub


AnnRestrictCursor example for Visual Basic

'Example for AnnConvert, AnnRestrictCursor
'This example restricts the cursor to 10 pixels on either side
'of the bounding box of the annotation object. For example,
'if the object is a rectangle, the mouse cursor will be restricted
'to an area that is 10 pixels larger than the rectangle
Private Sub ExampleAnnRestrictCursor(hObject As Long)
Dim hContainer As Long
Dim ObjectType As AnnObjectType
Dim BoundsTop As Double
Dim BoundsLeft As Double
Dim BoundsWidth As Double
Dim BoundsHeight As Double
Dim BoundsRight As Double
Dim BoundsBottom As Double
Dim OldClipTop As Double
Dim OldClipLeft As Double
Dim OldClipRight As Double
Dim OldClipBottom As Double

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

'If (ObjectType <> ANN_OBJECT_AUTOMATION) And (ObjectType <> ANN_OBJECT_CONTAINER) Then
'MsgBox "This object is not an Automation Object and it is not a Container Object."
'End If

hContainer = RasterAnn.AnnGetTopContainer(hObject)

BoundsTop = RasterAnn.AnnRectTop(hObject)
BoundsLeft = RasterAnn.AnnRectLeft(hObject)
BoundsWidth = RasterAnn.AnnRectWidth(hObject)
BoundsHeight = RasterAnn.AnnRectHeight(hObject)

RasterAnn.PointsCount = 2
RasterAnn.ContainerPointX = BoundsLeft
RasterAnn.ContainerPointY = BoundsTop
RasterAnn.AnnConvert hObject, ANN_CONVERT_TO_CLIENT

RasterAnn.PointIndex = 0
BoundsLeft = RasterAnn.ClientPointX
BoundsTop = RasterAnn.ClientPointY

BoundsRight = (BoundsWidth + BoundsLeft) + 10
BoundsBottom = (BoundsHeight + BoundsTop) + 10
BoundsTop = BoundsTop - 10
BoundsLeft = BoundsLeft - 10

RasterAnn.AnnRestrictCursor hContainer, BoundsLeft, BoundsTop, BoundsRight, BoundsBottom, 0, 0, False

OldClipTop = RasterAnn.TopPreviousClip
OldClipLeft = RasterAnn.LeftPreviousClip
OldClipRight = RasterAnn.RightPreviousClip
OldClipBottom = RasterAnn.BottomPreviousClip

'When done with restricting cursor, call the line below
'ClipCursor

End Sub


AnnRotate example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'This example uses the AnnFlip, AnnReverse, and AnnRotate methods. To code this example, add a command button named Test to the example you created in Loading and Displaying an Image. For best results when you run the example, draw two objects in opposite corners, and use the right mouse button to select all annotation objects. The command button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate methods.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub AnnRotate_Click()
Dim MyCaption As String
MyCaption = AnnRotate.Caption
Select Case MyCaption
Case "Flip"
'Flip using the center of the bitmap as the axis.
RasterAnn.AnnFlip True, LEADRasterView1.Raster.BitmapHeight / 2, True
AnnRotate.Caption = "Reverse"
Case "Reverse"
'Reverse using the center of the bitmap as the axis.
RasterAnn.AnnReverse True, LEADRasterView1.Raster.BitmapWidth / 2, True
AnnRotate.Caption = "Rotate"
Case "Rotate"
'Rotate 90 degrees using the center of the bitmap as the axis.
RasterAnn.AnnRotate True, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 90, True
AnnRotate.Caption = "Flip"
Case Else
AnnRotate.Caption = "Flip"
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.ANNTOOL = ANN_TOOL_REDACT
MsgBox "Draw two objects, use the right mouse button to select all, then click the command button"
End Select
End Sub


AnnRotateAngle example for Visual Basic

Private Sub ExampleAnnRotateAngle(hObject As Long)
Dim szMsg As String
Dim RadiansAngle As Double
Dim DegreesAngle As Double

RadiansAngle = RasterAnn.AnnRotateAngle(hObject)
If (RasterAnn.AnnError <> 0)
MsgBox "There is an error equal to = " + Str(RasterAnn.AnnError)
Exit Sub
End if

DegreesAngle = RadiansAngle * 180 / 3.1415926535

MsgBox "Angle Rotation : Radians = " + Chr(RadiansAngle) + " Degrees = " + Chr(DegreesAngle)

End Sub


AnnRTFText example for Visual Basic

' This sample loads a rich text annotation object with text.
' It illustrates how AnnTextRTF can treat the text as Rich Text, or plain text.
' hObject: the Rich Text annotation object
' uFormat: the format of the retrieved text is one of the following:
' RTF_FORMAT_TEXT
' RTF_FORMAT_RTF

Private Sub SampleAnnTextRTF(hObject As Long, uFormat As Long)
Dim pszFormat As String
Dim RTF As String
Dim ulength As Long
Const RICH_STRING = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033" + _
"{\fonttbl{\f0\fnil\fcharset0 Arial;}}{\colortbl ;" + _
"\red255\green0\blue0;\red255\green255\blue255;" + _
"\red51\green102\blue0;\red0\green0\blue255;" + _
"\red0\green0\blue0;}\viewkind4\uc1\pard\cf1" + _
"\highlight2\ul\fs20 Rich \cf3\ulnone\b Text" + _
"\cf4\b0\i String\cf5\i0\par}"

Select Case uFormat
Case RTF_FORMAT_TEXT
pszFormat = "RTF_FORMAT_TEXT"
RasterAnn.Flags = 0
RasterAnn.AnnRTFText(hObject, uFormat) = RICH_STRING

Case RTF_FORMAT_RTF
pszFormat = "RTF_FORMAT_RTF"
RasterAnn.Flags = 0
RasterAnn.AnnRTFText(hObject, uFormat) = RICH_STRING

End Select

RTF = RasterAnn.AnnRTFText(hObject, uFormat)
ulength = RasterAnn.RTFTextLength

MsgBox "The Fomat Type is = " + pszFormat
MsgBox "The RTFTextLength = " + Str(ulength)

End Sub


AnnSaveArray example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub AnnSaveArray_Click()
Dim RasterVar As New LEADRasterVariant
Dim lSize As Long
Dim abool As Boolean
abool = False

iret = RasterAnn.AnnSaveArray(ANN_FMT_NATIVE, abool, RasterVar, SAVE_OVERWRITE, 0)

Open "c:\temp1.ann" For Binary Access Write As #1

For i = 0 To RasterVar.ItemCount - 1
Put #1, , Cbyte(RasterVar.ShortItemValue(i))
Next i

Close #1
End Sub


AnnSaveMemory example for Visual Basic

Note: This topic is for Document/Medical only.

This example lets you save the current annotations to a file in memory, and lets you load the annotations that were saved.

1. | Start with the project that you created in Creating and Using Annotations.
2. | Add the following to the declarations procedure of the general object in your main form:

Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Dim hMemGlobal As Long
Dim iSizeGlobal As Long
Private WithEvents RasterAnn As LEADRasterAnnotation

3. | Add the following code to the main form's Load procedure
 | Set RasterAnn = CreateObject("LEADAnnotation.LEADAnnotation. ")
4. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | AnnSaveMem | Save In Memory
 | AnnLoadMem | Load From Memory
5. | Code the AnnSaveMem button's Click procedure as follows:

If RasterAnn.AnnSaveMemory(hMemGlobal, ANN_FMT_NATIVE, False, iSizeGlobal, SAVE_OVERWRITE, 0) <> 0 Then
MsgBox ("Error calling AnnSaveMemory")
End If

6.

Code the AnnLoadMem button's Click procedure as follows:

'Load the annotations from the memory-resident file.
If RasterAnn.AnnLoadMemory(hMemGlobal, iSizeGlobal, 1) <> 0 Then
MsgBox ("Error calling AnnLoadMemory")
Else
MsgBox ("AnnLoadMemory succeeded")
End If
GlobalFree (hMemGlobal)

7.

Run your program to test it.


AnnSaveTag example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image.
Private Sub AnnSaveTag_Click()
Dim RasterIO As New LEADRasterIO
RasterAnn.AnnSaveTag RasterIO, True, False
RasterIO.Save LEADRasterView1.Raster, "c:\testwang.tif", FILE_CCITT_GROUP4, 1, 2, SAVE_OVERWRITE

'clear the LEAD raster view control
LEADRasterView1.Raster.Bitmap = 0

'Reload the image with the wang-compatible annotations
RasterIO.Load LEADRasterView1.Raster, "c:\testwang.tif", 0, 0, 1
RasterAnn.AnnLoad "c:\testwang.tif", 1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
End Sub


AnnSelect example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example for the AnnSelect event displays a message box showing the number of selected annotation objects. It then goes through the array of selected objects to see if any of them are polygons.
Private Sub RasterAnn_OnAnnSelect(ByVal aObjects As LEADRasterVariant, ByVal uCount As Integer)
Dim nType As AnnObjectType
Dim x As Integer
Dim nPolyCount As Integer

nPolyCount = 0
For x = 1 To uCount
RasterAnn.AnnGetType aObjects.LongItemValue (x - 1)

nType = RasterAnn.AnnType
If nType = ANN_OBJECT_POLYGON Then
nPolyCount = nPolyCount + 1
End If
Next
MsgBox CStr(uCount) & " objects were selected. " & nPolyCount & " Polygon Objects were selected"
End Sub


AnnSelectRect Example for Visual Basic

LEAD1.AnnSelectRect LEAD1.AnnContainer, 10, 10, 200, 100
LEAD1.AnnSelectPoint LEAD1.AnnContainer, 300, 300
If LEAD1.AnnGetSelected (hPlgn) Then
LEAD1.AnnRemove hPlgn
LEAD1.AnnSetSelected hPlgn, False, False
Else
LEAD1.AnnInsert LEAD1.AnnContainer, hPlgn, False
End If

Caption = "Left:" & LEAD1.AnnSelectRectLeft (LEAD1.AnnContainer) _
& ", Top:" & LEAD1.AnnSelectRectTop(LEAD1.AnnContainer) _
& ", Width:" & LEAD1.AnnSelectRectWidth (LEAD1.AnnContainer) _
& ", Height:" & LEAD1.AnnSelectRectHeight (LEAD1.AnnContainer)

RasterAnn.AnnSelectRect RasterAnn.AnnContainer, 10, 10, 200, 100
RasterAnn.AnnSelectPoint RasterAnn.AnnContainer, 300, 300
If RasterAnn.AnnGetSelected(hPlgn) Then
RasterAnn.AnnRemove hPlgn
RasterAnn.AnnSetSelected hPlgn, False, False
Else
RasterAnn.AnnInsert RasterAnn.AnnContainer, hPlgn, False
End If

Caption = "Left:" & RasterAnn.AnnSelectRectLeft (RasterAnn.AnnContainer) _
& ", Top:" & RasterAnn.AnnSelectRectTop (RasterAnn.AnnContainer) _
& ", Width:" & RasterAnn.AnnSelectRectWidth (RasterAnn.AnnContainer) _
& ", Height:" & RasterAnn.AnnSelectRectHeight (RasterAnn.AnnContainer)


AnnSetAutoMenuItemEnable Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub Command17_Click()
' disable the Delete menu item from all the selected objects
RasterAnn.AnnSetAutoMenuItemEnable RasterAnn.AnnContainer, 0, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, ""
' disable the Delete menu item from all the ellipse objects
RasterAnn.AnnSetAutoMenuItemEnable RasterAnn.AnnAutomation, ANN_OBJECT_ELLIPSE, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, 0, ""
End Sub


AnnSetAutoText Example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub AnnSetAutoText_Click()
Dim TestText As String
RasterAnn.AnnGetAutoText ANN_AUTOTEXT_MENU_UNDO
TestText = RasterAnn.AnnAutoText
TestText = TestText + " - New"
RasterAnn.AnnSetAutoText ANN_AUTOTEXT_MENU_UNDO, TestText
End Sub


AnnSetFillModeExt Example for Visual Basic

' The following example toggles through all supported fill modes for an annotation object.
' The background color is set to blue in each case
Private Sub ExampleAnnGetFillModeExt_Click()
Dim nRet As Integer
Dim nFillMode As Integer
Dim hObject As Long

RasterAnn.AnnCreate ANN_OBJECT_HILITE, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft (hObject) = 0
RasterAnn.AnnRectTop(hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100

nRet = RasterAnn.AnnSetSelected(hObject, True, False)
nRet = RasterAnn.AnnGetFillModeExt(hObject)
nRet = RasterAnn.AnnSetBackColor(hObject, RGB(0, 0, 255), True)
nFillMode = RasterAnn.AnnFillMode

Select Case nFillMode

Case ANN_FILLMODE_TRANSPARENT:
nFillMode = ANN_FILLMODE_TRANSLUCENT

Case ANN_FILLMODE_TRANSLUCENT:
nFillMode = ANN_FILLMODE_OPAQUE

Case ANN_FILLMODE_OPAQUE:
nFillMode = ANN_FILLMODE_ALPHA

Case ANN_FILLMODE_ALPHA:
Case Else:
nFillMode = ANN_FILLMODE_TRANSPARENT
End Select
' Arbitrarily set an alpha value of 128
' Note that this value is used only if the uFillMode is ANN_FILLMODE_ALPHA

nRet = RasterAnn.AnnSetFillModeExt(hObject, nFillMode, 128, True)

nRet = RasterAnn.AnnGetFillModeExt(hObject)
If (RasterAnn.AnnFillMode = ANN_FILLMODE_ALPHA) Then
MsgBox "Alpha :" + Str(RasterAnn.AnnAlpha)
End If


AnnSetMetafile Example for Visual Basic

Private Declare Function GetObjectType Lib "gdi32" (ByVal hgdiobj As Long) As Long
Private Const OBJ_ENHMETAFILE = 13
Private Const OBJ_METAFILE = 9

Private Sub Metafile_Click()
Dim hMeta As Long
Dim bEnh As Boolean
hMeta = RasterAnn.AnnGetPredefinedMetafile (ANN_METAFILE_IMPORTANT)
bEnh = LEAD1.AnnPredefinedMetafileEnhanced

RasterAnn.AnnSetPredefinedMetafile ANN_METAFILE_TOPSECRET, hMeta
RasterAnn.AnnSetMetafile hStamp, 0, ANN_METAFILE_TOPSECRET, False
MsgBox "stamp set to TopSecret"

hMeta = RasterAnn.AnnGetMetafile (hStamp)
Select Case GetObjectType(hMeta)
Case OBJ_ENHMETAFILE
MsgBox "Type is EMF"
Case OBJ_METAFILE
MsgBox "Type is WMF"
End Select
End Sub


AnnSetOptions Example for Visual Basic

Private Sub ExampleAnnSetOptions_Click()
Dim lOptions As Long
Dim strMsg As String

lOptions = RasterAnn.AnnGetOptions()

If ((lOptions And ANN_OPTIONS_NEW_SIDE_HANDLES)) Then
lOptions = lOptions And Not ANN_OPTIONS_NEW_SIDE_HANDLES
strMsg = "Draw a rectangular object and select it. Note there are no side handles. Run this example again to enable the side handles."
Else
lOptions = lOptions Or ANN_OPTIONS_NEW_SIDE_HANDLES
strMsg = "Draw a rectangular object and select it. Note the side handles. Run this example again to disable the side handles."
End If

RasterAnn.AnnSetOptions(lOptions)
MsgBox strMsg
End Sub


AnnSetPolyFillMode Example for Visual Basic

Dim nNodes As Integer, bShow As Boolean
LEAD1.AnnSetFillPattern hPlgn, (LEAD1.AnnGetFillPattern (hPlgn) + 1) Mod 7, False
LEAD1.AnnSetFillMode hPlgn, (LEAD1.AnnGetFillMode (hPlgn) + 1) Mod 3, False
LEAD1.AnnSetPolyFillMode hPlgn, 1 - LEAD1.AnnGetPolyFillMode (hPlgn), False
LEAD1.AnnSetLineStyle hPlgn, (LEAD1.AnnGetLineStyle(hPlgn) + 1) Mod 6, False
LEAD1.AnnSetLineWidth hPlgn, (LEAD1.AnnGetLineWidth (hPlgn)) Mod 4 + 1, False
nNodes = LEAD1.AnnGetNodes (hPlgn)
bShow = LEAD1.AnnShowNodes
LEAD1.AnnSetNodes hPlgn, bShow = False, (nNodes + 1) Mod LEAD1.AnnGetPointCount (hPlgn), False

Dim nNodes As Integer, bShow As Boolean
If hPlgn = 0 Then Exit Sub
RasterAnn.AnnSetFillPattern hPlgn, (RasterAnn.AnnGetFillPattern (hPlgn) + 1) Mod 7, False
RasterAnn.AnnSetFillMode hPlgn, (RasterAnn.AnnGetFillMode (hPlgn) + 1) Mod 3, False
RasterAnn.AnnSetPolyFillMode hPlgn, 1 - RasterAnn.AnnGetPolyFillMode (hPlgn), False
RasterAnn.AnnSetLineStyle hPlgn, (RasterAnn.AnnGetLineStyle (hPlgn) + 1) Mod 6, False
RasterAnn.AnnSetLineWidth hPlgn, (RasterAnn.AnnGetLineWidth (hPlgn)) Mod 4 + 1, False
nNodes = RasterAnn.AnnGetNodes (hPlgn)
bShow = LEAD1.AnnShowNodes

Dim ptCount As Long
RasterAnn.AnnGetPointCount hPlgn
ptCount = RasterAnn.AnnPointCount
RasterAnn.AnnSetNodes hPlgn, bShow = False, (nNodes + 1) Mod ptCount, False


AnnSetROP2 Example for Visual Basic

RasterAnn.AnnSetROP2 hPlgn, (RasterAnn.AnnGetROP2 (hPlgn) + 1) Mod 3, False


AnnSetSecondaryBitmap Example for Visual Basic

RasterAnn.AnnSetSecondaryBitmap hPushPin, LEADRasterView2.Raster, False
RasterAnn.AnnUserMode = ANN_USERMODE_RUN
MsgBox "secondary bitmap set"
RasterAnn.AnnGetSecondaryBitmap hPushPin, LEADRasterView1.Raster


AnnSetTextOptions Example for Visual Basic

' The following example changes some of the text options of
' a text-based annotation. It changes the text color to blue,
' and toggles the ShowBorder option:
Private Sub ExampleAnnSetTextOptions_Click()
Dim nRet As Integer
Dim lOptions As Long
Dim szMsg As String
Dim hObject As Long

RasterAnn.AnnCreate ANN_OBJECT_TEXT, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject) = 0
RasterAnn.AnnRectTop(hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100

lOptions = RasterAnn.AnnGetOptions()
lOptions = lOptions Or ANN_OPTIONS_NEW_TEXT_OPTIONS

nRet = RasterAnn.AnnSetOptions(lOptions)
If (nRet <> 0) Then Exit Sub

nRet = RasterAnn.AnnGetTextOptions(hObject, ANN_TEXT_SHOW_TEXT Or ANN_TEXT_SHOW_BORDER Or ANN_TEXT_TEXTCOLOR)
If (nRet <> 0) Then Exit Sub

szMsg = "Old Options: AnnShowText[" + Str(RasterAnn.AnnShowText) + "], AnnShowBorder[" + Str(RasterAnn.AnnShowBorder) + "], AnnTextColor[" + Str(RasterAnn.AnnTextColor) + "]"
MsgBox szMsg
'Change some options

nRet = RasterAnn.AnnSetTextOptions(hObject, RasterAnn.AnnShowText, Not RasterAnn.AnnShowBorder, RGB(0, 0, 255), 0, ANN_TEXT_SHOW_BORDER Or ANN_TEXT_TEXTCOLOR, False)
If (nRet <> 0) Then Exit Sub

nRet = RasterAnn.AnnGetTextOptions(hObject, ANN_TEXT_SHOW_TEXT Or ANN_TEXT_SHOW_BORDER Or ANN_TEXT_TEXTCOLOR)
If (nRet <> 0) Then Exit Sub

szMsg = "new Options: AnnShowText[" + Str(RasterAnn.AnnShowText) + "], AnnShowBorder[" + Str(RasterAnn.AnnShowBorder) + "], AnnTextColor[" + Str(RasterAnn.AnnTextColor) + "]"
MsgBox szMsg
End Sub


AnnSetUnit Example for Visual Basic

Dim nUnit As Integer, nPrecision As Integer, Distance2 As Single
RasterAnn.AnnGetUnit hCrossProd
nUnit = RasterAnn.AnnUnit
nPrecision = RasterAnn.AnnPrecision
nUnit = (nUnit + 1) Mod 10
RasterAnn.AnnSetUnit hCrossProd, nUnit + ANN_UNIT_DEF_ABBR, vbNullString, 2, False
RasterAnn.AnnSetGaugeLength hCrossProd, 3, False

RasterAnn.AnnGetDistance (hCrossProd)
Distance2 = RasterAnn.AnnDistance
MsgBox "Unit: " & RasterAnn.AnnGetUnit(hCrossProd, nUnit) & Chr(13) _
& "Distance: " & RasterAnn.AnnGetDistance(hCrossProd) & Chr(13) _
& "Gauge Length: " & RasterAnn.AnnGetGaugeLength (hCrossProd)


AnnSetUser Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub Command8_Click()
' hide the selected objects
RasterAnn.AnnSetVisible RasterAnn.AnnContainer, False, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, ""
' set the selected objects to belong to user XXX
RasterAnn.AnnSetUser RasterAnn.AnnContainer, "", "xxx", True
End Sub


AnnSetWnd Example for Visual Basic

LEAD1.AnnSetWnd hPlgn, oldWnd
Dim oldWnd As Long
oldWnd = RasterAnn.AnnGetWnd (hPlgn)
RasterAnn.AnnSetWnd hPlgn, Command1.hWnd
RasterAnn.AnnSetVisible hPlgn, False, 0, 0
RasterAnn.AnnSetVisible hPlgn, True, 0, 0
MsgBox "will restore old window"
RasterAnn.AnnSetWnd hPlgn, oldWnd


AnnShowLockedIcon Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example toggles the AnnShowLockedIcon property.
Private Sub AnnShowLockedIcon_Click()
RasterAnn.AnnShowLockedIcon = Not RasterAnn.AnnShowLockedIcon
MsgBox "AnnShowLockedIcon: " & RasterAnn.AnnShowLockedIcon
End Sub


AnnTextAlign example for Visual Basic

Private Sub ExampleAnnTextAlignment(hObject As Long)
Dim ObjectType As AnnObjectType
Dim Align As Long

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_TEXT Then
MsgBox "This Object is not an Text Object"
End If

Align = RasterAnn.AnnTextAlign(hObject)

If Align = TEXT_ALIGN_CENTER Then
Align = TEXT_ALIGN_LEFT
Else
Align = TEXT_ALIGN_CENTER
End If

RasterAnn.Flags = 0 'process only the specific object
RasterAnn.AnnTextAlign(hObject) = Align

End Sub


AnnTextEdit Example for Visual Basic

‘ This example programmatically makes an annotation text object
’ hObject go into edit mode
’ Note that hObject must be a text-based annotation

Private Sub ExampleAnnTextEdit_Click()
Dim nRet As Integer
Dim szError As String
Dim hObject As Long

RasterAnn.AnnCreate ANN_OBJECT_TEXT, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject) = 0
RasterAnn.AnnRectTop(hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100

nRet = RasterAnn.AnnTextEdit(hObject)
Select Case nRet
Case 0:
szError = ""
Case ERROR_AUTOMATION_INV_HANDLE:
szError = "AnnTextEdit failed because you are not in automated mode"
Case ERROR_INV_PARAMETER:
szError = "AnnTextEdit failed because hObject was not text-based"
Case Else:
szError = "AnnTextEdit failed"
End Select

If (szError <> "") Then
MsgBox (szError)
End If
End Sub


AnnTextExpandTokens example for Visual Basic

Private Sub ExampleAnnTextExpandToken(hObject As Long)
Dim ObjectType As AnnObjectType
Dim bTextExpandToken As Boolean

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_TEXT Then
MsgBox "This Object is not a Text Object"
End If

bTextExpandToken = RasterAnn.AnnTextExpandTokens(hObject)

bTextExpandToken = Not bTextExpandToken

RasterAnn.AnnTextExpandTokens(hObject) = bTextExpandToken

If bTextExpandToken = True Then
MsgBox "Text Expand Token"
Else
MsgBox "Text Not Expand Token"
End If

End Sub


AnnTextPointerFixed example for Visual Basic

Private Sub ExampleAnnTextPointerFixed(hObject As Long)
Dim ObjectType As AnnObjectType
Dim bTextPointerFixed As Boolean

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_TEXT Then
MsgBox "This Object is not an Text Object"
End If

bTextPointerFixed = RasterAnn.AnnTextPointerFixed(hObject)

If bTextPointerFixed = True Then
bTextPointerFixed = False
Else
bTextPointerFixed = True
End If

RasterAnn.AnnTextPointerFixed(hObject) = bTextPointerFixed

End Sub


AnnTextRotate example for Visual Basic

Private Sub ExampleAnnTextRotate(hObject As Long)
Dim ObjectType As AnnObjectType
Dim Angle As Double

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_TEXT Then
MsgBox "This Object is not a Text Object"
End If

Angle = RasterAnn.AnnTextRotate(hObject)

Angle = Angle + TEXT_ROTATE_90

RasterAnn.Flags = 0 'process only the specific object
RasterAnn.AnnTextRotate(hObject) = Angle

End Sub


AnnTicMarkLength example for Visual Basic

Private Sub ExampleAnnTicMarkLength(hObject As Long)
Dim ObjectType As AnnObjectType
Dim Length As Double

RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType

If ObjectType <> ANN_OBJECT_POLYRULER and ObjectType <> ANN_OBJECT_RULER Then
MsgBox "This Object is not a Polyruler or a Ruler Object"
End If

Length = RasterAnn.AnnTicMarkLength(hObject)

Length = Length + 10

RasterAnn.AnnTicMarkLength(hObject) = Length

End Sub


AnnToolChecked Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub RasterAnn_OnAnnToolChecked(ByVal iTool As Integer)
Dim TestString As String

Select Case iTool
Case ANN_TOOL_SELECT
TestString = "Selection pointer tool"
Case ANN_TOOL_LINE
TestString = "Line tool"
Case ANN_TOOL_RECT
TestString = "Rectangle tool"
Case ANN_TOOL_ELLIPSE
TestString = "Ellipse tool"
'...
'...
'...
Case Else
TestString = "User defined tool"
End Select
MsgBox TestString, 0, "Notice"

End Sub


AnnToolDestroy Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub RasterAnn_OnAnnToolDestroy()
MsgBox "You have closed the toolbar.", 0, "Notice"
End Sub


AnnUndo Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example does an "undo" on the last annotation change
'Note that AnnUndoEnable must be set to TRUE
Private Sub Command4_Click()
RasterAnn.AnnUndo
End Sub


AnnUndoEnable Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example sets the annotation undo depth to 10 and
'enables the annotation undo capability
Private Sub AnnUndoEnable_Click()
RasterAnn.AnnUndoEnable = True
RasterAnn.AnnUndoDepth = 10
End Sub


AnnUngroup Example for Visual Basic

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This examples ungroups all annotation objects that are grouped and selected.
Private Sub AnnUngroup_Click()
RasterAnn.AnnUngroup RasterAnn.AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, ""
End Sub


AnnUnlock Example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This is also the example for AnnGetLocked method.
'If an object is found to be locked, using AnnGetLocked method, the object is unlocked, by AnnUnlock, using the key "abcd".
'hGlobalAnn is a global handle to an annotation object
Private Sub AnnUnlock_Click()
Dim bLocked As Boolean
RasterAnn.AnnGetLocked hGlobalAnn
blocked = RasterAnn.AnnLocked
If bLocked = True Then
RasterAnn.AnnUnlock hGlobalAnn, "abcd"
End If
End Sub


AnnUnlocked Example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Private Sub RasterAnn_OnAnnUnLocked(ByVal hAnnObject As Long)
MsgBox "AnnObject: " & CStr(hAnnObject) & " was unlocked!"
End Sub


AnnUnrealize Example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example Unrealizes all redact objects in the container
Private Sub AnnUnrealize_Click()
RasterAnn.AnnUnrealize RasterAnn.AnnContainer, True
End Sub


AntiAlias example for Visual Basic

RasterProc.AntiAlias LEADRasterView1.Raster, 128, 3, ANTIALIAS_1


Appearance Example for Visual Basic

Note: Also works with Access 95 and 97.

This example toggles the Appearance property.

If LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_FLAT Then
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_THREED
Else
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_FLAT
End If


ApplyMathLogic Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ApplyMathLogic LEADRasterView1.Raster, 151, _
AML_OP_MUL Or _
CHANNEL_MASTER Or _
AML_VALUE_NOP Or _
AML_RES_NOP


ApplyModalityLUT2 Example for Visual Basic

Function TestModalityLUT(ByVal bLinear As Boolean)
Dim i As Integer
Dim Data As Variant
Dim RasterProc As New LEADRasterProcess
Dim LUT(65536) As Long
If (bLinear) Then
RasterProc.ApplyModalityLUT2 LeadRasterView.Raster, 0, 0.5, 0
Else
For i = 0 To 65535
LUT(i) = i / 2
Next i

Data.VarType = vbLong Or vbArray
Data = LUT

RasterProc.ApplyModalityLUT2 LeadRasterView.Raster, Data, 0, 0
End If
End Function


ApplyModalityLUT Example for Visual Basic

Function TestModalityLUT(ByVal bLinear As Boolean)
Dim i As Long
Dim RasVar As New LEADRasterVariant
Dim RasterProc As New LEADRasterProcess
Dim LUT(65536) As Long

If (blinear) Then
RasterProc.ApplyLinearModalityLUT LEADRasterView1.Raster, 0, 0.5, 0
Else
For i = 0 To 65535
LUT(i) = i / 2
Next I

RasVar.Type = VALUE_ARRAY_LONG
RasVar.ItemCount = 65535
For i = 0 To 65535
RasVar.LongItemValue(i) = LUT(i)
Next I

RasterProc.ApplyModalityLUT LEADRasterView1.Raster, RasVar, 0, 0
End If
End Function


ApplyVOILUT2 Example for Visual Basic

Function TestVOILUT(ByVal bLinear As Boolean)
Dim i As Integer
Dim Data As Variant
Dim RasterProc As New LEADRasterProcess
Dim LUT(4096) As Long

If (bLinear) Then
RasterProc.ApplyLinearVOILUT LeadRasterView.Raster, 330#, 600#, 0
Else
For i = 0 To 4096
If (i < 30) Then
LUT(i) = 0
Else
If (i > 630) Then
LUT(i) = 630
Else
LUT(i) = i
End If
End If
Next i

Data.VarType = vbLong Or vbArray
Data = LUT

RasterProc.ApplyVOILUT2 LeadRasterView.Raster, Data, 0, 0
End If
End Function


ApplyVOILUT Example for Visual Basic

Function TestVOILUT(ByVal bLinear As Boolean)
Dim i As Integer
Dim Data As LEADRasterVariant
Dim RasterProc As New LEADRasterProcess
Dim LUT(4096) As Long

If (bLinear) Then
RasterProc.ApplyLinearVOILUT LEADRasterView1.Raster, 330#, 600#, 0
Else
For i = 0 To 4096
If (i < 30) Then
LUT(i) = 0
Else
If (i > 630) Then
LUT(i) = 630
Else
LUT(i) = i
End If
End If
Next i

Data.Type = VALUE_ARRAY_LONG
Data.ItemCount = 4096
For i = 0 To 4096
Data(i) = LUT(i)
Next i

RasterProc.ApplyVOILUT LEADRasterView1.Raster, Data, 0, 0
End If
End Function


AutoAnimate Example for Visual Basic

Note: Also works with Access 95 and 97.

This example gets information about an animated file, uses the information to position the LEAD control, and plays the animation as it loads the file.

Dim RasterIO As New LEADRasterIO
' Force continued looping after the file loads.
LEADRasterView1.AutoAnimationLoop = AUTOANIMATIONLOOP_INFINITE
' Get information about the file we will load.
RasterIO.GetFileInfo LEADRasterView1.Raster, "d:\lead14\dist\images\eye.gif", 0, 0
' Exit if this is not an animated file.
If RasterIO.InfoAnimation = False Then
MsgBox "Not an animated file", 0, "Error"
Else
' Set properties for playing the animation as is loads.
LEADRasterView1.AutoAnimate = True
LEADRasterView1.AutoRepaint = True
' Load the animated file.
RasterIO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\eye.gif", 0, 0, -1
End If


AutoBinary Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.AutoBinary LEADRasterView1.Raster


AutoColorLevel Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.AutoColorLevel LEADRasterView1.Raster, 50, 50, AUTO_LEVEL


AutoPan Example for Visual Basic

'toggle AutoPan
LEADRasterView1.AutoPan = Not LEADRasterView1.AutoPan


AutoSegment example for Visual Basic

Dim WithEvents RasterMrc As LEADRasterMrc
Dim RasterFxd As LEADRasterFXD

Private Sub Command1_Click()
Set RasterMrc = New LEADRasterMrc
Set RasterFxd = New LEADRasterFXD
Dim RasterMrcDst As New LEADRasterMrc

Dim nSegID As Integer
Set RasterMrc = New LEADRasterMrc
Set RasterFxd = New LEADRasterFXD
RasterMrc.BaseBackColor = RGB(200, 255, 255)
RasterMrc.BaseForeColor = RGB(0, 80, 0)
RasterMrc.CombineFactor = 30
RasterMrc.CombineFlags = COMBINE_TRY
RasterMrc.Sensitivity = 25
RasterMrc.ImageType = IMAGETYPE_SCANNED
RasterMrc.AutoSegment Me.ActiveForm.LEADRasterView1.Raster, 60, 60
RasterMrc.EnumSegments
RasterMrc.CombineFlags = COMBINE_FORCE
RasterMrc.CombineSegments 0, 1
RasterMrc.SaveSegmentation "C:\segments.sgm"
RasterMrcDst.LoadSegmentation Me.ActiveForm.LEADRasterView1.Raster, "C:\segments.sgm"
RasterMrc.StopSegmentation
RasterMrc.StartSegmentation Me.ActiveForm.LEADRasterView1.Raster
nSegID = RasterMrc.CreateNewSegment(Me.ActiveForm.LEADRasterView1.Raster, 10, 10, 100, 100, SEGTYPE_PICTURE)
RasterMrc.SetSegmentData Me.ActiveForm.LEADRasterView1.Raster, nSegID, 0, 0, 10, 10, SEGTYPE_TEXT_1BIT_BW
RasterMrcDst.StopSegmentation
RasterMrcDst.CopySegmentationHandle RasterMrc
RasterMrc.EnumSegments
RasterMrc.DeleteSegment nSegID
RasterMrcDst.StopSegmentation
RasterMrcDst.StopSegmentation
End Sub

Private Sub RasterMrc_EnumSegments(ByVal nSegId As Long, ByVal SegmentLeft As Long, ByVal SegmentTop As Long, ByVal SegmentRight As Long, ByVal SegmentBottom As Long, ByVal SegType As LTRASTERMRCLib.MRCSegmentTypeConstants)

RasterFxd.DrawPenWidth = 2
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_TRANSPARENT
RasterFxd.DrawMode = DRAWMODE_COPY_PEN

If SegType = SEGTYPE_TEXT_1BIT_BW Then
RasterFxd.DrawPenColor = vbBlack
ElseIf SegType = SEGTYPE_TEXT_1BIT_COLORED Then
RasterFxd.DrawPenColor = vbYellow
ElseIf SegType = SEGTYPE_TEXT_2BIT_COLORED Then
RasterFxd.DrawPenColor = vbGreen
ElseIf SegType = SEGTYPE_GRAYSCALE_2BIT Then
RasterFxd.DrawPenColor = vbBlue
ElseIf SegType = SEGTYPE_GRAYSCALE_8BIT Then
RasterFxd.DrawPenColor = vbWhite
ElseIf SegType = SEGTYPE_PICTURE Then
RasterFxd.DrawPenColor = vbRed
End If
RasterFxd.DrawRectangle Nothing, Me.ActiveForm.LEADRasterView1.GetClientDC(),
 SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom – SegmentTop
End Sub


AutoSize Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how the AutoSize property works when loading and when rotating an image.

Dim RasterProc As New LEADRasterProcess
Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoSize = True
RasterIO.Load LEADRasterView1.Raster, "v:\images\hls.bmp", 0, 0, 1
MsgBox "Control is sized to fit the loaded bitmap"
RasterProc.Rotate LEADRasterView1.Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 0)
MsgBox "Control is sized to fit the rotated bitmap"


AutoTrim example for Visual Basic

'This example scans a document and trims the edges.

'Declare the Raster objects WithEvents
Private WithEvents RasterTwain As LEADRasterTwain
Private WithEvents RasterIO As LEADRasterIO
Private WithEvents RasterProc As LEADRasterProcess

‘Create the Raster objects
Private Sub Form_Load()
Dim bRet As Boolean
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO. ")
Set RasterTwain = CreateObject("LEADRasterTwain.LEADRasterTwain. ")
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")

‘Unlock support—substitute the unlock support key for L_KEY_DOCUMENT
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT

End Sub

Dim SavedSetting As Integer
Dim CalcHeight As Double
Dim nRet As Integer

'Make sure display rectangles are reset when we acquire the image.
LEADRasterView1.AutoSetRects = True

'Disable automatic repainting.
LEADRasterView1.AutoRepaint = False

'Acquire the image, allowing for possible mistakes.
SavedSetting = LEADRasterView1.EnableMethodErrors
RasterTwain.EnableMethodErrors = False
nRet = RasterTwain.Acquire (L_LTWAIN_SHOW_USER_INTERFACE)
If nRet <> 0 Then
MsgBox "TWAIN device was not ready"
RasterTwain.EnableMethodErrors = SavedSetting
GoTo FINISHED
End If
RasterTwain.EnableMethodErrors = SavedSetting

'Trim the edges of the acquired bitmap.
RasterProc.AutoTrim LEADRasterView1.Raster, 64

'Use the whole window.
LEADRasterView1.Top = 0
LEADRasterView1.Left = 0
LEADRasterView1.Width = ScaleWidth
LEADRasterView1.Height = ScaleHeight

'Set up for good display of a typical scanned document.
LEADRasterView1.BitonalScaling = BITONALSCALING_SCALETOGRAY
LEADRasterView1.AutoScroll = True
LEADRasterView1.DstWidth = LEADRasterView1.Raster.ScaleWidth 'Use the full control width.
LEADRasterView1.DstClipWidth = LEADRasterView1.Raster.ScaleWidth
CalcHeight = (LEADRasterView1.Raster.BitmapHeight * LEADRasterView1.Raster.ScaleWidth) / LEADRasterView1.Raster.BitmapWidth
LEADRasterView1.DstHeight = CalcHeight 'Use the proportional height.
LEADRasterView1.DstClipHeight = CalcHeight

'Enable automatic repainting.
LEADRasterView1.AutoRepaint = True
FINISHED:


Average example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies an average filter with a 3x3 neighborhood and redisplays the bitmap.

Dim RasterProc As New LEADRasterProcess
RasterProc.Average LEADRasterView1.Raster, 3
LEADRasterView1.ForceRepaint


BackColor (ILEADRasterImgList) example for Visual Basic

'set the background color to red
LEADImgList1.BackColor = RGB(255, 0, 0)


BackColor example for Visual Basic

Note: Also works with Access 95 and 97.

This example sets the background color to red. You can zoom out to see the background color.

LEADRasterView1.BackColor = RGB(255,0,0)


BackErase example for Visual Basic

Note: Also works with Access 95 and 97.

This example turns off repainting of the background, then zooms out to show the effect when repainting.

LEADRasterView1.BackErase = False
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = False
'Calculate the values to zoom out by 10 percent and center the image.
LEADRasterView1.DstWidth = LEADRasterView1.DstWidth * 0.9
LEADRasterView1.DstHeight = LEADRasterView1.DstHeight * 0.9
LEADRasterView1.DstTop = (LEADRasterView1.ScaleHeight - LEADRasterView1.DstHeight) / 2
LEADRasterView1.DstLeft = (LEADRasterView1.ScaleWidth - LEADRasterView1.DstWidth) / 2
'Set the clipping area to the same as the destination rectangle
LEADRasterView1.DstClipWidth = LEADRasterView1.DstWidth
LEADRasterView1.DstClipHeight = LEADRasterView1.DstHeight
LEADRasterView1.DstClipTop = LEADRasterView1.DstTop
LEADRasterView1.DstClipLeft = LEADRasterView1.DstLeft
'Redisplay the image
LEADRasterView1.ForceRepaint


BalanceColors example for Visual Basic

Const RedFactToRed = 0.25
Const RedFactToGreen = 0.5
Const RedFactToBlue = 0.25
Const GreenFactToRed = 0.3
Const GreenFactToGreen = 0.4
Const GreenFactToBlue = 0.3
Const BlueFactToRed = 0.1
Const BlueFactToGreen = 0.6
Const BlueFactToBlue = 0.3
Dim RasterProc As New LEADRasterProcess
RasterProc.BalanceColors LEADRasterView1.Raster, RedFactToRed, RedFactToGreen, RedFactToBlue, GreenFactToRed, GreenFactToGreen, GreenFactToBlue, BlueFactToRed, BlueFactToGreen, BlueFactToBlue


Bending Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Bending LEADRasterView1.Raster, 100, 20, 100, 0, FILL_RPT _
Or FILL_WOUTROT _
Or BND_NORM


BinaryFilter example for Visual Basic

This example does omni-directional erosion of black objects and repaints the image.

Dim RasterProc As New LEADRasterProcess
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
RasterProc.BinaryFilter LEADRasterView1.Raster, BFLT_EROSION_OMNI
LEADRasterView1.ForceRepaint


BitmapAlpha example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to use the BitmapAlpha property to save a region in a file's alpha channel. It also shows how to use the region as a mask for transparency.

Dim rgntop As Single
Dim rgnleft As Single
Dim rgnwidth As Single
Dim rgnheight As Single
Dim hRGN As Long
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim test As Long

LEADRasterView1.ScaleMode = 3
RasterIO.Load LEADRasterView1.Raster, "v:\images\eagle.cmp", 0, 0, 1
LEADRasterView1.AutoRepaint = False

'Get an alpha channel bitmap, and fill it with white
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.BitmapAlpha
LEADRasterView2.Raster.SetRgnColor RGB(0, 0, 0), L_RGN_SETNOT

test = LEADRasterView2.Raster.GetRgnArea

' test here, if test = 0, then Alpha is all Black
If test = 0 Then MsgBox "Alpha image is all black"

RasterProc.Fill LEADRasterView2.Raster, RGB(255, 255, 255)
rgntop = 0
rgnleft = 0
rgnwidth = LEADRasterView1.Raster.BitmapWidth
rgnheight = LEADRasterView1.Raster.BitmapHeight
'Create an elliptical region in the AlphaBitmap
LEADRasterView2.Raster.SetRgnEllipse rgntop, rgnleft, rgnwidth, rgnheight, L_RGN_SET
'Fill the region with black
RasterProc.Fill LEADRasterView2.Raster, RGB(0, 0, 0)
'Free the region
LEADRasterView2.Raster.FreeRgn
'Update the alpha channel in the main bitmap
LEADRasterView1.Raster.BitmapAlpha = LEADRasterView2.Raster.Bitmap
'Save the bitmap as 32-bit TGA
RasterIO.Save LEADRasterView1.Raster, "d:\temp\test.tga", FILE_TGA, 32, 0, SAVE_OVERWRITE
'Free the bitmaps
LEADRasterView1.Raster.Bitmap = 0
LEADRasterView2.Raster.Bitmap = 0
'Load the bitmap we just saved and get the alpha channel
RasterIO.Load LEADRasterView1.Raster, "d:\temp\test.tga", 0, 0, 1
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.BitmapAlpha
'Create a region in the AlphaBitmap that includes all of the black pixels
LEADRasterView2.Raster.SetRgnColor RGB(0, 0, 0), L_RGN_SET
'Get the region from the AlphaBitmap and set it into the main bitmap
hRGN = LEADRasterView2.Raster.GetRgnHandle
LEADRasterView1.Raster.SetRgnHandle hRGN, 0, 0, L_RGN_SET
LEADRasterView2.Raster.DeleteRgnHandle hRGN
LEADRasterView1.PaintRgnOnly = True
LEADRasterView1.ForceRepaint


BitmapBytesPerLine example for Visual Basic

Dim RasterIO As New LEADRasterIO
Private Sub Command1_Click()
RasterIO.Load Me.LEADRasterView1.Raster, App.Path & "\image.jpg", 0, 0, 1
MsgBox LEADRasterView1.Raster.BitmapBytesPerLine
End Sub


BitmapCompression example for Visual Basic

' This example toggles the bitmap's compression
Dim oldSize As Long
oldSize = LEADRasterView1.Raster.BitmapSize

If LEADRasterView1.Raster.BitmapCompression = COMP_NONE Then
' Compress the bitmap
If LEADRasterView1.Raster.BitmapBits = 24 Then
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_SUPER
ElseIf LEADRasterView1.Raster.BitmapBits = 1 Then
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_RLE
End If
Else
' Bitmap is compressed. Uncompress it
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_NONE
End If

MsgBox "old Size = " + CStr(oldSize) + vbCr + "New Size = " + CStr(LEADRasterView1.Raster.BitmapSize)


BitmapDataPath Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to load an image from the Internet. It uses the BitmapDataPath property to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.

'declare the RasterIO object WithEvents
Public WithEvents RasterIO As LEADRasterIO

'create the RasterIO object
Private Sub Form_Load()
'........
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO. ")
'........
End Sub

Private Sub Command1_Click()
' Start the asynchronous load.
RasterIO.BitmapDataPath LEADRasterView1.Raster, "http://www.leadtools.com/images/tiger2.cmp"
End Sub

Private Sub RasterIO_ReadyStateChange (ByVal ReadyState As Long)
' Paint the image when loading is complete.
If ReadyState = RASTER_READYSTATE_COMPLETE Then
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
LEADRasterView1.ForceRepaint
End If
End Sub


BitmapDpi Example for Visual Basic

Dim x, y, hAuto As Long
RasterAnn.AnnCreate ANN_OBJECT_AUTOMATION, False, False
hAuto = RasterAnn.AnnObject

x = RasterAnn.AnnGetBitmapDpiX (hAuto)
y = RasterAnn.AnnGetBitmapDpiY (hAuto)
MsgBox x & ", " & y
RasterAnn.AnnSetBitmapDpiX hAuto, x + 2, False
RasterAnn.AnnSetBitmapDpiY hAuto, y + 2, False
x = RasterAnn.AnnGetBitmapDpiX (hAuto)
y = RasterAnn.AnnGetBitmapDpiY (hAuto)
MsgBox x & ", " & y


BitmapToClient example for Visual Basic

Dim szOut As String

'Test a bitmap location for its screen location
LEADRasterView1.ScaleMode = 3 'pixels b/c I'm passing pixels
LEADRasterView1.BitmapToClient 50, 50
szOut = ""
szOut = szOut + "ClientX = " & CStr(LEADRasterView1.ConvertX) & Chr(10) & Chr(13)
szOut = szOut + "ClientY = " & CStr(LEADRasterView1.ConvertY) & Chr(10) & Chr(13)
MsgBox szOut


BitmapXRes and BitmapYRes example for Visual Basic

Note: Also works with Access 95 and 97.

This example sets the bitmap's resolution to 300 x 600 DPI.

LEADRasterView1.Raster.BitmapXRes = 300
LEADRasterView1.Raster.BitmapYRes = 600


BitonalScaling (ILEADRasterImgList) example for Visual Basic

' needed for the BitonalScaling feature
LEADRaster1.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT
LEADImgList1.BitonalScaling = IMGLST_BITONALSCALING_NORMAL
LEADImgList1.LoadFromFile "G:\Images\MultiPage.tif", 1, 1, -1
LEADImgList1.EnsureVisible LEADImgList1.Count – 1
'force redrawing
LEADImgList1.Visible = False
LEADImgList1.Visible = True
MsgBox "will enable bitonal scale to gray"
'set the control to use scale to gray
LEADImgList1.BitonalScaling = IMGLST_BITONALSCALING_SCALETOGRAY
'force redrawing
LEADImgList1.Visible = False
LEADImgList1.Visible = True


BitonalScaling example for Visual Basic

Note: Also works with Access 95 and 97.

This example sets the display to use scale-to-gray and repaints the image. This affects only 1-bit images.

If LEADRasterView1.Raster.IsSupportLocked(L_SUPPORT_DOCUMENT) Then
MsgBox "No scale to gray - You need to unlock Document/Medical capabilities"
Else
LEADRasterView1.BitonalScaling = BITONALSCALING_SCALETOGRAY
LEADRasterView1.ForceRepaint
End If


BooleanItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_ARRAY_BOOLEAN
RasterVariant.ItemCount = 2
RasterVariant.BooleanItemValue(0) = True
RasterVariant.BooleanItemValue(1) = False


BooleanValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_BOOLEAN
RasterVariant.BooleanValue = True


BorderColor example for Visual Basic

'This sets the border style to Fixed Single.
'And sets the border color to blue.
LEADImgList1.Appearance = IMGLST_APPEARANCE_FLAT
LEADImgList1.BorderStyle = 1
LEADImgList1.BorderColor = RGB(0, 0, 255)


BorderRemove example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub

Private Sub Command59_Click()
'Border Remove
'This example returns a region corresponding to the borders of a bitmap
'For the example, windows regions are returned in the BorderRemove Event and combined.
'In practice it would be easier and faster to just return a LEAD region representing the changes
'The border is removed from the image

Dim nRet As Integer

'Enable the doc clean event
RasterProc.EnableDocCleanEvents = True

'Create a NULL region
hRgnAll = CreateRectRgn(0, 0, 0, 0)
nRet = RasterProc.BorderRemove(LEADRasterView1.Raster, _
BORDER_CALLBACK_REGION + BORDER_USE_VARIANCE, _
BORDER_ALL, 20, 9, 3)
If (nRet = 0) Then
LEADRasterView1.Raster.FreeRgn
LEADRasterView1.Raster.SetRgnHandle hRgnAll, 0, 0, L_RGN_SET
LEADRasterView1.RgnFrameType= RGNFRAME_COLOR
End If
'delete the Windows Rgn
DeleteObject hRgnAll
End Sub

Private Sub RasterProc_BorderRemove(ByVal hRgn As Long, ByVal uBorderToRemove As Long, ByVal fBoundingRectLeft As Single, ByVal fBoundingRectTop As Single, ByVal fBoundingRectWidth As Single, ByVal fBoundingRectHeight As Single)
Dim szBorder As String
CombineRgn hRgnAll, hRgnAll, hRgn, RGN_OR
Select Case (uBorderToRemove)
Case BORDER_TOP:
szBorder = "Top"
Case BORDER_LEFT:
szBorder = "Left"
Case BORDER_RIGHT:
szBorder = "Right"
Case BORDER_BOTTOM:
szBorder = "Bottom"
End Select
Debug.Print "Border - " & szBorder & " Bounds:" & CStr(fBoundingRectLeft) & ", " & CStr(fBoundingRectTop) & ", " & CStr(fBoundingRectWidth) & ", " & CStr(fBoundingRectHeight); ""
RasterProc.DocCleanSuccess = SUCCESS_REMOVE
End Sub


BorderStyle example for Visual Basic

Note: Also works with Access 95 and 97.

This example toggles the border style and repaints the image.

If LEADRasterView1.BorderStyle = 1 Then
LEADRasterView1.BorderStyle = 0
Else
LEADRasterView1.BorderStyle = 1
End If
LEADRasterView1.ForceRepaint


BricksTexture Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.BricksTexture LEADRasterView1.Raster, _
60, 20, 0, _
0, 3, 4, _
315, 33, 20, _
0, 10, 0, _
0, BRICKS_SMOOTHEDOUT


BrowseDir example for Visual Basic

LEADThumb1.StopOnError = True
LEADThumb1.Filter = "*.*" 'search for all files
LEADThumb1.ThumbnailWidth= 150
LEADThumb1.ThumbnailHeight = 150
LEADThumb1.ThumbnailBitsPerPixel = 0
LEADThumb1.MaintainAspect = True
LEADThumb1.ForceSize = True
LEADThumb1.ThumbnailBackgroundColor = RGB(255, 0, 0)

LEADThumb1.LoadStamp = True
LEADThumb1.Resample = True

LEADThumb1.IncludeSubDirectories = False

LEADThumb1.ExpandMultipage = False

LEADThumb1.MaxSizeDisk = 0 'no filesize limit
LEADThumb1.MaxSizeMem = 4096000 'set an image size limit

LEADThumb1.DitherFlags = THMB_CRD_STUCKIDITHERING
LEADThumb1.PaletteFlags = THMB_CRP_FIXEDPALETTE
LEADThumb1.BrowseDir "G:\Images"


BumpMap Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim TmpRaster As New LEADRaster
Dim RasterIO As New LEADRasterIO
RasterIO.Load TmpRaster, "c:\1.jpg", 0, 0, 1
RasterProc.BumpMap LEADRasterView1.Raster, TmpRaster, 5, _
0, _
3, _
0, _
0, _
0, _
0, _
True, _
50, _
0


ButtonColumns example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Public Sub IncrementButtonColumns(AnnToolBar As LEADRasterAnnToolBar)
If AnnToolBar.ToolBarhWnd <> 0 Then
AnnToolBar.ButtonColumns = AnnToolBar.ButtonColumns + 1
End If
End Sub


ButtonMenuTool example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'Makes the first rubber stamp tool draw a rectangle
Public Sub SetToolToRect(AnnToolBar As LEADRasterAnnToolBar)
Dim I As Integer
For I = 0 To AnnToolBar.ButtonCount
' is this the button with the rubber stamps ?
If AnnToolBar.ButtonToolCount(I) > 1 Then
AnnToolBar.ButtonMenuTool(I, 0) = ANN_TOOL_RECT
End If
Next I
End Sub


ButtonRows example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Public Sub IncrementButtonRows (AnnToolBar As LEADRasterAnnToolBar)
If AnnToolBar.ToolBarhWnd = 0 Then
Exit Sub
End If
AnnToolBar.ButtonRows= AnnToolBar.ButtonRows + 1
End Sub


ButtonVisible example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

Public Sub ToggleVisibleState(AnnToolBar As LEADRasterAnnToolBar, iButtonIndex As Integer)

AnnToolBar.ButtonVisible(iButtonIndex) = Not AnnToolBar.ButtonVisible(iButtonIndex)

MsgBox "Button Index " & iButtonIndex & " visible state is " & AnnToolBar.ButtonVisible(iButtonIndex)

End Sub


Canvas Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim TmpRaster As New LEADRaster
Dim RasterIO As New LEADRasterIO
RasterIO.Load TmpRaster, "c:\Sample1.jpg", 0, 0, 1
RasterProc.Canvas LEADRasterView1.Raster, _
TmpRaster, _
100, _
100, _
0, _
0, _
10, _
CANVAS_SHIFT


Capture example for Visual Basic

This example captures the current form and displays the captured image with scroll bars.

Dim OldMode
'Turn on the automatic display rectangles.
LEADRasterView1.AutoSetRects = True
'Set the scale mode to twips temporarily
OldMode = LEADRasterView1.ScaleMode
LEADRasterView1.ScaleMode = 1
LEADRasterView1.Raster.Capture 0, Left, Top, Width, Height
LEADRasterView1.AutoScroll = True
LEADRasterView1.ForceRepaint
'Set the scale mode to the previous mode
LEADRasterView1.ScaleMode = OldMode


CenterImage example for Visual Basic

'toggle CenterImage
LEADRasterView1.CenterImage = Not LEADRasterView1.CenterImage


Change example for Visual Basic

Note: Also works with Access 95 and 97.

Typically, you would use this event to flag changed image data and prompt the user to save the changes before closing a window or exiting an application. That use of the event cannot be tested properly without writing a complete application; so this example just shows you a simple test of the event.

This example is for an ILEADRaster Object created at run-time.

'Declare an ILEADRaster Object WithEvents
Public WithEvents MyRaster As LEADRaster

Private Sub Command1_Click()
'Create a new ILEADRaster Object
Dim Factory As New LEADRasterFactory
Dim szLic As String

'Create the object
szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc." & vbCrLf & vbCrLf
Set MyRaster = Factory.CreateObject("LEADRaster.LEADRaster", szLic)

'create a new bitmap
MyRaster.ScaleMode = SCALEMODE_PIXEL
MyRaster.CreateBitmap 100, 100, 24 'this will fire the Change event
End Sub

Private Sub MyRaster_Change(ByVal nChange As Long, ByVal nReserved1 As Long, ByVal nReserved2 As Long)
MsgBox "Image data changed: " & CStr(nChange)
End Sub


ChannelMix Example for Visual Basic

RasterProc.ChannelMix LEADRasterView1.Raster, 50, 0, 0, 0, 100, 100, 0, 0, 0, 0, 100, 0


Clear example for Visual Basic

'empty the current list
LEADImgList1.Clear


Click and MouseIcon example for Visual Basic

This example demonstrates the Click event and the MouseIcon property.

Private Sub LEADRasterView1_Click()
'This example, on a click event, toggles between the default
'mouse pointer and a loaded icon.
If LEADRasterView1.MousePointer = 0 Then
LEADRasterView1.MouseIcon = LoadPicture("c:\vb\icons\arrows\point04.ico")
LEADRasterView1.MousePointer = 99
Else
LEADRasterView1.MousePointer = 0
End If
End Sub


ClientToBitmap example for Visual Basic

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim BitmapX As Single
Dim BitmapY As Single

BitmapX = x
BitmapY = y
LEADRasterView1.ClientToBitmap BitmapX, BitmapY

'Change that pixel to White
LEADRasterView1.Raster.Pixel(LEADRasterView1.ConvertX, LEADRasterView1.ConvertY) = vbWhite
End Sub


Clouds Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Clouds LEADRasterView1.Raster, _
1000, _
4, _
10, _
10, _
RGB(255, 255, 255), _
RGB(0, 0, 0), _
CLD_DIFFERENCE


CMYKRaster Example for Visual Basic

This example will load an array of CMYK TIFF files, increase the brightness of the K plane only (which will darken the image) and save the file as CMYK TIFF

Public RasterIO As New LEADRasterIO
Public Raster As New LEADRaster
Public RasterPorc As New LEADRasterProcess
Public RasterView As LEADRasterView

Private Sub TestLoadCMYKArray()
Dim nRet As Integer

nRet = RasterIO.GetFileInfo(Raster, "cmyk.tif", 0, 0)
If nRet <> 0 Then
MsgBox "Invalid source file"
Exit Sub
End If

RasterIO.CMYKRasterCount = 4
nRet = RasterIO.LoadFileCMYKArray("cmyk.tif", 8, 1)
If nRet <> 0 Then
MsgBox "LoadFileCMYKArray failed!"
Exit Sub
End If

' The load has succeeded.
' Increase the brightness of the K (black) plane by 50%
' Note that this will DARKEN the image, because we increased the amount of black!
nRet = RasterPorc.Intensity(RasterIO.CMYKRaster(3), 500)
If nRet <> 0 Then
MsgBox "Intensity failed!"
Else
nRet = RasterIO.SaveFileCMYKArray("c:\\myCMYK.tif", FILE_TIFLZW_CMYK, 8, 2, 0)
If nRet <> 0 Then
MsgBox "SaveFileCMYKArray failed!"
End If
End If

RasterView.RasterIO = RasterIO
RasterView.EnablePaintCMYKArray = True
End Sub


ColoredBalls Example for Visual Basic

RasterProc. ColoredBallsCount = 7

RasterProc.ColoredBalls(0) = RGB(230, 50, 50)
RasterProc.ColoredBalls (1) = RGB(230, 200, 160)
RasterProc.ColoredBalls (2) = RGB(255, 255, 128)
RasterProc.ColoredBalls (3) = RGB(240, 50, 100)
RasterProc.ColoredBalls (4) = RGB(255, 255, 180)
RasterProc.ColoredBalls (5) = RGB(170, 240, 100)
RasterProc.ColoredBalls (6) = RGB(255, 255, 255)

RasterProc.ColoredBalls LEADRasterView1.Raster, 1000, _
25, 15, 4500, _
RGB(255, 255, 255), _
RGB(255, 0, 0), _
RGB(255, 255, 0), _
64, 10, 100, _
CLRBALLS_SHADING_CIRCULAR Or _
CLRBALLS_STICKER Or _
CLRBALLS_IMAGE Or _
CLRBALLS_BALLCLR_OPACITY


ColoredPencil Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ColoredPencil LEADRasterView1.Raster, 50, 3


ColorHalfTone Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ColorHalfTone LEADRasterView1.Raster, 15, 10800, 16200, 9000, 4500


ColorIntensityBalance Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.Shadow.Red = 60
RasterProc.Shadow.Green = 0
RasterProc.Shadow.Blue = 0

RasterProc.MidTone.Red = 40
RasterProc.MidTone.Green = 0
RasterProc.MidTone.Blue = 0

RasterProc.HighLight.Red = 70
RasterProc.HighLight.Green = 0
RasterProc.HighLight.Blue = 0

RasterProc.ColorIntensityBalance LEADRasterView1.Raster, False


ColorizeGray Example for Visual Basic

Dim RasterSrc As New LEADRaster
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
RasterIO.Load RasterSrc, "c:\image1.bmp", 0, 0, 1

RasterProc.GrayColorCount = 6

RasterProc.GrayColorThreshold(0) = 9999
RasterProc.GrayColorRed(0) = 255
RasterProc.GrayColorGreen(0) = 0
RasterProc.GrayColorBlue(0) = 0

RasterProc.GrayColorThreshold(1) = 19999
RasterProc.GrayColorRed(1) = 0
RasterProc.GrayColorGreen(1) = 255
RasterProc.GrayColorBlue(1) = 0

RasterProc.GrayColorThreshold(2) = 29999
RasterProc.GrayColorRed(2) = 0
RasterProc.GrayColorGreen(2) = 0
RasterProc.GrayColorBlue(2) = 255

RasterProc.GrayColorThreshold(3) = 39999
RasterProc.GrayColorRed(3) = 0
RasterProc.GrayColorGreen(3) = 255
RasterProc.GrayColorBlue(3) = 255

RasterProc.GrayColorThreshold(4) = 49999
RasterProc.GrayColorRed(4) = 255
RasterProc.GrayColorGreen(4) = 0
RasterProc.GrayColorBlue(4) = 255

RasterProc.GrayColorThreshold(5) = 59999
RasterProc.GrayColorRed(5) = 255
RasterProc.GrayColorGreen(5) = 255
RasterProc.GrayColorBlue(5) = 0

RasterProc.ColorizeGray LEADRasterView1.Raster, RasterSrc


ColorLevel Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.MasterMinInput = 0
RasterProc.MasterMaxInput = 255
RasterProc.MasterMinOutput = 255
RasterProc.MasterMaxOutput = 0
RasterProc.MasterGamma = DEFAULT_GAMMA

RasterProc.RedMinInput = 120
RasterProc.RedMaxInput = 20
RasterProc.RedMinOutput = 255
RasterProc.RedMaxOutput = 255
RasterProc.RedGamma = DEFAULT_GAMMA

RasterProc.GreenMinInput = 0
RasterProc.GreenMaxInput = 100
RasterProc.GreenMinOutput = 200
RasterProc.GreenMaxOutput = 0
RasterProc.GreenGamma = DEFAULT_GAMMA

RasterProc.BlueMinInput = 20
RasterProc.BlueMaxInput = 200
RasterProc.BlueMinOutput = 0
RasterProc.BlueMaxOutput = 255
RasterProc.BlueGamma = DEFAULT_GAMMA

RasterProc.ColorLevel LEADRasterView1.Raster, LEVEL_BLUE Or LEVEL_MASTER


ColorReplace example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ReplaceColorsCount = 1
RasterProc.ReplaceColorValue(0) = RGB(200, 0, 35)
RasterProc.ReplaceColorFuzziness(0) = 100
RasterProc.ColorReplace LEADRasterView1.Raster, 9000, 0, 0


ColorRes example for Visual Basic

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

Dim RasterProc As New LEADRasterProcess
If LEADRasterView1.Raster.BitmapBits <> 8 Then
MousePointer = 11 ' hourglass
RasterProc.ColorRes LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default
End If


ColorResList Example for Visual Basic

Note: Also works with Access 95 and 97.

This example changes the hue of bitmaps in a list, then plays the list as an animation. When changing the hue, it preserves the transparent color.

Dim i As Integer ' Loop counter
Dim uCount As Integer ' Number of bitmaps in the list
Dim TransparentColor As Long ' Color used for transparency
Dim RasterProc As New LEADRasterProcess
' Save the current transparent color.
TransparentColor = LEADRasterView1.Raster.BitmapTransparentColor
' Avoid repaints while we modify the bitmaps.
LEADRasterView1.AutoRepaint = False
' Change the hue of each bitmap in the list,
' and restore the transparent color as the last color in the palette.
uCount = LEADRasterView1.Raster.BitmapListCount
For i = 0 To uCount - 1
LEADRasterView1.Raster.BitmapListIndex = i
RasterProc.Hue LEADRasterView1.Raster, i * 10
LEADRasterView1.Raster.BitmapPalette(255) = TransparentColor
Next I
' Get an optimized palette for the whole list.
RasterProc.ColorResList LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_NODITHERING, 0
' Update the palette that is used for playback.
For i = 0 To 255
LEADRasterView1.AnimationPalette(i) = LEADRasterView1.Raster.BitmapPalette(i)
Next I
' Start the animation.
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AnimationEnable = True


ColorSpace Example for Visual Basic

RasterIO.ColorSpace = COLORSPACE_BGR
RasterIO.IgnoreViewPerspective = True
RasterIO.Load Raster, "test.tif", 0, 1, -1


ColorThreshold example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i As Integer
For i = 0 To 2
RasterProc.ComponentMinRange(i) = 128
RasterProc.ComponentMaxRange(i) = 255
RasterProc.ComponentFlags(i) = CLTH_TYP_BANDPASS
Next i
'Apply color Threshold effect on the image
RasterProc.ColorThreshold LEADRasterView1.Raster, CLTH_RGB_SPACE


Combine example for Visual Basic

This example copies the LEADRasterView1 bitmap to LEADRasterView2, trims and filters the copied image, and combines the filtered image with the original LEADRasterView1 bitmap image. Trimming LEADRasterView2 lets you see the difference between filtered and nonfiltered regions.

Dim DstLeft As Single
Dim DstTop As Single
Dim DstWidth As Single
Dim DstHeight As Single
Dim RasterProc as New LEADRasterProcess
MousePointer = 11 ' hourglass
LEADRasterView2.Raster.RefBitmap = False
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
TrimLeft = (LEADRasterView2.Raster.BitmapWidth * 0.2)
TrimTop = (LEADRasterView2.Raster.BitmapHeight * 0.2)
TrimWidth = (LEADRasterView2.Raster.BitmapWidth * 0.6)
TrimHeight = (LEADRasterView2.Raster.BitmapHeight * 0.6)
RasterProc.Trim LEADRasterView2.Raster, TrimLeft, TrimTop, TrimWidth, TrimHeight
RasterProc.SpatialFilter LEADRasterView2.Raster, FLT_LINESEG_LTOR
DstLeft = TrimLeft
DstTop = TrimTop
DstWidth = TrimWidth
DstHeight = TrimHeight
SrcLeft = 0
SrcTop = 0
RasterProc.Combine LEADRasterView1.Raster, DstLeft, DstTop, _
DstWidth, DstHeight, _
LEADRasterView2.Raster, _
SrcLeft, SrcTop, CB_OP_ADD
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default


CombineBitmapWarp example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim RasterVarX As New LEADRasterVariant
Dim RasterVarY As New LEADRasterVariant
Dim lFlag As Long
Dim nRet As Integer
Dim uMasterBPP, uSlaveBPP As Integer
Dim nDithFlags, nPalFlags As Integer
Dim uBitsPerPixel As Integer
Dim strError As String

' Set the flag
lFlag = CBW_RESERVED8
If BilinearInterpolate.Value = 1 Then
lFlag = lFlag + CBW_BILINEAR
End If
' Get the polygon Annotation points
RasterAnn.AnnGetPointX hObject, RasterVarX
RasterAnn.AnnGetPointY hObject, RasterVarY
RasterProc.EnableMethodErrors = False

uMasterBPP = LEADMaster.Raster.BitmapBits
uSlaveBPP = LEADSlave.Raster.BitmapBits
If (uMasterBPP < 24) Or (uSlaveBPP < 24) Then
nPalFlags = CRP_FIXEDPALETTE + CRP_BYTEORDERBGR
nDithFlags = CRD_NODITHERING
If uMasterBPP > uSlaveBPP Then
uBitsPerPixel = uMasterBPP
Else
uBitsPerPixel = uSlaveBPP
End If
If uMasterBPP <> uBitsPerPixel Then
RasterProc.ColorRes LEADMaster.Raster, uBitsPerPixel, nPalFlags, nDithFlags, 0
End If
If uSlaveBPP <> uBitsPerPixel Then
RasterProc.ColorRes LEADSlave.Raster, uBitsPerPixel, nPalFlags, nDithFlags, 0
End If
End If
Screen.MousePointer = 11
' Combine the slave on the master
nRet = RasterProc.CombineBitmapWarp(LEADMaster.Raster, RasterVarX, RasterVarY, 4, LEADSlave.Raster, 0, 0, LEADSlave.Raster.BitmapWidth, LEADSlave.Raster.BitmapHeight, lFlag)
Screen.MousePointer = 0
If nRet <> 0 Then
strError = "One of the following caused the error: "
strError = strError + "1. Polygon must be concave "
strError = strError + "2. Polygon must lie completely on the master bitmap "
strError = strError + "3. The bits per pixel of the Master and Slave must be the same "
strError = strError + "4. Master or slave image not loaded"
MsgBox strError
End If
Set RasterProc = Nothing
LEADMaster.ForceRepaint


CombineExt example for Visual Basic

'This example copies the RasterView1 bitmap to RasterView2, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap image. Trimming RasterView2 lets you see the difference between filtered and nonfiltered regions.

Dim TrimLeft As Single, TrimTop As Single, TrimWidth As Single, TrimHeight As Single
Dim DstLeft As Single, DstTop As Single, DstWidth As Single, DstHeight As Single
Dim SrcLeft As Single, SrcTop As Single
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
TrimLeft = (LEADRasterView2.Raster.BitmapWidth * 0.2)
TrimTop = (LEADRasterView2.Raster.BitmapHeight * 0.2)
TrimWidth = (LEADRasterView2.Raster.BitmapWidth * 0.6)
TrimHeight = (LEADRasterView2.Raster.BitmapHeight * 0.6)
RasterProc.Trim LEADRasterView2.Raster, TrimLeft, TrimTop, TrimWidth, TrimHeight
RasterProc.SpatialFilter LEADRasterView2.Raster, FLT_LINESEG_HORZ
DstLeft = TrimLeft
DstTop = TrimTop
DstWidth = TrimWidth
DstHeight = TrimHeight
SrcLeft = 0
SrcTop = 0
RasterProc.CombineExt LEADRasterView1.Raster, DstLeft, DstTop, DstWidth, DstHeight, LEADRasterView2.Raster, SrcLeft, SrcTop, CB_OP_ADD
LEADRasterView1.ForceRepaint


Comment example for Visual Basic

Note: Also works with Access 95 and 97.

This example does the following:

1. | Loads an image from a TIFF file.
2. | Updates the current comment array by reading comments from the file.
3. | Modifies one of the comments.
4. | Modifies and saves the file.
5. | Reads the comment that was saved, and displays it in a message box.

This example handles only string comments. For more complex comments, refer to Exif Examples.

Dim MyCommentText As String 'String for CMNT_SZDESC
Dim FilePath As String 'File to be updated
Dim i As Long 'Loop counter and array index
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim RasterVarEmpty As New LEADRasterVariant
Dim RasterVar As New LEADRasterVariant

'Specify the file that we will update.
FilePath = "d:\temp\combined.mpt"
'Get all of the current comments from the file.
'Temporarily disable method errors so that we do not fail when comments are missing.
RasterIO.EnableMethodErrors = False
For i = 0 To CMNT_LAST
RasterIO.Comment(i) = RasterVarEmpty
RasterIO.Comment(i) = RasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, i)
Next i
'Load and modify the image.
RasterIO.EnableMethodErrors = True
RasterIO.Load LEADRasterView1.Raster, FilePath, 0, 0, 1
RasterProc.Reverse LEADRasterView1.Raster
'Update the CMNT_SZDESC comment.
MyCommentText = Chr(13) + "This image has been reversed."
RasterVar.Type = VALUE_STRING
RasterVar = RasterIO.Comment(CMNT_SZDESC)
RasterVar.StringValue = RasterVar.StringValue + MyCommentText
RasterIO.Comment(CMNT_SZDESC) = RasterVar
'Save the file and read the comment that we saved.
RasterIO.Save LEADRasterView1.Raster, FilePath, FILE_TIF, LEADRasterView1.Raster.BitmapBits, 0, SAVE_OVERWRITE
RasterVar = RasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_SZDESC)
'Display the message
MsgBox RasterVar.StringValue
'Clear the comments from memory
For i = 0 To CMNT_LAST
RasterIO.Comment(i) = RasterVarEmpty
Next i


CompactFile Example for Visual Basic

Example 1:

Public RasterIO As New LEADRasterIO
Private Sub TestCompactFileExample1()
Dim nRet As Integer
' This example will compact all the pages in a TIFF file. It will create a new file called dstfile.tif
nRet = RasterIO.CompactFile("srcfile.tif", "dstfile.tif", 0, 0, -1, SAVE_OVERWRITE, 0)
If nRet <> 0 Then
MsgBox "Error compacting file!"
End If
End Sub

Example 2:

Public RasterIO As New LEADRasterIO
Private Sub TestCompactFileExample2()
Dim nRet As Integer
' This example will compact all the pages in a TIFF file. It will append all the pages to an existing file called dstfile.tif
nRet = RasterIO.CompactFile("srcfile.tif", "dstfile.tif", 0, 0, -1, SAVE_APPEND, -1)
If nRet <> 0 Then
MsgBox "Error compacting file!"
End If
End Sub


ContinueBrowse example for Visual Basic

Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
Dim LEADRaster1 as LEADRaster
'in this example, nCount is a global variable used to count the thumbnails
If (nStatusCode = 0) Then 'successful thumbnail generation
'save thumbnails in a multipage TIFF file
Set LEADRaster1 = New LEADRaster
LEADRaster1.Bitmap = Bitmap
LEADRasterIO1.Save LEADRaster1, "d:\temp\thumbs.tif", FILE_TIF, 24, 0, SAVE_APPEND
nCount = nCount + 1
If nCount > 20 Then 'allow max of 20 thumbnails
LEADThumb1.ContinueBrowse = False 'stop the browse
Exit Sub
End If
End If
LEADThumb1.ContinueBrowse = True 'continue the browse operation
End Sub


ContourFilter example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ContourFilter LEADRasterView1.Raster, _
20, 35, 5, CONTOUR_APPROX_COLOR


Contrast example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the contrast and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Contrast LEADRasterView1.Raster, 50
LEADRasterView1.ForceRepaint


ContrastBrightIntensity Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.ContrastBrightIntensity LEADRasterView1.Raster, -146, 385, 240


ControlWindow Example for Visual Basic

Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long

Private Sub CtlWin_Click()
Dim ctlDC As Long, ctlWnd As Long, strOut As String
strOut = "Writing to Control Window"
ctlWnd = LEADRasImgList1.ControlWindow
If ctlWnd <> 0 Then
ctlDC = GetDC(ctlWnd)
TextOut ctlDC, 10, 10, strOut, Len(strOut)
ReleaseDC ctlWnd, ctlDC
End If
End Sub


ConvertToColoredGray example for Visual Basic

Const RedFact = 300
Const GreenFact = 590
Const BlueFact = 110
Const RedGrayFact = 500
Const GreenGrayFact = 300
Const BlueGrayFact = 200
Dim RasterProc As New LEADRasterProcess
RasterProc.ConvertToColoredGray LEADRasterView1.Raster, RedFact, GreenFact, BlueFact, RedGrayFact, GreenGrayFact, BlueGrayFact


ConvertUnsignedToSigned Example for Visual Basic

RasterIO.LoadSigned = True
RasterIO.Load LEADRasterView1.Raster, "c:\temp\signed.tif", 0, 0, 1
' use the non-default conversion "zero to center"
RasterProc.ConvertUnsignedToSigned LEADRasterView1.Raster, _ PROCESS_RANGE_ONLY


CopyMarkers example for Visual Basic

Dim Marker1 As LEADMarkers
Dim Marker2 As LEADMarkers4
Dim RasterIO As LEADRasterIO

Private Sub CopyMarkers_Click()
Marker1.Load "c:\ image1.jpg", 0
Marker2.CreateMarkers
RasterIO.CopyMarkers Marker2, Marker1

For i = 0 To Marker2.Count - 1
Marker2.GetMarker i
Print Marker2.Type, Marker2.ElementCount
Next i
End Sub


Correlation Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim RasterIO As New LEADRasterIO
Dim CorRaster As New LEADRaster
Dim i As Integer

RasterIO.Load CorRaster, "c:\1.cmp", 0, 0, 1

RasterProc.CorrelationMaxPoints = 90
RasterProc.Correlation LEADRasterView1.Raster, CorRaster, 1, 1, 90
MsgBox RasterProc.CorrelationCount
For i = 0 To RasterProc.CorrelationCount - 1
MsgBox "X = " + Str(RasterProc.CorrelationX(i)) + Chr$(13) + _
"Y = " + Str(RasterProc.CorrelationY (i)) + Chr$(13)

Next i


CorrelationList Example for Visual Basic

Dim iListCount As Integer
Dim iListIndex As Integer
Dim iListMaxPoints As Integer
Dim i As Integer
Dim c As Integer
Raster2.Bitmap = 0
For i = 0 To 4
Raster2.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.Rotate Raster2, 7200 * i, 0, RGB(255, 0, 0)
LEADRasterView2.Raster.InsertBitmapListItem -1, Raster2.Bitmap
Next i

RasterProc.CorrelationListMaxPoints = 90
RasterProc.CorrelationList LEADRasterView2.Raster, 1, 2, 10

iListCount = RasterProc.CorrelationListCount
iListMaxPoints = RasterProc.CorrelationListMaxPoints

For c = 0 To iListCount

iListIndex = RasterProc.CorrelationListIndex(c)
MsgBox "X = " + Str(RasterProc.CorrelationListX(iListIndex)) + Chr$(13) + _
"Y = " + Str(RasterProc.CorrelationListY(iListIndex)) + Chr$(13)
Next c


CountLUTColors example for Visual Basic

LEADRasterView1.Raster.CountLUTColors LUT_UNSIGNED
MsgBox "Colors = " + Str(LEADRasterView1.Raster.LUTColorsCount) + Chr$(13) + _
"First Index = " + Str(LEADRasterView1.Raster.LUTColorsFirstIndex)


Create Bitmap, Size, and Combine example for Visual Basic

This example creates a bitmap for Raster2 (same size and BPS as LEADRasterView1.Raster) and fills it with green. It resizes the LEADRasterView1.Raster bitmap, then uses a loop to do multiple combines with the Raster2 bitmap. It then copies the Raster2 bitmap to LEADRasterView1 and redisplays LEADRasterView1.

Dim Factory As New LEADRasterFactory
Dim Raster2 As LEADRaster
Dim szLic As String
Dim RasterProc As New LEADRasterProcess
Dim MyWidth As Single
Dim MyHeight As Single
Dim MyBPS As Integer
Dim ImageWidth As Integer
Dim ImageHeight As Integer
Dim TestWidth As Integer
Dim TestHeight As Integer
Dim VFactor As Integer
Dim VSpacing As Integer
Dim HFactor As Integer
Dim HSpacing As Integer
Dim DstT As Single
Dim DstL As Single
Dim SrcL As Single
Dim SrcT As Single
Dim DstW As Single
Dim DstH As Single
Dim MyOP As CombineConstants

MousePointer = 11 ' hourglass

'Create a new ILEADRaster Object
szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc." & vbCrLf & vbCrLf
Set Raster2 = Factory.CreateObject("LEADRaster.LEADRaster", szLic)

' Create the Raster2 bitmap.
MyWidth = LEADRasterView1.Raster.BitmapWidth
MyHeight = LEADRasterView1.Raster.BitmapHeight
MyBPS = LEADRasterView1.Raster.BitmapBits
Raster2.CreateBitmap MyWidth, MyHeight, MyBPS
RasterProc.Fill Raster2, RGB(0, 255, 0) ' fill with green
' Resize the LEADRasterView1 bitmap
ImageWidth = CInt(MyWidth * 0.3)
ImageHeight = CInt(MyHeight * 0.3)
RasterProc.Size LEADRasterView1.Raster, ImageWidth, ImageHeight, RESIZE_RESAMPLE
' Initialize the variables used for multiple combines.
TestWidth = MyWidth ' Used for horizontal positioning
TestHeight = MyHeight ' Used for vertical positioning
VFactor = Int(MyHeight / ImageHeight) + 1 ' Number spaces between images
VSpacing = CInt((MyHeight Mod ImageHeight) / VFactor) ' Pixels between images
HFactor = Int(MyWidth / ImageWidth) + 1 ' Number spaces between images
HSpacing = CInt((MyWidth Mod ImageWidth) / HFactor) ' Pixels between images
DstT = VSpacing ' Top coordinate of the destination rectangle
SrcL = 0 ' Left coordinate of the source rectangle
SrcT = 0 ' Top coordinate of the source rectangle
DstW = ImageWidth ' Width of the destination rectangle
DstH = ImageHeight ' Height of the destination rectangle
MyOP = CB_OP_ADD + CB_DST_0 ' Operation flags used when combining images
' Do the loop that does the multiple combines
While TestHeight > ImageHeight ' Vertical loop
DstT = MyHeight - TestHeight + VSpacing
TestHeight = TestHeight - ImageHeight - VSpacing
While TestWidth > ImageWidth 'Horizontal loop
DstL = MyWidth - TestWidth + HSpacing
TestWidth = TestWidth - ImageWidth - HSpacing
RasterProc.Combine Raster2, DstL, DstT, DstW, DstH, LEADRasterView1.Raster, SrcL, SrcT, MyOP
Wend
TestWidth = MyWidth
Wend
' Copy the Raster2 bitmap to LEADRasterView1
LEADRasterView1.Raster.Bitmap = Raster2.Bitmap
'Set the image display size to match the LEADRasterView control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.ForceRepaint ' Repaint the image
MousePointer = 0 ' default


Create example for Visual Basic

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar

'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1

'This example creates an annotation toolbar and adds a button to the toolbar.
'The button displays different images when selected/deselected
'The button has two tools associated with (line and button tool)
Private Sub CreateToolBar_Click()
Dim Rasterio As New LEADRasterIO
RasterAnnToolbar.AnnParentRasterView = LEADRasterView1
RasterAnnToolbar.Visible = True

RasterAnnToolbar.Create 0, 0, ANN_TOOLALIGN_TOP
If RasterAnnToolbar.ToolBarhWnd Then
RasterAnnToolbar.ButtonTool(RasterAnnToolbar.ButtonCount) = ANN_TOOL_USER_FIRST
RasterIO.Load LEADRasterView2.Raster, "e:\lead14\dist\images\Ulay1.bmp", 0, 0, 1
RasterAnnToolbar.ButtonBitmapUp(RasterAnnToolbar.ButtonCount) = LEADRasterView2.Raster.Bitmap
RasterIO.Load LEADRasterView2.Raster, "e:\lead14\dist\images\Ulay2.bmp", 0, 0, 1
RasterAnnToolbar.ButtonBitmapDown(RasterAnnToolbar.ButtonCount) = LEADRasterView2.Raster.Bitmap
RasterAnnToolbar.ButtonToolTipTextID(RasterAnnToolbar.ButtonCount) = -1
RasterAnnToolbar.ButtonToolTipText(RasterAnnToolbar.ButtonCount) = "User defined tool"
MsgBox "AnnToolTipText: " & RasterAnnToolbar.ButtonToolTipText(RasterAnnToolbar.ButtonCount)

RasterAnnToolbar.ButtonToolCount(RasterAnnToolbar.ButtonCount) = 2

RasterAnnToolbar.ButtonMenuTool(RasterAnnToolbar.ButtonCount, 0) = ANN_TOOL_LINE
RasterAnnToolbar.ButtonMenuTextID(RasterAnnToolbar.ButtonCount, 0) = -1
RasterAnnToolbar.ButtonMenuText(RasterAnnToolbar.ButtonCount, 0) = "User defined tool"

RasterAnnToolbar.ButtonMenuTool(RasterAnnToolbar.ButtonCount, 1) = ANN_TOOL_BUTTON
RasterAnnToolbar.ButtonMenuTextID(RasterAnnToolbar.ButtonCount, 1) = -1
RasterAnnToolbar.ButtonMenuText(RasterAnnToolbar.ButtonCount, 1) = "Button"

RasterAnnToolbar.ButtonCount = RasterAnnToolbar.ButtonCount + 1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN

RasterAnn.AutoSetTool = True

End If
End Sub


CreateMaskFromRgn example for Visual Basic

Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
' This example loads an image, sets a color region using black, }
' and then creates a 1-bit mask image from that bitmap. }
nRet = RasterIO.Load(LEADRasterView1.Raster, "C:\PARROTS.JPG", 0, 0, 1)
If (nRet = 0) Then
LEADRasterView1.Raster.SetRgnColor RGB(0, 0, 0), L_RGN_SET
nRet = LEADRasterView1.Raster.CreateMaskFromRgn
If (nRet = 0) Then
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.MaskBitmap
End If
End If


CreateThumbnailFromFile example for Visual Basic

LEADThumb1.LoadStamp = False
LEADThumb1.ForceSize = True
LEADThumb1.ThumbnailBackgroundColor = vbGreen
LEADThumb1.ThumbnailWidth = 80
LEADThumb1.ThumbnailHeight = 40
LEADThumb1.CreateThumbnailFromFile "c:\temp\testdb6.tif", 1
LEADThumb1.CreateThumbnailFromFile "c:\temp\testdb6.tif", 2
LEADThumb1.CreateThumbnailFromFile "c:\temp\testdb6.tif", 3
Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
If (nStatusCode = 0 And nPercent = 0 And Bitmap <> 0) Then
MsgBox "Done loading " + pszFilename
End If
End Sub


CreateUserBitmap example for Visual Basic

Private Sub Command1_Click()
' allocate memory for a 640x480x24 bpp image
Dim lDataSize As Long
Dim RasterIO As New LEADRasterIO
Dim RasterVar As New LEADRasterVariant
Dim RasterVarEmpty As New LEADRasterVariant

lDataSize = 640# * 480 * 24 / 8

' make sure I am using pixels
LEADRasterView1.ScaleMode = 3

' Create the user bitmap
LEADRasterView1.Raster.CreateUserBitmap 640, 480, 24, RasterVarEmpty, 0

RasterVar.Type = VALUE_ARRAY_BYTE
RasterVar.ItemCount = lDataSize
' fill the bitmap data with gray
For i = 0 To lDataSize - 1
RasterVar.ShortItemValue(i) = 128 ' gray
Next

' set the bitmap data pointer
LEADRasterView1.Raster.SetBitmapDataPointer RasterVar, lDataSize

' save the bitmap
RasterIO.Save LEADRasterView1.Raster, "d:\temp\gray.jpg", FILE_JFIF, 0,
25, SAVE_OVERWRITE

' reset the bitmap data pointer, because the BitmapData array
' will be freed when we exit this function
LEADRasterView1.Raster.SetBitmapDataPointer RasterVarEmpty, 0
End Sub

Private Sub Command2_Click()
Dim RasterIO As New LEADRasterIO
RasterIO.Load LEADRasterView1.Raster, "d:\temp\gray.jpg", 0, 0, 1
End Sub


CreateUserBitmap2 example for Visual Basic

Private Sub Command1_Click()
' allocate memory for a 640x480x24 bpp image
Dim lDataSize As Long
Dim BitmapData(640# * 480 * 24 / 8) As Byte
Dim RasterIO As New LEADRasterIO

lDataSize = 640# * 480 * 24 / 8

' make sure I am using pixels
LEADRasterView1.ScaleMode = 3

' Create the user bitmap
LEADRasterView1.Raster.CreateUserBitmap2 640, 480, 24, Empty, 0

' fill the bitmap data with gray
For i = 0 To lDataSize - 1
BitmapData(i) = 128 ' gray
Next

' set the bitmap data pointer
LEADRasterView1.Raster.SetBitmapDataPointer2 BitmapData, lDataSize

' save the bitmap
RasterIO.Save LEADRasterView1.Raster, "d:\temp\gray.jpg", FILE_JFIF, 0,
25, SAVE_OVERWRITE

' reset the bitmap data pointer, because the BitmapData array
' will be freed when we exit this function
LEADRasterView1.Raster.SetBitmapDataPointer2 Empty, 0
End Sub

Private Sub Command2_Click()
Dim RasterIO As New LEADRasterIO
RasterIO.Load LEADRasterView1.Raster, "d:\temp\gray.jpg", 0, 0, 1
End Sub


CreateZoomView Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim nRet As Integer
Dim ZoomView As New LEADRasterZoomView

‘Unlock support—substitute the unlock support key for L_KEY_DOCUMENT
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT
RasterIO.Load LEADRasterView1.Raster, "c:\image1.cmp", 0, 0, 1

ZoomView.SrcLeft = 0
ZoomView.SrcTop = 0
ZoomView.SrcWidth = 100
ZoomView.SrcHeight = 100

ZoomView.DstTop = 100
ZoomView.DstLeft = 100
ZoomView.DstWidth = 500
ZoomView.DstHeight = 500

ZoomView.BorderColor = RGB(255, 0, 0)
ZoomView.BorderStyle = ZOOM_VIEW_BORDERSTYLE_ROUNDED
ZoomView.PenStyle = PEN_STYLE_DASHDOTDOT

ZoomView.SrcBorderColor = RGB(255, 0, 0)
ZoomView.SrcBorderStyle = SOURCE_BORDERSTYLE_SIMPLE
ZoomView.SrcPenStyle = PEN_STYLE_DOT

ZoomView.EnableCallouts = True
ZoomView.CalloutColor = RGB(0, 0, 255)
ZoomView.CalloutPenStyle = PEN_STYLE_DASH

ZoomView.ZoomFactor = 200
ZoomView.Enabled = True
ZoomView.ForceDst = True
ZoomView.AnnContainer = 0

nRet = LEADRasterView1.CreateZoomView(ZoomView)


Cubism Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Cubism LEADRasterView1.Raster, 5, 15, 200, 4500, _
RGB(255,0,0) , CUB_COLOR | CUB_RECT | CUB_RAND


CurveToBezier example for Visual Basic

Private Declare Function PolyBezier Lib "gdi32" (ByVal hdc As Long, lppt As POINTAPI, ByVal cPoints As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type

Private Sub Bezier_Click()
LEADRasterView1.Raster.CurveClose = CURVE_CLOSE
LEADRasterView1.Raster.CurveSize = 4
LEADRasterView1.Raster.CurveX(1) = 10
LEADRasterView1.Raster.CurveY(1) = 30
LEADRasterView1.Raster.CurveX(2) = 20
LEADRasterView1.Raster.CurveY(2) = 240
LEADRasterView1.Raster.CurveX(3) = 250
LEADRasterView1.Raster.CurveY(3) = 260
LEADRasterView1.Raster.CurveX(0) = 220
LEADRasterView1.Raster.CurveY(0) = 10
LEADRasterView1.Raster.CurveTension = 0.35
LEADRasterView1.Raster.CurveType = CURVE_STANDAR
LEADRasterView1.Raster.SetRgnCurve L_POLY_WINDING, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED

LEADRasterView1.Raster.CurveToBezier

ReDim p(LEADRasterView1.Raster.BezierSize) As POINTAPI

Dim i
For i = 1 To LEADRasterView1.Raster.BezierSize
p(i).x = LEADRasterView1.Raster.BezierX(i - 1)
p(i).y = LEADRasterView1.Raster.BezierY(i - 1)
Next
PolyBezier Form1.hdc, p(1), LEADRasterView1.Raster.BezierSize
End Sub


Cylindrical Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Cylindrical LEADRasterView1.Raster, 100, CYL_HORZ


dbCan... example for Visual Basic

This example displays property values in a message box. You can implement this example by adding a button, with this code, to the project described in ODBC Example for Visual Basic.

Msg = "dbCanAppend = " & CStr(RasterODBC.dbCanAppend) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbCanRestart = " & CStr(RasterODBC.dbCanRestart) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbCanScroll = " & CStr(RasterODBC.dbCanScroll) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbCanUpdate = " & CStr(RasterODBC.dbCanUpdate) & "."
' dbCurrentRecord is 0 based
Msg = Msg & Chr(10) & Chr(13) & "dbCurrentRecord = " & CStr(RasterODBC.dbCurrentRecord) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbEditMode = " & CStr(RasterODBC.dbEditMode) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbIsBOF = " & CStr(RasterODBC.dbIsBOF) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbIsDeleted = " & CStr(RasterODBC.dbIsDeleted) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbIsEOF = " & CStr(RasterODBC.dbIsEOF) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbIsOpen = " & CStr(RasterODBC.dbIsOpen) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbLoadBits = " & CStr(RasterODBC.dbLoadBits) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbLockingMode = " & CStr(RasterODBC.dbLockingMode) & "."
Msg = Msg & Chr(10) & Chr(13) & "dbRecordCount = " & CStr(RasterODBC.dbRecordCount) & "."
Style = vbOKOnly
Title = "LEADTOOLS ActiveX Database Properties"
Response = MsgBox(Msg, Style, Title)


DblClick (ILEADRasterImgList) example for Visual Basic

Private Sub LEADImgList1_DblClick()
MsgBox "Control was Double-Clicked"
End Sub


DblClick example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates the DblClick event.

Private Sub LEADRasterView1_ DblClick()
Dim RasterProc As New LEADRasterProcess
RasterProc.Flip LEADRasterView1.Raster ' Just test the event
LEADRasterView1.ForceRepaint
End Sub


DDB example for Visual Basic

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DDB. It pastes the DDB into LEADRasterView2.Raster and reverses the image. It then gets a DDB from LEADRasterView2, sets the same DDB to LEADRasterView, and repaints.

Dim MyFlags As RasterCopyConstants
Dim RasterProc As New LEADRasterProcess
Dim MyDC As Long
Dim MyDDB As Long
Dim MyPalette As Long
MousePointer = 11 ' hourglass
MyFlags = COPY_EMPTY + COPY_DDB + COPY_PALETTE
LEADRasterView1.Raster.Copy MyFlags
If (LEADRasterView2.Raster.Paste(PASTE_ISREADY) = 0) Then
MsgBox ("Invalid data on the clipboard")
Else
LEADRasterView2.Raster.Paste 0
End If
RasterProc.Reverse LEADRasterView2.Raster
MyDC = LEADRasterView2.GetClientDC
MyDDB = LEADRasterView2.Raster.GetDDB(MyDC)
MyPalette = LEADRasterView2.GetPalette(MyDC)
LEADRasterView1.Raster.SetDDB MyDC, MyDDB, MyPalette
LEADRasterView1.ForceRepaint
LEADRasterView2.ReleaseClientDC
MousePointer = 0 ' default


DecodeABIC Example for Visual Basic

Private Sub DecodeAbic_Click()
Dim RasterIO As New LEADRasterIO
Dim InputData As New LEADRasterVariant
Dim OutputData As New LEADRasterVariant
Dim FileSize As Long
Dim FileName As String
Dim Data() As Byte
Dim i As Long
Dim BmpInfo As BITMAPINFO
Dim BmpFileHeader As BITMAPFILEHEADER
Dim BmpData As Byte

LEADRasterView1.Raster.UnlockSupport L_SUPPORT_ABIC_READ, L_KEY_ABIC_READ

FileName = "c:\Image2Raw.ica"
FileSize = FileLen(FileName)
ReDim Data(FileSize) As Byte

Open FileName For Binary Access Read As #1
Get #1, , Data
Close #1

InputData.vType = VALUE_ARRAY_BYTE
InputData.ItemCount = FileSize
For i = 0 To FileSize – 1
InputData.ShortItemValue(i) = Data(i)
Next i

RasterIO.DecodeABIC InputData, OutputData, 4, 472, 221, False

BmpInfo.bmiHeader.biSize = Len(BmpInfo.bmiHeader)
BmpInfo.bmiHeader.biWidth = 472
BmpInfo.bmiHeader.biHeight = 221
BmpInfo.bmiHeader.biBitCount = 4

BmpFileHeader.bfType = Asc("B") + (Asc("M") * 2 ^ 8)
BmpFileHeader.bfSize = Len(BmpInfo) + Len(BmpFileHeader) + OutputData.ItemCount
BmpFileHeader.bfReserved1 = 0
BmpFileHeader.bfReserved2 = 0
BmpFileHeader.bfOffBits = Len(BmpInfo) + Len(BmpFileHeader)

For i = 0 To 15
BmpInfo.bmiColors(i).rgbBlue = &H11 * i
BmpInfo.bmiColors(i).rgbRed = &H11 * i
BmpInfo.bmiColors(i).rgbGreen = &H11 * i
BmpInfo.bmiColors(i).rgbReserved = 0
Next u

Open "c:\Abic.bmp" For Binary Access Write As #1
Put #1, , BmpFileHeader
Put #1, , BmpInfo
For i = 0 To OutputData.ItemCount – 1
BmpData = OutputData.ShortItemValue(i)
Put #1, , BmpData
Next i
Close #1
End Sub


Deinterlace Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Deinterlace LEADRasterView1.Raster, _
DEINTERLACE_SMOOTH + DEINTERLACE_ODD


DeleteBitmapListItems example for Visual Basic

Note: Also works with Access 95 and 97.

This example deletes the first five bitmaps from the control's bitmap list. Then, it plays the animation to show that the bitmaps are missing.

'Delete the first five bitmaps.
LEADRasterView1.Raster.DeleteBitmapListItems 0, 5
'Play the animation without looping.
LEADRasterView1.AnimationLoop = False
LEADRasterView1.AnimationEnable = True


DeleteMarker example for Visual Basic

Dim Marker1 As LEADMarkers
Dim RasterIO As LEADRasterIO
Private Sub DeleteMarker_Click()
Marker1.Load "c:\ image1.jpg", 0
Marker1.DeleteMarker Marker1.Type, 0
End Sub

Private Sub Save_Marker_Click()
RasterIO.SetMarkers Marker1, 0
RasterIO.Save LEADRasterView1.Raster, "c:\ image2.jpg", FILE_EXIF_JPEG, 24, 2, 0
End Sub


DeleteMarkerAt example for Visual Basic

Dim Marker1 As LEADMarkers
Dim RasterIO As LEADRasterIO
Private Sub DeleteMarker_Click()
Marker1.Load "c:\ image1.jpg", 0
Marker1.DeleteMarkerAt 0
End Sub

Private Sub Save_Marker_Click()
RasterIO.SetMarkers Marker1, 0
RasterIO.Save LEADRasterView1.Raster, "c:\ image2.jpg", FILE_EXIF_JPEG, 24, 2, 0
End Sub


DeletePage example for Visual Basic

Dim RasterIO As New LEADRasterIO
' delete page 1 from TEST.TIF
RasterIO.DeletePage "d:\temp\combined.mpt", 1


DeleteTag Example for Visual Basic

' The following example will delete the PAGENUMBER tag from page 2 of a TIFF file:

Public RasterIO As New LEADRasterIO
Private Sub TestDeleteTag()
Dim nRet As Integer
nRet = RasterIO.ReadTag("test.tif", 2, 297)
If nRet = 0 Then
nRet = RasterIO.DeleteTag("test.tif", 2, 297, 0)
If nRet <> 0 Then
MsgBox "DeleteTag failed!"
Else
MsgBox "DeleteTag SUCCEEDED!"
End If
Else
MsgBox "Page 2 does not have a tag number 297"
End If
End Sub


Desaturate Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Desaturate LEADRasterView1.Raster


Deskew Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Deskew LEADRasterView1.Raster, RGB(0, 0, 0), DSKW_NOFILL Or DSKW_PROCESS Or DSKW_DOCUMENTIMAGE

Dim RasterProc As New LEADRasterProcess
RasterProc.Deskew LEADRasterView1.Raster, RGB(0, 0, 0), DSKW_NOFILL Or DSKW_PROCESS Or DSKW_DOCUMENTIMAGE
MsgBox RasterProc.DeskewAngle


DeskewExt Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.DeskewExt LEADRasterView1.Raster, 1000, _
2, 0, DSKW_PROCESS Or _
DSKW_NOFILL Or _
DSKW_LINEAR Or _
DSKW_DOCUMENTIMAGE
MsgBox RasterProc.DeskewExtAngle


Despeckle example for Visual Basic

Note: Also works with Access 95 and 97.

This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.

Dim RasterProc As New LEADRasterProcess
Dim lAngle As Long
RasterProc.Despeckle LEADRasterView1.Raster
LEADRasterView1.ForceRepaint


DestroyZoomView Example for Visual Basic

Dim nCount As Integer
Dim i As Integer
If (LEADRasterView1.HasZoomView) Then
nCount = LEADRasterView1.ZoomViewsCount
For i = nCount - 1 To 0 Step -1
LEADRasterView1.DestroyZoomView i
Next i
End If


DIB example for Visual Basic

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

Dim RasterProc As New LEADRasterProcess
Dim MyFlags As RasterCopyConstants
Dim MyDib As Long
MousePointer = 11 ' hourglass
MyFlags = COPY_EMPTY + COPY_DIB + COPY_PALETTE
LEADRasterView1.Raster.Copy MyFlags
If (LEADRasterView2.Raster.Paste(PASTE_ISREADY) = 0) Then
MsgBox ("Invalid data on the clipboard")
Else
LEADRasterView2.Raster.Paste 0
End If
RasterProc.Reverse LEADRasterView2.Raster
MyDib = LEADRasterView2.Raster.GetDIB
LEADRasterView1.Raster.SetDIB MyDib
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default


DiceEffect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.DiceEffect LEADRasterView1.Raster, 16, 16, 0, _
RGB(0, 0, 0), _
BITMAP_RESIZE Or _
DICE_SIZE Or _
DICE_BORDER


DiffuseGlow Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.DiffuseGlow LEADRasterView1.Raster, _
500, _
500, _
200, _
50, _
RGB(255, 255, 255)


DigitalSubtract Example for Visual Basic

Dim RasterSrc As New LEADRaster
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
RasterIO.Load RasterSrc, "c:\image1.cmp", 0, 0, 1

RasterProc.DigitalSubtract LEADRasterView1.Raster, RasterSrc, DS_CONTRASTENH


DirectionEdgeStatistical example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.DirectionEdgeStatistical LEADRasterView1.Raster, 15, 128, _
4500, _
RGB(255, 255, 255), _
RGB(0, 0, 0)


Directory example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Directory = "C:\ Test"
RasterProc.ExtractMessage LEADRasterView1.Raster
MsgBox RasterProc.Message


DiscreteFourierTransformation example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim MaxXHarmonic As Integer
Dim MaxYHarmonic As Integer

RasterProc.InitFourierTransformation LEADRasterView1.Raster
MaxXHarmonic = LEADRasterView1.Raster.BitmapWidth / 4
MaxYHarmonic = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.DiscreteFourierTransformation LEADRasterView1.Raster, _
0, _
MaxXHarmonic, _
0, _
MaxYHarmonic, _
DFT_DFT Or _
DFT_GRAY Or _
DFT_RANGE Or _
DFT_INSIDE_X Or _
DFT_OUTSIDE_Y

RasterProc.FreeFourierTransformation


DispatchValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant
Dim Raster As New LEADRaster

RasterVariant.Type = VALUE_DISPATCH
RasterVariant.DispatchValue = Raster


DisplaceMap Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim TmpRaster As New LEADRaster
Dim RasterIO As New LEADRasterIO
RasterIO.Load TmpRaster, "c:\Sample1.jpg", 0, 0, 1
RasterProc.DisplaceMap LEADRasterView1.Raster, _
TmpRaster, _
5, _
5, _
RGB(0, 0, 0), _
FILL_CLR Or _
DSPL_TILE


DisplayFourierTransformation example for Visual Basic

Private Sub DisplayFT_Click()
Dim RasterProc As New LEADRasterProcess
Dim DisplayRaster As New LEADRaster
Dim MaxXHarmonic As Integer
Dim MaxYHarmonic As Integer

DisplayRaster = LEADRasterView1.Raster
RasterProc.InitFourierTransformation LEADRasterView1.Raster
MaxXHarmonic = LEADRasterView1.Raster.BitmapWidth / 4
MaxYHarmonic = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.DiscreteFourierTransformation LEADRasterView1.Raster, _
0, _
MaxXHarmonic, _
0, _
MaxYHarmonic, _
DFT_DFT Or _
DFT_GRAY Or _
DFT_RANGE Or _
DFT_INSIDE_X Or _
DFT_OUTSIDE_Y

RasterProc.DisplayFourierTransformation DisplayRaster, DSP_FT_MAG Or DSP_FT_LOG
LEADRasterView1.Raster = DisplayRaster
RasterProc.FreeFourierTransformation


DJVResolution example for Visual Basic

Private Sub LoadDJV_Click()
'Set new DJV option
Dim RasterIO As New LEADRasterIO
RasterIO.DJVResolution = 120

' Now load the DJV file
RasterIO.Load LEADRasterView1.Raster,
 "c:\Image1.DJVU", 0, 1, 1
End Sub


DlgHelpEvent example for Visual Basic

Private Sub LEADRasterDlg1_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)
Select Case DlgFrom
Case DLG_HELP_CONTOUR
Select Case CtlID
Case LTDLG_IDC_CONTOUR_OPTION, LTDLG_IDC_CONTOUR_OPTIONLABEL
MsgBox "Help on Contour Option"
Case LTDLG_IDC_CONTOUR_THRESHOLD, LTDLG_IDC_CONTOUR_THRESHOLDLABEL
MsgBox "Help on Contour Threshold"
Case LTDLG_IDC_CONTOUR_DELTADIRECTION, LTDLG_IDC_CONTOUR_DELTADIRECTIONLABEL
MsgBox "Help on Contour DeltaDirection"
Case LTDLG_IDC_CONTOUR_MAXIMUMERROR, LTDLG_IDC_CONTOUR_MAXIMUMERRORLABEL
MsgBox "Help on Contour MaximumError"
End Select
Case Else
MsgBox "No Help!"
End Select
End Sub


DocCleanSuccess example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub

'This example updates a region with all 1x1 to 3x3 specks that are solid black
'If a speck has any white pixels, it is NOT part of the updated region
'The call is configured to update a single LEAD region with all changes
'The image itself is unchanged
'The DotRemove Event is used to display information about each speck that is removed

Dim nRet As Integer

RasterProc.EnableDocCleanEvents = True
nRet = RasterProc.DotRemove(LEADRasterView1.Raster, DOT_USE_SIZE Or DOT_SINGLE_REGION Or DOT_LEAD_REGION Or DOT_IMAGE_UNCHANGED, 1, 1, 3, 3)
If (nRet = 0) Then
LEADRasterView1.RgnFrameType = RGNFRAME_COLOR
End If

Private Sub RasterProc_DotRemove(ByVal hRgn As Long, ByVal fBoundingRectLeft As Single, ByVal fBoundingRectTop As Single, ByVal fBoundingRectWidth As Single, ByVal fBoundingRectHeight As Single, ByVal iWhiteCount As Long, ByVal iBlackCount As Long)
Dim nRet As Long
Debug.Print "Dot Found at [Left,Top,Width,Height]" & CStr(fBoundingRectLeft) & "," & CStr(fBoundingRectTop) & "," & CStr(fBoundingRectWidth) & "," & CStr(fBoundingRectHeight) & " WhiteCount=" & CStr(iWhiteCount) & " BlackCount=" & CStr(iBlackCount)
'Do not remove the speck if it contains any white pixels
If (iWhiteCount > 0) Then
nRet = SUCCESS_NOREMOVE
Else
nRet = SUCCESS_REMOVE
End If
RasterProc.DocCleanSuccess = nRet
End Sub


DoubleBuffer Example for Visual Basic

Dim RasterIO As New LEADRasterIO

LEADRasterView1.DoubleBuffer = True
RasterIO.Load LEADRasterView1.Raster, "c:\parrots.jpg", 0, 0, 1


DoubleItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant
Dim d As Double
d = 10

RasterVariant.Type = VALUE_ARRAY_DOUBLE
RasterVariant.ItemCount = 2
RasterVariant.DoubleItemValue(0) = d
RasterVariant.DoubleItemValue(1) = d * 2


DoubleValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant
Dim d As Double
d = 10

RasterVariant.Type = VALUE_DOUBLE
RasterVariant.DoubleValue = d


DrawShape example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD

LEADRasterView1.AutoRepaint = False
'Load an image for the main control
LeadRasIO.Load LEADRasterView1.Raster, "v:\images\babe.cmp", 0, 0, 1
'Load an image for the background of the shape
LeadRasIO.Load LEADRasterView2.Raster, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
'Shape background
RasterFxd.ShapeBackgroundStyle = FXD_BACKSTYLE_TILED_IMAGE
RasterFxd.BackgroundImageTop = 0
RasterFxd.BackgroundImageLeft = 0
RasterFxd.BackgroundImageWidth = LEADRasterView2.Raster.BitmapWidth
RasterFxd.BackgroundImageHeight = LEADRasterView2.Raster.BitmapHeight
'Shape location
RasterFxd.ShapeTop = 50
RasterFxd.ShapeLeft = 50
RasterFxd.ShapeWidth = LEADRasterView1.DstWidth - 50
RasterFxd.ShapeHeight = LEADRasterView1.DstHeight - 50
'Shape border
RasterFxd.ShapeBorderColor = RGB(255, 0, 0)
RasterFxd.ShapeBorderStyle = FXD_BORDERSTYLE_SOLID
RasterFxd.ShapeBorderThickness = 10
RasterFxd.ShapeInnerBandHiliteColor = RGB(255, 255, 255)
RasterFxd.ShapeInnerBandShadowColor = 0
RasterFxd.ShapeInnerBandStyle = FXD_INNERSTYLE_RAISED
RasterFxd.ShapeInnerBandThickness = 2
RasterFxd.ShapeOuterBandHiliteColor = RGB(0, 255, 0)
RasterFxd.ShapeOuterBandShadowColor = RGB(128, 128, 128)
RasterFxd.ShapeOuterBandStyle = FXD_OUTERSTYLE_RAISED
RasterFxd.ShapeOuterBandThickness = 2
'Make the shape a permanent part of the bitmap
RasterFxd.DrawPersistence = True
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.DstBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.ScaleMode = 3
RasterFxd.ClientSizeX = 5
RasterFxd.ClientSizeY = 5
'Draw the shape
RasterFxd.DrawShape LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, LEADRasterView2.Raster
'Repaint
LEADRasterView1.AutoRepaint = True


DrawStar Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY, iStarWidth, iStarHeight As Integer

CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

iStarWidth = LEADRasterView1.Raster.BitmapWidth / 2
iStarHeight = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.DrawStar LEADRasterView1.Raster, CenterX, CenterY, 5, _
iStarWidth, iStarHeight, 50, 0, 0, 0, 0, 0, 0, RGB(0, 0, 255), RGB(255, 0, 0), _
100, STR_INSIDE


DrawText example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates most of the properties of a three-dimensional text object as it draws rotated text on the current bitmap.

Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD
Dim LeadRasProc As New LEADRasterProcess
LEADRasterView1.AutoRepaint = False
LEADRasterView1.ScaleMode = 3
'Load an image for the main control
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_NORMAL
LeadRasIO.Load LEADRasterView1.Raster, "c:\temp\golf.jpg", 0, 0, 1
'Load an image for the foreground of the text
LeadRasIO.Load LEADRasterView2.Raster, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
'Text location
RasterFxd.TextTop = 50
RasterFxd.TextLeft = 50
RasterFxd.TextWidth = LEADRasterView1.DstWidth - 50
RasterFxd.TextHeight = LEADRasterView1.DstHeight - 50
'The foreground image needs to be the correct size.
LeadRasProc.Size LEADRasterView2.Raster, RasterFxd.TextWidth, RasterFxd.TextHeight, 0
'Text alignment and angle
RasterFxd.TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER
RasterFxd.TextAngle = 450 '45 degrees
'Text highlight color and style
RasterFxd.TextHiliteColor = RGB(255, 255, 255)
RasterFxd.TextStyle = FXD_TEXTSTYLE_DROPSHADOW
'Text drop shadow
RasterFxd.ShadowColor = RGB(0, 0, 0)
RasterFxd.ShadowXDepth = 5
RasterFxd.ShadowYDepth = 5
'Make the text a permanent part of the bitmap
RasterFxd.DrawPersistence = True
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.DstBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.ScaleMode = 3
'Draw the text
RasterFxd.DrawText LEADRasterView1.Raster, 0, "LEADTOOLS", LEADRasterView1.Raster.Bitmap
LEADRasterView1.ForceRepaint


Dry Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Dry LEADRasterView1.Raster, 5


Dst... example for Visual Basic

Note: Also works with Access 95 and 97.

' Declare local variables
Dim ClHeight, ClWidth
' Set variables for the client area of the control.
ClHeight = LEADRasterView1.ScaleHeight
ClWidth = LEADRasterView1.ScaleWidth
'Calculate the values to zoom in by 10 percent and center the image.
LEADRasterView1.PaintSizeUseDPI = False
LEADRasterView1.DstWidth = LEADRasterView1.DstWidth * 1.1
LEADRasterView1.DstHeight = LEADRasterView1.DstHeight * 1.1
LEADRasterView1.DstTop = (ClHeight - LEADRasterView1.DstHeight) / 2
LEADRasterView1.DstLeft= (ClWidth - LEADRasterView1.DstWidth) / 2
'Set the clipping area to the same as the destination rectangle
LEADRasterView1.DstClipWidth = LEADRasterView1.DstWidth
LEADRasterView1.DstClipHeight = LEADRasterView1.DstHeight
LEADRasterView1.DstClipTop = LEADRasterView1.DstTop
LEADRasterView1.DstClipLeft = LEADRasterView1.DstLeft
'Redisplay the image
LEADRasterView1.ForceRepaint


DynamicBinary Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.DynamicBinary LEADRasterView1.Raster, 8, 16


EdgeDetectEffect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.EdgeDetectEffect LEADRasterView1.Raster, 50, 0, EDGE_SOLID


EdgeDetector example for Visual Basic

RasterProc.EdgeDetector LEADRasterView1.Raster, 60, EDG_SOBEL_ALL


EdgeDetectorExt example for Visual Basic

RasterProc.EdgeDetectorExt LEADRasterView1.Raster, 60, EDG_SOBEL_ALL


EdgeDetectStatistical Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.EdgeDetectStatistical LEADRasterView1.Raster, 15, 128, RGB(255, 255, 255), _ RGB(0, 0, 0)


EffectSpeed Example for Visual Basic

Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.TransitionDelay = 50
RasterIO.Load LEADRasterView1.Raster, "c:\1.bmp", 0, 0, 1
LEADRasterView1.EffectSpeed = 0
LEADRasterView1.EffectCycles = 0
LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
LEADRasterView1.TransitionStyle = EFX_TRANSITION_GRADIENT
LEADRasterView1.GradientStyle = EFX_GRADIENT_ANGLE_TO_LT
LEADRasterView1.GradientEndColor = RGB(0, 0, 0)
LEADRasterView1.GradientStartColor = RGB(255, 255, 255)
LEADRasterView1.GradientSteps = 255
LEADRasterView1.AutoRepaint = True


Emboss example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies an emboss effect and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Emboss LEADRasterView1.Raster, EMBOSS_NE, 500
LEADRasterView1.ForceRepaint


EnableKeyboard example for Visual Basic

' toggle keyboard processing
LEADImgList1.EnableKeyboard = Not LEADImgList1.EnableKeyboard


EnableLoadInfoEvent Example for Visual Basic

Dim RasterIO As New LEADRasterIO
RasterIO.EnableLoadInfoEvent = False
RasterIO.Load LEADRasterView1.Raster, "c:\1.fax", 0, 0, 1


EnableMethodErrors (ILEADRasterImgList) example for Visual Basic

On Error GoTo ErrorHappened

LEADImgList1.EnableMethodErrors = False
'call with invalid file name
LEADImgList1.LoadDatabase "dd::yY"
MsgBox "no errors genererated so far"
'enable error generation
LEADImgList1.EnableMethodErrors = True
LEADImgList1.LoadDatabase "dd::yY"
Exit Sub
ErrorHappened:
MsgBox "There was error: " & Error()


EnableMethodErrors (ILEADRasterThumbnail) example for Visual Basic

'disable method errors
LEADThumb1. EnableMethodErrors = False


EnableMethodErrors example for Visual Basic

Note: Also works with Access 95 and 97.

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle using ILEADRasterProcess in this case).

' Declare local variables.
Dim ShearAngle, nRet, cMsg, answer
Dim RasterProc As New LEADRasterProcess

ShearAngle = 9000 ' This would be the user's input * 100
RasterProc.EnableMethodErrors = False
nRet = RasterProc.Shear(LEADRasterView1.Raster, ShearAngle, True, RGB(0, 0, 255))
If nRet = ERROR_INV_PARAMETER Then
cMsg = "The angle cannot be more than 45 degrees"
answer = MsgBox(cMsg, 0, "Error")
ElseIf nRet = 0 Then
LEADRasterView1.ForceRepaint
Else
MsgBox "Error: " & CStr(nRet)
End If


EnableOCRDrawing Example for Visual Basic

Private Sub Test
RasterDoc.ActivePageIndex = 0
LEADRasterView1.RasterDocument = RasterDoc
LEADRasterView1.EnableOCRDrawing = True
LEADRasterView1.SelectedZoneIndex = 0
LEADRasterView1.ForceRepaint
End Sub


EnableOLEDragMethod Example for Visual Basic

Public RasterIO As LEADRasterIO

Private Sub StartDrag_Click()
Set RasterIO = New LEADRasterIO
RasterIO.Load LEADRasterView2.Raster, "v:\images\image1.cmp", 0, 1, -1

LEADRasterView1.EnableOLEDragMethod = True
LEADRasterView2.EnableOLEDragMethod = True

LEADRasterView1.OLEDragCursor = Me.MouseIcon
LEADRasterView2.OLEDragCursor = Me.MouseIcon
End Sub

Private Sub StopDrag_Click()
LEADRasterView1.EnableOLEDragMethod = False
LEADRasterView2.EnableOLEDragMethod = False
End Sub

Private Sub LEADRasterView1_OLEGiveFeedback()
LEADRasterView1.EnableUseDefaultCursor = False
End Sub

Private Sub LEADRasterView2_OLEGiveFeedback()
LEADRasterView2.EnableUseDefaultCursor = False
End Sub


EnablePaint example for Visual Basic

Dim RasterProc As New LEADRasterProcess
' disable the paint
LEADRasterView1.EnablePaint = False
' do whatever changes you want. The control will not repaint
RasterProc.Size LEADRasterView1.Raster, LEADRasterView1.Raster.BitmapWidth * 2, _
LEADRasterView1.Raster.BitmapHeight * 2, RESIZE_BICUBIC
' re-enable the paint
LEADRasterView1.EnablePaint = True
' call ForceRepaint because the control will not automatically repaint
LEADRasterView1.ForceRepaint


EnableRestrictToContainer example for Visual Basic

'This examples toggles the "restrict to container" property.
'If an object is restricted to the container, no part of it can be moved outside the container
Private Sub ExampleAnnRestrictToContainer(hObject As Long)
Dim bRestrict As Boolean

bRestrict = RasterAnn.EnableRestrictToContainer(hObject)

bRestrict = Not bRestrict

RasterAnn.EnableRestrictToContainer(hObject) = bRestrict

If bRestrict = True Then
MsgBox "Restricted To Container"
Else
MsgBox "Not Restricted To Container"
End If

End Sub


EnableZoomInRect example for Visual Basic

Note: Also works with Access 95 and 97.

This example toggles the EnableZoomInRect property.

'Toggle the ZoomInRect setting
LEADRasterView1.EnableZoomInRect = Not LEADRasterView1.EnableZoomInRect


EncodeABIC Example for Visual Basic

Private Sub EncodeAbic_Click()
Dim RasterIO As New LEADRasterIO
Dim InputData As New LEADRasterVariant
Dim OutputData As New LEADRasterVariant
Dim BmpData As Byte
Dim i As Integer

RasterIO.Load LEADRasterView1.Raster, "c:\Abic.bmp", 0, 0, 1
Set InputData = RasterIO.SaveArray(LEADRasterView1.Raster, FILE_RAW, 0, 0)

RasterIO.EncodeABIC InputData, 4, 472, 221, OutputData, False

Open "c:\Image2Raw.ica" For Binary Access Write As #1
For i = 0 To OutputData.ItemCount – 1
BmpData = OutputData.ShortItemValue(i)
Put #1, , BmpData
Next i
Close #1
End Sub


EnumFileTags Example for Visual Basic

Public WithEvents RasterIO As LEADRasterIO
Private Sub RasterIO_EnumTags(ByVal uTag As Long, ByVal uType As Long, ByVal uCount As Long)
Dim str As String

str = "Tag = " + uTag + Chr(13) + _
"Type = " + uType + Chr(13) + _
"Count = " + uCount
MsgBox str
RasterIO.StopFireEnumTags = FALSE
End Sub

Private Sub EnumTags()
' Enumerate the tags
RasterIO.EnumFileTags "file.tif", 0, 0
End Sub


EnumGeoKeys Example for Visual Basic

' This is an efficient way of reading all the GeoKeys in a file
Public WithEvents RasterIO As LEADRasterIO
Private Sub TestEnumFileGeoKeys()
Dim nRet As Integer

nRet = RasterIO.EnumFileGeoKeys ("GeoTif.tif", 0, 0)
If nRet = 0 Then
MsgBox "Enumeration SUCCEEDED!"
Else
MsgBox "Error enumerating GeoKeys"
End If
End Sub

Private Sub RasterIO_EnumGeoKeys(ByVal uTag As Long, ByVal uType As Long, ByVal uCount As Long)
Dim str As String

If uType = TAG_ASCII Then
str = "ASCII"
Else
If uType = TAG_SHORT Then
str = "SHORT"
Else
str = "DOUBLE"
End If
End If

str = "Key = " + CStr(uTag) + Chr(13) + "Type = " + str + Chr(13) + "Count = " + CStr(uCount)
MsgBox str, vbOKOnly, "Key Info"

If uType = TAG_SHORT Then
If uCount = 1 Then
str = "Key Value = " + CStr(RasterIO.GeoKeyData.ShortValue)
Else
str = "Key Value = " + CStr(RasterIO.GeoKeyData.ShortItemValue (0))
End If
Else
If uType = TAG_DOUBLE Then
If uCount = 1 Then
str = "Key Value = " + CStr(RasterIO.GeoKeyData.DoubleValue)
Else
str = "Key Value = " + CStr(RasterIO.GeoKeyData.DoubleItemValue (0))
End If
End If
End If
MsgBox str, vbOKOnly, "Key Value"
RasterIO.StopFireEnumGeoKeys = FALSE
End Sub


EnumerateMarkers Event (ILEADMarkers)

EnumerateMarkers example for Visual Basic

Dim WithEvents Marker1 As LEADMarkers
Private Sub LoadMarker_Click()
Marker1.Load "c:\image1.jpg", 0
Marker1.EnumMarkers
End Sub

Private Sub Marker1_EnumerateMarkers (ByVal lType As Long, ByVal
ElementCount As Long)
Print lType, ElementCount
For i = 0 To ElementCount - 1
Marker1.Element (i)
Next i
End Sub


Exif example for Visual Basic

Note: Also works with Access 95 and 97.

This example does the following:

1. | Read all of the comments in an existing Exif file, updating the Comment array.
2. | Loads and modifies the file's image.
3. | Updates some of the comments in the comment array.
4. | Saves the file.
5. | Reads and displays the updated comments.

Note: Comments for GIF, TIFF, and DICOM files are simpler than the ones in this Exif example. With those file types, all of the comments are strings that you can get and set with simple assignments.

Dim MyCommentText As String 'String for CMNT_USERCOMMENT
Dim MyCommentSize As Integer 'Size of the comment array
Dim NewCommentText As String 'String for CMNT_USERCOMMENT that we read
Dim FilePath, DistanceString, ThisDate, ThisTime, MyMsg 'Miscellaneous
Dim i As Integer 'Counter
Dim ArraySize 'Size of an array
Dim MyRasterIO As New LEADRasterIO
Dim MyRasterProcess As New LEADRasterProcess
Dim RasterVarEmpty As New LEADRasterVariant
Dim RasterVar1 As New LEADRasterVariant
Dim RasterVar2 As New LEADRasterVariant
Dim RasterVar3 As New LEADRasterVariant

'Specify the file that we will update.
FilePath = "d:\work\images\exif2.xif"
'Get all of the current comments from an Exif file.
'Temporarily disable method errors so that we do not fail when comments are missing.
MyRasterIO.EnableMethodErrors = False
For i = 0 To CMNT_LAST
MyRasterIO.Comment(i) = RasterVarEmpty
MyRasterIO.Comment(i) = MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 0, i)
Next i
MyRasterIO.EnableMethodErrors = True
'Load and modify the image.
MyRasterIO.Load LEADRasterView1.Raster, FilePath, 0, 0, 1
MyRasterProcess.Reverse LEADRasterView1.Raster

'Update the date when the file is generated.
ThisDate = Format(Date, "yyyy:mm:dd ")
ThisTime = Format(Time, "hh:mm:ss")
RasterVar1.Type = VALUE_STRING
RasterVar1.StringValue = ThisDate + ThisTime
MyRasterIO.Comment(CMNT_SZDATETIMEDIGITIZED) = RasterVar1
MyRasterIO.Comment(CMNT_SZSUBSECTIMEDIGITIZED) = RasterVarEmpty
'Change the subject distance to 4 1/3 meters.
RasterVar2.Type = VALUE_ARRAY_LONG
RasterVar2.ItemCount = 2
RasterVar2.LongItemValue(0) = 13
RasterVar2.LongItemValue(1) = 3
MyRasterIO.Comment(CMNT_SUBJECTDISTANCE) = RasterVar2

'Specify the user comment string.
MyCommentText = "This is my new comment."
MyCommentSize = 8 + Len(MyCommentText)

'Define the array for the user comment.
RasterVar3.Type = VALUE_ARRAY_BYTE
RasterVar3.ItemCount = MyCommentSize

'Fill in the ASCII prefix.
RasterVar3.ShortItemValue(0) = Asc("A")
RasterVar3.ShortItemValue(1) = Asc("S")
RasterVar3.ShortItemValue(2) = Asc("C")
RasterVar3.ShortItemValue(3) = Asc("I")
RasterVar3.ShortItemValue(4) = Asc("I")
RasterVar3.ShortItemValue(5) = &H0
RasterVar3.ShortItemValue(6) = &H0
RasterVar3.ShortItemValue(7) = &H0
'Fill in the rest of the comment, starting at the end.
RasterVar3.ShortItemValue(MyCommentSize) = &H0
For i = MyCommentSize - 1 To 8 Step -1
RasterVar3.ShortItemValue(i) = Asc(Right(MyCommentText, MyCommentSize - i))
Next i

'Update the user comment.
MyRasterIO.Comment(CMNT_USERCOMMENT) = RasterVarEmpty
MyRasterIO.Comment(CMNT_USERCOMMENT) = RasterVar3
'Save the file and read the comments that we saved.
MyRasterIO.Save LEADRasterView1.Raster, FilePath, FILE_EXIF, 24, 0, SAVE_OVERWRITE
RasterVar1 = MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_SZDATETIMEDIGITIZED)
RasterVar2 = MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_SUBJECTDISTANCE)
RasterVar3 = MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_USERCOMMENT)

'Interpret the Subject-Distance RATIONAL.
DistanceString = RasterVar2.LongItemValue(0) / RasterVar2.LongItemValue(1)
'Initialize the string for the message box.
MyMsg = "Subject Distance = " + DistanceString + Chr(13) + "Date/Time = " + RasterVar1.StringValue
'Add the ASCII comment if it is there
If Chr$(RasterVar3.ShortItemValue(0)) = "A" Then
ArraySize = RasterVar3.ItemCount
NewCommentText = ""
For i = 8 To ArraySize
NewCommentText = NewCommentText + Chr$(RasterVar3.ShortItemValue(i))
Next i
MyMsg = MyMsg + Chr(13) + Chr(13) + NewCommentText
End If

'Display the message
MsgBox MyMsg
'Clear the comments from memory
For i = 0 To CMNT_LAST
MyRasterIO.Comment(i) = RasterVarEmpty
Next i


ExportBitmapList Example for Visual Basic

Option Explicit
Private Sub Export_Click()
LEADImgList1.LoadFromFile "c:\image1.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image2.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image3.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image4.jpg", 0, 0, -1
'Export All Items From Images List Control
LEADImgList1.ExportBitmapList 0, LEADImgList1.Count
End Sub

Private Sub Import_Click()
LEADImgList2.ImportBitmapList LEADImgList1.ExportedBitmapList, 0, 2, "Image1", "Imported From List1"
End Sub


ExtractMessage Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.ExtractMessage LEADRasterView1.Raster
MsgBox RasterProc.Message


FastFourierTransformation example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.Size LEADRasterView1.Raster, 256, 512, RESIZE_BICUBIC
RasterProc.InitFourierTransformation LEADRasterView1.Raster
' Apply FFT
RasterProc.FastFourierTransformation LEADRasterView1.Raster, FFT_FFT Or FFT_GRAY

' Free FFT buffer
RasterProc.FreeFourierTransformation
End Sub


FastLoad Example for Visual Basic

Dim io As New LEADRasterIO
io.FastLoad = True
io.Load LEADRasterView1.Raster, "d:\temp\test2.abc", 0, 1, 1


FastRotate example for Visual Basic

Note: This topic is for Document/Medical only.

This example uses fast rotation to rotate an image 90 degrees:

Dim RasterProc As New LEADRasterProcess
RasterProc.FastRotate LEADRasterView1.Raster, 90


FeatherAlphaBlend example for Visual Basic

Raster2.CreateBitmap 800, 600, 24
Raster2.SetRgnRoundRect 50, 50, 500, 500, 150, 150, L_RGN_SET
RasterProc.CreateFadedMask LEADRasterView2.Raster, Raster2, 60, 20, 3, 0, FADE_DUMPFILL + FADE_NOTRANSPARENCY, 255, RGB(0, 0, 255)
RasterIO.Load Raster2, "c:\temp\test.cmp", 0, 1, 1
RasterProc.FeatherAlphaBlend LEADRasterView1.Raster, 0, 0, LEADRasterView2.Raster.BitmapWidth, LEADRasterView2.Raster.BitmapHeight, Raster2, 0, 0, LEADRasterView2.Raster


FeedLoad example for Visual Basic

Note: Works with Access 97, but not with Access 95.

This example uses StartFeedLoad, FeedLoad, and StopFeedLoad and loads a file through a buffer to simulate receiving a transmitted image.

Private Sub FeedLoad_Click()
Dim RasterIO As New LEADRasterIO
' Declare a buffer that you will use to feed the file-load process.
Const BUFFERSIZE = 1000
Dim RasterVar As New LEADRasterVariant
RasterVar.Type = VALUE_STRING

' Declare other local variables.
Dim BytesRead As Long
Dim FileLength As Long
' Open an image file and get its length.
Open "d:\temp\24bit.bmp" For Binary Access Read As #1
FileLength = LOF(1)
' Set PaintWhileLoad so that we can watch the progress.
LEADRasterView1.PaintWhileLoad = True
' Initialize the file-load process.
' Specify the default bits per pixel and first page
If RasterIO.StartFeedLoad(LEADRasterView1.Raster, 0, 0, 1) <> 0 Then
MsgBox ("Error in StartFeedLoad !")
GoTo quit_function
End If
' Use FeedLoad in a loop to load the file into the bitmap.
Do
RasterVar.StringValue = Input(BUFFERSIZE, #1)

If FileLength > BUFFERSIZE Then
BytesRead = BUFFERSIZE
Else
BytesRead = FileLength
End If
FileLength = FileLength - BytesRead
If RasterIO.FeedLoad(RasterVar, BytesRead) <> 0 Then
MsgBox ("Error in FeedLoad !")
GoTo quit_function
End If
Loop Until FileLength <= 0
' Finish the file-load process.
If RasterIO.StopFeedLoad() <> 0 Then
MsgBox ("Error in StopFeedLoad !")
GoTo quit_function
End If
quit_function:
' Close the file.
Close #1
End Sub


FileName example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Message = ""
RasterProc.FileName = "C:\1.TXT"
RasterProc.AddMessage LEADRasterView1.Raster


FilePage Event Example for Visual Basic

This example shows how the FilePage event can be used to size and position a RasterView Control when an image is loaded.

'Declare the RasterIO object WithEvents
Public WithEvents RasterIO As LEADRasterIO

'Use Load to load an image
RasterIO.Load LEADRasterView1.Raster, "d:\temp\24bit.bmp", 0, 1, 1

Private Sub RasterIO_FilePage()
Dim HeightFactor, WidthFactor ' Factors for aspect ratio
Dim HeightAllowed, WidthAllowed ' Maximum width and height
Dim Width, Height, Left, Top ' Variables for control dimensions
' Set the variables used for preserving the aspect ratio.
'Allow for a border of 1/8 of the form size.
'The units of measure do not matter, since we are calculating proportions.
HeightFactor = RasterIO.InfoHeight
WidthFactor = RasterIO.InfoWidth
HeightAllowed = ScaleHeight * 3 / 4
WidthAllowed = ScaleWidth * 3 / 4
'Center the LEAD RasterView control on the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
LEADRasterView1.Left = ScaleWidth / 8
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor
LEADRasterView1.Top = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.Top = ScaleHeight / 8
LEADRasterView1.Height = HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor
LEADRasterView1.Left = (ScaleWidth - LEADRasterView1.Width) / 2
End If
' Set the image display size to match the LEAD RasterView control.
LEADRasterView1.AutoScroll = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.AutoRepaint = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
End Sub


Fill example for Visual Basic

Note: Also works with Access 95 and 97.

This example fills the bitmap with blue and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Fill LEADRasterView1.Raster, RGB(0, 0, 255)
LEADRasterView1.ForceRepaint


Flip example for Visual Basic

Note: Also works with Access 95 and 97.

This example flips the bitmap and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Flip LEADRasterView1.Raster
LEADRasterView1.ForceRepaint


FloaterDstClip... example for Visual Basic

Note: Also works with Access 95 and 97.

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

'Declare local variables.
Dim AdjustX, AdjustY, NewLeft, NewTop, NewWidth, NewHeight
'Set variables to use for adjustment increments.
AdjustX = LEADRasterView1.ScaleWidth / 20
AdjustY = LEADRasterView1.ScaleHeight / 20
'Determine new values, based on adjustments of current values.
NewLeft = LEADRasterView1.FloaterDstClipLeft + AdjustX
NewTop = LEADRasterView1.FloaterDstClipTop + AdjustY
NewWidth = LEADRasterView1.FloaterDstClipWidth - (2 * NewLeft)
NewHeight = LEADRasterView1.FloaterDstClipHeight - (2 * NewTop)
'Set the clipping rectangle to the new values.
LEADRasterView1.SetFloaterDstClipRect NewLeft, NewTop, NewWidth, NewHeight


FloatItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_ARRAY_FLOAT
RasterVariant.ItemCount = 2
RasterVariant.FloatItemValue(0) = 5.1
RasterVariant.FloatItemValue(1) = 10.1


FloatValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_FLOAT
RasterVariant.FloatValue = 5.1


Font (ILEADRasterImgList) example for Visual Basic

LEADImgList1.Font.Name = "Arial"
'change the font properties
If LEADImgList1.Font.Bold = True Then
LEADImgList1.Font.Bold = False
Else
LEADImgList1.Font.Bold = True
End If
LEADImgList1.Font.Size = (LEADImgList1.Font.Size + 2) Mod 7 + 6


Font example for Visual Basic

Note: Also works with Access 95 and 97.

This example, in a MouseUp event, determines the size of a rectangle for a string in the specified font. It then draws the rectangle and draws the text on top of the rectangle.

Dim TestText As String
Dim TextWidth As Single
Dim TextHeight As Single
Dim RasterFxd As New LEADRasterFXD
Dim hDC As Long

hDC = LEADRasterView1.GetClientDC()
'Specify the text, font, and styles
TestText = "This is my text."
RasterFxd.Font.Name = "Times New Roman"
RasterFxd.Font.Size = 16
RasterFxd.DrawFontColor = RGB(0, 0, 255) 'Blue
RasterFxd.TextStyle = FXD_TEXTSTYLE_NORMAL
RasterFxd.TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER
'Get the width and height of the text to be drawn.
TextWidth = RasterFxd.DrawTextWidth(hDC, TestText)
TextHeight = RasterFxd.DrawTextHeight(hDC, TestText)
'set the location for the text
RasterFxd.TextTop = y
RasterFxd.TextLeft = x
RasterFxd.TextWidth = TextWidth
RasterFxd.TextHeight = TextHeight
'Set the properties for drawing a rectangle behind the text.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawMode = DRAWMODE_COPY_PEN
RasterFxd.DrawFillColor = RGB(0, 255, 0) 'Green
'Draw on the screen, not on the bitmap.
RasterFxd.DrawPersistence = False
'Draw the rectangle, then draw the text.
RasterFxd.DrawRectangle Nothing, hDC, x, y, TextWidth, TextHeight
RasterFxd.DrawText Nothing, hDC, TestText, 0
LEADRasterView1.ReleaseClientDC


ForeColor example for Visual Basic

'set text color to blue
LEADImgList1.ForeColor = RGB(0, 0, 255)


Fragment Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Fragment LEADRasterView1.Raster, 15, 100


Frame... example for Visual Basic

Note: Also works with Access 95 and 97.

This example sets the control's frame properties. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

LEADRasterView1.AutoRepaint = False
LEADRasterView1.FrameThickness = 2
LEADRasterView1.FrameColor = RGB(0, 0, 0)
LEADRasterView1.FrameInnerStyle = EFX_INNERSTYLE_INSET
LEADRasterView1.FrameOuterStyle = EFX_OUTERSTYLE_RAISED
LEADRasterView1.FrameInnerHiliteColor = RGB(255, 255, 0) 'Yellow
LEADRasterView1.FrameInnerShadowColor = RGB(128, 128, 128) 'Dark Gray
LEADRasterView1.FrameOuterHiliteColor = RGB(255, 0, 0) 'Red
LEADRasterView1.FrameOuterShadowColor = RGB(192, 192, 192) 'Light Gray
LEADRasterView1.FrameInnerThickness = 3
LEADRasterView1.FrameOuterThickness = 3
LEADRasterView1.AutoRepaint = True


FreeHandShear Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim nMax As Integer
Dim i As Integer

RasterProc.AmplitudesCount = 4

RasterProc.UserLUTCurveX(0) = 0
RasterProc.UserLUTCurveY (0) = 0

RasterProc.UserLUTCurveX(1) = 3
RasterProc.UserLUTCurveY(1) = 10

RasterProc.UserLUTCurveX(2) = 9
RasterProc.UserLUTCurveY(2) = -10

RasterProc.UserLUTCurveX(3) = 12
RasterProc.UserLUTCurveY(3) = 0

RasterProc.GetCurvePoints GUB_LINEAR

For i = 0 To RasterProc.AmplitudesCount - 1
If nMax < RasterProc.Amplitudes(i) Then
nMax = RasterProc.Amplitudes(i)
End If
Next i

If nMax > 0 Then
For i = 0 To RasterProc.AmplitudesCount - 1
RasterProc.Amplitudes(i) = (1000 * CLng(RasterProc.Amplitudes(i)) / Abs(nMax))
Next i
End If

RasterProc.FreeHandShear LEADRasterView1.Raster, 100, RGB(0, 0, 0), FILL_RPT _
Or HR_HORZ


FreeHandWave Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.AmplitudesCount = 4

RasterProc.UserLUTCurveX(0) = 0
RasterProc.UserLUTCurveY(0) = 0

RasterProc.UserLUTCurveX(1) = 3
RasterProc.UserLUTCurveY(1) = 10

RasterProc.UserLUTCurveX(2) = 9
RasterProc.UserLUTCurveY(2) = -10

RasterProc.UserLUTCurveX(3) = 12
RasterProc.UserLUTCurveY(3) = 0

RasterProc.GetCurvePoints GUB_LINEAR

RasterProc.FreeHandWave LEADRasterView1.Raster, 100, 10, 0, RGB(0, 0, 0), _
FILL_RPT Or DIS_FRQ


FreePlaneBend Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.UserLUTCurveSize = 4

RasterProc.UserLUTCurveX(0) = 0
RasterProc.UserLUTCurveY(0) = 0

RasterProc.UserLUTCurveX(1) = 3
RasterProc.UserLUTCurveY(1) = 10

RasterProc.UserLUTCurveX(2) = 9
RasterProc.UserLUTCurveY(2) = -10

RasterProc.UserLUTCurveX(3) = 12
RasterProc.UserLUTCurveY(3) = 0

RasterProc.GetCurvePoints GUB_LINEAR
RasterProc.FreePlaneBend LEADRasterView1.Raster, 200, RGB(255, 0, 0), FILL_CLR + _ FPB_VERT


FreeRadBend Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.UserLUTCurveSize = 3

RasterProc.UserLUTCurveX(0) = 0
RasterProc.UserLUTCurveY(0) = 0

RasterProc.UserLUTCurveX(1) = 3
RasterProc.UserLUTCurveY(1) = 10

RasterProc.UserLUTCurveX(2) = 9
RasterProc.UserLUTCurveY(2) = -10

RasterProc.UserLUTCurveX(2) = 12
RasterProc.UserLUTCurveY(2) = 0

RasterProc.GetCurvePoints GUB_LINEAR

RasterProc.FreeRadBend LEADRasterView1.Raster, 200, CenterX, CenterY, _
RGB(255, 0, 0), FILL_CLR + FILL_ROT


FrequencyFilter example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim DisplayRaster As New LEADRaster
Dim MaxXHarmonic As Integer
Dim MaxYHarmonic As Integer

DisplayRaster = LEADRasterView1.Raster
RasterProc.InitFourierTransformation LEADRasterView1.Raster
MaxXHarmonic = LEADRasterView1.Raster.BitmapWidth / 4
MaxYHarmonic = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.DiscreteFourierTransformation LEADRasterView1.Raster, _
0, _
MaxXHarmonic, _
0, _
MaxYHarmonic, _
DFT_DFT Or _
DFT_GRAY Or _
DFT_RANGE Or _
DFT_INSIDE_X Or _
DFT_OUTSIDE_Y

RasterProc.FrequencyFilter 0, MaxXHarmonic, 0, MaxYHarmonic, FRQ_INSIDE_X Or FRQ_INSIDE_Y

RasterProc.DisplayFourierTransformation DisplayRaster, DSP_FT_MAG Or DSP_FT_LOG
LEADRasterView1.Raster = DisplayRaster
RasterProc.FreeFourierTransformation


FrequencyFilterMask example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim NoisyRaster As New LEADRaster
Dim MaskRaster As New LEADRaster
Dim RasterIO As New LEADRasterIO
Dim MaxXHarmonic As Integer
Dim MaxYHarmonic As Integer

MaxXHarmonic = LEADRasterView1.Raster.BitmapWidth / 4
MaxYHarmonic = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.InitFourierTransformation LEADRasterView1.Raster
RasterIO.Load NoisyRaster, "c:\NoisyXRay.CMP", 0, 0, 1
' Load the mask bitmap, keeping the bits per pixel of the file
RasterIO.Load MaskRaster, "c:\NoisyMask.CMP", 0, 0, 1

RasterProc.DiscreteFourierTransformation NoisyRaster, _
0, _
0, _
0, _
0, _
DFT_DFT Or _
DFT_GRAY

' filter frequencies
RasterProc.FrequencyFilterMask MaskRaster, True

' apply inverse DFT
' After this call, the image should be clean
RasterProc.DiscreteFourierTransformation NoisyRaster, _
0, _
0, _
0, _
0, _
DFT_IDFT Or _
DFT_ALL Or _
DFT_IDFT_SCL
RasterProc.FreeFourierTransformation


FunctionalLight Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.LightRedAmplitude = 75
RasterProc.LightGreenAmplitude = 90
RasterProc.LightBlueAmplitude = 0
RasterProc.LightAngle = 9000
RasterProc.LightFrequency = 10
RasterProc.LightPhase = 5000
RasterProc.LightFlags = FL_LINEAR_QUADRATIC Or FL_LINEAR_OUTER
RasterProc.LightXOrigin = LEADRasterView1.Raster.BitmapWidth / 2
RasterProc.LightYOrigin = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.FunctionalLight LEADRasterView1.Raster


GammaCorrect example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a 2.2 gamma correction and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.GammaCorrect LEADRasterView1.Raster, 220
LEADRasterView1.ForceRepaint


GammaCorrectExt Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GammaCorrectExt LEADRasterView1.Raster, 250, GMCR_YUV_SPACE


GaussianFilter example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GaussianFilter LEADRasterView1.Raster, 20


GetBitmapClipSegments example for Visual Basic

Dim i As Integer, j As Integer
Dim y As Single
Dim RasterVar As New LEADRasterVariant

LEADRasterView1.Raster.ScaleMode = SCALEMODE_PIXEL ' use pixels
LEADRasterView1.AutoRepaint = False ' disable repainting

y = (LEADRasterView1.Raster.RgnTop + LEADRasterView1.Raster.RgnHeight) / 2

' get the clip segments
RasterVar = LEADRasterView1.Raster.GetBitmapClipSegments(y)

' loop through all the segments
For i = 0 To RasterVar.ItemCount - 1 Step 2
' for every segment, set all the pixels to black
For j = RasterVar.FloatItemValue(i) To RasterVar.FloatItemValue(i + 1) - 1
LEADRasterView1.Raster.Pixel(j, y) = RGB(0, 0, 0)
Next j
Next i

LEADRasterView1.AutoRepaint = True ' re-enable repainting


GetBitmapDC example for Visual Basic

Note: Also works with Access 95 and 97.

Take the following steps to demonstrate how GDI functions can be used to print text on the bitmap and on the control. The text printed on the bitmap is a permanent part of the bitmap and becomes permanent if the bitmap is saved; whereas the text on the control is superficial and does not affect the bitmap.

Note: For an easier way of drawing text, refer to the DrawText example.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Open the API Viewer by double-clicking the API Text Viewer icon in the Visual Basic program group on your desktop.
3. | From the File menu, choose Load Text File.
4. | Open WIN32API.TXT (32-bit Windows declares, types, and constants), which is located in the \WINAPI subdirectory of the main Visual Basic directory.
5. | In the API Type drop-down list box, select Declares; then select and add the following items:
 | SetBkMode
 | TextOut
 | GetStockObject
 | SelectObject
6. | In the API Type drop-down list box, select Constants; then select and add the following items:
 | SYSTEM_FONT
 | TRANSPARENT
7. | Copy the selected items, and paste them into the declarations procedure of the general object in your form. In this example, you must edit the declarations and constants to make them private. On a 32-bit system, they should appear as follows:

Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Const SYSTEM_FONT = 13
Private Const TRANSPARENT = 1

8. | Select the CommandButton control; then add the control to your main form. Put the control at the top of the form to keep it away from the image.
9. | In the Properties box, change the CommandButton control's Caption property to GDI for Text.
10. | Add the following code to the CommandButton control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.
 | Notice that the code prints in two different places: the bitmap and the control. You can see the difference when you run the program.

Sub Command1_Click ()
Dim LeadDC As Long
Dim LeadClientDC As Long
Dim hfnt As Long
Dim hOldFont As Long
Dim MyReturn As Long
Dim mystring$
'Ensure that the Lead control is visible
LEADRasterView1.Visible = True
'First, print text on the bitmap.
'Create a device context for the bitmap that the GDI functions can access
LeadDC = LEADRasterView1.Raster.GetBitmapDC
'Get the system font and select it. The old font is saved.
'Using other fonts is more complex. Refer to the Windows API documentation.
hfnt = GetStockObject(SYSTEM_FONT)
hOldFont = SelectObject(LeadDC, hfnt)
'Make the background transparent, so that the text will overlay the image
MyReturn = SetBkMode(LeadDC, TRANSPARENT)
'Assign the string value
mystring$ = "Text on the bitmap"
'Print the text on the bitmap. This is a permanent change in the bitmap
MyReturn = TextOut(LeadDC, 20, 40, mystring$, Len(mystring$))
'Restore the previous font
MyReturn = SelectObject(LeadDC, hOldFont)
'Remove the lock from the device control
LEADRasterView1.Raster.ReleaseBitmapDC
'Repaint the part of the image that has changed
LEADRasterView1.BackErase = False
LEADRasterView1.ForceRepaint
'Allow full repainting again
LEADRasterView1.BackErase = True
'Next, print text on the control.
'Create a device context for the control that the GDI functions can access
LeadClientDC = LEADRasterView1.GetClientDC
'Get the system font and select it. The old font is saved.
'Using other fonts is more complex. Refer to the Windows API documentation.
hfnt = GetStockObject(SYSTEM_FONT)
hOldFont = SelectObject(LeadDC, hfnt)
'Make the background transparent, so that the text will overlay the image
MyReturn = SetBkMode(LeadClientDC, TRANSPARENT)
'Assign the string value
mystring$ = "Text on the LEAD control"
'Print the text on the control.
'This is an overlay that does not affect the bitmap.
MyReturn = TextOut(LeadClientDC, 20, 80, mystring$, Len(mystring$))
'Restore the previous font
MyReturn = SelectObject(LeadClientDC, hOldFont)
'Remove the lock from the device control
LEADRasterView1.ReleaseClientDC
End Sub

11.

Run your program to test it. Notice that the text printed on the bitmap is scaled as part of the bitmap. If you zoom in, it becomes larger, and if you zoom out, it becomes smaller. The text printed on the control is the normal size for the system font and is not affected by zooming.


GetBitmapStatisticsInfo example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GetBitmapStatisticsInfo LEADRasterView1.Raster, CHANNEL_MASTER, 0, 255
MsgBox "Bitmap Median :" + Str(RasterProc.BitmapMedian) + Chr$(13) + _
"Bitmap Mean :" + Str(RasterProc.BitmapMean) + Chr$(13) + _
"Bitmap Min Value:" + Str(RasterProc.BitmapMinValue) + Chr$(13) + _
"Bitmap Max Value:" + Str(RasterProc.BitmapMaxValue) + Chr$(13) + _
"Bitmap Pixels Count:" + Str(RasterProc.BitmapPixelsCount) + Chr$(13) + _
"Bitmap Selected Pixel Percent :" + Str(RasterProc.BitmapSelectedPixelPercent) + Chr$(13) + _
"Bitmap Standard Deviation:" + Str(RasterProc.BitmapStandardDeviation) + Chr$(13) + _
"Bitmap Total Pixel Count:" + Str(RasterProc.BitmapTotalPixelCount) + Chr$(13)


GetColorCount Example for Visual Basic

This example displays a message box showing the number of unique colors in the control's current bitmap.

' Declare local variables.
Dim RasterProc As New LEADRasterProcess
Dim szMessage As String ' Buffer for the MessageBox string
Dim NumberOfColors As Long ' Number of colors in the bitmap
' Get the number of colors in the bitmap.
NumberOfColors = RasterProc.GetColorCount(LEADRasterView1.Raster)
' Display the result in a message.
szMessage = "The bitmap has " + CStr(NumberOfColors) + " colors"
MsgBox szMessage, 0, "Notice"


GetDIB2 example for Visual Basic

'This example gets the image from LEADRasterView1 as a V5 DIB
'and then loads the DIB into LEADRasterView2
Dim MyDIB As Long

'LEADRasterView1 has an image at this point
MyDIB = LEADRasterView1.Raster.GetDIB2 (DIB_BITMAPV5HEADER)
LEADrasterView2.Raster.SetDIB (MyDIB)

'Free the DIB using the Windows API
GlobalFree MyDIB


GetFeretsDiameter example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim Top, Bottom, Left, Right As Integer
Dim i As Integer

Top = LEADRasterView1.Raster.BitmapHeight / 4
Bottom = LEADRasterView1.Raster.BitmapHeight * 6 / 4
Left = LEADRasterView1.Raster.BitmapWidth / 4
Right = LEADRasterView1.Raster.BitmapWidth * 3 / 4
LEADRasterView1.Raster.SetRgnEllipse Left, Top, Right, Bottom, L_RGN_SET

RasterProc.GetRgnContourPoints LEADRasterView1.Raster
For i = 0 To RasterProc.ContoursCount
MsgBox "(" + Str(RasterProc.ContourX(i)) + "," + Str(RasterProc.ContourY(i)) + ")"
Next i

RasterProc.GetFeretsDiameter
MsgBox "Ferets Diameter Length :" + Str(RasterProc.FeretsDiameterLength) + Chr$(13) + _
"Ferets First Index:" + Str(RasterProc.FeretsFirstIndex) + Chr$(13) + _
"Ferets Second Index:" + Str(RasterProc.FeretsSecondIndex) + Chr$(13)


GetFileInfo example for Visual Basic

Note: Also works with Access 95 and 97.

This example gets information about the specified file.

' Declare local variables
Dim fname, pg, fmt, LeadWidth, LeadHeight, bps, xres, yres, sizd, sizm, cmp, cFmt, cMsg, answer
Dim RasterIO As New LEADRasterIO
' Initialize variables
fname = "d:\temp\24bit.bmp"
pg = 0
' Update the variables
RasterIO.GetFileInfo LEADRasterView1.Raster, fname, pg, FILEINFO_TOTALPAGES
' Read the updated properties
fmt = RasterIO.InfoFormat
LeadWidth = RasterIO.InfoWidth
LeadHeight = RasterIO.InfoHeight
bps = RasterIO.InfoBits
pg = RasterIO.InfoPage
sizd = RasterIO.InfoSizeDisk
sizm = RasterIO.InfoSizeMem
cmp = RasterIO.InfoCompress
' Translate the meaning of the format constant
Select Case fmt
Case FILE_PCX
cFmt = "ZSoft PCX"
Case FILE_GIF
cFmt = "CompuServe GIF"
Case FILE_TGA
cFmt = "TARGA"
Case FILE_PNG
cFmt = "Portable Network Graphics"
Case FILE_PSD
cFmt = "Adobe Photoshop 3.0"
Case FILE_BMP
cFmt = "Windows BMP"
Case FILE_OS2
cFmt = "OS/2 BMP version 1.x"
Case FILE_OS2_2
cFmt = "OS/2 BMP version 2.x"
Case FILE_WMF
cFmt = "Windows Meta File"
Case FILE_EPS
cFmt = "Encapsulated PostScript"
Case FILE_MAC
cFmt = "MacPaint"
Case FILE_PCT
cFmt = "Macintosh Pict"
Case FILE_MSP
cFmt = "Microsoft Paint"
Case FILE_IMG
cFmt = "GEM Image"
Case FILE_PCD
cFmt = "Kodak PhotoCD"
Case FILE_EPSTIFF
cFmt = "Encapsulated PostScript with an embedded TIFF file"
Case Else
cFmt = "Unknown format"
End Select
' Create the message string
cMsg = fname + Chr(13) + "Page = " + Str(pg) + " of " + CStr(RasterIO.InfoTotalPages) + Chr(13) + "Format = " + cFmt + Chr(13)
cMsg = cMsg + "Width = " + Str(LeadWidth) + Chr(13) + "Height = " + Str(LeadHeight) + Chr(13)
cMsg = cMsg + "Size in memory = " + Str(sizm) + Chr(13) + "Size on disk = " + Str(sizd) + Chr(13)
cMsg = cMsg + "Bits per pixel = " + Str(bps) + Chr(13)
cMsg = cMsg + "X resolution = " + Str(xres) + Chr(13) + "Y resolution = " + Str(yres)
' Display the message box
MsgBox cMsg, 0, "File Info"


GetFloaterHandle example for Visual Basic

The following is an alternative way of coding the PasteFloaterBtn button's click procedure in Outlining, Dragging, and Pasting a Region. This alternative uses the GetFloaterHandle and SetRgnHandle methods to specify the mask for the paste. It also shows how to use the HasRgn, FloaterWidth, and FloaterHeight properties.

Private Sub PasteFloaterBtn_Click()
'Declare the variable for the Combine operation.
Dim MyOp As Long
'Declare the variable for the saved region.
Dim SavedRgn As Long
'Declare the variables for the client area coordinates.
Dim LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight
'Declare the variables for the bitmap coordinates.
Dim LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight
'Declare the RasterProcess object
Dim RasterProc As New LEADRasterProcess

'Exit this routine if there is no region.
If LEADRasterView1.Raster.HasRgn = False Then Exit Sub
'Save the region that is in the floater.
SavedRgn = LEADRasterView1.GetFloaterHandle
'Get the floater into another bitmap
LEADRasterView2.ScaleMode = LEADRasterView1.ScaleMode
LEADRasterView2.Raster.RefBitmap = False
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Floater
'Get the floater's client coordinates into local variables.
LCRgnX = LEADRasterView1.FloaterDstLeft
LCRgnY = LEADRasterView1.FloaterDstTop
LCRgnWidth = LEADRasterView1.FloaterDstWidth
LCRgnHeight = LEADRasterView1.FloaterDstHeight
'Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft
LBRgnY = ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop
LBRgnWidth = LEADRasterView1.FloaterWidth
LBRgnHeight = LEADRasterView1.FloaterHeight
'Delete the floater.
LEADRasterView1.FloaterVisible = False
LEADRasterView1.Floater = 0
'Set the saved region to use as a mask for the Combine method.
LEADRasterView1.Raster.SetRgnHandle SavedRgn, LBRgnX, LBRgnY, L_RGN_SET
'Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0 'Operation flags for a simple paste.
RasterProc.Combine LEADRasterView1.Raster, _
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, _
LEADRasterView2.Raster, _
0, 0, MyOp
'Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False
'Free the region.
LEADRasterView1.Raster.FreeRgn
'Delete the region handle.
LEADRasterView1.Raster.DeleteRgnHandle SavedRgn
End Sub


GetFunctionalLookupTable example for Visual Basic

RasterProc.GetFunctionalLookupTable 0, 255, 5, GL_EXPRasterProc.RemapIntensity LEADRasterView1.Raster, CHANNEL_MASTER


GetGeoKey Example for Visual Basic

Public RasterIO As LEADRasterIO
Private Sub TestGeoKey()
' This example gets the value set for the GTModelTypeGeoKey key.
' Note that the example can be simpler by not allocating memory because this particular GeoKey has only one SHORT item. But I want to demonstrate how you call L_GetGeoKey twice and get the required size in the first call

Dim nRet As Integer
nRet = RasterIO.GetGeoKey (1024)
If nRet <> 0 Then
MsgBox "The GeoKey was not set, or an error occurred!"
Else
Dim str As String
str = "GeoKey Type = " + CStr(RasterIO.GeoKeyType) + Chr(13) + _
"GeoKey Count = " + CStr(RasterIO.GeoKeyCount)

MsgBox str
End If
End Sub


GetHistogram example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim nIndex As Integer
Dim nBrightest As Integer
Dim nDarkest As Integer

RasterProc.HistogramTableSize = 256
RasterProc.GetHistogram LEADRasterView1.Raster, CHANNEL_RED Or _
HIST_LOWHIGH_BITS
nDarkest = 0
nBrightest = 0

For nIndex = 0 To 255
If (RasterProc.HistogramTable(nIndex) <> 0) Then
nBrightest = nIndex
If (nDarkest = 0) Then
nDarkest = nIndex
End If
End If
Next nIndex

MsgBox "Darkest red =" + Str(nDarkest) + " Brightest red =" + Str(nBrightest)


GetHistogramGray example for Visual Basic

'This example gets a histogram for a 12-bit or 16-bit grayscale image and then
'displays the number of occurrences of the brightest and darkest intensities
Private Sub Command86_Click()
Dim nRet As Integer
Dim RasterProc As New LEADRasterProcess

MsgBox "Table size before call to GetHistogramGray: " & RasterProc.HistogramGrayTableSize
nRet = RasterProc.GetHistogramGray (LEADRasterView1.raster)
If nRet = 0 Then
LEADRasterView1.raster.GetMinMaxVal
MsgBox "Highest Intensity: 0x" & Hex(LEADRasterView1.raster.MaxVal) & " Count: " & RasterProc.HistogramGrayTable (LEADRasterView1.raster.MaxVal) _
& Chr(13) & "Lowest Intensity: 0x" & Hex(LEADRasterView1.raster.MinVal) & " Count: " & RasterProc.HistogramGrayTable(LEADRasterView1.raster.MinVal)
End If
MsgBox "Table size of current histogram: " & RasterProc.HistogramGrayTableSize
End Sub


GetLayerMaskBitmap example for Visual Basic

RasterIO.GetLayerMaskBitmap LEADRasterView1.Raster, Raster2, 1
If Raster2.Bitmap = 0 Then
MsgBox "No Layer Mask Bitmap"
End If


GetLinearVOILUT example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim nRet As Integer
RasterProc.EnableMethodErrors = False
nRet = RasterProc.GetLinearVOILUT(LEADRasterView1.Raster, 0)
If (nRet = 0) Then
MsgBox "Width = " + Str(RasterProc.UserWindowWidth) + Chr$(13) + _
"Center = " + Str(RasterProc.UserWindowCenter)
End If


GetMarkers example for Visual Basic

Dim Marker1 As LEADMarkers
Dim Marker2 As LEADMarkers
Dim RasterIO As LEADRasterIO
Private Sub LoadMarker_Click()
RasterIO.Load LEADRasterView1.Raster, "c:\ image1.jpg", 0, 0, 1
Marker1.Load "c:\ image1.jpg", 0
RasterIO.SetMarkers Marker1, 0
RasterIO.Save LEADRasterView1.Raster, "c:\ image2.jpg", _
FILE_EXIF_JPEG, 24, 2, 0
Marker2.GetMarkers 0
For i = 0 To Marker2.Count - 1
Marker2.GetMarker i
Print Marker2.Type, Marker2.ElementCount
Next i
End Sub


GetMemoryInfo example for Visual Basic

LEADRasterView1.Raster.GetMemoryInfo
MsgBox LEADRasterView1.Raster.MemoryInfoTileViews


GetMemoryThresholds example for Visual Basic

LEADRasterView1.Raster.GetMemoryThresholds
MsgBox LEADRasterView1.Raster.MemoryTiledThreshold


GetMinMaxBits example for Visual Basic

The following example retrieves the values for MinBit and MaxBit using GetMinMaxBits and writes the results.

LEADRasterView1.Raster.GetMinMaxBits
Text1.Text = CStr(LEADRasterView1.Raster.MinBit)
Text2.Text = CStr(LEADRasterView1.Raster.MaxBit)


GetMinMaxVal example for Visual Basic

The following example retrieves the values for MinVal and MaxVal using GetMinMaxVal and writes the results.

'must call GetMinMaxVal first
LEADRasterView1.Raster.GetMinMaxVal
Text3.Text = CStr(LEADRasterView1.Raster.MinVal)
Text4.Text = CStr(LEADRasterView1.Raster.MaxVal)


GetObjectInfo example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GetObjectInfo LEADRasterView1.Raster, False
MsgBox "X =" + Str(RasterProc.ObjectXPos) + Chr$(13) + _
"Y =" + Str(RasterProc.ObjectYPos) + Chr$(13) + _
"Angle =" + Str(RasterProc.ObjectOrientationAngle) + Chr$(13) + _
" Roundness =" + Str(RasterProc.ObjectRoundness)


GetOverlayBitmap example for Visual Basic

Dim nRet As Integer
Dim i As Integer
Dim strFile As String
Dim OverlayRaster As New LEADRaster
Dim RasterProc As New LEADRasterProcess
Dim RasterIO As New LEADRasterIO
For i = 0 To 16
nRet = RasterProc.GetOverlayBitmap(LEADRasterView1.Raster, i, OverlayRaster, _
OVERLAY_NOCOPY)
If (nRet = 0) Then
strFile = "C:\" + Str(i) + "_copy.cmp"
nRet = RasterIO.Save(OverlayRaster, strFile, FILE_LEAD1BIT, 1, QFACTOR_LEAD_0, 0)
If (nRet <> 0) Then
MsgBox ("Error saving file!")
End If
End If
Next i


GetOverlayCount example for Visual Basic

MsgBox RasterProc.GetOverlayCount(LEADRasterView1.Raster, 0)


GetPicture and SetPicture example for Visual Basic

To use this code, you must first add a PictureBox control to your form, and make it invisible.

' Hide the LEAD control
LEADRasterView1.Visible = False
'Assign the picture object to the PictureBox control
Picture1 = LEADRasterView1.Raster.GetPicture
'Give the PictureBox control the same size and position as the LEAD control
Picture1.Top = LEADRasterView1.Top
Picture1.Left = LEADRasterView1.Left
Picture1.Height = LEADRasterView1.Height
Picture1.Width = LEADRasterView1.Width
'Interrupt with a message.
MsgBox "This is the PictureBox. Click OK for the SetPicture method"
'Get the picture object back to the LEAD control and repaint it
LEADRasterView1.AutoSetRects = False ' Keep the previous display rectangles.
LEADRasterView1.Raster.SetPicture Picture1 ' Load the bitmap from the PictureBox control.
Picture1.Visible = False ' Hide the PictureBox control.
LEADRasterView1.Visible = True ' Make the LEAD control visible.
LEADRasterView1.ForceRepaint


GetRgnHandle example for Visual Basic

Note: Also works with Access 95 and 97.

The following code creates a region, saves its handle and adds the saved region beside the current region.

Dim RasterProc As New LEADRasterProcess
'Declare local variables.
Dim OffsetX, OffsetY
Dim SavedRegion As Long
'Initialize the variables that we will manipulate to simulate mouse coordinates.
OffsetX = LEADRasterView1.Raster.BitmapWidth / 8
OffsetY = LEADRasterView1.Raster.BitmapHeight / 6
'Create an elliptical region.
LEADRasterView1.Raster.SetRgnEllipse OffsetX, OffsetY, OffsetX, OffsetY, L_RGN_SET
'Save a copy of the region.
SavedRegion = LEADRasterView1.Raster.GetRgnHandle
'Add the saved region to the bitmap, offsetting it so that we can see it.
LEADRasterView1.Raster.SetRgnHandle SavedRegion, OffsetX, OffsetY, L_RGN_OR
'Delete the saved region.
LEADRasterView1.Raster.DeleteRgnHandle SavedRegion
'Fill the bitmap region with blue.
RasterProc.Fill LEADRasterView1.Raster, RGB(0, 0, 255)
'Free the bitmap region.
LEADRasterView1.Raster.FreeRgn
'Repaint the image so that we can see how the image was updated.
LEADRasterView1.ForceRepaint


GetRgnPerimeterLength example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim Top, Bottom, Left, Right As Integer
Top = LEADRasterView1.Raster.BitmapHeight / 3
Bottom = LEADRasterView1.Raster.BitmapHeight * 2 / 3
Left = LEADRasterView1.Raster.BitmapWidth / 3
Right = LEADRasterView1.Raster.BitmapWidth * 2 / 3
LEADRasterView1.Raster.SetRgnEllipse Left, Top, Right, Bottom, L_RGN_SET

RasterProc.GetRgnPerimeterLength LEADRasterView1.Raster
MsgBox "Perimeter Length = " + Str(RasterProc.RgnPerimeterLength)


GetServerBitmap example for Visual Basic

This example copies a bitmap from a LEAD OLE Server, flips the bitmap, then copies the bitmap back to the server. To test this example, you must add an OLE control to your form and specify LEAD Image as the object type.

Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
OLE1.AppIsRunning = True
RasterIO.GetServerBitmap LEADRasterView1.Raster, OLE1.LpOleObject
RasterProc.Flip LEADRasterView1.Raster
RasterIO.SetServerBitmap LEADRasterView1.Raster, OLE1.LpOleObject


GetTransformationParameters Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i As Integer

RasterProc.ReferencePointsX(0) = 81400
RasterProc.ReferencePointsY (0) = 11300

RasterProc.ReferencePointsX(1) = 78600
RasterProc.ReferencePointsY(1) = 87400

RasterProc.ReferencePointsX(2) = 79400
RasterProc.ReferencePointsX(2) = 116000

RasterProc.MarksCount = 3

RasterProc.Mark(0).Type = RGS_T
RasterProc.Mark(0).MinScale = 90
RasterProc.Mark(0).MaxScale = 110
RasterProc.Mark(0).Width = 31
RasterProc.Mark(0).Height = 29
RasterProc.Mark(0).Top = 72
RasterProc.Mark(0).Left = 741
RasterProc.Mark(0).Bottom = 171
RasterProc.Mark(0).Right = 896
RasterProc.Mark(0).NumberOfExpectedMarks = 1

RasterProc.Mark(1).Type = RGS_T
RasterProc.Mark(1).MinScale = 90
RasterProc.Mark(1).MaxScale = 110
RasterProc.Mark(1).Width = 31
RasterProc.Mark(1).Height = 29
RasterProc.Mark(1).Top = 836
RasterProc.Mark(1).Left = 706
RasterProc.Mark(0).Bottom = 908
RasterProc.Mark(0).Right = 840
RasterProc.Mark(0).NumberOfExpectedMarks = 1

RasterProc.Mark(2).Type = RGS_T
RasterProc.Mark(2).MinScale = 90
RasterProc.Mark(2).MaxScale = 110
RasterProc.Mark(2).Width = 31
RasterProc.Mark(2).Height = 29
RasterProc.Mark(2).Top = 1118
RasterProc.Mark(2).Left = 729
RasterProc.Mark(2).Bottom = 1199
RasterProc.Mark(2).Right = 852
RasterProc.Mark(2).NumberOfExpectedMarks = 1

RasterProc.SearchRegMarks LEADRasterView1.Raster

For i = 0 To 2
RasterProc.MarkPointX(i) = RasterProc.Mark(i).DetectedMarkPointX(0)
RasterProc.MarkPointY (i) = RasterProc.Mark(i).DetectedMarkPointY(0)
Next i '

RasterProc.GetMarksCenterMass LEADRasterView1.Raster
For i = 0 To 2
RasterProc.TransformedPointsX(i) = RasterProc.MarkCMPointX(i)
RasterProc.TransformedPointsY(i) = RasterProc.MarkCMPointY(i)
Next i

RasterProc.GetTransformationParameters LEADRasterView1.Raster

RasterProc.ApplyTransformationParameters LEADRasterView1.Raster, _
RasterProc.XTranslation, _
RasterProc.YTranslation, _
RasterProc.TransformationAngle, _
RasterProc.XScale, _
RasterProc.YScale, _
RGS_SIZE_NORMAL Or RGS_SIZE_FAVORWHITE


GetUserLookupTable example for Visual Basic

Dim PointCount As Long
RasterProc.UserLUTCurveSize = 3
RasterProc.UserLUTCurveX(0) = 0
RasterProc.UserLUTCurveY(0) = 0
RasterProc.UserLUTCurveX(1) = 128
RasterProc.UserLUTCurveY(1) = 150
RasterProc.UserLUTCurveX(2) = 255
RasterProc.UserLUTCurveY(2) = 255
RasterProc.GetUserLookupTable
PointCount = RasterProc.UserLookupTablePointCount
RasterProc.RemapIntensity LEADRasterView1.Raster, CHANNEL_MASTER
MsgBox PointCount & " Points were modified"


GlassEffect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GlassEffect LEADRasterView1.Raster, 20, 10, _
GLASS_WFRQ + GLASS_HPER


GlowFilter Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GlowFilter LEADRasterView1.Raster, 5, 3, 0


Grayscale example for Visual Basic

Note: Also works with Access 95 and 97.

This example converts the bitmap to 12-bit grayscale.

Dim RasterProc As New LEADRasterProcess
RasterProc.Grayscale LEADRasterView1.Raster, 12 'Grayscale image to 12-bit


GrayscaleExt example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.GrayscaleExt LEADRasterView1.Raster, 300, 590, 110


GrayScaleToDuotone Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i As Integer
RasterProc.Grayscale LEADRasterView1.Raster, 8
For i = 0 To 255
RasterProc.GrayScaleRed(i) = i
RasterProc.GrayScaleGreen(i) = 100
RasterProc.GrayScaleBlue(i) = 20
Next i
RasterProc.GrayScaleToDuotone LEADRasterView1.Raster, RGB(0, 0, 0), 1


GrayScaleToMultitone Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i As Integer
RasterProc.Grayscale LEADRasterView1.Raster, 8
RasterProc.MultitoneColors (0 ,RGB(255, 255, 0));
RasterProc.MultitoneColors (0 ,RGB(255, 0, 0));

RasterProc.GrayScaleToMultitone (LEADRasterView1.Raster,DT_DUOTONE, 1, DT_LINEAR
RasterProc.GrayScaleToDuotone LEADRasterView1.Raster, RGB(0, 0, 0), 1


Halftone Example for Visual Basic

Dim Raster As New LEADRaster
Dim RasterProc As New LEADRasterProcess
Dim iDim As Integer
Dim i As Integer
iDim = 5
For i = 0 To 25
Raster.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.Rotate Raster, 360 * i, 0, RGB(255, 0, 0)
LEADRasterView1.Raster.InsertBitmapListItem -1, Raster.Bitmap
Next i

RasterProc.HalfTone LEADRasterView1.Raster, HALFTONE_USERDEF, 0, iDim


HalfTonePattern Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.HalfTonePattern LEADRasterView1.Raster, _
100, _
200, _
12, _
2, _
4500, _
RGB(255, 255, 255), _
RGB(255, 0, 0), _
HTPATTERN_LINE


HasMagGlass example for Visual Basic

If (LEADRasterView1.HasMagGlass) Then
Caption = "Stop"
'Stop the MagGlass
LEADRasterView1.StopMagGlass
Else
Caption = "Error"
End If


hDocCleanRgn example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub

Private Sub Command62_Click()
'HolePunch Remove
'This example updates a windows region with all removed hole punches
'For the example, a windows region is updated and then converted to a LEAD region
'but in practice it would easier and faster to just update a LEAD region
'The HOLEPUNCH_USE_DPI flag instructs the API to determine the size of the hole punches
'based on the image DPI
'The image is modified
'The HolePunch Event is used to display information about each hole punch removed

Dim nRet As Integer
RasterProc.EnableDocCleanEvents = True
nRet = RasterProc.HolePunchRemove(LEADRasterView1.Raster, _
HOLEPUNCH_SINGLE_REGION Or HOLEPUNCH_USE_DPI Or HOLEPUNCH_USE_COUNT Or HOLEPUNCH_USE_LOCATION, _
2, 4, 0, 0, 0, 0, HOLEPUNCH_LEFT)

If (nRet = 0) Then
LEADRasterView1.Raster.FreeRgn
LEADRasterView1.Raster.SetRgnHandle RasterProc.hDocCleanRgn, 0, 0, L_RGN_SET
RasterProc.hDocCleanRgn = 0 'no longer need rgn
LEADRasterView1.RgnFrameType = RGNFRAME_COLOR
End If
End Sub

Private Sub RasterProc_HolePunchRemove(ByVal hRgn As Long, ByVal fBoundingRectLeft As Single, ByVal fBoundingRectTop As Single, ByVal fBoundingRectWidth As Single, ByVal fBoundingRectHeight As Single, ByVal iHoleIndex As Long, ByVal iHoleTotalCount As Long, ByVal iWhiteCount As Long, ByVal iBlackCount As Long)
Debug.Print "HolePunch at [Left,Top,Width,Height]" & CStr(fBoundingRectLeft) & "," & CStr(fBoundingRectTop) _
& "," & CStr(fBoundingRectWidth) & "," & CStr(fBoundingRectHeight) _
& " HoleIndex=" & CStr(iHoleIndex) & " TotalCount=" & CStr(iHoleTotalCount) _
& " WhiteCount=" & CStr(iWhiteCount) & " BlackCount=" & CStr(iBlackCount)
End Sub


HighPassFilter Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.HighPassFilter LEADRasterView1.Raster, 10, 100


HistoContrast example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a histogram contrast to the bitmap and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.HistoContrast LEADRasterView1.Raster, 300
LEADRasterView1.ForceRepaint


HistoEqualize example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.HistoEqualize LEADRasterView1.Raster, YUV_SPACE


HistogramTableSize example for Visual Basic

If LEADRasterView1.Raster.BitmapBits = 64 Or LEADRasterView1.Raster.BitmapBits = 48 Then
RasterProc.HistogramTableSize = 65536
Else
RasterProc.HistogramTableSize = 256
End If


HolesRemovalBitmapRgn Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.HolesRemovalBitmapRgn LEADRasterView1.Raster


HScrollInfo example for Visual Basic

Private Sub LEADRasterView1_Resize()
If (LEADRasterView1.HScrollInfo.Visible) Then
LEADRasterView1.HScrollInfo.Page = LEADRasterView1.HScrollInfo.Max / 10
LEADRasterView1.HScrollInfo.Line = 10
End If
If (LEADRasterView1.VScrollInfo.Visible) Then
LEADRasterView1.VScrollInfo.Page = LEADRasterView1.VScrollInfo.Max / 10
LEADRasterView1.VScrollInfo.Line = 10
End If
Debug.Print "*************"
Debug.Print "HScrollMin: " & CStr(LEADRasterView1.HScrollInfo.Min)
Debug.Print "HScrollMax: " & CStr(LEADRasterView1.HScrollInfo.Max)
Debug.Print "VScrollMin: " & CStr(LEADRasterView1.VScrollInfo.Min)
Debug.Print "VScrollMax: " & CStr(LEADRasterView1.VScrollInfo.Max)
Debug.Print "-------------"
Debug.Print "HScrollPage: " & CStr(LEADRasterView1.HScrollInfo.Page)
Debug.Print "HScrollLine: " & CStr(LEADRasterView1.HScrollInfo.Line)
Debug.Print "VScrollPage: " & CStr(LEADRasterView1.VScrollInfo.Page)
Debug.Print "VScrollLine: " & CStr(LEADRasterView1.VScrollInfo.Line)
Debug.Print "-------------"
Debug.Print "HScrollPos: " & CStr(LEADRasterView1.HScrollInfo.Pos)
Debug.Print "VScrollPos: " & CStr(LEADRasterView1.VScrollInfo.Pos)
Debug.Print "-------------"
Debug.Print "HScrollWidth: " & CStr(LEADRasterView1.HScrollInfo.Width)
Debug.Print "VScrollWidth: " & CStr(LEADRasterView1.VScrollInfo.Width)
End Sub


HSV_HfromRGB example for Visual Basic

'Takes an RGB, displays the RGB components, and displays the HSV components
Private Sub RGBtoHSV(cr As OLE_COLOR)
Dim red As Integer
Dim green As Integer
Dim blue As Integer
Dim h As Integer
Dim s As Integer
Dim v As Integer
Dim RasterProc As New LEADRasterProcess

red = cr And &HFF
green = (cr \ &H100) And &HFF
blue = cr \ &H10000

h = RasterProc.HSV_HfromRGB (cr)
s = RasterProc.HSV_SfromRGB (cr)
v = RasterProc.HSV_VfromRGB (cr)

MsgBox "RGB (" & red & "," & green & "," & blue & ") is HSV(" & h & "," & s & "," & v & ")"
End Sub


Hue example for Visual Basic

Note: Also works with Access 95 and 97.

This example rotates the hue 180 degrees and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Hue LEADRasterView1.Raster, 180
LEADRasterView1.ForceRepaint


HueSaturationIntensity example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.HSICount = 1
RasterProc.HSIHue(0) = 18000
RasterProc.HSISaturation(0) = 0
RasterProc.HSIIntensity(0) = 0
RasterProc.HSIOuterLow(0) = 315
RasterProc.HSIOuterHigh(0) = 45
RasterProc.HSIInnerLow(0) = 345
RasterProc.HSIInnerHigh(0) = 15
' change the red color to green
RasterProc.HueSaturationIntensity LEADRasterView1.Raster, 0, 0, 0


IgnoreFilterList example for Visual Basic

Dim io As New LEADRasterIO

io.IgnoreFilters "CMP,BMP,PCX,TIF"

MsgBox io.IgnoreFilterList


IgnoreFilters example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to ignore filters so that certain files are not loaded.

Dim RasterIO As New LEADRasterIO
'First, make sure PreLoaded Filters does not
'contain CMP, and that 0 filters can be cached
RasterIO.PreLoadFilters 3, 0, "BMP,FAX,TIF"
'now, ignore cmp filter (never load cmp files)
RasterIO.IgnoreFilters "CMP"


Impressionist Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Impressionist LEADRasterView1.Raster, 10, 10


InfoBits example for Visual Basic

Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
Dim out$
If (nStatusCode = 0) Then 'successful thumbnail generation
out$ = pszFilename & Chr(13)
out$ = out$ & "Format: " & CStr(LEADThumb1.InfoFormat) & Chr(13)
out$ = out$ & "Compression: " & CStr(LEADThumb1.InfoCompression) & Chr(13)
out$ = out$ & "Bits: " & CStr(LEADThumb1.InfoBits) & Chr(13)
out$ = out$ & "Width: " & CStr(LEADThumb1.InfoWidth) & Chr(13)
out$ = out$ & "Height: " & CStr(LEADThumb1.InfoHeight) & Chr(13)
out$ = out$ & "Page: " & CStr(LEADThumb1.InfoPage) & Chr(13)
out$ = out$ & "TotalPages: " & CStr(LEADThumb1.InfoTotalPages) & Chr(13)
out$ = out$ & "SizeDisk: " & CStr(LEADThumb1.InfoSizeDisk) & Chr(13)
out$ = out$ & "SizeMem: " & CStr(LEADThumb1.InfoSizeMem) & Chr(13)
out$ = out$ & "XRes: " & CStr(LEADThumb1.InfoXRes) & Chr(13)
out$ = out$ & "YRes: " & CStr(LEADThumb1.InfoYRes) & Chr(13)
MsgBox out$
End If
LEADThumb1.ContinueBrowse = True 'continue the browse operation
End Sub


InfoHasAlpha example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

RasterIO.Load LEADRasterView1.Raster, "c:\temp\1.jpg", 24, 1, 1 'load a 24-bit image
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.ColorRes LEADRasterView1.Raster, 8, 0, 0, 0 'just make it 8-bit
'now set an alpha channel
LEADRasterView1.Raster.BitmapAlpha = LEADRasterView2.Raster.Bitmap

'save and free
RasterIO.Save LEADRasterView1.Raster, "c:\temp\32.png", FILE_PNG, 32, 0, 0
LEADRasterView1.Raster.Bitmap = 0
LEADRasterView2.Raster.Bitmap = 0

MsgBox "Pause"

're-load
RasterIO.GetFileInfo LEADRasterView1.Raster, "c:\temp\32.png", 0, 0
If (RasterIO.InfoHasAlpha <> False) Then
RasterIO.Load LEADRasterView1.Raster, "c:\temp\32.png", 0, 1, 1
End If
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.BitmapAlpha


InfoLayers example for Visual Basic

' This example all the layers in a file to a bitmap list
RasterIO.GetFileInfo LEADRasterView1.Raster, "c:\temp\layers.psd", 0, 0

If RasterIO.InfoLayers = 0 Then
MsgBox "This file has no layers!"
Else
' load the first layer directly
RasterIO.LoadLayer LEADRasterView1.Raster, "c:\temp\layers.psd", 0, 0

' steal the bitmaps from the other object
LEADRasterView1.Raster.RefBitmap = True

For i = 1 To LEADRasterView1.Raster.InfoLayers - 1
' use a second control to load the other layers
' using LEAD1 to load the other layers would invalidate the bitmap list
RasterIO.LoadLayer LEADRasterView2.Raster, "c:\temp\layers.psd", 0, i
' append the layer to the bitmap list
LEADRasterView1.Raster.InsertBitmapListItem -1, LEADRasterView2.Raster.Bitmap
Next
End If


InfoViewPerspective Example for Visual Basic

RasterIO.GetFileInfo LEADRasterView1.Raster, "v:\images\babe.cmp", 1, FILEINFO_TOTALPAGES
MsgBox CStr(RasterIO.InfoViewPerspective)


Insert example for Visual Basic

'load an image
LEADRasterIO1.Load LEADRaster1, "v:\images\eagle.cmp", 0, 0, 1
'insert it into the ImageList control
LEADImgList1.Insert LEADRaster1.Bitmap, "testing", 1
LEADImgList1.EnsureVisible LEADImgList1.Count – 1


InsertAt example for Visual Basic

'load an image
LEADRasterIO1.Load LEADRaster1, "v:\images\eagle.cmp", 0, 0, 1
'insert it into the ImageList control as the fourth item (after 3)
LEADImgList1.InsertAt LEADRaster1.Bitmap, "test2", 1, 3


InsertBitmapListItem Example for Visual Basic

Note: Also works with Access 95 and 97.

This example loads an ordinary file and uses it to create and play an animation. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

Dim nMax As Double ' Maximum width or height for bitmaps in the list
Dim BitmapWidth As Double ' Width of the bitmap
Dim BitmapHeight As Double ' Height of the bitmap
Dim I As Long ' Loop Counter
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim Factory As New LEADRasterFactory
Dim Raster2 As LEADRaster
Dim szLic As String

'Create a new ILEADRaster Object
szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc." & vbCrLf & vbCrLf
Set Raster2 = Factory.CreateObject("LEADRaster.LEADRaster", szLic)

nMax = 160
RasterIO.Load Raster2, "d:\temp\24bit.bmp", 0, 0, 1
BitmapWidth = Raster2.BitmapWidth
BitmapHeight = Raster2.BitmapHeight
' Reduce memory requirements, if necessary. Only small bitmaps play smoothly.
If (BitmapWidth > nMax) Then
RasterProc.Size Raster2, nMax, (BitmapHeight * nMax) / BitmapWidth, RESIZE_RESAMPLE
ElseIf (BitmapHeight > nMax) Then
RasterProc.Size Raster2, (BitmapWidth * nMax) / BitmapHeight, nMax, RESIZE_RESAMPLE
End If
' Dither to an optimized palette, leaving the last color blank to use
' for transparency.
RasterProc.ColorRes Raster2, 8, CRP_IDENTITYPALETTE, CRD_FLOYDSTEINDITHERING, 255
' Set an arbitrary transparent color in the last position of the bitmap palette.
Raster2.BitmapPalette(255) = RGB(212, 222, 202)
' Set the playback values that will apply to all bitmaps in the list.
Raster2.BitmapDelay = 10
Raster2.BitmapTop = 0
Raster2.BitmapLeft = 0
Raster2.BitmapEnableTransparency = True
Raster2.BitmapTransparentColor = 16777216 + 255 ' Specified by palette index
Raster2.BitmapDisposalMethod = ANIMATIONDISPOSAL_RESTOREBACKGROUND
' Free the LEADRasterView1 control's current bitmap list.
LEADRasterView1.Raster.BitmapList = 0
' Populate the bitmap list in the LEADRasterView1 control.
LEADRasterView1.EnablePaint = False
For I = 0 To 36
LEADRasterView1.Raster.InsertBitmapListItem I, Raster2.Bitmap
' Rotate, using the transparent color as the fill color.
LEADRasterView1.Raster.BitmapListIndex = I
RasterProc.Rotate LEADRasterView1.Raster, 1000 * I, 0, 16777216 + 255
Next I
LEADRasterView1.EnablePaint = True
' Set the animation playback properties
LEADRasterView1.AnimationBackColor = RGB(0, 0, 255)
LEADRasterView1.AnimationBitsPerPixel = 8
LEADRasterView1.AnimationHeight = LEADRasterView1.ScaleHeight
LEADRasterView1.AnimationWidth = LEADRasterView1.ScaleWidth
LEADRasterView1.AnimationLoop = False
For I = 0 To 255
LEADRasterView1.AnimationPalette(I) = LEADRasterView1.Raster.BitmapPalette(I)
Next I
' Set properties for a scaled animation.
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSetRects = False
' Set the image display size to match the LEAD Raster View control.
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
' Start the animation.
LEADRasterView1.AnimationEnable = True
' Free the Raster2 object's bitmap list.
Raster2.BitmapList = 0


InsertFromBitmapList example for Visual Basic

'load 5 pages
LEADRasterIO1.Load LEADRaster1, "G:\Images\MultiPage.tif", 0, 2, 5
LEADImgList1.InsertFromBitmapList LEADRaster1.BitmapList, "from List"


InsertMarker example for Visual Basic

Dim RasterIO As LEADRasterIO
Private Sub LoadMarker_Click()
Marker1.Load "c:\ image1.jpg", 0
Marker2.Load "c:\ image2.tif", 0
Marker1.GetMarker 0
Marker2.Type = Marker1.Type
Marker2.ElementCount = Marker1.ElementCount
For i = 0 To Marker1.Count - 1
Marker2.Element (i) = Marker1.Element(i)
Next i
Marker2.InsertMarker 0
End Sub


Intensity example for Visual Basic

Note: Also works with Access 95 and 97.

This example lightens the bitmap and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Intensity LEADRasterView1.Raster, 150
LEADRasterView1.ForceRepaint


IntensityDetect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.IntensityDetect LEADRasterView1.Raster, _
128, _
255, _
RGB(0, 0, 0), _
RGB(255, 255, 255), _
CHANNEL_MASTER


Invert example for Visual Basic

Note: Also works with Access 95 and 97.

This example inverts the bitmap's colors and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Invert LEADRasterView1.Raster
LEADRasterView1.ForceRepaint


InvertedText example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub

Private Sub Command60_Click()
Dim nRet As Integer
'InvertedText
'This example finds all inverted text regions greater than 5 inches in width and 1/2 inch in height
'and inverts the text so that it appears normal
'The InvertedText Event is used to display additional information about the inverted text regions
'A LEAD region is updated to show all of the changes
RasterProc.EnableDocCleanEvents = True
nRet = RasterProc.InvertedText(LEADRasterView1.Raster, INVERTEDTEXT_SINGLE_REGION Or INVERTEDTEXT_LEAD_REGION Or INVERTEDTEXT_USE_DPI, 5000, 500, 70, 95)
If (nRet = 0) Then
LEADRasterView1.RgnFrameType = RGNFRAME_COLOR
End If
End Sub

Private Sub RasterProc_InvertedText(ByVal hRgn As Long, ByVal fBoundingRectLeft As Single, ByVal fBoundingRectTop As Single, ByVal fBoundingRectWidth As Single, ByVal fBoundingRectHeight As Single, ByVal iWhiteCount As Long, ByVal iBlackCount As Long)
Debug.Print "Inverted at [Left,Top,Width,Height]" & CStr(fBoundingRectLeft) & "," & CStr(fBoundingRectTop) & "," & CStr(fBoundingRectWidth) & "," & CStr(fBoundingRectHeight) & " WhiteCount=" & CStr(iWhiteCount) & " BlackCount=" & CStr(iBlackCount)
End Sub


IsGrayscale example for Visual Basic

This example tests to see if the bitmap is grayscale.

Dim IsGray As GrayScaleTypes
IsGray = LEADRasterView1.Raster.IsGrayScale
If IsGray = GRAY_NO Then
MsgBox "Not Grayscale"
Else
MsgBox "Is Grayscale"
End If


ISISAcquire example for Visual Basic

‘The following example acquires a single image using ISISAcquire.

Dim nret As Integer
LEADRasterISIS1.EnableMethodErrors = False
nret = LEADRasterISIS1.ISISLoadDriver
If (nret = 0) Then
nret = LEADRasterISIS1.ISISAcquire (hWnd, LEADRasterView1.Raster, ISIS_SHOWUI, ISIS_BITMAP_LIST_OVERWRITE)
LEADRasterISIS1.ISISUnloadDriver
End If
If (nret <> 0) Then
If nret <> ERROR_ISIS_CANCEL Then
MsgBox "Error " & CStr(nret) & "during ISIS Scan!"
End If
End If


ISISAcquireMulti example for Visual Basic

'The following example prepares for scanning multiple images by setting tags and enabling the ISISPage event and then scans multiple images, using ISISAcquireMulti method.

Dim nMaxPages As Long
Dim nRet As Integer
nMaxPages = 10

LEADRasterISIS1.EnableMethodErrors = False
LEADRasterISIS1.EnableISISEvent = True
nRet = LEADRasterISIS1.ISISLoadDriver
If (nRet = 0) Then
LEADRasterISIS1.ISISSetTag TAG_SCANAHEAD, TAG_SCANAHEAD_YES
LEADRasterISIS1.ISISGetTag TAG_MAXPAGES
nMaxPages = LEADRasterISIS1.ISISTagValue
LEADRasterISIS1.ISISSetTag TAG_SCANAHEAD_MAXPAGES, nMaxPages / 2
LEADRasterISIS1.ISISSetTag TAG_COMPRESSION, TAG_COMPRESSION_G4
nRet = LEADRasterISIS1.ISISAcquireMulti (hWnd, LEADRasterView1.Raster, "d:\temp\vbtest.tif", ISIS_SHOWUI, FILE_CCITT_GROUP4, True, ISIS_BITMAP_LIST_OVERWRITE)
LEADRasterISIS1.ISISUnloadDriver
If (nRet <> 0) Then
If (nRet = ERROR_USER_ABORT) Then
MsgBox "Acquire canceled, " & CStr(LEADRasterISIS1.PagesDiscarded) & " pages were aborted!"
ElseIf nRet <> ERROR_ISIS_CANCEL Then
MsgBox "Error " & CStr(nRet) & Chr(13) & "During ISIS Scan"
End If
Else
MsgBox "Image(s) acquired to file(s)" & "d:\temp\vbtest.tif"
End If
End If

Private Sub LEADRasterISIS1_ISISPage (ByVal nPage As Long, ByVal pszFileName As String)
Text1.Text = CStr(nPage)
Text1.Refresh
Text2.Text = pszFileName
Text2.Refresh
DoEvents
End Sub


IsISISAvailable example for Visual Basic

'The following example tests to see if ISIS is available. A message is output with the result.

If (LEADRasterISIS1.IsISISAvailable = False) Then
MsgBox "ISIS Support not installed!"
Else
MsgBox "ISIS is installed!"
End If


ISISSelect example for Visual Basic

'The following example displays the ISISSelect DialogBox and writes a message indicating which ISIS Scanner Driver was selected.

LEADRasterISIS1.ISISSelect hWnd
MsgBox LEADRasterISIS1.DriverName & " was selected! "


ISISSetScanOptions example for Visual Basic

LEADRasterISIS1.ISISLoadDriver
LEADRasterISIS1.ISISSetScanOptions hWnd
LEADRasterISIS1.ISISUnloadDriver


IsRegistrationMark Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim nRet As Integer

nRet = RasterProc.IsRegistrationMark(LEADRasterView1.Raster, RGS_T, 90, 110, 31, 29)
If (nRet = 0) Then
MsgBox "it is a registration mark"
End If


IsSigned example for Visual Basic

' Load the bitmap data as signed so we can use a different conversion
RasterIO.LoadSigned = True
RasterIO.Load LEADRasterView1.Raster, "c:\temp\signed.tif", 0, 0, 1
' use the non-default conversion "zero to center"
RasterProc.ConvertSignedToUnsigned LEADRasterView1.Raster, SHIFT_ZERO_TO_CENTER


Item example for Visual Basic

Dim LEADRasItem As LEADRasImageListItem
Dim nCount As Long
LEADImgList1.SelectAll False
'get width of 2nd image
LEADRaster1.Bitmap = LEADImgList1.Item (2).Bitmap
MsgBox "width of item 2 =" & Str(LEADRaster1.BitmapWidth)
'set the 4th and 6th items as selected
LEADImgList1.Item (3).Selected = True
LEADImgList1.Item (5).Selected = True
'now, count the selected items
nCount = 0
For Each LEADRasItem In LEADImgList1
If LEADRasItem.Selected Then nCount = nCount + 1
Next
MsgBox CStr(nCount) & " Items were selected!"


ItemBackgroundColor example for Visual Basic

LEADImgList1.ItemBackgroundColor = RGB(255, 255, 0) 'set to yellow


ItemSelected example for Visual Basic

Private Sub LEADImgList1_ItemSelected(ByVal nIndex As Long)
Form1.Caption = Form1.Caption & LEADImgList1.Item(nIndex).Text & " was selected!"
End Sub


ItemUnSelected example for Visual Basic

Private Sub LEADImgList1_ItemUnSelected(ByVal nIndex As Long)
Form1.Caption = LEADImgList1.Item (nIndex).Text & " was un-selected! "
End Sub


ItemWidth example for Visual Basic

'set item display options
LEADImgList1.ItemWidth = 150
LEADImgList1.ItemHeight = 150
LEADImgList1.ItemVerticalSpacing = 20
LEADImgList1.ItemHorizontalSpacing = 20
LEADImgList1.DisplayItemText = Not LEADImgList1.DisplayItemText


J2KCompressionControl example for Visual Basic

Dim IO As New LEADRasterIO
' compress a lossless file
IO.J2KSetDefaults
IO.J2KCompressionControl = J2K_COMP_LOSSLESS
IO.Save LEADRasterView1.Raster, "c:\temp\lossless.j2k", FILE_J2K, 0, 0, SAVE_OVERWRITE


J2KCompressionRatio example for Visual Basic

Dim IO As New LEADRasterIO
' compress a JPEG2000 file using 100:1 comp ratio
IO.J2KSetDefaults
IO.J2KCompressionControl = J2K_COMP_RATIO
IO.J2KCompressionRatio = 100#
IO.Save LEADRasterView1.Raster, "c:\temp\100_to_1.j2k", FILE_J2K, 0, 0, SAVE_OVERWRITE


J2KROIControl example for Visual Basic

Private Sub Command1_Click()
RasterIO.J2KSetDefaults
' Set our options
RasterIO.J2KCompressionRatio = 1000
RasterIO.J2KCompressionControl = J2K_COMP_RATIO
RasterIO.J2KUseROI = True
RasterIO.J2KROIControl = J2K_USEOPTION_RECT
RasterIO.J2KROILeft = 200
RasterIO.J2KROITop = 200
RasterIO.J2KROIWidth = 600
RasterIO.J2KROIHeight = 600

RasterIO.J2KXTsiz = 100
RasterIO.J2KYTsiz = 100
' Save the bitmap to disk
RasterIO.Save LEADRasterView1.Raster, "c:\image1.j2k", FILE_J2K, 24, 2, SAVE_OVERWRITE
End Sub


J2KSetDefaults example for Visual Basic

Dim x As Integer
Dim IO As New LEADRasterIO
Dim msg$

LEADRasterView1.Raster.UnlockSupport L_SUPPORT_J2K, L_KEY_J2K

' Display all the default JPEG2000 advanced options
IO.J2KSetDefaults

msg$ = msg$ + "J2KUseColorTransform = " + CStr(IO.J2KUseColorTransform) + vbCrLf
msg$ = msg$ + "J2KDerivedQuantization = " + CStr(IO.J2KDerivedQuantization) + vbCrLf

msg$ = msg$ + "J2KXOsiz = " + CStr(IO.J2KXOsiz) + vbCrLf
msg$ = msg$ + "J2KYOsiz = " + CStr(IO.J2KYOsiz) + vbCrLf
msg$ = msg$ + "J2KXTsiz = " + CStr(IO.J2KXTsiz) + vbCrLf
msg$ = msg$ + "J2KYTsiz = " + CStr(IO.J2KYTsiz) + vbCrLf
msg$ = msg$ + "J2KXTOsiz = " + CStr(IO.J2KXTOsiz) + vbCrLf
msg$ = msg$ + "J2KYTOsiz = " + CStr(IO.J2KYTOsiz) + vbCrLf

msg$ = msg$ + "J2KDecompLevel = " + CStr(IO.J2KDecompLevel) + vbCrLf
msg$ = msg$ + "J2KProgressOrder = " + CStr(IO.J2KProgressOrder) + vbCrLf
msg$ = msg$ + "J2KCodBlockWidth = " + CStr(IO.J2KCodBlockWidth) + vbCrLf
msg$ = msg$ + "J2KCodBlockHeight = " + CStr(IO.J2KCodBlockHeight) + vbCrLf

msg$ = msg$ + "J2KCBS_SelectiveACBypass = " + CStr(IO.J2KCBS_SelectiveACBypass) + vbCrLf
msg$ = msg$ + "J2KCBS_ResetContextOnBoundaries = " + CStr(IO.J2KCBS_ResetContextOnBoundaries) + vbCrLf
msg$ = msg$ + "J2KCBS_TerminationOnEachPass = " + CStr(IO.J2KCBS_TerminationOnEachPass) + vbCrLf
msg$ = msg$ + "J2KCBS_VerticallyCausalContext = " + CStr(IO.J2KCBS_VerticallyCausalContext) + vbCrLf
msg$ = msg$ + "J2KCBS_PredictableTermination = " + CStr(IO.J2KCBS_PredictableTermination) + vbCrLf
msg$ = msg$ + "J2KCBS_ErrorResilienceSymbol = " + CStr(IO.J2KCBS_ErrorResilienceSymbol) + vbCrLf

msg$ = msg$ + "J2KGuardBits = " + CStr(IO.J2KGuardBits) + vbCrLf
msg$ = msg$ + "J2KDerivedBaseMantissa = " + CStr(IO.J2KDerivedBaseMantissa) + vbCrLf
msg$ = msg$ + "J2KDerivedBaseExponent = " + CStr(IO.J2KDerivedBaseExponent) + vbCrLf

msg$ = msg$ + "J2KUseSOPMarker = " + CStr(IO.J2KUseSOPMarker) + vbCrLf
msg$ = msg$ + "J2KUseEPHMarker = " + CStr(IO.J2KUseEPHMarker) + vbCrLf

MsgBox msg$


J2KTargetFileSize example for Visual Basic

Dim IO As New LEADRasterIO
' compress a 30K JPEG2000 file
IO.J2KSetDefaults
IO.J2KCompressionControl = J2K_COMP_TARGETSIZE
IO.J2KTargetFileSize = 30 * 1024
IO.Save LEADRasterView1.Raster, "c:\temp\30k.j2k", FILE_J2K, 0, 0, SAVE_OVERWRITE


JBIG2GBATX1 Example for Visual Basic

Dim RasterIO As New LEADRasterIO
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_JBIG2, L_KEY_JBIG2

RasterIO.Load LEADRasterView1.Raster, "c:\1.jpg", 0, 0, 1

RasterIO.JBIG2TemplateType = 0
RasterIO.JBIG2GBATX1 = 3
RasterIO.JBIG2GBATY1 = -1
RasterIO.JBIG2GBATX2 = -3
RasterIO.JBIG2GBATY2 = -1
RasterIO.JBIG2GBATX3 = 2
RasterIO.JBIG2GBATY3 = -2
RasterIO.JBIG2GBATX4 = -2
RasterIO.JBIG2GBATY4 = -2
RasterIO.JBIG2SaveFlags = JBIG2_TPON

RasterIO.Save LEADRasterView1.Raster, "c:\1.jp2", FILE_JBIG, 1, QFACTOR_LEAD_0, 0


KeyDown example for Visual Basic

Private Sub LEADImgList1_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
Form1.Caption = "Key " & Str(KeyCode) & " was pressed"
End Sub


KeyPress (ILEADRasterImgList) example for Visual Basic

Private Sub LEADImgList1_KeyPress(ByVal KeyAscii As Integer)
Form1.Caption = Form1.Caption + "Key " & Chr(KeyAscii) & " was pressed"
End Sub


KeyPress example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates the KeyPress event.

Private Sub LEADRasterView1_KeyPress(ByVal KeyAscii As Integer)
'This example uses the KeyPress event to implement a custom scale mode.
'There is no particular reason to put this code in this event
'This sample is just here to provide an example of both the Key Press event
'and the scale mode.
If KeyAscii = 67 Then 'Uppercase C
'This example sets an custom scale mode and uses it to crop the
'display. Keep in mind that the actual height and width do not change.
'Only the unit of measure changes.
'Change the scale so that origin is moved one-third right and one-third down
LEADRasterView1.ScaleLeft = -1
LEADRasterView1.ScaleTop = -1
LEADRasterView1.ScaleWidth = 3
LEADRasterView1.ScaleHeight = 3
'Crop the display so that it takes up the middle third of the height and width
LEADRasterView1.DstClipLeft = 0
LEADRasterView1.DstClipTop = 0
LEADRasterView1.DstClipWidth = 1
LEADRasterView1.DstClipHeight = 1
LEADRasterView1.ForceRepaint
End If
End Sub


KeyUp example for Visual Basic

Private Sub LEADImgList1_KeyUp(ByVal KeyCode As Integer, ByVal Shift As Integer)
Form1.Caption = Form1.Caption & " Key " & Str(KeyCode) & " was released"
End Sub


LensFlare Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 4
CenterY = LEADRasterView1.Raster.BitmapHeight / 4
RasterProc.LensFlare LEADRasterView1.Raster, CenterX, CenterY, 100, LNS_TYPE_1, _ RGB(100, 150, 10)


LevelLowBit example for Visual Basic

Note: Also works with Access 95 and 97.

This is also the example for LevelHighBit.

This example sets LevelLowBit and LevelHighBit to display the image using only the eight least significant bits.

LEADRasterView1.AutoRepaint = False
'use least significant 8 bits
LEADRasterView1.Raster.LevelLowBit = 0
LEADRasterView1.Raster.LevelHighBit = 7
LEADRasterView1.AutoRepaint = True


LevelLUT example for Visual Basic

Note: Also works with Access 95 and 97.

This is also the example for MinVal property and MaxVal property.

The following example sets LevelLowBit and LevelHighBit to use all bits, gets the minimum and maximum bits and intensity values for the image, and then sets the LUT so that pixels with values in the minimum range are mapped to the color RED, while pixels with values in the maximum range are mapped to BLUE.

Dim min As Long
Dim max As Long
Dim i As Long

LEADRasterView1.AutoRepaint = False
'use all bits
LEADRasterView1.Raster.LevelLowBit = 0
LEADRasterView1.Raster.LevelHighBit = LEADRasterView1.Raster.BitmapBits - 1

LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.GetMinMaxVal
max = LEADRasterView1.Raster.MaxVal
min = LEADRasterView1.Raster.MinVal

'set LUT so that min range maps to RED and max range maps to BLUE
For i = min To min + 100
LEADRasterView1.Raster.LevelLUT(i) = RGB(255, 0, 0)
Next
For i = max - 100 To max
LEADRasterView1.Raster.LevelLUT(i) = RGB(0, 0, 255)
Next
LEADRasterView1.AutoRepaint = True


LevelLUTLength example for Visual Basic

Note: Also works with Access 95 and 97.

This example writes out the number of entries in the LUT.

Text1.Text = CStr(LEADRasterView1.Raster.LevelLUTLength)


Light Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY, iWidth, iHeight As Integer

CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

If LEADRasterView1.Raster.BitmapHeight > LEADRasterView1.Raster.BitmapWidth / 2 Then
iWidth = LEADRasterView1.Raster.BitmapHeight
Else
iHeight = LEADRasterView1.Raster.BitmapWidth / 2
End If

RasterProc.Light LEADRasterView1.Raster, CenterX, CenterY, iWidth, iHeight, 0, 100, _
0, RGB(255, 255, 255), 100, 1, 100, 0, RGB(255, 255, 255), LGT_SPOTLIGHT


LightControl Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.LightLowerAvr(0) = 100
RasterProc.LightLowerAvr(1) = 120
RasterProc.LightLowerAvr(2) = 80

RasterProc.LightAvr(0) = 150
RasterProc.LightAvr(1) = 140
RasterProc.LightAvr(2) = 128

RasterProc.LightUpperAvr(0) = 190
RasterProc.LightUpperAvr(1) = 200
RasterProc.LightUpperAvr(2) = 228

RasterProc.LightControl LEADRasterView1.Raster, RGB_SPACE


LineProfile example for Visual Basic

Dim maxR As Long, maxG As Long, maxB As Long, i As Integer
Dim RasterProc As New LEADRasterProcess
RasterProc.LineProfile LEADRasterView1.Raster, 10, 10, 220, 120
For i = 0 To RasterProc.LineProfileSize - 1
If RasterProc.LineProfileRed (i) > maxR Then maxR = RasterProc.LineProfileRed(i)
If RasterProc.LineProfileGreen (i) > maxG Then maxG = RasterProc.LineProfileGreen(i)
If RasterProc.LineProfileBlue (i) > maxB Then maxB = RasterProc.LineProfileBlue(i)
Next
MsgBox "maxR= " & maxR & ", maxG= " & maxG & ", maxB= " & maxB


LineRemove example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub

Dim nRet As Integer
'Line Remove
'This examples removes vertical lines that are at least 200 pixels in length
'and no more than 5 pixels in width
'The lines can have gaps up to two pixels in length
'The LineRemove Event is used to display information about each line removed
RasterProc.EnableDocCleanEvents = True
nRet = RasterProc.LineRemove(LEADRasterView1.Raster, LINE_USE_GAP, 200, 5, 7, 10, 2, 0, LINEREMOVE_HORIZONTAL)

Private Sub RasterProc_LineRemove(ByVal fStartRow As Single, ByVal fStartCol As Single, ByVal fLength As Single, ByVal hRgnLine As Long)
Debug.Print "Line at [R,C] " & CStr(fStartRow) & "," & CStr(fStartCol) & " Length=" & CStr(fLength)
End Sub


Load (ILEADMarkers) example for Visual Basic

Dim RasterIO As LEADRasterIO
Dim Marker1 As LEADMarkers
Private Sub LoadMarker_Click()
RasterIO.Load LEADRasterView1.Raster, "c:\image1.jpg", 0, 0, 1
Marker1.Load "c:\ image1.jpg", 0
RasterIO.SetMarkers Marker1, 0
RasterIO.Save LEADRasterView1.Raster, "c:\image2.jpg", _
FILE_EXIF_JPEG, 24, 2, 0
End Sub


Load example for Visual Basic

Dim nPages As Long
Dim RasterMrc As LEADRasterMrc
RasterMrc.EnableMethodErrors = True
RasterMrc.GetPagesCount "c:\temp\testT44.mrc"
nPages = RasterMrc.MRCPagesCount
Caption = "File has " & nPages & " pages"
' load last page
RasterMrc.Load LEADRasterView1.Raster, "c:\temp\testT44.mrc", nPages


LoadArray example for Visual Basic

Private Sub LoadArray_Click()
Dim buf(30000) As Byte
Dim RasterIO As New LEADRasterIO
Dim RasterVar As New LEADRasterVariant
Dim i As Integer
Dim size As Integer
Open "c:\image1.cmp" For Binary Access Read As #1
Get #1, , buf
size = UBound(buf) – LBound(buf) +1
RasterVar.Type = VALUE_ARRAY_BYTE
RasterVar.ItemCount = size
For i = 0 To RasterVar.ItemCount - 1
RasterVar.ShortItemValue(i) = buf(i)
Next
RasterIO.LoadArray LEADRasterView1.Raster, _
RasterVar, 0, 0, -1, _
size
Close #1
End Sub


LoadArray2 example for Visual Basic

Private Sub LoadArray_Click()
Dim buf(40000) As Byte
Dim RasterIO As New LEADRasterIO

Open "d:\temp\error.bmp" For Binary Access Read As #1
Get #1, , buf
RasterIO.LoadArray2 LEADRasterView1.Raster, _
buf, 0, 0, -1, _
UBound(buf) - LBound(buf) + 1
Close #1
End Sub


LoadCompressed example for Visual Basic

RasterIO.LoadCompressed = COMP_NONE
' now "test.tif" will be loaded uncompressed
RasterIO.Load LEADRasterView1.Raster, "c:\temp\test.cmp", 0, 1, 1


LoadDatabase example for Visual Basic

Dim i As Integer
For i = 1 To 3 ' select 2nd to 4th items
LEADImgList1.Item(i).Selected = True
Next
'save all selected items to a multipage file
LEADImgList1.SaveDatabase "d:\temp\testing.tif", True
MsgBox "about to reload file"
'clear list
LEADImgList1.Clear
'reload file
LEADImgList1.LoadDatabase "d:\temp\testing.tif"


LoadFromFile example for Visual Basic

' load all images after the first
LEADImgList1.LoadFromFile "G:\Images\MultiPage.tif", 0, 2, -1


LoadICCProfile Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim pData As New LEADRasterVariant

Open "c:\MyICC.ICM" For Binary As #1
nRet = RasterIO.LoadICCProfile("c:\dst_rgb_image.tif", pData, 1)

For i = 0 To pData.ItemCount - 1
Put #1, , CByte(pData.ShortItemValue (i))
Next i

Set pData = Nothing
Close #1


LoadICCProfile2 Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim pData

Open "c:\MyICC.ICM" For Binary As #1
nRet = RasterIO.LoadICCProfile2 ("c:\dst_rgb_image.tif", pData, 1)

For i = 0 To UBound(pData) - LBound(pData) - 1
Put #1, , CByte(pData(i))
Next i
Close #1


LoadIFD example for Visual Basic

Dim RasterIO As New LEADRasterIO
' All examples will assume that "test.tif" has over 1002 images
' This example will load pages 1000 and 1001 after getting the information for page 1000:
RasterIO.GetFileInfo LEADRasterView1.Raster, "f:\IMAG001.I00", 1000, 0
' Setting LoadIFD to InfoIFD indicates that 1000 is treated as page 1
RasterIO.LoadIFD = RasterIO.InfoIFD
RasterIO.Load LEADRasterView1.Raster, "f:\IMAG001.I00", 0, 0, 2
' Reset LoadIFD to 0 so other TIF files will be handled properly
RasterIO.LoadIFD = 0


LoadInfo... example for Visual Basic

Take the following steps to exercise the LoadInfo event and LoadInfo... properties. The example creates a raw FAX file, then loads the file it just created. (Getting format information from an unfamiliar file is beyond the scope of this example.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
3. | Add the following form-level variables to the declarations procedure of the general object in your main form:

'Declare variables for demonstrating raw FAX.
Dim MyInfoBits As Integer
Dim MyInfoFlags As Long
Dim MyInfoFormat As Integer
Dim MyInfoHeight As Single
Dim MyInfoOffset As Long
Dim MyInfoWidth As Single
Dim MyInfoXRes As Integer
Dim MyInfoYRes As Integer
Private WithEvents RasterIO As LEADRasterIO

4.

Add the following to the Form Load event handler:

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO. ")

5.

Add a CommandButton control and code its click procedure as follows:

Private Sub Command4_Click()
Dim RasterProc As New LEADRasterProcess
LEADRasterView1.ScaleMode = 3 'Pixels
'Make the image look OK as a 1-bit image.
RasterProc.Size LEADRasterView1.Raster, _
LEADRasterView1.ScaleWidth, _
LEADRasterView1.ScaleHeight, RESIZE_RESAMPLE
RasterProc.Halftone LEADRasterView1.Raster, HALFTONE_VIEW, 45
'Set the form-level variables to the values we will use when loading.
MyInfoBits = 1
MyInfoFlags = LOADINFO_TOPLEFT
MyInfoFormat = FILE_FAX_G3_2D
MyInfoHeight = LEADRasterView1.Raster.BitmapHeight
MyInfoOffset = 0
MyInfoWidth = LEADRasterView1.Raster.BitmapWidth
MyInfoXRes = LEADRasterView1.Raster.BitmapXRes
MyInfoYRes = LEADRasterView1.Raster.BitmapYRes
'Save the image as raw FAX; then load the saved file.
'Format information will be supplied in the LoadInfo event.
RasterIO.Save LEADRasterView1.Raster, "d:\temp\tmp.tif", FILE_FAX_G3_2D, _
1, 1, SAVE_OVERWRITE
RasterIO.Load LEADRasterView1.Raster, "d:\temp\tmp.tif", 0, 0, 1
'Repaint the newly loaded image.
LEADRasterView1.ForceRepaint
End Sub

6.

Code the RasterIO object's LoadInfo event as follows:

'Use the form-level variables to supply format information.
RasterIO.LoadInfoBits = MyInfoBits
RasterIO.LoadInfoFlags = MyInfoFlags
RasterIO.LoadInfoFormat = MyInfoFormat
RasterIO.LoadInfoHeight = MyInfoHeight
RasterIO.LoadInfoOffset = MyInfoOffset
RasterIO.LoadInfoWidth = MyInfoWidth
RasterIO.LoadInfoXRes = MyInfoXRes
RasterIO.LoadInfoYRes = MyInfoYRes

7.

Run your program to test it.


LoadMemory example for Visual Basic

This example uses WIN32 API calls to load a file into memory, then uses the LoadMemory method to load the memory-resident file into a bitmap.

' Declare WIN32 API constants and functions in the Declarations module.
Private Const OF_READ = &H0
Private Const OF_CREATE = &H1000
Private Const SEEK_SET = 0
Private Const SEEK_END = 2
Private Const GMEM_MOVEABLE = &H2
Private Type OFSTRUCT
cBytes As String * 1
fFixedDisk As String * 1
nErrCode As Integer
reserved As String * 4
szPathName As String * 128
End Type
Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

Private Declare Function hread Lib "kernel32" Alias "_hread" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal wBytes As Long) As Long
Private Declare Function hwrite Lib "kernel32" Alias "_hwrite" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal lBytes As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Private Declare Function llseek Lib "kernel32" Alias "_llseek" (ByVal hFile As Long, ByVal lOffset As Long, ByVal iOrigin As Long) As Long

Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
' ---------------------- Code for LoadMemory (32 bit) -------------
Private Sub LoadMemory_Click()
Dim RasterIO As New LEADRasterIO
Dim hf As Long ' For WIN32 declare this as Long
Dim hMem As Long ' For WIN32 declare this as Long
Dim lpMem As Long
Dim iSize As Long
Dim of As OFSTRUCT
Dim nRet As Long

' Load the file into memory.
hf = OpenFile("d:\temp\error.bmp", of, OF_READ)
If hf = -1 Then
MsgBox ("Error opening file!")
GoTo quit_loadmemory
End If
iSize = llseek(hf, 0, SEEK_END)
nRet = llseek(hf, 0, SEEK_SET)
hMem = GlobalAlloc(GMEM_MOVEABLE, iSize)
If hMem = -1 Then
lclose (hf)
MsgBox ("Not enough memory to hold the file in memory!")
GoTo quit_loadmemory
End If
lpMem = GlobalLock(hMem)
If lpMem = 0 Then
lclose (hf)
GlobalFree (hMem)
MsgBox ("Not enough memory to hold the file in memory!")
GoTo quit_loadmemory
End If

If hread(hf, lpMem, iSize) < iSize Then
lclose (hf)
GlobalUnlock (hMem)
GlobalFree (hMem)
MsgBox ("Error reading file")
GoTo quit_loadmemory
End If
lclose (hf)
GlobalUnlock (hMem)
'Load the bitmap from the memory-resident file.
If RasterIO.LoadMemory(LEADRasterView1.Raster, hMem, 0, 0, -1, iSize) <> 0 Then
MsgBox ("Error calling LoadMemory")
Else
MsgBox ("LoadMemory succeeded")
End If
GlobalFree (hMem)
quit_loadmemory:
End Sub


LoadOffset example for Visual Basic

Dim RasterIO As New LEADRasterIO
Private Sub LoadOffset_Click()
Dim nRet As Integer
Dim nOffsetBegin As Integer

Open "c:\1.dat" For Binary As #1
Get #1, , nOffsetBegin
Close #1

nRet = RasterIO.LoadOffset(LEADRasterView1.Raster, "c:\1.dat", nOffsetBegin, FileLen("c:\1.dat") - nOffsetBegin, 0, 0, 1)
End Sub
Private Sub SaveOffset_Click()
Dim nRet As Integer
Dim nOffsetBegin As Integer
Dim Data As String
Data = "Lead Technologies Corporation"
Open "c:\1.dat" For Binary As #1
nOffsetBegin = Len(Data) + Len(nOffsetBegin)
Put #1, , nOffsetBegin
Put #1, , Data
Close #1

nRet = RasterIO.SaveOffset(LEADRasterView1.Raster, "c:\1.dat", nOffsetBegin, FILE_LEAD, 0, QFACTOR_PQ1, 0)
If (nRet = 0) Then
MsgBox "Size of the embedded image file = " + Str(RasterIO.FileSizeWritten), , "SUCCESS"
End If
End Sub
Private Sub Form_Load()
RasterIO.Load LEADRasterView1.Raster, "r:\users\images\parrots.cmp", 0, 0, 1
End Sub


LoadResize example for Visual Basic

RasterIO.LoadResize LEADRasterView1.Raster, "c:\temp\test.cmp", 250, 50, RESIZE_RESAMPLE, 0


LoadStatus Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim nRet As Integer
nRet = RasterIO.Load(LEADRasterView1.Raster, "c:\1.jpg", 0, 0, 1)

If (nRet = 0) Then
If (RasterIO.LoadStatus = 0) Then
MsgBox ("The image was loaded successfully and with no errors")
Else
MsgBox ("The image was loaded, but it might have corrupted areas"), , "Warning!"
End If
Else
MsgBox ("The load failed!"), , "ERROR"
End If


LoadUseViewPerspective example for Visual Basic

Note: This topic is for Document/Medical only.

This example times the loading of a bitmap with and without changing the internal view perspective.

Dim RasterIO As New LEADRasterIO
'Declare local variables
Dim StartTime, DeltaTime
'Do not include paints when measuring time.
LEADRasterView1.AutoRepaint = False
'Time the load using the bitmap's view perspective.
RasterIO.LoadUseViewPerspective = True
StartTime = Now
RasterIO.Load LEADRasterView1.Raster, "d:\temp\rotated.tif", 0, 0, 1
DeltaTime = DateDiff("s", StartTime, Now)
MsgBox Str$(DeltaTime) + " seconds loaded as is"
'Time the load that converts the bitmap's view perspective.
RasterIO.LoadUseViewPerspective = False
StartTime = Now
RasterIO.Load LEADRasterView1.Raster, "d:\temp\rotated.tif", 0, 0, 1
DeltaTime = DateDiff("s", StartTime, Now)
MsgBox Str$(DeltaTime) + " seconds converted on load"


LocalHistoEqualize Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.LocalHistoEqualize LEADRasterView1.Raster (), 15, 15, 100, 100, YUV_SPACE, CHANNEL_MASTER


LongItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_ARRAY_LONG
RasterVariant.ItemCount = 2
RasterVariant.LongItemValue(0) = 500
RasterVariant.LongItemValue(1) = 1000


LongValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant
RasterVariant.Type = VALUE_LONG
RasterVariant.LongValue = 500


LZWAutoClear Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim nRet As Integer

nRet = RasterIO.Load(LEADRasterView1.Raster, "c:\1.jpg", 0, 0, 1)
RasterIO.LZWAutoClear = False

RasterIO.Save LEADRasterView1.Raster, "c:\1.tif", FILE_TIFLZW, 24, QFACTOR_LEAD_0, 0


MagGlassOwnerDraw Example for Visual Basic

Dim RasterAnn As LEADRasterAnnotation
Dim RasterIO As LEADRasterIO
Dim hObject As Long

Private Sub Form_Load()
Dim Raster As New LEADRaster
Set RasterAnn = New LEADRasterAnnotation
Set RasterIO = New LEADRasterIO

RasterIO.Load Me.LEADRasterView1.Raster, App.Path & "\image.jpg", 0, 0, 1
RasterAnn.AnnParentRasterView = Me.LEADRasterView1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN

RasterAnn.AnnCreate ANN_OBJECT_BUTTON, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectHeight(hObject) = 100
RasterAnn.AnnRectWidth(hObject) = 200
RasterAnn.AnnRectLeft(hObject) = 50
RasterAnn.AnnRectTop(hObject) = 50
RasterAnn.AnnSetFontName hObject, "", False
RasterAnn.AnnSetText hObject, "Lead Tools", False
End Sub

Private Sub LEADRasterView1_MagGlassOwnerDraw(ByVal hWnd As Long, ByVal hMemDC As Long, ByVal lXPos As Long, ByVal lYPos As Long, ByVal lMagGlassTop As Long, ByVal lMagGlassLeft As Long, ByVal lMagGlassBottom As Long, ByVal lMagGlassRight As Long)
RasterAnn.AnnMagGlass hMemDC, lXPos, lYPos, 200, 200, 200
End Sub

Private Sub StopMagGlass_Click()
LEADRasterView1.StopMagGlass
LEADRasterView1.EnableMagGlassDraw = False
RasterAnn.AnnEnableMagGlass = False
End Sub
Dim RasterIO As New LEADRasterIO
Private Sub Command1_Click()
RasterIO.Load Me.LEADRasterView1.Raster, App.Path & "\image.jpg", 0, 0, 1
MsgBox LEADRasterView1.Raster.BitmapBytesPerLine
End Sub

Private Sub StartMagGlass_Click()
LEADRasterView1.EnableMagGlassDraw = True
RasterAnn.AnnEnableMagGlass = True
LEADRasterView1.StartMagGlass 200, 200, 200, RGB(0, 0, 0), _
RGB(255, 255, 255), False, 1, _
False, CROSSHAIR_FINE, False, False
End Sub


MagGlassPaintIntensity Example for Visual Basic

Private Sub StartMagnifyingGlass()
Dim nStatus As Integer

' Setting the Magnifying Glass Paint contrast, gamma and intensity
LEADRasterView1.MagGlassPaintContrast = LEADRasterView1.MagGlassPaintContrast + 100
LEADRasterView1.MagGlassPaintGamma = LEADRasterView1.MagGlassPaintGamma + 100
LEADRasterView1.MagGlassPaintIntensity = LEADRasterView1.MagGlassPaintIntensity + 100

' Starting the Magnifying Glass
nStatus = LEADRasterView1.StartMagGlass(100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), False, 1, False, CROSSHAIR_FINE, True, True)

If (nStatus <> 0) Then
MsgBox "Error Starting the Magnifying Glass, Error: " & CStr(nStatus)
End If
End Sub


MathFunction example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.MathFunction LEADRasterView1.Raster, MF_LOG, 100


MaskConvolution Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.MaskConvolution LEADRasterView1.Raster, 500, 45, 3, MSKC_EMBOSS


MaxFilter example for Visual Basic

Note: This topic is for Document/Medical only.

This example erodes dark objects and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.MaxFilter LEADRasterView1.Raster, 3
LEADRasterView1.ForceRepaint


Median example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a median filter with a 3x3 neighborhood and redisplays the bitmap.

Dim RasterProc As New LEADRasterProcess
RasterProc.Median LEADRasterView1.Raster, 3
LEADRasterView1.ForceRepaint


MinFilter example for Visual Basic

Note: This topic is for Document/Medical only.

This example dilates dark objects and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.MinFilter LEADRasterView1.Raster, 3
LEADRasterView1.ForceRepaint


Mosaic example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a mosaic effect with 8x8 tiles and redisplays the bitmap.

Dim RasterProc As New LEADRasterProcess
RasterProc.Mosaic LEADRasterView1.Raster, 8
LEADRasterView1.ForceRepaint


MosaicTiles Example for Visual Basic

Dim TWidth As Integer
Dim THeight As Integer
Dim RasterProc As New LEADRasterProcess

TWidth = LEADRasterView1.Raster.BitmapWidth / 5
THeight = LEADRasterView1.Raster.BitmapHeight / 5
RasterProc.MosaicTiles LEADRasterView1.Raster, 50, 7, _
TWidth, THeight, 0, 0, _
MSCT_CART Or MSCT_SHADOWGRAY, SHADOW_E, _
0, RGB(0, 0, 0), RGB(255, 255, 255)


MotionBlur example for Visual Basic

RasterProc.MotionBlur LEADRasterView1.Raster, 12, 4500, False


MouseDown example for Visual Basic

Private Sub LEADImgList1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim nItem As Long

nItem = LEADImgList1.HitTest(x, y)

If (nItem >= 0) Then
LEADImgList1.SelectionColor = RGB(255, 0, 0)
LEADImgList1.Item (nItem).Selected = True
End If
End Sub


MouseMove example for Visual Basic

Private Sub LEADImgList1_Click()
Dim lIndex As Long
If (LEADImgList1.AllowSelection = IMGLST_ALLOWSELECTION_NONE) Then 'manual selection?
lIndex = LEADImgList1.HitTest(gLastX, gLastY) 'did we hit an item?
If ((lIndex >= 0) And (lIndex < LEADImgList1.Count)) Then
'set item as selected
LEADImgList1.SelectAll False
LEADImgList1.Item (lIndex).Selected = True 'make sure the item is selected
End If
End If
End Sub
Private Sub LEADImgList1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
gLastX = x
gLastY = y
End Sub


MousePointer example for Visual Basic

LEADImgList1.MousePointer = 99
LEADImgList1.MouseIcon = LoadPicture("d:\temp\eye.ico")


MouseUp example for Visual Basic

Private Sub LEADImgList1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim nItem As Long

nItem = LEADImgList1.HitTest(x, y)

If (nItem >= 0) Then
LEADImgList1.SelectionColor = RGB(0, 0, 255)
LEADImgList1.Item (nItem).Selected = True
End If
End Sub


MouseWheel example for Visual Basic

Private Sub LEADRasterView_MouseWheel(ByVal nDelta As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
If (Shift = 2) Then
If (nDelta < 0) Then
If (LEADRasterView.PaintZoomFactor< 100 * 16) Then
LEADRasterView.PaintZoomFactor = LEADRasterView.PaintZoomFactor * 2
End If
Else
If (LEADRasterView.PaintZoomFactor > 100 / 16) Then
LEADRasterView.PaintZoomFactor = LEADRasterView.PaintZoomFactor / 2
End If
End If
Else
If (Shift = 3) Then
LEADRasterView.HScrollInfo.Pos = LEADRasterView.HScrollInfo.Pos - nDelta
Else
LEADRasterView.VScrollInfo.Pos = LEADRasterView.VScrollInfo.Pos - nDelta
End If
End If
End Sub


Multiply Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Multiply LEADRasterView1.Raster, 151


MultiScaleEnhancement Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.MultiScaleEnhancement LEADRasterView1.Raster, 2000, 4, _
MSE_DEFAULT, 0, 0, MSE_GAUSSIAN Or MSE_EDGEENH


NumberFramesInOverlay example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim strOut As String

RasterProc.GetOverlayAttributes LEADRasterView1.Raster, 0, OVERLAYATTRIBUTES_FLAGS

MsgBox "NumberFramesInOverlay =" + Str(RasterProc.OverlayAttributes.NumberFramesInOverlay) + Chr(13) + _
"BitsAllocated = " + Str(RasterProc.OverlayAttributes.ImageFrameOrigin) + Chr(13) + _
"Description =" + RasterProc.OverlayAttributes.ActivationLayer


Ocean Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Ocean LEADRasterView1.Raster, 20, 6, True


ODBC Example for Visual Basic

Take the following steps to create and use a simple ODBC database, containing only images. (For a more sophisticated approach, refer to Using ODBC to Access Image Data.)

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Make a copy of the project that you created in Loading and Displaying an Image; then load the copied project.
2. | In the Add-Ins menu, select the Data Manager...
3. | In the Data Manager Window's File menu, select New, and create an Access database named c:\lead\lead.mdb.
4. | Click the New button, and create a table with one field as follows:
 | Name: | ltvbpic
 | Field Name: | photo
 | Data Type: | long binary
5. | Add the following LEAD Raster objects to your project,
 | a. LEADRasterODBC Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
 | b. LEADRasterProcess Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
6. | Add the following statment to your public section:

Public RasterODBC As New LEADRasterODBC

7. | Exit the Data Manager.
8. | Open the ODBC administrator and click the Add button.
9. | Select Microsoft Access driver and click the OK button.
10. | Enter the name LEADACCESS.
11. | Click the Select directory button and select the LEAD directory.
12. | Click the OK button; click the next OK button; then click the Close button.
13. | In Visual Basic, replace the code in the main form's init procedure as follows:

'Position and size the main form so that it takes up most of the screen.
Width = Screen.Width * 0.9
Height = Screen.Height * 0.8
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
' Set the position and size of the LEAD control.
' Allow for a border of 1/8 of the form size.
' The units of measure do not matter, since we are calculating proportions.
HeightAllowed = ScaleHeight * 3 / 4
WidthAllowed = ScaleWidth * 3 / 4
LEADRasterView1.Left = (ScaleWidth - WidthAllowed) / 2
LEADRasterView1.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = HeightAllowed
'Turn off automatic repainting and turn on scroll bars.
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = True
'Set the image display size to match the LEADRasterView control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
' Open the database.
RasterODBC.Raster = LEADRasterView1.Raster
DString = "ODBC;DSN=LEADACCESS"
RasterODBC.dbOpen DString, "ltvbpic", "photo", DB_OPENOPTIONS_NONE
RasterODBC.dbLoadBits = 24
RasterODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
LEADRasterView1.ForceRepaint
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
End If

14. | Add a common dialog control to your main form and name it Commdlg.
15. | At the top of your main form, add seven command buttons and name them as follows: Add, Update, Delete, FirstRec, NextRec, PrevRec, and LastRec.
16. | For the Add button, add the following code to the click procedure:

Dim RasterIO As New LEADRasterIO
If RasterODBC.dbCanAppend = False Then
msg = "You cannot add to this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbAddNew
CommDlg.Filter = "All Files|*.*"
CommDlg.Flags = cdlOFNFileMustExist
CommDlg.DialogTitle = "Open File"
CommDlg.CancelError = True
CommDlg.ShowOpen
filename = CommDlg.filename
RasterIO.Load LEADRasterView1.Raster, filename, 0, 0, 1
RasterODBC.Raster = LEADRasterView1.Raster
nret = RasterODBC.dbUpdate(FILE_CMP, 0, QFACTOR_QMS)
If nret <> 0 Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbMoveLast
LEADRasterView1.ForceRepaint
msg = "Image added to the database."
answer = MsgBox(msg, 0, "LEAD")
NextRec.Enabled = True
PrevRec.Enabled = True
If RasterODBC.dbIsBOF = True Then
PrevRec.Enabled = False
Else
PrevRec.Enabled = True
End If
If RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
Else
NextRec.Enabled = True
End If
End If
End If

17.

For the Update button, add the following code to the click procedure:

Dim RasterProc As New LEADRasterProcess
If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
If RasterODBC.dbEditMode = DB_EDITMODE_NONE Then
RasterODBC.dbEdit
RasterProc.Flip LEADRasterView1.Raster
LEADRasterView1.ForceRepaint
End If
RasterODBC.dbUpdate FILE_CMP, 0, QFACTOR_QMS
End If

18.

For the Delete button, add the following code to the click procedure:

If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbDelete
RasterODBC.dbRequery
RasterODBC.dbMoveFirst
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
PrevRec.Enabled = False
End If
LEADRasterView1.ForceRepaint
End If

19.

For the First button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveFirst
PrevRec.Enabled = False
NextRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

20.

For the Next button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMoveNext
If RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
RasterODBC.dbMovePrev
msg = "Already at last record."
answer = MsgBox(msg, 0, "Notice")
Else
PrevRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

21.

For the Prev button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMovePrev
If RasterODBC.dbIsBOF = True Then
PrevRec.Enabled = False
RasterODBC.dbMoveNext
msg = "Already at first record."
answer = MsgBox(msg, 0, "Notice")
Else
NextRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

22.

For the Last button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveLast
NextRec.Enabled = False
PrevRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

23.

Update the main form's unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
RasterODBC.dbClose
End Sub

24.

Run your program to test it.


Offset Example for Visual Basic

Dim HShift As Integer
Dim VShift As Integer
Dim RasterProc As New LEADRasterProcess
HShift = LEADRasterView1.Raster.BitmapWidth / 2
VShift = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Offset LEADRasterView1.Raster, _
HShift, _
VShift, _
0, _
OFFSET_FILL_WRAP


Oilify example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies an oil-painting effect and repaints the image. The progress event is enabled because this the Oilify method, with a neighborhood of 10, is slow.

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess
'.....
Set RasterProc = New LEADRasterProcess
RasterProc.EnableProgressEvent = True
RasterProc.Oilify LEADRasterView1.Raster, 10
LEADRasterView1.ForceRepaint

Private Sub RasterProc_ProgressStatus(ByVal iPercent As Integer)
Me.Caption = CStr(iPercent)
End Sub


OLECompleteDrag Example for Visual Basic

Private Sub LEADRasterView2_OLECompleteDrag(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim str As String

str = "LEADRasterView2: OLE Complete Drag at pos X = " + CStr(x) + " and pos y = " + CStr(y)
MsgBox str
End Sub

Private Sub LEADRasterView2_OLEDragOver(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim str As String

str = "LEADRasterView2: OLE Drag Over at pos X = " + CStr(x) + " and pos y = " + CStr(y)
MsgBox str
End Sub

Private Sub LEADRasterView2_OLEStartDrag(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim str As String

str = "LEADRasterView2: OLE Start Drag at pos X = " + CStr(x) + " and pos y = " + CStr(y)
MsgBox str
End Sub


OLEStartDrag (ILEADRasterImgList) example for Visual Basic

Option Explicit
Public WithEvents LEADThumb1 As LEADRasterThumbnail
Dim x As Integer
Dim strHistory As String

Private Sub FillThumbs_Click()
Set LEADThumb1 = New LEADRasterThumbnail
Screen.MousePointer = vbHourglass
LEADThumb1.Filter = "*.jpg"
LEADThumb1.EnableMethodErrors = False
LEADThumb1.ThumbnailWidth = 150
LEADThumb1.ThumbnailHeight = 150
LEADThumb1.MaintainAspect = True
LEADThumb1.ForceSize = False
LEADThumb1.Resample = False
LEADThumb1.StopOnError = False
LEADThumb1.LoadStamp = False
LEADThumb1.IncludeSubDirectories = False
LEADThumb1.ExpandMultipage = False
LEADThumb1.ThumbnailBitsPerPixel = 24
LEADThumb1.MaxSizeMem = 0 'set a size limit
LEADThumb1.BrowseDir App.Path
Screen.MousePointer = vbDefault
End Sub

Private Sub History_Click()
MsgBox strHistory
End Sub

Private Sub LEADImgList1_OLECompleteDrag(ByVal
 Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As
 Long)
strHistory = strHistory + "Drag Complete for Item#"
 + Str(LEADImgList1.HitTest(x, y)) + Chr(10)
End Sub

Private Sub LEADImgList1_OLEDragOver (ByVal Button
 As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
strHistory = strHistory + "Drag Over Item#"
 + Str(LEADImgList1.HitTest(x, y)) + Chr(10)
End Sub

Private Sub LEADImgList1_OLEGiveFeedback ()
LEADImgList1.EnableUseDefaultCursor
 = False
End Sub

Private Sub LEADImgList1_OLEStartDrag (ByVal
 Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As
 Long)
strHistory = strHistory + "Drag Start for Item#"
 + Str(LEADImgList1.HitTest(x, y)) + Chr(10)
End Sub

Private Sub LEADImgList2_OLEGiveFeedback ()
LEADImgList2.EnableUseDefaultCursor = False
End Sub

Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename
 As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
If (nStatusCode = BROWSE_LOADING Or nStatusCode = BROWSE_PRELOAD)
 Then GoTo EVENTOUT 'loading a file

If (nStatusCode = 0) Then
AddItem pszFilename,
 Bitmap, LEADThumb1.InfoFormat, LEADThumb1.InfoWidth, LEADThumb1.InfoHeight,
 LEADThumb1.InfoBits, LEADThumb1.InfoCompression, LEADThumb1.InfoTotalPages,
 LEADThumb1.InfoSizeDisk, LEADThumb1.InfoSizeMem, LEADThumb1.InfoXRes,
 LEADThumb1.InfoYRes
End If

EVENTOUT:
LEADThumb1.ContinueBrowse = True
End Sub
Private Sub Form_Load()
LEADImgList1.DisplayItemText = True
LEADImgList1.ScrollStyle = IMGLST_SCROLLSTYLE_VERTICAL
LEADImgList1.ItemHeight = 150
LEADImgList1.ItemWidth = 150
LEADImgList1.AllowSelection = IMGLST_ALLOWSELECTION_MULTI

LEADImgList2.DisplayItemText = True
LEADImgList2.ScrollStyle = IMGLST_SCROLLSTYLE_VERTICAL
LEADImgList2.ItemHeight = 150
LEADImgList2.ItemWidth = 150
LEADImgList2.AllowSelection = IMGLST_ALLOWSELECTION_MULTI
End Sub
Private Sub AddItem(pszFilename As String, Bitmap As Long, InfoFormat As
 Integer, InfoWidth As Integer, InfoHeight As Integer, InfoBits As Integer,
 InfoCompression As String, InfoTotalPages As Integer, InfoSizeDisk As
 Long, InfoSizeMem As Long, InfoXRes As Integer, InfoYRes As Integer)
LEADImgList1.Insert Bitmap, pszFilename, 1
LEADImgList1.EnsureVisible (LEADImgList1.Count - 1)
End Sub

Private Sub StartDrag_Click()
LEADImgList1.EnableOLEDragMethod
 = True
LEADImgList2.EnableOLEDragMethod = True

LEADImgList1.OLEDragCursor = Me.MouseIcon
LEADImgList2.OLEDragCursor = Me.MouseIcon
End Sub

Private Sub StopDrag_Click()
LEADImgList1.EnableOLEDragMethod
 = False
LEADImgList2.EnableOLEDragMethod = False
End Sub


OLEDropAllowed example for Visual Basic

Note: Also works with Access 95 and 97.

This example toggles the OLEDropAllowed property.

LEADRasterView1.OLEDropAllowed = Not LEADRasterView1.OLEDropAllowed


OLEDropFile example for Visual Basic

This example displays the name of the file that was dropped, and then loads it.

Private Sub LEADRasterView1_OleDropFile(ByVal pszName As String)
Dim RasterIO As New LEADRasterIO

' when a file is dropped, bring up a dialog box and ask the user
' whether to load the file or not
If MsgBox(pszName, vbYesNo) = vbYes Then
RasterIO.Load LEADRasterView1.Raster, pszName, 0, 1, 1
Else
MsgBox "File Not Loaded!"
End If
End Sub


OptimizeBuffer Example for Visual Basic

Dim WithEvents ImageOptmizer As LEADRasterImgOpt

Private Sub ImageOptmizer_OnOptimize(ByVal nPercent As Integer)
MsgBox nPercent, , "Optimizing"
End Sub

Private Sub Optimize_Click()
Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
Dim OrgData As New LEADRasterVariant
Dim OptData As LEADRasterVariant
Dim OptimizeOptions As LEADOptimizeOptions

RasterIO.Load LEADRasterView1.Raster, "c:\slices\eye.gif", 0, 0, 1
Set OrgData = RasterIO.SaveArray(LEADRasterView1.Raster, FILE_JPEG, 24, QFACTOR_LEAD_0)
Set OptimizeOptions = ImageOptmizer.DefaultOptions

OptimizeOptions.Distance= 1
OptimizeOptions.JPEGColorSpace = JPEG_COLOR_SPACE_422
OptimizeOptions.Percent = 50
OptimizeOptions.PickSamePalette = True
OptimizeOptions.PNGQFactor = 8
OptimizeOptions.JPEGQFactor = 128

nRet = ImageOptmizer.OptimizeBuffer(OrgData, OptData, OptimizeOptions, True)

If (nRet = 0) Then
RasterIO.LoadArray LEADRasterView2.Raster, OptData, 0, 0, -1, OptData.ItemCount
End If


OptimizeDir Example for Visual Basic

Dim WithEvents ImageOptmizer As LEADRasterImgOpt
Private Sub ImageOptmizer_OnOptimizeDir()
Static FileCount As Integer

Select Case ImageOptmizer.DirectoryInfo.StatusCode
Case OPTIMIZE_SUCCESS
MsgBox "Operation Successfully Done"

Case OPTIMIZE_DIR_PRE_OPTIMIZING_IMAGE
MsgBox "Operation Successfully Done", , "Note"

Case OPTIMIZE_DIR_OPTIMIZING_IMAGE
With ImageOptmizer.DirectoryInfo
MsgBox Str(.FilePercent) + "% of optimizing " + _
.OrginalFileName + " to " + .OptimizedFileName + Chr(10) _
+ " Files " + Str(FileCount + 1) + " of " + Str(.TotalFolderFilesCount) _
+ " Total Percent " + Str(.TotalPercent) + "% Percent " + Str(.OptimizeOptions.Percent)

If ((.FilePercent = 100) And ((FileCount + 1) <= .TotalFolderFilesCount)) Then
FileCount = FileCount + 1
End If
End With

Case Else
Dim nRet As Integer
With ImageOptmizer.DirectoryInfo
nRet = MsgBox("Error: " + Str(.StatusCode) + " - Optimizing Image!" + Chr(10) + _
.OrginalFileName + Chr(10) + _
"Press OK to skip this file and optimize the next one!", vbOKCancel, "Error")

If (nRet = vbOK) Then
ImageOptmizer.OptimizingError = ERROR_OPT_SKIPIMAGE
Else
ImageOptmizer.OptimizingError = ERROR_OPT_ABORT
End If
End With
End Select
End Sub

Private Sub OptimizeDir_Click()
Dim Options As New LEADOptimizeOptions
Set Options = ImageOptmizer.DefaultOptions
ImageOptmizer.EnableMethodErrors = False
ImageOptmizer.OptimizeDir "c:\Org", "C:\Opt", Options, "*.jpg;*.bmp;*.tmp", True, True
End Sub


OriginX example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.GetOverlayAttributes LEADRasterView1.Raster, 0, OVERLAYATTRIBUTES_FLAGS
MsgBox "Origin(x,y) : (" + Str(RasterProc.OverlayAttributes.OriginX) + "," + Str(RasterProc.OverlayAttributes.OriginY) + ")"


OwnerDrawItem event example for Visual Basic

Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Sub LEADRasImgList1_OwnerDrawItem(ByVal nIndex As Long, ByVal hDC As Long, ByVal ItemLeft As Single, ByVal ItemTop As Single, ByVal ItemRight As Single, ByVal ItemBottom As Single, ByVal ItemBackLeft As Single, ByVal ItemBackTop As Single, ByVal ItemBackRight As Single, ByVal ItemBackBottom As Single)
'use Windows GDI to custom paint the items
'make sure you have previously set ScaleMode to Pixels (3) so
'that you get these values in Pixels rather than Twips!!!!!!!
'ex. LEADRasImgList1.ScaleMode = 3 'pixels

Dim szText As String
szText = LEADRasImgList1.Item(nIndex).Text

Ellipse hDC, ItemLeft, ItemTop, ItemRight, ItemBottom
TextOut hDC, ItemLeft, ItemTop, szText, Len(szText)
End Sub


OwnerDrawItems example for Visual Basic

'toggle OwnerDraw
LEADRasImgList1.OwnerDrawItems = Not LEADRasImgList1.OwnerDrawItems


Paint event example for Visual Basic

This example uses some Windows API functions to demonstrate the following:

Paint event

Click event

Enabled property

Window property

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Insert menu, select the Module option, and use the API Text Viewer to add the following Windows API defines:

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

3.

Add global variables for MyRect and MyPoint as shown in the following code:

Private MyRect As RECT
Private MyPoint As POINTAPI

4. | Close the code module.
5. | Return to Form1, add a command button to the top of your main form, and in the properties box, change both its name and caption to Toggle.
6. | Add a text box to the top of your form, and in the properties box, change its name to Directions, and change its Text property to the following:

Use the Toggle button to turn on or turn off Click-Splat

7.

Add the following code to the Toggle button's Click procedure. This code uses the Enabled property to toggle the LEAD RasterView control's ability to respond to click events.

If (LEADRasterView1.Enabled = False) Then
LEADRasterView1.Enabled = True
Directions.Text = "Click on the image for a splat"
Toggle.Caption = "Disable"
Else
LEADRasterView1.Enabled = False
Directions.Text = "Click does nothing"
Toggle.Caption = "Enable"
End If

8.

Add the following code to the LEADRasterView1 Click procedure. When the Enabled property is true, this code uses a Windows API call to generate a paint event.

Dim hCtl As Long
Dim SavedMode As RasterScaleModeConstants
' Use pixels for API calls
SavedMode = LEADRasterView1.ScaleMode
LEADRasterView1.ScaleMode = 3 'Pixels
' Use InvalidateRect to generate a paint message
MyRect.Left = 0
MyRect.Top = 0
MyRect.Bottom = LEADRasterView1.ScaleHeight
MyRect.Right = LEADRasterView1.ScaleWidth
hCtl = LEADRasterView1.Window
InvalidateRect hCtl, MyRect, True
' Set the ScaleMode back to the default
LEADRasterView1.ScaleMode = SavedMode

9.

Add the following code to the LEADRasterView1 Paint procedure. It uses Windows GDI functions to draw random lines on the control whenever there is a paint event.

Private Sub LEADRasterView1_Paint(ByVal hDC As Long)
Dim LeadClientDC As Long
Dim xStart As Long
Dim yStart As Long
Dim MyReturn As Long
Dim xDelta As Long
Dim yDelta As Long
Dim xEnd As Long
Dim yEnd As Long
Dim i As Long
MyPoint.x = 0
MyPoint.y = 0
' Create a device context for the control that the GDI functions can access
LeadClientDC = LEADRasterView1.GetClientDC
' Draw random lines on the control. This overlay does not affect the bitmap.
xStart = CLng((Rnd(1) * LEADRasterView1.ScaleWidth) + 1)
yStart = CLng((Rnd(1) * LEADRasterView1.ScaleHeight) + 1)
MyReturn = MoveToEx(LeadClientDC, xStart, yStart, MyPoint)
For i = 1 To 50
xDelta = CLng(81 * Rnd(1)) - 40
yDelta = CLng(81 * Rnd(1)) - 40
xEnd = xStart + xDelta
yEnd = yStart + yDelta
MyReturn = LineTo(LeadClientDC, xEnd, yEnd)
MyReturn = MoveToEx(LeadClientDC, xStart, yStart, MyPoint)
Next
' Remove the lock from the device control
LEADRasterView1.ReleaseClientDC
End Sub

10.

Run your program to test it.


PaintContrast example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the contrast for painting images.

LEADRasterView1.PaintContrast = LEADRasterView1.PaintContrast + 100
LEADRasterView1.ForceRepaint


PaintDither (ILEADRasterImgList) example for Visual Basic

'set the control to use error diffusion
LEADImgList1.PaintDither = IMGLST_PAINTDITHER_DIFFUSION


PaintDither example for Visual Basic

Note: Also works with Access 95 and 97.

This example turns on error diffusion and redisplays the bitmap.

LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.ForceRepaint


PaintEffect example for Visual Basic

The following modules use the KeyDown and KeyUp events to repaint the image with effects.

'don't forget to include L_OCXEFX.BAS
Private Sub LEADRasterView1_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
If KeyCode = 116 Then 'Code for F5
LEADRasterView1.AutoRepaint = False
LEADRasterView1.BackErase = True
LEADRasterView1.EffectGrain = 20
LEADRasterView1.EffectDelay = 50
LEADRasterView1.WandSize = 5
LEADRasterView1.WandColor = RGB(255,255,0) 'Yellow Wand
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_L_TO_R
LEADRasterView1.ForceRepaint
End If
End Sub
Private Sub LEADRasterView1_KeyUp(ByVal KeyCode As Integer, ByVal Shift As Integer)
If KeyCode = 116 Then 'Code for F5
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_R_TO_L
LEADRasterView1.ForceRepaint
LEADRasterView1.PaintEffect = EFX_EFFECT_NONE
End If
End Sub


PaintEffectMaxPasses example for Visual Basic

Note: Also works with Access 95 and 97.

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

'don't forget to include L_OCXEFX.BAS
Private Sub StartEffect_Click()
Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN 'Set the Effect
LEADRasterView1.PaintEffectMaxPasses = 5 '5 total passes
LEADRasterView1.PaintEffectPass = 1 'Start with pass number 1
LEADRasterView1.PaintNotificationDelay = 200 'Delay 200 milliseconds between passes
RasterIO.Load LEADRasterView1.Raster, "d:\temp\240bit.bmp", 0, 0, 1 'Load the image
LEADRasterView1.AutoRepaint = True
End Sub

Private Sub LEADRasterView1_PaintNotification(ByVal uPass As Integer, ByVal uType As Integer)
'If the first pass is complete
If ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) Then
'Toggle the effect from left_to_right to right_to_left
If LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN Then
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
Else
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN
End If
End If
End Sub


PaintGamma example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the gamma correction for painting images.

LEADRasterView1.PaintGamma = LEADRasterView1.PaintGamma + 100
LEADRasterView1.ForceRepaint


PaintIntensity example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the intensity for painting images.

LEADRasterView1.PaintIntensity = LEADRasterView1.PaintIntensity+ 100
LEADRasterView1.ForceRepaint


PaintPalette example for Visual Basic

This example sets the paint palette to the palette of each Lead control. It then loads two images and dithers them to 8 bits per pixel with optimized palettes, and displays them side by side. In 8-bit display mode, you can see the palette problems that result when you do not use a fixed palette.

Dim HeightFactor1
Dim WidthFactor1
Dim HeightFactor2
Dim WidthFactor2
Dim HeightAllowed
Dim WidthAllowed
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView2.PaintPalette = PAINTPALETTE_AUTO
'Disable automatic repainting of the image.
LEADRasterView1.AutoRepaint = False
LEADRasterView2.AutoRepaint = False
'Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll = False
LEADRasterView2.AutoScroll = False
'Clear the bitmaps from memory
LEADRasterView1.Raster.Bitmap = 0
LEADRasterView2.Raster.Bitmap = 0
Screen.MousePointer = 11 'Hourglass
'Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO.Load LEADRasterView1.Raster, "d:\temp\24bit.bmp", 0, 0, 1
RasterIO.Load LEADRasterView2.Raster, "d:\temp\24bit2.bmp", 0, 0, 1
'Change the bitmaps to 8 BPS with optimized palettes
RasterProc.ColorRes LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0
RasterProc.ColorRes LEADRasterView2.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0
'Make the controls visible so that we can size and position them.
'They will not really appear until we load an image and paint it.
LEADRasterView1.Visible = True
LEADRasterView2.Visible = True
'Set the variables used for preserving the aspect ratio.
HeightFactor1 = LEADRasterView1.Raster.BitmapHeight
WidthFactor1 = LEADRasterView1.Raster.BitmapWidth
HeightFactor2 = LEADRasterView2.Raster.BitmapHeight
WidthFactor2 = LEADRasterView2.Raster.BitmapWidth
HeightAllowed = ScaleHeight * 0.8
WidthAllowed = ScaleWidth * 0.45
'Center each LEAD control on half of the form, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed Then
LEADRasterView1.Left = (ScaleWidth / 4) - (WidthAllowed / 2)
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor1) / WidthFactor1
LEADRasterView1.Top = (ScaleHeight - LEADRasterView1.Height) / 2
Else
LEADRasterView1.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView1.Height = HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor1) / HeightFactor1
LEADRasterView1.Left = (ScaleWidth / 4) - (LEADRasterView1.Width / 2)
End If
If (WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed Then
LEADRasterView2.Left = (ScaleWidth * 3 / 4) - (WidthAllowed / 2)
LEADRasterView2.Width = WidthAllowed
LEADRasterView2.Height = (LEADRasterView2.Width * HeightFactor2) / WidthFactor2
LEADRasterView2.Top = (ScaleHeight - LEADRasterView2.Height) / 2
Else
LEADRasterView2.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView2.Height = HeightAllowed
LEADRasterView2.Width = (LEADRasterView2.Height * WidthFactor2) / HeightFactor2
LEADRasterView2.Left = (ScaleWidth * 3 / 4) - (LEADRasterView2.Width / 2)
End If
'Set the image display sizes to match the LEAD controls
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView2.SetDstRect 0, 0, LEADRasterView2.ScaleWidth, LEADRasterView2.ScaleHeight
LEADRasterView2.SetDstClipRect 0, 0, LEADRasterView2.ScaleWidth, LEADRasterView2.ScaleHeight
'Display the images
LEADRasterView1.ForceRepaint
LEADRasterView2.ForceRepaint
Screen.MousePointer = 0 ' Default


PaintROP3 example for Visual Basic

This example demonstrates the PaintROP3 property.

' Add this WIN32 constant to the Declarations module
Private Const SRCINVERT = 6684742
' Use this code to paint an inverted image.
LEADRasterView1.PaintROP3 = SRCINVERT
LEADRasterView1.ForceRepaint


PaintScaling (ILEADRasterImgList) example for Visual Basic

'toggle through the paint scale modes
Select Case LEADImgList1.PaintScaling
Case IMGLST_PAINTSCALING_NORMAL
LEADImgList1.PaintScaling = IMGLST_PAINTSCALING_RESAMPLE
Text1.Text = "Resample"
Case IMGLST_PAINTSCALING_RESAMPLE
LEADImgList1.PaintScaling = IMGLST_PAINTSCALING_BICUBIC
Text1.Text = "Bicubic"
Case IMGLST_PAINTSCALING_BICUBIC
LEADImgList1.PaintScaling = IMGLST_PAINTSCALING_NORMAL
Text1.Text = "Normal"
End Select
'force redraw
LEADImgList1.Visible = False
LEADImgList1.Visible = True


PaintScaling Example for Visual Basic

' This example sets the display to use bilinear interpolation
LEADRasterView1.PaintScaling = PAINTSCALING_RESAMPLE


PaintSizeMode Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to set the PaintSizeMode property so that the control uses only a vertical scroll bar.

LEADRasterView1.AutoScroll = True
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FITSIDES
LEADRasterView1.ForceRepaint


PaintSizeUseDPI example for Visual Basic

Note: Also works with Access 95 and 97.

This example toggles the PaintSizeUseDPI property.

LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_NORMAL
LEADRasterView1.PaintSizeUseDPI = Not LEADRasterView1.PaintSizeUseDPI


PaintTransitionMaxPasses example for Visual Basic

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

'don't forget to include L_OCXEFX.BAS
Private Sub StartEffect_Click()
Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN 'Set the Effect
LEADRasterView1.EffectDelay = 100
LEADRasterView1.PaintTransitionMaxPasses = 5 '5 total passes
LEADRasterView1.PaintTransitionPass = 1 'Start with pass number 1
LEADRasterView1.PaintNotificationDelay = 200 'Delay 200 milliseconds between passes
RasterIO.Load LEADRasterView1.Raster, "d:\temp\240bit.bmp", 0, 0, 1 'Load the image
LEADRasterView1.AutoRepaint = True
End Sub

Private Sub LEADRasterView1_PaintNotification(ByVal uPass As Integer, ByVal uType As Integer)
'If the first pass is complete
If ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) Then
'Toggle the effect from left_to_right to right_to_left
If LEADRasterView1.TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_IN Then
LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
Else
LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_IN
End If
End If
End Sub


PaintWhileLoad example for Visual Basic

Note: Also works with Access 95 and 97.

This example causes the LEAD RasterView control to paint the image as it loads.

Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
LEADRasterView1.PaintWhileLoad = True
RasterIO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\image2.cmp", 0, 0, 1


PaintZoomFactor Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to set the PaintZoomFactor property so that image is scaled 200 percent for display.

LEADRasterView1.AutoScroll = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM
LEADRasterView1.PaintZoomFactor = 200
LEADRasterView1.ForceRepaint


Password example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Message = "Lead tools"
RasterProc.Password = "password"
RasterProc.AddMessage LEADRasterView1.Raster


PatternStyle (ILEADRasterFXD) example for Visual Basic

Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD

LEADRasterView1.AutoRepaint = False
'Load an image for the main control
LeadRasIO.Load LEADRasterView1.Raster, "v:\images\babe.cmp", 0, 0, 1
'Shape background
RasterFxd.ShapeBackgroundStyle = FXD_BACKSTYLE_OPAQUE
RasterFxd.PatternStyle = FXD_PATTERN_CROSS
RasterFxd.PatternBackColor = RGB(255, 0, 0) 'red
RasterFxd.PatternForeColor = RGB(0, 0, 255) 'blue
'Shape location
RasterFxd.ShapeTop = 50
RasterFxd.ShapeLeft = 50
RasterFxd.ShapeWidth = LEADRasterView1.DstWidth - 50
RasterFxd.ShapeHeight = LEADRasterView1.DstHeight - 50
'Make the shape a permanent part of the bitmap
RasterFxd.DrawPersistence = True
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.DstBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
RasterFxd.ScaleMode = 3
RasterFxd.ClientSizeX = 5
RasterFxd.ClientSizeY = 5
'Draw the shape
RasterFxd.DrawShape LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, 0
'Repaint
LEADRasterView1.AutoRepaint = True


PatternStyle example for Visual Basic

Note: Also works with Access 95 and 97.

This example paints a transition with a diagonal cross pattern.

Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.TransitionDelay = 50
RasterIO.Load LEADRasterView1.Raster, "c:\lead\images\image1.cmp", 0, 0, 1
LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
LEADRasterView1.TransitionStyle = EFX_TRANSITION_PATTERN
LEADRasterView1.PatternStyle = EFX_PATTERN_DIAG_CROSS
LEADRasterView1.PatternBackColor = RGB(255, 0, 0)
LEADRasterView1.PatternForeColor = RGB(0, 0, 255)
LEADRasterView1.AutoRepaint = True


PCDRes example for Visual Basic

This example checks for a high resolution image and loads it if possible.

myfile = "v:\images\img0024.pcd" 'No PCD sample image is included with LEADTOOLS
Dim RasterIO As New LEADRasterIO
Dim Msg
RasterIO.GetFileInfo LEADRasterView1.Raster, "s:\temp\images\pcd\_aiwanit.pcd", 0, 0
If RasterIO.InfoPCDRes(PCDRES_4BASE) = True Then
RasterIO.PCDRes = PCDRES_4BASE
Msg = "Loading 1024 x 1536 resolution"
Else
RasterIO.PCDRes = PCDRES_BASE
Msg = "Loading 512 x 768 resolution"
End If
MsgBox Msg
MousePointer = 11 ' hourglass
'Turn on the automatic display rectangles and the scroll bars.
LEADRasterView1.AutoSetRects = True
LEADRasterView1.AutoScroll = True
'Load the file.
RasterIO.Load LEADRasterView1.Raster, "s:\temp\images\pcd\_aiwanit.pcd", 0, 0, 1
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default


PDFCompInsertNormal Example for Visual Basic

Dim WithEvents LeadPDFComp As LEADPDFCompressor
Dim Factory As New LEADRasterFactory
Dim Raster As LEADRaster
Dim RasterIO As New LEADRasterIO
Dim gszLic As String

Private Sub Form_Load()
gszLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LeadPDFComp = New LEADPDFCompressor

Set Raster = Factory.CreateObject ("LEADRaster.LEADRaster", gszLic)

RasterIO.Load Raster, "C:\Image.cmp", 0, 0, 1

LeadPDFComp.PDFCompInit False
LeadPDFComp.PDFCompInsertNormal Raster
LeadPDFComp.PDFCompWrite "C:\Output.pdf"
LeadPDFComp.PDFCompFree

End Sub


PDFCompInsertMRC Example for Visual Basic

Dim WithEvents LeadPDFComp As LEADPDFCompressor
Dim Factory As New LEADRasterFactory
Dim Raster As LEADRaster
Dim RasterIO As New LEADRasterIO
Dim gszLic As String

Private Sub Click_Click()

gszLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LeadPDFComp = New LEADPDFCompressor

Set Raster = Factory.CreateObject("LEADRaster.LEADRaster", gszLic)
RasterIO.Load Raster, "C:\Image.CMP", 0, 0, 1

LeadPDFComp.EnableMethodErrors = False

LeadPDFComp.PDFCompInit True

LeadPDFComp.PDFCompSetCompression PDFCOMP_1BIT_COMPRESSION_TYPE_ENABLED + PDFCOMP_2BIT_COMPRESSION_TYPE_ENABLED + PDFCOMP_PICTURE_COMPRESSION_TYPE_ENABLED, PDFCOMP_1BIT_COMP_TYPE_JBIG2, PDFCOMP_2BIT_COMP_TYPE_ZIP, PDFCOMP_PICTURE_COMP_TYPE_JPEG, 50

LeadPDFComp.ImageQuality = PDFCOMPIMAGEQUALITY_USER
LeadPDFComp.OutputQuality = PDFCOMPOUTPUTQUALITY_USER

LeadPDFComp.CleanSize = 7
LeadPDFComp.Flags = PDFCOMP_FAVOR_ONE_BIT + PDFCOMP_WITHBACKGROUND
LeadPDFComp.SegmentQuality = 50
LeadPDFComp.ColorThreshold = 25
LeadPDFComp.BackGroundThreshold = 15
LeadPDFComp.CombineThreshold = 100

LeadPDFComp.PDFCompInsertMRC Raster
LeadPDFComp.PDFCompWrite "C:\Output.pdf"
LeadPDFComp.PDFCompFree

End Sub

Private Sub LeadPDFComp_OnPDFCompEvent(ByVal nPage As Long)

If nPage = 1 Then
MsgBox "Left Value of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentLeft)
MsgBox "Right Value of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentRight)
MsgBox "Top Value of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentTop)
MsgBox "Bottom Value of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentBottom)
MsgBox "Segment type of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentType)
MsgBox "Color Count of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentColorsCount)
MsgBox "Color 0 of Segment 0 = " + Str(LeadPDFComp.MRCSegmentInfo.SegmentColors (0))
End If

LeadPDFComp.EnableAddSegment = True

End Sub


PDFEncryptFlags example for Visual Basic

Dim RasterIO As New LEADRasterIO
RasterIO.PDFUserPassword = "UserPassword"
RasterIO.PDFOwnerPassword = "OwnerPassword"
RasterIO.EnablePDF128bit = True
RasterIO.PDFEncryptFlags = PDF_SECURITY_REV2_PRINTDOCUMENT
RasterIO.Save LEADRasterView1.Raster, "c:\Test.pdf", FILE_RAS_PDF, 24, _
QFACTOR_LEAD_0, SAVE_OVERWRITE


PDFInitDir example for Visual Basic

Dim RasterIO As New LEADRasterIO
Private Sub GetPDFInitDir_Click()
MsgBox RasterIO.PDFInitDir
End Sub

Private Sub SetPDFInitDir_Click()
RasterIO.PDFInitDir = "c:\Runtime PDF\PDF"
End Sub


PDFSaveLowMemory example for Visual Basic

Public Sub Save_click()
Dim IO As New LEADRasterIO
IO.PDFSaveLowMemory = True
IO.Save LEADRasterView1.Raster, "c:\temp\tmp.pdf", _
FILE_RAS_PDF_G4, 1, 1, SAVE_OVERWRITE
End Sub


PDFSaveUseDPI example for Visual Basic

Dim IO As New LEADRasterIO
'Use image DPI when saving as PDF
IO.PDFSaveUseDPI = True
'Save image as Raster PDF with CCITT G4 compression
IO.Save LEADRasterView1.Raster, "c:\temp\tmp.pdf", _
FILE_RAS_PDF_G4, 1, 1, SAVE_OVERWRITE


PDFXResolution example for Visual Basic

'This example does the following :
' 1- Changes the horizontal and vertical PDF resolutions to 150 dpi .
' 2- Sets the pixel depth to 8 .
' 3- Disables both font and graphics anti-aliasing.
' 4- Forces the PDF module to use it's own installed fonts.
' 5- Loads a PDF file using the new settings.
Dim RasterIO As New LEADRasterIO

'Unlock PDF support, you will need the actual key
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_PDF, "TestKey"

'Set horizontal resolution
RasterIO.PDFXResolution = 150
'Set vertial resolution
RasterIO.PDFYResolution = 150
'Set Display depth
RasterIO.PDFDisplayDepth = 8
' No font anti-aliasing
RasterIO.PDFTextAlpha = 1
' No graphics anti-aliasing
RasterIO.PDFGraphicsAlpha = 1
' Use fonts installed by the PDF module
RasterIO.PDFUseLibFonts = True
'Load the PDF file
RasterIO.Load LEADRasterView1.Raster, "c:\temp\Test.pdf", 0, 0, 1


Perlin Example for Visual Basic

Dim XCircle As Integer
Dim YCircle As Integer
Dim RasterProc As New LEADRasterProcess
XCircle = LEADRasterView1.Raster.BitmapWidth / 2
YCircle = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Perlin LEADRasterView1.Raster, _
0, _
10, _
8, _
50, _
RGB(0, 0, 0), _
RGB(255, 0, 0), _
XCircle, _
YCircle, _
4, _
20, _
PRL_PURE Or _
PRL_CIRCLE


Perspective Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.PerspectivePointsX(0) = LEADRasterView1.Raster.BitmapWidth * 3 / 9
RasterProc.PerspectivePointsY(0) = LEADRasterView1.Raster.BitmapWidth * 1 / 12
RasterProc.PerspectivePointsX(1) = LEADRasterView1.Raster.BitmapWidth * 3 / 4
RasterProc.PerspectivePointsY(1) = LEADRasterView1.Raster.BitmapWidth * 2 / 12
RasterProc.PerspectivePointsX(2) = LEADRasterView1.Raster.BitmapWidth * 2 / 10
RasterProc.PerspectivePointsY(2) = LEADRasterView1.Raster.BitmapWidth * 8 / 10
RasterProc.PerspectivePointsX(3) = LEADRasterView1.Raster.BitmapWidth * 10 / 11
RasterProc.PerspectivePointsY(3) = LEADRasterView1.Raster.BitmapWidth * 7 / 10

RasterProc.Perspective LEADRasterView1.Raster, RGB(255, 255, 255), PERSPECTIVE_IMAGE


Picturize example for Visual Basic

' replace the current image in the main control with an image created
' from all the images present in c:\images. Resize all images present in that directory
' to 16x16 pixels and load them all in memory before proceeding

'Declare the Raster objects WithEvents
Private WithEvents RasterProc As LEADRasterProcess

‘Create the Raster objects
Private Sub Form_Load()
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")

End Sub

LEADRasterView1.ScaleMode = SCALEMODE_TWIP
RasterProc.Picturize LEADRasterView1.Raster, _
"c:\images", _
PICTURIZE_LOADALL Or PICTURIZE_RESIZE, _
16, 16


PicturizeBitmapList example for Visual Basic

RasterProc.PicturizeBitmapList LEADRasterView1.Raster, 20, 15, 200, LEADRasterView2.Raster


PicturizeSingle example for Visual Basic

RasterIO.Load LEADRasterView2.Raster, "c:\temp\test.cmp", 0, 1, 1
RasterProc.PicturizeSingle LEADRasterView1.Raster, LEADRasterView2.Raster, 20, 15, 200


Pixel example for Visual Basic

Note: Also works with Access 95 and 97.

This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim xycolor As Long
Dim xfraction As Single
Dim yfraction As Single
Dim xPixel As Long
Dim yPixel As Long
'Translate mouse coordinates to fractions of the destination width and height.
LEADRasterView1.BackErase = False
xfraction = (x - LEADRasterView1.DstLeft) / LEADRasterView1.DstWidth
yfraction = (y - LEADRasterView1.DstTop) / LEADRasterView1.DstHeight
'convert fractions to bitmap pixel coordinates.
xPixel = (LEADRasterView1.SrcWidth * xfraction) + LEADRasterView1.SrcLeft
yPixel = (LEADRasterView1.SrcHeight * yfraction) + LEADRasterView1.SrcTop
'Make the whole line the same color as the pixel.
xycolor = LEADRasterView1.Raster.Pixel(xPixel, yPixel)
For xPixel = 0 To LEADRasterView1.Raster.BitmapWidth - 1
LEADRasterView1.Raster.Pixel(xPixel, yPixel) = xycolor
Next
LEADRasterView1.ForceRepaint
End Sub


Pixelate Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterX = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Pixelate LEADRasterView1.Raster, 5, 10, 100, CenterX, CenterY, PIX_AVR _
Or PIX_RAD _
Or PIX_WPER _
Or PIX_HPER


PixelData example for Visual Basic

' This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

Private Sub LEADRasterView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Dim RasterVar As New LEADRasterVariant
Dim xfraction As Single
Dim yfraction As Single
Dim xPixel As Long
Dim yPixel As Long
'In VB, you get TWIPS; so set the scale mode accordingly.
LEADRasterView1.Raster.ScaleMode = SCALEMODE_TWIP
'Translate mouse coordinates to fractions of the destination width and height.
xfraction = (x - LEADRasterView1.DstLeft) / LEADRasterView1.DstWidth
yfraction = (y - LEADRasterView1.DstTop) / LEADRasterView1.DstHeight

'Set the scale mode to pixels and convert fractions to bitmap pixel coordinates.
LEADRasterView1.Raster.ScaleMode = SCALEMODE_PIXEL
xPixel = (LEADRasterView1.SrcWidth * xfraction) + LEADRasterView1.SrcLeft
yPixel = (LEADRasterView1.SrcHeight * yfraction) + LEADRasterView1.SrcTop
'Make the whole line the same color as the pixel.
RasterVar = LEADRasterView1.Raster.PixelData(xPixel, yPixel)
'disable repainting
LEADRasterView1.AutoRepaint = False
For xPixel = 0 To LEADRasterView1.Raster.BitmapWidth - 1
LEADRasterView1.Raster.PixelData(xPixel, yPixel) = RasterVar
Next
' re-enable repainting
LEADRasterView1.AutoRepaint = True
LEADRasterView1.ForceRepaint
End Sub


Plane Example for Visual Basic

Dim CenterX, CenterY As Integer

CenterX = LEADRasterView1.Raster.BitmapWidth
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.Plane LEADRasterView1.Raster, CenterX, CenterY, 0, CenterY * 2, _
CenterX / 2, -1, 0, 25, 0, 100, 20000, RGB(255, 0, 0), RGB(0, 0, 0), _
PLANE_RIGHT + PLANE_LEFT + PLANE_FILL_CLR


PlaneBend Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY As Integer

CenterX = LEADRasterView1.Raster.BitmapWidth
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.PlaneBend LEADRasterView1.Raster, CenterX, CenterY, 0, _
CenterY * 2, CenterX / 2, -1, 0, 100, 400, 0, 100, 20000, RGB(255, 0, 0), RGB(0, 0, 0), _
PLANE_DOWN OR PLANE_UP + PLANE_FILL_CLR


PlasmaFilter Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.PlasmaFilter LEADRasterView1.Raster, _
0, 0, 0, 50, 0, _
30, PLSTYP_DIAGONAL Or PLSCLR_RGB2


PLTPenColor Example for Visual Basic

Private Sub PLT_Click()
Dim iPen As Integer
Dim iWidth As Integer
Dim crColor As Long
Dim RasterIO As New LEADRasterIO

For iPen = 0 To 7
iWidth = Round(iPen / 2) + 1
Select Case iWidth
Case 1
crColor = RGB(255, 0, 0)
Case 2
crColor = RGB(0, 255, 0)
Case 3
crColor = RGB(0, 0, 255)
Case 4
crColor = RGB(255, 255, 0)
Case Else
crColor = RGB(255, 0, 255)
End Select

'Change Pen width
RasterIO.PLTPenWidth(iPen) = iWidth
'Change Pen color
RasterIO.PLTPenColor(iPen) = crColor
Next iPen

' Now load the PLT file
RasterIO.Load LEADRasterView1.Raster, "c:\image1.plt", 0, 0, 1
End Sub


Pointillist Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Pointillist LEADRasterView1.Raster, 25, _
RGB(255, 255, 255), _
POINTILLIST_COLOR Or _
POINTILLIST_POINT


Polar Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Polar LEADRasterView1.Raster, 0, FILL_RPT or CART_TO_POL


Posterize example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a six-color poster effect and redisplays the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Posterize LEADRasterView1.Raster, 6
LEADRasterView1.ForceRepaint


PreferredLoadFormat Example for Visual Basic

Dim RasterIO As New LEADRasterIO
RasterIO.PreferredLoadFormat = FILE_CMP
'....... load a file


PreLoadFilterList example for Visual Basic

Dim io As New LEADRasterIO

io.PreLoadFilters 2, 3, "XXX,ZZZ,BMP,PCX,TIF"

MsgBox io.PreLoadFilterList + " Fixed: " + _

CStr(io.PreLoadFilterFixedCount) + _

" Cached: " + CStr(io.PreLoadFilterCachedCount)


PreLoadFilters Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to pre-load filters.

Dim RasterIO As New LEADRasterIO
'preload the BMP, PCX, FAX, and TIFF filters,
'and allow 1 filter to be cached, while always
'keeping 3 loaded.
RasterIO.PreLoadFilters 3, 1, "BMP,PCX,FAX,TIF"
'..... load an image


PrinterScaleHeight Example for Visual Basic

Dim hdc As Long
MsgBox "Width: " & CStr(LEADRasterView1.PrinterScaleWidth) _
& " Height: " & CStr(LEADRasterView1.PrinterScaleHeight)
hdc = LEADRasterView1.PrintStart
'print 1/4 of the printable region
LEADRasterView1.Render hdc, 0, 0, _
LEADRasterView1.PrinterScaleWidth / 4, _
LEADRasterView1.PrinterScaleHeight / 4
LEADRasterView1.PrintEnd (hdc)


PrintNewPage Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

'change this to a file on your system
RasterIO.Load LEADRasterView1.Raster, "v:\images\babe.cmp", 0, 1, 1

'note, there will be no samples for other platforms, this function is not necessary in other languages):
' Set the variables used for preserving the aspect ratio.
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
' Allow a maximum of 3x3 inches on a 300dpi printer
HeightAllowed = 900
WidthAllowed = 900
' Print the LEAD control, preserving the aspect ratio.
' Check to see if using the maximum width will make the image too tall.
' Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
ControlWidth = WidthAllowed
ControlHeight = (ControlWidth * HeightFactor) / WidthFactor
Else
ControlHeight = HeightAllowed
ControlWidth = (ControlHeight * WidthFactor) / HeightFactor
End If

'start the print job
MyPrinter = LEADRasterView1.PrintStart
LEADRasterView1.Render MyPrinter, 0, 0, ControlWidth, ControlHeight
'flip the image
RasterProc.Flip LEADRasterView1.Raster
'start a new page
LEADRasterView1.PrintNewPage MyPrinter
'print the flipped image
LEADRasterView1.Render MyPrinter, 0, 0, ControlWidth, ControlHeight
'end the print job
LEADRasterView1.PrintEnd MyPrinter


ProgressivePasses Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to save and load a progressive file.

Dim RasterIO As New LEADRasterIO
' Save the current image as a progressive JPEG file.
RasterIO.ProgressivePasses = 8
RasterIO.Save LEADRasterView1.Raster, "d:\temp\TMP.jpg", _
FILE_JFIF, 24, _
200, SAVE_OVERWRITE
' Set properties to show progressive paints when we load.
LEADRasterView1.PaintWhileLoad = True
' Load the file we just saved.
RasterIO.ProgressivePasses = PROGRESSIVEPASSES_WHEN_MEANINGFUL
RasterIO.Load LEADRasterView1.Raster, "d:\temp\TMP.jpg", 0, 0, 1


PTKResolution Example for Visual Basic

Private Sub LoadPTK_Click()
'Set new PTK option
Dim RasterIO As New LEADRasterIO
RasterIO.PTKResolution = 120

' Now load the PTK file
RasterIO.Load LEADRasterView1.Raster, "c:\Image1.ptk", 0, 1, 1
End Sub


Punch Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Punch LEADRasterView1.Raster, 100, 100, CenterX, CenterY, RGB(0,0,0), _
FILL_RPT OR FILL_WOUTROT


PuzzleEffect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.PuzzleEffect LEADRasterView1.Raster, 10, 10, 0, _
RGB(0, 0, 0), _
PUZZLE_BORDER Or _
PUZZLE_SHUFFLE Or _
PUZZLE_COUNT Or _
BITMAP_RESIZE


RadialBlur Example for Visual Basic

Dim RasterIO as LEADRasterIO
Dim RasterProc as LEADRasterProcess

Public sub Command1_click()
Set RasterIO = New LEADRasterIO
Set RasterProc = New LEADRasterProcess

RasterIO.Load LEADRasterView1.Raster, "c:\1.bmp", 0, 0, 1
RasterProc.RadialBlur LEADRasterView1.Raster, 50, 10, 50, 50
End Sub


RadWave Example for Visual Basic

Dim RasterIO as LEADRasterIO
Dim RasterProc as LEADRasterProcess

Public sub Command1_click()
Set RasterIO = New LEADRasterIO
Set RasterProc = New LEADRasterProcess
RasterIO.Load LEADRasterView1.Raster, "c:\1.bmp", 0, 0, 1
RasterProc.RadWave LEADRasterView1.Raster, 5, 25, 0, 20, 20, 0, FILL_RPT_
_Or DIS_FRQ
End Sub


RasterizeViewMode Example for Visual Basic

' This example will set current viewport mode to L2D_USE_WIDTH_AND_HEIGHT,
' sets the current viewport size to 400*400 pixels and then loads a DXF file
Dim RasterIO As New LEADRasterIO

' Set viewport mode to L2D_USE_WIDTH_HEIGHT
RasterIO.RasterizeViewMode = L2D_USE_WIDTH_HEIGHT
' Set viewport size to 400*400 pixels
RasterIO.RasterizeViewportWidth = 400
RasterIO.RasterizeViewportHeight = 400
' Load a DXF file
RasterIO.Load LEADRasterView1.Raster, "s:\temp\images\dxf\Test.dxf", 0, 0, 1


RawLoad Example for Visual Basic

'This example loads RAW data into a LEAD control
'Raw data parameters are set in the LoadInfo event, which gets called
'when the file format is FILE_RAW, or any unrecognized file format
'The LoadInfo event obtains information through global variables

Private WithEvents RasterIO As LEADRasterIO

'Global variables used in the LoadInfo event
Dim nWidth As Integer 'width of image
Dim nHeight As Integer 'height of image
Dim nBitsPerPixel As Integer ' bits per pixel of image--if palettized, a gray palette is generated
Dim nViewPerspective As Integer 'view perspective of raw data (TOP_LEFT, BOTTOM_LEFT, etc)
Dim bOrderBGR As Integer 'TRUE if order BGR, FALSE if order RGB
Dim nOffset As Long 'offset into file where raw data begins
Dim bPadding As Boolean 'TRUE if each line of data is padded to four bytes
Dim bReverseBits As Boolean 'TRUE if the bits of each byte are reversed

Private Sub LoadRawData(szFileName As String)
Dim nRet As Integer

'Fill in the values of the global variables
'The global variables will get access in the LoadInfo event
nWidth = 294
nHeight = 415
nBitsPerPixel = 24
nViewPerspective = BOTTOM_LEFT
bOrderBGR = True
nOffset = 100
bPadding = True
bReverseBits = True

Set RasterIO = New LEADRasterIO
nRet = RasterIO.Load (LEADRasterView1.Raster, szFileName, nBitsPerPixel, 0, 1)
If (nRet = 0) Then
MsgBox ("SUCCESS file load: " & szFileName)
Else
MsgBox ("FAILED--file load: " & szFileName)
End If
End Sub

Private Sub RasterIO_LoadInfo ()
Dim nColors As Integer
Dim i As Long
Dim nGray As Long

RasterIO.LoadInfoFormat = FILE_RAW
RasterIO.LoadInfoWidth = nWidth
RasterIO.LoadInfoHeight = nHeight
RasterIO.LoadInfoBits = nBitsPerPixel
RasterIO.LoadInfoXRes = 150
RasterIO.LoadInfoYRes = 150
RasterIO.LoadInfoOffset = nOffset
RasterIO.LoadInfoFlags = 0

If (bPadding) Then
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_PAD4
End If

If (bOrderBGR = False) Then
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_ORDERRGB
End If

If (bReverseBits) Then
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_LSB
End If

Select Case nViewPerspective
Case TOP_LEFT
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT

Case BOTTOM_LEFT
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_REVERSE

Case TOP_RIGHT 'BOTTOM_LEFT180
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT180

Case BOTTOM_RIGHT 'TOP_LEFT180
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT180

Case RIGHT_TOP 'TOP_LEFT90
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT90

Case LEFT_BOTTOM 'TOP_LEFT270
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT270

Case LEFT_TOP 'BOTTOM_LEFT90
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT90

Case RIGHT_BOTTOM 'BOTTOM_LEFT270
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT270
End Select

'if image is palettized create a grayscale palette
If (nBitsPerPixel <= 8) Then
nColors = 2 ^ nBitsPerPixel
RasterIO.LoadInfoFlags = RasterIO.LoadInfoFlags Or LOADINFO_PALETTE

For i = 0 To nColors – 1
nGray = (i * 256) / nColors
RasterIO.IOPalette (i) = RGB(nGray, nGray, nGray)
Next I
End If

End Sub


RawSave Example for Visual Basic

'This example saves a LEAD bitmap as RAW data starting at offset uOffset
'The data is padded so that each line of bytes is evenly divides 4
'The bits in each byte are reversed before saving
'The Bits per pixel of the raw data is the same as the bits per pixel of pBitmap
'If pBitmap is a palettized image, the palette is not saved--only the raw data
Private Sub SaveRawData(szFileName As String, uOffset As Long)
Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
RasterIO.SaveLSB = True
RasterIO.SavePad4 = True
nRet = RasterIO.SaveOffset (LEADRasterView1.Raster, szFileName, uOffset, FILE_RAW, 0, 0, 0)
If (nRet = 0) Then
MsgBox ("SUCCESS file save: " & szFileName & " Size Written: " & RasterIO.FileSizeWritten)
Else
MsgBox ("FAILED--file save: " & szFileName)
End If
End Sub


ReadFileCommentOffset Example for Visual Basic

' The following sample will create a file with an offset and will read a comment from the file it just saved:

Public RasterIO As New LEADRasterIO
Public Raster As New LEADRaster
Public RasterVar As New LEADRasterVariant

Private Sub TestReadFileCommentOffset()
Dim nRet As Integer

' Load an existing bitmap
nRet = RasterIO.Load(Raster, "eagle.cmp", 0, 1, -1)
If nRet <> 0 Then
MsgBox "Load has failed!"
Exit Sub
End If

RasterVar.Type = VALUE_STRING
RasterVar.StringValue = "This is a 29-character string"

' set and save a comment into a file with an offset
Set RasterIO.Comment(CMNT_SZARTIST) = RasterVar

' Save the image file with an offset inside the TOFFSET.TST file
nRet = RasterIO.SaveOffset(Raster, "eagle.cmp", 30, FILE_TIF, 1, QFACTOR_LEAD_0, SAVE_OVERWRITE)

' free the bitmap
Raster.Free

' Notify the user with a message box
If nRet <> 0 Then
MsgBox "Error saving file"
Exit Sub
End If

' ***** Now load the file we just saved ****
' Get the comment size
nRet = RasterIO.ReadFileCommentOffset("eagle.cmp", 30, RasterIO.FileSizeWritten, CMNT_SZARTIST, RasterVar)
MsgBox RasterVar.StringValue
End Sub


ReadLoadResolutions Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to use the methods and properties for FlashPix files.

Dim TempStr, InfoStr As String ' For composing message strings
Dim i As Integer ' Loop counter
Dim RasterIO As New LEADRasterIO

' Initialize the display
LEADRasterView1.AutoScroll = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
RasterIO.GetFileInfo LEADRasterView1.Raster, "v:\images\image5.fpx", 0, 0
' Update information about the available resolutions.
RasterIO.ReadLoadResolutions "v:\images\image5.fpx"
' Display a message box that shows the available sizes.
InfoStr = "Available dimensions:" + Chr(13)
For i = 0 To RasterIO.LoadResolutionCount - 1
TempStr = Str(RasterIO.LoadResolutionWidth(i)) + " X " + _
Str(RasterIO.LoadResolutionWidth(i)) + Chr(13)
InfoStr = InfoStr + TempStr
Next i
MsgBox InfoStr
' Set the size to load, the smallest size in this case.
RasterIO.SetLoadResolution LEADRasterView1.Raster, _
RasterIO.InfoFormat, _
RasterIO.LoadResolutionWidth(0), _
RasterIO.LoadResolutionHeight(0)
' Get the dimensions that we just set and display them.
RasterIO.GetLoadResolution RasterIO.InfoFormat
InfoStr = "Size that will be loaded:" + Chr(13) + Chr(13)
TempStr = Str(RasterIO.LoadResolutionWidth(0)) + _
" X " + Str(RasterIO.LoadResolutionWidth(0)) + Chr(13)
InfoStr = InfoStr + TempStr
MsgBox InfoStr
' Load the bitmap, keeping the bits per pixel of the file.
RasterIO.Load LEADRasterView1.Raster, "v:\images\image5.fpx", 0, 0, 1


ReadTagMemory example for Visual Basic

Dim RasterIO As New LEADRasterIO

Private Sub ReadTagMemory_Click()
Dim RasterVar As New LEADRasterVariant
Dim nRet As Integer
Dim hMem As Long
Dim iSize As Long

RasterVar.Type = VALUE_STRING
RasterVar.StringValue = "My text string"

RasterIO.SetTag 32768, TAG_ASCII, 0, RasterVar
nRet = RasterIO.SaveMemory(LEADRasterView1.Raster, hMem, FILE_TIF, LEADRasterView1.Raster.BitmapBits, QFACTOR_LEAD_0, 0, iSize)
nRet = RasterIO.ReadTagMemory(hMem, 1, 32768, iSize)

Call GetAndDisplayTag(0)
End Sub

Private Sub GetAndDisplayTag(lTag As Long)
Dim myVar As Variant
Dim RasterVar As New LEADRasterVariant
Dim Msg$
Dim i As Long
Dim count As Long

Set RasterVar = RasterIO.GetTagData(lTag)
count = RasterIO.GetTagCount(lTag)

Msg$ = "Type = " + CStr(RasterIO.GetTagType(lTag))
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "count = " + CStr(count)
If RasterIO.GetTagType(lTag) = TAG_ASCII Then
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data = " + RasterVar.StringValue
ElseIf RasterIO.GetTagType(lTag) = TAG_RATIONAL Or _
RasterIO.GetTagType(lTag) = TAG_SRATIONAL Then '
For i = 0 To count - 1
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data(" + CStr(i) + ") = " + _
CStr(RasterVar.ShortItemValue(i * 2)) + "/" + CStr(RasterVar.ShortItemValue(i * 2 + 1))
Next i
Else
For i = 0 To count - 1
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data(" + CStr(i) + ") = " + _
CStr(RasterVar.ShortItemValue(i))
Next
End If
MsgBox Msg$
End Sub


ReadyState Example for Visual Basic

This example shows how to use the ReadyState property to test whether an asynchronous load is in progress.

Public WithEvents RasterIO As LEADRasterIO

'...... start a download
RasterIO.BitmapDataPath LEADRasterView1.Raster, "http://www.someserver.com/images/someimage.cmp"

'......
If RasterIO.ReadyState = RASTER_READYSTATE_LOADING Then
MsgBox "Still loading the image"
End If


RefBitmap example for Visual Basic

'This example demonstrates the RefBitmap property

Private Sub Command79_Click()
Dim MyRaster As LEADRaster
Set MyRaster = CreateObject("leadraster.leadraster. ")
Dim MyRasterIO As LEADRasterIO
Set MyRasterIO = CreateObject("LEADRasterIO.LEADRasterIO. ")

'Load an image into MyRaster object
MyRasterIO.Load MyRaster, "d:\work\images\rgbw.bmp", 0, 0, 1
MsgBox "MyRaster.Bitmap should be non-zero: " & MyRaster.Bitmap

'Have the LEADRasterView1 control "steal" the MyRaster bitmap
LEADRasterView1.raster.RefBitmap = True
LEADRasterView1.raster.Bitmap = MyRaster.Bitmap

'The MyRaster Bitmap has been invalidated
MsgBox "MyRaster.Bitmap should be zero: " & MyRaster.Bitmap
End Sub


RefBitmapList example for Visual Basic

' tell LEADRasterView2 to "steal" the bitmap list from LEADRasterView1
LEADRasterView2.Raster.RefBitmapList = True
' move the bitmap list from LEADRasterView1 to LEADRasterView2
LEADRasterView2.Raster.BitmapList = LEADRasterView1.Raster.BitmapList
' restore the default value for RefBitmapList
LEADRasterView2.Raster.RefBitmapList = False
' for safety, let LEADrasterview1 know that its list has been emptied
LEADRasterView1.Raster.BitmapList = 0


RemapHue example for Visual Basic

' This example changes all green hues(and hues near green) to the hue of crNewColor
Private Function Increment(x As Integer) As Integer
Increment = (x + 1) Mod 256
End Function

Private Function Decrement(x As Integer) As Integer
Decrement = (x + 255) Mod 256
End Function

Private Function Add(x As Integer, y As Integer) As Integer
Add = (x + y) Mod 256
End Function

Private Sub Command83_Click()
Dim i As Integer
Dim nHueGreen As Integer
Dim nHueNewColor As Integer
Dim nHueChange As Integer
Dim crNewColor As OLE_COLOR
Dim iCount As Integer
Dim RasterProc As New LEADRasterProcess

If (LEADRasterView1.Raster.BitmapBits = 16 And LEADRasterView1.Raster.IsGrayscale()) _
Or LEADRasterView1.Raster.BitmapBits = 64 Or LEADRasterView1.Raster.BitmapBits = 48 Then
RasterProc.RemapHueTablesSize = 65536
ElseIf LEADRasterView1.Raster.BitmapBits = 12 Then
RasterProc.RemapTablesSize = 4096
Else
RasterProc.RemapTablesSize = 256
End If

For i = 0 To RasterProc.RemapTablesSize-1
RasterProc.MaskTable (i) = 0
RasterProc.HTable (i) = I
Next I

'Get the hue for green
nHueGreen = RasterProc.HSV_HfromRGB (RGB(0, 255, 0))

'Obtain new hue (crNewColor can be any color)
crNewColor = RGB(255, 255, 0)
nHueNewColor = RasterProc.HSV_HfromRGB(crNewColor)
nHueChange = nHueNewColor - nHueGreen

If (nHueChange < 0) Then
nHueChange = nHueChange + 256
End If

'Set values in uHueTable, uMaskTable
RasterProc.HTable(nHueGreen) = Add(RasterProc.HTable(nHueGreen), nHueChange)
RasterProc.MaskTable(nHueGreen) = 1

'set the hues near green (+/- 10)
iCount = 0
i = Increment(nHueGreen)
While iCount < 10
RasterProc.HTable(i) = Add(RasterProc.HTable(i), nHueChange)
RasterProc.MaskTable(i) = 1
i = Increment(i)
iCount = iCount + 1
Wend

iCount = 0
i = Decrement(nHueGreen)
While iCount < 10
RasterProc.HTable(i) = Add(RasterProc.HTable(i), nHueChange)
RasterProc.MaskTable(i) = 1
i = Decrement(i)
iCount = iCount + 1
Wend

RasterProc.RemapHue LEADRasterView1.raster, True, True, False, False
End Sub


RemapTableSize example for Visual Basic

If (LEADRasterView1.Raster.BitmapBits = 16 And LEADRasterView1.Raster.IsGrayscale()) _
Or LEADRasterView1.Raster.BitmapBits = 64 Or LEADRasterView1.Raster.BitmapBits = 48 Then
RasterProc.RemapTableSize = 65536
ElseIf LEADRasterView1.Raster.BitmapBits = 12 Then
RasterProc.RemapTableSize = 4096
Else
RasterProc.RemapTableSize = 256
End If
Exit Sub


Remove example for Visual Basic

'remove the 2nd item from the ImageList Control
LEADImgList1.Remove 1


RemoveRedeye example for Visual Basic

LEADRasterView1.Raster.SetRgnEllipse 80, 55, 35, 30, L_RGN_SET
RasterProc.RemoveRedeye LEADRasterView1.Raster, RGB(5, 20, 10), 125, 100


RenderCenter example for Visual Basic

Printer.Print "Center the image on the page"

LEADRasterView1.RenderCenter = True

LEADRasterView1.Render Printer.hDC, 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight

Printer.NewPage

Printer.EndDoc


Resize (ILEADRasterImgList) example for Visual Basic

Private Sub LEADImgList1_Resize()
Form1.Caption = "Control Resized"
End Sub


Resize event example for Visual Basic

This example demonstates the Resize event.

Private Sub LEADRasterView1_Resize()
'Before using this example you must add a text box to your form.
'Then, you can exercise this example by coding a command button that
'changes the width and height of the LEADRasterView1 control
Text1.Text = "Control size: " & CStr(LEADRasterView1.Width) _
& " x " & CStr(LEADRasterView1.Height)
Text1.Refresh
End Sub


ResizeRgn example for Visual Basic

LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
LEADRasterView1.Raster.SetRgnRect 40, 60, 280, 200, L_RGN_SET
MsgBox "About to resize"
LEADRasterView1.Raster.ResizeRgn 20, RGN_CONTRACT, False


RevEffect example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.RevEffect LEADRasterView1.Raster, 3, 37


RGBfromHSV example for Visual Basic

'Takes an HSV, displays the HSV components, and displays the RGB components
Private Sub HSVtoRGB(h As Integer, s As Integer, v As Integer)
Dim cr As OLE_COLOR
Dim red As Integer
Dim green As Integer
Dim blue As Integer
Dim RasterProc As New LEADRasterProcess

cr = RasterProc.RGBfromHSV (h, s, v)
red = cr And &HFF
green = (cr \ &H100) And &HFF
blue = cr \ &H10000
MsgBox "HSV (" & h & "," & s & "," & v & ") is RGB(" & red & "," & green & "," & blue & ")"
End Sub


RgnChange example for Visual Basic

The following code for the RasterView RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

Private Sub LEADRasterView1_RgnChange()
Dim MyText As String
MyText = "Number of pixels in region: "
MyText = MyText + CStr(LEADRasterView1.Raster.GetRgnArea)
MsgBox MyText
End Sub


RgnFrameColor example for Visual Basic

LEADRasterView1.RgnFrameColor = vbBlue
LEADRasterView1.RgnFrameType = RGNFRAME_COLOR
LEADRasterView1.Raster.SetRgnRect 10, 10, 200, 200, L_RGN_SET


RingEffect Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim Xorg As Integer
Dim Yorg As Integer
Dim Radius As Integer

Xorg = LEADRasterView1.Raster.BitmapWidth / 2
Yorg = LEADRasterView1.Raster.BitmapHeight / 2
Radius = Xorg

RasterProc.RingEffect LEADRasterView1.Raster, Xorg, Yorg, _
Radius, 10, 0, _
RGB(0, 0, 0), 100, _
RING_COLOR Or _
RING_FIXEDANGLE Or _
RING_MAXRADIUS


Ripple Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Ripple LEADRasterView1.Raster, 20, 10,0,0, CenterX, CenterY, RGB(0,0,0), _FILL_RPT


ROIMean example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim strOut As String

RasterProc.GetOverlayAttributes LEADRasterView1.Raster, 0, OVERLAYATTRIBUTES_FLAGS

MsgBox "ROIMean = " + Str(RasterProc.OverlayAttributes.ROIMean) + Chr(13) + _
"ROIArea = " + Str(RasterProc.OverlayAttributes.ROIArea) + Chr(13) + _
"ROIStandardDeviation = " + Str(RasterProc.OverlayAttributes.ROIStandardDeviation) + Chr(13)


RomanMosaic Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.RomanMosaic LEADRasterView1.Raster, _
15, _
15, _
5, _
SHADOW_E, _
0, _
RGB(0, 0, 0), _
RMN_RECT Or _
RMN_SHADOWGRAY


Rotate example for Visual Basic

This example rotates the bitmap 45 degrees and redisplays the image. It resizes the bitmap to accommodate the rotation and uses blue as the fill color.

Dim RasterProc As New LEADRasterProcess
RasterProc.Rotate LEADRasterView1.Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 255)
LEADRasterView1.AutoSetRects = True 'Make sure the display rectangles are adjusted
LEADRasterView1.ForceRepaint


RowCount example for Visual Basic

Dim LinesPerPage As Long
If (LEADImgList1.ScrollStyle = IMGLST_SCROLLSTYLE_VERTICAL) Then
LinesPerPage = LEADImgList1.RowCount / LEADImgList1.PageCount
Else
LinesPerPage = LEADImgList1.ColumnCount / LEADImgList1.PageCount
End If
MsgBox "LinesPerPage = " & LinesPerPage


Rows example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim strOut As String

RasterProc.GetOverlayAttributes LEADRasterView1.Raster, 0, OVERLAYATTRIBUTES_FLAGS
MsgBox "Rows = " + Str(RasterProc.OverlayAttributes.Rows) + Chr(13) + _
"Columns = " + Str(RasterProc.OverlayAttributes.Rows)


RTFPaperHeight Example for Visual Basic

Private Sub LoadRTF_Click()
' This example loads a RTF file, with a custom top margin, bottom margin, left margin, right '
' margin, Paper width, and Paper height
Dim RasterIO As New LEADRasterIO
'Change margin values

RasterIO.RTFTopMarg = 0.9
RasterIO.RTFBottomMarg = 0.9

RasterIO.RTFLeftMarg = 1.3
RasterIO.RTFRightMarg = 1.3

RasterIO.RTFPaperWidth = 8.25
RasterIO.RTFPaperHeight = 11.5

'Now load the RTF file
RasterIO.Load LEADRasterView1.Raster, "c:\image1.rtf", 0, 1, 1
End Sub


SampleTarget Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

RasterProc.SampleTarget LEADRasterView1.Raster, RGB(50, 100, 150), _
RGB(60, 90, 150), SAMP_RED + SAMP_MID


Saturation example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the saturation of colors in the bitmap and redisplays the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Saturation LEADRasterView1.Raster, 1000
LEADRasterView1.ForceRepaint


Save (ILEADRasterMrc) example for Visual Basic

Dim RasterMrc As LEADRasterMrc
RasterMrc.MaskCoder = MRC_MASK_COMPRESSION_JBIG
RasterMrc.PictureCoder = MRC_PICTURE_COMPRESSION_JPEG
RasterMrc.PictureQFactor = 2
RasterMrc.Grayscale2BitCoder = MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT
RasterMrc.Grayscale8BitCoder = MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_JPEG_8BIT
RasterMrc.Grayscale8BitQFactor = 2
RasterMrc.Text2BitCoder = MRC_TEXT_COMPRESSION_JBIG_2BIT
RasterMrc.Save Me.ActiveForm.LEADRasterView1.Raster, "c:\test.mrc", FILE_LEAD_MRC, 0, SAVE_OVERWRITE
RasterMrc.SaveT44 Me.ActiveForm.LEADRasterView1.Raster, "c:\testT44.mrc", FILE_MRC, 0, SAVE_OVERWRITE


Save example for Visual Basic

This example saves the image as a BMP file, loads the new file, and redisplays the bitmap.

Dim RasterIO As New LEADRasterIO
Screen.MousePointer = 11 'Hourglass
RasterIO.Save LEADRasterView1.Raster, "d:\temp\tmp.bmp", _
FILE_BMP, 8, 1, SAVE_OVERWRITE
RasterIO.Load LEADRasterView1.Raster, "d:\temp\tmp.bmp", 0, 0, 1
LEADRasterView1.ForceRepaint
Screen.MousePointer = 0 ' default


SaveArray example for Visual Basic

Dim i As Integer
Dim RasterVar As New LEADRasterVariant
Dim lSize As Long
Dim RasterIO As New LEADRasterIO
Set RasterVar = RasterIO.SaveArray(LEADRasterView1.Raster, FILE_BMP, 0, 2)
lSize = RasterIO.ArraySize(RasterVar)
Open "c:\temp\tmp2.bmp" For Binary Access Write As #1
For i = 0 To lSize - 1
Put #1, i + 1, RasterVar.ShortItemValue(i)
Next i
Close #1
'get some info on the memory array
RasterIO.GetArrayInfo LEADRasterView1.Raster, RasterVar, 1, lSize
MsgBox "Format = " & CStr(RasterIO.InfoFormat)


SaveBuffer example for Visual Basic

''This sample loads the file 'szFileName', and saves it to memory buffer allocated by the user
'The original memory buffer is 1 bytes, which is too small to accommodate the image
'The SaveBuffer callback gets called as necessary, allowing the user to reallocate the memory buffer as needed
'When the image is completely saved in memory, it is loaded into a second LEAD control
'
'The following declarations are for calling Windows API's to allocate memory
Private Declare Function HeapAlloc Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function HeapReAlloc Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal lpMem As Long, ByVal dwBytes As Long) As Long
Private Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal lpMem As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Function HeapCreate Lib "kernel32" (ByVal flOptions As Long, ByVal dwInitialSize As Long, ByVal dwMaximumSize As Long) As Long
Private Declare Function HeapDestroy Lib "kernel32" (ByVal hHeap As Long) As Long

'The following variables are declared globally
Dim lHeap As Long
Dim lHeapAddress As Long

Private Sub SampleLoadSaveBuffer(szFileName As String)
Dim lHeapInitialSize As Long
Dim lMemInitialSize As Long
Dim nRet As Integer

'Create the heap
lHeap = 0
lHeapInitialSize = 1000
lHeap = HeapCreate(0, lHeapInitialSize, 0)

'Allocate the first chunk of memory to be 100 bytes
lHeapAddress = 0
lMemInitialSize = 1
lHeapAddress = HeapAlloc(lHeap, 0, lMemInitialSize)

RasterIO.Load LEADRasterView1.Raster, szFileName, 0, 0, 1
RasterIO.SaveBufferSize= lMemInitialSize
RasterIO.SaveBufferAddress= lHeapAddress
RasterIO.EnableSaveBufferEvent= True
nRet = RasterIO.SaveBuffer(LEADRasterView1.Raster, FILE_TIF, 24, 0, SAVE_OVERWRITE)
If (nRet <> 0) Then
MsgBox "SaveBuffer Error: " + Str(nRet)
End If

'Load the file in memory into a second LEAD Raster object
nRet = RasterIO.LoadBuffer(LEADRasterView2.Raster, RasterIO.SaveBufferAddress, 24, 0, 1, LEADRasterView1.Raster.SaveBufferSize)

'Free the allocated memory
HeapFree lHeap, 0, lHeapAddress

'Destroy the heap
HeapDestroy lHeap
End Sub

Private Sub RasterIO_SaveBuffer (ByVal uRequiredSize As Long)
'The SaveBuffer event allows the user to reallocate the buffer as needed
Dim dRet As Long
lHeapAddress = HeapReAlloc(lHeap, 0, lHeapAddress, uRequiredSize)
If (lHeapAddress = 0) Then
MsgBox "HeapReAlloc Error"
LEADRasterView1.Raster.EnableSaveBufferEvent = False
Else
LEADRasterView1.Raster.SaveBufferSize = uRequiredSize
LEADRasterView1.Raster.SaveBufferAddress = lHeapAddress
End If
End Sub


SaveICCProfile example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim pData As New LEADRasterVariant
Dim nRet As Integer

nRet = RasterIO.LoadICCProfile ("c:\dst_rgb_image.tif", pData, 1)
nRet = RasterIO.SaveICCProfile ("c:\image.tif", pData, 1)

Set pData = Nothing


SaveICCProfile2 Example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim pData
Dim nRet As Integer

nRet = RasterIO.LoadICCProfile2 ("c:\dst_rgb_image.tif", pData, 1)
nRet = RasterIO.SaveICCProfile2 ("c:\image.tif", pData, 1)


SaveIFD example for Visual Basic

' This example will add 100 pages to a file faster by continuously using the IFD of the last page
Dim RasterIO As New LEADRasterIO
Dim Page As Integer

' Save page 1, to make sure the file exists
RasterIO.Save LEADRasterView1.Raster, "d:\temp\test.tif", FILE_TIF, 1, 0, SAVE_APPEND
For Page = 2 To 100
' get the IFD of the last page
RasterIO.GetFileInfo LEADRasterView1.Raster, "d:\temp\test.tif", 100000, 0
RasterIO.SaveIFD = RasterIO.InfoIFD
RasterIO.Save LEADRasterView1.Raster, _
"d:\temp\test.tif", FILE_TIF, _
1, 0, SAVE_APPEND
Next
' reset the SaveIFD property so the other Save calls will work properly
RasterIO.SaveIFD = 0


SaveInterlaced example for Visual Basic

Note: Also works with Access 95 and 97.

'This example saves the current image as an interlaced GIF file, then loads the saved 'image with a paint-while-load effect that shows the interlaced behavior.
Dim szFile As String
Dim bRet As Boolean
Dim MyRasterIO As New LEADRasterIO

szFile = "c:\temp\test.gif"

'Save the current image as an interlaced GIF file.
MyRasterIO.SaveInterlaced= True
MyRasterIO.Save LEADRasterView1.Raster, szFile, FILE_GIF, 8, 1, SAVE_OVERWRITE

'Clear the bitmap so that we can see the paint-while-load effect.
LEADRasterView1.Raster.Bitmap= 0

'Paint the image while loading, showing that it is interlaced.
LEADRasterView1.PaintWhileLoad= True
MyRasterIO.Load LEADRasterView1.Raster, szFile, 0, 0, 1


SaveLayers example for Visual Basic

' Save all the extra bitmaps in the bitmap list as layers
RasterIO.SaveLayers= True
For i = 1 To LEADRasterView1.Raster.BitmapListCount - 1
' reset the layer info so all the layers are saved from 0,0 offset
RasterIO.LayerLeft (LEADRasterView1.Raster, i) = 0
RasterIO.LayerTop(LEADRasterView1.Raster, i) = 0
RasterIO.LayerBlendModeKey(LEADRasterView1.Raster, i) = "dark"
RasterIO.LayerClipping(LEADRasterView1.Raster, i) = 0
RasterIO.LayerOpacity(LEADRasterView1.Raster, i) = 40

Dim Raster2 As New LEADRaster
Raster2.Bitmap = 0
RasterIO.SetLayerMaskBitmap LEADRasterView1.Raster, Raster2, i
Next
' set the active bitmap to be the first in the list
RasterIO.Save LEADRasterView1.Raster, "c:\temp\layers.psd", FILE_PSD, 0, 0, SAVE_OVERWRITE


SaveList Example for Visual Basic

Private Sub SaveMulti_Click()
Dim nRet As Integer
Dim RasterMrc1 As New LEADRasterMrc
Dim RasterMrc2 As New LEADRasterMrc
Dim RasterIO As New LEADRasterIO
Dim RasterList As New LEADRaster
Dim Raster As New LEADRaster

Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT

RasterIO.Load Raster, "c:\1.jpg", 0, 0, 1
nRet = RasterMrc1.AutoSegmentExt(Raster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND Or SGM_FAVOR_TWOBIT)
RasterList.InsertBitmapListItem -1, Raster.Bitmap

RasterIO.Load Raster, "c:\2.jpg", 0, 0, 1
nRet = RasterMrc2.AutoSegmentExt(Raster, 5, 5, 25, 10, 75, SGM_WITHOUTBKGRND Or SGM_FAVOR_TWOBIT)
RasterList.InsertBitmapListItem -1, Raster.Bitmap

RasterIO.MRCRasterCount = 2
RasterIO.MRCRaster(0) = RasterMrc1
RasterIO.MRCRaster(1) = RasterMrc2

RasterIO.MaskCoder = MRC_MASK_COMPRESSION_FAX_G3_1D
RasterIO.PictureCoder = MRC_PICTURE_COMPRESSION_JPEG
RasterIO.PictureQFactor = 10
RasterIO.Grayscale8BitCoder = MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT
RasterIO.Grayscale8BitQFactor = 2
RasterIO.Grayscale2BitCoder = MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT
RasterIO.Text2BitCoder = MRC_TEXT_COMPRESSION_JBIG_2BIT

nRet = RasterIO.SaveList(RasterList, "c:\Multi.tif", FILE_TIF_MRC)


SaveLSB example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
' This example saves a bitmap compatible with the requirements
' of the TIFF Class F format
' make sure we are using pixels
LEADRasterView1.ScaleMode = 3
RasterIO.SaveLSB = True
RasterIO.SavePageNumberTag = True
LEADRasterView1.Raster.BitmapXRes = 204
LEADRasterView1.Raster.BitmapYRes = 196
' scale the bitmap (preserving the aspect ratio) to have a width of 1728 pixels
RasterProc.Size LEADRasterView1.Raster, 1728, _
LEADRasterView1.Raster.BitmapHeight * 1728 / _
LEADRasterView1.Raster.BitmapWidth, 0
RasterIO.Save LEADRasterView1.Raster, "d:\temp\lsb.tif", _
FILE_CCITT_GROUP3_1DIM, 1, 0, SAVE_OVERWRITE


SaveMemory example for Visual Basic

This example uses SaveMemory to save a bitmap to a memory-resident file, uses GetMemoryInfo to examine the file size; then uses WIN32 API calls to save the file to disk and free the memory.

' Declare WIN32 API constants and functions in the Declarations module.
Private Const OF_READ = &H0
Private Const OF_CREATE = &H1000
Private Const SEEK_SET = 0
Private Const SEEK_END = 2
Private Const GMEM_MOVEABLE = &H2
Private Type OFSTRUCT
cBytes As String * 1
fFixedDisk As String * 1
nErrCode As Integer
reserved As String * 4
szPathName As String * 128
End Type
Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

Private Declare Function hread Lib "kernel32" Alias "_hread" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal wBytes As Long) As Long
Private Declare Function hwrite Lib "kernel32" Alias "_hwrite" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal lBytes As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Private Declare Function llseek Lib "kernel32" Alias "_llseek" (ByVal hFile As Long, ByVal lOffset As Long, ByVal iOrigin As Long) As Long

Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
' ---------------------- Code for SaveMemory (32 bit) -------------
Private Sub SaveMemory_Click()
Dim hf As Long
Dim hMem As Long
Dim iSize As Long
Dim lpMem As Long
Dim of As OFSTRUCT
Dim RasterIO As New LEADRasterIO
Dim cMsg
If RasterIO.SaveMemory(LEADRasterView1.Raster, hMem, FILE_BMP, 4, 0, 0, iSize) <> 0 Then
MsgBox ("Error calling SaveMemory")
GoTo quit_savememory
End If
If RasterIO.GetMemoryInfo(LEADRasterView1.Raster, hMem, 0, iSize) <> 0 Then
GlobalFree (hMem)
GoTo quit_savememory
End If
' Ask for a confirmation to save this file
cMsg = "File info:" + Chr(13)
cMsg = cMsg + Str(RasterIO.InfoWidth) + " x " + Str(RasterIO.InfoHeight)
cMsg = cMsg + " x " + Str(RasterIO.InfoBits) + " BPP" + Chr(13)
cMsg = cMsg + "Size in memory: " + Str(RasterIO.InfoSizeMem) + Chr(13)
cMsg = cMsg + "Size on disk : " + Str(RasterIO.InfoSizeDisk)
If MsgBox(cMsg, vbYesNo, "Write this file on disk ") = vbNo Then
GlobalFree (hMem)
GoTo quit_savememory
End If
lpMem = GlobalLock(hMem)
If lpMem = 0 Then
GlobalFree (hMem)
MsgBox ("Error calling GlobalLock")
GoTo quit_savememory
End If
hf = OpenFile("d:\temp\memsave.bmp", of, OF_CREATE)
If hf = -1 Then
GlobalUnlock (hMem)
GlobalFree (hMem)
MsgBox ("Error calling OpenFile")
GoTo quit_savememory
End If
If hwrite(hf, lpMem, iSize) <> iSize Then
MsgBox ("Error calling hwrite")
Else
MsgBox ("The file was saved successfully on disk.")
End If
lclose (hf)
GlobalUnlock (hMem)
GlobalFree (hMem)
quit_savememory:
End Sub


SaveMemory2 example for Visual Basic

' Declare WIN32 API constants and functions in the Declarations module.
Private Const OF_READ = &H0
Private Const OF_CREATE = &H1000
Private Const SEEK_SET = 0
Private Const SEEK_END = 2
Private Const GMEM_MOVEABLE = &H2
Private Type OFSTRUCT
cBytes As String * 1
fFixedDisk As String * 1
nErrCode As Integer
reserved As String * 4
szPathName As String * 128
End Type

Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

Private Declare Function hread Lib "kernel32" Alias "_hread" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal wBytes As Long) As Long
Private Declare Function hwrite Lib "kernel32" Alias "_hwrite" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal lBytes As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Private Declare Function llseek Lib "kernel32" Alias "_llseek" (ByVal hFile As Long, ByVal lOffset As Long, ByVal iOrigin As Long) As Long

Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long

Private Sub Form_Load()
Dim RasterIO2 As New LEADRasterIO_U
RasterIO2.Load LEADRasterView1.Raster, "c:\1.bmp", 0, 0, 1
End Sub

Private Sub Save_Click()
Dim hf As Long
Dim of As OFSTRUCT
Dim RasterIO As New LEADRasterIO_U
Dim cMsg
Dim lpMem As Long

If RasterIO.SaveMemory2(LEADRasterView1.Raster, FILE_BMP, 4, 0, SAVE_REPLACE) <> 0 Then
MsgBox ("Error calling SaveMemory")
GoTo quit_savememory
End If

If RasterIO.GetMemoryInfo(LEADRasterView1.Raster, RasterIO.SaveMemory2Handle, 0, RasterIO.SaveMemory2Size) <> 0 Then
RasterIO.SaveMemory2Handle = 0
GoTo quit_savememory
End If
' Ask for a confirmation to save this file
cMsg = "File info:" + Chr(13)
cMsg = cMsg + Str(RasterIO.InfoWidth) + " x " + Str(RasterIO.InfoHeight)
cMsg = cMsg + " x " + Str(RasterIO.InfoBits) + " BPP" + Chr(13)
cMsg = cMsg + "Size in memory: " + Str(RasterIO.InfoSizeMem) + Chr(13)
cMsg = cMsg + "Size on disk : " + Str(RasterIO.InfoSizeDisk)
If MsgBox(cMsg, vbYesNo, "Write this file on disk ") = vbNo Then
RasterIO.SaveMemory2Handle = 0
GoTo quit_savememory
End If

lpMem = GlobalLock(RasterIO.SaveMemory2Handle)
hf = OpenFile("c:\memsave.bmp", of, OF_CREATE)
If hf = -1 Then
GlobalUnlock (RasterIO.SaveMemory2Handle)
RasterIO.SaveMemory2Handle = 0
MsgBox ("Error calling OpenFile")
GoTo quit_savememory
End If

If hwrite(hf, lpMem, RasterIO.SaveMemory2Size) <> RasterIO.SaveMemory2Size Then
MsgBox ("Error calling hwrite")
Else
MsgBox ("The file was saved successfully on disk.")
End If

lclose (hf)
GlobalUnlock (RasterIO.SaveMemory2Handle)
RasterIO.SaveMemory2Handle = 0

quit_savememory:
End Sub


SaveNoPalette example for Visual Basic

RasterProc.Grayscale LEADRasterView1.Raster, 8
RasterIO.SaveNoPalette = True
RasterIO.Save LEADRasterView1.Raster, "d:\temp\testnopal.tif", FILE_TIF, 0, 0, 0
RasterIO.SaveNoPalette = False
RasterIO.Save LEADRasterView1.Raster, "d:\temp\testpal.tif", FILE_TIF, 0, 0, 0


SavePage example for Visual Basic

Dim RasterIO As New LEADRasterIO
' replace page 1 from TEST.TIF
RasterIO.SavePage = 1
RasterIO.Save LEADRasterView1.Raster, "d:\temp\TEST.TIF", _
FILE_TIF, 8, 0, SAVE_REPLACE


SaveResolutionCount example for Visual Basic

Dim i As Integer
Dim RasterIO As New LEADRasterIO
' assume that our bitmap is 800 x 600
' save 3 resolutions
RasterIO.SaveResolutionCount = 3

RasterIO.SaveResolutionWidth(0) = 800
RasterIO.SaveResolutionHeight(0) = 600
RasterIO.SaveResolutionWidth(1) = 400
RasterIO.SaveResolutionHeight(1) = 300
RasterIO.SaveResolutionWidth(2) = 200
RasterIO.SaveResolutionHeight(2) = 150

' get the SaveResolution info
MsgBox "SaveResolutionCount = " + CStr(RasterIO.SaveResolutionCount)

For i = 0 To RasterIO.SaveResolutionCount - 1
MsgBox "SaveResolution(" + CStr(i) + ") = " + _
CStr(RasterIO.SaveResolutionWidth(i)) + " x " + _
CStr(RasterIO.SaveResolutionHeight(i))
Next


SaveTileWidth example for Visual Basic

' save TIF files with a tile size of 512x512
LEADRasterView1.Raster.ScaleMode = SCALEMODE_PIXEL ' use pixels for the tile size
RasterIO.SaveTileWidth= 512
RasterIO.SaveTileHeight= 512
RasterIO.Save LEADRasterView1.Raster, "c:\temp\tiled.tif", FILE_CCITT_GROUP4, 0, QFACTOR_LEAD_0, SAVE_OVERWRITE


SaveToFile example for Visual Basic

Dim i As Integer
For i = 1 To 3 ' select 2nd to 4th items
LEADImgList1.Item (i).Selected = True
Next
Kill "d:\temp\testing.tif"
'save all selected items to a multipage file
LEADImgList1.SaveToFile "d:\temp\testing.tif", FILE_TIF_CMP, 0, QFACTOR_QS, True

MsgBox "about to reload file"
'clear list
LEADImgList1.Clear
'reload file
LEADImgList1.LoadFromFile "d:\temp\testing.tif", 0, 1, -1


SaveWithStamp example for Visual Basic

Note: Also works with Access 95 and 97.

This example saves the image in a JPEG file that includes a thumbnail (stamp) image. It then loads the thumbnail from the new file.

' Declare a local variable
Dim RasterIO As New LEADRasterIO
LEADRasterView1.ScaleMode = 3 ' Use pixels for sizing the thumbnail
RasterIO.SaveWithStamp LEADRasterView1.Raster, "d:\temp\stamp.jpg", _
FILE_JFIF, 24, 30, 150, 100, 24
RasterIO.LoadStamp LEADRasterView1.Raster, "d:\temp\stamp.jpg"
LEADRasterView1.ForceRepaint


ScaleMode example for Visual Basic

'setup a custom scale
LEADImgList1.ScaleMode = SCALEMODE_USER
LEADImgList1.ScaleWidth = 600
LEADImgList1.ScaleHeight = 300
LEADImgList1.ScaleTop = 200
LEADImgList1.ScaleLeft = 200


Scroll (ILEADRasterImgList) example for Visual Basic

Private Sub LEADImgList1_Scroll ()
Form1.Caption = "Page: " & CStr(LEADImgList1.CurrentPage) & " of " & CStr(LEADImgList1.PageCount)
End Sub


Scroll event example for Visual Basic

This example demonstrates the Scroll event.

Private Sub LEADRasterView1_Scroll()
' Add a TextBox control to your form and use it for this test
Text1.Text = "Image origin: " & CStr(LEADRasterView1.DstLeft) _
& ", " & CStr(LEADRasterView1.DstTop)
Text1.Refresh
End Sub


ScrollItems example for Visual Basic

'scroll items down 2 lines
LEADImgList1. ScrollItems 2


ScrollStyle example for Visual Basic

'Set scroll style to horizontal
LEADImgList1.ScrollStyle = IMGLST_SCROLLSTYLE_HORIZONTAL


Segment example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Segment LEADRasterView1.Raster, 20, SGM_RGB


SegmentExt Example for Visual Basic

Private Sub SaveMulti_Click()
Dim nRet As Integer
Dim RasterMrc1 As New LEADRasterMrc
Dim RasterMrc2 As New LEADRasterMrc
Dim RasterIO As New LEADRasterIO
Dim RasterList As New LEADRaster
Dim Raster As New LEADRaster

Raster.UnlockSupport L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT

RasterIO.Load Raster, "c:\1.jpg", 0, 0, 1
RasterMrc1.StartSegmentation Raster
nRet = RasterMrc1.SegmentExt(Raster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND Or SGM_FAVOR_TWOBIT)
RasterMrc1.StopSegmentation
RasterList.InsertBitmapListItem -1, Raster.Bitmap

RasterIO.Load Raster, "c:\2.jpg", 0, 0, 1
RasterMrc2. StartSegmentation LEADRasterView1.Raster
nRet = RasterMrc2.SegmentExt(Raster, 5, 5, 25, 10, 75, SGM_WITHOUTBKGRND Or SGM_FAVOR_TWOBIT)
RasterMrc2.StopSegmentation
RasterList.InsertBitmapListItem -1, Raster.Bitmap

RasterIO.MRCRasterCount = 2
RasterIO.MRCRaster(0) = RasterMrc1
RasterIO.MRCRaster(1) = RasterMrc2

RasterIO.MaskCoder = MRC_MASK_COMPRESSION_FAX_G3_1D
RasterIO.PictureCoder = MRC_PICTURE_COMPRESSION_JPEG
RasterIO.PictureQFactor = 10
RasterIO.Grayscale8BitCoder = MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT
RasterIO.Grayscale8BitQFactor = 2
RasterIO.Grayscale2BitCoder = MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT
RasterIO.Text2BitCoder = MRC_TEXT_COMPRESSION_JBIG_2BIT

nRet = RasterIO.SaveList(RasterList, "c:\Multi.tif", FILE_TIF_MRC)


SelectData Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim RasterSrc As New LEADRaster
Dim RasterIO As New LEADRasterIO

RasterIO.Load RasterSrc, "c:\image1.bmp", 0, 0, 1

RasterProc.SelectData LEADRasterView1.Raster, _
RasterSrc, _
RGB(233, 10, 77), _
2, _
6, _
25, _
True


SelectedItems example for Visual Basic

Dim x As Long
x = LEADRasImgList1.SelectedCount
While (x > 0)
LEADRasImgList1.SelectedItems(0).Selected = False
x = LEADRasImgList1.SelectedCount
Wend


SelectionStyle example for Visual Basic

'show selected items as pressed buttons
LEADImgList1.SelectionStyle = IMGLST_SELECTIONSTYLE_PRESSEDBUTTON
MsgBox "about to change selection style"
LEADImgList1.SelectionStyle = IMGLST_SELECTIONSTYLE_SELECTCOLOR
LEADImgList1.SelectionColor = RGB(255, 0, 0) 'set to RED


SelectiveColor Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.SelectiveColorCyan(0) = -100

RasterProc.SelectiveColorCyan(1) = 34
RasterProc.SelectiveColorMagenta(1) = 100
RasterProc.SelectiveColorYellow(1) = 40
RasterProc.SelectiveColorBlack(1) = 100

RasterProc.SelectiveColorCyan(1) = 100

RasterProc.SelectiveColorCyan(2) = -65
RasterProc.SelectiveColorMagenta(2) = -39
RasterProc.SelectiveColorYellow(2) = 63
RasterProc.SelectiveColor LEADRasterView1.Raster


SetGeoKey Example for Visual Basic

Public RasterIO As LEADRasterIO
Private Sub TestSetGeoKey()
Dim rasVar As New LEADRasterVariant

' This example sets the GTModelTypeGeoKey key to the Project Coordination System value

RasterIO.GeoKeyType = TAG_SHORT
RasterIO.GeoKeyCount = 1

rasVar.Type = VALUE_SHORT
rasVar.ShortValue = 1
RasterIO.GeoKeyData = rasVar
RasterIO.SetGeoKey 1024
' Every GeoTIFF file I save from now on will contain this GeoKey
End Sub


SetMemoryInfo example for Visual Basic

' change the tiled bitmap so is can use as many cache buffers as possible:

LEADRasterView1.Raster.MemoryInfoType = 0
LEADRasterView1.Raster.MemoryInfoTileSize = 0
LEADRasterView1.Raster.MemoryInfoTotalTiles = 0
LEADRasterView1.Raster.MemoryInfoConventionalTiles = 0
LEADRasterView1.Raster.MemoryInfoMaxTileViews = &HFFFFFFFF
LEADRasterView1.Raster.MemoryInfoTileViews = &HFFFFFFFF
LEADRasterView1.Raster.MemoryInfoFlags = SET_MEMORYINFO_MAXTILEVIEW + _
SET_MEMORYINFO_TILEVIEWS
LEADRasterView1.Raster.SetMemoryInfo


SetMemoryThresholds example for Visual Basic

' Allocate tiled bitmaps when more than 75% of the computer memory is used, or for bitmaps larger than '100MB.
LEADRasterView1.Raster.MemoryTiledThreshold = -25
LEADRasterView1.Raster.MaxConventionalSize = 1024 * 102400
LEADRasterView1.Raster.TiledBitmapsSize = 0
LEADRasterView1.Raster.MemoryConventionalTile = 0
LEADRasterView1.Raster.MemoryConventionalBuffers = 0
LEADRasterView1.Raster.MemoryFlags = MEMORY_TILED_THRESHOLD + MEMORY_MAX_CONV_SIZE
LEADRasterView1.Raster.SetMemoryThresholds


SetMinMaxBits Example for Visual Basic

Dim RasterProc As New LEADRasterProcess

' set the grayscale LUT
If (LEADRasterView1.Raster.IsGrayscale) <> GRAY_NO And (LEADRasterView1.Raster.BitmapBits > 8) Then
LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.SetMinMaxBits LEADRasterView1.Raster.MinBit, LEADRasterView1.Raster.MaxBit
LEADRasterView1.Raster.GetMinMaxVal
Dim window As Double
Dim center As Double
window = (LEADRasterView1.Raster.MaxVal - LEADRasterView1.Raster.MinVal)
center = window / 2
RasterProc.ApplyLinearVOILUT LEADRasterView1.Raster, window, center, 0
End If


SetOverlayAttributes example for Visual Basic

Dim OverlayRaster As New LEADRaster
Dim nRet As Integer
RasterIO.Load OverlayRaster, "c:\pic1.cmp", 0, 0, 1
nRet = RasterProc.SetOverlayBitmap(LEADRasterView1.Raster, 0, _
OverlayRaster, OVERLAY_MOVE)

If nRet = 0 Then
RasterProc.OverlayAttributes.Color = RGB(255, 255, 255)
RasterProc.OverlayAttributes.Flags = OVERLAY_AUTOPROCESS + OVERLAY_AUTOPAINT
RasterProc.OverlayAttributes.OriginX = 0
RasterProc.OverlayAttributes.OriginY = 0
RasterProc.OverlayAttributes.BitPosition = LEADRasterView1.Raster.BitmapBits - 1
RasterProc.SetOverlayAttributes LEADRasterView1.Raster, 0, _
OVERLAYATTRIBUTES_COLOR + _
OVERLAYATTRIBUTES_FLAGS + _
OVERLAYATTRIBUTES_ORIGIN +_ OVERLAYATTRIBUTES_BITINDEX
End If


SetRgn... example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates the SetRgnEllipse, SetRgnRect, SetRgnRoundRect, and SetRgnPolygon methods by simulating client area coordinates. Normally, you would get the coordinates interactively from mouse events and would use Windows GDI functions to outline the shape of each region before it is created.

To create the polygonal region, this example uses the PolygonSize, PolygonX, and PolygonY properties.

Also, to demonstrate the SetRgnColor method, it uses the Fill method to fill the region with a solid color, then uses the fill color to create a new region.

'Declare local variables.
Dim ZoomFactorX As Single 'Used for translating positioning information
Dim ZoomFactorY As Single 'Used for translating positioning information
Dim OffsetX, OffsetY, CurrentX, CurrentY 'To simulate mouse coordinates
Dim SimLeft, SimTop, SimWidth, SimHeight 'To simulate mouse coordinates
Dim LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, eW, eH 'For bitmap coordinates
Dim i As Integer 'Loop counter
Dim xPoint, yPoint 'Arrays for polygon points
Dim RasterProc As New LEADRasterProcess
'Initialize the variables that we will manipulate to simulate mouse coordinates.
LEADRasterView1.ScaleMode = SCALEMODE_PIXEL
OffsetX = LEADRasterView1.Raster.ScaleWidth / 15
OffsetY = LEADRasterView1.Raster.ScaleHeight / 15
CurrentX = OffsetX
CurrentY = OffsetY
'Set the zoom factors.
ZoomFactorX = LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth
ZoomFactorY = LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight
'Start by simulating the drawing of a rectangle.
SimLeft = CurrentX
SimTop = CurrentY
SimWidth = OffsetX * 2
SimHeight = OffsetY * 2
'Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) - _
(LEADRasterView1.DstLeft / ZoomFactorX) _
+ LEADRasterView1.SrcLeft
LBRgnTop = (SimTop / ZoomFactorY) - _
(LEADRasterView1.DstTop / ZoomFactorY) _
+ LEADRasterView1.SrcTop
LBRgnWidth = SimWidth / ZoomFactorX
LBRgnHeight = SimHeight / ZoomFactorY
'Create the rectangular region, outline it, and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnRect LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_STATIC
MsgBox "Here is the rectangular region"
'Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + OffsetX
CurrentY = CurrentY + OffsetY
'Next, simulate the drawing of an ellipse.
SimLeft = CurrentX
SimTop = CurrentY
SimWidth = OffsetX * 3
SimHeight = OffsetY * 2
'Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) - _
(LEADRasterView1.DstLeft / ZoomFactorX) _
+ LEADRasterView1.SrcLeft
LBRgnTop = (SimTop / ZoomFactorY) - _
(LEADRasterView1.DstTop / ZoomFactorY) _
+ LEADRasterView1.SrcTop
LBRgnWidth = SimWidth / ZoomFactorX
LBRgnHeight = SimHeight / ZoomFactorY
'Add the elliptical region, using a Boolean OR,
'and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnEllipse LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_OR
LEADRasterView1.RgnFrameType = RGNFRAME_STATIC
MsgBox "Here is the added ellipse, with a Boolean OR"
'Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + OffsetX
CurrentY = CurrentY + OffsetY
'Next, simulate the drawing of a rounded rectangle.
SimLeft = CurrentX
SimTop = CurrentY
SimWidth = OffsetX * 3
SimHeight = OffsetY * 2
'Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) _
- (LEADRasterView1.DstLeft / ZoomFactorX) _
+ LEADRasterView1.SrcLeft
LBRgnTop = (SimTop / ZoomFactorY) _
- (LEADRasterView1.DstTop / ZoomFactorY) _
+ LEADRasterView1.SrcTop
LBRgnWidth = SimWidth / ZoomFactorX
LBRgnHeight = SimHeight / ZoomFactorY
'Define an ellipse to use for the corners.
eW = LBRgnWidth / 4
eH = LBRgnHeight / 4
'Add the rounded rectangular region, using a Boolean exclusive OR,
'and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnRoundRect LBRgnLeft, LBRgnTop, LBRgnWidth, _
LBRgnHeight, eW, eH, L_RGN_XOR
MsgBox "Here is the rounded rectangle, with a Boolean XOR"
'Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + (2 * OffsetX)
CurrentY = CurrentY + (2 * OffsetY)
'Set up some arrays to use as client area grid values.
'OffsetX and OffsetY set the grid sizes.
xPoint = Array(0, -1, 2, 1, 1, 2, -1, -2)
yPoint = Array(0, -1, -1, 1, -1, 1, 1, 1)
'Initialize the polygon size using an arbitrary number.
'This number will be increased dynamically.
LEADRasterView1.Raster.PolygonSize = 5
'Fill in the array for the polygon. This simulates a user's mouse clicks.
For i = 0 To 7
CurrentX = CurrentX + (xPoint(i) * OffsetX)
CurrentY = CurrentY + (yPoint(i) * OffsetY)
LEADRasterView1.Raster.PolygonX(i) = (CurrentX / ZoomFactorX) _
- (LEADRasterView1.DstLeft / ZoomFactorX) _
+ LEADRasterView1.SrcLeft
LEADRasterView1.Raster.PolygonY(i) = (CurrentY / ZoomFactorY) _
- (LEADRasterView1.DstTop / ZoomFactorY) _
+ LEADRasterView1.SrcTop
If i + 1 = LEADRasterView1.Raster.PolygonSize Then
LEADRasterView1.Raster.PolygonSize = LEADRasterView1.Raster.PolygonSize + 5
End If
Next
'Adjust the polygon size to the actual number of points.
LEADRasterView1.Raster.PolygonSize = i
'Add the polygonal region, using a Boolean OR,
'and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnPolygon L_POLY_WINDING, L_RGN_OR
MsgBox "Here is the added polygon, with a Boolean OR"
'Fill the resulting polygon with red, and display a message.
RasterProc.Fill LEADRasterView1.Raster, RGB(255, 0, 0)
LEADRasterView1.RgnFrameType = RGNFRAME_NONE
LEADRasterView1.ForceRepaint
MsgBox "Using SetRgnColor and L_RGN_SETNOT, all else will become blue."
'Clean up memory
LEADRasterView1.Raster.FreeRgn
'Do the final region.
LEADRasterView1.Raster.SetRgnColor RGB(255, 0, 0), L_RGN_SETNOT
RasterProc.Fill LEADRasterView1.Raster, RGB(0, 0, 255)
LEADRasterView1.ForceRepaint
'Clean up memory
LEADRasterView1.Raster.FreeRgn
LEADRasterView1.Raster.PolygonSize = 0


SetRgnBorder Example for Visual Basic

Private Sub SetRgnBorder_Click()
LEADRasterView1.Raster.SetRgnBorder 0, 0, RGB(0, 0, 0), RGB(20, 30, 15), RGB(15, 30, 10), L_RGN_SET
LEADRasterView.RgnFrameType = RGNFRAME_ANIMATED
End Sub


SetRgnColorHSVRange example for Visual Basic

'This example sets a region corresponding to all pure green (Hue = 85)
'and colors near green (+/- 10)
'where Saturation is at least 40 and Value is at least 40
Private Sub Command95_Click()
Dim H0 As Integer
Dim S0 As Integer
Dim V0 As Integer
Dim H1 As Integer
Dim S1 As Integer
Dim V1 As Integer

H0 = 75
S0 = 40
V0 = 40

H1 = 95
S1 = 255
V1 = 255
LEADRasterView1.raster.SetRgnColorHSVRange H0, S0, V0, H1, S1, V1, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
End Sub


SetRgnColorRGBRange example for Visual Basic

'This example sets a region corresponding to all colors that
'have an rgb that includes red but no green and no blue
Private Sub Command94_Click()
Dim rgbLo As OLE_COLOR
Dim rgbHi As OLE_COLOR

rgbLo = RGB(1, 0, 0)
rgbHi = RGB(255, 0, 0)
LEADRasterView1.raster.SetRgnColorRGBRange rgbLo, rgbHi, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
End Sub


SetRgnFromMask example for Visual Basic

Dim RasterIO As New LEADRasterIO
' This example sets a region into a bitmap using a 1-bit black-and-white mask image.
RasterIO.Load LEADRasterView1.Raster, "C:\PARROTS.JPG", 0, 0, 1
RasterIO.Load LEADRasterView2.Raster, "c:\test2.jpg", 0, 0, 1
LEADRasterView1.Raster.MaskBitmap = LEADRasterView2.Raster.Bitmap
LEADRasterView1.Raster.SetRgnFromMask L_RGN_SET
LEADRasterView1.Raster.MaskBitmap = 0


SetRgnMagicWand example for Visual Basic

Private Sub LEADRasterView1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
LEADRasterView1.Raster.SetRgnMagicWand x, y, 10, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
End Sub


SetSelectionBitmap example for Visual Basic

LEADRasterIO1.Load LEADRaster1, "d:\temp\circ.bmp", 24, 0, 1
LEADImgList1.SetSelectionBitmap vbWhite, LEADRaster1.Bitmap
LEADImgList1.SelectionStyle = IMGLST_SELECTIONSTYLE_USERBITMAP


SetSrcClipRect example for Visual Basic

Note: Also works with Access 95 and 97.

This example crops the image by reducing the source clipping area and repaints the image.

' Declare local variables
Dim NewLeft, NewTop, NewWidth, NewHeight
NewLeft = LEADRasterView1.SrcClipLeft+ (LEADRasterView1.SrcClipWidth * 0.1)
NewTop = LEADRasterView1.SrcClipTop + (LEADRasterView1.SrcClipHeight * 0.1)
NewWidth = LEADRasterView1.SrcClipWidth * 0.8
NewHeight = LEADRasterView1.SrcClipHeight * 0.8
If (NewWidth > 1) AND (NewHeight >1) Then
LEADRasterView1.SetSrcClipRect NewLeft, NewTop, NewWidth, NewHeight
End If
LEADRasterView1.ForceRepaint


SetSrcRect example for Visual Basic

Note: Also works with Access 95 and 97.

This example zooms in on the image by reducing the source rectangle and repaints the image.

' Declare local variables
Dim NewLeft, NewTop, NewWidth, NewHeight
NewLeft = LEADRasterView1.SrcLeft+ (LEADRasterView1.SrcWidth * 0.1)
NewTop = LEADRasterView1.SrcTop + (LEADRasterView1.SrcHeight * 0.1)
NewWidth = LEADRasterView1.SrcWidth * 0.8
NewHeight = LEADRasterView1.SrcHeight * 0.8
If (NewWidth > 1) AND (NewHeight >1) Then
LEADRasterView1.SetSrcRect NewLeft, NewTop, NewWidth, NewHeight
End If
LEADRasterView1.ForceRepaint


SetTag example for Visual Basic

'Declare a FormLevel RasterIO object
Public WithEvents RasterIO As LEADRasterIO

Private Sub Form_Load()
Set RasterIO = New LEADRasterIO
End Sub

Private Sub SetAndRead_Click()
Dim myArray(4) As Long
Dim RasterVar As New LEADRasterVariant

' initialize the array
myArray(0) = 1
myArray(1) = 2
myArray(2) = 3
myArray(3) = 127
RasterVar.Type = VALUE_STRING
RasterVar.StringValue = "My text string"
' set a tag using one of the following:
RasterIO.SetTag 32768, TAG_ASCII, 0, RasterVar
' RasterIO.SetTag 32768, TAG_BYTE, 4, myArray
' RasterIO.SetTag 32768, TAG_DOUBLE, 4, myArray
' RasterIO.SetTag 32768, TAG_FLOAT, 4, myArray
' RasterIO.SetTag 32768, TAG_LONG, 4, myArray
' RasterIO.SetTag 32768, TAG_RATIONAL, 2, myArray
' RasterIO.SetTag 32768, TAG_SBYTE, 4, myArray
' RasterIO.SetTag 32768, TAG_SHORT, 4, myArray
' RasterIO.SetTag 32768, TAG_SLONG, 4, myArray
' RasterIO.SetTag 32768, TAG_SRATIONAL, 2, myArray
' RasterIO.SetTag 32768, TAG_SSHORT, 4, myArray
' RasterIO.SetTag 32768, TAG_UNDEFINED, 4, myArray

' Write the tag
RasterIO.WriteTag "d:\temp\test.tif", 1
Call ReadTag_Click
End Sub

Private Sub ReadTag_Click()
' read the tag back
RasterIO.ReadTag "d:\temp\test.tif", 1, 32768
Call GetAndDisplayTag(0)
End Sub

' This sub will get a certain tag and display it according to the tag type.
Private Sub GetAndDisplayTag(lTag As Long)
Dim myVar As Variant
Dim RasterVar As New LEADRasterVariant
Dim Msg$
Dim i As Long
Dim count As Long

Set RasterVar = RasterIO.GetTagData(lTag)
count = RasterIO.GetTagCount(lTag)

Msg$ = "Type = " + CStr(RasterIO.GetTagType(lTag))
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "count = " + CStr(count)
If RasterIO.GetTagType(lTag) = TAG_ASCII Then
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data = " + RasterVar.StringValue
ElseIf RasterIO.GetTagType(lTag) = TAG_RATIONAL Or _
RasterIO.GetTagType(lTag) = TAG_SRATIONAL Then
For i = 0 To count - 1
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data(" + CStr(i) + ") = " + _
CStr(RasterVar.ShortItemValue(i * 2)) + "/" + CStr(RasterVar.ShortItemValue(i * 2 + 1))
Next i
Else
For i = 0 To count - 1
Msg$ = Msg$ + Chr$(10) + Chr$(13) + "Data(" + CStr(i) + ") = " + _
CStr(RasterVar.ShortItemValue(i))
Next
End If
MsgBox Msg$
End Sub


Sharpen example for Visual Basic

Note: Also works with Access 95 and 97.

This example increases the sharpness of the bitmap and redisplays the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Sharpen LEADRasterView1.Raster, 100
LEADRasterView1.ForceRepaint


Shear example for Visual Basic

Note: Also works with Access 95 and 97.

This example shears the bitmap 5 degrees horizontally and redisplays the image. It uses blue as the fill color.

Dim RasterProc As New LEADRasterProcess
RasterProc.Shear LEADRasterView1.Raster, 500, True, RGB(0, 0, 255)
LEADRasterView1.ForceRepaint


ShiftData Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim RasterSrc As New LEADRaster
Dim RasterIO As New LEADRasterIO

RasterIO.Load RasterSrc, "c:\1.bmp", 0, 0, 1

RasterProc.ShiftData LEADRasterView1.Raster, _
RasterSrc, _
2, _
6, _
3, _
8


ShiftMinimumToZero Example for Visual Basic

Dim iShiftAmount As Integer
RasterProc.ShiftMinimumToZero LEADRasterView1.Raster
iShiftAmount = RasterProc.ShiftAmount

RasterProc.MultiScaleEnhancement LEADRasterView1.Raster, 2000, 4, _
MSE_DEFAULT, 0, 0, _
MSE_GAUSSIAN Or MSE_EDGEENH

RasterProc.ShiftZeroToNegative LEADRasterView1.Raster, iShiftAmount, _
-32767, 32766, 0, 65535


ShortItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_ARRAY_SHORT
RasterVariant.ItemCount = 2
RasterVariant.ShortItemValue(0) = 5
RasterVariant.ShortItemValue(1) = 10


ShortValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.EnableMethodErrors = False
RasterVariant.Type = VALUE_SHORT
RasterVariant.ShortValue = 5
If RasterVariant.Error = 0 Then
MsgBox "the short value is set correctly"
End If


Skeleton Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Skeleton LEADRasterView1.Raster,128


SkipFile example for Visual Basic

Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
Dim out$

If (nStatusCode = 0) Then 'successful thumbnail generation
'save thumbnails in a multipage TIFF file
LEADRaster1.Bitmap = Bitmap
LEADRasterIO1.Save LEADRaster1, "d:\temp\thumbs.tif", FILE_TIF, 24, 0, SAVE_APPEND
out$ = pszFilename & Chr(13)
out$ = out$ & "Format: " & CStr(LEADThumb1.InfoFormat) & Chr(13)
out$ = out$ & "Compression: " & CStr(LEADThumb1.InfoCompression) & Chr(13)
out$ = out$ & "Bits: " & CStr(LEADThumb1.InfoBits) & Chr(13)
out$ = out$ & "Width: " & CStr(LEADThumb1.InfoWidth) & Chr(13)
out$ = out$ & "Height: " & CStr(LEADThumb1.InfoHeight) & Chr(13)
out$ = out$ & "Page: " & CStr(LEADThumb1.InfoPage) & Chr(13)
out$ = out$ & "TotalPages: " & CStr(LEADThumb1.InfoTotalPages) & Chr(13)
out$ = out$ & "SizeDisk: " & CStr(LEADThumb1.InfoSizeDisk) & Chr(13)
out$ = out$ & "SizeMem: " & CStr(LEADThumb1.InfoSizeMem) & Chr(13)
out$ = out$ & "XRes: " & CStr(LEADThumb1.InfoXRes) & Chr(13)
out$ = out$ & "YRes: " & CStr(LEADThumb1.InfoYRes) & Chr(13)
MsgBox out$
ElseIf (nStatusCode = BROWSE_PRELOAD) Then
'check the extension, if it is ".DOC", then skip
If (UCase(Right$(pszFilename, 4)) = ".DOC") Then
LEADThumb1.SkipFile = True
MsgBox "skipping - " & pszFilename
End If
End If
LEADThumb1.ContinueBrowse = True 'continue the browse operation
End Sub


Slice Example for Visual Basic

Private Sub RasterProc_OnSliceBitmap (ByVal Bitmap As Long, ByVal lLeft As Long, ByVal lTop As Long, ByVal lWidth As Long, ByVal lHeight As Long, ByVal lAngle As Long)
Static nCount As Integer
Dim RasterIO As New LEADRasterIO
Dim SliceRaster As New LeadRaster
Dim strFileName As String
Dim nRet As Integer

strFileName = "c:\Slices\" + Str$(nCount + 1) + ".bmp"

SliceRaster.Bitmap = Bitmap

nRet = RasterIO.Save (SliceRaster, strFileName, FILE_BMP, 24, QFACTOR_LEAD_1, SAVE_OVERWRITE)

If (nRet = 0) Then
nCount = nCount + 1
If (nCount > 10) Then RasterProc.ContinueSlicing = False
End If

Set SliceRaster = Nothing
Set RasterIO = Nothing

Private Sub ImageSlice_Click()
Dim nRet As Integer
nRet = RasterProc.Slice (Main.ActiveForm.LEADRasterView1.Raster, 500, RGB(0, 0, 0), SLICE_DESKEW Or SLICE_DESKEW_LINEAR Or SLICE_CUT_SLICES, True)
MsgBox "Deskew Angle :" + Str(RasterProc.SliceDeskewAngle)
End Sub


Smooth example for Visual Basic

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public hRgnAll As Long
Private Const RGN_OR = 2

'Declare the RasterProcess object WithEvents
Public WithEvents RasterProc As LEADRasterProcess

'Create the RasterProcess object and UnlockSupport
Private Sub Form_Load()
'.....
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess. ")
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
'.....
End Sub
'This example smooths all nicks and bumps up to 2 pixels in length
'Long bumps/nicks are treated before short bumps/nicks
'A LEAD region is updated to show all the changes
'The Smooth Event is used to display information about bump or nick

Dim nRet As Integer
RasterProc.EnableDocCleanEvents = True
RasterProc.DocCleanSuccess = SUCCESS_REMOVE
nRet = RasterProc.Smooth(LEADRasterView1.Raster, 2, SMOOTH_SINGLE_REGION Or SMOOTH_LEAD_REGION Or SMOOTH_FAVOR_LONG)
If (nRet = 0) Then
LEADRasterView1.RgnFrameType = RGNFRAME_COLOR
End If

Private Sub RasterProc_Smooth(ByVal nBumpOrNick As Long, ByVal fStartRow As Single, ByVal fStartCol As Single, ByVal fLength As Single, ByVal uHorV As Long)
Dim szType As String
Dim szHorV As String
If (nBumpOrNick = SMOOTH_BUMP) Then
szType = "Bump"
Else
szType = "Nick"
End If
If (uHorV = SMOOTH_HORIZONTAL_ELEMENT) Then
szHorV = "Horz."
Else
szHorV = "Vert."
End If
Debug.Print "Found " & szType & " at " & CStr(fStartRow) & "," & CStr(fStartCol) & " Length=" & CStr(fLength) & " - " & szHorV
End Sub


SmoothEdges Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.SmoothEdges LEADRasterView1.Raster, 75, 0


Solarize example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies a solarize effect and repaints the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.Solarize LEADRasterView1.Raster, 100
LEADRasterView1.ForceRepaint


Sort example for Visual Basic

'Sort the items in ascending order
LEADImgList1.Sort True


SortExt Example for Visual Basic

Private Sub Sort_Click()
LEADImgList1.LoadFromFile "c:\image1.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image2.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image3.jpg", 0, 0, -1
LEADImgList1.LoadFromFile "c:\image4.jpg", 0, 0, -1

LEADImgList1.SortExt True, False, False, 0
End Sub


SpatialFilter example for Visual Basic

Note: Also works with Access 95 and 97.

This example applies Laplacian line detection and redisplays the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.SpatialFilter LEADRasterView1.Raster, FLT_LAPLACE_1
LEADRasterView1.ForceRepaint


Spherize Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Spherize LEADRasterView1.Raster, 100, CenterX, CenterY, RGB(0,0,0), FILL_RPT OR FILL_WOUTROT


Src... example for Visual Basic

Note: Also works with Access 95 and 97.

This example uses the source rectangle properties to zoom in on the image.

'Calculate the values to zoom in by 10 percent and center the image.
If (LEADRasterView1.SrcWidth > 1) And (LEADRasterView1.SrcHeight > 1) Then
LEADRasterView1.SrcWidth = LEADRasterView1.SrcWidth * 0.9
LEADRasterView1.SrcHeight = LEADRasterView1.SrcHeight * 0.9
LEADRasterView1.SrcTop = (LEADRasterView1.Raster.BitmapHeight - LEADRasterView1.SrcHeight) / 2
LEADRasterView1.SrcLeft = (LEADRasterView1.Raster.BitmapWidth - LEADRasterView1.SrcWidth) / 2
End If
'Set the clipping area to the same as the source rectangle
LEADRasterView1.SrcClipWidth = LEADRasterView1.SrcWidth
LEADRasterView1.SrcClipHeight = LEADRasterView1.SrcHeight
LEADRasterView1.SrcClipTop = LEADRasterView1.SrcTop
LEADRasterView1.SrcClipLeft = LEADRasterView1.SrcLeft
'Redisplay the image
LEADRasterView1.ForceRepaint


STable example for Visual Basic

'This example remaps the saturation of each color to one half its original
Private Sub Command87_Click()
Dim i As Integer
Dim RasterProc As New LEADRasterProcess

For i = 0 To 255
RasterProc.STable (i) = i \ 2
Next I
RasterProc.RemapHue LEADRasterView1.raster, False, False, True, False
End Sub


StopFireEnumGeoKeys property (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | VARIANT_BOOL StopFireEnumGeoKeys
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Stops firing the EnumGeoKeys event.

This property should be called inside EnumGeoKeys event. Possible values are:

Value | Meaning
TRUE | Abort firing EnumGeoKeys event.
FALSE | Continue firing EnumGeoKeys event.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


StopMagGlass example for Visual Basic

LEADRASTERVIEW1.ScaleMode = 3

' Set MagGlass flags
' In this case the masked colors from the Magnifying Glass area will be all the colors
' except those colors which will be set using the MagGlassMask property
LEADRASTERVIEW1.MagGlassFlags = MAGGLASS_MASK_INVERT

'set the color mask to mask out all colors except a few shades of black
LEADRASTERVIEW1.MagGlassMaskCount = 3
LEADRASTERVIEW1.MagGlassMask(0) = RGB(0, 0, 0)
LEADRASTERVIEW1.MagGlassMask(1) = RGB(1, 1, 1)
LEADRASTERVIEW1.MagGlassMask(2) = RGB(2, 2, 2)
LEADRASTERVIEW1.RgnFrameType = 0
LEADRASTERVIEW1.StartMagGlass 100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True
'.......some other work..............
'.......some other work..............
'Stop the MagGlass
LEADRASTERVIEW1.StopMagGlass


StretchIntensity example for Visual Basic

Note: Also works with Access 95 and 97.

This example stretches the intensity and redisplays the image.

Dim RasterProc As New LEADRasterProcess
RasterProc.StretchIntensity LEADRasterView1.Raster
LEADRasterView1.ForceRepaint


StringItemValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_ARRAY_STRING
RasterVariant.ItemCount = 2
RasterVariant.StringItemValue(0) = "My 1st String"
RasterVariant.StringItemValue(1) = "My 2nd String"


StringValue example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.Type = VALUE_STRING
RasterVariant.StringValue = "My String Value"


SubtractBackground example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.SubtractBackground LEADRasterView1.Raster, _
50, _
SBK_1_1, _
100, _
SBK_BG_DARK Or _
SBK_RES_SHOW


SwapColors example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.SwapColors LEADRasterView1.Raster, SWAP_RG


Swirl Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Swirl LEADRasterView1.Raster, 180, CenterX, CenterY


TempDirectory Example for Visual Basic

LEADRasterView1.Raster.TempDirectory = "c:\Temp"


TextureAlphaBlend Example for Visual Basic

Dim RasterSrc As New LEADRaster
Dim RasterMask As New LEADRaster
Dim RasterUnderlay As New LEADRaster
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

RasterIO.Load RasterSrc, "C:\image1.cmp", 0, 0, 1
RasterIO.Load RasterMask, "C:\FadeMask.cmp", 0, 0, 1

RasterProc.TextureAlphaBlend LEADRasterView1.Raster, 0, 0, 100, 100, RasterSrc, 0, 0, RasterMask, 100, Nothing, 0, 0


TextWordWrap example for Visual Basic

Note: Also works with Access 95 and 97.

This example wraps text inside the rectangle that is specified for the text object.

Dim LeadRasterFxd1 As New LEADRasterFXD
'Text location
LeadRasterFxd1.TextTop = 10
LeadRasterFxd1.TextLeft = 10
LeadRasterFxd1.TextWidth = 150
LeadRasterFxd1.TextHeight = 150
'Text alignment and angle
LeadRasterFxd1.TextAlign = FXD_TEXTALIGN_LEFT_VCENTER
LeadRasterFxd1.TextAngle = 0
'Enable word wrap
LeadRasterFxd1.TextWordWrap = True
LeadRasterFxd1.DrawPersistence = True
LeadRasterFxd1.DrawText LEADRasterView1.Raster, 0, "LEADTOOLS 14.5 Supports WordWrap when drawing text.", 0


Tool example for Visual Basic

'This sample displays the current tool, and then changes it to ANN_TOOL_RECT
Private Sub Tool_Click()
Dim strTool As String

strTool = RasterAnnToolbar.Tool

Select Case RasterAnnToolbar.Tool
Case ANN_TOOL_SELECT:
strTool = "Select"
Case ANN_TOOL_LINE:
strTool = "Line"
Case ANN_TOOL_RECT:
strTool = "Rect"
Case ANN_TOOL_ELLIPSE:
strTool = "Ellipse"
Case ANN_TOOL_POLYLINE:
strTool = "Polyline"
Case ANN_TOOL_POLYGON:
strTool = "Polygon"
Case ANN_TOOL_POINTER:
strTool = "Pointer"
Case ANN_TOOL_FREEHAND:
strTool = "Freehand"
Case ANN_TOOL_HILITE:
strTool = "hilite"
''...other tools

End Select
MsgBox "Current tool: " & strTool
MsgBox "Changing to ANN_TOOL_RECT"
RasterAnnToolbar.Tool = ANN_TOOL_RECT
End Sub


TransitionEffect example for Visual Basic

Note: Also works with Access 95 and 97.

This example paints a transition with a 255-step grayscale gradient.

Dim RasterIO As New LEADRasterIO
LEADRasterView1.AutoRepaint = False
LEADRasterView1.TransitionDelay = 50
RasterIO.Load LEADRasterView1.Raster, "d:\temp\24bit.bmp", 0, 0, 1
LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
LEADRasterView1.TransitionStyle = EFX_TRANSITION_GRADIENT
LEADRasterView1.GradientStyle = EFX_GRADIENT_ANGLE_TO_LT
LEADRasterView1.GradientEndColor = RGB(0, 0, 0)
LEADRasterView1.GradientStartColor = RGB(255, 255, 255)
LEADRasterView1.GradientSteps = 255
LEADRasterView1.AutoRepaint = True


Transparent example for Visual Basic

'set the backcolor of the control to BLUE
LEADRasterView1.BackColor = vbBlue
MsgBox "Pause"
'create a 100x100 image
LEADRasterView1.Raster.CreateBitmap 100, 100, 24
'fill some of the image with RED, the rest with black
LEADRasterView1.AutoRepaint = False
For y = 0 To 99
For x = 0 To 24
LEADRasterView1.Raster.Pixel(x, y) = vbRed
Next
For x = 25 To 74
LEADRasterView1.Raster.Pixel(x, y) = vbBlack
Next
For x = 75 To 99
LEADRasterView1.Raster.Pixel(x, y) = vbRed
Next
Next
LEADRasterView1.AutoRepaint = True
MsgBox "Pause"
'now, set Red as the transparent color
LEADRasterView1.Raster.BitmapTransparentColor = vbRed
LEADRasterView1.Raster.BitmapEnableTransparency = True
MsgBox "Pause"
'now set the control transparent
LEADRasterView1.Transparent = True


Trim example for Visual Basic

This example trims one-tenth from the bitmap and repaints the image.

' Declare local variables
Dim NewLeft, NewTop, NewWidth, NewHeight, ViewWidth, ViewHeight
Dim RasterProc As New LEADRasterProcess
NewLeft = LEADRasterView1.Raster.BitmapWidth * 0.1
NewTop = LEADRasterView1.Raster.BitmapHeight * 0.1
NewWidth = LEADRasterView1.Raster.BitmapWidth * 0.8
NewHeight = LEADRasterView1.Raster.BitmapHeight * 0.8
RasterProc.Trim LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight
' Set variables for the position and size of the display rectangle.
ViewWidth = LEADRasterView1.ScaleWidth
ViewHeight = LEADRasterView1.ScaleHeight
' Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect 0, 0, ViewWidth, ViewHeight
LEADRasterView1.SetDstClipRect 0, 0, ViewWidth, ViewHeight
LEADRasterView1.ForceRepaint


Tunnel Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX, CenterY As Integer

CenterX = LEADRasterView1.Raster.BitmapWidth
CenterY = LEADRasterView1.Raster.BitmapHeight / 2

RasterProc.Tunnel LEADRasterView1.Raster, CenterX, CenterY, 0, CenterY*2, CenterX, -1,0, 25,0,100, 20000, RGB(255,0,0), RGB(0,0,0),TUN_AXIS_WIDTH | PLANE_FILL_CLR


TXTTopMarg Example for Visual Basic

'This example loads a TXT file, with a top margin, bottom margin, left margin, right margin ,font color, font size and bold formatting defined by the user
Dim RasterIO As New LEADRasterIO

'Change TXT Options values
RasterIO.TXTTopMarg = 1
RasterIO.TXTBottomMarg = 1
RasterIO.TXTRightMarg = 1.5
RasterIO.TXTLeftMarg = 1.5
RasterIO.TXTPaperWidth = 10
RasterIO.TXTPaperHeight = 10
RasterIO.TXTFaceName = "Arial"
RasterIO.TXTFontSize = 12
RasterIO.TXTFontColor = RGB(255, 0, 0)
RasterIO.TXTHighlight = RGB(0, 0, 255)
RasterIO.TXTStrikeThrough = False
RasterIO.TXTBold = True
RasterIO.TXTItalic = False
RasterIO.TXTUnderLine = False
RasterIO.TXTEnabled = True

' Now load the TXT file
RasterIO.Load LEADRasterView1.Raster, "c:\1.txt", 0, 0, 1


Type example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim strOut As String

RasterProc.GetOverlayAttributes LEADRasterView1.Raster, 0, OVERLAYATTRIBUTES_FLAGS
MsgBox "Type = " + RasterProc.OverlayAttributes.Type + Chr(13) + _
"BitsAllocated = " + Str(RasterProc.OverlayAttributes.BitsAllocated) + Chr(13) + _
"Description =" + RasterProc.OverlayAttributes.Description + Chr(13) + _
"Subtype =" + RasterProc.OverlayAttributes.Subtype + Chr(13) + _
"Label =" + RasterProc.OverlayAttributes.Label + Chr(13)


Underlay example for Visual Basic

This example loads a bitmap into Raster2 and uses it as a tiled underlay for LEADRasterView1.

Dim Factory As New LEADRasterFactory
Dim Raster2 As LEADRaster
Dim szLic As String
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

szLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc." & vbCrLf & vbCrLf
Set Raster2 = Factory.CreateObject("LEADRaster.LEADRaster", szLic)

RasterIO.Load Raster2, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
RasterProc.Underlay LEADRasterView1.Raster, Raster2, UNDERLAY_TILE
LEADRasterView1.ForceRepaint


UnsharpMask example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.UnsharpMask LEADRasterView1.Raster, 200, 15, 50, RGB_SPACE


UpdateMagGlassFromHandle Example for Visual Basic

' Global variables
Public ghMagGlassCursor As Long
Public gbLeftButton As Boolean

' Windows API functions headers
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

Private Sub Form_Load()
LEADRasterView1.EnableMethodErrors = False
RasterIO.Load LEADRasterView1.Raster, "c:\ Sample1.cmp ", 0, 0, 1
RasterIO.Load LEADRasterView2.Raster, " Sample2.cmp ", 0, 0, 1
LEADRasterView1.MagGlassFlags = MAGGLASS_MANUAL_UPDATE

' Starting the Magnifying Glass
LEADRasterView1.StartMagGlass 100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), False, 1, False, CROSSHAIR_FINE, True, True

' Updating the Magnifying Glass bitmap of 1st control with bitmap of the
' 2nd control that has the same width and height.
LEADRasterView1.UpdateMagGlassFromHandle LEADRasterView2.Bitmap, True

' Use this Windows API function to load the MagGlass cursor from a file
ghMagGlassCursor = LoadCursorFromFile(App.Path & "\MagGlassCursor.cur")

Private Sub LEADRasterView1_MagGlassCursor()
' Check if the left button is not down and the Magnifying Glass is started
If ((Not gbLeftButton) And (LEADRasterView1.HasMagGlass)) Then
SetCursor (ghMagGlassCursor)
End If
End Sub

Private Sub LEADRasterView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nStatus As Integer

' Check if this is a left button and the Magnifying Glass is started
If ((Button <> 1) Or Not (LEADRasterView1..HasMagGlass)) Then
Exit Sub
End If

' Move the Magnifying Glass to the hit position
nStatus = SetMagGlassMousePosition(x, y)
If (nStatus <> 0) Then
MsgBox "Error while displaying Magnifying Glass, Error: " & CStr(nStatus)
Exit Sub
End If

' Show the Magnifying Glass
nStatus = LEADRasterView1.ShowMagGlass(True)
If (nStatus <> 0) Then
MsgBox "Error while displaying Magnifying Glass, Error: " & CStr(nStatus)
Exit Sub
End If

' Left button is currently pressed
gbLeftButton = True

' Call this Windows API function to hide the cursor
ShowCursor (False)
End Sub

Private Sub LEADRasterView1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nStatus As Integer

' Check if the left button is down and the Magnifying Glass is started
If ((Button <> 1) Or Not (LEADRasterView1.HasMagGlass)) Then
Exit Sub
End If

' Move the Magnifying Glass to the mouse position
nStatus = SetMagGlassMousePosition(x, y)
If (nStatus <> 0) Then
MsgBox "Error while Moving Magnifying Glass, Error: " & CStr(nStatus)
End If
End Sub

Private Sub LEADRasterView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nStatus As Integer

' Check if the left button is down and the Magnifying Glass is started
If ((Button <> 1) Or Not (LEADRasterView1.HasMagGlass)) Then
Exit Sub
End If

' Show the Magnifying Glass
nStatus = LEADRasterView1.ShowMagGlass(False)
If (nStatus <> 0) Then
MsgBox "Error while Hiding Magnifying Glass, Error: " & CStr(nStatus)
End If

' Left button is released
gbLeftButton = True

' Call this Windows API function to show the cursor
ShowCursor (True)
End Sub

Private Function SetMagGlassMousePosition(xPos As Single, yPos As Single) As Integer
Dim nStatus As Integer
Dim nOldScaleMode As Long

' Save the current Scale mode
nOldScaleMode = LEADRasterView1.ScaleMode
' Change the Scaling mode to Twip
LEADRasterView1.ScaleMode = 1
' Set the MagGlass new position
nStatus = LEADRasterView1.SetMagGlassPos(xPos, yPos)
' Switch back to the old Scale mode
LEADRasterView1.ScaleMode = nOldScaleMode

SetMagGlassMousePosition = nStatus
End Function


UpdateMagGlassShape example for Visual Basic

Dim hRgn As Long
LEADRasterView1.ScaleMode = 3
LEADRasterView1.RgnFrameType = 0
LEADRasterView1.StartMagGlass 100, 100, 400, RGB(255, 0, 0), _

RGB(128,128, 128), True, 1, False, _

CROSSHAIR_FINE, True, True
'assume that VB API viewer Add-In Module was added to the current
project
hRgn = CreateRoundRectRgn(0, 0, 100, 100, 25, 25)
LEADRasterView1.UpdateMagGlassShape MAGGLASS_SHAPE_HRGN, hRgn
DeleteObject hRgn
'.......some other work..............
'.......some other work..............
'Stop the MagGlass
LEADRasterView1.StopMagGlass


UpdateOverlayBits example for Visual Basic

Dim OverlayRaster As New LEADRaster
Dim nRet As Integer

RasterIO.Load OverlayRaster, "c:\pic1.cmp", 0, 0, 1
nRet = RasterProc.SetOverlayBitmap(LEADRasterView1.Raster, 0, _
OverlayRaster, OVERLAY_MOVE)

If nRet = 0 Then
RasterProc.OverlayAttributes.Color = RGB(255, 255, 255)
RasterProc.OverlayAttributes.Flags = OVERLAY_AUTOPROCESS + _
OVERLAY_AUTOPAINT

RasterProc.OverlayAttributes.OriginX = 0
RasterProc.OverlayAttributes.OriginY = 0
RasterProc.OverlayAttributes.BitPosition = LEADRasterView1.Raster.BitmapBits - 1

RasterProc.SetOverlayAttributes LEADRasterView1.Raster, 0, _ OVERLAYATTRIBUTES_COLOR + OVERLAYATTRIBUTES_FLAGS + OVERLAYATTRIBUTES_ORIGIN + OVERLAYATTRIBUTES_BITINDEX
End If

RasterProc.UpdateOverlayBits LEADRasterView1.Raster, 0, SETOVERLAYBITS_FROMOVERLAY


UpdateZoomView Example for Visual Basic

Dim ZoomView As New LEADRasterZoomView
Dim nCount As Integer
Dim i As Integer
If (LEADRasterView1.HasZoomView) Then
nCount = LEADRasterView1.ZoomViewsCount
For i = 0 To nCount - 1
ZoomView.Index = i
LEADRasterView1.GetZoomView ZoomView
ZoomView.EnableCallouts = False
LEADRasterView1.UpdateZoomView ZoomView
Next i
End If


UseFastConversion Example for Visual Basic

Dim RasterIO As New LEADRasterIO
RasterIO.UseFastConversion = True
RasterIO.Load LEADRasterView1.Raster, "c:\1.jpg", 0, 0, 1


UserFilter example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i, j As Integer

RasterProc.UserFilterWidth = 3
RasterProc.UserFilterHeight = 3
RasterProc.UserFilterXCenter = 1
RasterProc.UserFilterYCenter = 1
RasterProc.UserFilterDivisor = 1
RasterProc.UserFilterOffset = 0
RasterProc.UserFilterFlags = UD_SUM

For i = 0 To RasterProc.UserFilterWidth - 1
For j = 0 To RasterProc.UserFilterHeight - 1
If (j = 1 Or i = 1) Then
If (j = 1 And i = 1) Then
RasterProc.UserFilterData(i, j) = 5
Else
RasterProc.UserFilterData(i, j) = -1
End If
Else
RasterProc.UserFilterData(i, j) = 0
End If
Next j
Next i

RasterProc.UserFilter LEADRasterView1.Raster


UseLUT example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

Private Sub Form_Load()
Dim nLow, nHigh As Long

RasterIO.Load LEADRasterView1.Raster, "c:\16.jpg", 16, 0, 1

LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.GetMinMaxVal

LEADRasterView1.Raster.LevelLowBit = 0
LEADRasterView1.Raster.LevelHighBit = LEADRasterView1.Raster.BitmapBits - 1

nLow = LEADRasterView1.Raster.MinBit
nHigh = 2 ^ (LEADRasterView1.Raster.MaxBit - LEADRasterView1.Raster.MinBit + 1)
'allocate the LUT
LEADRasterView1.Raster.LevelLUT(nHigh - 1) = 0

'fill the entire LUT with gradient from RED to BLUE
LEADRasterView1.Raster.WindowLevelFillLUT RGB(255, 0, 0), RGB(0, 0, 255), _
nLow, nHigh, _
LEADRasterView1.Raster.MinBit, _
LEADRasterView1.Raster.MaxBit, _
LEADRasterView1.Raster.MinVal, _
LEADRasterView1.Raster.MaxVal, _
0, _
FILLLUT_INSIDE Or FILLLUT_LINEAR

End Sub

Private Sub Command3_Click()
LEADRasterView1.Raster.UseLUT = True
RasterProc.ColorRes LEADRasterView1.Raster, 24, CRP_BYTEORDERBGR, CRD_NODITHERING, 0
End Sub


UserPalette and BitmapPalette example for Visual Basic

Note: Also works with Access 95 and 97.

This example demonstrates the UserPalette and BitmapPalette properties.

Dim RasterProc As New LEADRasterProcess
'Specify a blue and white user palette
RasterProc.UserPalette(0) = RGB(0, 0, 255)
RasterProc.UserPalette(1) = RGB(255, 255, 255)
'Implement the user palette
RasterProc.ColorRes LEADRasterView1.Raster, 1, CRP_USERPALETTE, CRD_ORDEREDDITHERING, 2
'Display the blue and white image
LEADRasterView1.ForceRepaint
MsgBox "This is the user palette. Click OK to change the bitmap palette."
'Change the bitmap palette to red and white
LEADRasterView1.Raster.BitmapPalette(0) = RGB(255, 0, 0)
LEADRasterView1.Raster.BitmapPalette(1) = RGB(255, 255, 255)
'Display the red and white image
LEADRasterView1.ForceRepaint


UserSegmentInfo Example for Visual Basic

Dim WithEvents LeadPDFComp As LEADPDFCompressor
Dim Factory As New LEADRasterFactory
Dim Raster As LEADRaster
Dim RasterIO As New LEADRasterIO
Dim gszLic As String

Private Sub Form_Load()
gszLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LeadPDFComp = New LEADPDFCompressor

Set Raster = Factory.CreateObject ("LEADRaster.LEADRaster", gszLic)

RasterIO.Load Raster, "C:\Image.cmp", 0, 0, 1

LeadPDFComp.PDFCompInit False

LeadPDFComp.UserSegmentInfoCount = 2

LeadPDFComp.UserSegmentInfo(0).SegmentTop = 0
LeadPDFComp.UserSegmentInfo(0).SegmentLeft = 0
LeadPDFComp.UserSegmentInfo(0).SegmentBottom = Raster.BitmapHeight / 2
LeadPDFComp.UserSegmentInfo(0).SegmentRight = Raster.BitmapWidth / 2
LeadPDFComp.UserSegmentInfo(0).SegmentType = PDFCOMP_SEGMENT_TYPE_PICTURE
LeadPDFComp.UserSegmentInfo(0).SegmentColorsCount = 0

LeadPDFComp.UserSegmentInfo(1).SegmentTop = Raster.BitmapHeight / 2
LeadPDFComp.UserSegmentInfo(1).SegmentLeft = Raster.BitmapHeight / 2
LeadPDFComp.UserSegmentInfo(1).SegmentBottom = Raster.BitmapHeight
LeadPDFComp.UserSegmentInfo(1).SegmentRight = Raster.BitmapWidth
LeadPDFComp.UserSegmentInfo(1).SegmentType = PDFCOMP_SEGMENT_TYPE_PICTURE
LeadPDFComp.UserSegmentInfo(1).SegmentColorsCount = 0

LeadPDFComp.PDFCompInsertSegments Raster, vbWhite, True

LeadPDFComp.PDFCompWrite "C:\Output.pdf"
LeadPDFComp.PDFCompFree

End Sub


UserShape Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim i As Integer
RasterProc.LightAngle = 9000
RasterProc.LightFrequency = 10
RasterProc.LightFlags = FL_FREEHAND Or FL_ADD
RasterProc.UserShapeCount = 10
For i = 0 To RasterProc.UserShapeCount - 1
RasterProc.UserShape(i) = i * 10
Next i
RasterProc.FunctionalLight LEADRasterView1.Raster


ViewSize example for Visual Basic

Dim nSize As Long
Dim nFirst As Long
Dim nLast As Long
Dim nCols As Long
Dim nCount As Long

'NOTE: assume scroll style = SCROLLSTYLE_VERTICAL
'get the view size
nSize = LEADRasImgList1.ViewSize
'get the first visible item
nFirst = LEADRasImgList1.FirstVisibleItem
'get the column count
nCols = LEADRasImgList1.ColumnCount
'calculate the index of last visible item
nLast = nFirst + (nSize * nCols) - 1 '0 based index
nCount = LEADRasImgList1.Count
If (nLast > nCount - 1) Then
nLast = nCount - 1
End If
MsgBox "nSize " & nSize & vbNewLine & "nFirst " & nFirst & vbNewLine & "nLast " & nLast & vbNewLine & "nCols " & nCols & vbNewLine & "nCount " & nCount


Vignette Example for Visual Basic

Dim XCenter As Integer
Dim YCenter As Integer
Dim RasterProc As New LEADRasterProcess
XCenter = LEADRasterView1.Raster.BitmapWidth / 2
YCenter = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.Vignette LEADRasterView1.Raster, XCenter, _
YCenter, 50, 100, XCenter, YCenter, _
RGB(0, 0, 255), VIG_ELLIPSE Or VIG_FILLIN


VTable example for Visual Basic

'This example remaps the "value" of each color to one half its original
Private Sub Command91_Click()
Dim i As Integer
Dim RasterProc As New LEADRasterProcess

For i = 0 To 255
RasterProc.VTable (i) = i \ 2
Next I
RasterProc.RemapHue LEADRasterView1.raster, False, False, False, True
End Sub


vType example for Visual Basic

Dim RasterVariant As New LEADRasterVariant

RasterVariant.EnableMethodErrors = False
RasterVariant.vType = VALUE_SHORT
RasterVariant.ShortValue = 5

If RasterVariant.Error = 0 Then
MsgBox "the short value is set correctly"End If


Wave Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
RasterProc.Wave LEADRasterView1.Raster, 20, 25, 0, 100, 100, RGB(0,0,0), FILL_RPT _
OR DIS_PER _
OR WV_SIN


Wind Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
RasterProc.Wind LEADRasterView1.Raster, 40, 180, 0


Window example for Visual Basic

This example shows how to call one of the Windows API functions and pass the ImageList Control's Window property as a parameter.

Private Declare Function ShowWindow Lib "User32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Boolean

Private Sub Command6_Click()
'hide the control
ShowWindow LEADImgList1.Window, 0
MsgBox "wait"
'restore the window
ShowWindow LEADImgList1.Window, 1
End Sub


WindowLevel example for Visual Basic

Note: Also works with Access 95 and 97.

These examples convert a bitmap to 12-bit grayscale and then perform window leveling on the four most significant bits of the image.

Dim RasterProc As New LEADRasterProcess
'WindowLevel for Display
RasterProc.Grayscale LEADRasterView1.Raster, 12 'Grayscale image to 12-bit
LEADRasterView1.Raster.LevelLowBit = 8 ' use 4 most significant bits
LEADRasterView1.Raster.LevelHighBit = 11
LEADRasterView1.WindowLevel

Dim RasterProc As New LEADRasterProcess
'WindowLevel image processing
RasterProc.Grayscale LEADRasterView1.Raster, 12 'Grayscale image to 12-bit
LEADRasterView1.Raster.LevelLowBit = 8 ' use 4 most significant bits
LEADRasterView1.Raster.LevelHighBit = 11
RasterProc.WindowLevel LEADRasterView1.Raster

'This example loads a 16-bit grayscale, fills the window level lookup table,
' and window levels the bitmap for display only
Private Sub Command2_Click()
Dim i As Long
Dim RasterProc As New LEADRasterProcess
Dim RasterIO As New LEADRasterIO
'Load a 16-bit grayscale image
RasterIO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\dicom\image2.dic", 0, 0, 1
LEADRasterView1.AutoRepaint = False

'Use all bits
LEADRasterView1.Raster.LevelLowBit = 0
LEADRasterView1.Raster.LevelHighBit = LEADRasterView1.Raster.BitmapBits - 1

LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.GetMinMaxVal

'Set LUT so the range is from pure blue to pure red
For i = LEADRasterView1.Raster.MinVal To LEADRasterView1.Raster.MaxVal
LEADRasterView1.Raster.LevelLUT(i) = RGB(i Mod 256, 0, 256 - i Mod 256)
Next i

'Window level for display only--leave the bitmap data unchanged
LEADRasterView1.WindowLevel
LEADRasterView1.ForceRepaint
End Sub


WindowLevelFillLUT example for Visual Basic

Dim nHigh As Long
Dim nLow As Long
Dim RasterProc As New LEADRasterProcess
Dim fSigned As Long

RasterProc.Grayscale LEADRasterView1.Raster, 16

LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.GetMinMaxVal

LEADRasterView1.Raster.LevelLowBit = 0
LEADRasterView1.Raster.LevelHighBit = LEADRasterView1.Raster.BitmapBits - 1

nLow = LEADRasterView1.Raster.MinBit
nHigh = 2 ^ (LEADRasterView1.Raster.MaxBit - LEADRasterView1.Raster.MinBit + 1)

'allocate the LUT
LEADRasterView1.Raster.LevelLUT(nHigh - 1) = 0

'set the FILLLUT_SIGNED flag for signed images
fSigned = FILLLUT_UNSIGNED
If (LEADRasterView1.Raster.IsSigned) Then fSigned = FILLLUT_SIGNED

'fill the entire LUT with gradient from RED to BLUE
LEADRasterView1.Raster.WindowLevelFillLUT RGB(255, 0, 0), RGB(0, 0, 255), _
nLow, nHigh, _
LEADRasterView1.Raster.MinBit, _
LEADRasterView1.Raster.MaxBit, _
LEADRasterView1.Raster.MinVal, _
LEADRasterView1.Raster.MaxVal, _
0, _
FILLLUT_INSIDE Or FILLLUT_LINEAR Or fSigned

'now use it
RasterProc.WindowLevel LEADRasterView1.Raster


WMFResolution example for Visual Basic

'This example displays the default resolution stored in a WMF,
'changes the resolution to 150 dpi, and then loads the image
'Display resolution stored in WMF
'Note that InfoXRes and InfoYRes will return the same value

Dim RasterIO As New LEADRasterIO

RasterIO.GetFileInfo LEADRasterView1.Raster, _
"v:\compiler\vb40\metafile\arrows\2darrow1.wmf", 0, 0
MsgBox "InfoXRes: " & CStr(RasterIO.InfoXRes) & " InfoYRes: " & _
CStr(RasterIO.InfoYRes)

'Set resolution so WMF is loaded at 150 dpi
RasterIO.WMFResolution = 150
RasterIO.Load LEADRasterView1.Raster, _
"v:\compiler\vb40\metafile\arrows\2darrow1.wmf", _
0, 0, 1


WriteComment example for Visual Basic

Dim RasterIO As New LEADRasterIO
Dim RsaterVar As New LEADRasterVariant
' set the comment
RsaterVar.Type = VALUE_STRING
RsaterVar.StringValue = "Me"
RasterIO.Comment(CMNT_SZARTIST) = RsaterVar
' write the comment into page 1 of TEST.TIF
RasterIO.WriteComment "d:\temp\TEST.TIF", 1
' read the comment and display it
RsaterVar = RasterIO.ReadComment(LEADRasterView1.Raster, _
"d:\temp\TEST.TIF", 1, CMNT_SZARTIST)
MsgBox RsaterVar.StringValue


WriteGeoKey Example for Visual Basic

' Displays a GeoKey
Private Sub DisplayKey(uTag As Integer, uType As Integer, uCount As Integer, data As LEADRasterVariant)
Dim buffer As String

If uType = TAG_ASCII Then
buffer = "ASCII"
Else
If uType = TAG_SHORT Then
buffer = "SHORT"
Else
buffer = "DOUBLE"
End If
End If

buffer = "Key = " + CStr(uTag) + Chr(13) + buffer + Chr(13) + "Count = " + CStr(uCount)
MsgBox buffer

If uType = TAG_SHORT Then
If uCount = 1 Then
buffer = "Key Value = " + CStr(data.ShortValue)
Else
buffer = "Key Value = " + CStr(data.ShortItemValue (0))
End If
Else
If uType = TAG_DOUBLE Then
If uCount = 1 Then
buffer = "Key Value = " + CStr(data.DoubleValue)
Else
buffer = "Key Value = " + CStr(data.DoubleItemValue (0))
End If
End If
End If
MsgBox buffer
End Sub

' This example sets the GTModelTypeGeoKey key (1024), writes it to an existing file and reads the key back
Public RasterIO As LEADRasterIO
Private Sub TestReadFileGeoKey()
Dim rasVar As New LEADRasterVariant
Dim nRet As Integer

rasVar.Type = VALUE_SHORT
rasVar.ShortValue = 1

RasterIO.GeoKeyType = TAG_SHORT
RasterIO.GeoKeyCount = 1
RasterIO.GeoKeyData = rasVar
' set the GTModelTypeGeoKey key
RasterIO.SetGeoKey 1024

' write the GeoKey to an existing file
nRet = RasterIO.WriteFileGeoKey ("GeoTIFF.tif", 0, SAVE_OVERWRITE)
If nRet = 0 Then
nRet = RasterIO.ReadFileGeoKey ("GeoTIFF.tif", 1024)
If nRet = 0 Then
DisplayKey 1024, RasterIO.GeoKeyType, RasterIO.GeoKeyCount, RasterIO.GeoKeyData
End If
End If
End Sub


WriteMarkerAction example for Visual Basic

Private Sub RasterIO_TransformMarker(ByVal iMarker As Integer, ByVal lSize As Long, vData As LEADRasterVariant, ByVal iTransform As Integer)
If iMarker = &HFE Then
Dim RasterVar As New LEADRasterVariant
RsaterVar.Type = VALUE_STRING
RsaterVar.StringValue = "My Comments"
RasterIO.WriteMarkerAction = WRITEMARKER_IGNORE
RasterIO.WriteMarker iMarker, 10, RasterVar
End If
End Sub


WriteMetaData example for Visual Basic

Dim Marker1 As LEADMarkers
Dim RasterIO As LEADRasterIO
Private Sub WriteMetaData _Click()
Marker1.Load "c:\image1.jpg", 0
RasterIO.SetMarkers Marker1,0
RasterIO.WriteMetaData "c:\image2.tif", METADATA_ALL
End Sub


ZigZag Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim XCenter As Integer
Dim YCenter As Integer
XCenter = LEADRasterView1.Raster.BitmapWidth / 2
YCenter = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.ZigZag LEADRasterView1.Raster, _
50, _
1000, _
10, _
0, _
XCenter, _
YCenter, _
0, _
FILL_RPT Or _
ZG_POND


ZoomBlur Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.ZoomBlur LEADRasterView1.Raster, 50, 5, CenterX,CenterY


ZoomIn example for Visual Basic

Note: Also works with Access 95 and 97.

This example calls ZoomIn() method to zoom in on a captured image.

LEADRasterView1.ZoomIn


ZoomInDone example for Visual Basic

Note: Also works with Access 95 and 97.

This example triggers the ZoomInDone event and displays a message that the ZoomIn image has been captured.

Private Sub LEADRasterView1_ZoomInDone(ByVal x As Long, ByVal y As Long)
MsgBox "ZoomIn Captured: " & CStr(x) & "," & CStr(y)
End Sub


ZoomWave Example for Visual Basic

Dim RasterProc As New LEADRasterProcess
Dim CenterX As Integer
Dim CenterY As Integer
CenterX = LEADRasterView1.Raster.BitmapWidth / 2
CenterY = LEADRasterView1.Raster.BitmapHeight / 2
RasterProc.ZoomWave LEADRasterView1.Raster, 20, 10, 0, 0, CenterX,CenterY, RGB(0,0,0), FILL_RPT


Tutorial for Visual Basic Script Programmers

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

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Updating a Gauge and Detecting a User Interrupt

Using a Pan Window

Using Transparent Controls

Using Imaging Common Dialog

Creating, Viewing, and Merging Color Separations

Adding a Color Resolution Dialog

Cropping a Bitmap 2 (Visual Basic Script)

Combining Images with Regions (Visual Basic Script)


Loading and Displaying an Image (Visual Basic Script)

This example dmonstrates how to load and display an image using the LEAD COM object in VBScript. Just copy and paste this code into an HTML file and open it in Internet Explorer. If you wish to run this sample on a computer which does not have LEADTOOLS installed on it, you should create a CAB file for each object you use and an LPK file for the RasterView control and copy them along with the HTML file to that computer and specify the correct paths to those files in the <OBJECT> tages. For information on creating CAB and LPK files please refer to Implementing Internet Features.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()

Dim RASTERVIEW_APPEARANCE_THREED
Dim PAINTDITHER_DIFFUSION
Dim PAINTPALETTE_AUTO
Dim PAINTSIZEMODE_FIT

RASTERVIEW_APPEARANCE_THREED = 1
PAINTPALETTE_AUTO = 0
PAINTSIZEMODE_FIT = 3

'Set defaults for displaying the image.
'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = APPEARANCE_THREED
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 0)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
End Sub

Sub LoadImage()
RasterIO1.Load LeadRasterView1.Raster, "c:\save.jpg", 0, 0, 1
End Sub
//-->
</SCRIPT>

<TITLE>LEADTOOLS VBScript COM Example</TITLE>

</HEAD>

<BODY OnLoad = "Window_OnLoad">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<OBJECT ID="RasterIO1" NAME="RasterIO1"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnLoad" VALUE="Load Image" LANGUAGE="VBScript"
OnClick="LoadImage">
</FORM>
</BODY>
</HTML>


Zooming Out and Zooming In (Visual Basic Script)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD Raster View control:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to create two buttons: "btnZoomIn" and "btnZoomOut":

<INPUT TYPE="button" NAME="btnZoomIn" VALUE="Zoom In" LANGUAGE="VBScript"
OnClick="ZoomIn">

<INPUT TYPE="button" NAME="btnZoomOut" VALUE="Zoom Out" LANGUAGE="VBScript"
OnClick="ZoomOut">

3.

Add the following subroutines between the <SCRIPT> </SCRIPT> tags for the btnZoonIn and btnZoomOut buttons respectively:

Sub ZoomIn()
Dim PAINTSIZEMODE_ZOOM
PAINTSIZEMODE_ZOOM = 4

LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor + 10
LEADRasterView1.ForceRepaint
End Sub

Sub ZoomOut()
Dim PAINTSIZEMODE_ZOOM
PAINTSIZEMODE_ZOOM = 4

LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM
If LEADRasterView1.PaintZoomFactor > 10 Then
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor - 10
End If
End Sub

4.

Run the page to test it.


Dynamically Positioning the Control (Visual Basic Script)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the browser’s area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Delete the <FORM> </FORM> tags and what’s between them and the LoadImage subroutine, and replace the code in the Window_OnLoad subroutine with the following code:

Dim HeightFactor
Dim WidthFactor
Dim HeightAllowed
Dim WidthAllowed
Dim NewWidth
Dim NewHeight

'Modify the browser window’s size and position so that it takes up most of the screen.
NewHeight = Screen.height * 0.8
NewWidth = Screen.width * 0.9
Window.resizeTo NewWidth, NewHeight
Window.moveTo (Screen.Width - NewWidth) / 2, (Screen.Height - NewHeight) / 2
LEADRasterView1.ScaleMode = 3

'Turn off automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = False
LEADRasterView1.BackErase = False

'Load the bitmap. This hard-coded path name may be different on your system.
RasterIO1.Load LeadRasterView1.Raster, "i:\a\pic\20010327047.jpg", 0, 0, 1

'Set the variables used for preserving the aspect ratio.
'The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth
HeightAllowed = NewHeight * 3 / 4
WidthAllowed = NewWidth * 3 / 4

'Check to see if using the maximum width will make the image too tall. Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor
Else
LEADRasterView1.Height = HeightAllowed
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor
End If

'Set the image display size to match the LEAD control
Dim PAINTSIZEMODE_FIT
PAINTSIZEMODE_FIT = 3
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

'Turn on automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = True

3.

Run your page to test it.


Zooming In on a Selection (Visual Basic Script)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Insert the following code between the <HEAD> </HEAD> tags to handle the MouseDown and RubberBand events respectively:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , X , Y)">
<!--
'Enable AutoRubberBand
LEADRasterView1.AutoRubberBand = True
LEADRasterView1.MousePointer = 2
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="RubberBand">
<!--
Dim zoomleft
Dim zoomtop
Dim zoomwidth
Dim zoomheight

LEADRasterView1.MousePointer = 0

'Zoom in on the selection.
zoomleft = LEADRasterView1.RubberBandLeft
zoomtop = LEADRasterView1.RubberBandTop
zoomwidth = LEADRasterView1.RubberBandWidth
zoomheight = LEADRasterView1.RubberBandHeight

'Zoom in on the rectangle defined by the rubberband
LEADRasterView1.ZoomToRect zoomleft, zoomtop, zoomwidth, zoomheight
LEADRasterView1.ForceRepaint
//-->
</SCRIPT>

3.

Run the page to test it.


Outlining, Dragging, and Pasting a Region (Visual Basic Script)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add another LEAD Raster View control named LEADRasterView2:

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/ Ltrvw14n.CAB"
ALIGN="baseline"
BORDER="0"
WIDTH="50%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

4.

Add the following variables between the <SCRIPT> </SCRIPT> tags. In online help, you can use the Edit pull-down menu to copy the block of code:

Dim ReadyToDrag 'The state after marking the region but before dragging
Dim Dragging 'The state when the mouse is used for dragging the floater
Dim StartX 'Starting X position in screen twips
Dim StartY 'Starting Y position in screen twips
Dim FloaterX 'Floater X position in screen twips
Dim FloaterY 'Floater Y position in screen twips
Dim ZoomFactorX 'Used for translating positioning information
Dim ZoomFactorY 'Used for translating positioning information

5.

Add the following code between the <FORM> </FORM> tags to create two buttons: "btnSelRgn" and "btnPasteRgn":

<INPUT TYPE="button" NAME="btnSelRgn" VALUE="Select Region" LANGUAGE="VBScript"
OnClick="SelectRgn">

<INPUT TYPE="button" NAME="btnPasteRgn" VALUE="Paste Region" LANGUAGE="VBScript"
OnClick="PasteRgn">

6.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnSelRgn button:

Sub SelectRgn()
Dim RGNFRAME_ANIMATED
Dim RGNMARK_FREEHAND

RGNFRAME_ANIMATED = 2
RGNMARK_FREEHAND = 4

LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
LEADRasterView1.Raster.RefBitmap = False
LEADRasterView1.RgnMarkingMode = RGNMARK_FREEHAND
MsgBox "Draw a freehand region"
End Sub

7.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnPasteRgn button:

Sub PasteRgn()
Dim LCRgnX
Dim LCRgnY
Dim LCRgnWidth
Dim LCRgnHeight
Dim LBRgnX
Dim LBRgnY
Dim LBRgnWidth
Dim LBRgnHeight
Dim MyOp
Dim CB_OP_ADD
Dim CB_DST_0

CB_OP_ADD = 768
CB_DST_0 = 32

'Do nothing if there is no floater.
If LEADRasterView1.Floater = 0 Then
Exit Sub
End If

'Get the floater into another bitmap
LEADRasterView2.Raster.RefBitmap = False
LEADRasterView2.ScaleMode = LEADRasterView1.ScaleMode
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Floater

'Get the floater's client coordinates into local variables.
LCRgnX = LEADRasterView1.FloaterDstLeft
LCRgnY = LEADRasterView1.FloaterDstTop
LCRgnWidth = LEADRasterView1.FloaterDstWidth
LCRgnHeight = LEADRasterView1.FloaterDstHeight

'Delete the floater.
LEADRasterView1.FloaterVisible = False
LEADRasterView1.Floater = 0

'Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft
LBRgnY = ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop
LBRgnWidth = LCRgnWidth / ZoomFactorX
LBRgnHeight = LCRgnHeight / ZoomFactorY
'Reposition the region to use as a mask for the Combine method.
LEADRasterView1.Raster.OffsetRgn LBRgnX - LEADRasterView1.Raster.RgnLeft, LBRgnY - LEADRasterView1.Raster.RgnTop
'Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0 'Operation flags for a simple paste.
RasterProc.Combine LeadRasterView1.Raster, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2.Raster, 0, 0, MyOp
'Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False
'Free the region.
LEADRasterView1.Raster.FreeRgn
End Sub

8.

Insert the following code between the <HEAD> </HEAD> tags to handle the MouseDown, MouseMove and MouseUp events respectively:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , X , Y)">
<!--
'Enable AutoRubberBand
'LEADRasterView1.AutoRubberBand = True
'LEADRasterView1.MousePointer = 2

Dim BitmapX
Dim BitmapY
Dim NewX
Dim NewY
Dim NewWidth
Dim NewHeight
Dim RGNMARK_NONE

RGNMARK_NONE = 0
'Do nothing if we are drawing a region.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then
Exit Sub
End If

' Save the starting position, in case we need it.
StartY = y
StartX = x

'If we are ready to drag the selection, get a floater.
If ReadyToDrag = True Then
'Translate the current mouse coordinates.
'These coordinates account for the zoom factor and offset.
ZoomFactorX = LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth
ZoomFactorY = LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight
BitmapX = (x / ZoomFactorX) - (LEADRasterView1.DstLeft / ZoomFactorX) + LEADRasterView1.SrcLeft
BitmapY = (y / ZoomFactorY) - (LEADRasterView1.DstTop / ZoomFactorY) + LEADRasterView1.SrcTop

'Continue to create the floater if the mouse is pointing to the region we marked.
If LEADRasterView1.Raster.IsPtInRgn (BitmapX, BitmapY) Then
'Hide the region frame.
LEADRasterView1.RgnFrameType = RGNFRAME_NONE
'Create the floater bitmap, which will be the part of the main bitmap that is
'in the region's bounding rectangle.
LEADRasterView1.Floater = LEADRasterView1.Raster.Bitmap
'Translate the bitmap region coordinates to client area coordinates.
NewY = ((LEADRasterView1.Raster.RgnTop - LEADRasterView1.SrcTop) * ZoomFactorY) + LEADRasterView1.DstTop
NewX = ((LEADRasterView1.Raster.RgnLeft - LEADRasterView1.SrcLeft) * ZoomFactorX) + LEADRasterView1.DstLeft
NewWidth = LEADRasterView1.Raster.RgnWidth* ZoomFactorX
NewHeight = LEADRasterView1.Raster.RgnHeight * ZoomFactorY
'Set the initial display position of the floater.
LEADRasterView1.SetFloaterDstRect NewX, NewY, NewWidth, NewHeight
'Set form-level variables.
FloaterY = LEADRasterView1.FloaterDstTop
FloaterX = LEADRasterView1.FloaterDstLeft
LEADRasterView1.FloaterVisible = True
Dragging = True
ReadyToDrag = False
End If
End If
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseMove(Button, Shift, x, y)">
<!--
Dim xDelta
Dim yDelta
Dim NewX
Dim NewY
Dim NewWidth
Dim NewHeight
Dim RGNMARK_NONE

RGNMARK_NONE = 0
'Do nothing if we are drawing a region.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then
Exit Sub
End If

'Reposition the floater if we are dragging it.
If Dragging = True And Button = 1 And LEADRasterView1.Floater <> 0 Then
If LEADRasterView1.IsPtInFloater(x, y) Then
'Update the position variables.
xDelta = x – StartX
yDelta = y – StartY
NewX = FloaterX + xDelta
NewY = FloaterY + yDelta
NewWidth = LEADRasterView1.Raster.RgnWidth
NewHeight = LEADRasterView1.Raster.RgnHeight
'Reposition the floater.
LEADRasterView1.SetFloaterDstRect NewX, NewY, NewWidth, NewHeight
'Save the form-level position variables.
FloaterY = NewY
FloaterX = NewX
StartY = y
StartX = x
End If
End If
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
Dim RGNMARK_NONE
Dim RGNFRAME_ANIMATED

RGNMARK_NONE = 0
RGNFRAME_ANIMATED = 2
' If we were drawing a region, set up for the next operation.
If LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE Then
LEADRasterView1.RgnMarkingMode = RGNMARK_NONE
LEADRasterView1.RgnFrameType = RGNFRAME_STATIC
ReadyToDrag = True
MsgBox "Now, drag the selection to another place."
End If
//-->
</SCRIPT>

9.

Run your page to test it.


Creating, Viewing, and Merging Color Separations (Visual Basic Script)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add the button btnColorSeparate:

<INPUT TYPE="button" NAME="btnColorSeparate" VALUE="Color Separate" LANGUAGE="VBScript"
OnClick="ColorSeparate">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Dim ClickCount

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnColorSeparate button:

Sub ColorSeparate()
Dim msg
Dim COLORSEP_CMYK

COLORSEP_CMYK = 1

'Turn off the automatic display rectangles.
LEADRasterView1.AutoSetRects = False
LEADRasterView1.Raster.RefBitmap = False
Select Case ClickCount
Case 0
RasterProc.ColorSeparate LeadRasterView1.Raster, COLORSEP_CMYK
'Just for fun, add contrast to the K plane
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(3) 'Copy the K plane
RasterProc.Contrast LeadRasterView1.Raster, 300 'Increase the contrast
RasterProc.ColorPlanes(3) = LEADRasterView1.Raster.Bitmap 'Update the K plane
msg = "Separated. Keep clicking to see separations, then merge"
MsgBox msg
Case 1
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(0) 'Cyan
LEADRasterView1.ForceRepaint
Case 2
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(1) ' Magenta
LEADRasterView1.ForceRepaint
Case 3
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(2) ' Yellow
LEADRasterView1.ForceRepaint
Case 4
LEADRasterView1.Raster.Bitmap = RasterProc.ColorPlanes(3) ' K
LEADRasterView1.ForceRepaint
Case 5
RasterProc.ColorMerge LeadRasterView1.Raster, COLORSEP_CMYK
LEADRasterView1.ForceRepaint
RasterProc.ColorPlanes(0) = 0
RasterProc.ColorPlanes(1) = 0
RasterProc.ColorPlanes(2) = 0
RasterProc.ColorPlanes(3) = 0
msg = "Merged, with more contrast in the K plane"
MsgBox msg
Case Else
ClickCount = -1
msg = "Cycle is finished"
MsgBox msg
End Select
ClickCount = ClickCount + 1
End Sub

6.

Run your page to test it.


Printing Multiple Images (Visual Basic Script)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to create a command button named btnPrint:

<INPUT TYPE="button" NAME="btnPrint" VALUE="Print" LANGUAGE="VBScript" OnClick="PrintImage">

3.

Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Sub PrintImage()
'Declare the variables for pixel measurements
Dim UsableWidth
Dim UsableHeight
Dim MaxImageHeight

'Declare the variables for sizing and positioning the image
Dim PrintLeft
Dim PrintTop
Dim PrintHeight
Dim PrintWidth
Dim CurrentY

CurrentY = 1

'Declare variables used for preserving aspect ratios
Dim WidthFactor
Dim HeightFactor

LEADRasterView1.EnableMethodErrors = False
LEADRasterView1.ScaleMode = 3

'Set the variables used for preserving the aspect ratio
HeightFactor = LEADRasterView1.Raster.BitmapHeight
WidthFactor = LEADRasterView1.Raster.BitmapWidth

'Get the page width and height in pixels (dots)
UsableWidth = LEADRasterView1.PrinterScaleWidth
UsableHeight = LEADRasterView1.PrinterScaleHeight

'Get the maximum height of one image
MaxImageHeight = UsableHeight / 2

'Size and position the first image, preserving the aspect ratio.
'Check to see if using the maximum width will make the image too tall.
'Set the dimensions based on the result.
If ((UsableWidth * HeightFactor / WidthFactor) < MaxImageHeight) Then
PrintLeft = 1
PrintTop = CurrentY
PrintWidth = UsableWidth
PrintHeight = PrintWidth * HeightFactor / WidthFactor
Else
PrintLeft = 1
PrintTop = CurrentY
PrintHeight = MaxImageHeight
PrintWidth = PrintHeight * WidthFactor / HeightFactor
End If

'Print the first image
Dim hDC
hDC = LEADRasterView1.PrintStart
LEADRasterView1.Render hDC, PrintLeft, PrintTop, PrintWidth, PrintHeight

'Update the current printing position
CurrentY = CurrentY + PrintHeight

'Invert the bitmap for the second printing
'to show the difference between the second picture and the first
RasterProc.Invert LeadRasterView1.Raster

'Size and position the second image, preserving the aspect ratio.
'The coding is the same as for the first image.
If ((UsableWidth * HeightFactor / WidthFactor) < MaxImageHeight) Then
PrintLeft = 1
PrintTop = CurrentY
PrintWidth = UsableWidth
PrintHeight = PrintWidth * HeightFactor / WidthFactor
Else
PrintLeft = 1
PrintTop = CurrentY
PrintHeight = MaxImageHeight
PrintWidth = PrintHeight * WidthFactor / HeightFactor
End If

'Print the second image
LEADRasterView1.Render hDC, PrintLeft, PrintTop, PrintWidth, PrintHeight

'Finish the page and finish the print job
LEADRasterView1.PrintEnd hDC
End Sub


Writing and Reading Multipage Files (Visual Basic Script)

Take the following steps to create a multipage file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add another Raster IO object and Raster View control:

<OBJECT ID="RasterIO2" NAME="RasterIO2"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="50%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Modify the LoadImage() procedure as follows:

Dim FILE_TIF
Dim SAVE_OVERWRITE
Dim SAVE_APPEND

FILE_TIF = 3
SAVE_OVERWRITE = 0
SAVE_APPEND = 1

'Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load LeadRasterView1.Raster, "c:\Image1.jpg", 0, 0, 1
RasterIO2.Load LEADRasterView2.Raster, "c:\Image2.jpg", 0, 0, 1

'Save the bitmaps to a single multipage TIFF file
RasterIO1.Save LeadRasterView1.Raster, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE
RasterIO2.Save LEADRasterView2.Raster, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND

'Load the bitmaps from the multipage TIFF file
RasterIO1.Load LeadRasterView1.Raster, "c:\combined.tif", 24, 1, 1
RasterIO2.Load LEADRasterView2.Raster, "c:\combined.tif", 24, 2, 1

4.

Run your page to test it.


Drawing Simple Lines and Shapes (Visual Basic Script)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add the Raster 3D DrawEffect object:

<OBJECT ID="RasterFxd" NAME="RasterFxd"
CLASSID="CLSID:0014072B-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrfd14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Dim DrawObject
Dim StartX
Dim StartY
Dim EndX
Dim EndY

4.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , X , Y)">
<!--
LEADRasterView1.ScaleMode = 3
RasterFxd.ScaleMode = 3
'Save the starting position.
StartX = x
StartY = y
EndX = x
EndY = y
'Cycle through the types of drawing objects.
Select Case DrawObject
Case 0
DrawObject = 1 'Line
Case 1
DrawObject = 2 'Rectangle
Case 2
DrawObject = 0 'Ellipse
Case Else
DrawObject = 0
End Select
RasterFxd.DstLeft = 0
RasterFxd.DstTop = 0
RasterFxd.DstRight = LEADRasterView1.DstWidth
RasterFxd.DstBottom = LEADRasterView1.DstHeight
RasterFxd.SrcLeft = 0
RasterFxd.SrcTop = 0
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight
//-->
</SCRIPT>

5.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseMove event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseMove(Button, Shift, x, y)">
<!--
'Declare local variables.
Dim OldEndX
Dim OldEndY
Dim OldDrawX
Dim OldDrawY
Dim OldWidth
Dim OldHeight
Dim DrawX
Dim DrawY
Dim NewWidth
Dim NewHeight
Dim hDC
Dim DRAWPENSTYLE_SOLID
Dim DRAWMODE_INVERT
Dim DRAWFILLSTYLE_TRANSPARENT

DRAWPENSTYLE_SOLID = 0
DRAWMODE_INVERT = 6
DRAWFILLSTYLE_TRANSPARENT = 1

If Button = 1 Then
'Set the drawing styles.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawMode = DRAWMODE_INVERT
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_TRANSPARENT
RasterFxd.DrawPersistence = False 'On the window, not the bitmap
'Save the previous ending mouse position.
OldEndX = EndX
OldEndY = EndY
'Get the current mouse position.
EndX = x
EndY = y
'Calculate the origin of the current object.
If EndX > StartX Then
DrawX = StartX
Else
DrawX = EndX
End If
If EndY > StartY Then
DrawY = StartY
Else
DrawY = EndY
End If
'Calculate the origin of the previous object.
If OldEndX > StartX Then
OldDrawX = StartX
Else
OldDrawX = OldEndX
End If
If OldEndY > StartY Then
OldDrawY = StartY
Else
OldDrawY = OldEndY
End If
'Calculate the height and width of the current object.
NewHeight = Abs(StartY - EndY)
NewWidth = Abs(StartX - EndX)
'Calculate the height and width of the previous object.
OldHeight = Abs(StartY - OldEndY)
OldWidth = Abs(StartX - OldEndX)
'Erase the old object and draw the new one.
hDC = LEADRasterView1.GetClientDC ()
Select Case DrawObject
Case 0 'Ellipse
RasterFxd.DrawEllipse Nothing, hDC, OldDrawX, OldDrawY, OldWidth, OldHeight
RasterFxd.DrawEllipse Nothing, hDC, DrawX, DrawY, NewWidth, NewHeight
Case 1 'Line
RasterFxd.DrawLine Nothing, hDC, StartX, StartY, OldEndX, OldEndY
RasterFxd.DrawLine Nothing, hDC, StartX, StartY, EndX, EndY
Case 2 'Rectangle
RasterFxd.DrawRectangle Nothing, hDC, OldDrawX, OldDrawY, OldWidth, OldHeight
RasterFxd.DrawRectangle Nothing, hDC, DrawX, DrawY, NewWidth, NewHeight
Case Else
End Select
LEADRasterView1.ReleaseClientDC
End If
//-->
</SCRIPT>

6.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
'Declare local variables.
Dim DrawX
Dim DrawY
Dim NewWidth
Dim NewHeight
Dim DRAWPENSTYLE_SOLID
Dim DRAWMODE_COPY_PEN
Dim DRAWFILLSTYLE_HORIZONTAL_LINE

DRAWPENSTYLE_SOLID = 0
DRAWMODE_COPY_PEN = 13
DRAWFILLSTYLE_HORIZONTAL_LINE = 2
'Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawPenWidth = 2
RasterFxd.DrawPenColor = RGB(255, 0, 0) 'Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN
RasterFxd.DrawFillColor = RGB(0, 255, 0) 'Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE
RasterFxd.DrawPersistence = True 'On the bitmap
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the object.
If EndX > StartX Then
DrawX = StartX
Else
DrawX = EndX
End If
If EndY > StartY Then
DrawY = StartY
Else
DrawY = EndY
End If
'Determine the height and width of the object.
NewHeight = Abs(StartY - EndY)
NewWidth = Abs(StartX - EndX)
'Draw the object
Select Case DrawObject
Case 0 'Ellipse
RasterFxd.DrawEllipse LeadRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight
Case 1 'Line
RasterFxd.DrawLine LeadRasterView1.Raster, 0, StartX, StartY, EndX, EndY
Case 2 'Rectangle
RasterFxd.DrawRectangle LeadRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight
Case Else
End Select
LEADRasterView1.ForceRepaint
//-->
</SCRIPT>

7.

Run your page to test it.


Combining Images with Regions (Visual Basic Script)

Copy the following code into an HTML file to combine two images with a region:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()

Dim RASTERVIEW_APPEARANCE_THREED
Dim PAINTDITHER_DIFFUSION
Dim PAINTPALETTE_AUTO
Dim PAINTSIZEMODE_FIT

RASTERVIEW_APPEARANCE_THREED = 1
PAINTPALETTE_AUTO = 0
PAINTSIZEMODE_FIT = 3

'Set defaults for displaying the image.
'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = APPEARANCE_THREED
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 0)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

LEADRasterView2.Appearance = APPEARANCE_THREED
LEADRasterView2.BorderStyle = 1
LEADRasterView2.BackColor = RGB(255, 255, 0)
LEADRasterView2.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView2.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView2.AutoRepaint = True
LEADRasterView2.AutoSize = False
LEADRasterView2.AutoSetRects = True
LEADRasterView2.PaintSizeMode = PAINTSIZEMODE_FIT
End Sub

Sub LoadImage()
Dim CB_OP_ADD
Dim CB_DST_0

CB_OP_ADD = 768
CB_DST_0 = 32

RasterIO1.Load LeadRasterView1.Raster, "c:\save.jpg", 0, 0, 1
RasterIO1.Load LeadRasterView2.Raster, "c:\sample2.cmp", 0, 0, 1

LEADRasterView1.Raster.SetRgnRect 100, 100, 300, 300, 0
LEADRasterProc.Combine LEADRasterView1.Raster, 100, 100, 300, 300, LEADRasterView2.Raster, 0, 0, CB_OP_ADD + CB_DST_0
LEADRasterView1.Raster.FreeRgn
End Sub
//-->
</SCRIPT>

<TITLE>LEADTOOLS VBScript COM Example</TITLE>

</HEAD>

<BODY OnLoad = "Window_OnLoad">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<OBJECT ID="RasterIO1" NAME="RasterIO1"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnLoad" VALUE="Load Image" LANGUAGE="VBScript"
OnClick="LoadImage">
</FORM>
</BODY>
</HTML>


Cropping a Bitmap (Visual Basic Script)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.):

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add two buttons: btnCrop and btnTrim:

<INPUT TYPE="button" NAME="btnSelectRect" VALUE="Select Rectangle" LANGUAGE="VBScript"
OnClick="SelectRect">

<INPUT TYPE="button" NAME="btnTrim" VALUE="Trim Image" LANGUAGE="VBScript"
OnClick="Trim">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Dim Cropping 'The state when the mouse is used for cropping
Dim StartX 'Starting X position in screen pixels
Dim StartY 'Starting Y position in screen pixels
Dim EndX 'Ending X position in screen pixels
Dim EndY 'Ending Y position in screen pixels

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnCrop and btnTrim buttons respectively:

Sub SelectRect()
'Set the scale mode to twips so that we do not have to
'translate mouse coordinates
LEADRasterView1.ScaleMode = 1
'Initialize cropping so that you can do it more than once
If Cropping = True Then
'Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect LEADRasterView1.DstLeft, LEADRasterView1.DstTop, LEADRasterView1.DstWidth, LEADRasterView1.DstHeight
'Display the image
LEADRasterView1.ForceRepaint
End If
'Set a global variable to let other events know that you are cropping
Cropping = True
'Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2
End Sub

Sub Trim()
'Trim the bitmap.
RasterProc.Trim LeadRasterView1.Raster, 0, 0, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight
End Sub

6.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , X , Y)">
<!--
'Save the starting position
StartX = x
StartY = y
'Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = False
//-->
</SCRIPT>

7.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseMove event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseMove(Button, Shift, x, y)">
<!--
Dim rbX
Dim rbY
Dim rbWidth
Dim rbHeight
If Cropping = True And Button = 1 Then
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
If EndX > StartX Then
rbX = StartX
Else
rbX = EndX
End If
If EndY > StartY Then
rbY = StartY
Else
rbY = EndY
End If
'Determine the height and width of the rubberband rectangle
rbHeight = Abs(StartY - EndY)
rbWidth = Abs(StartX - EndX)
'Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect rbX, rbY, rbWidth, rbHeight
'Alternatively, you could use the following properties to set the
'rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight
LEADRasterView1.RubberBandLeft = rbX
LEADRasterView1.RubberBandTop = rbY
LEADRasterView1.RubberBandWidth = rbWidth
'Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = True
End If
//-->
</SCRIPT>

8.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
Dim CropLeft
Dim CropTop
Dim CropWidth
Dim CropHeight
If Cropping = True Then
'Get the current mouse position
EndX = x
EndY = y
'Get the origin of the clipping rectangle.
'Allow for different mouse drag directions
If StartX < EndX Then
CropLeft = StartX
Else
CropLeft = EndX
End If
If StartY < EndY Then
CropTop = StartY
Else
CropTop = EndY
End If
'Get the height and width of the cropped area
CropWidth = Abs(EndX - StartX)
CropHeight = Abs(EndY - StartY)
'Crop and repaint the image
LEADRasterView1.SetDstClipRect CropLeft, CropTop, CropWidth, CropHeight
LEADRasterView1.ForceRepaint
LEADRasterView1.RubberBandVisible = False
LEADRasterView1.MousePointer = 0 'Default
End If
//-->
</SCRIPT>

9.

Run your page to test it.


Cropping a Bitmap 2 (Visual Basic Script)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.):

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> and </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> and </FORM> tags to add Two buttons: btnCropp and btnTrim:

<INPUT TYPE="button" NAME="btnSelectRect" VALUE="Select Rectangle" LANGUAGE="VBScript"
OnClick="SelectRect">

<INPUT TYPE="button" NAME="btnTrim" VALUE="Trim Image" LANGUAGE="VBScript"
OnClick="Trim">

4.

Add the following code between the <SCRIPT> and </SCRIPT> tags:

Dim Cropping 'The state when the mouse is used for cropping
Dim StartX 'Starting X position in screen pixels
Dim StartY 'Starting Y position in screen pixels
Dim EndX 'Ending X position in screen pixels
Dim EndY 'Ending Y position in screen pixels

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnCrop and btnTrim buttons respectively:

Sub SelectRect()
LEADRasterView1.EnableFireMouse2Event = True
'Set the scale mode to twips so that we do not have to
'translate mouse coordinates
LEADRasterView1.ScaleMode = 1
'Initialize cropping so that you can do it more than once
If Cropping = True Then
'Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect LEADRasterView1.DstLeft, LEADRasterView1.DstTop, LEADRasterView1.DstWidth, LEADRasterView1.DstHeight
'Display the image
LEADRasterView1.ForceRepaint
End If

'Set a global variable to let other events know that you are cropping
Cropping = True
'Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2
End Sub

Sub Trim()
'Trim the bitmap.
RasterProc.Trim LEADRasterView1.Raster, 0, 0, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight
End Sub

6.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown2 event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseDown2(Button, Shift , X , Y)">
<!--
'Save the starting position
StartX = x
StartY = y
'Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = False
//-->
</SCRIPT>

7.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseMove2 event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseMove2(Button, Shift, x, y)">
<!--
Dim rbX
Dim rbY
Dim rbWidth
Dim rbHeight
If Cropping = True And Button = 1 Then
'Get the current mouse position
EndX = x
EndY = y
'Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
If EndX > StartX Then
rbX = StartX
Else
rbX = EndX
End If
If EndY > StartY Then
rbY = StartY
Else rbY = EndY
End If
'Determine the height and width of the rubberband rectangle
rbHeight = Abs(StartY - EndY)
rbWidth = Abs(StartX - EndX)
'Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect rbX, rbY, rbWidth, rbHeight
'Alternatively, you could use the following properties to set the
'rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight
LEADRasterView1.RubberBandLeft = rbX
LEADRasterView1.RubberBandTop = rbY
LEADRasterView1.RubberBandWidth = rbWidth
'Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = True
End If
//-->
</SCRIPT>

8.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp2 event:

<SCRIPT LANGUAGE="VBScript" FOR="LEADRasterView1" EVENT="MouseUp2(Button, Shift, x, y)">
<!--
Dim CropLeft
Dim CropTop
Dim CropWidth
Dim CropHeight

If Cropping = True Then
'Get the current mouse position
EndX = x
EndY = y
'Get the origin of the clipping rectangle.
'Allow for different mouse drag directions
If StartX < EndX Then
CropLeft = StartX
Else
CropLeft = EndX
End If
If StartY < EndY Then
CropTop = StartY
Else
CropTop = EndY
End If
'Get the height and width of the cropped area
CropWidth = Abs(EndX - StartX)
CropHeight = Abs(EndY - StartY)
'Crop and repaint the image
LEADRasterView1.SetDstClipRect CropLeft, CropTop, CropWidth, CropHeight
LEADRasterView1.ForceRepaint
LEADRasterView1.RubberBandVisible = False
LEADRasterView1.MousePointer = 0 'Default
End If
//-->
</SCRIPT>

9.

Run your page to test it.


Updating a Gauge and Detecting a User Interrupt (Visual Basic Script)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <BODY> </BODY> tags to add a Microsoft ProgressBar object named ProgressBar1:

<OBJECT id=ProgressBar1
style="WIDTH: 667px; HEIGHT: 31px; BACKGROUND-COLOR: white"
classid=clsid:0714E8D2-850A-101B-AFC0-4210102A8DA7 VIEWASTEXT>
</OBJECT>

4.

Add the following code between the <FORM> </FORM> tags to create a command button named btnMedian:

<INPUT TYPE="button" NAME="btnMedian" VALUE="Median" LANGUAGE="VBScript" OnClick="Median">

5.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Sub Median()
RasterProc.EnableProgressEvent = True
RasterProc.Median LeadRasterView1.Raster, 4
LEADRasterView1.ForceRepaint
End Sub

6.

Add the following code between the <HEAD> </HEAD> tags to handle the ProgressStatus event:

<SCRIPT LANGUAGE="VBScript" FOR="RasterProc" EVENT="ProgressStatus(iPercent)">
<!--
ProgressBar1.Value = iPercent
//-->
</SCRIPT>

7.

Run your page to test it.


Using a Pan Window (Visual Basic Script)

Take the following steps to add a Pan Window to your page:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to add the button btnPanWnd:

<INPUT TYPE="button" NAME="btnPanWnd" VALUE="Pan Window" LANGUAGE="VBScript"
OnClick="PanWnd">

3.

Delete the following line from the Window_OnLoad subroutine:

Lead1.PaintSizeMode = PAINTSIZEMODE_FIT

4.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnPanWnd button:

Sub PanWnd()
With LEADRasterView1
.BackErase = False
'set the location of the PanWindow
.PanWinX = 100
.PanWinY = 100
'set the size of the PanWindow
'requested width
.PanWinWidth = 150
'requested height
.PanWinHeight = 200
.PanWinTitle = "PanWindow"
.PanWinRectColor = RGB(0, 0, 255)
.PanWinSysMenu = True
'use the settings for LEADRasterView1.
.PanWinPaintPalette = .PaintPalette
.PanWinBitonalScaling = .BitonalScaling
.PanWinPaintScaling = .PaintScaling
.PanWinPaintDither = .PaintDither
'show the Pan Window
.ShowPanWin True
End With
End Sub

5.

Run your page to test it.


Using Transparent Controls (Visual Basic Script)

The following example creates a web page with a bitmap as its background, and then adds a RasterView control. You can then press the button at the bottom of the page to toggle the transparency of the control.

1.

Create an new HTML file and copy the following code to it ans save:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
LEADRasterView1.RasterUnk.CreateBitmap 500, 150, 24
RasterProc.Fill LEADRasterView1.RasterUnk, 255

RasterFxd.TextTop = 50
RasterFxd.TextLeft = 0
RasterFxd.TextWidth = LEADRasterView1.DstWidth
RasterFxd.TextHeight = LEADRasterView1.DstHeight
RasterFxd.DrawFontColor = RGB(0, 255, 0)
RasterFxd.Font.Size = 18
RasterFxd.DrawPersistence = True
RasterFxd.DrawText LEADRasterView1.RasterUnk, 0, "Press the button below to toggle transparency", 0
End Sub

Sub ToggleTransparency()
If LEADRasterView1.Transparent = True Then
LEADRasterView1.Transparent = false
Else
LEADRasterView1.Transparent = True
End If
End Sub
//-->
</SCRIPT>

<TITLE>LEADTOOLS JavaScript COM Example</TITLE>

</HEAD>

<BODY OnLoad = "Window_OnLoad()" BACKGROUND="c:\save.jpg">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="90%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterFxd" NAME="RasterFxd"
CLASSID="CLSID:0014072B-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrfd14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnToggleTransparency" VALUE="Toggle Transparency" LANGUAGE="VBScript"
OnClick="ToggleTransparency">
</FORM>
</BODY>
</HTML>


Using Imaging Common Dialog (Visual Basic Script)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code to add the imaging file common dialog COM object to your page:

<OBJECT ID="LEADRasterDlg1" NAME="LEADRasterDlg1"
CLASSID="CLSID: 00140B79-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrdg14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Modify the LoadImage procedure as follows:

Dim nRet
Dim DLG_FO_AUTOPROCESS
Dim DLG_FO_PROGRESSIVE
Dim DLG_FO_MULTIPAGE
Dim DLG_FO_LOADROTATED
Dim DLG_FO_LOADCOMPRESSED
Dim DLG_FO_FILEINFO
Dim DLG_FO_SHOWPREVIEW

DLG_FO_AUTOPROCESS = 1
DLG_FO_PROGRESSIVE = 2
DLG_FO_MULTIPAGE = 4
DLG_FO_LOADROTATED = 8
DLG_FO_LOADCOMPRESSED = 16
DLG_FO_FILEINFO = 32
DLG_FO_SHOWPREVIEW = 64

LEADRasterDlg1.FileDlgFlags  = 0
LEADRasterDlg1.DialogTitle  = "Open a File"
LEADRasterDlg1.Filter  = "All|*.*|CMP|*.cmp|JPEG|*.jpg"
LEADRasterDlg1.FilterIndex  = 2 'look for .cmp first
LEADRasterDlg1.InitialDir  = "s:\temp\images\"
LEADRasterDlg1.LoadPasses  = 0
LEADRasterDlg1.LoadRotated  = True
LEADRasterDlg1.LoadCompressed  = False
LEADRasterDlg1.Raster = LeadRasterView1.Raster

LEADRasterDlg1.UIFlags  = DLG_FO_AUTOPROCESS + DLG_FO_PROGRESSIVE + DLG_FO_MULTIPAGE + DLG_FO_LOADROTATED + DLG_FO_LOADCOMPRESSED + DLG_FO_FILEINFO + DLG_FO_SHOWPREVIEW

nRet = LEADRasterDlg1.ShowOpenDlg
  LEADRasterView1.Window

If (nRet = 0) Then
LEADRasterView1.ForceRepaint
End If

4.

Run you page to test it.


Creating and Using Annotations (Visual Basic Script)

Note: | This topic is for Document/Medical only.
Note: | You’ll need to call the UnlockSupport method to unlock Document Imaging capability.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following line between the <SCRIPT> and </SCRIPT> tags:

Dim NewTag

3.

Add the following code between the <BODY> and </BODY> tags to add the annotations COM object:

<OBJECT ID="RasterAnn" NAME="RasterAnn"
CLASSID="CLSID:00140723-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltran14n.CAB">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

4.

Add the following code to the Window_OnLoad() procedure:

RasterAnn.AnnParentRasterView = LEADRasterView1

'Enable left button drawing of annotations
RasterAnn.AnnAutoDrawEnable = True

'Enable right-click to display annotation menus
RasterAnn.AnnAutoMenuEnable = True
NewTag = 0

5.

Add the following code between the <FORM> </FORM> tags to create four buttons:

<INPUT TYPE="button" NAME="btnStart" VALUE="Start" LANGUAGE="VBScript"
OnClick="Start">

<INPUT TYPE="button" NAME="btnSave" VALUE="Save" LANGUAGE="VBScript"
OnClick="Save">

<INPUT TYPE="button" NAME="btnCopy" VALUE="Copy" LANGUAGE="VBScript"
OnClick="Copy">

<INPUT TYPE="button" NAME="btnRealize" VALUE="Realize" LANGUAGE="VBScript"
OnClick="Realize">

6.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnStart button:

Sub Start()
Dim ANN_USERMODE_DESIGN
Dim ANN_TOOL_BUTTON
Dim ANN_USERMODE_RUN

ANN_USERMODE_DESIGN = 1
ANN_TOOL_BUTTON = 13
ANN_USERMODE_RUN = 2

'Use the button to toggle between design mode and run mode
If LEADForm.btnStart.Value = "Start" Then
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.AnnTool = ANN_TOOL_BUTTON
'Make run mode the next thing.
LEADForm.btnStart.Value = "Run Mode"
MsgBox "In design mode now. Draw a button object."
ElseIf LEADForm.btnStart.Value = "Design Mode" Then
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.AnnTool = ANN_TOOL_BUTTON
'Make run mode the next thing.
LEADForm.btnStart.Value = "Run Mode"
Else 'The button takes us to run mode
RasterAnn.AnnUserMode = ANN_USERMODE_RUN
MsgBox "Click on your new button"
LEADForm.btnStart.Value = "Design Mode"
End If
End Sub

7.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnSave button:

Sub Save()
Dim nRet
Dim ANN_USERMODE_DESIGN
Dim ANN_FMT_NATIVE
Dim SAVE_OVERWRITE

ANN_USERMODE_DESIGN = 1
ANN_FMT_NATIVE = 0
SAVE_OVERWRITE = 0

'Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = False
'Use the button to toggle between saving and loading annotations
If LEADForm.btnSave.Value = "Save" Then
'Do nothing if there are no annotations.
If RasterAnn.AnnContainer = 0 Then Exit Sub
'Save the all annotations.
nRet = RasterAnn.AnnSave("c:\tmp.ann", ANN_FMT_NATIVE, False, SAVE_OVERWRITE, 0)
If nRet = 0 Then
LEADForm.btnSave.Value = "Load"
MsgBox "Use the right mouse button to delete any annotations, then click Load"
Else
MsgBox "Error code: " & CStr(nRet)
End If
Else 'We are loading annotations
'Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
'Load the annotations.
nRet = RasterAnn.AnnLoad("c:\tmp.ann", 1)
If nRet = 0 Then
LEADForm.btnSave.Value = "Save"
Else
MsgBox "No annotations to load"
End If
End If
End If
End Sub

8.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnCopy button:

Sub Copy()
Dim nRet
Dim ANN_USERMODE_DESIGN
Dim ANN_FMT_NATIVE

ANN_USERMODE_DESIGN = 1
ANN_FMT_NATIVE = 0
'Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = False
'Use the button to toggle between copying and pasting annotations
If LEADForm.btnCopy.Value = "Copy" Then
'Do nothing if there are no annotations.
If RasterAnn.AnnContainer = 0 Then Exit Sub
'Copy all annotations to the clipboard.
nRet = RasterAnn.AnnCopy(ANN_FMT_NATIVE, False, True)
If nRet = 0 Then
'Make pasting the next thing.
LEADForm.btnCopy.Value = "Paste"
MsgBox "Use the right mouse button to delete any annotations, then click Paste"
Else
MsgBox "Error code: " + CStr(nRet)
End If
Else 'We are pasting annotations
'Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
'Paste the annotations
If RasterAnn.AnnPasteReady Then
nRet = RasterAnn.AnnPaste
LEADForm.btnCopy.Value = "Copy"
Else
MsgBox "No annotations to paste"
End If
End If
End If
End Sub

9.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnRealize button:

Sub Realize()
RasterAnn.AnnRealize False
LEADRasterView1.ForceRepaint
MsgBox "Annotations are now rendered to the bitmap"
End Sub

10.

Add the following code between the <HEAD> </HEAD> tags to for handling the OnAnnCreate, OnAnnDrawn, OnAnnClicked and OnAnnDestroy events respectively:

<SCRIPT LANGUAGE="VBScript" FOR="RasterAnn" EVENT="OnAnnCreate(hAnnObject)">
<!--
RasterAnn.AnnSetForeColor hAnnObject, RGB(255, 255, 0), False
Dim ANN_OBJECT_BUTTON
Dim ANN_OBJECT_HOTSPOT

ANN_OBJECT_BUTTON = 3
ANN_OBJECT_HOTSPOT = 7
RasterAnn.AnnGetType hAnnObject
If RasterAnn.AnnType = ANN_OBJECT_BUTTON Or RasterAnn.AnnType = ANN_OBJECT_HOTSPOT
Then NewTag = NewTag + 1
RasterAnn.AnnSetTag hAnnObject, NewTag
End If
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="RasterAnn" EVENT="OnAnnDrawn(hAnnObject)">
<!--
Dim ANN_TOOL_SELECT
ANN_TOOL_SELECT = 0

RasterAnn.AnnTool = ANN_TOOL_SELECT
MsgBox "Use the right mouse button to modify this object; then click on Run Mode to test it."
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="RasterAnn" EVENT="OnAnnClicked(hAnnObject)">
<!--
Dim lTag
RasterAnn.AnnGetTag hAnnObject
LTag = RasterAnn.AnnTag
MsgBox "This is what we do for the button tagged " + CStr(lTag)
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" FOR="RasterAnn" EVENT="OnAnnDestroy(hAnnObject)">
<!--
Dim lTag
RasterAnn.AnnGetTag hAnnObject
LTag = RasterAnn.AnnTag
MsgBox "The object tagged " + CStr(lTag) + " is deleted."
//-->
</SCRIPT>

11.

Run your page to test it.


Adding a Color Resolution Dialog (Visual Basic Script)

1. | Start with the project you created in Using Imaging Common Dialog
2. | Add the following code to add the imaging color common dialog COM object to your page:

<OBJECT ID="LEADRasterDlg2" NAME="LEADRasterDlg2"
CLASSID="CLSID: 00140B4F-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrdg14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add a new command button:

<INPUT TYPE="button" NAME="btnColorRes" VALUE="Color Resolution" LANGUAGE="VBScript"
OnClick="ColorRes">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

Sub ColorRes()
Dim DLG_CR_BITALL
Dim DLG_CR_PAL_ALL
Dim DLG_CR_DITHER_ALL
Dim DLG_CR_SHOWPREVIEW
Dim DLG_CR_AUTOPROCESS
Dim DLG_CR_ORDER

DLG_CR_BITALL = 16383
DLG_CR_PAL_ALL = 1065353216
DLG_CR_DITHER_ALL = 8372224
DLG_CR_SHOWPREVIEW = 1
DLG_CR_AUTOPROCESS = 2
DLG_CR_ORDER = 32

LEADRasterDlg1.BitsPerPixel = 0
LEADRasterDlg1.PaletteFlags = 0
LEADRasterDlg1.DitherFlags = 0
LEADRasterDlg1.Raster = LeadRasterView1.Raster 'assign the bitmap for processing
LEADRasterDlg1.ColorResFlags = DLG_CR_BITALL + DLG_CR_PAL_ALL + DLG_CR_DITHER_ALL
LEADRasterDlg1.UIFlags = DLG_CR_SHOWPREVIEW + DLG_CR_AUTOPROCESS + DLG_CR_ORDER
LEADRasterDlg1.ShowColorResDlg LEADRasterView1.Window
LEADRasterView1.ForceRepaint
End Sub

5.

Run your page to test it.


Tutorial for Visual C++ 5.0 Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS COM Objects. Note that the COM Objects require the MFC 4.2 files, which are described in System Files Updated.

Implementing the LEADTOOLS COM Objects in Visual C++ 5.0 and later is much different than with earlier versions of Visual C++. These instructions were developed with version 5.0, except for the Implementing a Database with the MS ADO Data Control tutorial, which requires version 6.0.

For general information about the syntax requirements of this interface, refer to Visual C++ 5.0 Syntax.

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Using ODBC to Access Image Data

Implementing a Database with the MS ADO Data Control

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Cropping a Bitmap2 (C++ 5.0 and later)

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Creating an MDI Application

Using the Magnifying Glass

Using the Magnifying Glass (2)

Using a PanWindow

Print a Real Image Size in Inches

Combining Images with Regions

Miscellaneous Examples


Loading and Displaying an Image (Visual C++ 5.0)

Loading and Displaying an Image (C++ 5.0 and later)

Take the following steps to start a project and to add some code that positions, scales, and displays an image in a dialog box.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify tutor.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrio14n.dll" no_namespace, named_guids, exclude("LoadResizeConstants")
#import "c:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids

8. | Add a LEAD RasterView control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the tutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_TUTOR_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEAD RasterView Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that both CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEAD RasterView control icon; then size and position the control as you want it to appear at run time.
 | l. | Use the right mouse button to edit the properties of the new LEAD RasterView control.
 | m. | Change the ID to IDC_LEADRASTERVIEW1.
9. | Add a command button to your form and name it as follows:
 | ID | Caption
 | IDC_LOADLEAD | Load Image
10. | Press Ctrl-F4 to close all windows back to the Project Workspace.
11. | Do the following to add m_LEADRasterView1 to the CTutorDlg class and link the variable to the LEAD RasterView control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
12. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the tutor classes folder to open it.
 | c. | Expand the CTutorDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
13. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.

m_LEADRasterView1.SetAppearance(RASTERVIEW_APPEARANCE_FLAT);
m_LEADRasterView1.SetBorderStyle(1);
m_LEADRasterView1.SetBackColor(RGB(255, 255, 125));
m_LEADRasterView1.SetPaintDither(PAINTDITHER_DIFFUSION);
m_LEADRasterView1.SetPaintPalette(PAINTPALETTE_AUTO);
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAutoSize(FALSE);
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);

14. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LOADLEAD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnLoadlead).
 | f. | Click the Edit Code button and enter the following code: (you will have to change to file name to an existing image file name on your computer)

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "d:\\temp\\24bit.bmp", 0, 0, 1);
pRasterIO->Release();

15. | To accommodate a 256-color display driver, continue with the remaining steps, which send WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages to the LEADTOOLS RasterView ActiveX.
16. | In the Project Workspace, click the FileView tab.
17. | Edit the TUTORDLG.H file and insert the following lines in the definition of CTutorDlg class, just before DECLARE_MESSAGE_MAP():

afx_msg BOOL OnQueryNewPalette();
afx_msg void OnPaletteChanged( CWnd *pwin );

18.

Edit the TUTORDLG.CPP file and insert at the top of the file after the #include statement:

#include "leadraster.h"

19.

Edit the TUTORDLG.CPP file and insert the following lines between the lines: BEGIN_MESSAGE_MAP(CTutorDlg, CDialog) and END_MESSAGE_MAP():

ON_WM_QUERYNEWPALETTE()
ON_WM_PALETTECHANGED()

20.

Go to the end of TUTORDLG.CPP file and insert the following two functions:

BOOL CTutorDlg::OnQueryNewPalette()
{
if(!IsWindow(m_LEADRasterView1.m_hWnd))
return FALSE;
return m_LEADRasterView1.SendMessage(WM_QUERYNEWPALETTE);
}
void CTutorDlg::OnPaletteChanged(CWnd* pFocusWnd)
{
if(pFocusWnd->m_hWnd == m_hWnd || !IsWindow(m_LEADRasterView1.m_hWnd))
return;
m_LEADRasterView1.SendMessage(WM_PALETTECHANGED, (WPARAM) pFocusWnd->m_hWnd);
}

21. | On the main menu, select Build > Build tutor.exe to build the project.
22. | On the main menu, select Build > Execute tutor.exe to run the project.


Loading and Saving Images Using Databases (Visual C++ 5.0)

Loading and Saving Images Using Databases (C++ 5.0 and later)

Take the following steps to start a project and to add some code that demonstrates adding images to or deleting images from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify ImageBlob.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls.
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ImageBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the header files reside):

#import <C:\\Windows\\system32\\LTRVR14N.DLL> no_namespace, named_guids
#import <C:\\Windows\\system32\\LTR14n.DLL> no_namespace, named_guids
#import <C:\\Windows\\system32\\LTRIO14n.DLL> no_namespace, named_guids

8. | Add #import statements to your program so you can access the Microsoft ActiveX Data Object 2.6 Library:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ImageBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the .tlb files reside):

#import <C:\\Windows\\system32\\msado26.tlb> rename("EOF", "ADOEOF")
using namespace ADODB

9. | Add a LEADRasterView control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the ImageBlob resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_IMAGEBLOB_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEADRasterView Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEADRasterView Control icon; then size and position the control as you want it to appear at run time.

10. | Add six command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_CONNECT | &Connect To Database
 | IDC_DISCONNECT | &Disconnect From Data Base
 | IDC_ADDRECORD | &Add Record
 | IDC_DELETERECORD | D&elete Record
 | IDC_MOVENEXT | Move &Next
 | IDC_MOVEPREVIOUS | Move &Previous
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.

12. | Do the following to add m_LEADRasterView1 to the CImageBlobDlg class and link the variable to the LEADRasterView control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CImageBlobDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_RasterView as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
13. | Do the following to add m_btnAddRecord to the CImageBlobDlg class and link the variable to the CButton control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CImageBlobDlg.
 | d. | In the Control IDs list, select IDC_ADDRECORD.
 | e. | Click the Add Variable... button.
 | f. | Specify m_btnAddRecord as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.

14. | Repeat step 13 for the other buttons, using the following variable names:
 | ID | Member Variable Name
 | IDC_MOVEPREVIOUS | m_btnMovePrevious
 | IDC_MOVENEXT | m_btnMoveNext
 | IDC_DISCONNECT | m_btnDisconnect
 | IDC_DELETERECORD | m_btnDeleteRecord
 | IDC_CONNECT | m_btnConnect
15. | Add the following Member Variables to the CImageBlobDlg class:
 | ILEADRasterIO | *m_pltRasterIO
 | _ConnectionPtr | m_pConnection;
 | _RecordsetPtr | m_pRecordset;

16. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the ImageBlob classes folder to open it.
 | c. | Expand the CImageBlobDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
17. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

CoInitialize(NULL);
ILEADRasterIO *pltRasterIO = NULL;
::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pltRasterIO);

pltRasterIO->Load(m_RasterView.GetRaster(),"c:\\parrots.jpg",0,0,1);

m_pConnection.CreateInstance(__uuidof( Connection) );
m_pRecordset.CreateInstance(__uuidof(Recordset));

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and enter the following code: (you will have to change to file name to an existing database file name on your computer)

HRESULT hr;
_bstr_t bstrQuery("SELECT * FROM Images");
_variant_t vNull;
vNull.vt = VT_ERROR ;
vNull.scode = DISP_E_PARAMNOTFOUND ;

if (m_pConnection->State == adStateClosed)
{
hr = m_pConnection->Open( _bstr_t(L"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= DB1.mdb;"),
_bstr_t(L""), _bstr_t(L""), adModeUnknown ) ;
}

if (SUCCEEDED(hr))
{
m_pRecordset->PutRefActiveConnection(m_pConnection);
hr = m_pRecordset->Open(_variant_t(bstrQuery), vNull, adOpenKeyset, adLockOptimistic, adCmdText );

if (SUCCEEDED(hr))
{
if(!m_pRecordset->GetBOF())
{
m_pRecordset->MoveFirst();
}

if (!m_pRecordset->GetADOEOF())
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

m_btnAddRecord.EnableWindow(TRUE);
}
}

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateOpen)
{
m_pConnection->Close();
}

if (m_pRecordset->State == adStateOpen )
{
m_pRecordset->Close();
}

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

20. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_ADDRECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddRecord).
 | f. | Click the Edit Code button and enter the following code:

SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
long ix[1];
int nSize;

ILEADRasterVariant *pRasterVariant = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

m_pRecordset->AddNew();

pRasterVariant = m_pltRasterIO->SaveArray(m_RasterView.GetRaster(),
FILE_BMP, 0, (QFactorConstants)0);

nSize = pRasterVariant->ItemCount;

sabFldData[0].cElements = nSize ;
sabFldData[0].lLbound = 0;
SAFEARRAY * psaFieldData = SafeArrayCreate(VT_I1, 1, sabFldData);

for ( int i = 0; i < nSize; ++i)
{
ix[0] = i;
long data = pRasterVariant->GetShortItemValue(i);
HRESULT hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

VariantInit(&vData);
V_VT(&vData) = VT_ARRAY | VT_UI1;
vData.parray = psaFieldData;

m_pRecordset->Fields->Item[_variant_t( (long) 1)]->Value = _variant_t(vData);
m_pRecordset->Fields->Item[_variant_t( (long) 2)]->Value = _variant_t( (long) nSize);

m_pRecordset->Update();

if(m_pRecordset->RecordCount >= 0)
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

VariantClear(&vData);
pRasterVariant->Release();

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_DELETERECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDeleteRecord).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF() || !m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveLast();
m_pRecordset->Delete(adAffectCurrent);
m_pRecordset->Update();

if(m_pRecordset->RecordCount <= 0)
{
m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);
}
}

22. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVENEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMoveNext).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;

ILEADRasterVariant *pRasterVariant = NULL;
::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveNext();
}

if (m_pRecordset->GetADOEOF())
{
MessageBox(TEXT("Unable to get the Image from db"));
m_pRecordset->MovePrevious();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;

if(vData.vt == (VT_ARRAY | VT_UI1))
{
pRasterVariant-> Type = VALUE_ARRAY_BYTE;
pRasterVariant-> ItemCount = nSize;
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pRasterVariant-> PutShortItemValue (i, (short)data);
}
}

nRet = m_pltRasterIO-> LoadArray (m_RasterView.GetRaster(),pRasterVariant, 0, 0, -1, nSize);
}
}

pRasterVariant->Release();

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVEPREVIOUS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMovePrevious).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;

ILEADRasterVariant *pRasterVariant = NULL;
::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF())
{
m_pRecordset->MovePrevious();
}

if (m_pRecordset->GetBOF())
{
MessageBox(TEXT("Unable to get the image from the database"));
m_pRecordset->MoveNext();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;

if(vData.vt == (VT_ARRAY | VT_UI1))
{
pRasterVariant-> Type = VALUE_ARRAY_BYTE;
pRasterVariant-> ItemCount = nSize;
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pRasterVariant-> PutShortItemValue (i, (short)data);
}
}

nRet = m_pltRasterIO-> LoadArray (m_RasterView.GetRaster(),pRasterVariant, 0, 0, -1, nSize);
}
}

pRasterVariant->Release();

24. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Messages list box, select WM_CLOSE.
 | d. | Click the Add function button. Choose OK for the default function name (OnClose).
 | e. | Click the Edit Code button and enter the following code:

if(m_pltRasterIO)
m_pltRasterIO ->Release();

CoUninitialize();

25.

Open the IMAGEBLOBDLG.CPP file and add the following line after the #include statements:

#include "leadraster.h"

26. | On the main menu, select Build > Build ImageBlob.exe to build the project.
27. | On the main menu, select Build > Execute ImageBlob.exe to run the project.


Zooming Out and Zooming In (Visual C++ 5.0)

Zooming Out and Zooming In (C++ 5.0 and later)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD RasterView control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add two command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_ZOOMIN | Zoom In
 | IDC_ZOOMOUT | Zoom Out
5. | Press Ctrl-F4 to close all windows back to the Project Workspace.
6. | To add code for the Zoom Out button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_ZOOMOUT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnZoomout).
 | f. | Click the Edit Code button, and enter the following code:

m_LEADRasterView1.SetAutoSetRects( TRUE);
m_LEADRasterView1.SetPaintSizeMode( PAINTSIZEMODE_ZOOM);
if (m_LEADRasterView1.GetPaintZoomFactor() > 10)
{
m_LEADRasterView1.SetPaintZoomFactor(m_LEADRasterView1.GetPaintZoomFactor() - 10);
}

7. | To add code for the Zoom In button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_ZOOMIN.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnZoomIn).
 | f. | Click the Edit Code button, and enter the following code:

m_LEADRasterView1.SetAutoSetRects( TRUE);
m_LEADRasterView1.SetPaintSizeMode( PAINTSIZEMODE_ZOOM);
m_LEADRasterView1.SetPaintZoomFactor(m_LEADRasterView1.GetPaintZoomFactor() + 10);

8.

Rebuild and run the application.


Dynamically Positioning the Control (Visual C++ 5.0)

Dynamically Positioning the Control (C++ 5.0 and later)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the OnLoadlead procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying an Image.

// Declare local variables.
float HeightFactor, WidthFactor, HeightAllowed, WidthAllowed;
float Width, Height, Left, Top;
CString ImageFile;
ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// Load the bitmap. This hard-coded path name may be different on your system.
/******* Put a valid image path here **********/
ImageFile = TEXT("d:\\temp\\24bit.bmp");
/**********************************************/
// Get file information
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(), LPCTSTR(ImageFile), 0, 0);
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
HeightFactor = pRasterIO->GetInfoHeight();
WidthFactor = pRasterIO->GetInfoWidth();
CRect rcWindow;
GetClientRect(rcWindow);
HeightAllowed = rcWindow.Height() * 3.0f / 4;
WidthAllowed = rcWindow.Width() * 3.0f / 4;
// Center the LEAD control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
Left = rcWindow.Width() / 8.0f;
Width = WidthAllowed;
Height = (Width * HeightFactor) / WidthFactor;
Top = (rcWindow.Height() - Height) / 2;
}
else
{
Top = rcWindow.Height() / 8.0f;
Height = HeightAllowed;
Width = (Height * WidthFactor) / HeightFactor;
Left = (rcWindow.Width() - Width) / 2;
}
rcWindow.SetRect(0, 0, (int) Width, (int) Height);
rcWindow.OffsetRect((int) Left, (int) Top);
m_LEADRasterView1.MoveWindow(rcWindow);
// Set up for handling our own display rectangles.
m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView1.SetAutoRepaint(TRUE);
// Load the bitmap
pRasterIO->Load(m_LEADRasterView1.GetRaster(), LPCTSTR(ImageFile), 0, 0, 1);
// Set the image display size to match the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
pRasterIO->Release();

3.

Rebuild and run the application.


Zooming In on a Selection (Visual C++ 5.0)

Zooming In on a Selection (C++ 5.0 and later)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | To add the code for LEAD events, do the following:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | d. | Continue with the remaining steps for each event.
3. | In the MFC ClassWizard, double-click the MouseDown event and add code as follows:

void CTutorDlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
m_LEADRasterView1.SetAutoRubberBand(TRUE);
m_LEADRasterView1.SetMousePointer(2);
}

4.

In the MFC ClassWizard, double-click the RubberBand event and add code as follows:

void CMfc40Dlg::OnRubberBandLeadrasterview1()
{
float zoomleft;
float zoomtop;
float zoomwidth;
float zoomheight;
m_LEADRasterView1.SetMousePointer(0);
//Zoom in on the selection.
zoomleft = m_LEADRasterView1.GetRubberBandLeft();
zoomtop = m_LEADRasterView1.GetRubberBandTop();
zoomwidth = m_LEADRasterView1.GetRubberBandWidth();
zoomheight = m_LEADRasterView1.GetRubberBandHeight();
//zoom in on the rectangle defined by the rubberband
m_LEADRasterView1.ZoomToRect(zoomleft, zoomtop, zoomwidth, zoomheight);
m_LEADRasterView1.ForceRepaint();
}

5.

Rebuild and run the application.


Outlining, Dragging, and Pasting a Region (Visual C++ 5.0)

Outlining, Dragging, and Pasting a Region (C++ 5.0 and later)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add another LEAD RasterView control with an ID of IDC_LEADRASTERVIEW2, set its Visible property to FALSE, and give it a variable name of m_LEADRasterView2. (You can follow the same instructions as when adding the first LEAD control.) Note, for simplicity, we are using a 2nd RasterView control. In reality, to reduce memory requirements, you would probably want to use an ILEADRaster Object.
3. | Go to the Project WorkSpace and click the FileView tab.
4. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

BOOL ReadyToDrag; //The state after marking the region but before dragging
BOOL Dragging; //The state when the mouse is used for dragging the floater
float StartX; //Starting X position in screen pixels
float StartY; //Starting Y position in screen pixels
float FloaterX; //Floater X position in screen pixels
float FloaterY; //Floater Y position in screen pixels
float ZoomFactorX; //Used for translating positioning information
float ZoomFactorY; //Used for translating positioning information

5. | Go to the Project Workspace and click the ResourceView tab.
6. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
7. | Add two new buttons to use for selecting and pasting the region. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
8. | Double-click each button and change its values as follows:
 | ID | Caption
 | IDC_SELRGN | Select Region
 | IDC_PASTEFLOATER | Paste Floater
9. | Start the Class Wizard and add code for the IDC_SELRGN button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_SELRGN.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnSelRgn).
 | f. | Click the Edit Code button to start entering the code.
10. | Enter new code as follows:

void CTutorDlg::OnSelrgn()
{
// TODO: Add your control notification handler code here
m_LEADRasterView1.SetRgnMarkingMode(RGNMARK_FREEHAND);
MessageBox(TEXT("Draw a freehand region"));
}

11. | Start the Class Wizard and add code for the IDC_PASTEFLOATER button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_PASTEFLOATER.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnPastefloater).
 | f. | Click the Edit Code button to start entering the code.
12. | Enter new code as follows:

void CTutorDlg::OnPastefloater()
{
// Variable for the Combine operation.
CombineConstants MyOp;
// Variables for the client area coordinates.
float LCRgnX, LCRgnY , LCRgnWidth, LCRgnHeight;
// Variables for the bitmap coordinates.
float LBRgnX, LBRgnY , LBRgnWidth, LBRgnHeight;
// Do nothing if there is no floater.
if (m_LEADRasterView1.GetFloater() == 0) return;
// Set the scale mode to pixels so that we do not have to
// translate mouse coordinates
m_LEADRasterView1.SetScaleMode(3);
// Get the floater into another bitmap
m_LEADRasterView2.SetScaleMode(m_LEADRasterView1.GetScaleMode());
m_LEADRasterView2.GetRaster().SetBitmap(m_LEADRasterView1.GetFloater());
// Get the floater's client coordinates into local variables.
LCRgnX = m_LEADRasterView1.GetFloaterDstLeft();
LCRgnY = m_LEADRasterView1.GetFloaterDstTop();
LCRgnWidth = m_LEADRasterView1.GetFloaterDstWidth();
LCRgnHeight = m_LEADRasterView1.GetFloaterDstHeight();
// Delete the floater.
m_LEADRasterView1.SetFloaterVisible(FALSE);
m_LEADRasterView1.SetFloater(0);
// Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - m_LEADRasterView1.GetDstLeft()) / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft();
LBRgnY = ((LCRgnY - m_LEADRasterView1.GetDstTop()) / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop();
LBRgnWidth = LCRgnWidth / ZoomFactorX;
LBRgnHeight = LCRgnHeight / ZoomFactorY;
// Reposition the region to use as a mask for the Combine method.
m_LEADRasterView1.GetRaster().OffsetRgn(LBRgnX - m_LEADRasterView1.GetRaster().GetRgnLeft(),
LBRgnY - m_LEADRasterView1.GetRaster().GetRgnTop());
// Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
MyOp = (CombineConstants)(CB_OP_ADD | CB_DST_0); // Operation flags for a simple paste.
pRasterProc->Combine(m_LEADRasterView1.GetRaster(),
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight,
m_LEADRasterView2.GetRaster(), 0.0f, 0.0f, MyOp);
pRasterProc->Release();
// Repaint the part of the client area that has changed.
m_LEADRasterView1.RepaintRect(LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, FALSE);
// Free the region.
m_LEADRasterView1.GetRaster().FreeRgn();
}

13. | To add the code for LEAD RasterView mouse events, do the following:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | d. | Continue with the remaining steps for each mouse event.
14. | In the MFC ClassWizard, double-click the MouseDown event and add code as follows:

void CTutorDlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
// Declare local variables.
float BitmapX, BitmapY;
float NewX, NewY, NewWidth, NewHeight;
// Do nothing if we are drawing a region.
if (m_LEADRasterView1.GetRgnMarkingMode() != RGNMARK_NONE) return;
// Save the starting position, in case we need it.
StartY = y;
StartX = x;
// if we are ready to drag the selection, get a floater.
if (ReadyToDrag == TRUE)
{
// Translate the current mouse coordinates.
// These coordinates account for the zoom factor and offset.
ZoomFactorX = m_LEADRasterView1.GetDstWidth() / m_LEADRasterView1.GetSrcWidth();
ZoomFactorY = m_LEADRasterView1.GetDstHeight() / m_LEADRasterView1.GetSrcHeight();
BitmapX = (x / ZoomFactorX) - (m_LEADRasterView1.GetDstLeft() / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft();
BitmapY = (y / ZoomFactorY) - (m_LEADRasterView1.GetDstTop() / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop();
// Continue to create the floater if the mouse is pointing to
// the region we marked.
if (m_LEADRasterView1.GetRaster().IsPtInRgn(BitmapX, BitmapY))
{
// Hide the region frame.
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_NONE);
// Create the floater bitmap, which will be the part of the main bitmap
// that is in the region's bounding rectangle.
m_LEADRasterView1.SetFloater(m_LEADRasterView1.GetRaster().GetBitmap());
// Translate the bitmap region coordinates to client area coordinates.
NewY = ((m_LEADRasterView1.GetRaster().GetRgnTop()
- m_LEADRasterView1.GetSrcTop()) * ZoomFactorY)
+ m_LEADRasterView1.GetDstTop();
NewX = ((m_LEADRasterView1.GetRaster().GetRgnLeft()
- m_LEADRasterView1.GetSrcLeft()) * ZoomFactorX)
+ m_LEADRasterView1.GetDstLeft();
NewWidth = m_LEADRasterView1.GetRaster().GetRgnWidth() * ZoomFactorX;
NewHeight = m_LEADRasterView1.GetRaster().GetRgnHeight() * ZoomFactorY;
// Set the initial display position of the floater.
m_LEADRasterView1.SetFloaterDstRect(NewX, NewY, NewWidth, NewHeight);
// Set form-level variables.
FloaterY = m_LEADRasterView1.GetFloaterDstTop();
FloaterX = m_LEADRasterView1.GetFloaterDstLeft();
m_LEADRasterView1.SetFloaterVisible(TRUE);
Dragging = TRUE;
ReadyToDrag = FALSE;
}
}
}

15.

In the MFC ClassWizard, double-click the MouseMove event and add code as follows:

void CTutorDlg::OnMouseMoveLeadrasterview1(short Button, short Shift, float x, float y)
{
// Variables for repositioning the floater.
float NewX, NewY, NewWidth, NewHeight, XDelta, YDelta;
// Do nothing if we are drawing a region.
if (m_LEADRasterView1.GetRgnMarkingMode() != RGNMARK_NONE) return;
// Reposition the floater if we are dragging it.
if ((Dragging == TRUE) && (Button == 1) && (m_LEADRasterView1.GetFloater() != 0))
{
if (m_LEADRasterView1.IsPtInFloater(x, y))
{
// Update the position variables.
XDelta = x - StartX;
YDelta = y - StartY;
NewX = FloaterX + XDelta;
NewY = FloaterY + YDelta;
NewWidth = m_LEADRasterView1.GetFloaterDstWidth();
NewHeight = m_LEADRasterView1.GetFloaterDstHeight();
// Reposition the floater.
m_LEADRasterView1.SetFloaterDstRect(NewX, NewY, NewWidth, NewHeight);
// Save the form-level position variables.
FloaterY = NewY;
FloaterX = NewX;
StartY = y;
StartX = x;
}
}
}

16.

In the MFC ClassWizard, double-click the MouseUp event and add code as follows:

void CTutorDlg::OnMouseUpLeadrasterview1(short Button, short Shift, float x, float y)
{
// If we were drawing a region, set up for the next operation.
if (m_LEADRasterView1.GetRgnMarkingMode() != RGNMARK_NONE)
{
m_LEADRasterView1.SetRgnMarkingMode( RGNMARK_NONE);
m_LEADRasterView1.SetRgnFrameType( RGNFRAME_STATIC);
ReadyToDrag = TRUE;
MessageBox(TEXT("Now, drag the selection to another place."));
}
}

17.

Run your program to test it.


Creating and Using Annotations (Visual C++ 5.0)

Creating and Using Annotations (C++ 5.0 and later)

Note:

This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add The #import and #include statements to your program so you can access LEAD Annotation COM:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltran14n.dll" no_namespace, named_guids

3. | Add an ILEADRasterAnnotation pointer to the class and Set it to NULL in the constructor.
 | a. | In the Project Workspace, click the Class View tab.
 | b | Select the CTutorDlg class
 | c. | Right-click and choose "Add Member Variable"
 | d. | For Variable Type enter ILEADRasterAnnotation
 | e. | For Variable Declaration enter *m_pRasterAnn
 | f. | Leave Access as Public
 | g. | Click the OK button
 | h. | In the Class View tab, double-click the CTutorDlg constructor function
 | i. | Add the following line to the end of the construtor

m_pRasterAnn = NULL;

4. | Go to the Project WorkSpace and click the ResourceView tab. Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
5. | Add four new buttons at the top of the form. To do this for each button, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box. Then double-click the button to change its properties. Set the properties as follows:
 | ID | Caption
 | IDC_ANNTOGGLE | Start
 | IDC_IOTOGGLE | Save
 | IDC_CLIPBOARDTOGGLE | Copy
 | IDC_REALIZE | Realize
6. | Add the following code to the end of OnInitDialog before the return statement:

if (m_pRasterAnn == NULL)
{
CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&m_pRasterAnn);
}

7. | Add code for the user mode toggle button (IDC_ANNTOGGLE). To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_ANNTOGGLE
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAnntoggle).
 | f. | Click the Edit Code button to start entering the code.

void CTutorDlg::OnAnntoggle()
{
CString Caption;
// Use the button to toggle between design mode and run mode
CWnd *pButton = GetDlgItem(IDC_ANNTOGGLE);
pButton->GetWindowText(Caption);
if (Caption == TEXT("Start"))
{
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
m_pRasterAnn->PutAnnTool(ANN_TOOL_BUTTON);
// Make run mode the next thing.
pButton->SetWindowText(TEXT("Run Mode"));
MessageBox(TEXT("In design mode now. Draw a button object."));
}
else if (Caption == TEXT("Design Mode"))
{
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
m_pRasterAnn->PutAnnTool(ANN_TOOL_BUTTON);
// Make run mode the next thing.
pButton->SetWindowText(TEXT("Run Mode"));
}
else // The button takes us to run mode
{
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_RUN);
MessageBox(TEXT("Click on your new button."));
pButton->SetWindowText(TEXT("Design Mode"));
}
}

8. | Add code for the load and save toggle button (IDC_IOTOGGLE). To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_IOTOGGLE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnIotoggle).
 | f. | Click the Edit Code button to start entering the code.

void CTutorDlg::OnIotoggle()
{
CString strFileName = TEXT("c:\\lead\\images\\tmp.ann");
CString Caption;
int nRet;
// Disable errors so that we can trap our own.
m_pRasterAnn->PutEnableMethodErrors(VARIANT_FALSE);
// Use the button to toggle between saving and loading annotations
CWnd *pButton = GetDlgItem(IDC_IOTOGGLE);
pButton->GetWindowText(Caption);
if (Caption == TEXT("Save"))
{
// Do nothing if there are no annotations.
HANDLE hAnnContainer = NULL;
hAnnContainer = (HANDLE)m_pRasterAnn->GetAnnContainer ();
if (hAnnContainer == 0)
return;
// Save All annotations.
nRet = m_pRasterAnn->AnnSave(strFileName.AllocSysString(), ANN_FMT_NATIVE, FALSE, SAVE_OVERWRITE, 0);
if (nRet == 0)
{
pButton->SetWindowText(TEXT("Load"));
// Make loading the next thing.
MessageBox(TEXT("Use the right mouse button to delete any annotations, then click Load."));
}
else
{
TCHAR buffer[50];
wsprintf(buffer, TEXT("LEAD Error %d"), nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
}
else // We are loading annotations
{
// Make sure we are in design mode
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
// Load the annotations.
nRet = m_pRasterAnn->AnnLoad( strFileName.AllocSysString(), 1);
if (nRet == 0)
pButton->SetWindowText(TEXT("Save"));
else
MessageBox(TEXT("No annotations to load."));
}
}

9. | Add code for the clipboard toggle button (IDC_CLIPBOARDTOGGLE). To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_CLIPBOARDTOGGLE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnIotoggle).
 | f. | Click the Edit Code button to start entering the code.

void CTutorDlg::OnClipboardtoggle()
{
CString Caption;
int nRet;
// Disable errors so that we can trap our own.
m_pRasterAnn->PutEnableMethodErrors(VARIANT_FALSE);
// Use the button to toggle between copying and pasting annotations
CWnd *pButton = GetDlgItem(IDC_CLIPBOARDTOGGLE);
pButton->GetWindowText(Caption);
if (Caption == TEXT("Copy")
{
// Do nothing if there are no annotations.
HANDLE hAnnContainer = NULL;
hAnnContainer = (HANDLE) m_pRasterAnn->GetAnnContainer();
if (hAnnContainer == NULL)
return;
// Copy all annotations to the clipboard.
nRet = m_pRasterAnn->AnnCopy(ANN_FMT_NATIVE, FALSE, -1);
if (nRet == 0)
{
// Make pasting the next thing.
pButton->SetWindowText(TEXT("Paste");
MessageBox(TEXT("Use the right mouse button to delete any annotations, then click Paste"));
}
else
{
TCHAR buffer[50];
wsprintf(buffer, "LEAD Error %d", nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
}
else // We are pasting annotations
{
// Make sure we are in design mode

m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
// Paste the annotations
VARIANT_BOOL bPasteReady = 0;
bPasteReady = m_pRasterAnn->GetAnnPasteReady();
if (bPasteReady == VARIANT_TRUE)
{
m_pRasterAnn->AnnPaste();
pButton->SetWindowText(TEXT("Copy");
}
else
{
MessageBox(TEXT("No annotations to paste"));
}
}
}

10. | Add code for the realize button (IDC_REALIZE), which renders the annotation objects to the bitmap. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_REALIZE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnIotoggle).
 | f. | Click the Edit Code button to start entering the code.

void CTutorDlg::OnRealize()
{
m_pRasterAnn->AnnRealize(VARIANT_FALSE);
MessageBox(TEXT("Annotations are now rendered to the bitmap."));
}

11.

To add the code for annotation events, edit the TUTORDLG.H file and change the definition of CTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP()

public:
CRasterAnnSink *m_pRasterAnnSink;
IConnectionPoint *m_pCP;
DWORD m_dwCookie;

12.

Edit the TUTORDLG.CPP file and add the following code to the end of the OnInitDialog function:

//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Instantiate the sink class and hold a pointer to it.
m_pRasterAnnSink = new CRasterAnnSink;
m_pRasterAnnSink->m_pDlg = this;

//Attach the annotation object to the raster view control
IDispatch *pDispatch=NULL;
(m_LEADRasterView1.GetControlUnknown())->QueryInterface(IID_IDispatch, (void**)&pDispatch);
m_pRasterAnn->PutAnnParentRasterView(pDispatch);

if(pDispatch)
pDispatch->Release();

//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterAnnSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterAnn, DIID__LEADRasterAnnotationEvents, pUnkSink, FALSE, &m_dwCookie);

13. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterAnnSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterAnnSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterAnnSink();
protected:

h. | In the RasterAnnSink.h file, add the following to the top of the file:
 | class CTutorDlg;
i. | In the RasterAnnSink.h file, add the following to the CRasterAnnSink class in the //Attributes public section:

// Attributes

public:

CTutorDlg *m_pDlg;

j.

In the RasterAnnSink.cpp file, add the following to the top of the file (after the #include "RasterAnnSink.h")

#include "tutorDlg.h"

14. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:
 |  | #include <AFXCTL.H>
 |  | #include "RasterAnnSink.h"
15. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterAnnSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:
 |  | afx_msg void OnAnnCreate(long hAnnObject);
 |  | afx_msg void OnAnnDestroy(long hAnnObject);
 |  | afx_msg void OnAnnClicked(long hAnnObject);
 |  | afx_msg void OnAnnDrawn(long hAnnObject);
16. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterAnnSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterAnnSink, "OnAnnCreate", 5, OnAnnCreate, VT_EMPTY,VTS_I4)
DISP_FUNCTION_ID(CRasterAnnSink, "OnAnnDestroy",6, OnAnnDestroy, VT_EMPTY,VTS_I4)
DISP_FUNCTION_ID(CRasterAnnSink, "OnAnnClicked",7, OnAnnClicked, VT_EMPTY,VTS_I4)
DISP_FUNCTION_ID(CRasterAnnSink, "OnAnnDrawn", 8, OnAnnDrawn, VT_EMPTY,VTS_I4)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CRasterAnnSink, DIID__LEADRasterAnnotationEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterAnnSink::OnAnnClicked(long hAnnObject)
{
long lTag;
CString strMsg;

m_pDlg->m_pRasterAnn->AnnGetTag(hAnnObject);
lTag = m_pDlg->m_pRasterAnn->GetAnnTag();
strMsg.Format(TEXT("This is what we do for the button tagged %d"), lTag);
AfxMessageBox( strMsg);
}

void CRasterAnnSink::OnAnnCreate(long hAnnObject)
{
AnnObjectType ObjectType;

//Update the tag if we need one.
static int nNewTag=0;
m_pDlg->m_pRasterAnn->AnnGetType(hAnnObject);
ObjectType = m_pDlg->m_pRasterAnn->GetAnnType();
if ((ObjectType == ANN_OBJECT_BUTTON) || (ObjectType == ANN_OBJECT_HOTSPOT))
{
nNewTag++;
m_pDlg->m_pRasterAnn->AnnSetTag(hAnnObject, nNewTag);
}
}

void CRasterAnnSink::OnAnnDestroy(long hAnnObject)
{
CString strMsg;
long lTag;
m_pDlg->m_pRasterAnn->AnnGetTag(hAnnObject);
lTag = m_pDlg->m_pRasterAnn->GetAnnTag();

strMsg.Format(TEXT("The object tagged %d is deleted"), lTag);
AfxMessageBox(strMsg);
}

void CRasterAnnSink::OnAnnDrawn(long hAnnObject)
{
m_pDlg->m_pRasterAnn->PutAnnTool(ANN_TOOL_SELECT);
AfxMessageBox(TEXT("Use the right mouse button to modify this object; then click on Run Mode to test it."));
}

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
18. | Enter new code as follows:

void CTutorDlg::OnDestroy()
{
//Terminate a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterAnnSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterAnn, DIID__LEADRasterAnnotationEvents,
pUnkSink, FALSE, m_dwCookie);
delete m_pRasterAnnSink;
m_pRasterAnn->Release();
CDialog::OnDestroy();
}

19.

Compile and run your program to test it.


Loading and Saving Annotations Using Databases (Visual C++ 5.0)

Loading and Saving Annotations Using Databases (C++ 5.0 and later)

Note: This topic is for Document/Medical only.

Take the following steps to start a project and to add some code that demonstrates adding annotation objects to or deleting annotation objects from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify AnnBlob.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls.
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the AnnBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dlls reside):

#import <C:\\Windows\\system32\\LTRVR14N.DLL> no_namespace, named_guids
#import <C:\\Windows\\system32\\LTR14n.DLL> no_namespace, named_guids
#import <C:\\Windows\\system32\\LTRIO14n.DLL> no_namespace, named_guids
#import <C:\\Windows\\system32\\LTRAN14n.DLL> no_namespace, named_guids

8. | Add #import statements to your program so you can access the Microsoft ActiveX Data Object 2.6 Library:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the AnnBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the .tlb files reside):

#import <C:\\Windows\\system32\\msado26.tlb> rename("EOF", "ADOEOF")
using namespace ADODB

9. | Add a LEAD RasterView control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the AnnBlob resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_ANNBLOB_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEAD RasterView Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEAD RasterView control icon; then size and position the control as you want it to appear at run time.

10. | Add six command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_CONNECT | &Connect To Database
 | IDC_DISCONNECT | &Disconnect From Data Base
 | IDC_ADDRECORD | &Add Record
 | IDC_DELETERECORD | D&elete Record
 | IDC_MOVENEXT | Move &Next
 | IDC_MOVEPREVIOUS | Move &Previous
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.

12. | Do the following to add m_LEADRasterView1 to the CAnnBlobDlg class and link the variable to the LEADRasterView control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CAnnBlobDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_RasterView as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
13. | Do the following to add m_btnAddRecord to the CAnnBlobDlg class and link the variable to the CButton control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CAnnBlobDlg.
 | d. | In the Control IDs list, select IDC_ADDRECORD.
 | e. | Click the Add Variable... button.
 | f. | Specify m_btnAddRecord as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.

14. | Repeat step 13 for the other buttons, using the following variable names:
 | ID | Member Variable Name
 | IDC_MOVEPREVIOUS | m_btnMovePrevious
 | IDC_MOVENEXT | m_btnMoveNext
 | IDC_DISCONNECT | m_btnDisconnect
 | IDC_DELETERECORD | m_btnDeleteRecord
 | IDC_CONNECT | m_btnConnect
15. | Add the following Member Variables to the CAnnBlobDlg class:
 | ILEADRasterAnnotation | *m_pRasterAnn;
 | ILEADRasterAnnToolBar | *m_pRasterAnnToolBar;
 | _ConnectionPtr | m_pConnection;
 | _RecordsetPtr | m_pRecordset;

16. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the AnnBlob classes folder to open it.
 | c. | Expand the CAnnBlobDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
17. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

CoInitialize(NULL);
ILEADRasterIO *pltRasterIO = NULL;
::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pltRasterIO);

pltRasterIO->Load(m_RasterView.GetRaster(),"c:\\parrots.jpg",0,0,1);

m_pRasterAnnToolBar = NULL;
::CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL,
IID_ILEADRasterAnnToolBar, (void**)&m_pRasterAnnToolBar);

::CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL,
IID_ILEADRasterAnnotation, (void**)&m_pRasterAnn);

IDispatch *pDispatch=NULL;
(m_RasterView.GetControlUnknown())->QueryInterface(IID_IDispatch, (void**)&pDispatch);

m_pRasterAnn->AnnParentRasterView = pDispatch;

m_pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;

m_pRasterAnn->AnnCreate(ANN_OBJECT_RECT, TRUE, TRUE);

m_pRasterAnnToolBar->AnnParentRasterView = pDispatch;

m_pRasterAnnToolBar->Visible = TRUE;
m_pRasterAnnToolBar->Create(10, 10, ANN_TOOLALIGN_TOP);

m_pConnection.CreateInstance(__uuidof( Connection) );
m_pRecordset.CreateInstance(__uuidof(Recordset));

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and enter the following code: (you will have to change to file name to an existing database file name on your computer)

HRESULT hr;
_bstr_t bstrQuery("SELECT * FROM Images");
_variant_t vNull;
vNull.vt = VT_ERROR ;
vNull.scode = DISP_E_PARAMNOTFOUND ;

if (m_pConnection->State == adStateClosed)
{
hr = m_pConnection->Open( _bstr_t(L"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= DB1.mdb;"),
_bstr_t(L""), _bstr_t(L""), adModeUnknown ) ;
}

if (SUCCEEDED(hr))
{
m_pRecordset->PutRefActiveConnection(m_pConnection);
hr = m_pRecordset->Open(_variant_t(bstrQuery), vNull, adOpenKeyset, adLockOptimistic, adCmdText );

if (SUCCEEDED(hr))
{
if(!m_pRecordset->GetBOF())
{
m_pRecordset->MoveFirst();
}

if (!m_pRecordset->GetADOEOF())
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

m_btnAddRecord.EnableWindow(TRUE);
}
}

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateOpen)
{
m_pConnection->Close();
}

if (m_pRecordset->State == adStateOpen )
{
m_pRecordset->Close();
}

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

20. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_ADDRECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddRecord).
 | f. | Click the Edit Code button and enter the following code:

SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
long ix[1];
int nSize;
int nRet;

ILEADRasterVariant *pRasterVariant = NULL;
::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

m_pRecordset->AddNew();

nRet = m_pRasterAnn->AnnSaveArray (ANN_FMT_NATIVE, false, pRasterVariant, SAVE_OVERWRITE, 0);

nSize = pRasterVariant->ItemCount;

sabFldData[0].cElements = nSize ;
sabFldData[0].lLbound = 0;

SAFEARRAY * psaFieldData = SafeArrayCreate(VT_I1, 1, sabFldData);

for (int i = 0; i < nSize; ++i)
{
ix[0] = i;
long data = pRasterVariant->GetShortItemValue(i);
HRESULT hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

VariantInit(&vData);
V_VT(&vData) = VT_ARRAY | VT_UI1;
vData.parray = psaFieldData;

m_pRecordset->Fields->Item[_variant_t( (long) 1)]->Value = _variant_t(vData);
m_pRecordset->Fields->Item[_variant_t( (long) 2)]->Value = _variant_t( (long) nSize);

m_pRecordset->Update();

if(m_pRecordset->RecordCount >= 0)
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

VariantClear(&vData);
pRasterVariant->Release();

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_DELETERECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDeleteRecord).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF() || !m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveLast();
m_pRecordset->Delete(adAffectCurrent);
m_pRecordset->Update();

if(m_pRecordset->RecordCount <= 0)
{
m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);
}
}

22. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVENEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMoveNext).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;

ILEADRasterVariant *pRasterVariant = NULL;
::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveNext();
}

if (m_pRecordset->GetADOEOF())
{
MessageBox(TEXT("Unable to get the annotation from the database"));
m_pRecordset->MovePrevious();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;

if(vData.vt == (VT_ARRAY | VT_UI1))
{
pRasterVariant-> Type = VALUE_ARRAY_BYTE;
pRasterVariant-> ItemCount = nSize;
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pRasterVariant-> PutShortItemValue (i, (short)data);
}
}

nRet = m_pRasterAnn-> AnnLoadArray (pRasterVariant, nSize, 1);
}
}

pRasterVariant->Release();

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVEPREVIOUS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMovePrevious).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;

ILEADRasterVariant *pRasterVariant = NULL;
::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void**)&pRasterVariant);

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF())
{
m_pRecordset->MovePrevious();
}

if (m_pRecordset->GetBOF())
{
MessageBox(TEXT("Unable to get the Annotation from db"));
m_pRecordset->MoveNext();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;

if(vData.vt == (VT_ARRAY | VT_UI1))
{
pRasterVariant-> Type = VALUE_ARRAY_BYTE;
pRasterVariant-> ItemCount = nSize;
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pRasterVariant-> PutShortItemValue (i, (short)data);
}
}

nRet = m_pRasterAnn-> AnnLoadArray (pRasterVariant, nSize, 1);
}
}

pRasterVariant->Release();

24. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Messages list box, select WM_CLOSE.
 | d. | Click the Add function button. Choose OK for the default function name (OnClose).
 | e. | Click the Edit Code button and enter the following code:

if(m_pRasterAnn)
m_pRasterAnn->Release();

if(m_pRasterAnnToolBar)
m_pRasterAnnToolBar->Release();

CoUninitialize();

25.

Open the ANNBLOBDLG.CPP file and add the following line after the #include statements:

#include "leadraster.h"

26. | On the main menu, select Build > Build AnnBlob.exe to build the project.
27. | On the main menu, select Build > Execute AnnBlob.exe to run the project.


Using ODBC to Access Image Data (Visual C++ 5.0)

Using ODBC to Access Image Data (C++ 5.0 and later)

This lesson describes how to use the LEADTOOLS ODBC features to maintain images in a table with other data. In this lesson, you accomplish the following:

Create a database with one table containing images and names for the images.

Create an ODBC data source that references the table.

Use a DAO recordset to manage the table and to access the names.

Use the LEADTOOLS methods to access the images through the ODBC data source.

Use SQL SELECT statements to maintain a sorted view of the records.

Synchronize the record pointers so that the two views of the same table are always correct.

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Use a database manager to create an ACCESS MBD database with one table that has two fields. Use the following specifications:
 | a. | Database name: leadpic.mdb.
 | b. | Table name: people.
 | c. | Field name: who. Data Type: text. Size: 255.
 | d. | Field name: photo. Data Type: Long Binary. Size: N/A.
2. | Create an ODBC data source that references the same database as follows:
 | a. | From the Windows Control Panel, open the ODBC administrator and click the Add button.
 | b. | Select Microsoft Access driver and click the OK button.
 | c. | Enter the name LEADODBC.
 | d. | Click the Select directory button and select the path to the database that you created.
 | e. | Click the OK button; click the next OK button; then click the Close button.
3. | Start the Microsoft Developer Studio for Visual C++, version 5.0.
4. | Select the File >New menu option, select Project Workspace, and click the OK button.
5. | In the New Project Workspace dialog box, do the following:
 | a. | In the Type list box, select MFC AppWizard (exe).
 | b. | In the Name text box, specify ltcdb.
 | c. | In the Location text box, specify the path of the project.
 | d. | In the Platforms list box, check Win32.
 | e. | Click the Create button.
6. | In the Step 1 dialog box, do the following:
 | a. | Select Single document.
 | b. | Click the Next button.
7. | In the Step 2 of 6 dialog box, do the following:
 | a. | Select Database view without file support.
 | b. | Click the Data Source button.
 | c. | Select DAO and use the browser to specify the leadpic.mdb database that you created earlier.
 | d. | Ensure that Dynaset and Detect dirty columns are selected and click the OK button.
 | e. | Select the people table and click the OK button.
 | f. | Click the Next button.
8. | In the Step 3 of 6 dialog box, do the following:
 | a. | For compound document support, ensure that None is selected.
 | b. | For other support, select ActiveX Controls.
 | c. | Click the Next button.
9. | In the Step 4 of 6 dialog box, do the following:
 | a. | For supported features, select only Docking toolbar and 3D controls.
 | b. | Click the Next button.
10. | In the Step 5 of 6 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select "Use MFC in a Shared DLL".
 | c. | Click the Next button.
11. | In the Step 6 of 6 dialog box, just click Finish.
12. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
13. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ltcdb files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\\system32\\Ltrio14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\LTRBC14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids
#include "leadraster.h"

14. | Add a LEADRasterView control to the Controls toolbar as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the ltcdb resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_LTCDB_FORM to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Right-click and choose "Insert ActiveX Control ..."
 | g. | Select "LEADRasterView Control" and click OK
15. | Add the LEADRasterView control to your form as follows:
 | a. | Right-click the new LEADRasterView control to edit its properties.
 | b. | Change the ID to IDC_LEADRASTERVIEW1 and change the BorderStyle property to 1 - Fixed Single.
16. | Add an edit box for the image name and bind it to the database as follows:
 | a. | Click the Edit Box icon; then click and drag on the form to size and position the control.
 | b. | Double-click the new Edit Box control to edit its properties.
 | c. | Change the ID to IDC_CWHO.
 | d. | Hold down the Ctrl key and double click the control.
 | e. | For the Member variable name, select m_pSet->m_who, and click the OK button.
17. | Do the following to add m_LEADRasterView1 to the CLtcdbView class and link the variable to the LEADRasterView control using dynamic data exchange:
 | a. | Open the ClassWizard (CTRL-W).
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CLtcdbView.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterODBCSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterODBCSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterODBCSink();
protected:

h. | In the RasterODBCSink.h file, add the following to the top of the file:
 | class CLtcdbView;
i. | In the RasterODBCSink.h file, add the following to the CRasterODBCSink class in the //Attributes public section:

// Attributes
public:
CLtcdbView *m_pView;

j.

In the RasterODBCSink.cpp file, add the following to the top of the file (after the #include "RasterODBCSink.h")

#include "ltcdbview.h"

19. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ltcdb files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>

#include "RasterODBCSink.h"

#include "ltcdbSet.h"

#include "ltcdbdoc.h"

20.

Edit the header for the Sink class:

a. | In the Project Workspace, click the FileView tab.
b. | Double-click the ltcdb files folder to open it.
c. | Double-click the Header Files folder to open it.
d. | Double-click the RasterODBCSink.h file to edit it.
e. | Add the following just before //}}AFX_MSG:

afx_msg void OnODBCChanged();

21. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ltcdb files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterODBCSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterODBCSink,"ODBCChanged",1,OnODBCChanged,VT_EMPTY,VTS_NONE)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART tothe following:

INTERFACE_PART(CRasterODBCSink, DIID__LEADRasterODBCEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterODBCSink::OnODBCChanged ()
{
if (m_pView==NULL)
return;

// Avoid sizing images that are not loaded.
if (m_pView->m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
m_pView->m_LEADRasterView1.ForceRepaint(); // So we can see when images are missing.
return;
}
// Calculate the display rectangle to fit the image inside the control
float HeightAllowed = m_pView->m_LEADRasterView1.GetScaleHeight();
float WidthAllowed = m_pView->m_LEADRasterView1.GetScaleWidth();
float XProportion = m_pView->m_LEADRasterView1.GetRaster().GetBitmapWidth();
float YProportion = m_pView->m_LEADRasterView1.GetRaster().GetBitmapHeight();
float DisplayTop;
float DisplayHeight;
float DisplayWidth;
float DisplayLeft;
// See if using the allowed height makes the image too wide.
if ((HeightAllowed * XProportion / YProportion) <= WidthAllowed)
{ // Use the allowed height.
DisplayTop = (float)0;
DisplayHeight = HeightAllowed;
DisplayWidth = DisplayHeight * XProportion / YProportion;
DisplayLeft = (WidthAllowed - DisplayWidth) / 2;
}
else
{ // Use the allowed width.
DisplayLeft = (float)0;
DisplayWidth = WidthAllowed;
DisplayHeight = DisplayWidth * YProportion / XProportion;
DisplayTop = (HeightAllowed - DisplayHeight) / 2;
}
// Set the image display size
m_pView->m_LEADRasterView1.SetDstRect(DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight);
m_pView->m_LEADRasterView1.SetDstClipRect(DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight);
m_pView->m_LEADRasterView1.ForceRepaint();
}

22.

Edit LTCDBVIEW.H and insert the following lines in the definition of CLtcdbView after DECLARE_MESSAGE_MAP():

// These variables let us synchronize the LEADRasterODBC control's ODBC access with the
// the normal database access
long OldPosition, NewPosition;
// This variable lets us make the dbMove method conditional
BOOL NormalMove;
ILEADRasterODBC *m_pRastODBC;

CRasterODBCSink *m_pRasterODBCSink;
DWORD m_dwODBCCookie;

23.

Edit the CLtcdbView::OnInitialUpdate() function so that it looks like this:

void CLtcdbView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_ltcdbSet;
CDaoRecordView::OnInitialUpdate();

m_pRasterODBCSink = new CRasterODBCSink;
m_pRasterODBCSink->m_pView = this;

CoCreateInstance(CLSID_LEADRasterODBC, NULL, CLSCTX_ALL, IID_ILEADRasterODBC, (void**)&m_pRastODBC);

//Establish a connection between source and sink.
LPUNKNOWN pODBCUnkSink = m_pRasterODBCSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRastODBC, DIID__LEADRasterODBCEvents, pODBCUnkSink, FALSE, &m_dwODBCCookie);

// Turn off automatic scrolling and repainting
m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView1.SetAutoRepaint(FALSE);

// Open the database.
// Use the same SELECT statement that is used for the data control.
// Note that the image field must be listed first in the SELECT statement.
m_pRastODBC->PutEnableMethodErrors(FALSE);
m_pRastODBC->PutRaster((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch);

int nRet = m_pRastODBC->dbOpen("ODBC;DSN=LEADODBC", "SELECT photo FROM people ORDER BY who", "photo", DB_OPENOPTIONS_NONE);
// Set the LEAD control's database properties
m_pRastODBC->PutdbLoadBits(24);
m_pRastODBC->PutdbLockingMode(DB_LOCKINGMODE_OPTIMISTIC);

// Enable use of the dbMove method in the data control's Reposition event
NormalMove = TRUE;
NewPosition = 0;
}

24. | Disable the DAO recordset's access of the photo field. (We will access this field through the LEADRasterODBC object.) To disable the recordset's access, do the following:
 | a. | Edit the CLtcdbSet::CLtcdbSet function to change m_nFields = 2 to m_nFields = 1.
 | b. | Edit the CLtcdbSet::DoFieldExchange function and remove the following statement: DFX_LongBinary(pFX, _T("[photo]"), m_photo);
 | c. | Edit the LtcdbSet.h file to remove the following line: CLongBinary m_photo;
25. | Edit the CLtcdbSet::GetDefaultSQL function to use an SQL SELECT statement as follows:

CString CLtcdbSet::GetDefaultSQL()
{
return TEXT("SELECT who FROM people ORDER BY who");
}

26. | Add the code for the LEADRasterODBC control to close the database when the application ends. To do so, open the ClassWizard (CTRL-W), and do the following:
 | a. | In the Class name combo box, select CLtcdbView.
 | b. | In the Object IDs list box, select CLtcdbView.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
 | f. | Edit the function to appear as follows:

void CLtcdbView::OnDestroy()
{
if (m_pRastODBC)
{
m_pRastODBC->dbClose();

//Terminate a connection between source and sink.
m_pRasterODBCSink->m_pView = NULL;
LPUNKNOWN pODBCUnkSink = m_pRasterODBCSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRastODBC, DIID__LEADRasterODBCEvents, pODBCUnkSink, FALSE, m_dwODBCCookie);

m_pRastODBC->Release();
delete m_pRasterODBCSink;
m_pRastODBC = NULL;
}
}

27.

Add code to synchronize the LEADRasterODBC control's record pointer with the DAO recordset's record pointer. To do so, add the following so that the CLtcdbView::DoDataExchange function looks like this:

void CLtcdbView::DoDataExchange(CDataExchange* pDX)
{
CDaoRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLtcdbView)
DDX_FieldText(pDX, IDC_CWHO, m_pSet->m_who, m_pSet);
DDX_Control(pDX, IDC_LEADRASTERVIEW1, m_LEADRasterView1);
//}}AFX_DATA_MAP
if ((NormalMove == TRUE) && (NewPosition != m_pSet->GetAbsolutePosition()))
{
OldPosition = NewPosition;
NewPosition = m_pSet->GetAbsolutePosition();
m_pRastODBC->dbMove(NewPosition - OldPosition);
m_LEADRasterView1.ForceRepaint();
}
}

28. | In this step and the next one, change the resource file to add some buttons. For the first button, do the following:
 | a. | Click on the ResourceView tab of the Project Workspace.
 | b. | Double-click on the ltcdb resources folder.
 | c. | Double-click on Dialog.
 | d. | Double-click on IDD_LTCDB_FORM.
 | e. | Select the command button control on the Controls toolbar.
 | f. | Click and drag on the dialog window to create and position the button.
 | g. | Double-click the button just created to bring up the Push Button Properties window.
 | h. | Change the ID to IDC_ADDNEW and the caption to Add Record.
 | i. | Close the window.
29. | For the other buttons, repeat the preceding step with the following differences for each button:
 | - With an ID of IDC_FLIP and caption Flip Photo
 | - With an ID of IDC_DELETE and caption Delete Record
30. | Add code for the IDC_ADDNEW button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CLtcdbView.
 | c. | In the Object IDs list box, select IDC_ADDNEW.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddnew).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CLtcdbView::OnAddnew()
{
// Make sure we can add records to the database.
if (!m_pSet->CanUpdate())
{
MessageBox(TEXT("You cannot update this database."), TEXT("ERROR"));
return;
}
// Get the name of the file to load.
// This filter list is complete, except for GIF.
CString ImageFilter = TEXT("Graphics|*.cmp; *.jpg; *.jff; *.jtf; *.bmp; *.tif; *.tga; *.pcx; *.cal; *.mac; *.mac; *.img; *.msp; *.wpg; *.wpg; *.ras; *.pct; *.pcd; *.eps; *.wmf||");
CFileDialog OpenFile(TRUE, NULL, NULL,0,ImageFilter);
if (OpenFile.DoModal() != IDOK)
return;
CWaitCursor wait; // Display an hourglass
CString MyFile = OpenFile.GetPathName();
// Disable the normal synchronization code and hide the LEAD control
// while we manipulate the recordsets.
NormalMove = FALSE;
m_LEADRasterView1.ShowWindow (SW_HIDE);
// Add a record to the DAO recordset.
m_pSet->AddNew();
SetDlgItemText(IDC_CWHO, MyFile);
UpdateData();
try
{
m_pSet->Update();
}
catch( CDaoException* e )
{
AfxMessageBox(
e->m_pErrorInfo->m_strDescription,
MB_ICONEXCLAMATION );
m_pSet->CancelUpdate();
UpdateData(FALSE);
m_LEADRasterView1.ShowWindow(SW_NORMAL);
NormalMove = TRUE;
return;
}
// Requery the DAO recordset and wait for the change to take effect.
m_pSet->Requery();
Sleep(5000);
// Requery the LEAD recordset and make sure the recordsets match.
m_pRastODBC->dbRequery();
m_pSet->MoveFirst();
NewPosition = 0;
m_pSet->MoveLast();
if (NewPosition != m_pSet->GetAbsolutePosition())
{
OldPosition = NewPosition;
NewPosition = m_pSet->GetAbsolutePosition();
m_pRastODBC->dbMove(NewPosition - OldPosition);
}
if(m_pRastODBC->GetdbCurrentRecord() != m_pSet->GetAbsolutePosition())
{
MessageBox(TEXT("Synchronization error!\nDelete the record and exit"), TEXT("ERROR"), MB_OK);
m_pSet->FindFirst(CString(TEXT("who = '")) + MyFile + CString(TEXT("'")));
return;
}
// Find the record we just added and synchronize the recordsets.
m_pSet->FindFirst(CString(TEXT("who = '")) + MyFile + CString(TEXT("'")));
if (NewPosition != m_pSet->GetAbsolutePosition())
{
OldPosition = NewPosition;
NewPosition = m_pSet->GetAbsolutePosition();
m_pRastODBC->dbMove(NewPosition - OldPosition);
}
// Use return values to trap errors.
BOOL ErrHand = m_LEADRasterView1.GetEnableMethodErrors(); // Save the current setting.
m_LEADRasterView1.SetEnableMethodErrors(FALSE);
// Redisplay the LEADRasterView control, load the image, update the record,
// and restore normal recordset synchronization.
m_LEADRasterView1.ShowWindow(SW_NORMAL);
m_pRastODBC->dbEdit();
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
int nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster(),MyFile.AllocSysString(), 24, 0, 1);
pRasterIO->Release();
if (nRet != 0)
{
TCHAR buffer[50];
wsprintf(buffer, TEXT("LEAD Error %d loading image."), nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
// Update the recordset using the appropriate format
if (m_LEADRasterView1.GetRaster().GetBitmapBits() == 1)
nRet = m_pRastODBC->dbUpdate(FILE_LEAD1BIT, 1, 0);
else if (m_LEADRasterView1.GetRaster().GetBitmapBits() == 4)
nRet = m_pRastODBC->dbUpdate(FILE_PCX, 4, 0);
else if (m_LEADRasterView1.GetRaster().GetIsGrayscale() == GRAY_NO)
nRet = m_pRastODBC->dbUpdate(FILE_CMP, 24, QFACTOR_QMS);
else // save as grayscale
nRet = m_pRastODBC->dbUpdate(FILE_CMP, 8, QFACTOR_QMS);
if (nRet != 0)
{
TCHAR buffer[50];
wsprintf(buffer, TEXT("LEAD Error %d saving image to database"), nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
// Restore previous error handling.
m_LEADRasterView1.SetEnableMethodErrors(ErrHand);
NormalMove = TRUE;
}

31. | Add code for the IDC_FLIP button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CLtcdbView.
 | c. | In the Object IDs list box, select IDC_FLIP.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnUpdate).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CLtcdbView::OnFlip()
{
ILEADRasterProcess *pRasterIO = NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)& pRasterIO);

// Make sure we can update records in the database.
if (m_pRastODBC->GetdbCanUpdate() == FALSE)
{
MessageBox(TEXT("You cannot update this database."), TEXT("ERROR"));
return;
}
// Make sure the current record contains an image.
if (m_pRastODBC->GetdbIsEOF() || m_pRastODBC->GetdbIsBOF() || m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
MessageBox(TEXT("No current image"), TEXT("NOTICE"), MB_OK);
return;
}
// Flip the image.
m_pRastODBC->dbEdit();
pRasterIO->Flip(m_LEADRasterView1.GetRaster());
m_LEADRasterView1.ForceRepaint();

// Use return values to trap errors.
BOOL ErrHand = m_LEADRasterView1.GetEnableMethodErrors(); // Save the current setting.
m_LEADRasterView1.SetEnableMethodErrors(FALSE);
// Update the recordset using the appropriate format
int nRet;
if (m_LEADRasterView1.GetRaster().GetBitmapBits() == 1)
nRet = m_pRastODBC->dbUpdate(FILE_LEAD1BIT, 1, 0);
else if (m_LEADRasterView1.GetRaster().GetBitmapBits() == 4)
nRet = m_pRastODBC->dbUpdate(FILE_PCX, 4, 0);
else if (m_LEADRasterView1.GetRaster().GetIsGrayscale() == GRAY_NO)
nRet = m_pRastODBC->dbUpdate(FILE_CMP, 24, QFACTOR_QMS);
else // save as grayscale
nRet = m_pRastODBC->dbUpdate(FILE_CMP, 8, QFACTOR_QMS);
if (nRet != 0)
{
TCHAR buffer[50];
sprintf(buffer, TEXT("LEAD Error %d saving image to database"), nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
// Restore previous error handling.
m_LEADRasterView1.SetEnableMethodErrors(ErrHand);
}

32. | Add code for the IDC_DELETE button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CLtcdbView.
 | c. | In the Object IDs list box, select IDC_DELETE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDelete).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CLtcdbView::OnDelete()
{
// Make sure we can delete records from the database.
if (!m_pSet->CanUpdate())
{
MessageBox(TEXT("You cannot update this database."), TEXT("ERROR"));
return;
}
// Make sure the database is not empty.
if (m_pSet->IsEOF() && m_pSet->IsBOF())
{
MessageBox(TEXT("The database is empty."), TEXT("NOTICE"), MB_OK);
return;
}
CWaitCursor wait; // Display an hourglass
// Disable the normal record synchronization and hide the LEAD control.
NormalMove = FALSE;
m_LEADRasterView1.ShowWindow(SW_HIDE);
// Save the current position.
long RecMarker = m_pSet->GetAbsolutePosition();
// Delete the current record and wait for the change to take effect.
m_pSet->Delete();
Sleep(5000);
// Requery the recordsets, move to the last record,
// and initialize the NewPosition global variable.
m_pSet->Requery();
m_pRastODBC->dbRequery();
m_pSet->MoveLast();
NewPosition = m_pSet->GetAbsolutePosition();
m_pRastODBC->dbMove(NewPosition);
// Make sure the LEADRasterODBC control is on the last record.
m_pRastODBC->dbMoveNext();
if(m_pRastODBC->GetdbIsEOF())
{
m_pRastODBC->dbMovePrev();
}
else
{
int nRet = MessageBox(TEXT("Synchronization error!\nRestart the application"), TEXT("ERROR"), MB_OK);
return;
}
// Return to the old record position, if possible.
NormalMove = TRUE;
m_LEADRasterView1.ShowWindow(SW_NORMAL);
long RelativePosition = RecMarker - NewPosition;
if (RelativePosition < 0)
{
m_pSet->Move(RelativePosition);
}
// Update the edit box with data from the current record.
UpdateData(FALSE);
}

33. | To accommodate a 256-color display driver, continue with the remaining steps, which send WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages to the LEADTOOLS ActiveX.
34. | Edit the LTCDBVIEW.H file and insert the following lines in the definition of CLtcdbView class, just before DECLARE_MESSAGE_MAP():

afx_msg BOOL OnQueryNewPalette();
afx_msg void OnPaletteChanged( CWnd *pwin );

35.

Edit the LTCDBVIEW.CPP file and insert the following lines between the lines: BEGIN_MESSAGE_MAP(CLtcdbView, CDaoRecordView) and END_MESSAGE_MAP():

ON_WM_QUERYNEWPALETTE()
ON_WM_PALETTECHANGED()

36.

Go to the end of LTCDBVIEW.CPP file and insert the following two functions:

BOOL CLtcdbView::OnQueryNewPalette()
{
if(!IsWindow(m_LEADRasterView1.m_hWnd))
return FALSE;
return m_LEADRasterView1.SendMessage(WM_QUERYNEWPALETTE);
}
void CLtcdbView::OnPaletteChanged(CWnd* pFocusWnd)
{
if(pFocusWnd->m_hWnd == m_hWnd || !IsWindow(m_LEADRasterView1.m_hWnd))
return;
m_LEADRasterView1.SendMessage(WM_PALETTECHANGED, (WPARAM) pFocusWnd->m_hWnd);
}

37. | On the main menu, select Build > Build ltcdb.exe to build the project.
38. | On the main menu, select Build > Execute ltcdb.exe to run the project.


Implementing a Database with the MS ADO Data Control (MFC 6.0)

Note:

This tutorial requires MFC 6.0.

In MFC, the LEADTOOLS Raster OLEDB control is a OLEDB data bound control. This means you can associate the LEADTOOLS Raster OLEDB control with an ADO data control so that the LEADTOOLS Raster OLEDB control's bitmap is bound to a specified field in the data control's recordset.

Take the following steps to start a project and to add some code that associates the LEADTOOLS Raster OLEDB control with an ADO data control:

1. | Use a database manager to create an ACCESS MBD database with one table that has two fields. Use the following specifications:
 | a. | Database name: leadpic.mdb.
 | b. | Table name: people.
 | c. | Field name: who. Data Type: text. Size: 255.
 | d. | Field name: photo. Data Type: Long Binary. Size: N/A.
2. | Create an ODBC data source that references the same database follows:
 | a. | From the Windows Control Panel, open the ODBC administrator and click the Add button.
 | b. | Select Microsoft Access driver and click the OK button.
 | c. | Enter the name LEADACCESS.
 | d. | Click the Select directory button and select the path to the database that you created.
 | e. | Click the OK button; click the next OK button; then click the Close button.
3. | Start the Microsoft Developer Studio for Visual C++, version 6.0.
4. | Select the File >New menu option. Select the Projects tab. Select MFC AppWizard (exe) from the list. Set the location for the new project as c:\ltwin14x\examples\ocx\MFC 6.0 (you may need to change this for your system) and name the project "mfcoledb". When you are finished, click OK.
5. | In step 1, choose "Dialog Based" for the type of application, and click Next.
6. | In step 2, make sure "ActiveX Controls" is checked, and click Finish.
7. | Open the new project's resources, and go to the IDD_MFCOLEDB_DIALOG dialog resource. Select the text box "TODO: Place dialog controls here" and hit the delete key.
8. | Right click on the dialog, and click on Insert ActiveX Control. Add the LEADRasterView Control to the dialog. Size and Position the control to your liking.
9. | Do the following to add m_LEADRasterView1 to the CMfcoledbDlg class and link the variable to the LEAD control using dynamic data exchange:
 | a. | Open the ClassWizard (CTRL-W).
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | ClassWizard will prompt you to generate the class wrapper for the LEADRasterView Control. Select OK, and then select OK again to accept the default filenames.
 | g. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | h. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
10. | Right click on the dialog, and click on Insert ActiveX Control. Add the Microsoft ADO Data Control to the dialog. Size and Position the control to your liking.
11. | Set the following properties for the ADO Data Control:
 | a. | Set the ConnectionString property by using the browse to build the string. Select the OLEDB Provider for ODBC Drivers, and set the DSN to LEADACCESS.
 | b. | Set the RecordSource by setting the CommandType to adCommandTable and the table to the "people" table.
12. | Do the following to add m_ADODC1 to the CMfcoledbDlg class and link the variable to the MS ADO Data Control using dynamic data exchange:
 | a. | Open the ClassWizard (CTRL-W).
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Control IDs list, select IDC_ADODC1.
 | e. | Click the Add Variable... button.
 | f. | ClassWizard will prompt you to generate the class wrapper for the ADO Data Control. Select OK, and then select OK again to accept the default filenames.
 | g. | Specify m_ADODC1 as the variable name, and Control as the category.
 | h. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
13. | Add a static text box to the dialog. Size and Position the control below the LEAD Raster View control. Right-click the text box to view the properties. Change the ID to IDC_TEXT.
14. | Add a member function to class CMfcoledbDlg to update the text field
 | a. | Click on the Class View Tab
 | b. | Right-click CMfcoledbDlg
 | c. | Choose "Add Member Function..."
 | d. | For Function Type enter void
 | e. | For Function Declaration enter UpdateTextBox
 | f. | For Access select Public
 | g. | Click the OK button
 | h. | Enter the following code for the function body:

void CMfcoledbDlg::UpdateTextBox()
{
//manually update the text control with the data from the text field
C_Recordset recset;
recset = m_ADODC1.GetRecordset();

VARIANT vax;
VariantInit(&vax);
VARIANT vaval;
VariantInit(&vaval);
CFields Fields;
CField cwho;
Fields = recset.GetFields();
vax.vt = VT_I4;
vax.lVal = 0;
cwho = Fields.GetItem(vax);
vaval = cwho.GetValue();
CString csText(vaval.bstrVal);
SysFreeString(vaval.bstrVal);
SetDlgItemText(IDC_TEXT, csText);
}

15. | In the Project Workspace click the Resource tab and display the IDD_MFCOLEDB_DIALOG dialog. Right click on the dialog, and click on Insert ActiveX Control. Add the LEADRasterOLEDB Control to the dialog.
16. | Set the following properties for the LEADRasterOLEDB Control:
 | a. | Set the DataSource property to IDC_ADODC1.
 | b. | Leave the DataMember property empty to use the default for this data source.
17. | Do the following to add m_LEADRasOLEDB1 to the CMfcoledbDlg class and link the variable to the LEADRasterOLEDB Control using dynamic data exchange:
 | a. | Open the ClassWizard (CTRL-W).
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTEROLEDB1.
 | e. | Click the Add Variable... button.
 | f. | ClassWizard will prompt you to generate the class wrapper for the LEADRasterOLEDB Control. Select OK, and then select OK again to accept the default filenames.
 | g. | Specify m_LEADRasOLEDB1 as the variable name, and Control as the category.
 | h. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
18. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the mfcoledb files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\\system32\\Ltrpr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\Ltrio14n.dll" no_namespace, named_guids, exclude("LoadResizeConstants")
#pragma warning(disable:4146)
#import "c:\\winnt\\system32\\Ltrdg14n.ocx" no_namespace, named_guids
#pragma warning(default:4146)

f.

Edit the file mfcoledbDlg.cpp and add the following include files after #include "mfcoledbDlg.h": (note, you will need to copy L_OCXERR.H to the project directory, from the LEADTOOLS \INCLUDE directory)

#include "_recordset.h"
#include "fields.h"
#include "field.h"
#include "leadrasterview.h"
#include "leadraster.h"
#include "l_ocxerr.h"

19. | Modify the OnInitDialog function follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select CMfcoledbDlg.
 | e. | In the Messages list box, select WM_INITDIALOG.
 | f. | Click the Edit Code button, and edit the function by adding the following just after "// TODO: Add extra initialization here":

// TODO: Add extra initialization here

m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);

m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView1.SetAutoRepaint(TRUE);

//create a small bitmap, so the OLEDB control will
//have a bitmap into which it can load images.
m_LEADRasterView1.GetRaster().CreateBitmap(1.0f,1.0f,1);
m_LEADRasOLEDB1.SetRaster(m_LEADRasterView1.GetRaster());

//databind performed at design-time, except for the data field
m_LEADRasOLEDB1.SetDataField("photo");

//Set the data properties on the LEAD OLE DB control
m_LEADRasOLEDB1.SetDataLoadBits(0);
m_LEADRasOLEDB1.SetDataSaveBits(24);
m_LEADRasOLEDB1.SetDataSaveFormat(FILE_LEAD);

m_LEADRasOLEDB1.SetDataSaveQuality(QFACTOR_QMS);

UpdateTextBox();
m_LEADRasOLEDB1.SetEnableMethodErrors(FALSE);

m_bValid = TRUE;
m_bDeleted = FALSE;
return TRUE; // return TRUE unless you set the focus to a control

20. | Open the project's resources, and go to the IDD_MFCOLEDB_DIALOG dialog resource.
21. | Right click on the dialog, and click on Insert ActiveX Control. Add the LEAD Raster Common Dialog Control to the dialog.
22. | Do the following to add m_LEADRasDlg1 to the CMfcoledbDlg class and link the variable to the LEAD Raster Common Dialog Control using dynamic data exchange:
 | a. | Open the ClassWizard (CTRL-W).
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERDLGCTRL1.
 | e. | Click the Add Variable... button.
 | f. | ClassWizard will prompt you to generate the class wrapper for the LEAD Raster Common Dialog Control. Select OK, and then select OK again to accept the default filenames.
 | g. | Specify m_LEADRasDlg1 as the variable name, and Control as the category.
 | h. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
23. | Add a member variable m_bDeleted
 | a. | Click on the Class View Tab
 | b. | Right click the CMfcoledbDlg class
 | c. | Select "Add Member Variable..."
 | d. | For Variable Type enter BOOL
 | e. | For Variable Name enter m_bDeleted
 | f. | For Access, choose Public
 | g. | Click "OK"
 | h. | In the OnInitDialog() method, add this line to the end

m_Deleted = FALSE

24.

Repeat the previous steps to add the following variable to CMfcoledbDlg

BOOL m_bValid

25. | Open the project's resources, and go to the IDD_MFCOLEDB_DIALOG dialog resource.
26. | Add 3 command buttons to the dialog, and set the properties as follows
 | ID | Caption
 | IDC_ADDREC | "AddRec"
 | IDC_DELREC | "DelRec"
 | IDC_FLIP | "Flip"
27. | Add the OnAddrec event as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_ADDREC.
 | e. | In the Messages list box, select BN_CLICKED.
 | f. | Click the Add function button. Choose OK for the default function name (OnAddrec).
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CMfcoledbDlg::OnAddrec()
{
VARIANT va1;
VARIANT va2;
C_Recordset recset;
CString csSearch;

int nRet;
int nPage;
CString strFileName = TEXT("");
RECT rcWin;
CLEADRasterDlg LTCommDlg;
ILEADRasterVariant * pltRasVar = NULL;
ILEADRasterDlgKrn * pltRasKrn = NULL;
ILEADRasterDlgFile * pltRasFile = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
CoCreateInstance(CLSID_LEADRasterDlgKrn, NULL, CLSCTX_ALL,
IID_ILEADRasterDlgKrn, (void **)&pltRasKrn);
CoCreateInstance(CLSID_LEADRasterDlgFilet, NULL, CLSCTX_ALL,
IID_ILEADRasterDlgFile, (void **)&pltRasFile);
BSTR  strFile;

pltRasFile->PutEnableMethodErrors
 (FALSE);
pltRasFile->PutFilter
 ("");
pltRasFile->PutFileDlgFlags
 (0);
pltRasFile->PutDialogTitle
 ("Open File");
pltRasFile->PutUIFlags
 (OPEN_SHOW_MULTIPAGE | OPEN_SHOW_FILEINFO | OPEN_SHOW_PREVIEW );

nRet = pltRasFile->ShowOpenDlg
 ((long)this->m_hWnd);
if (nRet == 0)
{
strFileName = pltRasFile->GetFileName ();
nPage = pltRasFile->GetPageNumber ();
}
else
return;

VariantInit(&va1);
VariantInit(&va2);

if (strFileName.GetLength())
{
// Hide the Lead control while we update the recordset
m_LEAD1.ShowWindow(SW_HIDE);

recset = m_ADODC1.GetRecordset();

BOOL  bCanAdd= TRUE;
CFields Fields;
CField cwho;
CField cphoto;
FILE *pFile;
unsigned int nbytes = 1024, bytesread;
BYTE buffer[1024];
VARIANT var;
VariantInit(&var);  //Initialize our variant
void * pArrayData = NULL;
Fields = recset.GetFields();

va1.vt = VT_I4;
va1.lVal = 0;

va2.vt = VT_BSTR;
va2.bstrVal = strFileName.AllocSysString();
strFile = strFileName.AllocSysString();

ILEADRaster *pRaster=NULL;
HRESULT hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);
if (FAILED(hr))
return;

int nRet = m_pRasterIO->Load(pRaster, strFile, 0, 1, 1);

pRaster->Release();
if (nRet != 0)
{
CString csError;
csError.Format(TEXT("You can not add this file. Error no = %d"), nRet);
AfxMessageBox(csError);
m_LEAD1.ShowWindow(SW_SHOW);
return;
}

TRY
{
recset.AddNew(va1, va2);
}
CATCH_ALL(e)
{
AfxMessageBox(TEXT("Couldn't add this record"), MB_ICONEXCLAMATION);
recset.CancelUpdate();
m_LEAD1.ShowWindow(SW_NORMAL);
bCanAdd = FALSE;
}
END_CATCH_ALL

// release any reference
if (!bCanAdd)
return;

m_LEADOLEDB1.GetRaster().SetBitmap(0);
m_pltAnn->PutAnnContainer(0);
m_LEADOLEDB1.SetAnnContainer(0);

m_bDataDirty = TRUE;
m_LEADOLEDB1.SetDataDirty(TRUE);

recset.Update(va1, va2);
Fields = recset.GetFields();

pltRasVar->Type = VALUE_ARRAY_BYTE;

//Set up the bounds structure
SAFEARRAYBOUND  rgsabound[1];
va1.lVal = 1;
cphoto = Fields.GetItem(va1);

if((pFile = _tfopen(strFileName, TEXT("r+b"))) == NULL)
return;

//read the image into chunks as 1K
do
{
bytesread = fread(buffer, sizeof(BYTE), nbytes, pFile);

if (bytesread)
{
pltRasVar->ItemCount = bytesread;

for (long i; i< bytesread ; i++)
pltRasVar->ShortItemValue (i) = buffer(i);
}
}
while(bytesread == nbytes);

fclose(pFile);

VariantInit(&var);  //Initialize our variant

pltRasVar->Type = VALUE_ARRAY_BYTE;
m_pRasterIO->StartFeedLoad(m_LEAD1.GetRaster(), 0, 0, 1);
do
{
m_pRasterIO->FeedLoad(pltRasVar, bytesread);
}
while(pltRasVar->ItemCount == nbytes);

m_pRasterIO->StopFeedLoad();

::SysFreeString(va2.bstrVal);
// Requery the data control's recordset
recset.Requery(0);

// Go to the new record, and show the LEAD control
m_LEAD1.ShowWindow(SW_SHOW);
csSearch = TEXT("who = '") + strFileName + TEXT("'");
va1 = recset.GetBookmark();
recset.Find((LPCTSTR)csSearch, 0, 1/*search forward*/, va1);
}

pltRasVar->Release ();
pltRasKrn->Release ();
pltRasFile->Release ();
}

28. | Add the OnDelrec event as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_DELREC.
 | e. | In the Messages list box, select BN_CLICKED.
 | f. | Click the Add function button. Choose OK for the default function name (OnDelrec).
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CMfcoledbDlg::OnDelrec()
{
C_Recordset recset;
recset = m_ADODC1.GetRecordset();

if (recset.GetBof() && recset.GetEof())
return;

// Hide the LEADRasterView control.
m_LEADRasterView1.ShowWindow(SW_HIDE);
// Delete the record

recset.Delete(1); //delete current record only
m_bDeleted = TRUE;

// Requery the recordset, and move to saved position
recset.Requery(0);

m_LEADRasterView1.ShowWindow(SW_SHOW);
m_bDeleted = FALSE;
if(recset.GetEof())
recset.MoveLast();
}

29. | Add the OnFlip event as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_FLIP.
 | e. | In the Messages list box, select BN_CLICKED.
 | f. | Click the Add function button. Choose OK for the default function name (OnFlip).
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CMfcoledbDlg::OnFlip()
{
//Flip the image
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
pRasterProc->Release();
m_LEADRasOLEDB1.SetDataDirty(TRUE);

}

30. | Add the LEAD OLEDB Control's OnDataLoaded event as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_LEADRASTEROLEDB1.
 | e. | In the Messages list box, select DataLoaded.
 | f. | Click the Add function button. Choose OK for the default function name (OnDataLoadedLtodbctl1).
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CMfcoledbDlg::OnDataLoadedLeadrasteroledb1(short nStatus)
{
if(nStatus == 0)
{
m_LEADRasOLEDB1.SetDataDirty(FALSE);
}

else if(nStatus == ERROR_FILENOTFOUND) //if it's an empty record
{
if (m_ADODC1.GetMaxRecords() == 0)
m_LEADRasOLEDB1.GetRaster().SetBitmap(0);
}
else if (nStatus != ERROR_FILENOTFOUND) //if it's not an empty record
{
//Do nothing
}

if (IsWindow(m_LEADRasterView1.m_hWnd))
m_LEADRasterView1.ForceRepaint();
}

31. | Add the LEAD OLEDB Control's OnDataSaved event as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_LEADRASTEROLEDB1.
 | e. | In the Messages list box, select DataSaved.
 | f. | Click the Add function button. Choose OK for the default function name (OnDataSavedLtodbctl1).
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CMfcoledbDlg::OnDataSavedLeadrasteroledb1(short nStatus)
{
if(nStatus != 0)
{
m_LEADRasterView1.ForceRepaint();
AfxMessageBox(TEXT("Error saving to database!"));
}
}

32. | Process the Microsoft ADO control event MoveComplete
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CMfcoledbDlg.
 | d. | In the Object IDs list box, select IDC_ADODC1.
 | e. | In the Messages list box, select MoveComplete
 | f. | Click the "Add Function..." button, take the default, and click "OK"
 | g. | Click the "Edit Code" button.
 | h. | Click the Edit Code button, and edit the function as follows

void CMfcoledbDlg::OnMoveCompleteAdodc1(long adReason, LPDISPATCH pError, long FAR* adStatus, LPDISPATCH pRecordset)
{
if (m_bValid)
{
if (!m_bDeleted)
UpdateTextBox();
else
SetDlgItemText(IDC_TEXT, TEXT(""));
}
}

33. | On the main menu, select Build > Build ltcdb.exe to build the project.
34. | On the main menu, select Build > Execute ltcdb.exe to run the project.


Printing Multiple Images (Visual C++ 5.0)

Printing Multiple Images (C++ 5.0 and later)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new button under the Cancel button. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
5. | Double-click the button and change IDC_BUTTON1 to IDC_PRINT. Also, set the Caption to &Print.
6. | Press Ctrl-F4 to close all windows back to the Project Workspace.
7. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_PRINT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnPrint).
 | f. | Click the Edit Code button to start entering the code.
8. | Enter new code as follows:

void CTutorDlg::OnPrint()
{
// TODO: Add your control notification handler code here
//Declare the variable for printed text
static TCHAR szMessage1[] = TEXT("This is a print example using LEADTOOLS ActiveX.");
//Declare the variables for pixel measurements
int TextHeightInPixels;
int UsableWidth;
int UsableHeight;
int MaxImageHeight;
//Declare the variables for sizing and positioning the image
long PrintLeft;
long PrintTop;
long PrintHeight;
long PrintWidth;
//Declare variables used for preserving aspect ratios
int WidthFactor;
int HeightFactor;
HDC hdcPrinter;
PRINTDLG printdlg;
int yPrinter;
DOCINFO docinfo;
SIZE size;
//Set the variables used for preserving the aspect ratio
HeightFactor = (int)m_LEADRasterView1.GetRaster().GetBitmapHeight();
WidthFactor = (int)m_LEADRasterView1.GetRaster().GetBitmapWidth();
// get the printer DC here
memset( &printdlg, 0, sizeof(printdlg) );
printdlg.lStructSize = sizeof(printdlg);
printdlg.Flags = PD_RETURNDC;
if( !PrintDlg(&printdlg) )
return;
if( (hdcPrinter = printdlg.hDC) == NULL )
{
if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);
if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);
return;
}
docinfo.cbSize = sizeof(docinfo);
docinfo.lpszDocName = TEXT("Print example using LEADTOOLS ActiveX.");
docinfo.lpszOutput= NULL;
docinfo.fwType = 0L;
if( StartDoc(hdcPrinter, &docinfo) <= 0)
{
if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);
if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);
DeleteDC(hdcPrinter);
}
StartPage(hdcPrinter);
//Set the pointer to an hourglass
HCURSOR hOldCursor = SetCursor(LoadCursor(NULL,IDC_WAIT));
//Get the page width and height in pixels (dots)
UsableWidth = GetDeviceCaps(hdcPrinter,HORZRES);
UsableHeight = GetDeviceCaps(hdcPrinter,VERTRES);
//Print a title at the top of the page
yPrinter = 0;
TextOut( hdcPrinter, 0, yPrinter, szMessage1, strlen(szMessage1));
//Get the maximum height of one image,
//assuming two equal-size images and space for 12 lines of text
GetTextExtentPoint32( hdcPrinter, szMessage1, strlen(szMessage1), &size );
TextHeightInPixels = (int)size.cy;
yPrinter += TextHeightInPixels;
MaxImageHeight = (UsableHeight - (12 * TextHeightInPixels)) / 2;
//Size and position the first image, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if ( ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1; //This is for flush left. Use 0 for centering.
PrintTop = yPrinter;
PrintWidth = UsableWidth;
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor;
}
else
{
PrintLeft = 1; //This is for flush left. Use 0 for centering.
PrintTop = yPrinter;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the first image
m_LEADRasterView1.Render( (long)hdcPrinter, (float)PrintLeft, (float)PrintTop, (float)PrintWidth, (float)PrintHeight );
//Update the current printing position
yPrinter += PrintHeight;
//Leave a blank line, then print a caption for the next picture
yPrinter += TextHeightInPixels;
static TCHAR szMessage2[] = TEXT("This is a print example using LEADTOOLS ActiveX.");
TextOut( hdcPrinter, 0, yPrinter, szMessage2, strlen(szMessage2) );
yPrinter += TextHeightInPixels;
//Stretch the intensity of the bitmap for the second printing
//to show the difference between the second picture and the first
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->StretchIntensity(m_LEADRasterView1.GetRaster());
pRasterProc->Release();
//Size and position the second image, preserving the aspect ratio.
//The coding is the same as for the first image.
if( ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight )
{
PrintLeft = 1; //This is for flush left. Use 0 for centering.
PrintTop = yPrinter;
PrintWidth = UsableWidth;
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor;
}
else
{
PrintLeft = 1; //This is for flush left. Use 0 for centering.
PrintTop = yPrinter;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the second image
m_LEADRasterView1.Render( (long)hdcPrinter, (float)PrintLeft, (float)PrintTop, (float)PrintWidth, (float)PrintHeight );
//Finish the page and finish the print job
EndPage( hdcPrinter );
EndDoc( hdcPrinter );
//Set the mouse pointer back to the default
SetCursor( hOldCursor );
if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);
if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);
DeleteDC(hdcPrinter);
}

9.

Rebuild and run the application.


Writing and Reading Multipage Files (Visual C++ 5.0)

Writing and Reading Multipage Files (C++ 5.0 and later)

Take the following steps to create a multipage file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support multipage files.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new LEAD RasterView Control to the dialog box as follows:
 | a. | In the Controls toolbar, click the LEAD RasterView control icon; then click the dialog box to add the control to the dialog box.
 | b. | Double-click the new LEAD RasterView control to edit its properties.
 | c. | Change the properties ID to IDC_LEADRASTERVIEW2.
5. | Add a new button at the top of the dialog box. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
6. | Double-click the button and change IDC_BUTTON1 to IDC_MULTIPAGE. Also, set the Caption to &Multipage.
7. | Press Ctrl-F4 to close all windows back to the Project Workspace.
8. | Do the following to add m_LEADRasterView2 to the CTutorDlg class and link the variable to the LEAD RasterView control using dynamic data exchange:
 | a. | From the main menu, select View > ClassWizard. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW2.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView2 as the variable name, and Control as the category.
 | g. | Click OK to close the ClassWizard.
9. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_MULTIPAGE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMultipage).
 | f. | Click the Edit Code button to start entering the code.
10. | Enter new code as follows:

void CTutorDlg::OnMultipage()
{
ILEADRasterIO *pRasterIO1=NULL;
ILEADRasterIO *pRasterIO2=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO1);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO2);

// Disable automatic repainting of the image.
m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView2.SetAutoRepaint(FALSE);
// Turn off scroll bars to make sure we use the full client area.
m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView2.SetAutoScroll(FALSE);
// Position and size the main form so that it takes up most of the screen.
float Width = (float)GetSystemMetrics(SM_CXSCREEN) * 0.9f;
float Height = (float)GetSystemMetrics(SM_CYSCREEN)* 0.8f;
float Left = ((float)GetSystemMetrics(SM_CXSCREEN) - Width) / 2;
float Top = ((float)GetSystemMetrics(SM_CYSCREEN) - Height) / 2;
// Display the form and set the mouse pointer to an hourglass.
MoveWindow((int) Left, (int) Top, (int) Width, (int) Height);
BeginWaitCursor();
// Load the bitmaps. These path names may be different on your system.
pRasterIO1->Load(m_LEADRasterView1.GetRaster(),
"..\\..\\..\\..\\images\\image1.cmp", 0, 0, 1 );
pRasterIO2->Load(m_LEADRasterView2.GetRaster(),
"..\\..\\..\\..\\images\\image2.cmp", 0, 0, 1 );
// Save the bitmaps to a single multipage TIFF file
pRasterIO1->Save(m_LEADRasterView1.GetRaster(),
"c:\\combined.tif", FILE_TIF, 24, (QFactorConstants)0, SAVE_OVERWRITE );
pRasterIO2->Save(m_LEADRasterView2.GetRaster(),
"c:\\combined.tif", FILE_TIF, 24, (QFactorConstants)0, SAVE_APPEND );
// Clear the bitmaps from memory
m_LEADRasterView1.GetRaster().SetBitmap( 0 );
m_LEADRasterView2.GetRaster().SetBitmap( 0 );
// Get information about the images so that we can size the controls.
pRasterIO1->GetFileInfo(m_LEADRasterView1.GetRaster(),
"c:\\combined.tif", 1, 0 );
pRasterIO2->GetFileInfo(m_LEADRasterView2.GetRaster(),
"c:\\combined.tif", 2, 0 );
// Set the variables used for preserving the aspect ratio.
float HeightFactor1 = pRasterIO1->GetInfoHeight();
float WidthFactor1 = pRasterIO1->GetInfoWidth();
float HeightFactor2 = pRasterIO2->GetInfoHeight();
float WidthFactor2 = pRasterIO2->GetInfoWidth();
CRect rcWindow;
GetClientRect(rcWindow);
float HeightAllowed = rcWindow.Height() * 0.8f;
float WidthAllowed = rcWindow.Width() * 0.45f;
// Center each LEAD control on half of the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if( (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed )
{
Left = ( (rcWindow.Width() / 4) - (WidthAllowed / 2) );
Width = WidthAllowed;
Height = ((Width * HeightFactor1) / WidthFactor1);
Top = ((rcWindow.Height() - Height) / 2);
}
else
{
Top = ((rcWindow.Height() - HeightAllowed) / 2);
Height = HeightAllowed;
Width = ((Height * WidthFactor1) / HeightFactor1);
Left = ((rcWindow.Width() / 4) - (Width / 2));
}
m_LEADRasterView1.MoveWindow( CRect((int)Left, (int)Top,
(int)Left + (int)Width,
(int)Top + (int)Height) );
if( (WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed )
{
Left = ((rcWindow.Width() * 3/4) - (WidthAllowed / 2));
Width = WidthAllowed;
Height = ((Width * HeightFactor2) / WidthFactor2);
Top = ((rcWindow.Height() - Height) / 2);
}
else
{
Top = (rcWindow.Height() - HeightAllowed) / 2;
Height = HeightAllowed;
Width = ((Height * WidthFactor2) / HeightFactor2);
Left = ((rcWindow.Width() * 3 / 4) - (Width / 2));
}
m_LEADRasterView2.MoveWindow( CRect((int)Left, (int)Top,
(int)Left + (int)Width,
(int)Top + (int)Height) );
// Load the bitmaps from the multipage TIFF file
pRasterIO1->Load( m_LEADRasterView1.GetRaster(),
"c:\\combined.tif", 24, 1, 1 );
pRasterIO2->Load( m_LEADRasterView2.GetRaster(),
"c:\\combined.tif", 24, 2, 1 );
// Set the image display sizes to match the LEAD controls
float ImageWidth = m_LEADRasterView1.GetScaleWidth();
float ImageHeight = m_LEADRasterView1.GetScaleHeight();
m_LEADRasterView1.SetDstRect( 0.0f, 0.0f, ImageWidth, ImageHeight );
m_LEADRasterView1.SetDstClipRect( 0.0f, 0.0f, ImageWidth, ImageHeight );
// Set the image display sizes to match the LEAD controls
ImageWidth= m_LEADRasterView2.GetScaleWidth();
ImageHeight= m_LEADRasterView2.GetScaleHeight();
m_LEADRasterView2.SetDstRect( 0.0f, 0.0f, ImageWidth, ImageHeight );
m_LEADRasterView2.SetDstClipRect( 0.0f, 0.0f, ImageWidth, ImageHeight );
// Display the images
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView2.ForceRepaint();
// Set the mouse pointer back to the default();
EndWaitCursor();
pRasterIO1->Release();
pRasterIO2->Release();
}

11.

Rebuild and run the application. Running the application may take a long time because it will load two images, write both of them into a TIF file and read them again.


Drawing Simple Lines and Shapes (Visual C++ 5.0)

Drawing Simple Lines and Shapes (C++ 5.0 and later)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

int m_nDrawObject; // The object we are drawing
float m_fStartX; // Starting X position
float m_fStartY; // Starting Y position
float m_fEndX; // Ending X position
float m_fEndY; // Ending Y position
ILEADRasterFXD *m_pltRasFXD;
BOOL m_bDrawing;

3. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | e. | Double-click the StdAfx.h file to edit it.
 | d. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrfd14n.dll" no_namespace, named_guids

4.

Add the following code to the OnInitDialog

CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL,IID_ILEADRasterFXD, (void**)&m_pltRasFXD);
m_pltRasFXD->PutDstLeft(0);
m_pltRasFXD->PutDstTop(0);
m_pltRasFXD->PutSrcLeft(0);
m_pltRasFXD->PutSrcTop(0);
m_pltRasFXD->PutScaleMode (3);
m_pltRasFXD->PutClientSizeX (5);
m_pltRasFXD->PutClientSizeY (5);

5. | Process the WM_DESTROY dialog message as follows:
 | Click on the Class View Tab
 | a. | Right-clock the CTutorDlg class
 | b. | Choose "Add Windows Message Handler"
 | c. | Select WM_DESTROY for the "New Window Messages/events"
 | d. | Click the "Add and Edit" button
 | e. | Enter new code as follows:

void CTutorDlg::OnDestroy()
{
if (!m_pltRasFXD)
m_pltRasFXD->Release();
CDialog::OnDestroy();
}

6.

Edit the OnLoadlead() function to add the following code to the end:

m_nDrawObject = 0;
m_bDrawing = FALSE;
m_pltRasFXD->PutDstRight((long) m_LEADRasterView1.GetRaster().GetBitmapWidth());
m_pltRasFXD->PutDstBottom((long) m_LEADRasterView1.GetRaster().GetBitmapHeight());
m_pltRasFXD->PutSrcRight((long) m_LEADRasterView1.GetRaster ().GetBitmapWidth());
m_pltRasFXD->PutSrcBottom ((long) m_LEADRasterView1.GetRaster().GetBitmapHeight());

7. | Code the LEADRasterView control's MouseDown event as follows. (This code selects a different drawing object each time the event occurs.)
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | Click the Message Maps tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | e. | In the Messages list box, select MouseDown.
 | f. | Click the Add function button. Choose OK for the default function name
 | g. | Click the Edit Code button, and edit the function so it appears as follows:

void CTutorDlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
m_bDrawing = TRUE;
// Save the starting position.
m_fStartX = x;
m_fStartY = y;
m_fEndX = x;
m_fEndY = y;
// Cycle through the types of drawing objects.
switch (m_nDrawObject)
{
case 0:
m_nDrawObject = 1; // Line
break;
case 1:
m_nDrawObject = 2; // Rectangle
break;
case 2:
m_nDrawObject = 0; // Ellipse
break;
}
}

8.

Add the LEADRasterView control's MouseMove event as described in the previous step. This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one. Code the LEADRasterView control's MouseMove event as follows.

void CTutorDlg::OnMouseMoveLeadrasterview1(short Button, short Shift, float x, float y)
{
float OldEndX, OldEndY;
float OldDrawX, OldDrawY, OldWidth, OldHeight;
float DrawX, DrawY, NewWidth, NewHeight;
if (m_bDrawing == TRUE)
{
// Set the drawing styles.
m_pltRasFXD->PutDrawPenStyle(DRAWPENSTYLE_SOLID);
m_pltRasFXD->PutDrawMode(DRAWMODE_INVERT);
m_pltRasFXD->PutDrawFillStyle(DRAWFILLSTYLE_TRANSPARENT);
m_pltRasFXD->PutDrawPersistence(FALSE); // On the window, not the bitmap
// Save the previous ending mouse position.
OldEndX = m_fEndX;
OldEndY = m_fEndY;
// Get the current mouse position.
m_fEndX = x;
m_fEndY = y;
// Calculate the origin of the current object.
if (m_fEndX > m_fStartX)
DrawX = m_fStartX;
else
DrawX = m_fEndX;
if (m_fEndY > m_fStartY)
DrawY = m_fStartY;
else
DrawY = m_fEndY;
// Calculate the origin of the previous object.
if (OldEndX > m_fStartX)
OldDrawX = m_fStartX;
else
OldDrawX = OldEndX;
if (OldEndY > m_fStartY)
OldDrawY = m_fStartY;
else
OldDrawY = OldEndY;
// Calculate the height and width of the current object.
NewHeight = (float)abs((int)m_fStartY - (int)m_fEndY);
NewWidth = (float)abs((int)m_fStartX - (int)m_fEndX);
// Calculate the height and width of the previous object.
OldHeight = (float)abs((int)m_fStartY - (int)OldEndY);
OldWidth = (float)abs((int)m_fStartX - (int)OldEndX);
// Erase the old object and draw the new one.
switch (m_nDrawObject)
{
case 0: // Ellipse
m_pltRasFXD->DrawEllipse(NULL, m_LEADRasterView1. GetClientDC(), (float)OldDrawX, (float)OldDrawY, (float)OldWidth, (float)OldHeight);
m_pltRasFXD->DrawEllipse(NULL, m_LEADRasterView1. GetClientDC(), (float)DrawX, (float)DrawY, (float)NewWidth, (float)NewHeight);
break;
case 1: // Line
m_pltRasFXD->DrawLine( NULL, m_LEADRasterView1. GetClientDC(), m_fStartX, m_fStartY, OldEndX, OldEndY);
m_pltRasFXD->DrawLine( NULL, m_LEADRasterView1. GetClientDC(), m_fStartX, m_fStartY, m_fEndX, m_fEndY);
break;
case 2: // Rectangle
m_pltRasFXD->DrawRectangle( NULL, m_LEADRasterView1. GetClientDC(), OldDrawX, OldDrawY, OldWidth, OldHeight);
m_pltRasFXD->DrawRectangle( NULL, m_LEADRasterView1. GetClientDC(), DrawX, DrawY, NewWidth, NewHeight);
break;
}
}
}

8.

Add the LEADRasterView control's MouseUp event as described in the previous step.This code sets the drawing style and draws the object on the bitmap. Code the LEADRasterView control's MouseUp event as follows.

void CTutorDlg::OnMouseUpLeadrasterview1(short Button, short Shift, float x, float y)
{
float DrawX, DrawY, NewWidth, NewHeight;
m_bDrawing = FALSE;
// Set the drawing style.
m_pltRasFXD->PutDrawPenStyle(DRAWPENSTYLE_SOLID);
m_pltRasFXD->PutDrawPenWidth(2);
m_pltRasFXD->PutDrawPenColor(RGB(255, 0, 0)); // Red
m_pltRasFXD->PutDrawMode(DRAWMODE_COPY_PEN);
m_pltRasFXD->PutDrawFillColor(RGB(0, 255, 0)); // Green
m_pltRasFXD->PutDrawFillStyle(DRAWFILLSTYLE_HORIZONTAL_LINE);
m_pltRasFXD->PutDrawPersistence(TRUE); // On the bitmap
// Get the current mouse position
m_fEndX = x;
m_fEndY = y;
// Determine the origin of the object.
if (m_fEndX > m_fStartX)
DrawX = m_fStartX;
else
DrawX = m_fEndX;
if (m_fEndY > m_fStartY)
DrawY = m_fStartY;
else
DrawY = m_fEndY;
// Determine the height and width of the object.
NewHeight = (float)abs((int)m_fStartY - (int)m_fEndY);
NewWidth = (float)abs((int)m_fStartX - (int)m_fEndX);
// Draw the object
switch (m_nDrawObject)
{
case 0: // Ellipse
m_pltRasFXD->DrawEllipse((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL, DrawX, DrawY, NewWidth, NewHeight);
break;
case 1: // Line
m_pltRasFXD->DrawLine((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL, m_fStartX, m_fStartY, m_fEndX, m_fEndY);
break;
case 2: // Rectangle
m_pltRasFXD->DrawRectangle((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL , DrawX, DrawY, NewWidth, NewHeight);
break;
}

m_LEADRasterView1.ForceRepaint();
}

9.

Run your program to test it.


Cropping a Displayed Image and Copying It to a Bitmap (Visual C++ 5.0)

Cropping a Bitmap (C++ 5.0 and later)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the FileView tab.
3. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

BOOL m_bCropping; //The state when the mouse is used for cropping
float m_fStartX; //Starting X position in screen pixels
float m_fStartY; //Starting Y position in screen pixels
float m_fEndX; //Ending X position in screen pixels
float m_fEndY; //Ending Y position in screen pixels

4. | Go to the Project Workspace and click the ResourceView tab.
5. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
6. | Add a new button to use for activating a selection mode. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
7. | Double-click the button and change IDC_BUTTON1 to IDC_SELECT. Also, set the Caption to &Select.
8. | Add another button to use for trimming the bitmap. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
9. | Double-click the button and change IDC_BUTTON1 to IDC_TRIM. Also, set the Caption to &Trim.
10. | Press Ctrl-F4 to close all windows back to the Project Workspace.
11. | Start the Class Wizard and add code for the Select button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_SELECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnSelect).
 | f. | Click the Edit Code button to start entering the code.
12. | Enter new code as follows:

void CTutorDlg::OnSelect()
{
// TODO: Add your control notification handler code here
// Initialize cropping so that you can do it more than once
if( m_bCropping )
{
// Set the clipping area to match the image.
m_LEADRasterView1.SetDstClipRect( m_LEADRasterView1.GetDstLeft(),
m_LEADRasterView1.GetDstTop(),
m_LEADRasterView1.GetDstWidth(),
m_LEADRasterView1.GetDstHeight() );
// Display the image
m_LEADRasterView1.ForceRepaint();
}
// Set a global variable to let other events know that you are cropping
m_bCropping = TRUE;
// Set the pointer to a crosshair
m_LEADRasterView1.SetMousePointer(2);
}

13. | Add code for the Trim button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_TRIM.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnTrim).
 | e. | Click the Edit Code button to start entering the code.
14. | Enter new code as follows:

void CTutorDlg::OnTrim()
{
float XFactor, YFactor,
NewTop, NewLeft, NewWidth, NewHeight;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// TODO: Add your control notification handler code here
m_LEADRasterView1.SetMousePointer(11); // hourglass
// Use the clipping rectangle// s percentage offsets in the image rectangle
// to determine the trimmed rectangle in the bitmap.
// Using percentages allows for the possibility that the image is zoomed.
XFactor = m_LEADRasterView1.GetRaster().GetBitmapWidth() / m_LEADRasterView1.GetDstWidth();
YFactor = m_LEADRasterView1.GetRaster().GetBitmapHeight() / m_LEADRasterView1.GetDstHeight();
NewTop = (m_LEADRasterView1.GetDstClipTop() - m_LEADRasterView1.GetDstTop()) * YFactor;
NewLeft = (m_LEADRasterView1.GetDstClipLeft() - m_LEADRasterView1.GetDstLeft()) * XFactor;
NewWidth = m_LEADRasterView1.GetDstClipWidth() * XFactor;
NewHeight = m_LEADRasterView1.GetDstClipHeight() * YFactor;
// Make sure display rectangles are automatically adjusted.
m_LEADRasterView1.SetAutoSetRects(TRUE);
// Trim the bitmap. This changes the size of the image and
// both the source and destination clipping rectangles
pRasterProc->Trim(m_LEADRasterView1.GetRaster(), NewLeft, NewTop, NewWidth, NewHeight);
pRasterProc->Release();
// Turn off scroll bars to make sure we use the full client area.
m_LEADRasterView1.SetAutoScroll(FALSE);
// Set the image display size to match the LEAD control
// The source rectangle matches the smaller bitmap.
// Making the destination rectangle bigger, the paint will fill the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight() );
m_LEADRasterView1.SetDstClipRect( 0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight() );
// Display the image
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView1.SetMousePointer(0); // Default
}

15. | To add the code for LEAD mouse events, do the following:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | d. | Continue with the remaining steps for each mouse event.
16. | In the MFC ClassWizard, double-click the MouseDown event and add code as follows:

void CTutorDlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
// Save the starting position
if( m_bCropping && Button == 1 )
{
m_fStartX = x;
m_fStartY = y;
// Make the rubberband invisible until the mouse moves
m_LEADRasterView1.SetRubberBandVisible(FALSE);
}
}

17.

In the MFC ClassWizard, double-click the MouseMove event and add code as follows:

void CTutorDlg::OnMouseMoveLeadrasterview1(short Button, short Shift, float x, float y)
{
if( m_bCropping && Button == 1 )
{
float rbX, rbY, rbWidth, rbHeight;
// Get the current mouse position
m_fEndX = x;
m_fEndY = y;
// Determine the origin of the rubberband rectangle,
// regardless of which way the mouse moves.
if( m_fEndX > m_fStartX )
rbX = m_fStartX;
else
rbX = m_fEndX;
if( m_fEndY > m_fStartY )
rbY = m_fStartY;
else
rbY = m_fEndY;
// Determine the height and width of the rubberband rectangle
rbHeight = (float)fabs((double)m_fStartY - m_fEndY);
rbWidth = (float)fabs((double)m_fStartX - m_fEndX);
// Set the rubberband rectangle
m_LEADRasterView1.SetRubberBandRect( rbX, rbY, rbWidth, rbHeight );
// Alternatively, you could use the following properties to set the
// rubberband rectangle:
// m_LEADRasterView1.SetRubberBandHeight(rbHeight);
// m_LEADRasterView1.SetRubberBandLeft(rbX);
// m_LEADRasterView1.SetRubberBandTop(rbY);
// m_LEADRasterView1.SetRubberBandWidth(rbWidth);
// Make the rubberband rectangle visible
m_LEADRasterView1.SetRubberBandVisible(TRUE);
}
}

18.

In the MFC ClassWizard, double-click the MouseUp event and add code as follows:

void CTutorDlg::OnMouseUpLeadrasterview1(short Button, short Shift, float x, float y)
{
if( m_bCropping && Button == 1 )
{
float CropLeft, CropTop, CropWidth, CropHeight;
// Get the current mouse position
m_fEndX = x;
m_fEndY = y;
// Get the origin of the clipping rectangle.
// Allow for different mouse drag directions
if( m_fStartX < m_fEndX )
CropLeft = m_fStartX;
else
CropLeft = m_fEndX;
if( m_fStartY < m_fEndY )
CropTop = m_fStartY;
else
CropTop = m_fEndY;
// Get the height and width of the cropped area
CropWidth = (float)fabs((double)m_fEndX - m_fStartX);
CropHeight = (float)fabs((double)m_fEndY - m_fStartY);
// Crop and repaint the image
m_LEADRasterView1.SetDstClipRect(CropLeft, CropTop, CropWidth, CropHeight);
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView1.SetRubberBandVisible(FALSE);
m_LEADRasterView1.SetMousePointer(0); // Default
}
}

19.

Press Ctrl-Home to go to the top of the current file (tutorDlg.cpp), and add the following to the list of include files:

#include <math.h>

20.

Rebuild and run the application.


Cropping a Bitmap2 (C++ 5.0 and later)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the FileView tab.
3. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

BOOL m_bCropping; //The state when the mouse is used for cropping
float m_fStartX; //Starting X position in screen pixels
float m_fStartY; //Starting Y position in screen pixels
float m_fEndX; //Ending X position in screen pixels
float m_fEndY; //Ending Y position in screen pixels

4. | Go to the Project Workspace and click the ResourceView tab.
5. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
6. | Add a new button to use for activating a selection mode. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
7. | Double-click the button and change IDC_BUTTON1 to IDC_SELECT. Also, set the Caption to &Select.
8. | Add another button to use for trimming the bitmap. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
9. | Double-click the button and change IDC_BUTTON1 to IDC_TRIM. Also, set the Caption to &Trim.
10. | Press Ctrl-F4 to close all windows back to the Project Workspace.
11. | Start the Class Wizard and add code for the Select button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_SELECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnSelect).
 | f. | Click the Edit Code button to start entering the code.
12. | Enter new code as follows:

void CTutorDlg::OnSelect()
{
// TODO: Add your control notification handler code here
m_LEADRasterView1.SetEnableFireMouse2Event(TRUE);

// Initialize cropping so that you can do it more than once
if( m_bCropping )
{
// Set the clipping area to match the image.
m_LEADRasterView1.SetDstClipRect ( m_LEADRasterView1.GetDstLeft (),
m_LEADRasterView1.GetDstTop (),
m_LEADRasterView1.GetDstWidth (),
m_LEADRasterView1.GetDstHeight () );
// Display the image
m_LEADRasterView1.ForceRepaint ();
}
// Set a global variable to let other events know that you are cropping
m_bCropping = TRUE;
// Set the pointer to a crosshair
m_LEADRasterView1.SetMousePointer (2);
}

13. | Add code for the Trim button. To do so, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_TRIM.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnTrim).
 | e. | Click the Edit Code button to start entering the code.

14.

Enter new code as follows:

void CTutorDlg::OnTrim()
{
float XFactor, YFactor,
NewTop, NewLeft, NewWidth, NewHeight;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// TODO: Add your control notification handler code here
m_LEADRasterView1.SetMousePointer (11); // hourglass
// Use the clipping rectangle's percentage offsets in the image rectangle
// to determine the trimmed rectangle in the bitmap.
// Using percentages allows for the possibility that the image is zoomed.
XFactor = m_LEADRasterView1.GetRaster().GetBitmapWidth() / m_LEADRasterView1.GetDstWidth ();
YFactor = m_LEADRasterView1.GetRaster().GetBitmapHeight () / m_LEADRasterView1.GetDstHeight ();
NewTop = (m_LEADRasterView1.GetDstClipTop() - m_LEADRasterView1.GetDstTop ()) * YFactor;
NewLeft = (m_LEADRasterView1.GetDstClipLeft() - m_LEADRasterView1.GetDstLeft()) * XFactor;
NewWidth = m_LEADRasterView1.GetDstClipWidth() * XFactor;
NewHeight = m_LEADRasterView1.GetDstClipHeight() * YFactor;
// Make sure display rectangles are automatically adjusted.
m_LEADRasterView1.SetAutoSetRects (TRUE);
// Trim the bitmap. This changes the size of the image and
// both the source and destination clipping rectangles
pRasterProc->Trim(m_LEADRasterView1.GetRaster(), NewLeft, NewTop, NewWidth, NewHeight);
pRasterProc->Release();
// Turn off scroll bars to make sure we use the full client area.
m_LEADRasterView1.SetAutoScroll (FALSE);
// Set the image display size to match the LEAD control
// The source rectangle matches the smaller bitmap.
// Making the destination rectangle bigger, the paint will fill the LEAD control
m_LEADRasterView1.SetDstRect (0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth (), m_LEADRasterView1.GetScaleHeight () );
m_LEADRasterView1.SetDstClipRect ( 0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth (), m_LEADRasterView1.GetScaleHeight () );
// Display the image
m_LEADRasterView1.ForceRepaint ();
m_LEADRasterView1.SetMousePointer (0); // Default
}

15. | To add the code for LEAD mouse events, do the following:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | d. | Continue with the remaining steps for each mouse event.
16. | In the MFC ClassWizard, double-click the MouseDown2 event and add code as follows:

void CTutorDlg::OnMouseDown2Leadrasterview1(short Button, short Shift, long x, long y)
{
// Save the starting position
if( m_bCropping && Button == 1 )
{
m_fStartX = x;
m_fStartY = y;
// Make the rubberband invisible until the mouse moves
m_LEADRasterView1.SetRubberBandVisible (FALSE);
}
}

17.

In the MFC ClassWizard, double-click the MouseMove2 event and add code as follows:

void CTutorDlg::OnMouseMove2Leadrasterview1(short Button, short Shift, long x, long y)
{
if( m_bCropping && Button == 1 )
{
float rbX, rbY, rbWidth, rbHeight;
// Get the current mouse position
m_fEndX = x;
m_fEndY = y;
// Determine the origin of the rubberband rectangle,
// regardless of which way the mouse moves.
if( m_fEndX > m_fStartX )
rbX = m_fStartX;
else
rbX = m_fEndX;
if( m_fEndY > m_fStartY )
rbY = m_fStartY;
else
rbY = m_fEndY;
// Determine the height and width of the rubberband rectangle
rbHeight = (float)fabs((double)m_fStartY - m_fEndY);
rbWidth = (float)fabs((double)m_fStartX - m_fEndX);
// Set the rubberband rectangle
m_LEADRasterView1.SetRubberBandRect( rbX, rbY, rbWidth, rbHeight );
// Alternatively, you could use the following properties to set the
// rubberband rectangle:
// m_LEADRasterView1.SetRubberBandHeight (rbHeight);
// m_LEADRasterView1.SetRubberBandLeft(rbX);
// m_LEADRasterView1.SetRubberBandTop (rbY);
// m_LEADRasterView1.SetRubberBandWidth (rbWidth);
// Make the rubberband rectangle visible
m_LEADRasterView1.SetRubberBandVisible (TRUE);
}
}

18.

In the MFC ClassWizard, double-click the MouseUp2 event and add code as follows:

void CTutorDlg::OnMouseUp2Leadrasterview1(short Button, short Shift, long x, long y)
{
if( m_bCropping && Button == 1 )
{
float CropLeft, CropTop, CropWidth, CropHeight;
// Get the current mouse position
m_fEndX = x;
m_fEndY = y;
// Get the origin of the clipping rectangle.
// Allow for different mouse drag directions
if( m_fStartX < m_fEndX )
CropLeft = m_fStartX;
else
CropLeft = m_fEndX;
if( m_fStartY < m_fEndY )
CropTop = m_fStartY;
else
CropTop = m_fEndY;
// Get the height and width of the cropped area
CropWidth = (float)fabs((double)m_fEndX - m_fStartX);
CropHeight = (float)fabs((double)m_fEndY - m_fStartY);
// Crop and repaint the image
m_LEADRasterView1.SetDstClipRect (CropLeft, CropTop, CropWidth, CropHeight);
m_LEADRasterView1.ForceRepaint ();
m_LEADRasterView1.SetRubberBandVisible (FALSE);
m_LEADRasterView1.SetMousePointer (0); // Default
}
}

19.

Press Ctrl-Home to go to the top of the current file (tutorDlg.cpp), and add the following to the list of include files:

#include <math.h>

20.

Rebuild and run the application.


Creating, Viewing, and Merging Color Separations (Visual C++ 5.0)

Creating, Viewing, and Merging Color Separations (C++ 5.0 and later)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new button under the Cancel button. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
5. | Double-click the button and change IDC_BUTTON1 to IDC_MERGE. Also, set the caption to Color Merge.
6. | Close all the windows until you reach the project window, answering yes when asked whether to save the changes.
7. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_MERGE.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnMerge).
 | e. | Click the Edit Code button to start entering the code.
8. | Enter new code as follows:

void CTutorDlg::OnMerge()
{
// TODO: Add your control notification handler code here
// Count the button clicks and take the next step with each click
static int ClickCount;
static ILEADRasterProcess *pRasterProc=NULL;
if(!pRasterProc)
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
BeginWaitCursor();
// Turn off the automatic display rectangles.
m_LEADRasterView1.SetAutoSetRects( FALSE );
switch(ClickCount)
{
case 0:
pRasterProc->ColorSeparate(m_LEADRasterView1.GetRaster(), COLORSEP_CMYK);
// Free the palette used by the original bitmap
// Just for fun, add contrast to the K plane
m_LEADRasterView1.GetRaster().SetBitmap(pRasterProc->GetColorPlanes(3));

pRasterProc->Contrast(m_LEADRasterView1.GetRaster(), 300); // Increase the contrast
pRasterProc->PutColorPlanes(3, m_LEADRasterView1.GetRaster().GetBitmap()); // Update the K plane
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("Separated. Keep clicking to see separations, then merge"), TEXT("Merge"),MB_OK);
break;
case 1:
m_LEADRasterView1.GetRaster().SetBitmap(pRasterProc->GetColorPlanes(0)); // Cyan
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("First color plane--Cyan"));
break;
case 2:
m_LEADRasterView1.GetRaster().SetBitmap(pRasterProc->GetColorPlanes(1)); // Magenta
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("Second color plane--Magenta"));
break;
case 3:
m_LEADRasterView1.GetRaster().SetBitmap(pRasterProc->GetColorPlanes(2)); // Yellow
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("Third color plane--Yellow"));
break;
case 4:
m_LEADRasterView1.GetRaster().SetBitmap(pRasterProc->GetColorPlanes(3)); // K
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("Fourth color plane--K"));
break;
case 5:
pRasterProc->ColorMerge(m_LEADRasterView1.GetRaster(), COLORSEP_CMYK);
m_LEADRasterView1.ForceRepaint();
pRasterProc->PutColorPlanes(0, 0); // free the color planes
pRasterProc->PutColorPlanes(1, 0);
pRasterProc->PutColorPlanes(2, 0);
pRasterProc->PutColorPlanes(3, 0);
MessageBox(TEXT("Merged, with more contrast in the K plane"), TEXT("Merge"),MB_OK);
break;
default:
ClickCount = -1;
MessageBox(TEXT("Cycle is finished"), TEXT("Merge"),MB_OK);
pRasterProc->Release();
break;
};
ClickCount = ClickCount + 1;
EndWaitCursor();
}

9.

Rebuild and run the application.


Updating a Gauge and Detecting a User Interrupt (Visual C++ 5.0)

Updating a Gauge and Detecting a User Interrupt (C++ 5.0 and later)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new button under the Cancel button. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
5. | Add another button under the previously added button.
6. | Double-click the first button and change IDC_BUTTON1 to IDC_MEDIAN. Also, set the caption to Do &Median.
7. | Double-click the second button and change IDC_BUTTON2 to IDC_QUIT. Also, set the caption to &Quit.
8. | To build a gauge, select the Progress control on the Controls toolbar. (If you do not have a Progress control, you can use any control that has a rectangular shape and a border.) Put the gauge at the top of the dialog box to keep it away from the image.
9. | Double-click on the gauge and change the ID from IDC_PROGRESS1 to IDC_GAUGE.
10. | Close all the windows until you reach the project window, answering yes when asked whether to save the changes.
11. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_MEDIAN.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnMedian).
 | e. | Click the Edit Code button to start entering the code.
12. | Enter new code as follows:

void CTutorDlg::OnMedian()
{
// TODO: Add your control notification handler code here
// Enable the ProgressStatus event
m_pRasterProc->PutEnableProgressEvent( TRUE );
// Initialize the indicators
fEscape = FALSE; // The user does not want to quit
fInProc = TRUE; // Processing is taking place
// Perform a relatively slow median filter
m_pRasterProc->Median(m_LEADRasterView1.GetRaster(), 4);
// Clean up
fInProc = FALSE; // Processing is no longer taking place
m_LEADRasterView1.ForceRepaint();
// reset the gauge
GetDlgItem(IDC_GAUGE)->InvalidateRect(NULL, TRUE);
}

13. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_QUIT.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnQuit).
 | e. | Click the Edit Code button to start entering the code.
14. | Enter new code as follows:

void CTutorDlg::OnQuit()
{
// TODO: Add your control notification handler code here
fEscape = TRUE; // The user wants to quit
// Set the gauge back to the beginning
GetDlgItem(IDC_GAUGE)->InvalidateRect(NULL, TRUE);
}

15.

Edit the TUTORDLG.H file and change the definition of CTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
BOOL fInProc;
BOOL fEscape;
ILEADRasterProcess *m_pRasterProc;
CRasterProcSink *m_pRasterProcSink;
IConnectionPoint *m_pCP;
DWORD m_dwCookie;

16.

Edit the TUTORDLG.CPP file and add the following code to the end of the OnInitDialog function:

//Instantiate the sink class and hold a pointer to it.
m_pRasterProcSink = new CRasterProcSink;
m_pRasterProcSink->m_pDlg = this;

//Create the RasterProcess object
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&m_pRasterProc);

//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterProcSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterProc, DIID__LEADRasterProcessEvents, pUnkSink, FALSE, &m_dwCookie);

fInProc = FALSE;

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterProcSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterProcSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterProcSink();
protected:

h. | In the RasterProcSink.h file, add the following to the top of the file:
 | class CTutorDlg;
i. | In the RasterProcSink.h file, add the following to the CRasterProcSink class in the //Attributes public section:

// Attributes
public:
CTutorDlg *m_pDlg;

j.

In the RasterProcSink.cpp file, add the following to the top of the file (after the #include "RasterProcSink.h")

#include "tutorDlg.h"

18. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "RasterProcSink.h"

19. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterProcSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnProgressStatus(short iPercent);

20. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterProcSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterProcSink,"ProgressStatus",1,OnProgressStatus,VT_EMPTY,VTS_I2)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CRasterProcSink, DIID__LEADRasterProcessEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterProcSink::OnProgressStatus(short iPercent)
{
MSG msg;
// are there any messages in the queue (like a button being pressed) ?
while( PeekMessage(&msg,NULL, 0, 0, PM_REMOVE) )
{
TranslateMessage( &msg ); /* Translates virtual key codes. */
DispatchMessage( &msg ); /* Dispatches message to window. */
}
if( !m_pDlg->fEscape ) // Look for the Click on the Quit button
{
CWnd *pwndGauge = m_pDlg->GetDlgItem( IDC_GAUGE );
RECT rcGauge;
pwndGauge->GetClientRect( &rcGauge );
// Update the gauge
short LineLength = (rcGauge.right-rcGauge.left) * iPercent / 100;
CDC *pdc = pwndGauge->GetDC();
CPen hpen( PS_SOLID, rcGauge.bottom - rcGauge.top, RGB(0,0,0) ); // black pen
CPen *pOldPen = pdc->SelectObject(&hpen);
pdc->MoveTo( rcGauge.left, (rcGauge.top + rcGauge.bottom) / 2 );
pdc->LineTo( rcGauge.left + LineLength, (rcGauge.top + rcGauge.bottom) / 2 );
pdc->SelectObject(pOldPen);
}
else
m_pDlg->m_pRasterProc->PutEnableProgressEvent(FALSE); // Cancel the task
}

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
22. | Enter new code as follows:

void CTutorDlg::OnDestroy()
{
//Terminate a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterProcSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterProc, DIID__LEADRasterProcessEvents,
pUnkSink, FALSE, m_dwCookie);
delete m_pRasterProcSink;
m_pRasterProc->Release();
CDialog::OnDestroy();
}

23. | Continue with the remaining steps to prevent the user from quitting while a process is still going. This requires additional checks in the handling of the OK and Cancel buttons.
24. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDCANCEL.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnCancel).
 | e. | Click the Edit Code button to start entering the code.
25. | Enter new code as follows:

void CTutorDlg::OnCancel()
{
// TODO: Add extra cleanup here
if( !fInProc )
CDialog::OnCancel();
}

26. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDOK.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnOK).
 | e. | Click the Edit Code button to start entering the code.
27. | Enter new code as follows:

void CTutorDlg::OnOK()
{
// TODO: Add extra validation here
if( !fInProc )
CDialog::OnOK();
}

28. | Change the MFC settings for this project:
 | a. | On the main menu, select Project | Settings.
 | b. | Select the General tab.
 | c. | Under Microsoft Foundation Classes, select Use MFC in a Shared DLL.
 | d. | Select OK.
29. | Rebuild the application and run the program.


Creating an MDI Application (Visual C++ 5.0)

Creating an MDI Application (C++ 5.0 and later)

Take the following steps to start an MDI (Multiple Document Interface) project and to add some code that positions, scales, and displays an image in a dialog box.

1. | Start the Microsoft Developer Studio for Visual C++, version 5.0.
2. | Select the File >New menu option, select Project Workspace, and click the OK button.
3. | In the New Project Workspace dialog box, do the following:
 | a. | In the Type list box, select MFC AppWizard (exe).
 | b. | In the Name text box, specify mditutor.
 | c. | In the Location text box, specify the path of the project.
 | d. | In the Platforms list box, check Win32 Platforms.
 | e. | Click the Create button.
4. | In the Step 1 dialog box, do the following:
 | a. | Select Multiple Documents.
 | b. | Click the Next button.
5. | In the Step 2 of 6 dialog box, do the following:
 | a. | Select None for Database support.
 | b. | Click the Next button.
6. | In the Step 3 of 6 dialog box, do the following:
 | a. | Select None for OLE compound document support.
 | b. | Select ActiveX Controls for the type of OLE support.
 | c. | Click the Next button.
7. | In the Step 4 of 6 dialog box, do the following:
 | a. | Ensure that that 3D Controls and Printing and Print Preview are selected as features to include.
 | b. | Click the Next button.
8. | In the Step 5 of 6 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
9. | In the Step 6 of 6 dialog box, do the following:
 | a. | Select CMditutorView from the class list that AppWizard will create so that it appears in the Class name entry field.
 | b. | Change the Base class from CView to CFormView.
 | c. | Click the Finish button.
10. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
11. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the mditutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrio14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids
#include "leadraster.h"

12. | Change the resource file to add a LEAD RasterView control to the mditutor dialog template form as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the mditutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_MDITUTOR_FORM to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEAD RasterView Control icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that both CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEAD RasterView control icon; then click the mditutor dialog box to add the control to the dialog box.
 | l. | Double-click the new LEAD RasterView control to edit its properties.
 | m. | Change the ID to IDC_LEADRASTERVIEW1.
 | n. | Press Ctrl-F4 to close all windows back to the Project Workspace.
13. | Do the following to add m_LEADRasterView1 to the CMditutorView class and link the variable to the LEAD RasterView control using dynamic data exchange:
 | a. | From the main menu, select View > ClassWizard. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMditutorView.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box.
14. | Do the following to add code to the OnInitialUpdate function:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMditutorView.
 | c. | In the Object IDs list box, select CMditutorView.
 | d. | In the Messages list box, select OnInitialUpdate.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
15. | Edit the OnInitialUpdate() function to add the following code after the line that says //TODO: Add your specialized code here:

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CDocument *pDoc = GetDocument();
int nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster(),
LPCTSTR(pDoc->GetPathName()), 0, 1, 1);
pRasterIO->Release();
if(nRet)
{
TCHAR szBuffer[30];
wsprintf(szBuffer, TEXT("Load Error: Error code %d"), nRet);
AfxMessageBox(szBuffer);
m_LEADRasterView1.GetRaster().SetBitmap(0);
// Parent of view is MDI Child frame window
CFrameWnd *pMDIFrame = GetParentFrame();
pMDIFrame->PostMessage(WM_CLOSE);
}
else
{
m_LEADRasterView1.SetPaintPalette(PAINTPALETTE_AUTO);
CRect rcRect;
GetClientRect(rcRect);
m_LEADRasterView1.MoveWindow(rcRect);
}

16.

In the file Mditutor.CPP, find the function CMditutorApp::InitInstance() and comment out some lines as follows:

// Parse command line for standard shell commands, DDE, file open
// CCommandLineInfo cmdInfo;
// ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
// if (!ProcessShellCommand(cmdInfo))
// return FALSE;

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMditutorView.
 | c. | In the Object IDs list box, select CMditutorView.
 | d. | In the Messages list box, select WM_SIZE.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
18. | Edit the OnSize() function to add the following code after the line that says //TODO: Add your message handler code here:

if (IsWindow(m_LEADRasterView1.m_hWnd))
m_LEADRasterView1.MoveWindow(0, 0, cx, cy);

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMainFrame.
 | c. | In the Object IDs list box, select CMainFrame.
 | d. | In the Messages list box, select WM_PALETTECHANGED.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
20. | Edit the OnPaletteChanged() function to add the following code after the line that says //TODO: Add your message handler code here:

CMDIChildWnd* pMDIChildWnd = MDIGetActive();
if (pMDIChildWnd == NULL)
return; // no active MDI child frame
SendMessageToDescendants(WM_DOREALIZE,
(WPARAM)pFocusWnd->m_hWnd, (LPARAM) TRUE);

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMainFrame.
 | c. | In the Object IDs list box, select CMainFrame.
 | d. | In the Messages list box, select WM_QUERYNEWPALETTE.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
22. | Edit the OnQueryNewPalette() function so that it appears as follows:

BOOL CMainFrame::OnQueryNewPalette()
{
// always realize the palette for the active view
CMDIChildWnd* pMDIChildWnd = MDIGetActive();
if (pMDIChildWnd == NULL)
return FALSE; // no active MDI child frame (no new palette)
CView* pView = pMDIChildWnd->GetActiveView();
ASSERT(pView != NULL);
// just notify the target view
return((BOOL) pView->SendMessage(WM_DOREALIZE,
(WPARAM)m_hWnd, (LPARAM) FALSE));
}

23.

Edit the MDITUTOR.H file and add the following line after the preprocessing:

#define WM_DOREALIZE (WM_USER + 512)

24.

Edit the MDITUTORVIEW.H file and insert the following line just before DECLARE_MESSAGE_MAP():

afx_msg LRESULT OnDoRealize(WPARAM wParam, LPARAM lParam);

25.

Edit the MditutorView.CPP file and add the following function:

LRESULT CMditutorView::OnDoRealize(WPARAM wParam, LPARAM lParam)
{
if (!m_LEADRasterView1.m_hWnd || !m_LEADRasterView1.GetRaster().GetBitmap())
return FALSE;
if(lParam)
{
return m_LEADRasterView1.SendMessage(WM_PALETTECHANGED, wParam);
}
else
{
UINT nColorsChanged = 0;
CDC* pdc;
pdc = theApp.m_pMainWnd->GetDC();
HPALETTE hpal =
(HPALETTE)m_LEADRasterView1.GetPalette((OLE_HANDLE) pdc->m_hDC);
if(hpal)
{
CPalette pal;
pal.Attach(hpal);
CPalette* oldPalette = pdc->SelectPalette(&pal, (BOOL) lParam);
nColorsChanged = pdc->RealizePalette();
if (nColorsChanged > 0)
m_LEADRasterView1.InvalidateRect(NULL, FALSE);
pdc->SelectPalette(oldPalette, TRUE);
}
theApp.m_pMainWnd->ReleaseDC(pdc);
return ((LRESULT) (BOOL) (nColorsChanged > 0));
}
}

26.

In the MditutorView.CPP file, look for the following lines:

BEGIN_MESSAGE_MAP(CMditutorView, CFormView)
//{{AFX_MSG_MAP(CMditutorView)

After these lines, add the following line:

ON_MESSAGE(WM_DOREALIZE, OnDoRealize)

Also, near the top of the file, add the following line:

extern CMditutorApp theApp;

27. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMditutorView.
 | c. | In the Object IDs list box, select CMditutorView.
 | d. | In the Messages list box, select OnActivateView.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
28. | Edit the OnActivateView() function so that it appears as follows:

void CMditutorView::OnActivateView(BOOL bActivate, CView* pActivateView,
CView* pDeactiveView)
{
// TODO: Add your specialized code here and/or call the base class
CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
if (bActivate)
{
ASSERT(pActivateView == this);
OnDoRealize((WPARAM)theApp.m_pMainWnd->m_hWnd,
(LPARAM) FALSE); // same as SendMessage(WM_DOREALIZE);
}
}

29. | To remove the default printing functions, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMditutorView.
 | c. | In the Object IDs list box, select CMditutorView.
 | d. | In the Messages list box, select OnPrint.
 | e. | Click Delete function and answer YES to the dialog box.
 | f. | In the Messages list box, select OnBeginPrinting.
 | g. | Click Delete function and answer YES to the dialog box.
 | h. | Click OK to exit ClassWizard.
 | i. | Go to MditutorView.CPP and manually delete the functions CMditutorView::OnPrint() and CMditutorView::OnBeginPrinting().
30. | To add new printing functions, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMditutorView.
 | c. | In the Object IDs list box, select CMditutorView.
 | d. | In the Messages list box, select OnDraw.
 | e. | Click the Add function button.
 | f. | Click the Edit Code button to start entering the code.
31. | Edit the OnDraw() function so that it appears as follows:

void CMditutorView::OnDraw(CDC* pDC)
{
CRect rcClip;
CSize winext;
CSize viewext;
CSize paintext;
CMditutorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

if(pDC->IsPrinting())
{
pDC->SaveDC();
::GetWindowExtEx(pDC->m_hDC, &winext);
::GetViewportExtEx(pDC->m_hDC, &viewext);
paintext.cx = MulDiv((int) m_LEADRasterView1.GetRaster().GetBitmapWidth(), viewext.cx, winext.cx);
paintext.cy = MulDiv((int) m_LEADRasterView1.GetRaster().GetBitmapHeight(), viewext.cy, winext.cy);
::SetMapMode(pDC->m_hDC, MM_TEXT);
m_LEADRasterView1.Render((OLE_HANDLE) pDC->m_hDC, (float) 0, (float) 0, (float)
paintext.cx, (float) paintext.cy);
pDC->RestoreDC(-1);
}
}

32. | To remove unused menu items, click the ResourceView tab of the Project Workspace, and do the following:
 | a. | Open the mditutor resources folder.
 | b. | Open the Menu folder.
 | c. | Double-click on IDR_MAINFRAME
 | d. | Click the File menu; then select the New menu item and press the Delete key.
 | e. | Double-click on IDR_MDITUTORTYPE.
 | f. | Click the File menu option; then select and delete the following items: New, Save, and Save As....
 | g. | Press Ctrl-F4 twice to return to the Project Workspace.
33. | On the main menu, select Build > Build mditutor.exe to build the project.
34. | On the main menu, select Build > Execute mditutor.exe to run the project.


Using the Magnifying Glass (Visual C++ 4.0 and later)

Using the Magnifying Glass (Visual C++ 5.0 or later)

Take the following steps to enable the generation of the MagGlassExt event and update the zoomed image using the LEADTOOLS Internet toolkit methods.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify MagGlsNtCom.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls.
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add the L_OcxErr.h file to your project as follows:
 | a. | Copy the L_OcxErr.h file to your project directory from the \lead\include directory.
 | b. | In the Project Workspace, click the FileView tab.
 | c. | Double-click the MagGlsNtCom files folder to open it.
 | d. | Double-click the Dependencies folder (the Header Files folder in 5.0) to open it.
 | e. | Double-click the StdAfx.h file to edit it.
 | f. | Add the following lines to the end of the file:

#include "L_OcxErr.h"

8. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\windows\system\ltr14n.dll" no_namespace, named_guids
#import "c:\windows\system\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\windows\system\ltrio14n.dll" no_namespace, named_guids
#import "c:\windows\system\ltrpr14n.dll" no_namespace, named_guids
#import "c:\windows\system\ltrnt14n.dll" no_namespace, named_guids
#include "leadraster.h"

9. | Add a LEAD RasterView Control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the MagGlsNtCom resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_MAGGLSNTCOM_DIALOG to design the dialog box.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Select also the OK button; then press the Delete key to delete it.
 | g. | From the main menu, select Project > Add To Project > Components and Controls.
 | h. | Select Registered ActiveX Controls.
 | i. | Double-click the LEAD RasterView Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | j. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
 | k. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView Control appears in the Controls toolbar.)
 | l. | Click the LEAD RasterView Control icon; then size and position the control as you want it to appear at run time.
 | m. | Use the right mouse button to edit the properties of the new LEAD RasterView Control.
 | n. | Change the ID to IDC_LEADRASTERVIEW1.

10. | Add seven command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_STARTUP_SERVER | Start Up Server
 | IDC_SHUTDOWN_SERVER | Shut Down Server
 | IDC_CONNECT | Connect To Remote Server
 | IDC_DISCONNECT | Disconnect From Remote Server
 | IDC_LOAD_REMOTE | Load Remote Image
 | IDC_START_MAG_GLASS | Start Magnifying Glass
 | IDC_STOP_MAG_GLASS | Stop Magnifying Glass

11. | Add an Edit Box Control to the main window and give it the following ID:
 | ID
 | IDC_REMOTE_ADDRESS
12. | Press Ctrl-F4 to close all windows back to the Project Workspace.
13. | Do the following to add m_LEADRasterView1 and m_RemoteAddress to the CMagGlsNtComDlg class and link the variables to its control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMagGlsNtComDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box.
 | h. | Back in MFC Wizard, go to the Member Variables tab, and ensure CMagGlsNtComDlg is in the Class Name box.
 | i. | In the Control IDs list, select IDC_Remote.
 | j. | Click the Add Variable... button.
 | k. | Specify m_RemoteAddress as the variable name, and control as the category.
 | l. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
14. | Edit the MagGlsNtComDlg.h file and change the definition of CMagGlsNtComDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:

short m_hServer;

long m_nCommandID;

BOOL m_bMagGlass;

ILEADRasterInet *m_pRasterInet;

CRasterInetSink *m_pRasterInetSink;

IConnectionPoint *m_pInetCP;

DWORD m_dwInetCookie;

15. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the MagGlsNtCom classes folder to open it.
 | c. | Expand the CMagGlsNtComDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
16. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

 // Initialize some variables
m_hServer = 0;
m_nCommandID = 0;
m_bMagGlass = FALSE;

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.
m_LEADRasterView1.SetAppearance (RASTERVIEW_APPEARANCE_FLAT);
m_LEADRasterView1.SetBorderStyle (1);
m_LEADRasterView1.SetBackColor (RGB(255, 255, 125));
m_LEADRasterView1.SetPaintDither (PAINTDITHER_DIFFUSION);
m_LEADRasterView1.SetPaintPalette (PAINTPALETTE_AUTO);
m_LEADRasterView1.SetAutoRepaint (TRUE);
m_LEADRasterView1.SetAutoSize (FALSE);
m_LEADRasterView1.SetAutoSetRects (TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);

// Create the RasterInet object
CoCreateInstance(CLSID_LEADRasterInet, NULL, CLSCTX_ALL,
IID_ILEADRasterInet, (void**)&m_pRasterInet);

// Create a temp LEADRaster object and use it
// to unlock support for the Inet object
IClassFactory2 *pCF2=NULL;
CLSID clsid;
ILEADRaster *pRaster=NULL;
static const WCHAR BASED_CODE _szID[] = L"LEADRaster.LEADRaster";

CLSIDFromProgID(_szID, &clsid);

CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory2, (void**)&pCF2);

// This object is licensed, so we need to pass a license key
static const WCHAR BASED_CODE _szLic[] = L"LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLic);
pCF2->CreateInstanceLic(NULL, NULL, IID_IUnknown, lpLic, (void**)&pRaster);
SysFreeString(lpLic);
pCF2->Release();

// Unlock the Internet features.
// Note that TestKey is a sample key and will not work in your toolkit.
pRaster->UnlockSupport(L_SUPPORT_INTERNET, "TestKey");
pRaster->Release();

// Stop runtime exceptions generation for LEAD RasterView
// Control and LEAD Raster Internet object.
m_LEADRasterView1.SetEnableMethodErrors (FALSE);
m_pRasterInet->EnableMethodErrors
   = FALSE;

//Instantiate the sink class and hold a pointer to it.
m_pRasterInetSink = new CRasterInetSink;
m_pRasterInetSink->m_pDlg = this;

//Establish a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterInet, DIID__LTRASINETEvents, pInetUnkSink, FALSE, &m_dwInetCookie);

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterInetSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class, and click OK to close the MFC ClassWizard.
 | g. | In the RasterInetSink.h file, move the destructor so that it is public:

virtual ~CRasterInetSink();
// Implementation
protected:

h. | In the RasterInetSink.h file, add the following to the top of the file:
 | class CMagGlsNtComDlg;
i. | In the RasterInetSink.h file, add the following to the CRasterInetSink class in the //Attributes public section:
 | // Attributes
 | public:
 | CMagGlsNtComDlg *m_pDlg;
j. | In the RasterInetSink.cpp file, add the following to the top of the file (after the #include "RasterInetSink.h")

#include " MagGlsNtComDlg.h"

18. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:
 |  | #include <AFXCTL.H>
 |  | #include "RasterInetSink.h"
19. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterInetSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnInetReceiveBitmap(short, long);
afx_msg void OnInetConnected(short);
afx_msg void OnInetDisconnected(short);
afx_msg void OnInetAccept(short);
afx_msg void OnInetReceiveCmd(short, short, long, short, struct ILEADRasterInetPacket*, long, const _variant_t &);
afx_msg void OnInetReceiveRsp(short, short, long, short, short, struct ILEADRasterInetPacket*, long, const _variant_t &);

20. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterInetSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP just before //}}AFX_DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveBitmap",1,OnInetReceiveBitmap,VT_EMPTY,VTS_I2 VTS_I4)
DISP_FUNCTION_ID(CRasterInetSink,"InetConnected",3,OnInetConnected,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetDisconnected",4,OnInetDisconnected,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetAccept",5,OnInetAccept,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveCmd",12,OnInetReceiveCmd,VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I2 VTS_DISPATCH VTS_I4 VTS_VARIANT)
DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveRsp",13,OnInetReceiveRsp,VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I2 VTS_I2 VTS_DISPATCH VTS_I4 VTS_VARIANT)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CRasterInetSink, DIID__LTRASINETEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterInetSink::OnInetReceiveBitmap
 (short iComputer, long hBitmap)
{
m_pDlg->m_LEADRasterView1.GetRaster().SetBitmap(hBitmap);
}

void CRasterInetSink::OnInetConnected
 (short iComputer)
{
BSTR sRemote;
/* Get the name of the remote host */
m_pDlg->m_pRasterInet->InetGetHostName
 (iComputer, HOST_NAME_DESCRP);
sRemote = m_pDlg->m_pRasterInet->GetInetHostName ();

/* Add this connection to our SendList. */
m_pDlg->m_pRasterInet->PutSendList
 (m_pDlg->m_pRasterInet->GetSendListNum (), iComputer);
AfxMessageBox(TEXT("Successfully connected to server."));
}

void CRasterInetSink::OnInetDisconnected
 (short iComputer)
{
if(m_pDlg->m_hServer == 0)
AfxMessageBox(TEXT("Disconnect from remote server."));
else
AfxMessageBox(TEXT("Connection to remote computer closed."));
}

void CRasterInetSink::OnInetAccept
 (short iServer)
{
int nRet;
short hComputer;
BSTR hName;
CString cs;

nRet = m_pDlg->m_pRasterInet->InetAcceptConnect (m_pDlg->m_hServer);
hComputer = m_pDlg->m_pRasterInet->GetInetConnectedComputer ();

if (nRet != 0)
{
cs.Format(TEXT("%s %d\n"), TEXT("Error accepting connection:"), nRet);
AfxMessageBox(cs);
}
m_pDlg->m_pRasterInet->InetGetHostName
 (hComputer, HOST_NAME_DESCRP);
hName = m_pDlg->m_pRasterInet->GetInetHostName();
/* add to our send list */
m_pDlg->m_pRasterInet->PutSendList
 (m_pDlg->m_pRasterInet->GetSendListNum(), hComputer);
AfxMessageBox(TEXT("Connection accepted."));
}

void CRasterInetSink::OnInetReceiveCmd
 (short iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket * Params, long nExtraDataSize,ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szMsg;
ILEADRasterInetPacket * Packet = NULL;
ILEADRasterIO *pRasterIO=NULL;
CString szTemp;
BSTR strFileName;
ILEADRasterVariant * vColorBuffer = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&vColorBuffer);

Params->QueryInterface (IID_ILEADRasterInetPacket, (void **)&Packet);
if (!Packet)
return;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_LOAD:
// check the validity of the parameters
if((Packet->GetParamCount() == 4) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_UINT32))
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

szTemp = (CString)Packet->GetParamValue(0)->StringValue ;
strFileName =szTemp .AllocSysString();
nStatus = pRasterIO->Load(m_pDlg->m_LEADRasterView1.GetRaster(),
strFileName,
(short)Packet->GetParamValue(1)->LongValue ,
1, 1);

pRasterIO->Release();

if(nStatus != 0)
{
szMsg.Format(TEXT("Load Bitmap failed with error code %d"), nStatus);
AfxMessageBox(szMsg);
}
else
{
nStatus = m_pDlg->m_pRasterInet->InetSendBitmap (m_pDlg->m_LEADRasterView1.GetRaster().m_lpDispatch,
FILE_CMP, 0, QFACTOR_PQ2);

if(nStatus != 0)
{
szMsg.Format(TEXT("SendBitmap failed with error code %d"), nStatus);
AfxMessageBox(szMsg);
}
}
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter

m_pDlg->m_pRasterInet->InetSendLoadRsp (nCommandID, 0, 0, NULL, nStatus);
return;
break;

case INETCMD_GET_MAGGLASS_DATA:
// check the validity of the parameters
if((Packet->GetParamCount() == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32) && (Packet->GetParamType(2) == PARAM_TYPE_USTRING) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4) == PARAM_TYPE_INT32))
{
if(m_pDlg->m_LEADRasterView1.GetRaster().GetBitmap() != 0)
{
nStatus = m_pDlg->m_pRasterInet->InetGetMagGlassData (m_pDlg->m_LEADRasterView1.GetRaster().m_lpDispatch,
vColorBuffer,
Packet->GetParamValue(2),
Packet->GetParamValue(3)->LongValue,
Packet->GetParamValue(4)->LongValue);

if(nStatus != 0)
{
szMsg.Format(TEXT("InetGetMagGlassData failed with error code %d"), nStatus);
AfxMessageBox(szMsg);
}
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter

m_pDlg->m_pRasterInet->InetSendGetMagGlassDataRsp (nCommandID,
vColorBuffer,
Packet->GetParamValue(2),
Packet->GetParamValue(3)->LongValue ,
Packet->GetParamValue(4)->LongValue ,
0, NULL, nStatus);
return;
break;
}
}
m_pDlg->m_pRasterInet->InetSendRsp
 ((InetCmdType)InetCommand, nCommandID, Params, 0, NULL, nStatus);
vColorBuffer->Release();
}

void CRasterInetSink::OnInetReceiveRsp
 (short iComputer, short InetCommand, long nCommandID, short nError, short nStatus, struct ILEADRasterInetPacket * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nRet;
CString szMsg;
ILEADRasterInetPacket * Packet = NULL;

Params->QueryInterface (IID_ILEADRasterInetPacket, (void **)&Packet);
if (!Packet)
return;

if(nError != 0)
return;

switch(InetCommand)
{
case INETCMD_LOAD:
if(nStatus != 0)
{
szMsg.Format(TEXT("Load failed with error code %d"), nStatus);
AfxMessageBox(szMsg);
}
break;

case INETCMD_GET_MAGGLASS_DATA:
if(nStatus == 0)
{
if((Packet->GetParamCount() == 6) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_USTRING) && (Packet->GetParamType(2) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_USTRING) && (Packet->GetParamType(4) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32))
{
nRet = m_pDlg->m_LEADRasterView1.UpdateMagGlass(Packet->GetParamValue(1),
Packet->GetParamValue(3),
Packet->GetParamValue(4)->LongValue ,
Packet->GetParamValue(5)->LongValue ,
TRUE);

if(nRet != 0)
{
szMsg.Format(TEXT("UpdateMagGlass failed with error code %d"), nRet);
AfxMessageBox(szMsg);
}
}
else
AfxMessageBox(TEXT("Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response"));
}
else
{
szMsg.Format(TEXT("Get MagGlass Data from sever failed with error code %d"), nStatus);
AfxMessageBox(szMsg);
}
break;
}
}

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select CMagGlsNtComDlg.
 | d. | In the Messages list box, select WM_DESTROY.
 | e. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | f. | Click the Edit Code button to start entering the code.
22. | Enter new code for OnDestroy function, so it becomes as follows:

//Terminate a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterInet, DIID__LTRASINETEvents,
pInetUnkSink, FALSE, m_dwInetCookie);
delete m_pRasterInetSink;
m_pRasterInet->Release();

CDialog::OnDestroy();

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDCANCEL.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCancel).
 | f. | Click the Edit Code button and add the following code after the line that says //TODO: Add extra cleanup here:

 // TODO: Add extra cleanup here
int i, num;
/* disconnect all connections */
num = m_pRasterInet->GetConnectListNum
 ();
for (i = 0; i < num; i++)
{
m_pRasterInet->InetDisconnect
 (m_pRasterInet->GetConnectList(i));
}

if(m_bMagGlass)
m_LEADRasterView1.StopMagGlass();

CDialog::OnCancel();

24. | To add code for the Start Up Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_STARTUP_SERVER.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStartupServer).
 | f. | Click the Edit Code button and code the OnStartupServer procedure as follows:

 int nRet;
CString cs;

/* initialize server on port 1000 */
nRet = m_pRasterInet->InetServerInit
 (&m_hServer, 1000);
if (nRet != 0)
{
cs.Format(TEXT("%s %d\n"), TEXT("Error initializing server:"), nRet);
AfxMessageBox(cs);
}

25. | To add code for the Shut Down Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_SHUTDOWN_SERVER.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnShutdownServer).
 | f. | Click the Edit Code button and code the OnShutdownServer procedure as follows:

short nRet;
CString cs;

if (m_hServer != 0)
{
nRet = m_pRasterInet->InetServerClose (m_hServer);
if(nRet != 0)
{
cs.Format(TEXT("%s %d\n"), TEXT("Error Shutting Down server:"), nRet);
AfxMessageBox(cs);
}
else
m_hServer = 0;
}

26. | To add code for the Connect To Remote Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and code the OnConnect procedure as follows:

int nRet;
CString cs,text;

/* get the name of the computer entered in the edit box control */
m_RemoteAddress.GetWindowText(text);
/* Connect to remote computer on port 1000 */
nRet = m_pRasterInet->InetConnect
 (text.AllocSysString(), 1000);
if (nRet != 0)
{
cs.Format(TEXT(" %s\n %s\n"), TEXT("Error connecting to :"), text);
AfxMessageBox(cs);
}

27. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and code the OnDisconnect procedure as follows:

int nRet;
CString cs;
/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList.
*/
nRet = m_pRasterInet->InetDisconnect
 (m_pRasterInet->GetSSendList (0));
if (nRet != 0)
{
cs.Format(TEXT("%s %d\n"), TEXT("Error disconnecting from the server:"),nRet);
AfxMessageBox(cs);
}

28. | To add code for the Load Remote Image button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_LOAD_REMOTE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnLoadRemote).
 | f. | Click the Edit Code button and code the OnLoadRemote procedure as follows:

short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendLoadCmd
 (m_nCommandID++, "v:\\images\\eagle.cmp", 0, 1);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendLoadCmd."), nRet);
AfxMessageBox(csOut);
}

29. | To add code for the Start Magnifying Glass button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_START_MAG_GLASS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStartMagGlass).
 | f. | Click the Edit Code button and code the OnStartMagGlass procedure as follows:

if(m_LEADRasterView1.GetRaster().GetBitmap() != 0 && m_hServer == 0)
{
// Enable MagGlassExt event.
if(!m_LEADRasterView1. GetEnableMagGlassEvent())
m_LEADRasterView1. SetEnableMagGlassEvent(TRUE);

m_LEADRasterView1.SetRgnFrameType(0);

// Start the Magnifying Glass
int nRet = m_LEADRasterView1.StartMagGlass(150.0f, 100.0f, 200,
0, m_LEADRasterView1.GetBackColor(),
FALSE, 1.0f, TRUE, CROSSHAIR_FINE,
TRUE, TRUE);

if(nRet == 0)
m_bMagGlass = TRUE;
}

30. | To add code for the Stop Magnifying Glass button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_STOP_MAG_GLASS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStopMagGlass).
 | f. | Click the Edit Code button and code the OnStopMagGlass procedure as follows:

if(m_LEADRasterView1.GetRaster().GetBitmap() != 0 && m_hServer == 0)
{
int nRet = m_LEADRasterView1.StopMagGlass();

if(nRet == 0)
m_bMagGlass = FALSE;
}

31. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CMagGlsNtComDlg.
 | b. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | c. | In the Messages list box, select MagGlassExt.
 | d. | Click the Add function button. Choose OK for the default function name (OnMagGlassExtLeadrasterview1).
 | e. | Click the Edit Code button and code the OnMagGlassExtLeadrasterview1 procedure as follows:

   short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendGetMagGlassDataCmd
 (m_nCommandID++, 0, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendGetMagGlassDataCmd."), nRet);
AfxMessageBox(csOut);
}

32.

Edit the MagGlsNtCom.cpp file and add the following code as the first line in the InitInstance function:

CoInitialize(NULL);

33.

Edit the MagGlsNtCom.cpp file and add the following code as the next to last line in the InitInstance function (before the return)!:

CoUninitialize();

34. | To accommodate a 256-color display driver, continue with the remaining steps, which send WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages to the LEADTOOLS RasterView COM Control.
35. | In the Project Workspace, click the FileView tab.
36. | Edit the MagGlsNtComDlg.h file and insert the following lines in the definition of CMagGlsNtComDlg class, just before DECLARE_MESSAGE_MAP():

afx_msg BOOL OnQueryNewPalette();
afx_msg void OnPaletteChanged( CWnd *pwin );

37.

Edit the MagGlsNtComDlg.cpp file and insert the following lines between the lines: BEGIN_MESSAGE_MAP(CMagGlsNtComDlg, CDialog) and END_MESSAGE_MAP():

ON_WM_QUERYNEWPALETTE()
ON_WM_PALETTECHANGED()

38.

Go to the end of MagGlsNtComDlg.cpp file and insert the following two functions:

BOOL CMagGlsNtComDlg::OnQueryNewPalette()
{
if(!IsWindow(m_LEADRasterView1.m_hWnd))
return FALSE;
return m_LEADRasterView1.SendMessage(WM_QUERYNEWPALETTE);
}

void CMagGlsNtComDlg::OnPaletteChanged(CWnd* pFocusWnd)
{
if(pFocusWnd->m_hWnd == m_hWnd || !IsWindow(m_LEADRasterView1.m_hWnd))
return;
m_LEADRasterView1.SendMessage(WM_PALETTECHANGED, (WPARAM) pFocusWnd->m_hWnd);
}

39. | On the main menu, select Build > Build MagGlsNtCom.exe to build the project.
40. | On the main menu, select Build > Execute MagGlsNtCom.exe twice, to run two projects.
41. | In the first project press the Start Up Server button.
42. | In the second project fill the edit box with the IP address of the remote computer on which you started the first project as a server. Then, press the Connect To Remote Server button to connect to the specified address.
43. | Press the Load Remote Image button of the second project started, to load an image on the server. Then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support. Press the left mouse button and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using the Magnifying Glass (2) (Visual C++ 5.0 or later)

Take the following steps to enable the generation of the MagGlassExt2 event and update the zoomed image using the LEADTOOLS Internet toolkit methods.

1. | Start a new project as follows:
 | a. | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | b. | Click the Projects tab.
 | c. | Select MFC AppWizard (exe) as the project type
 | d. | In the Project name text box, specify MagGlsNtCom.
 | e. | In the Location text box, specify the path of the project.
 | f. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls.
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add the L_OcxErr.h file to your project as follows:
 | a. | Copy the L_OcxErr.h file to your project directory from the \lead\include directory.
 | b. | In the Project Workspace, click the FileView tab.
 | c. | Double-click the MagGlsNtCom files folder to open it.
 | d. | Double-click the Dependencies folder (the Header Files folder in 5.0) to open it.
 | e. | Double-click the StdAfx.h file to edit it.
 | f. | Add the following lines to the end of the file:

#include "L_OcxErr.h"

8. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\windows\system32\ltrvr14n.dll" no_namespace, named_guids
#import "c:\windows\system32\ltr14n.dll" no_namespace, named_guids
#import "c:\windows\system32\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\windows\system32\ltrio14n.dll" no_namespace, named_guids
#import "c:\windows\system32\ltrpr14n.dll" no_namespace, named_guids
#import "c:\windows\system32\ltrnt14n.dll" no_namespace, named_guids
#include "leadraster.h"

9. | Add a LEAD RasterView Control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the MagGlsNtCom resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_MAGGLSNTCOM_DIALOG to design the dialog box.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Select also the OK button; then press the Delete key to delete it.
 | g. | From the main menu, select Project > Add To Project > Components and Controls.
 | h. | Select Registered ActiveX Controls.
 | i. | Double-click the LEAD RasterView Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | j. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
 | k. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView Control appears in the Controls toolbar.)
 | l. | Click the LEAD RasterView Control icon; then size and position the control as you want it to appear at run time.
 | m. | Use the right mouse button to edit the properties of the new LEAD RasterView Control.
 | n. | Change the ID to IDC_LEADRASTERVIEW1.
10. | Add seven command buttons to your form and name them as follows:

ID | Caption
IDC_STARTUP_SERVER | Start Up Server
IDC_SHUTDOWN_SERVER | Shut Down Server
IDC_CONNECT | Connect To Remote Server
IDC_DISCONNECT | Disconnect From Remote Server
IDC_LOAD_REMOTE | Load Remote Image
IDC_START_MAG_GLASS | Start Magnifying Glass
IDC_STOP_MAG_GLASS | Stop Magnifying Glass

11. | Add an Edit Box Control to the main window and give it the following ID:
 | ID
 | IDC_REMOTE_ADDRESS
12. | Press Ctrl-F4 to close all windows back to the Project Workspace.
13. | Do the following to add m_LEADRasterView1 and m_RemoteAddress to the CMagGlsNtComDlg class and link the variables to its control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CMagGlsNtComDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box.
 | h. | Back in MFC Wizard, go to the Member Variables tab, and ensure CMagGlsNtComDlg is in the Class Name box.
 | i. | In the Control IDs list, select IDC_REMOTE_ADDRESS.
 | j. | Click the Add Variable... button.
 | k. | Specify m_RemoteAddress as the variable name, and control as the category.
 | l. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
14. | Edit the MagGlsNtComDlg.h file and change the definition of CMagGlsNtComDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
short m_hServer;
long m_nCommandID;
BOOL m_bMagGlass;
ILEADRasterInet *m_pRasterInet;
CRasterInetSink *m_pRasterInetSink;
IConnectionPoint *m_pInetCP;
DWORD m_dwInetCookie;

15. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the MagGlsNtCom classes folder to open it.
 | c. | Expand the CMagGlsNtComDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
16. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

// Initialize some variables
m_hServer = 0;
m_nCommandID = 0;
m_bMagGlass = FALSE;

// Unlock GIF format support.
// Note that this is a sample key, which will not work in your toolkit.
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_GIFLZW, "TestKey");

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.
m_LEADRasterView1.SetAppearance(RASTERVIEW_APPEARANCE_FLAT);
m_LEADRasterView1.SetBorderStyle(1);
m_LEADRasterView1.SetBackColor(RGB(255, 255, 125));
m_LEADRasterView1.SetPaintDither(PAINTDITHER_DIFFUSION);
m_LEADRasterView1.SetPaintPalette(PAINTPALETTE_AUTO);
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAutoSize(FALSE);
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);

// Create the RasterInet object
CoCreateInstance(CLSID_LEADRasterInet, NULL, CLSCTX_ALL,
IID_ILEADRasterInet, (void**)&m_pRasterInet);

// Create a temp LEADRaster object and use it
// to unlock support for the Inet object
IClassFactory2 *pCF2=NULL;
CLSID clsid;
ILEADRaster *pRaster=NULL;
static const WCHAR BASED_CODE _szID[] = L"LEADRaster.LEADRaster";

CLSIDFromProgID(_szID, &clsid);

CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory2, (void**)&pCF2);

// This object is licensed, so we need to pass a license key
static const WCHAR BASED_CODE _szLic[] = L"LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLic);
pCF2->CreateInstanceLic(NULL, NULL, IID_IUnknown, lpLic, (void**)&pRaster);
SysFreeString(lpLic);
pCF2->Release();

// Unlock the Internet features.
// Note that TestKey is a sample key and will not work in your toolkit.
pRaster->UnlockSupport(L_SUPPORT_LTPRO, "TestKey");
pRaster->Release();

// Stop runtime exceptions generation for LEAD RasterView
// Control and LEAD Raster Internet object.
m_LEADRasterView1.SetEnableMethodErrors
 (FALSE);
m_pRasterInet->EnableMethodErrors
  = FALSE;

//Instantiate the sink class and hold a pointer to it.
m_pRasterInetSink = new CRasterInetSink;
m_pRasterInetSink->m_pDlg = this;

//Establish a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterInet, DIID__LTRASINETEvents, pInetUnkSink, FALSE, &m_dwInetCookie);

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterInetSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class, and click OK to close the MFC ClassWizard.
 | g. | In the RasterInetSink.h file, move the destructor so that it is public:

virtual ~CRasterInetSink();
// Implementation
protected:

h.

In the RasterInetSink.h file, add the following to the top of the file:

class CMagGlsNtComDlg;

i.

In the RasterInetSink.h file, add the following to the CRasterInetSink class in the //Attributes public section:

// Attributes
public:
CMagGlsNtComDlg *m_pDlg;

j.

In the RasterInetSink.cpp file, add the following to the top of the file (after the #include "RasterInetSink.h")

#include "MagGlsNtComDlg.h"

18. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "RasterInetSink.h"

19. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterInetSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnInetReceiveBitmap(short, long);
afx_msg void OnInetConnected(short);
afx_msg void OnInetDisconnected(short);
afx_msg void OnInetAccept(short);
afx_msg void OnInetReceiveCmd2(short, short, long, short, struct ILEADRasterInetPacket*, long, const _variant_t &);
afx_msg void OnInetReceiveRsp2(short, short, long, short, short, struct ILEADRasterInetPacket*, long, const _variant_t &);

20. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the MagGlsNtCom files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterInetSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP just before /}}AFX_DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveBitmap",1,OnInetReceiveBitmap,VT_EMPTY,VTS_I2 VTS_I4)
DISP_FUNCTION_ID(CRasterInetSink,"InetConnected",3,OnInetConnected,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetDisconnected",4,OnInetDisconnected,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetAccept",5,OnInetAccept,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveCmd2",16,OnInetReceiveCmd2,VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I2 VTS_DISPATCH VTS_I4 VTS_VARIANT)
DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveRsp2",17,OnInetReceiveRsp2,VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I2 VTS_I2 VTS_DISPATCH VTS_I4 VTS_VARIANT)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART to the following:

INTERFACE_PART(CRasterInetSink, DIID__LTRASINETEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterInetSink::OnInetReceiveBitmap
 (short iComputer, long hBitmap)
{
m_pDlg->m_LEADRasterView1.GetRaster().SetBitmap(hBitmap);
}

void CRasterInetSink::OnInetConnected
 (short iComputer)
{
/* Get the name of the remote host */
m_pDlg->m_pRasterInet->InetGetHostName
 (iComputer, HOST_NAME_DESCRP);
/* Add this connection to our SendList. */
m_pDlg->m_pRasterInet->PutSendList
 (m_pDlg->m_pRasterInet->GetSendListNum (), iComputer);
AfxMessageBox("Successfully connected to server.");
}

void CRasterInetSink::OnInetDisconnected
 (short iComputer)
{
if(m_pDlg->m_hServer == 0)
AfxMessageBox("Disconnect from remote server.");
else
AfxMessageBox("Connection to remote computer closed.");
}

void CRasterInetSink::OnInetAccept
 (short iServer)
{
int nRet;
short hComputer;
CString cs;

nRet = m_pDlg->m_pRasterInet->InetAcceptConnect (m_pDlg->m_hServer);

if (nRet != 0)
{
cs.Format("%s %d\n","Error accepting connection:", nRet);
AfxMessageBox(cs);
}

hComputer = m_pDlg->m_pRasterInet->InetConnectedComputer
 ;

m_pDlg->m_pRasterInet->InetGetHostName
 (hComputer, HOST_NAME_DESCRP);
/* add to our send list */
m_pDlg->m_pRasterInet->PutSendList
 (m_pDlg->m_pRasterInet->GetSendListNum  (), hComputer);
AfxMessageBox("Connection accepted.");
}

void CRasterInetSink::OnInetReceiveCmd2
 (short iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szMsg;
ILEADRasterInetPacket * Packet = NULL;
ILEADRasterIO *pRasterIO=NULL;
VARIANT vColorBuffer;
CString szTemp;
BSTR strFileName;

Params->QueryInterface (IID_ILEADRasterInetPacket, (void **)&Packet);
if (!Packet)
return;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_LOAD:
// check the validity of the parameters
if((Packet->GetParamCount() == 4) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_UINT32))
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

szTemp = (CString)Packet->GetParamValue2(0).bstrVal;
strFileName =szTemp .AllocSysString();
nStatus = pRasterIO->Load(m_pDlg->m_LEADRasterView1.GetRaster(),
strFileName,
(short)Packet->GetParamValue2(1).lVal,
1, 1);

pRasterIO->Release();

if(nStatus != 0)
{
szMsg.Format("Load Bitmap failed with error code %d", nStatus);
AfxMessageBox(szMsg);
}
else
{
nStatus = m_pDlg->m_pRasterInet->InetSendBitmap (m_pDlg->m_LEADRasterView1.GetRaster().m_lpDispatch,
FILE_CMP, 0, QFACTOR_PQ2);

if(nStatus != 0)
{
szMsg.Format("SendBitmap failed with error code %d", nStatus);
AfxMessageBox(szMsg);
}
}
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter

m_pDlg->m_pRasterInet->InetSendLoadRsp (nCommandID, 0, 0, NULL, nStatus);
return;
break;

case INETCMD_GET_MAGGLASS_DATA:
// check the validity of the parameters
if((Packet->GetParamCount() == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32) && (Packet->GetParamType(2) == PARAM_TYPE_USTRING) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4) == PARAM_TYPE_INT32))
{
if(m_pDlg->m_LEADRasterView1.GetRaster().GetBitmap() != 0)
{
nStatus = m_pDlg->m_pRasterInet->InetGetMagGlassData2 (m_pDlg->m_LEADRasterView1.GetRaster().m_lpDispatch,
&vColorBuffer,
Packet->GetParamValue2(2),
Packet->GetParamValue2(3).iVal,
Packet->GetParamValue2(4).iVal);

if(nStatus != 0)
{
szMsg.Format("InetGetMagGlassData failed with error code %d", nStatus);
AfxMessageBox(szMsg);
}
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter
}
else
nStatus = ERROR_INV_PARAMETER; // Invalid parameter

m_pDlg->m_pRasterInet->InetSendGetMagGlassDataRsp2 (nCommandID,
vColorBuffer,
Packet->GetParamValue2(2),
Packet->GetParamValue2(3).iVal,
Packet->GetParamValue2(4).iVal,
0, NULL, nStatus);
return;
break;
}
}
m_pDlg->m_pRasterInet->InetSendRsp
 ((InetCmdType)InetCommand, nCommandID, Params, 0, NULL, nStatus);
}

void CRasterInetSink::OnInetReceiveRsp2
 (short iComputer, short InetCommand, long nCommandID, short nError, short nStatus, struct ILEADRasterInetPacket * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nRet;
CString szMsg;
ILEADRasterInetPacket * Packet = NULL;

Params->QueryInterface (IID_ILEADRasterInetPacket, (void **)&Packet);
if (!Packet)
return;

if(nError != 0)
return;

switch(InetCommand)
{
case INETCMD_LOAD:
if(nStatus != 0)
{
szMsg.Format("Load failed with error code %d", nStatus);
AfxMessageBox(szMsg);
}
break;

case INETCMD_GET_MAGGLASS_DATA:
if(nStatus == 0)
{
if((Packet->GetParamCount() == 6) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_USTRING) && (Packet->GetParamType(2) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_USTRING) && (Packet->GetParamType(4) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32))
{
nRet = m_pDlg->m_LEADRasterView1.UpdateMagGlass2(Packet->GetParamValue2(1),
Packet->GetParamValue2(3),
Packet->GetParamValue2(4).lVal,
Packet->GetParamValue2(5).lVal,
TRUE);

if(nRet != 0)
{
szMsg.Format("UpdateMagGlassExt failed with error code %d", nRet);
AfxMessageBox(szMsg);
}
}
else
AfxMessageBox("Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response");
}
else
{
szMsg.Format("Get MagGlass Data from sever failed with error code %d", nStatus);
AfxMessageBox(szMsg);
}
break;
}
}

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select CMagGlsNtComDlg.
 | d. | In the Messages list box, select WM_DESTROY.
 | e. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | f. | Click the Edit Code button to start entering the code.
22. | Enter new code for OnDestroy function, so it becomes as follows:

//Terminate a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterInet, DIID__LTRASINETEvents,
pInetUnkSink, FALSE, m_dwInetCookie);
delete m_pRasterInetSink;
m_pRasterInet->Release();

CDialog::OnDestroy();

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDCANCEL.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCancel).
 | f. | Click the Edit Code button and add the following code after the line that says //TODO: Add extra cleanup here:

// TODO: Add extra cleanup here
int i, num;
/* disconnect all connections */
num = m_pRasterInet->();
for (i = 0; i < num; i++)
{
m_pRasterInet->InetDisconnect
 (m_pRasterInet->GetConnectList (i));
}
if(m_bMagGlass)
m_LEADRasterView1.StopMagGlass();

CDialog::OnCancel();

24. | To add code for the Start Up Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_STARTUP_SERVER.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStartupServer).
 | f. | Click the Edit Code button and code the OnStartupServer procedure as follows:

int nRet;
CString cs;

/* initialize server on port 1000 */
nRet = m_pRasterInet->InetServerInit(1000);
if (nRet != 0)
{
cs.Format("%s %d\n","Error initializing server:", nRet);
AfxMessageBox(cs);
}
else
m_hServer = m_pRasterInet->InetServerHandle
 ;

25. | To add code for the Shut Down Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_SHUTDOWN_SERVER.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnShutdownServer).
 | f. | Click the Edit Code button and code the OnShutdownServer procedure as follows:

short nRet;
CString cs;

if (m_hServer != 0)
{
nRet = m_pRasterInet->InetServerClose
 (m_hServer);
if(nRet != 0)
{
cs.Format("%s %d\n","Error Shutting Down server:", nRet);
AfxMessageBox(cs);
}
else
m_hServer = 0;
}

26. | To add code for the Connect To Remote Server button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and code the OnConnect procedure as follows:

int nRet;
CString cs,text;

/* get the name of the computer entered in the edit box control */
m_RemoteAddress.GetWindowText(text);
/* Connect to remote computer on port 1000 */
nRet = m_pRasterInet->InetConnect
 (text.AllocSysString(), 1000);
if (nRet != 0)
{
cs.Format(" %s\n %s\n", "Error connecting to :", text);
AfxMessageBox(cs);
}

27. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and code the OnDisconnect procedure as follows:

int nRet;
CString cs;
/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList.
*/
nRet = m_pRasterInet->InetDisconnect
 (m_pRasterInet->GetSendList(0));
if (nRet != 0)
{
cs.Format("%s %d\n", "Error disconnecting from the server:",nRet);
AfxMessageBox(cs);
}

28. | To add code for the Load Remote Image button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_LOAD_REMOTE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnLoadRemote).
 | f. | Click the Edit Code button and code the OnLoadRemote procedure as follows:

short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendLoadCmd
 (m_nCommandID++, "v:\\images\\eagle.cmp", 0, 1);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format("ERROR %d calling InetSendLoadCmd.", nRet);
AfxMessageBox(csOut);
}

29. | To add code for the Start Magnifying Glass button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_START_MAG_GLASS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStartMagGlass).
 | f. | Click the Edit Code button and code the OnStartMagGlass procedure as follows:

if(m_LEADRasterView1.GetRaster().GetBitmap() != 0 && m_hServer == 0)
{
// Enable MagGlassExt event.
if(!m_LEADRasterView1.GetEnableMagGlassEvent())
m_LEADRasterView1.SetEnableMagGlassEvent(TRUE);

m_LEADRasterView1.SetRgnFrameType(0);

// Start the Magnifying Glass
int nRet = m_LEADRasterView1.StartMagGlass(150.0f, 100.0f, 200,
0, m_LEADRasterView1.GetBackColor(),
FALSE, 1.0f, TRUE, CROSSHAIR_FINE,
TRUE, TRUE);

if(nRet == 0)
m_bMagGlass = TRUE;
}

30. | To add code for the Stop Magnifying Glass button, press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CMagGlsNtComDlg.
 | c. | In the Object IDs list box, select IDC_STOP_MAG_GLASS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStopMagGlass).
 | f. | Click the Edit Code button and code the OnStopMagGlass procedure as follows:

if(m_LEADRasterView1.GetRaster().GetBitmap() != 0 && m_hServer == 0)
{
int nRet = m_LEADRasterView1.StopMagGlass();

if(nRet == 0)
m_bMagGlass = FALSE;
}

31. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CMagGlsNtComDlg.
 | b. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | c. | In the Messages list box, select MagGlassExt2.
 | d. | Click the Add function button. Choose OK for the default function name (OnMagGlassExt2Leadrasterview1).
 | e. | Click the Edit Code button and code the OnMagGlassExt2Leadrasterview1 procedure as follows:

short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendGetMagGlassDataCmd2
 (m_nCommandID++, 0, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format("ERROR %d calling InetSendGetMagGlassDataCmd .", nRet);
AfxMessageBox(csOut);
}

32

Edit the MagGlsNtCom.cpp file and add the following code as the first line in the InitInstance function:

CoInitialize(NULL);

33.

Edit the MagGlsNtCom.cpp file and add the following code as the next to last line in the InitInstance function (before the return)!:

CoUninitialize();

34. | On the main menu, select Build > Build MagGlsNtCom.exe to build the project.
35. | On the main menu, select Build > Execute MagGlsNtCom.exe twice, to run two projects.
36. | In the first project press the Start Up Server button.
37. | In the second project fill the edit box with the IP address of the remote computer on which you started the first project as a server. Then, press the Connect To Remote Server button to connect to the specified address.
38. | Press the Load Remote Image button of the second project started, to load an image on the server. Then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support. Press the left mouse button and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using a PanWindow (Visual C++ 5.0 and later)

Using a PanWindow (Visual C++ 5.0 or later)

Take the following steps to start a project and to add some code that opens and displays an image file and allows you to bring up a PanWindow.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify pan.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D controls is selected.
 | c. | Select ActiveX controls.
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the mditutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrio14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids
#include "leadraster.h"

8. | Add a LEAD RasterView control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the mditutor resources folder to open it.
 | c. | Double-click the Pan folder to open it.
 | d. | Double-click IDD_PAN_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEAD RasterView Control icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that both CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEAD RasterView control icon; then size and position the control as you want it to appear at run time.
 | l. | Use the right mouse button to edit the properties of the new LEAD RasterView control.
 | m. | Change the ID to IDC_LEADRASTERVIEW1.
9. | Add a command button to your form and name it as follows:
 | ID | Caption
 | IDC_PANWIN | Show Pan Window
10. | Add a Check box control to the main window and set the ID and Caption as follows:
 | ID | Caption
 | IDC_CHECK1 | Pan Window
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.
12. | Do the following to add m_LEADRasterView1 and m_Check1 to the CPanDlg class and link the variable to the controls using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CPanDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and control as the category.
 | g. | Click OK to close the dialog box.
 | h. | Back in MFC Wizard, go to the Member Variables tab, and ensure CPanDlg is in the Class Name box.
 | i. | In the Control IDs list, select IDC_CHECK1.
 | j. | Click the Add Variable... button.
 | k. | Specify m_Check1 as the variable name, and control as the category.
 | l. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
13. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CPanDlg.
 | c. | In the Object IDs list box, select IDC_PANWIN.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnPanWin).
 | f. | Click the Edit Code button and enter the following code:

/*set the location of the PanWindow*/
m_LEADRasterView1.SetPanWinX(100.0f);
m_LEADRasterView1.SetPanWinY(100.0f);
/*set the size of the PanWindow*/
m_LEADRasterView1.SetPanWinWidth(150.0f);
m_LEADRasterView1.SetPanWinHeight(200.0f);
/*set the type of mouse pointer*/
m_LEADRasterView1.SetPanWinPointer (12);

m_LEADRasterView1.SetPanWinTitle ("PanWindow");
m_LEADRasterView1.SetPanWinRectColor (RGB(0, 0, 255));
m_LEADRasterView1.SetPanWinSysMenu (1);
/*use the settings for LEADRASTERVIEW1*/
m_LEADRasterView1.SetPanWinPaintPalette (m_LEADRasterView1.GetPaintPalette());
m_LEADRasterView1.SetPanWinBitonalScaling (m_LEADRasterView1.GetBitonalScaling ());
m_LEADRasterView1.SetPanWinPaintScaling(m_LEADRasterView1.GetPaintScaling());
m_LEADRasterView1.SetPanWinPaintDither (m_LEADRasterView1.GetPaintDither ());
m_LEADRasterView1.ShowPanWin(TRUE);
m_Check1.SetCheck(TRUE);

14.

Add the following line to the OnInitDialog procedure in the PanDlg.cpp file, following : // TODO: Add extra initialization here

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\eagle.cmp", 0, 0, 1);
pRasterIO->Release();

15. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CPanDlg.
 | c. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | d. | In the Messages list box, select PanWin.
 | e. | Click the Add function button. Choose OK for the default function name (OnPanWin).
 | f. | Click the Edit Code button and code the OnPanWin procedure as follows:

if (iFlag == PANWIN_DESTROYED)
{
m_Check1.SetCheck(FALSE);
}

16. | On the main menu, select Build> Build pan.exe to build the project.
17. | On the main menu, select Build> Execute pan.exe to run the project.


Print a Real Image Size in Inches (Visual C++ 5.0)

Print a Real Image Size in Inches (C++ 5.0 and later)

Take the following steps to start a project and to add some code that prints an image:

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify tutor.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
a. | For comments, ensure that Yes, Please is selected.
b. | For how to use the MFC library, select Use MFC in a Shared DLL.
c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
a. | In the Project Workspace, click the FileView tab.
b. | Double-click the tutor files folder to open it.
c. | Double-click the Header Files folder to open it.
d. | Double-click the StdAfx.h file to edit it.

Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\\winnt\system32\\ltrio14n.dll" no_namespace, named_guids, exclude("LoadResizeConstants")
#include "leadraster.h"

8.

Add a LEAD RasterView control to the main window as follows:

a. | In the Project Workspace, click the ResourceView tab.
b. | Double-click the tutor resources folder to open it.
c. | Double-click the Dialog folder to open it.
d. | Double-click IDD_TUTOR_DIALOG to design the form.
e. | Select the TODO... text control; then press the Delete key to delete it.
f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
g. | Click the Registered ActiveX Contols.
h. | Double-click the LEAD Raster View Control (14.5) icon. (The Confirm Classes dialog box appears.)
i. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
j. | Click OK to complete the selection, then click Close to close the Component Gallery. (The LEAD Raster View Control (14.5) appears in the Controls toolbar.)
k. | Click the LEAD Raster View Control (14.5) icon; then size and position the control as you want it to appear at run time.
l. | Use the right mouse button to edit the properties of the new LEAD RasterView control.
m. | Change the ID to IDC_LEADRASTERVIEW1.

10. | Press Ctrl-F4 to close all windows back to the Project Workspace.
11. | Do the following to add m_LEADRasterView1 to the CTutorDlg class and link the variable to the LEAD RasterView control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
12. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the tutor classes folder to open it.
 | c. | Expand the CTutorDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
13. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

long hdcPrinter; // Printer device context
float fRealWidth; // Image real width in inches
float fRealHeight; // Image real height in inches
float fPrnDPIX; // Number of pixels per logical inch along the screen width
float fPrnDPIY; // Number of pixels per logical inch along the screen height
ILEADRasterIO *pRasterIO = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\image1.cmp", 0, 0, 1);

fRealWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth() / m_LEADRasterView1.GetRaster().GetBitmapXRes();
fRealHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight() / m_LEADRasterView1.GetRaster().GetBitmapYRes();

hdcPrinter = m_LEADRasterView1.PrintStart();

fPrnDPIX = (float)GetDeviceCaps((HDC)hdcPrinter, LOGPIXELSX);
fPrnDPIY = (float)GetDeviceCaps((HDC)hdcPrinter, LOGPIXELSY);

m_LEADRasterView1.Render(hdcPrinter, 1, 1, fPrnDPIX * fRealWidth, fPrnDPIY * fRealHeight);

m_LEADRasterView1.PrintEnd(hdcPrinter);

pRasterIO->Release();

21. | On the main menu, select Build > Build tutor.exe to build the project.
22. | On the main menu, select Build > Execute tutor.exe to run the project.


Combining Images with Regions (Visual C++ 5.0)

Combining Images with Regions (C++ 5.0 and later)

Take the following steps to start a project and to add some code that combines two images with a region:

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify tutor.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Select ActiveX Controls
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\\winnt\\system32\\ltrvr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\ltrio14n.dll" no_namespace, named_guids, exclude("LoadResizeConstants")
#import "c:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids

f. | In the Project Workspace, click the FileView tab.
g. | Double-click the tutor files folder to open it.
h. | Double-click the Header Files folder to open it.
i. | Double-click the tutorDlg.h file to edit it.
j. | Add the following lines to the top of the file:

#include "leadraster.h"

8. | Add a LEAD RasterView control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the tutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_TUTOR_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add to project > Components and Controls. (The Component Gallery appears.)
 | g. | Click the Registered ActiveX Contols.
 | h. | Double-click the LEAD Raster View Control (14.5) icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that CLEADRasterView, CLEADRaster, and CPicture are checked.
 | j. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView control appears in the Controls toolbar.)
 | k. | Click the LEAD RasterView control icon; then size and position the control as you want it to appear at run time.
 | l. | Use the right mouse button to edit the properties of the new LEAD RasterView control.
 | m. | Change the ID to IDC_LEADRASTERVIEW1.
 | n. | Click the LEAD RasterView control icon; then size and position the control as you want it to appear at run time.
 | o. | Use the right mouse button to edit the properties of the new LEAD RasterView control.
 | p. | Change the ID to IDC_LEADRASTERVIEW2.
 | q. | Ensure that Visible property is unchecked.

9. | Press Ctrl-F4 to close all windows back to the Project Workspace.
10. | Do the following to add m_LEADRasterView1 and m_LEADRasterView2 to the CTutorDlg class and link the variables to the LEAD RasterView controls using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box..
 | h. | In the Control IDs list, select IDC_LEADRASTERVIEW2.
 | i. | Click the Add Variable... button.
 | j. | Specify m_LEADRasterView2 as the variable name, and Control as the category.
 | k. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
11. | Go to the OnInitDialog() function as follows:
a. | In the Project Workspace, click the ClassView tab.
b. | Double-click the tutor classes folder to open it.
c. | Expand the CTutorDlg class.
d. | Double-click the OnInitDialog() function to edit it.

12.

Edit the OnInitDialog() function to add the following initializing code before the line CDialog::OnInitDialog();

ILEADRasterIO *pRasterIO = NULL;
ILEADRasterProcess *pRasterProc = NULL;

13.

Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\sample1.cmp", 0, 0, 1);
pRasterIO->Load(m_LEADRasterView2.GetRaster(), "c:\\sample2.cmp", 0, 0, 1);

m_LEADRasterView1.GetRaster().SetRgnRect(100, 100, 300, 300, L_RGN_SET);
pRasterProc->Combine(m_LEADRasterView1.GetRaster(), 100, 100, 300, 300, m_LEADRasterView2.GetRaster(), 0, 0, (CombineConstants)(CB_OP_ADD | CB_DST_0));

m_LEADRasterView1.GetRaster().FreeRgn();

pRasterIO->Release();
pRasterIO = NULL;
pRasterProc->Release();
pRasterProc = NULL;

14. | On the main menu, select Build > Build tutor.exe to build the project.
15. | On the main menu, select Build > Execute tutor.exe to run the project.


Miscellaneous Examples (Visual C++ 5.0)

Miscellaneous Examples (C++ 5.0 and later)

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test any of the following examples by adding a command button to one of the previous lessons in the tutorial, and pasting the sample code in the Click procedure. In most cases, you can add the button after the first lesson Loading and Displaying an Image.

AboutBox example for C++ 5.0 and later

AdaptiveContrast Example for C++ 5.0 and later

AddBitmaps example for C++ 5.0 and later

AddBorder example for C++ 5.0 and later

AddFrame example for C++ 5.0 and later

AddMessage Example for C++ 5.0 and later

AddNoise example for C++ 5.0 and later

AddShadow example for C++ 5.0 and later

AddWeightedBitmaps example for C++ 5 and later

AdjustTint example for Visual C++

Aging Example for C++ 5.0 and later

AlphaBlend example for C++ 5.0 and later

Animate Event Example for C++ 5.0 and later

AnimationEnable Example for C++ 5.0 and later

AnnAddUndoNode Example for C++ 5.0 and later

AnnAddUserHandle example for C++ 5.0 and later

AnnAdjustPoint example for C++ 5.0 and later

AnnAutoCursor example for C++ 5 and later

AnnAutoDialogFontSize Example for C++ 5.0 and later

AnnAutoDrawEnable Example for C++ 5.0 and later

AnnAutoHilightPen Example for C++ 5.0 and later

AnnAutomation Property Example for C++ 5.0 and later

AnnAutoMenuEnable Example for C++ 5.0 and later

AnnBoundingRect... Example for Visual C++

AnnChange Example for C++ 5.0 and later

AnnChangeUserHandle example for C++ 5.0 and later

AnnContainer Example for C++ 5.0 and later

AnnDataPath example for C++ 5.0 and later

AnnDefine2 example for C++ 5 and later

AnnDeletePage Example for Visual C++

AnnDeletePageArray Example for Visual C++

AnnDeletePageMemory Example for Visual C++

AnnDeleteUserHandle example for C++ 5 and later

AnnDestroy example for C++ 5.0 and later

AnnEnableZoomView Example for C++ 5.0 and later

AnnEncryptApply example for C++ 5 and later

AnnEnumerate example for C++ 5.0 and later

AnnEnumerateHandle example for C++ 5 and later

AnnEnumerateTextToken example for C++ 5.0 and later

AnnFixed example for C++ 5 and later

AnnGetAutoMenuItemEnable example for C++ 5.0 and later

AnnGetContainer Example for Visual C++

AnnGetDistance2 example for C++ 5 and later

AnnGetGrouping example for C++ 5.0 and later

AnnGetHyperlinkParam example for C++ 5.0 and later

AnnGetHyperlinkString example for C++ 5.0 and later

AnnGetNameOffsetX Example for Visual C++

AnnGetNameRestrict Example for Visual C++

AnnGetObjectFromTag example for C++ 5.0 and later

AnnGetPoint... example for C++ 5.0 and later

AnnGetProtractorOptions Example for Visual C++

AnnGetRgnHandle Example for Visual C++

AnnGetScalarX Example for Visual C++

AnnGetSecondaryMetaFile example for C++ 5 and later

AnnGetSelectList example for C++ 5.0 and later

AnnGetUserData example for C++ 5.0 and later

AnnGetUserHandles example for C++ 5 and later

AnnGetVisible example for C++ 5.0 and later

AnnGroup example for C++ 5.0 and later

AnnHandle example for C++ 5 and later

AnnHitTest Example for Visual C++

AnnHitTestExt example for C++ 5 and later

AnnHyperlink example for C++ 5.0 and later

AnnHyperlinkMenu example for C++ 5.0 and later

AnnHyperlinkMenuEnable example for C++ 5.0 and later

AnnInsert example for C++ 5.0 and later

AnnInsertTokenTable example for C++ 5 and later

AnnIsFixedRect example for C++ 5 and later

AnnLoadArray example for C++ 5.0 and later

AnnLock example for C++ 5.0 and later

AnnLocked example for C++ 5.0 and later

AnnMenu example for C++ 5.0 and later

AnnMouseDown example for C++ 5.0 and later

AnnMove example for C++ 5.0 and later

AnnNameBoundingRectLeft Example for Visual C++

AnnNameOptions example for C++ 5 and later

AnnNameRectLeft Example for Visual C++

Annotation Colors Example for Visual C++

AnnParentRasterView example for C++ 5.0 and later

AnnPointOptions example for C++ 5 and later

AnnPopFixedState example for C++ 5 and later

AnnPredefinedRaster example for C++ 5 and later

AnnPushFixedState example for C++ 5 and later

AnnRestrictCursor example for C++ 5 and later

AnnRotate example for C++ 5.0 and later

AnnRotateAngle example for C++ 5 and later

AnnRTFText example for C++ 5 and later

AnnSaveArray example for C++ 5.0 and later

AnnSaveMemory example for C++ 5.0 and later

AnnSaveTag example for C++ 5.0 and later

AnnSelect example for C++ 5.0 and later

AnnSelectRect Example for Visual C++

AnnSetAutoMenuItemEnable Example for C++ 5.0 and later

AnnSetAutoText Example for C++ 5.0 and later

AnnSetMetafile Example for Visual C++

AnnSetPolyFillMode Example for Visual C++

AnnSetROP2 Example for Visual C++

AnnSetSecondaryBitmap Example for Visual C++

AnnSetUnit Example for Visual C++

AnnSetUser Example for C++ 5.0 and later

AnnSetWnd Example for Visual C++

AnnShowLockedIcon Example for C++ 5.0 and later

AnnTextAlign example for C++ 5 and later

AnnTextExpandTokens example for C++ 5 and later

AnnTextPointerFixed example for C++ 5 and later

AnnTextRotate example for C++ 5 and later

AnnTicMarkLength example for C++ 5 and later

AnnToolChecked example for C++ 5.0 and later

AnnToolDestroy example for C++ 5.0 and later

AnnUndo Example for C++ 5.0 and later

AnnUndoEnable Example for C++ 5.0 and later

AnnUngroup Example for C++ 5.0 and later

AnnUnlock Example for C++ 5.0 and later

AnnUnlocked Example for C++ 5.0 and later

AnnUnrealize Example for C++ 5.0 and later

AnnTextEdit example for Visual C++

AnnCalibrateRuler example for Visual C++

AnnSetOptions example for Visual C++

AnnGetRotateOptions example for Visual C++

AnnSetTextOptions example for Visual C++

AnnAutoSnapCursor example for Visual C++

AnnSetFillModeExt example for Visual C++

AntiAlias example for Visual C++

Appearance Example for C++ 5.0 and later

ApplyMathLogic Example for C++ 5.0 and later

ApplyModalityLUT Example for C++ 5.0 and later

ApplyModalityLUT2 Example for C++ 5.0 and later

ApplyVOILUT Example for C++ 5.0 and later

ApplyVOILUT2 Example for C++ 5.0 and later

AutoAnimate Example for C++ 5.0 and later

AutoBinary Example for C++ 5.0 and later

AutoColorLevel Example for C++ 5.0 and later

AutoPan Example for C++ 5.0 and later

AutoSegment Example for C++ 5.0 and later

AutoSize Example for C++ 5.0 and later

AutoTrim example for C++ 5.0 and later

Average example for C++ 5.0 and later

BackColor (ILEADRasterImgList) example for C++ 5.0 and later

BackColor example for C++ 5.0 and later

BackErase example for C++ 5.0 and later

BalanceColors example for Visual C++

Bending Example for C++ 5.0 and later

BinaryFilter example for C++ 5.0 and later

BitmapAlpha example for C++ 5.0 and later

BitmapBytesPerLine example for C++ 5.0 and later

BitmapCompression example for C++ 5.0 and later

BitmapDataPath Example for C++ 5.0 and later

BitmapDpi Example for Visual C++

BitmapToClient example for C++ 5.0 and later

BitmapXres and BitmapYres example for C++ 5.0 and later

BitonalScaling (ILEADRasterImgList) example for C++ 5.0 and later

BitonalScaling example for C++ 5.0 and later

BooleanItemValue example for C++ 5.0 and later

BooleanItemValue example for C++ 5.0 and later

BooleanValue example for C++ 5.0 and later

BooleanValue example for C++ 5.0 and later

BorderColor example for C++ 5.0 and later

BorderRemove example for C++ 5.0 and later

BorderStyle example for C++ 5.0 and later

BricksTexture example for Visual C++

BrowseDir example for C++ 5.0 and later

BumpMap Example for C++ 5.0 and later

ButtonColumns example for C++ 5.0 and later

ButtonMenuTool example for C++ 5.0 and later

ButtonRows example for C++ 5.0 and later

ButtonVisible example for C++ 5.0 and later

Canvas example for Visual C++

Capture example for C++ 5.0 and later

CenterImage example for C++ 5.0 and later

Change example for C++ 5.0 and later

ChannelMix Example for C++ 5.0 and later

Clear example for C++ 5.0 and later

ClientToBitmap example for C++ 5.0 and later

Clouds example for Visual C++

CMYKRaster Example for C++ 5.0 and later

ColoredBalls example for Visual C++

ColoredPencil example for Visual C++

ColorHalfTone example for Visual C++

ColorIntensityBalance Example for C++ 5.0 and later

ColorizeGray Example for C++ 5.0 and later

ColorLevel Example for C++ 5.0 and later

ColorReplace example for C++ 5.0 and later

ColorRes example for C++ 5.0 and later

ColorResList Example for C++ 5.0 and later

ColorSpace Example for C++ 5.0 and later

ColorThreshold example for C++ 5.0 and later

Combine example for C++ 5.0 and later

CombineBitmapWarp example for C++ 5.0 and later

CombineExt example for C++ 5.0 and later

Comment example for C++ 5.0 and later

CompactFile Example for C++ 5.0 and later

ContinueBrowse example for C++ 5.0 and later

ContourFilter example for C++ 5.0 and later

Contrast example for C++ 5.0 and later

ContrastBrightIntensity Example for C++ 5.0 and later

ControlWindow example for C++ 5.0 and later

ConvertToColoredGray example for Visual C++

ConvertUnsignedToSigned Example for C++ 5.0 and later

CopyMarkers example for C++ 5.0 and later

Correlation Example for C++ 5.0 and later

CorrelationList example for Visual C++

CountLUTColors example for C++ 5 and later

Create example for C++ 5.0 and later

CreateBitmap, Size, and Combine example for C++ 5.0 and later

CreateMaskFromRgn Example for Visual C++

CreateObject Example for C++ 5.0 and later

CreateThumbnailFromFile example for C++ 5.0 and later

CreateUserBitmap example for C++ 5.0 and later

CreateUserBitmap2 example for Visual C++ 5.0

CreateZoomView Example for Visual C++ 5.0 and later

Cubism Example for C++ 5.0 and later

CurveToBezier example for C++ 5.0 and later

Cylindrical Example for C++ 5.0 and later

dbCan... example for C++ 5.0 and later

DblClick (ILEADRasterImgList) example for C++ 5.0 and later

DblClick example for C++ 5.0 and later

DDB example for C++ 5.0 and later

DecodeABIC example for Visual C++

Deinterlace Example for C++ 5.0 and later

DeleteBitmapListItems example for C++ 5.0 and later

DeleteMarker example for C++ 5.0 and later

DeleteMarkerAt example for C++ 5.0 and later

DeletePage example for C++ 5.0 and later

DeleteTag Example for C++ 5.0 and later

Desaturate Example for C++ 5.0 and later

Deskew example for C++ 5.0 and later

DeskewExt example for Visual C++

Despeckle example for C++ 5.0 and later

DestroyZoomView Example for Visual C++ 5.0 and later

DIB example for C++ 5.0 and later

DiceEffect Example for C++ 5.0 and later

DiffuseGlow example for Visual C++

DigitalSubtract Example for C++ 5.0 and later

DirectionEdgeStatistical example for C++ 5.0 and later

Directory Example for C++ 5.0 and later

DiscreteFourierTransformation example for C++ 5.0 and later

DispatchValue example for C++ 5.0 and later

DispatchValue example for C++ 5.0 and later

DisplaceMap example for Visual C++

DisplayFourierTransformation example for C++ 5.0 and later

DJVResolution example for C++ 5.0 and later

DocCleanSuccess example for C++ 5.0 and later

DoubleBuffer example for C++ 5.0 and later

DoubleItemValue example for C++ 5.0 and later

DoubleItemValue example for C++ 5.0 and later

DoubleValue example for C++ 5.0 and later

DoubleValue example for C++ 5.0 and later

DrawShape example for C++ 5.0 and later

DrawStar Example for C++ 5.0 and later

DrawText example for C++ 5.0 and later

Dry Example for C++ 5.0 and later

Dst... example for C++ 5.0 and later

DynamicBinary Example for C++ 5.0 and later

EdgeDetectEffect Example for C++ 5.0 and later

EdgeDetector example for C++ 5.0 and later

EdgeDetectorExt example for C++ 5.0 and later

EdgeDetectStatistical Example for C++ 5.0 and later

EffectSpeed Example for C++ 5.0 and later

Emboss example for C++ 5.0 and later

EnableKeyboard example for C++ 5.0 and later

EnableLoadInfoEvent Example for C++ 5.0 and later

EnableMethodErrors (ILEADRasterImgList) example for C++ 5.0and later

EnableMethodErrors (ILEADRasterThumbnail) example for C++ 5.0 and later

EnableMethodErrors example for C++ 5.0 and later

EnableOCRDrawing Example for C++ 5.0 and later

EnableOLEDragMethod Example for C++ 5.0 and later

EnablePaint example for C++ 5.0 and later

EnableRestrictToContainer example for C++ 5 and later

EnableZoomInRect example for C++ 5.0 and later

EncodeABIC example for Visual C++

EnumerateMarkers example for C++ 5.0 and later

EnumFileTags Example for C++ 5.0 and later

EnumGeoKeys Example for Visual C++

EnumSegments example for C++ 5.0 and later

Exif example for C++ 5.0 and later

ExportBitmapList Example for C++ 5.0 and later

ExtractMessage example for C++ 5.0 and later

FastFourierTransformation example for C++ 5.0 and later

FastLoad example for Visual C++ 5.0 and later

FastRotate example for C++ 5.0 and later

FeatherAlphaBlend example for C++ 5.0 and later

FeedLoad example for C++ 5.0 and later

FileName Example for C++ 5.0 and later

FilePage Event Example for C++ 5.0 and later

Fill example for C++ 5.0 and later

Flip example for C++ 5.0 and later

FloaterDstClip... example for C++ 5.0 and later

FloatItemValue example for C++ 5.0 and later

FloatItemValue example for C++ 5.0 and later

FloatValue example for C++ 5.0 and later

FloatValue example for C++ 5.0 and later

Font (ILEADRasterImgList) example for C++ 5.0 and later

Font example for C++ 5.0 and later

ForeColor example for C++ 5.0 and later

Fragment example for Visual C++

Frame... example for C++ 5.0 and later

FreeHandShear Example for C++ 5.0 and later

FreeHandWave Example for C++ 5.0 and later

FreePlaneBend Example for C++ 5.0 and later

FreeRadBend Example for C++ 5.0 and later

FrequencyFilter example for C++ 5.0 and later

FrequencyFilterMask example for C++ 5.0 and later

FunctionalLight Example for C++ 5.0 and later

GammaCorrect example for C++ 5.0 and later

GammaCorrectExt example for Visual C++

GaussianFilter example for Visual C++ 5.0 and later

GetBitmapClipSegments example for C++ 5.0 and later

GetBitmapDC example for C++ 5.0 and later

GetBitmapStatisticsInfo example for C++ 5.0 and later

GetColorCount Example for C++ 5.0 and later

GetDIB2 Example for C++ 5.0 and later

GetFeretsDiameter example for C++ 5.0 and later

GetFileInfo example for C++ 5.0 and later

GetFloaterHandle example for C++ 5.0 and later

GetFunctionalLookupTable example for C++ 5.0 and later

GetGeoKey Example for Visual C++

GetHistogram example for C++ 5.0 and later

GetHistogramGray example for C++ 5.0 and later

GetLayerMaskBitmap example for C++ 5.0 and later

GetLinearVOILUT example for C++ 5 and later

GetMarkers example for C++ 5.0 and later

GetMemoryInfo example for C++ 5.0 and later

GetMemoryThresholds example for C++ 5.0 and later

GetMinMaxBits example for C++ 5.0 and later

GetMinMaxVal example for C++ 5.0 and later

GetObjectInfo example for C++ 5.0 and later

GetOverlayBitmap example for C++ 5.0 and later

GetOverlayCount example for C++ 5.0 and later

GetRgnHandle example for C++ 5.0 and later

GetRgnPerimeterLength example for C++ 5.0 and later

GetTransformationParameters Example for C++ 5.0 and later

GetUserLookupTable example for C++ 5.0 and later

GlassEffect Example for C++ 5.0 and later

GlowFilter Example for C++ 5.0 and later

Grayscale example for C++ 5.0 and later

GrayscaleExt example for Visual C++

GrayScaleToDuotone Example for C++ 5.0 and later

GrayScaleToMultitone Example for C++ 5.0 and later

Halftone example for C++ 5.0 and later

HalfTonePattern example for Visual C++

HasMagGlass example for C++ 5.0 and later

hDocCleanRgn example for C++ 5.0 and later

HighPassFilter example for Visual C++

HistoContrast example for C++ 5.0 and later

HistoEqualize example for C++ 5.0 and later

HistogramTableSize example for C++ 5.0 and later

HolesRemovalBitmapRgn Example for C++ 5.0 and later

HScrollInfo example for C++ 5.0 and later

HSV_HfromRGB example for C++ 5.0 and later

Hue example for C++ 5.0 and later

HueSaturationIntensity example for C++ 5.0 and later

IgnoreFilters example for C++ 5.0 and later

Impressionist Example for C++ 5.0 and later

InfoHasAlpha example for Visual C++ 5.0 and later

InfoLayers example for C++ 5.0 and later

InfoViewPerspective Example for C++ 5.0 and later

Insert example for C++ 5.0 and later

InsertAt example for C++ 5.0 and later

InsertBitmapListItem Example for C++ 5.0 and later

InsertFromBitmapList example for C++ 5.0 and later

InsertMarker example for C++ 5.0 and later

Intensity example for C++ 5.0 and later

IntensityDetect example for C++ 5.0 and later

Invert example for C++ 5.0 and later

InvertedText example for C++ 5.0 and later

IsGrayscale example for C++ 5.0 and later

ISISAcquire example for C++ 5.0 and later

ISISAcquireMulti example for C++ 5.0 and later

IsISISAvailable example for C++ 5.0 and later

ISISSelect example for C++ 5.0 and later

ISISSetScanOptions example for C++ 5.0 and later

IsRegistrationMark Example for C++ 5.0 and later

IsSigned example for C++ 5.0 and later

Item example for C++ 5.0 and later

ItemBackgroundColor example for C++ 5.0 and later

ItemSelected example for C++ 5.0 and later

ItemUnSelected example for C++ 5.0 and later

ItemWidth example for C++ 5.0 and later

J2KCompressionControl example for C++ 5.0 and later

J2KCompressionRatio example for C++ 5.0 and later

J2KROIControl example for C++ 5.0 and later

J2KSetDefaults example for C++ 5.0 and later

J2KTargetFileSize example for C++ 5.0 and later

JBIG2GBATX1 Example for C++ 5.0 and later

KeyDown example for C++ 5.0 and later

KeyPress (ILEADRasterImgList) example for C++ 5.0 and later

KeyPress example for C++ 5.0 and later

KeyUp example for C++ 5.0 and later

LensFlare Example for C++ 5.0 and later

LevelHighBit example for C++ 5.0 and later

LevelLowBit example for C++ 5.0 and later

LevelLUT example for C++ 5.0 and later

LevelLUTLength example for C++ 5.0 and later

Light Example for C++ 5.0 and later

LightControl Example for C++ 5.0 and later

LineProfile example for Visual C++ 5.0 and later

LineRemove example for C++ 5.0 and later

Load (ILEADMarkers) example for C++ 5.0 and later

Load example for C++ 5.0 and later

LoadArray example for C++ 5.0 and later

LoadArray2 example for Visual C++ 5.0

LoadCompressed example for C++ 5.0 and later

LoadDatabase example for C++ 5.0 and later

LoadFromFile example for C++ 5.0 and later

LoadICCProfile Example for Visual C++

LoadICCProfile2 Example for Visual C++

LoadIFD example for C++ 5.0 and later

LoadInfo... example for C++ 5.0 and later

LoadMemory example for C++ 5.0 and later

LoadOffset example for C++ 5.0 and later

LoadResize example for C++ 5.0 and later

LoadStatus Example for C++ 5.0 and later

LoadUseViewPerspective example for C++ 5.0 and later

LocalHistoEqualize Example for C++ 5.0 and later

LongItemValue example for C++ 5.0 and later

LongItemValue example for C++ 5.0 and later

LongValue example for C++ 5.0 and later

LongValue example for C++ 5.0 and later

LZWAutoClear example for Visual C++

MagGlassOwnerDraw Example for C++ 5.0 and later

MagGlassPaintIntensity Example for C++ 5.0 and later

MaskConvolution example for Visual C++

MathFunction example for C++ 5.0 and later

MaxFilter example for C++ 5.0 and later

Median example for C++ 5.0 and later

MinFilter example for C++ 5.0 and later

Mosaic example for C++ 5.0 and later

MosaicTiles example for Visual C++

MotionBlur example for C++ 5.0 and later

MouseDown example for C++ 5.0 and later

MouseMove example for C++ 5.0 and later

MousePointer example for C++ 5.0 and later

MouseUp example for C++ 5.0 and later

MouseWheel example for C++ 5.0 and later

Multiply Example for C++ 5.0 and later

MultiScaleEnhancement Example for C++ 5.0 and later

NumberFramesInOverlay example for C++ 5.0 and later

Ocean Example for C++ 5.0 and later

ODBC Example for C++ 5.0 and later

Offset example for Visual C++

Oilify example for C++ 5.0 and later

OLECompleteDrag Example for C++ 5.0 and later

OLEDropAllowed example for C++ 5.0 and later

OLEDropFile example for C++ 5.0 and later

OLEStartDrag (ILEADRasterImgList) example for C++ 5.0 and later

OptimizeBuffer Example for Visual C++

OptimizeDir Example for Visual C++

OriginX example for C++ 5.0 and later

OwnerDrawItem event example for C++ 5 and later

OwnerDrawItems example for C++ 5 and later

Paint event example for C++ 5.0 and later

PaintContrast example for C++ 5.0 and later

PaintDither (ILEADRasterImgList) example for C++ 5.0 and later

PaintDither example for C++ 5.0 and later

PaintEffect example for C++ 5.0 and later

PaintEffectMaxPasses example for C++ 5.0 and later

PaintGamma example for C++ 5.0 and later

PaintIntensity example for C++ 5.0 and later

PaintPalette example for C++ 5.0 and later

PaintROP3 example for C++ 5.0 and later

PaintScaling (ILEADRasterImgList) example for C++ 5.0 and later

PaintScaling Example for C++ 5.0 and later

PaintSizeMode Example for C++ 5.0 and later

PaintSizeUseDPI example for C++ 5.0 and later

PaintTransitionMaxPasses example for C++ 5.0 and later

PaintWhileLoad example for C++ 5.0 and later

PaintZoomFactor Example for C++ 5.0 and later

Password Example for C++ 5.0 and later

PatternStyle (ILEADRasterFXD) example for C++ 5.0 and later

PatternStyle example for C++ 5.0 and later

PCDRes example for C++ 5.0 and later

PDFCompInsertMRC Example for Visual C++ 5.0 and later

PDFCompInsertNormal Example for Visual C++ 5.0 and later

PDFEncryptFlags example for Visual C++ 5.0 and later

PDFInitDir example for C++ 5.0 and later

PDFSaveLowMemory example for Visual C++ 5.0 and later

PDFSaveUseDPI example for Visual C++ 5.0 and later

PDFXResolution example for C++ 5.0 and later

Perlin example for Visual C++

Perspective example for Visual C++

Picturize example for C++ 5.0 and later

PicturizeBitmapList example for C++ 5.0 and later

PicturizeSingle example for C++ 5.0 and later

Pixel example for C++ 5.0 and later

Pixelate Example for C++ 5.0 and later

PixelData example for C++ 5.0 and later

Plane Example for C++ 5.0 and later

PlaneBend Example for C++ 5.0 and later

PlasmaFilter example for Visual C++

PLTPenColor Example for C++ 5.0 and later

Pointillist example for Visual C++

Polar Example for C++ 5.0 and later

Posterize example for C++ 5.0 and later

PreferredLoadFormat Example for c++ 5.0 and later

PreLoadFilters Example for C++ 5.0 and later

PrinterScaleHeight Example for C++ 5.0 and later

PrintNewPage Example for C++ 5.0 and later

ProgressivePasses Example for C++ 5.0 and later

PTKResolution Example for C++ 5.0 and later

Punch Example for C++ 5.0 and later

PuzzleEffect Example for C++ 5.0 and later

RadialBlur Example for C++ 5.0 and later

RadWave Example for C++ 5.0 and later

RasterizeViewMode Example for C++ 5.0 and later

RawLoad Example for C++ 5.0 and later

RawSave Example for C++ 5.0 and later

ReadFileCommentOffset Example for C++ 5.0 and later

ReadLoadResolutions Example for C++ 5.0 and later

ReadTagMemory example for C++ 5.0 and later

ReadyState Example for C++ 5.0 and later

RefBitmap Example for C++ 5.0 and later

RefBitmapList Example for C++ 5.0 and later

RemapHue example for C++ 5.0 and later

RemapTableSize example for C++ 5.0 and later

Remove example for C++ 5.0 and later

RemoveRedeye example for C++ 5.0 and later

Resize (ILEADRasterImgList) example for C++ 5.0 and later

Resize event example for C++ 5.0 and later

ResizeRgn example for C++ 5.0 and later

RevEffect example for C++ 5.0 and later

RGBfromHSV example for C++ 5.0 and later

RgnChange example for C++ 5.0 and later

RgnFrameColor example for C++ 5.0 and later

RingEffect Example for C++ 5.0 and later

Ripple Example for C++ 5.0 and later

ROIMean example for C++ 5.0 and later

RomanMosaic example for Visual C++

Rotate example for C++ 5.0 and later

RowCount example for C++ 5.0 and later

Rows example for C++ 5.0 and later

RTFPaperHeight Example for C++ 5.0 and later

SampleTarget Example for C++ 5.0 and later

Saturation example for C++ 5.0 and later

Save (ILEADRasterMrc) example for C++ 5.0 and later

Save example for C++ 5.0 and later

SaveArray example for C++ 5.0 and later

SaveBuffer example for C++ 5.0 and later

SaveICCProfile Example for Visual C++

SaveICCProfile2 Example for Visual C++

SaveIFD example for C++ 5.0 and later

SaveInterlaced example for C++ 5.0 and later

SaveLayers example for C++ 5.0 and later

SaveList example for Visual C++

SaveLSB example for C++ 5.0 and later

SaveMemory example for C++ 5.0 and later

SaveMemory2 example for C++ 5.0 and later

SaveNoPalette example for C++ 5.0 and later

SavePage example for C++ 5.0 and later

SaveResolutionCount example for C++ 5.0 and later

SaveTileWidth example for C++ 5.0 and later

SaveToFile example for C++ 5.0 and later

SaveWithStamp example for C++ 5.0 and later

ScaleMode example for C++ 5.0 and later

Scroll (ILEADRasterImgList) example for C++ 5.0 and later

Scroll event example for C++ 5.0 and later

ScrollItems example for C++ 5.0 and later

ScrollStyle example for C++ 5.0 and later

Segment example for C++ 5.0 and later

SegmentExt example for Visual C++

SelectData Example for C++ 5.0 and later

SelectedItems example for C++ 5 and later

SelectionStyle example for C++ 5.0 and later

SelectiveColor Example for C++ 5.0 and later

SetGeoKey Example for Visual C++

SetMemoryInfo example for C++ 5.0 and later

SetMemoryThresholds example for C++ 5.0 and later

SetMinMaxBits Example for C++ 5.0 and later

SetOverlayAttributes example for C++ 5.0 and later

SetRgn example for C++ 5.0 and later

SetRgnBorder Example for C++ 5.0 and later

SetRgnColorHSVRange example for C++ 5.0 and later

SetRgnColorRGBRange example for C++ 5.0 and later

SetRgnFromMask example for C++ 5 and later

SetRgnFromMask Example for Visual C++

SetRgnMagicWand example for C++ 5.0 and later

SetSelectionBitmap example for C++ 5.0 and later

SetSrcClipRect example for C++ 5.0 and later

SetSrcRect example for C++ 5.0 and later

SetTag example for C++ 5.0 and later

Sharpen example for C++ 5.0 and later

Shear example for C++ 5.0 and later

ShiftData Example for C++ 5.0 and later

ShiftMinimumToZero example for Visual C++

ShortItemValue example for C++ 5.0 and later

ShortItemValue example for C++ 5.0 and later

ShortValue example for C++ 5.0 and later

ShortValue example for C++ 5.0 and later

Skeleton Example for C++ 5.0 and later

SkipFile example for C++ 5.0 and later

Slice Example for Visual C++

Smooth example for C++ 5.0 and later

SmoothEdges Example for C++ 5.0 and later

Solarize example for C++ 5.0 and later

Sort example for C++ 5.0 and later

SortExt Example for C++ 5.0 and later

SpatialFilter example for C++ 5.0 and later

Spherize Example for C++ 5.0 and later

Src... example for C++ 5.0 and later

STable example for C++ 5.0 and later

StopMagGlass example for C++ 5.0 and later

StretchIntensity example for C++ 5.0 and later

StringItemValue example for C++ 5.0 and later

StringItemValue example for C++ 5.0 and later

StringValue example for C++ 5.0 and later

StringValue example for C++ 5.0 and later

SubtractBackground example for C++ 5.0 and later

SwapColors example for Visual C++

Swirl Example for C++ 5.0 and later

TempDirectory Example for C++ 5.0 and later

TextureAlphaBlend Example for C++ 5.0 and later

TextWordWrap example for C++ 5.0 and later

Tool example for C++ 5.0 and later

TransitionEffect example for C++ 5.0 and later

Transparent example for C++ 5.0 and later

Trim example for C++ 5.0 and later

Tunnel Example for C++ 5.0 and later

TXTTopMarg Example for C++ 5.0 and later

Type example for C++ 5.0 and later

Underlay example for C++ 5.0 and later

UnsharpMask example for Visual C++

UpdateMagGlassFromHandle Example for C++ 5.0 and later

UpdateMagGlassShape example for C++ 5.0 and later

UpdateOverlayBits example for C++ 5.0 and later

UpdateZoomView Example for Visual C++ 5.0 and later

UseLUT example for C++ 5.0 and later

UseFastConversion example for Visual C++

UserFilter example for C++ 5.0 and later

UserPalette and BitmapPalette example for C++ 5.0 and later

UserSegmentInfo Example for Visual C++ 5.0 and later

UserShape Example for C++ 5.0 and later

ViewSize example for C++ 5 and later

Vignette example for Visual C++

VTable example for C++ 5.0 and later

vType example for C++ 5 and later

Wave Example for C++ 5.0 and later

Wind Example for C++ 5.0 and later

Window example for C++ 5.0 and later

WindowLevel... example for C++ 5.0 and later

WindowLevelFillLUT example for C++ 5.0 and later

WMFResolution example for C++ 5.0 and later

WriteComment example for C++ 5.0 and later

WriteGeoKey Example for Visual C++

WriteMarkerActiont example for C++ 5.0 and later

WriteMetaData example for C++ 5.0 and later

ZigZag example for Visual C++

ZoomBlur Example for C++ 5.0 and later

ZoomIn example for C++ 5.0 and later

ZoomInDone example for C++ 5.0 and later

ZoomWave Example for C++ 5.0 and later


AboutBox example for Visual C++ 5.0

AboutBox example for C++ 5.0 and later

This example displays the LEADTOOLS COM RasterView Control information.

m_LEADRasterView1.AboutBox();


AdaptiveContrast Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AdaptiveContrast(m_LeadRasterView.GetRaster (),9, 200, ADAPTIVE_LIN);

m_pRasterProc->Release();


AddBitmaps example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

ILEADRaster *pRaster2=NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

pRaster2->Bitmap = 0;
for(int i = 0; i<5; ++i)
{
pRaster2->Bitmap = m_RasterView1.GetRaster().GetBitmap();
pRasterProc->Rotate (pRaster2, 7200 * i, (RotateConstants)0, RGB(255, 0, 0));
m_RasterView2.GetRaster().InsertBitmapListItem (-1, pRaster2->Bitmap);
}
pRasterProc->AddBitmaps (m_RasterView2.GetRaster(), BC_AVG);

pRaster2->Release();
pRasterProc->Release();


AddBorder example for Visual C++ 5.0

AddBorder example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->AddBorder(m_RasterView1.GetRaster (), 30, 30, 30, 30, BORDER_OUTSIDE, BORDER_STYLE_OPAQUE, BORDER_EFFECT_CURVEDIN, NULL, BORDER_GRAD_INSIDEOUT, RGB(200, 150, 150), 0, 200, FALSE, FALSE, 0, BORDER_SHADOW_LEFT, FALSE);

pRasterProc->Release();


AddFrame example for Visual C++ 5.0

AddFrame example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->AddFrame(m_RasterView1.GetRaster (), m_RasterView2.GetRaster(), FALSE, FALSE, 0, 0, FRAME_OUTSIDE, FRAME_QUALITY_LOW);

pRasterProc->Release();


AddMessage Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Message = " LEAD Technologies, Inc ";
m_pRasterProc->AddMessage(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();


AddNoise example for Visual C++ 5.0

AddNoise example for C++ 5.0 and later

This example adds red noise and redisplays the bitmap.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->AddNoise(m_LEADRasterView1.GetRaster(), 500, CHANNEL_RED);
pRasterProc->Release();
m_LEADRasterView1.ForceRepaint();


AddShadow example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AddShadow(m_LeadRasterView.GetRaster(),SHADOW_SE, 0, ADOW_CLR_GRAY);

m_pRasterProc->Release();


AddWeightedBitmaps example for Visual C++ 5.0

AddWeightedBitmaps example for C++ 5 and later

int iListCount = 4;

ILEADRaster* m_pRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRaster);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->FactorCount = iListCount;

for (int i = 0; i<iListCount- 1;++i)
{
m_pRaster->Bitmap = m_LeadRasterView.GetRaster ().GetBitmap();
m_pRasterProc->Rotate (m_pRaster, 360 * i, ROTATE_RESIZE, RGB(255, 0, 0));
m_LeadRasterView.GetRaster().InsertBitmapListItem (-1, m_pRaster->Bitmap);
m_pRasterProc->PutFactor(i,100);
}

m_pRasterProc->AddWeightedBitmaps( m_LeadRasterView.GetRaster(), BC_ADDWEIGHTED);

m_pRasterProc->Release();
m_pRaster->Release();


AdjustTint example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AdjustTint(m_LeadRasterView.GetRaster(), -6500, 2000);
m_pRasterProc->Release();


Aging Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Aging(m_LeadRasterView.GetRaster (),10, 2, 50, 2, 5, 6, RGB(255, 255, 0),
RGB(0, 0, 0),
RGB(0, 0, 255),
AGING_ADD_VSCRATCH |
AGING_ADD_PITS |
AGING_SCRATCH_INV |
AGING_PITS_CLR );

m_pRasterProc->Release();


AlphaBlend example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRaster *pRaster2=NULL;

CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);
pRaster2->Bitmap = m_RasterView1.GetRaster ().GetBitmap();
pRasterProc->IntensityDetect (pRaster2, 150, 250);
pRasterProc->AlphaBlend(m_RasterView1.GetRaster(), 0, 0, m_RasterView1.GetRaster().GetBitmapWidth (), m_RasterView1.GetRaster().GetBitmapHeight(), pRaster2, 0, 0, 128);

pRaster2->Release();
pRasterProc->Release();


Animate Event Example for Visual C++ 5.0

Animate Event Example for C++ 5.0 and later

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

void CTutorDlg::OnAnimateLeadrasterview1(BOOL bEnable)
{
CWnd *pButton = GetDlgItem(IDC_BUTTON1);
if (bEnable == TRUE)
pButton->SetWindowText(TEXT("Stop Animation"));
else
pButton->SetWindowText(TEXT("Start Animation"));
}
void CTutorDlg::OnButton1()
{
if (m_LEADRasterView1.GetAnimationEnable())
m_LEADRasterView1.SetAnimationEnable(FALSE);
else
m_LEADRasterView1.SetAnimationEnable(TRUE);
}


AnimationEnable Example for Visual C++ 5.0

AnimationEnable Example for C++ 5.0 and later

This example loads and plays an animated file. It assumes that the LEAD RasterViewcontrol has already been sized to the aspect ratio of the image.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Load all pages of a GIF file.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\eye.gif",
0, 1, -1);
pRasterIO->Release();
// Set properties for a scaled animation.
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAutoSetRects(FALSE);
// Set the image display size to match the LEAD control.
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
// Allow a continuous loop.
m_LEADRasterView1.SetAnimationLoop(TRUE);
// Start the animation.
m_LEADRasterView1.SetAnimationEnable(TRUE);


AnnAddUndoNode Example for Visual C++ 5.0

AnnAddUndoNode Example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example creates two annotation notes as a single undo operation
void CTutorDlg::OnButtonAddundonode()
{
long hObject1;
long hObject2;

//Call the AddUndoNode method to add an undo node to the container.
m_pRasterAnn->AnnAddUndoNode ();

//Disable the undo feature
m_pRasterAnn->PutAnnUndoEnable (FALSE);

//Perform the operations to be combined into one undo.
m_pRasterAnn->AnnCreate(ANN_OBJECT_NOTE, TRUE, TRUE);
hObject1 = m_pRasterAnn->GetAnnObject();
m_pRasterAnn->PutAnnRectLeft(hObject1,0);
m_pRasterAnn->PutAnnRectTop(hObject1,0);
m_pRasterAnn->PutAnnRectWidth(hObject1, 100);
m_pRasterAnn->PutAnnRectHeight(hObject1,100);

m_pRasterAnn->AnnCreate(ANN_OBJECT_NOTE, TRUE, TRUE);
hObject2 = m_pRasterAnn->GetAnnObject();
m_pRasterAnn->PutAnnRectLeft (hObject2,0);
m_pRasterAnn->PutAnnRectTop (hObject2, 100);
m_pRasterAnn->PutAnnRectWidth (hObject2, 100);
m_pRasterAnn->PutAnnRectHeight (hObject2, 100);

//Re-enable the undo feature
m_pRasterAnn->PutAnnUndoEnable(TRUE);
}


AnnAddUserHandle example for C++ 5 and later

//'This example adds user handles to the center of the top and bottom lines of a rectangle
//'hRect is a rectangle
void CTutorDlg::ExampleAddAnnUserHandle(long hRect)
{
AnnObjectType ObjectType;
double RectTop;
double RectLeft;
double RectWidth;
double RectHeight;

m_pRasterAnn->AnnGetType(hRect);
ObjectType = m_pRasterAnn->GetAnnType();

if(ObjectType == ANN_OBJECT_RECT )
{
RectTop = m_pRasterAnn->GetAnnRectTop(hRect);
RectLeft = m_pRasterAnn->GetAnnRectLeft(hRect);
RectWidth = m_pRasterAnn->GetAnnRectWidth(hRect);
RectHeight = m_pRasterAnn->GetAnnRectHeight(hRect);

m_pRasterAnn->AnnHandle->ID = 100;
m_pRasterAnn->AnnHandle->EnableVisible = TRUE;
m_pRasterAnn->AnnHandle->PenColor = RGB(0, 0, 0);
m_pRasterAnn->AnnHandle->FillColor = RGB(255, 0, 0);
m_pRasterAnn->AnnHandle->Shape = ANN_HANDLE_SHAPE_CIRCLE;
m_pRasterAnn->AnnHandle->hCursor = NULL;

m_pRasterAnn->AnnHandle->Flags = ANN_HANDLE_ID |
ANN_HANDLE_LOCATION |
ANN_HANDLE_CONTAINER_COORDINATES |
ANN_HANDLE_VISIBLE |
ANN_HANDLE_PEN_COLOR |
ANN_HANDLE_FILL_COLOR |
ANN_HANDLE_SHAPE;

m_pRasterAnn->AnnHandle->ContainerX = RectLeft + (RectWidth / 2);
m_pRasterAnn->AnnHandle->ContainerY = RectTop;

m_pRasterAnn->AnnAddUserHandle (hRect);

m_pRasterAnn->AnnHandle->ContainerX = RectLeft + (RectWidth / 2);
m_pRasterAnn->AnnHandle->ContainerY = RectTop + RectHeight;
}
else
{
MessageBox (TEXT("Annotation object must be a rectangle"));
}
}


AnnAdjustPoint example for C++ 5 and later

void CTutorDlg::ExampleAnnAdjustPoint(long hObject,double AnchorX , double AnchorY, double MoveX ,double MoveY )
{
double Angle;

Angle = m_pRasterAnn->AnnGetAngle(hObject);

m_pRasterAnn->AnnAdjustPoint(AnchorX, AnchorY, MoveX, MoveY, Angle, ANN_ADJUST_HORIZONTAL);
}


AnnAutoCursor example for C++ 5 and later

// This sample swaps the Default and Move annotation cursors
void CAnnSample2Dlg::SampleAnnAutoCursors(void )
{
IPictureDisp * phCursorMove ;
IPictureDisp * phCursorDefault ;

// Get copy of original cursors
phCursorDefault = m_pRasterAnn->GetAnnAutoCursor(ANN_AUTOCURSOR_DEFAULT);
phCursorMove = m_pRasterAnn->GetAnnAutoCursor(ANN_AUTOCURSOR_MOVE);

// Change
m_pRasterAnn->put_AnnAutoCursor(ANN_AUTOCURSOR_DEFAULT,phCursorMove);
m_pRasterAnn->put_AnnAutoCursor(ANN_AUTOCURSOR_MOVE, phCursorDefault);

}


AnnAutoDialogFontSize Example for Visual C++ 5.0

AnnAutoDialogFontSize Example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example will set the dialog fonts to use Courier 15
void CTutorDlg::OnAnnAutoDialogFontSize()
{
m_pRasterAnn->AnnSetAutoText (ANN_AUTOTEXT_DIALOG_FONT, "Courier New");
m_pRasterAnn->PutAnnAutoDialogFontSize(15);
}


AnnAutoDrawEnable Example for Visual C++ 5.0

AnnAutoDrawEnable Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the AnnAutoDrawEnable property.
void CTutorDlg::OnButtonAnnautodrawenable()
{
CString strMsg;
short bEnable;

bEnable = m_pRasterAnn->GetAnnAutoDrawEnable();
m_pRasterAnn->PutAnnAutoDrawEnable(!bEnable);
strMsg.Format(TEXT("AnnAutoDrawEnable: %s"), m_pRasterAnn->GetAnnAutoDrawEnable()? TEXT("TRUE") : TEXT("FALSE")); //VARIANT_TRUE
AfxMessageBox(strMsg);
}


AnnAutoHilightPen Example for Visual C++ 5.0

AnnAutoHilightPen Example for C++ 5.0 and later

m_pRasterAnn->PutAnnAutoHilightPen(RGB(0xC0, 0xC0, 0xC0));


AnnAutomation Property Example for Visual C++ 5.0

AnnAutomation Property Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example shows how you can use the AnnAutomation property to
//access the automation object through API functions.
//You must link to the ltann_n.lib import lib
#include "e:\\lead14\\dll\\include\\l_bitmap.h"
void CTutorDlg::OnButtonAnnautomation()
{
int nRet;
unsigned int bIsBold; /* Is the object's text bold */
HANDLE hAnnObject;
hAnnObject = (HANDLE)m_pRasterAnn->GetAnnAutomation();

//Toggle the default font bold property
L_AnnGetFontBold(hAnnObject, &bIsBold);
if (bIsBold)
AfxMessageBox(TEXT("Removing bold"));
else
AfxMessageBox(TEXT("Making bold"));

nRet = L_AnnSetFontBold(hAnnObject, !bIsBold, 0);
if (nRet != SUCCESS)
{
AfxMessageBox(TEXT("L_AnnSetFontBold failed"));
}
}


AnnAutoMenuEnable Example for Visual C++ 5.0

AnnAutoMenuEnable Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

This example toggles the AnnAutoMenuEnable property.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the AnnAutoMenuEnable property
void CTutorDlg::OnButtonAnnautomenuenable()
{
CString strMsg;

VARIANT_BOOL bEnable;;
bEnable = m_pRasterAnn->GetAnnAutoMenuEnable();
m_pRasterAnn->PutAnnAutoMenuEnable(!bEnable);
bEnable = m_pRasterAnn->GetAnnAutoMenuEnable();
strMsg.Format(TEXT("AnnAutoMenuEnable is now %s"), bEnable == VARIANT_TRUE ? TEXT("True") : TEXT("False"));
AfxMessageBox(strMsg);
}


AnnAutoSnapCursor example for Visual C++

// The following example toggles the automation cursor snap state.
// The cursor snap state affects whether the cursor snaps to a container border
// when creating annotations by clicking outside the annotation container.
void CAnnCOMView::ExampleAnnSetAutoSnapCursor()
{
int nRet = 0;
BOOL bSnap = FALSE;
CString strMsg;

bSnap = m_pltAnn->AnnAutoSnapCursor;
m_pltAnn->AnnAutoSnapCursor = !bSnap;

strMsg.Format(TEXT("Automation Snap Cursor State changed from %s to %s"),
!bSnap ? TEXT("TRUE") : TEXT("FALSE"),
m_pltAnn->AnnAutoSnapCursor ? TEXT("TRUE") : TEXT("FALSE"));

MessageBox(strMsg, TEXT("Notice"), MB_OK);
}


AnnBoundingRect Example for Visual C++ 5.0

AnnBoundingRect... Example for Visual C++

ILEADRasterVariant * pltRasVarX = NULL;
ILEADRasterVariant * pltRasVarY = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarX);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarY);

pltRasVarX->Type = VALUE_ARRAY_FLOAT;
pltRasVarY->Type = VALUE_ARRAY_FLOAT;

pltRasVarX->ItemCount = 4;
pltRasVarY->ItemCount = 4;

long hObj = m_pRasterAnn->AnnCreateItem(m_pRasterAnn->GetAnnContainer(), ANN_OBJECT_PROTRACTOR, TRUE);
long hObj2 = m_pRasterAnn->AnnCreateItem (m_pRasterAnn->GetAnnContainer (), ANN_OBJECT_POLYGON, TRUE);
pltRasVarX->LongItemValue (1) = 10;
pltRasVarX->LongItemValue (2) = 100;
pltRasVarX->LongItemValue (3) = 200;
pltRasVarY->LongItemValue (1) = 20;
pltRasVarY->LongItemValue (2) = 200;
pltRasVarY->LongItemValue (3) = 100;
m_pRasterAnn->AnnSetPoints(hObj, pltRasVarX, pltRasVarY, 3);
pltRasVarX->LongItemValue (0) = 50;
pltRasVarY->LongItemValue (0) = 220;
m_pRasterAnn->AnnSetPoints(hObj2, pltRasVarX, pltRasVarY, 4);
m_pRasterAnn->AnnSetFillMode(hObj2, ANN_FILLMODE_OPAQUE, FALSE);
CString msg;
m_pRasterAnn->AnnBringToFront (hObj2);
msg.Format(TEXT("Polygon Area:%d\nProtractor Angle:%f"), m_pRasterAnn->AnnGetArea (hObj2), (double)m_pRasterAnn->AnnGetAngle (hObj));
::MessageBox(NULL, msg, TEXT("Brought Polygon to front"), MB_OK);
m_pRasterAnn->AnnSendToBack (hObj2);
msg.Format(TEXT("Protractor Bounding Rectangle, Left:%f, Top:%f, Width:%f, Height:%f") ,
(double)m_pRasterAnn->GetAnnBoundingRectLeft(hObj),
(double)m_pRasterAnn->GetAnnBoundingRectTop(hObj),
(double)m_pRasterAnn->GetAnnBoundingRectWidth(hObj),
(double)m_pRasterAnn->GetAnnBoundingRectHeight(hObj));
::MessageBox(NULL, msg, TEXT("Sent Polygon to back"), MB_OK);
m_pRasterAnn->AnnCut(hObj2, ANN_FMT_WMF, FALSE, TRUE);

pltRasVarX->Release ();
pltRasVarY->Release ();


AnnCalibrateRuler example for Visual C++

// The following example calibrates a ruler object (hObject)
// so that it measures 10 inches with a DPI ratio of 1:1.
// Note that hObject must be of type ANNOBJECT_RULER.
// It then sets this calibration to ALL ruler objects
// (ANNOBJECT_RULER, ANNOBJECT_POLYRULER, ANNOBJECT_CROSSPRODUCT, ANNOBJECT_PROTRACTOR)
// in the container:
int CAnnCOMView::ExampleAnnCalibrateRuler()
{
int nRet = 0;
long lObjectType = 0;
double dDpiX = 0;
double dDpiY = 0;
long hObjectRuler =0;

nRet = m_pltAnn->AnnCreate(ANN_OBJECT_RULER, TRUE, TRUE);
hObjectRuler = m_pltAnn->GetAnnObject();
m_pltAnn->AnnDefine(hObjectRuler, 0, 0, ANN_DEFINE_BEGINSET);
m_pltAnn->AnnDefine(hObjectRuler, 100, 100, ANN_DEFINE_END);

nRet = m_pltAnn->AnnGetType(hObjectRuler);
if (nRet != 0)
return nRet;

lObjectType = m_pltAnn->AnnType;
if (lObjectType!= ANN_OBJECT_RULER)
{
MessageBox(TEXT("Error: AnnCalibrateRuler only works on ANN_OBJECT_RULER objects"), TEXT("Error"), MB_OK);
return 0;
}

nRet = m_pltAnn->AnnCalibrateRuler(hObjectRuler, 10, ANN_UNIT_INCHES, 1.0);
if (nRet != 0)
return nRet;

MessageBox(TEXT("Ruler has been calibrated to have a length of 10 inches. Now all existing and newly created ruler objects will be matched to this calibration."), TEXT("Error"), MB_OK);

dDpiX = m_pltAnn->AnnGetBitmapDpiX(hObjectRuler);
dDpiY = m_pltAnn->AnnGetBitmapDpiY(hObjectRuler);

//Match calibration to existing objects in container
m_pltAnn->AnnSetBitmapDpiX(hObjectRuler, (float)dDpiX, FALSE);
m_pltAnn->AnnSetBitmapDpiY(hObjectRuler, (float)dDpiY, FALSE);

//Set automation defaults so that all newly created objects have this calibration
m_pltAnn->AnnSetBitmapDpiX(m_pltAnn->AnnAutomation, (float)dDpiX, FALSE);
m_pltAnn->AnnSetBitmapDpiY(m_pltAnn->AnnAutomation, (float)dDpiY, FALSE);

return 0;
}


AnnChange example for Visual C++ 5.0

AnnChange example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//This example tests the AnnChange event.
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnChange(long hAnnObject)
{
CString strMsg;
long nTag=0;

m_pDlg->m_pRasterAnn->AnnGetTag(hAnnObject);
nTag = m_pDlg->m_pRasterAnn->GetAnnTag();
strMsg.Format(TEXT("AnnChange: This is a change for the button tagged %d"), nTag);
AfxMessageBox(strMsg);
}


AnnChangeUserHandle example for C++ 5 and later

//' This example changes the first user handle of an object by
//' * moving the handle ten pixels to the left,
//' * changing the color of handle to blue,
//' * changing the shape of the handle to square and
//' * displays the hour glass cursor when the mouse is over the handle.

void CTutorDlg::ExampleAnnChangeUserHandle(long hObject)
{
long Count ;

m_pRasterAnn->AnnGetUserHandles (hObject);
Count = m_pRasterAnn->UserHandleCount;

if( Count > 0 )
{
m_pRasterAnn->AnnGetUserHandle(hObject, 0);

m_pRasterAnn->AnnHandle->ContainerX = m_pRasterAnn->AnnHandle->ContainerX + 10;
m_pRasterAnn->AnnHandle->FillColor = RGB(0, 0, 255);
m_pRasterAnn->AnnHandle->Shape = ANN_HANDLE_SHAPE_SQUARE;
m_pRasterAnn->AnnHandle->Flags = (ANN_HANDLE_FILL_COLOR |
ANN_HANDLE_SHAPE |
ANN_HANDLE_LOCATION);

m_pRasterAnn->AnnChangeUserHandle(hObject, 0);
}
else
MessageBox(TEXT("No User Handle"));

}


AnnContainer example for Visual C++ 5.0

AnnContainer example for C++ 5.0 and later

//This sample is from the COM MFC ODBC database sample program
//For more information, see the examples/com/Msvc5/db folder
void CLtcdbView::InitAnnotation()
{
CLtcdbApp * pTheApp = (CLtcdbApp * )AfxGetApp();
CLEADRaster LTRas = m_RasterView.GetRaster();

short iRet = LTRas.CreateBitmap(1, 1, 1);
LTRas.SetScaleMode(SCALEMODE_PIXEL);

IDispatch *pDispatch=NULL;
(m_RasterView.GetControlUnknown())->QueryInterface(IID_IDispatch, (void**)&pDispatch);

pTheApp->m_pRasterAnn->PutAnnParentRasterView(pDispatch);
pTheApp->m_pRasterODBC->PutAnnContainer(pTheApp->m_pRasterAnn->GetAnnContainer());
if(pDispatch)
pDispatch->Release();
pTheApp->m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
pTheApp->m_pRasterAnn->PutAnnTool(ANN_TOOL_SELECT);
}


AnnDataPath example for Visual C++ 5.0

AnnDataPath example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example shows how to load an annotation file from the Internet.
void CTutorDlg::OnButtonAnndatapath()
{
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_RUN);
m_pRasterAnn->AnnDataPath("http://www.leadtools.com/images/test.ann");
}


AnnDefine2 example for C++ 5 and later

//'This example uses static variables to simulate user input to
//'rotate/resize a rectangle around a point on the bottom center line of the rectangle
//'Intially the rectangle must not be rotated.
void CTutorDlg::ExampleAnnDefine2(long hObject)
{
long hContainer ;
AnnObjectType ObjectType ;
double Angle ;
long CallCount=0;
double RectTop ;
double RectLeft ;
double RectWidth ;
double RectHeight;
double RectRight ;
double RectBottom;

double AnchorX ;
double AnchorY;
double MoveX;
double MoveY;
double AnnPointX;
double AnnPointY;

m_pRasterAnn->AnnGetType (hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_RECT )
MessageBox (TEXT("This Object is not Rect Object"));

Angle = m_pRasterAnn->GetAnnRotateAngle(hObject);

if (Angle != 0 )
MessageBox (TEXT("Object must not be rotated"));

CallCount = CallCount + 1;
switch (CallCount)
{
case 1:
RectTop = m_pRasterAnn->GetAnnRectTop(hObject);
RectLeft = m_pRasterAnn->GetAnnRectLeft(hObject);
RectWidth = m_pRasterAnn->GetAnnRectWidth(hObject);
RectHeight = m_pRasterAnn->GetAnnRectHeight(hObject);

RectRight = RectWidth + RectLeft;
RectBottom = RectHeight + RectTop;

AnchorX = (RectLeft + RectRight) / 2;
AnchorY = RectBottom;

AnnPointX = (RectLeft + RectRight) / 2;
AnnPointY = RectTop;

m_pRasterAnn->AnnDefine2(hObject, AnchorX, AnchorY, ANN_DEFINE_SETANCHORPOINT);
m_pRasterAnn->AnnDefine2(hObject, AnnPointX, AnnPointY, ANN_DEFINE_BEGINMOVEPOINT);

case 2:

RectTop = m_pRasterAnn->GetAnnRectTop(hObject);
RectLeft = m_pRasterAnn->GetAnnRectLeft(hObject);
RectWidth = m_pRasterAnn->GetAnnRectWidth(hObject);
RectHeight = m_pRasterAnn->GetAnnRectHeight(hObject);
RectRight = RectWidth + RectLeft;
RectBottom = RectHeight + RectTop;

m_pRasterAnn->PointsCount = 1;
m_pRasterAnn->ContainerPointX = RectRight;
m_pRasterAnn->ContainerPointY = RectTop;

hContainer = m_pRasterAnn->AnnGetContainer(hObject);

m_pRasterAnn->AnnConvert(hContainer, ANN_CONVERT_TO_CLIENT);

m_pRasterAnn->PointIndex = 0;
MoveX = m_pRasterAnn->ClientPointX;
MoveY = m_pRasterAnn->ClientPointY;
m_pRasterAnn->AnnDefine2(hObject, MoveX, MoveY, ANN_DEFINE_END);

CallCount = 0;
}
}


AnnDeletePage Example for Visual C++ 5.0

AnnDeletePage Example for Visual C++

//This sample saves the annotations as the first page of a multipage annotation file
//The annotations are flipped, and saved as the second page
//The annotations are rotated, and saved as the third page
//Information is displayed about the annotation file
//The second page is deleted, and information is again displayed about the annotation file
int nRet;
TCHAR *pszFormat;
CString strMsg;

//Save as the first page of the annotation file
m_pRasterAnn->AnnSave ("C:\\temp\\Test.ann", ANN_FMT_ENCODED, FALSE, SAVE_OVERWRITE, 0);

//Flip the container, and save as the second page (insert before page 2)
m_pRasterAnn->AnnFlip (TRUE, m_RasterView1.GetRaster ().GetBitmapHeight () / 2, FALSE);
m_pRasterAnn->AnnSave ("C:\\temp\\Test.ann", ANN_FMT_ENCODED, FALSE, SAVE_INSERT, 2);

//Rotate the container, and save as the third page
//Here we could pass the SAVE_INSERT flag and 3 for nPage,
//but instead we will use the SAVE_APPEND flag
m_pRasterAnn->AnnRotate (FALSE, m_RasterView1.GetRaster().GetBitmapWidth ()/ 2, m_RasterView1.GetRaster().GetBitmapHeight ()/ 2, 45, FALSE);
m_pRasterAnn->AnnSave ("C:\\temp\\Test.ann", ANN_FMT_ENCODED, FALSE, SAVE_APPEND, 0);

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfo ("C:\\temp\\Test.ann");
if (nRet == 0)
{
switch(m_pRasterAnn->GetAnnInfoFormat ())
{
case ANN_FMT_NATIVE:
pszFormat = TEXT("ANN_FMT_NATIVE");
break;
case ANN_FMT_WMF:
pszFormat = TEXT("ANN_FMT_WMF");
break;
case ANN_FMT_ENCODED:
pszFormat = TEXT("ANN_FMT_ENCODED");
break;
default:
pszFormat = TEXT("Unknown");
break;
}

strMsg.Format(TEXT("File: %s\nFormat: %s\nVersion: %d\nTotal Pages: %d\n"),
TEXT("C:\\temp\\Test.ann"),
pszFormat,
m_pRasterAnn->GetAnnInfoVersion (),
m_pRasterAnn->GetAnnInfoTotalPages ()
);

MessageBox(strMsg);
}
else
{
MessageBox(TEXT("Invalid Annotation File: C:\\temp\\Test.ann"));
}

//Now delete the second page, and display information
m_pRasterAnn->AnnDeletePage ("C:\\temp\\Test.ann", 2);

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfo ("C:\\temp\\Test.ann");
if (nRet == 0)
{
switch(m_pRasterAnn->GetAnnInfoFormat ())
{
case ANN_FMT_NATIVE:
pszFormat = TEXT("ANN_FMT_NATIVE");
break;
case ANN_FMT_WMF:
pszFormat = TEXT("ANN_FMT_WMF");
break;
case ANN_FMT_ENCODED:
pszFormat = TEXT("ANN_FMT_ENCODED");
break;
default:
pszFormat = TEXT("Unknown");
break;
}

strMsg.Format(TEXT("File: %s\nFormat: %s\nVersion: %d\nTotal Pages: %d\n"),
TEXT("C:\\temp\\Test.ann"),
pszFormat,
m_pRasterAnn->GetAnnInfoVersion (),
m_pRasterAnn->GetAnnInfoTotalPages ()
);

MessageBox(strMsg);

}
else
{
MessageBox(TEXT("Invalid Annotation File: C:\\temp\\Test.ann"));
}


AnnDeletePageArray Example for Visual C++ 5.0

AnnDeletePageArray Example for Visual C++

//This sample saves the annotations as the first page of a multipage annotation file in memory
//The annotations are flipped, and saved as the second page
//The annotations are rotated, and saved as the third page
//Information is displayed about the annotation file
//The second page is deleted, and information is again displayed about the annotation file
int nRet;
CString strFormat;
CString strMsg;
VARIANT AnnVariant;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

AnnFMTConstants nFormat = ANN_FMT_NATIVE;

//Save as the first page of the annotation file
nRet = m_pRasterAnn->AnnSaveArray(nFormat, FALSE, pltRasVar, SAVE_OVERWRITE, 0);

//Flip the container, and save as the second page (insert before page 2)
m_pRasterAnn->AnnFlip(TRUE, m_RasterView1.GetRaster ().GetBitmapHeight() / 2, FALSE);
nRet = m_pRasterAnn->AnnSaveArray (nFormat, FALSE, pltRasVar, SAVE_INSERT, 2);

//Rotate the container, and save as the third page
//Here we could pass the SAVE_INSERT flag and 3 for nPage,
//but instead we will use the SAVE_APPEND flag
m_pRasterAnn->AnnRotate (FALSE, m_RasterView1.GetRaster ().GetBitmapWidth () / 2, m_RasterView1.GetRaster ().GetBitmapHeight () / 2, 45, FALSE);
m_pRasterAnn->AnnSaveArray (nFormat, FALSE, pltRasVar, SAVE_APPEND, 0);

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfoArray (pltRasVar);
if (nRet == 0)
{
switch (m_pRasterAnn->GetAnnInfoFormat())
{
case ANN_FMT_NATIVE:
strFormat = TEXT("ANN_FMT_NATIVE");
break;

case ANN_FMT_WMF:
strFormat = TEXT("ANN_FMT_WMF");
break;

case ANN_FMT_ENCODED:
strFormat = TEXT("ANN_FMT_ENCODED");
break;

default:
strFormat = TEXT("Unknown");
break;
}
strMsg.Format(TEXT("Format: %s\nVersion: %d\nTotal Pages: %d\n"),
strFormat,
m_pRasterAnn->GetAnnInfoVersion(),
m_pRasterAnn->GetAnnInfoTotalPages()
);

MessageBox(strMsg);
}

else
{
MessageBox(TEXT("Invalid Annotation Memory File"));
}
//Now delete the second page, and display information
m_pRasterAnn->AnnDeletePageArray(pltRasVar, 2);

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfoArray(pltRasVar);
if (nRet == 0)
{
switch (m_pRasterAnn->GetAnnInfoFormat())
{
case ANN_FMT_NATIVE:
strFormat = TEXT("ANN_FMT_NATIVE");
break;

case ANN_FMT_WMF:
strFormat = TEXT("ANN_FMT_WMF");
break;

case ANN_FMT_ENCODED:
strFormat = TEXT("ANN_FMT_ENCODED");
break;

default:
strFormat = TEXT("Unknown");
break;
}
strMsg.Format(TEXT("Format: %s\nVersion: %d\nTotal Pages: %d\n"),
strFormat,
m_pRasterAnn->GetAnnInfoVersion (),
m_pRasterAnn->GetAnnInfoTotalPages ()
);

MessageBox(strMsg);
}
else
{
MessageBox(TEXT("Invalid Annotation Memory File"));
}

pltRasVar->Release ();


AnnDeletePageMemory Example for Visual C++ 5.0

AnnDeletePageMemory Example for Visual C++

//This sample saves the annotations as the first page of a multipage annotation file in memory
//The annotations are flipped, and saved as the second page
//The annotations are rotated, and saved as the third page
//Information is displayed about the annotation file
//The second page is deleted, and information is again displayed about the annotation file

int nRet;
CString strFormat;
CString strMsg;
long lSize, nHandle;

//Save as the first page of the annotation file
nHandle = 0;
m_pRasterAnn->AnnSaveMemory (&nHandle, ANN_FMT_NATIVE, FALSE, &lSize, SAVE_OVERWRITE, 0);

//Flip the container, and save as the second page (insert before page 2)
m_pRasterAnn->AnnFlip (TRUE, m_RasterView1.GetRaster().GetBitmapHeight() / 2, FALSE);
m_pRasterAnn->AnnSaveMemory (&nHandle, ANN_FMT_NATIVE, FALSE, &lSize, SAVE_INSERT, 2);

//Rotate the container, and save as the third page
//Here we could pass the SAVE_INSERT flag and 3 for nPage,
//but instead we will use the SAVE_APPEND flag
m_pRasterAnn->AnnRotate (FALSE, m_RasterView1.GetRaster ().GetBitmapWidth () / 2, m_RasterView1.GetRaster ().GetBitmapHeight () / 2, 45, FALSE);
m_pRasterAnn->AnnSaveMemory (&nHandle, ANN_FMT_NATIVE, FALSE, &lSize, SAVE_APPEND, 0);

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfoMemory ((long)nHandle, lSize);
if (nRet == 0)
{
switch (m_pRasterAnn->GetAnnInfoFormat ())
{
case ANN_FMT_NATIVE:
strFormat = TEXT("ANN_FMT_NATIVE");
break;

case ANN_FMT_WMF:
strFormat = TEXT("ANN_FMT_WMF");
break;

case ANN_FMT_ENCODED:

strFormat = TEXT("ANN_FMT_ENCODED");
break;

default:
strFormat = TEXT("Unknown");
break;
}
strMsg.Format(TEXT("Format: %s\nVersion: %d\nTotal Pages: %d\nTotal Size: %d\n"),
strFormat,
m_pRasterAnn->GetAnnInfoVersion (),
m_pRasterAnn->GetAnnInfoTotalPages (),
lSize);

MessageBox(strMsg);
}

else
{
MessageBox(TEXT("Invalid Annotation Memory File"));
}

//Now delete the second page, and display information
m_pRasterAnn->AnnDeletePageMemory ((long)nHandle, 2);
lSize = m_pRasterAnn->GetAnnPageMemorySize();

//Verify contents of file
nRet = m_pRasterAnn->AnnFileInfoMemory ((long)nHandle, lSize);
if (nRet == 0)
{
switch (m_pRasterAnn->GetAnnInfoFormat ())
{
case ANN_FMT_NATIVE:
strFormat = TEXT("ANN_FMT_NATIVE");
break;

case ANN_FMT_WMF:
strFormat = TEXT("ANN_FMT_WMF");
break;

case ANN_FMT_ENCODED:
strFormat = TEXT("ANN_FMT_ENCODED");
break;

default:
strFormat = TEXT("Unknown");
break;
}
strMsg.Format(TEXT("Format: %s\nVersion: %d\nTotal Pages: %d\nTotal Size: %d\n"),
strFormat,
m_pRasterAnn->GetAnnInfoVersion (),
m_pRasterAnn->GetAnnInfoTotalPages (),
lSize);

MessageBox(strMsg);
}

else
{
MessageBox(TEXT("Invalid Annotation Memory File"));
}


AnnDeleteUserHandle example for C++ 5 and later

//'This examples deletes the first user handle of an object
void CTutorDlg::ExampleAnnDeleteUserHandle(long hObject)
{
long Count;

m_pRasterAnn->AnnGetUserHandles(hObject);
Count = m_pRasterAnn->UserHandleCount;

if (Count > 0 )
m_pRasterAnn->AnnDeleteUserHandle (hObject, 0);
else
MessageBox(TEXT("No User Handle"));

}


AnnDestroy example for Visual C++ 5.0

AnnDestroy example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example destroys the selected objects in an annotation container.
void CTutorDlg::OnButtonAnndestroy()
{
long hAnnContainer = NULL;
hAnnContainer = m_pRasterAnn->GetAnnContainer();
m_pRasterAnn->AnnDestroy(hAnnContainer, ANN_FLAG_RECURSE | ANN_FLAG_SELECTED);

}


AnnEnableZoomView Example for C++ 5.0 and later

ZoomWave Example for C++ 5.0 and later

ILEADRasterAnnotation * pRasterAnn = NULL;
void CDemo::OnCreateZoomView()
{
ILEADRasterIO
 * pRasterIO = NULL;
ILEADRasterZoomView
 * pZoomView;
HRESULT
 hr = CoCreateInstance(
CLSID_LEADRasterZoomView,
NULL,
CLSCTX_ALL,
IID_ILEADRasterZoomView,
(void**)&pZoomView
);
hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);
hr = CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&pRasterAnn
);
//L_KEY_DOCUMENT
 represents the unlock support string
m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT,
 L_KEY_DOCUMENT);
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\Ann.tif"),
 0, 0, 1);
m_RasterView.SetPaintSizeMode(PAINTSIZEMODE_FIT);
IDispatch
 *pDispatch = NULL;
(m_RasterView.GetControlUnknown())->QueryInterface(IID_IDispatch,
 (void**)&pDispatch);
if(pDispatch==NULL)
return
 ;

pRasterAnn->PutAnnParentRasterView(pDispatch);
pRasterAnn->AnnUserMode = ANN_USERMODE_RUN;
pRasterAnn->AnnEnableZoomView
 = TRUE;
pRasterAnn->AnnLoad("c:\\Ann.tif",0);
pZoomView->SrcLeft
 = 0;
pZoomView->SrcTop =
 0;
pZoomView->SrcWidth
 = 100*100;
pZoomView->SrcHeight
 = 100*100;
pZoomView->DstTop =
 100*100;
pZoomView->DstLeft
 = 100*100;
pZoomView->DstWidth
 = 200*100;
pZoomView->DstHeight
 = 200*100;
pZoomView->BorderStyle
 = ZOOM_VIEW_BORDERSTYLE_3D;
pZoomView->SrcBorderStyle = SOURCE_BORDERSTYLE_3D;
pZoomView->ZoomFactor = 200;
pZoomView->Enabled
 = TRUE;
pZoomView->ForceDst = TRUE;
pZoomView->AnnContainer
 = pRasterAnn->AnnContainer;
m_RasterView.CreateZoomView(pZoomView);
pZoomView->Release();
pRasterIO->Release();
}


AnnEncryptApply example for C++ 5 and later

// This example takes a handle to an annotation object that is an encryptor, and does the following
//' 1. Verifies that it is an encryptor that is associated with a bitmap
//' 2. changes the key to 123
//' 3. Applies the encryptor so that it changes state to a decryptor
//' 4. Prompts the user to continue
//' 5. Removes the scrambling by applying the decryptor

void CTutorDlg::ExampleEncrypter(long hObject)
{
AnnObjectType ObjectType;
L_INT nRet;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_ENCRYPT)
MessageBox (TEXT("This Object is not an Encrypt Object"));

m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_ALL;
m_pRasterAnn->AnnGetEncryptOptions (hObject);

if (m_pRasterAnn->AnnEncryptOptions->EncryptRaster == NULL)
{
MessageBox(TEXT("The encrypt object is not associated with a bitmap."));
Return ;
}

if (m_pRasterAnn->AnnEncryptOptions->EnableEncryptor == FALSE)
MessageBox(TEXT("This object is a decryptor"));

m_pRasterAnn->AnnEncryptOptions->Key = 123;
m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_KEY;
m_pRasterAnn->AnnEncryptOptions->EnableSaveDecryptorKey = TRUE;
m_pRasterAnn->AnnEncryptOptions->EnableSaveEncryptorKey = TRUE;
m_pRasterAnn->AnnEncryptOptions->EnableClearDecryptorKey = TRUE;
m_pRasterAnn->AnnEncryptOptions->EnableClearEncryptorKey = TRUE;
m_pRasterAnn->AnnEncryptOptions->EnableNeverEncrypted = FALSE;
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnSetEncryptOptions(hObject);

m_pRasterAnn->AnnEncryptApply(hObject, ANN_ENCRYPTAPPLY_ENCRYPTOR);

nRet = MessageBox(TEXT("Encryptor has been applied-> Would you like to remove the encryption?"), TEXT(""), MB_YESNO);

if (nRet == IDYES)
m_pRasterAnn->AnnEncryptApply (hObject, ANN_ENCRYPTAPPLY_DECRYPTOR);
}


AnnEnumerate example for Visual C++ 5.0

AnnEnumerate example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example causes the AnnEnumerate event to get fired for all annotations in the container
//For details on implementing events, please refer to the tutorial: Creating and Using Annotations (C++ 5.0 and later)
void CTutorDlg::OnButtonAnnenumerate()
{
m_pRasterAnn->AnnEnumerate(m_pRasterAnn->GetAnnContainer(), ANN_FLAG_RECURSE | ANN_FLAG_NOTTHIS, "");
}

void CRasterAnnSink::OnAnnEnumerate(long hObject)
{
CString strMsg;
strMsg.Format(TEXT("Annotation Handle %x"), hObject);
AfxMessageBox(strMsg);
}


AnnEnumerateHandle example for C++ 5 and later

//'This example enumerates all handles of an object,
//'changing the predefined handles to blue squares
//'and the user handles to red circles.
void CTutorDlg::ExampleAnnEnumerateHandles(long hObject)
{
m_pRasterAnn->EnableFireEnumerateHandleEvent = TRUE;
m_pRasterAnn->AnnEnumerateHandle(hObject);
}

void CRasterAnnSink::OnEnumerateHandle(long hObject, ILEADRasterAnnHandleInfo AnnHandleInfo)
{
AnnHandleInfo.EnableVisible = TRUE;

if (AnnHandleInfo.Type == ANN_HANDLE_TYPE_DEFAULT_HANDLE)
{
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_SQUARE;
AnnHandleInfo.FillColor = RGB(0, 0, 255);
AnnHandleInfo.PenColor = RGB(0, 255, 0);
AnnHandleInfo.ID = 100;
AnnHandleInfo.ClientX = 20;
AnnHandleInfo.ClientY = 20;
AnnHandleInfo.ContainerX = 100;
AnnHandleInfo.ContainerY = 100;
}
else
{
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_CIRCLE;
AnnHandleInfo.FillColor = RGB(0, 255, 0);
AnnHandleInfo.PenColor = RGB(0, 0, 255);
AnnHandleInfo.ID = 50;
AnnHandleInfo.ClientX = 10;
AnnHandleInfo.ClientY = 10;
AnnHandleInfo.ContainerX = 50;
AnnHandleInfo.ContainerY = 50;
}
CString str ;

str.format(TEXT("The handle with index = %d was updated"), AnnHandleInfo.Index);
messageBox(str);

str.format(TEXT("The Total number of handles = %d") , AnnHandleInfo.TotalHandles);
messageBox(str);

RasterAnn.StopFireEnumerateHandleEvent = FALSE;
}


AnnEnumerateTextToken example for C++ 5 and later

void CTutorDlg::ExampleAnnEnumerateTextTokenTable(long hObject)
{
m_pRasterAnn->EnableFireEnumerateTextTokenTableEvent = TRUE;
m_pRasterAnn->AnnEnumerateTextToken();
}

void CRasterAnnSink::OnEnumerateTextTokenTable(long nTextTokenCount , CString bstrToken , CString bstrDescription , CString bstrTokenString , AnnTokenTextType TokenType )
{
if (TokenType == ANN_TOKEN_TEXT )
{
bstrToken = TEXT("F");
bstrDescription = TEXT("Company Name");
bstrTokenString = TEXT("Your Company Name");
}
else
bstrDescription = TEXT("Not ANN_TOKEN_TEXT");

m_pRasterAnn->StopFireEnumerateTextTokenTableEvent = FALSE;
}


AnnFixed example for C++ 5 and later

void CTutorDlg::ExampleAnnFixed(long hObject)
{
VARIANT_BOOL bFixed;

bFixed = m_pRasterAnn->GetAnnFixed(hObject);

m_pRasterAnn->GetEnableAdjust = True

bFixed = !bFixed;

m_pRasterAnn->PutAnnFixed(hObject, bFixed);

if (bFixed == TRUE)
MessageBox(TEXT("Fixed"));
else
MessageBox(TEXT("Not Fixed"));

}


AnnGetAutoMenuItemEnable example for Visual C++ 5.0

AnnGetAutoMenuItemEnable example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example disables the "delete" menu item from the annotation hGlobalAnn.
void CTutorDlg::AnnGetAutoMenuItemEnable(long hGlobalAnn)
{
AnnMenuConstants iEnable;

m_pRasterAnn->AnnSetAutoMenuItemEnable(hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, "");
m_pRasterAnn->AnnGetAutoMenuItemEnable(hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE);
iEnable = m_pRasterAnn->GetAnnAutoMenuItemEnable();
switch (iEnable)
{
case ANN_MENU_ENABLED:
AfxMessageBox(TEXT("ANN_MENU_ENABLED"));
break;
case ANN_MENU_DISABLED:
AfxMessageBox(TEXT("ANN_MENU_DISABLED"));
break;
case ANN_MENU_DEFAULT:
AfxMessageBox(TEXT("ANN_MENU_DEFAULT"));
break;
}
}


AnnGetContainer Example for Visual C++ 5.0

AnnGetContainer Example for Visual C++

long hPin, h1, h2, hCont;
m_pRasterAnn->AnnCreate (ANN_OBJECT_CONTAINER, TRUE, FALSE);
hCont = m_pRasterAnn->GetAnnObject();

if(hCont != 0)
{
hPin = m_pRasterAnn->AnnCreateItem (hCont, ANN_OBJECT_PUSHPIN, FALSE);
h1 = m_pRasterAnn->AnnGetContainer (hCont);
h2 = m_pRasterAnn->AnnGetTopContainer (hPin);
if(h1 == h2 && h1 == m_pRasterAnn->GetAnnContainer ())
AfxMessageBox(TEXT("root container is same as that of m_pRasterAnn"));
}


AnnGetDistance2 example for C++ 5 and later

void CTutorDlg::ExampleAnnGetDistance2(long hObject)
{
AnnObjectType ObjectType ;
long Count ;
double TotalDis ;
long TotalRulerUnit;
long TotalSmartUnit;
double Distance;
long RulerUnit;
long SmartUnit;
CString szResult;
int i;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_RULER)
MessageBox(TEXT("This Object is not an RULER Object"));

m_pRasterAnn->AnnGetDistance2(hObject);

Count = m_pRasterAnn->DistanceCount;

TotalDis = m_pRasterAnn->GetTotalDistance();
TotalRulerUnit = m_pRasterAnn->GetTotalRulerUnit();
TotalSmartUnit = m_pRasterAnn->GetTotalSmartUnit();

szResult.Format(TEXT("Total Distance = %f \n\t Total Ruler Unit = %d \n\t Total Smart Unit = %d "), TotalDis, TotalRulerUnit, TotalSmartUnit);

MessageBox(szResult);

for(i = 0; i<Count;i++)
{
Distance = m_pRasterAnn->GetDistance(i);
RulerUnit = m_pRasterAnn->GetRulerUnit(i);
SmartUnit = m_pRasterAnn->GetSmartUnit(i);

szResult.Format(TEXT("Distance Index = %d \n\t Distance = %f \n\t Ruler Unit = %d \n\t Smart Unit = %d "),i, Distance, RulerUnit, SmartUnit);
MessageBox(szResult) ;
}
return 1;
}


AnnGetGrouping example for Visual C++ 5.0

AnnGetGrouping example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the 'group' state of all objects in the main container.
void CTutorDlg::OnButtonAnngetgrouping()
{
VARIANT_BOOL bGroup;

//Get current group state
bGroup = m_pRasterAnn->AnnGetGrouping (m_pRasterAnn->GetAnnContainer());

//Toggle the group state
m_pRasterAnn->AnnSetGrouping(m_pRasterAnn->GetAnnContainer(), !bGroup, 0);

//Display the group state
if (m_pRasterAnn->AnnGetGrouping(m_pRasterAnn->GetAnnContainer()))
AfxMessageBox(TEXT("Objects in AnnContainer are grouped"));
else
AfxMessageBox(TEXT("Objects in AnnContainer are not grouped"));
}


AnnGetHyperlinkParam example for Visual C++ 5.0

AnnGetHyperlinkParam example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example retrieves parameters using AnnGetHyperlinkParam.
//m_hGlobalAnn is the handle to a button annotation
void CTutorDlg::OnButtonAnnGethyperlinkparam()
{
CString strMsg;
long nParam0;
long nParam1;
long nParam2;
long nParam3;
long nParam4;

m_pRasterAnn->AnnSetHyperlinkMsg(m_hGlobalAnn, ANN_LINK_ANNEVENT5, 1, 2, 3, 4, 5);

m_pRasterAnn->AnnGetHyperlinkParam(m_hGlobalAnn, 0);
nParam0 = m_pRasterAnn->GetAnnHyperlinkParam();
m_pRasterAnn->AnnGetHyperlinkParam (m_hGlobalAnn, 1);
nParam1 = m_pRasterAnn->GetAnnHyperlinkParam();
m_pRasterAnn->AnnGetHyperlinkParam (m_hGlobalAnn, 2);
nParam2 = m_pRasterAnn->GetAnnHyperlinkParam();
m_pRasterAnn->AnnGetHyperlinkParam (m_hGlobalAnn, 3);
nParam3 = m_pRasterAnn->GetAnnHyperlinkParam();
m_pRasterAnn->AnnGetHyperlinkParam (m_hGlobalAnn, 4);
nParam4 = m_pRasterAnn->GetAnnHyperlinkParam();

strMsg.Format(TEXT("HyperlinkParams: %d %d %d %d %d"), nParam0, nParam1, nParam2, nParam3, nParam4);
AfxMessageBox(strMsg);
}


AnnGetHyperlinkString example for Visual C++ 5.0

AnnGetHyperlinkString example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This examples assumes that hGlobalAnn is a handle to a button annotation.
//A hyperlink string is set and retrieved
//m_hGlobalAnn is the handle to a button annotation
void CTutorDlg::OnButtonAnngethyperlinkstring()
{
BSTR bstrHyperlink;
CString strHyperLink;

m_pRasterAnn->AnnSetHyperlinkString(m_hGlobalAnn, ANN_LINK_WEBPAGE, "http://www.leadtools.com");
m_pRasterAnn->AnnGetHyperlinkString(m_hGlobalAnn);
bstrHyperlink = m_pRasterAnn->GetAnnHyperlinkString();

strHyperLink = bstrHyperlink;
::SysFreeString(bstrHyperlink);
AfxMessageBox(strHyperLink);
}


AnnGetNameOffsetX Example for Visual C++ 5.0

AnnGetNameOffsetX Example for Visual C++

//This sample shifts the NameOffset of the annotation object hObject
//two pixels in the X direction and one pixel in the Y direction
long lOffsetX;
long lOffsetY;
CString strMsg;
lOffsetX = m_pRasterAnn->AnnGetNameOffsetX (hObject);
lOffsetY = m_pRasterAnn->AnnGetNameOffsetY (hObject);

lOffsetX += 2;
lOffsetY += 1;

strMsg.Format(TEXT("Shifting Name Offset to %d, %d"), lOffsetX, lOffsetY);
MessageBox(strMsg);

m_pRasterAnn->AnnSetNameOffsetX (hObject, lOffsetX, FALSE);
m_pRasterAnn->AnnSetNameOffsetY (hObject, lOffsetY, FALSE);


AnnGetNameRestrict Example for Visual C++ 5.0

AnnGetNameRestrict Example for Visual C++

//This sample toggles the bNameRestrict property of the annotation object hObject
BOOL bNameRestrict;
CString strMsg;

bNameRestrict = m_pRasterAnn->AnnGetNameRestrict (hObject);
bNameRestrict = !bNameRestrict;

if (bNameRestrict)
strMsg = TEXT("Changing NameRestrict property to TRUE");
else
strMsg = TEXT("Changing NameRestrict property to FALSE");

MessageBox(strMsg);
m_pRasterAnn->AnnSetNameRestrict (hObject, bNameRestrict, FALSE);


AnnGetObjectFromTag example for Visual C++ 5.0

AnnGetObjectFromTag example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example retrieves the annotation handle for any tag 'lTag'
void CTutorDlg::OnAnngetobjectfromtag(long lTag)
{
long hTagObject;
long lTagTest;
CString strMsg;

m_pRasterAnn->AnnGetObjectFromTag(m_pRasterAnn->GetAnnContainer(), lTag, FALSE);
hTagObject = m_pRasterAnn->GetAnnTagObject();

m_pRasterAnn->AnnGetTag(hTagObject);
lTagTest = m_pRasterAnn->GetAnnTag();
if (lTagTest == lTag)
strMsg.Format(TEXT("Annotation found with tag %x"), hTagObject);
else
strMsg.Format(TEXT("Annotation NOT found with tag %x"), hTagObject);
AfxMessageBox(strMsg);
}


AnnGetPoint example for Visual C++ 5.0

AnnGetPoint example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CRasterAnnSink::OnAnnDrawn(long hAnnObject)
{
AnnObjectType nType;
long i;
long nPoints; //number of points in the object
CString strMsg;
CString strTmp;
float x,y;
ILEADRasterVariant * pltRasVarX = NULL;
ILEADRasterVariant * pltRasVarY = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarX);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarY);

m_pDlg->m_pRasterAnn->AnnGetType(hAnnObject);
nType = m_pDlg->m_pRasterAnn->GetAnnType();
if (nType == ANN_OBJECT_POLYGON) //Is the object a polygon?
{
AfxMessageBox(TEXT("Object is a Polygon"));
m_pDlg->m_pRasterAnn->AnnGetPointCount(hAnnObject); //get the number of points
nPoints = m_pDlg->m_pLEADRasterAnn->getAnnPointCount();
m_pDlg->m_pRasterAnn->AnnGetPointX(hAnnObject, pltRasVarX); //get the X coordinates
m_pDlg->m_pRasterAnn->AnnGetPointY(hAnnObject, pltRasVarY); //get the Y coordinates

strMsg.Format(TEXT("The polygon points [%d] are: "), nPoints);

for (i=0; i<nPoints; i++)
{
x = pltRasVarX->FloatItemValue(i);
y = pltRasVarY->FloatItemValue(i);
strTmp.Format(TEXT("{%g,%g} "), x, y);
strMsg += strTmp;
}

strMsg += TEXT(")");
AfxMessageBox(strMsg);
}

pltRasVarX->Release ();
pltRasVarY->Release ();
}


AnnGetProtractorOptions Example for Visual C++ 5.0

AnnGetProtractorOptions example for Visual C++

float ArcRadius;'
VARIANT_BOOL bAcute;
short nUnit, nPrecision;
m_pRasterAnn->AnnGetProtractorOptions (hProt);
bAcute = m_pRasterAnn->GetAnnProtractorAcute();
nUnit = m_pRasterAnn->GetAnnProtractorUnit();
nPrecision = m_pRasterAnn->GetAnnProtractorPrecision();
ArcRadius = m_pRasterAnn->GetAnnProtractorArcRadius();
m_pRasterAnn->AnnSetProtractorOptions (hProt, !bAcute, 1 - nUnit + ANN_ANGLE_DEF_ABBR, "", (nPrecision + 1) % 5, ArcRadius, FALSE);
m_pRasterAnn->AnnSetShowFlags (hProt, (m_pRasterAnn->AnnGetShowFlags (hProt) + 1) % 4, FALSE);


AnnGetRgnHandle Example for Visual C++ 5.0

AnnGetRgnHandle example for Visual C++

m_RasterView2.GetRaster().SetRgnHandle (m_pRasterAnn->AnnGetRgnHandle (hPlgn), 1, 1, L_RGN_SET);
m_RasterView2.SetRgnFrameType (RGNFRAME_ANIMATED);


AnnGetRotateOptions example for Visual C++

// The following example toggles the display of
// rotate handles. If displaying rotate handles, the object
// is changed so that it does not display rotate handles.
// If not displaying rotate handles, the object is changed
// so that it displays rotate handles

int CAnnCOMView::ExampleAnnGetRotateOptions()
{
int nRet;
CString szMsg;
long hObject;

m_pltAnn-> AnnCreate (ANN_OBJECT_TEXT, TRUE, TRUE);
hObject = m_pltAnn-> GetAnnObject ();
 m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);

nRet = m_pltAnn-> AnnGetRotateOptions (hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES);
if (nRet != 0)
return nRet;

szMsg.Format(TEXT("Old State: AnnShowRotateHandles: %s"), m_pltAnn-> AnnShowRotateHandles ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(szMsg);

// Change the state
nRet = m_pltAnn-> AnnSetRotateOptions (hObject, !m_pltAnn->AnnShowRotateHandles, 0, ANN_ROTATE_SHOW_ROTATE_HANDLES, FALSE);
if (nRet != 0)
return nRet;

nRet = m_pltAnn->AnnGetRotateOptions(hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES);
if (nRet != 0)
return nRet;

szMsg.Format(TEXT("New State: AnnShowRotateHandles: %s"), m_pltAnn->AnnShowRotateHandles ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(szMsg);

return nRet;
}


AnnGetScalarX Example for Visual C++ 5.0

AnnGetScalarX example for Visual C++

long hCont;
m_pRasterAnn->AnnCreate (ANN_OBJECT_CONTAINER, FALSE, FALSE);
hCont = m_pRasterAnn->GetAnnObject();
CString msg2;
msg2.Format(TEXT("ScalarX: %f, ScalarY: %f, OffsetX: %f, OffsetY: %f"),
(double)m_pRasterAnn->AnnGetScalarX (hCont),
(double)m_pRasterAnn->AnnGetScalarY (hCont),
(double)m_pRasterAnn->AnnGetOffsetX (hCont),
(double)m_pRasterAnn->AnnGetOffsetY (hCont));
AfxMessageBox(msg2);
m_pRasterAnn->AnnSetScalarX (hCont, 1.5, FALSE);
m_pRasterAnn->AnnSetScalarY (hCont, 1.5, FALSE);
m_pRasterAnn->AnnSetOffsetX (hCont, 10, FALSE);
m_pRasterAnn->AnnSetOffsetY (hCont, 20, FALSE);
msg2.Format(TEXT("ScalarX: %f, ScalarY: %f, OffsetX: %f, OffsetY: %f"),
(double)m_pRasterAnn->AnnGetScalarX (hCont),
(double)m_pRasterAnn->AnnGetScalarY (hCont),
(double)m_pRasterAnn->AnnGetOffsetX (hCont),
(double)m_pRasterAnn->AnnGetOffsetY (hCont));
AfxMessageBox(msg2);


AnnGetSecondaryMetaFile example for C++ 5 and later

Void CTutorDlg::ExampleAnnGetSecondryMetafile(long hObject)
{

long hMetafile1;
long hMetafile2;
AnnObjectType nType;
L_BOOL bEncryptorOriginal;

m_pRasterAnn->AnnGetType(hObject);
nType = m_pRasterAnn->GetAnnType();

if(nType != ANN_OBJECT_ENCRYPT)
{
MessageBox(TEXT("this object is not an encryptor object"));
return 0;
}

hMetafile1 = m_pRasterAnn->AnnGetMetafile(hObject);
hMetafile2 = m_pRasterAnn->AnnGetSecondaryMetafile(hObject);

m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_ALL;
m_pRasterAnn->AnnGetEncryptOptions(hObject);

bEncryptorOriginal = m_pRasterAnn->AnnEncryptOptions->EnableEncryptor;

//Set state to Decryptor and set Decryptor metafile
m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_TYPE;
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = TRUE;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
m_pRasterAnn->AnnSetMetafile( hObject, hMetafile2, ANN_METAFILE_USER, FALSE);

//Set state to Decryptor and set Decryptor metafile
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = TRUE;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
m_pRasterAnn->AnnSetMetafile (hObject, hMetafile2, ANN_METAFILE_USER, FALSE);

m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = bEncryptorOriginal;
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
}


AnnGetSelectList example for Visual C++ 5.0

AnnGetSelectList example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

This example gets the number of selected annotation objects; then it gets an array of the selected object handles and checks to see if any of the objects in the array are polygons.

void CTutorDlg::OnButtonAnngetselectlist()
{
AnnObjectType nType;
short uCount;
long x;
int bSelected;
CString strMsg;
int hObject;
ILEADRasterVariant * pltRasVarList = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarList);

m_pRasterAnn->AnnGetSelectCount(); //get number of selected objects
uCount = m_pRasterAnn->GetAnnSelectCount();
m_pRasterAnn->AnnGetSelectList(pltRasVarList); //get handles of the selected objects
strMsg.Format(TEXT("%d"),uCount);
strMsg = strMsg + TEXT(" objects were selected");
AfxMessageBox (strMsg);
for (x=0; x<uCount; x++)
{
hObject = pltRasVarList->LongItemValue(x);
m_pRasterAnn->AnnGetType(hObject);
nType = m_pRasterAnn->GetAnnType();
if (nType == ANN_OBJECT_POLYGON)
bSelected = TRUE;
}
if (bSelected != TRUE)
AfxMessageBox(TEXT("No Polygon Objects were selected"));

pltRasVarList->Release ();
}


AnnGetUserData example for C++ 5.0 and later

void CAnnSample2Dlg::SampleAnnUserData(long hObject)
{
ILEADRasterVariant * pUserData = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pUserData);
if (FAILED(hr) || !pUserData)
return ;

pUserData->Type = VALUE_STRING;
pUserData->StringValue = "This is Sample Code";

m_pRasterAnn->Flags = ANN_FLAG_NOINVALIDATE;
m_pRasterAnn->AnnSetUserData(hObject, pUserData);

pUserData->Type = VALUE_STRING;
m_pRasterAnn->AnnGetUserData(hObject, pUserData);

MessageBox(pUserData->StringValue);

pUserData->Release();
}


AnnGetUserHandles example for C++ 5 and later

//' This example displays information about the user handles in an annotation object.
void CTutorDlg::ExampleGetAnnUserHandles(long hObject)
{
long Count;
int i;
CString strMsg;

m_pRasterAnn->AnnGetUserHandles(hObject);
Count = m_pRasterAnn->UserHandleCount;

if (Count > 0)
{
for (i = 0; i< Count; i++)
{

strMsg.Format(TEXT("uIndex = %l \n\t nID = %l \n\t ContainerX = %f\n\t ContainerY = %f\n\t CliantX = %f\n\t ClientY = %f\n\t Shape = %f\n\t"),
i,m_pRasterAnn->UserHandle(i)->ID,
m_pRasterAnn->UserHandle(i)->ContainerX,
m_pRasterAnn->UserHandle(i)->ContainerY,
m_pRasterAnn->UserHandle(i)->ClientX,
m_pRasterAnn->UserHandle(i)->ClientY,
m_pRasterAnn->UserHandle(i)->Shape
);

}

}
else
MessageBox (TEXT("No User Handles"));
}


AnnGetVisible example for Visual C++ 5.0

AnnGetVisible example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the visible state of the annotation container.
void CTutorDlg::OnButtonAnngetvisible()
{
VARIANT_BOOL bVisible;
CString strMsg;

m_pRasterAnn->AnnGetVisible(m_pRasterAnn->GetAnnContainer());
bVisible = m_pRasterAnn->GetAnnVisible();
m_pRasterAnn->AnnSetVisible(m_pRasterAnn->GetAnnContainer(), !bVisible, ANN_FLAG_RECURSE, "");
m_pRasterAnn->AnnGetVisible(m_pRasterAnn->GetAnnContainer());
bVisible = m_pRasterAnn->GetAnnVisible();

strMsg.Format(TEXT("AnnGetVisible: %s"),bVisible == VARIANT_TRUE ? TEXT("True") : TEXT("False"));
AfxMessageBox(strMsg);
}


AnnGroup example for Visual C++ 5.0

AnnGroup example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example groups all selected annotation objects.
void CTutorDlg::OnButtonAnngroup()
{
m_pRasterAnn->AnnGroup(m_pRasterAnn->GetAnnContainer(), ANN_FLAG_SELECTED | ANN_FLAG_RECURSE, "");
}


AnnHandle example for C++ 5 and later

void CAnnSample2Dlg::ExampleAnnUserHandle(long hObject)
{
long Count ;

m_pRasterAnn->AnnGetUserHandles(hObject);
Count = m_pRasterAnn->GetUserHandleCount();

if (Count > 0 )
{
CString str;
m_pRasterAnn->AnnGetUserHandle( hObject, 0);

str.Format (TEXT("uIndex = 0 \n nID = %d \n ContainerX = %d \n ContainerY = %d \n CliantX = %d \n ClientY = %d \n bVisible = %d \n PenColor = %d \n FillColor = %d \n Shape = %d "),
m_pRasterAnn->GetAnnHandle()->ID, m_pRasterAnn->GetAnnHandle()->ContainerX,m_pRasterAnn->GetAnnHandle()->ContainerY,
m_pRasterAnn->GetAnnHandle()->ClientX,m_pRasterAnn->GetAnnHandle()->ClientY,m_pRasterAnn->GetAnnHandle()->EnableVisible,
m_pRasterAnn->GetAnnHandle()->PenColor,m_pRasterAnn->GetAnnHandle()->FillColor,m_pRasterAnn->GetAnnHandle()->Shape);

MessageBox(str);
}

else
MessageBox(TEXT("No User Handles"));

}


AnnHitTest example for Visual C++ 5.0

AnnHitTest Example for Visual C++

long hObj;
if(m_pRasterAnn->AnnHitTest (m_pRasterAnn->GetAnnContainer (), 100, 100) == ANN_HIT_BODY)
{
hObj = m_pRasterAnn->GetAnnHitTestObject();
m_pRasterAnn->AnnSetName (hObj, TRUE, "AnnHitFound", FALSE);
AnnObjectType nType;
m_pRasterAnn->AnnGetType (hObj);
nType = m_pRasterAnn->GetAnnType();
if(nType == ANN_OBJECT_TEXT)
{
m_pRasterAnn->AnnSetFontBold (hObj, !m_pRasterAnn->AnnGetFontBold (hObj), FALSE);
m_pRasterAnn->AnnSetFontItalic (hObj, !m_pRasterAnn->AnnGetFontItalic (hObj), FALSE);
m_pRasterAnn->AnnSetFontStrikeThrough (hObj, !m_pRasterAnn->AnnGetFontStrikeThrough (hObj), FALSE);
m_pRasterAnn->AnnSetFontUnderline (hObj, !m_pRasterAnn->AnnGetFontUnderline (hObj), FALSE);
m_pRasterAnn->AnnSetFontName (hObj, m_pRasterAnn->AnnGetFontName (hObj), FALSE);
m_pRasterAnn->AnnSetFontSize (hObj, ((int)m_pRasterAnn->AnnGetFontSize (hObj)-9) %10 +10, FALSE);
VARIANT_BOOL bShow;
m_pRasterAnn->AnnSetText (hObj, m_pRasterAnn->AnnGetText (hObj) + m_pRasterAnn->AnnGetName (hObj, &bShow), FALSE);
}
}


AnnHitTestExt example for C++ 5 and later

//'This example uses the caller's mouse coordinates to get the handle
//' to the annotation object at the specified coordinates.
//' The part of the clicked annotation is displayed in the Output window.
//' If the result of the hittest is a user handle, additional information about the handle is displayed.
void CTutorDlg::ExampleAnnHitTestExt(long hContainer , long PointToTestX,long PointToTestY, long hAnnObject )
{
CString szResult;

m_pRasterAnn->AnnHitTestExt( hContainer, PointToTestX, PointToTestY);
If (m_pRasterAnn->.ObjectHitHandle == 0 )
{
MessageBox(TEXT("There is no object to hit test."));
Return ;
}
switch (m_pRasterAnn->GetPositionResult())
{
case ANN_HIT_NONE:
szResult = TEXT("ANN_HIT_NONE");

case ANN_HIT_BODY:
szResult = TEXT("ANN_HIT_NONE");

case ANN_HIT_NAME:
szResult = TEXT("ANN_HIT_NAME");

case ANN_HIT_HANDLE:
szResult.Format(TEXT("ANN_HIT_HANDLE HandleIndex = %d \n\t HandleId = %d "),m_pRasterAnn->HandleIndex, m_pRasterAnn->HandleID);

case ANN_HIT_USER_HANDLE:
szResult.Format(TEXT("ANN_HIT_USER_HANDLE HandleIndex = %d \n\t HandleId = %d "),m_pRasterAnn->HandleIndex, m_pRasterAnn->HandleID);

}

MessageBox(szResult);

}


AnnHyperlink example for Visual C++ 5.0

AnnHyperlink example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//AnnHyperlink event gets fired when the user clicks on a button or hotspot in run mode
//Prior to this event, you should call AnnSetHyperlinkMsg (see example for AnnSetHyperlinkMsg)
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnHyperlink(long hObject, short iParamCount, long lParam1, long lParam2, long lParam3, long lParam4, long lParam5)
{
CString strMsg;
CString strTmp;
short nType;

m_pDlg->m_pRasterAnn->AnnGetHyperlinkType(hObject);
nType = m_pDlg->m_pRasterAnn->AnnHyperlinkType();
if ((nType == ANN_LINK_ANNEVENT5) || (nType == ANN_LINK_ANNEVENT))
{
if (iParamCount >= 0)
{
strMsg.Format(TEXT("%d params are valid\n"), iParamCount);
}
if (iParamCount >= 1)
{
strTmp = strMsg;
strMsg.Format(TEXT("%s Param1: %d\n"), strTmp, lParam1);
}
if (iParamCount >= 2)
{
strTmp = strMsg;
strMsg.Format(TEXT("%s Param2: %d\n"), strTmp, lParam2);
}
if (iParamCount >= 3)
{
strTmp = strMsg;
strMsg.Format(TEXT("%s Param3: %d\n"), strTmp, lParam3);
}
if (iParamCount >= 4)
{
strTmp = strMsg;
strMsg.Format(TEXT("%s Param4: %d\n"), strTmp, lParam4);
}
if (iParamCount >= 5)
{
strTmp = strMsg;
strMsg.Format(TEXT("%s Param5: %d\n"), strTmp, lParam5);
}
}
else
{
strMsg.Format(TEXT("Invalid Type"));
}
AfxMessageBox(strMsg);
}


AnnHyperlinkMenu example for Visual C++ 5.0

AnnHyperlinkMenu example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//The AnnHyperLinkMenu event occurs whenever the user clicks on the Hyperlink menu item provided for automated annotations.
//The menu item is enabled and disabled using AnnHyperlinkMenuEnable property.
//The following is an example of AnnHyperlinkMenu event code, which includes a call to AnnSetHyperlinkMsg.
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnHyperlinkMenu(ILEADRasterVariant * pltRasVar, short uCount)
{
long x;
long hObject;

//set HyperLink to type ANNLINK_ANNEVENT5
//and set the 5 params to some values.
for (x = 0; x<uCount; x++)
{
hObject = pltRasVar->LongItemValue(x);
m_pDlg->m_pRasterAnn->AnnSetHyperlinkMsg(hObject, ANN_LINK_ANNEVENT5, 5, 4, 3, 2, 1);
}
}


AnnHyperlinkMenuEnable example for Visual C++ 5.0

AnnHyperlinkMenuEnable example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the AnnHyperlinkMenuEnable property .
//toggle AnnHyperLinkMenu item and event
void CTutorDlg::OnButtonAnnhyperlinkmenuenable()
{
CString strMsg;
VARIANT_BOOL bEnable;

m_pRasterAnn->PutAnnHyperlinkMenuEnable( ! m_pRasterAnn->GetAnnHyperlinkMenuEnable());

bEnable = m_pRasterAnn->GetAnnHyperlinkMenuEnable();
strMsg.Format(TEXT("AnnHyperlinkMenuEnable: %s"), bEnable == VARIANT_TRUE ? TEXT("True") : TEXT("False"));
AfxMessageBox(strMsg);
}


AnnInsert example for Visual C++ 5.0

AnnInsert example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example
//1. creates an ellipse annotation object
//2. sizes the ellipse
//3. inserts the ellipse into the annotation container
void CTutorDlg::OnButtonAnninsertann()
{

long hEllipseObject;
m_pRasterAnn->AnnCreate(ANN_OBJECT_ELLIPSE, VARIANT_FALSE, VARIANT_TRUE);
hEllipseObject = m_pRasterAnn->GetAnnObject();

m_pRasterAnn->PutAnnRectLeft(hEllipseObject, 0);
m_pRasterAnn->PutAnnRectTop(hEllipseObject, 0);
m_pRasterAnn->PutAnnRectWidth(hEllipseObject, 100);
m_pRasterAnn->PutAnnRectHeight(hEllipseObject, 100);

m_pRasterAnn->AnnInsert(m_pRasterAnn->GetAnnContainer(), hEllipseObject, VARIANT_FALSE);
}


AnnInsertTokenTable example for C++ 5 and later

Void CTutorDlg::ExampleAnnTextToken()
{
m_pRasterAnn->Token = "A";
m_pRasterAnn->Description = "Two Digit Month";
m_pRasterAnn->TokenString = "";
m_pRasterAnn->TokenType = ANN_TOKEN_DATE_MM;

m_pRasterAnn->AnnInsertTokenTable();

m_pRasterAnn->Token = "B";
m_pRasterAnn->Description = "Two Digit day";
m_pRasterAnn->TokenString = "";
m_pRasterAnn->TokenType = ANN_TOKEN_DATE_DD;

m_pRasterAnn->AnnInsertTokenTable();

m_pRasterAnn->Token = "C";
m_pRasterAnn->Description = "Two Digit day";
m_pRasterAnn->TokenString = "";
m_pRasterAnn->TokenType = ANN_TOKEN_DATE_YYYY;

m_pRasterAnn->AnnInsertTokenTable();

m_pRasterAnn->AnnDeleteTokenTable("B");

m_pRasterAnn->Token = "D";
m_pRasterAnn->Description = "";
m_pRasterAnn->TokenString = "";
m_pRasterAnn->TokenType = ANN_TOKEN_SEPARATOR;

m_pRasterAnn->AnnClearTokenTable();
}


AnnIsFixedRect example for C++ 5 and later

void CTutorDlg::ExampleAnnIsFixedInRect(long hObject ,long WndLeft ,long WndTop ,long WndRight ,long WndBottom)
{
VARIANT_BOOL bFixedInRect;

m_pRasterAnn->Flags = ANN_FLAG_RECURSE;
bFixedInRect = m_pRasterAnn->GetAnnIsFixedRect(hObject, WndLeft, WndTop, WndRight, WndBottom);

if(bFixedInRect == TRUE)
MessageBox(TEXT("There are Fixed annotations visible."));
else
MessageBox(TEXT("There are No Fixed annotations visible."));

}


AnnLoadArray example for Visual C++ 5.0

AnnLoadArray example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnloadarray()
{
long lCount;
HFILE hFile;
HGLOBAL hData=NULL;
void FAR* pData=NULL;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

hFile = _tfopen(TEXT("c:\\test.ann"), OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData = GlobalLock(hData);

_lread(hFile, pData, lCount);

pltRasVar->Type = VALUE_ARRAY_BYTE;
pltRasVar->ItemCount = lCount;

for(long i=0; i<lCount; i++)
pltRasVar->ShortItemValue(i) = (short)pData[i];

GlobalUnlock(hData);
GlobalFree(hData);

m_pRasterAnn->AnnLoadArray(&pltRasVar, lCount, 1);
_lclose(hFile);
}


AnnLock example for Visual C++ 5.0

AnnLock example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example locks objects of type ANNOBJECT_ELLIPSE using the key "IkeStarnes".
void CTutorDlg::OnButtonAnnlock()
{
AnnObjectType nType;
short uCount;
long x;
int bSelected;
int hObject;
CString str = TEXT("Ike Starnes");
ILEADRasterVariant * pltRasVarList = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarList);

m_pRasterAnn->AnnGetSelectCount(); //get number of selected objects
uCount = m_pRasterAnn->GetAnnSelectCount();
m_pRasterAnn->AnnGetSelectList(pltRasVarList); //get handles of the selected objects
for (x=0; x<uCount; x++)
{
hObject = pltRasVarList->LongItemValue(x);
m_pRasterAnn->AnnGetType(hObject);
nType = m_pRasterAnn->GetAnnType();
if (nType == ANN_OBJECT_ELLIPSE)
{
bSelected = TRUE;
m_pRasterAnn->AnnLock(hObject, str. AllocSysString(), VARIANT_FALSE);
}
}
if (bSelected != TRUE)
AfxMessageBox(TEXT("No Ellipse Objects were selected"));

pltRasVarList->Release ();
}


AnnLocked example for Visual C++ 5.0

AnnLocked example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//The following is an example of an AnnLocked event.
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnLocked(long hAnnObject)
{
CString strMsg;

strMsg.Format(TEXT("AnnObject: %x was locked."), hAnnObject);
AfxMessageBox(strMsg);
}


AnnMenu example for Visual C++ 5.0

AnnMenu example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//The AnnMenu event occurs just before an annotation automation menu is displayed.
//This example:
//* Displays the number of menu items
//* Changes the text of a menu item
//* Checks all unchecked menu items
//* Disables all menu items
//* Adds a user defined menu item (flip)
//* Adds a user defined popup menu
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnMenu(long hMenu)
{
long nID;
short x;
CString strMsg;

ILEADRasterAnnMenu *pRasterAnnMenu = NULL;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterAnnMenu,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnMenu,
(void**)&pRasterAnnMenu
);

if (SUCCEEDED(hr) && (pRasterAnnMenu != NULL) )
{
pRasterAnnMenu->SetAnnMenu(hMenu);
strMsg.Format(TEXT("There are %ld Items"), pRasterAnnMenu->GetCount());
AfxMessageBox(strMsg);

strMsg.Format(TEXT("Original Text for item#2: %s"), (LPCTSTR)pRasterAnnMenu->GetItemString(1));
AfxMessageBox(strMsg);
//set new string
pRasterAnnMenu->PutItemString(1, TEXT("TestText"));
strMsg.Format(TEXT("Custom Text for item#2: %s"), (LPCTSTR)pRasterAnnMenu->GetItemString(1));
AfxMessageBox(strMsg);

//make 3rd and 4th menu items have the same command id
nID = pRasterAnnMenu->GetItemID(3);
pRasterAnnMenu->PutItemID(2, nID);

//check all unchecked menu items that are not popup submenus
//disable all enabled menu items that are not popup submenus
for(x=0; x<pRasterAnnMenu->GetCount(); x++)
{
if(pRasterAnnMenu->GetItemType(x) == ANN_MENUITEMTYPE_NORMAL)
{
if(!pRasterAnnMenu->GetItemChecked(x))
pRasterAnnMenu->PutItemChecked(x, TRUE);
if(pRasterAnnMenu->GetItemEnabled(x))
pRasterAnnMenu->PutItemEnabled(x, FALSE);
}
}

//insert 2 user-defined menu items
pRasterAnnMenu->AddItem("&Flip", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST, pRasterAnnMenu->GetCount());
pRasterAnnMenu->AddItem("Test&2", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 1, pRasterAnnMenu->GetCount());

//delete the last menu item
pRasterAnnMenu->DeleteItem(pRasterAnnMenu->GetCount() - 1);
//delete the first menu item
pRasterAnnMenu->DeleteItem(0);

//insert a popup menu
pRasterAnnMenu->AddItem("&Popup1", ANN_MENUITEMTYPE_SUBMENU, 0, pRasterAnnMenu->GetCount());

//get the new item, and add some items to it
ILEADRasterAnnMenu *pPopupMenuItem = NULL;

pRasterAnnMenu->GetSubMenu(pRasterAnnMenu->GetCount() - 1, &pPopupMenuItem);
pPopupMenuItem->AddItem("Test&1", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 2, pPopupMenuItem->GetCount());
pPopupMenuItem->AddItem("Test&2", ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 3, pPopupMenuItem->GetCount());

//pPopupMenuItem->Release();

pRasterAnnMenu->Release();
}
}

void CRasterAnnSink::OnAnnUserMenu(long nID)
{
if (nID == ANN_EVENT_MENUFIRST)
{
m_pDlg->m_pRasterAnn->AnnFlip(FALSE, 0.0f, TRUE);
}
else
{
CString strMsg;
strMsg.Format(TEXT("nID = ANN_EVENT_MENUFIRST + %d"), nID - ANN_EVENT_MENUFIRST);
AfxMessageBox(strMsg);
}
}


AnnMouseDown example for Visual C++ 5.0

AnnMouseDown example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//This example shows
//1.
//How to create a custom annotation (circle inside a square)
//Set the AnnTool property to ANN_TOOL_USER_FIRST to see how this works

//2.
//How to restrict the rectangle annotation to be a square
//Set AnnTool property to ANN_TOOL_RECTANGLE and hold the SHIFT key when drawing to see how this works

//Global declarations
//long m_hRectObject;
//long m_hEllipseObject;
//long m_x0;
//long m_y0;
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

void CRasterAnnSink::AdjustMousePos(int Shift, long x, long y)
{
int dx;
int dy;
if (Shift == 1)
{
// if shift key is down, force the creation of squares
dx = abs(x - m_x0);
dy = abs(y - m_y0);
if (dx > dy)
{
// adjust y to be as far from m_y0 as x is from m_x0
y = (y>m_y0) ? m_y0 + dx : m_y0 - dx;
}
else
{
// adjust x to be as far from m_x0 as y is from m_y0
x = (x>m_x0) ? m_x0 + dy : m_x0 - dy;
}
// set the mouse cursor and update its position
m_pDlg->m_pRasterAnn->SetMousePos((float)x, (float)y, FALSE);
}
}

void CRasterAnnSink::OnAnnMouseDown(short Button, short Shift, long x, long y)
{
m_x0 = x;
m_y0 = y;
switch(m_pDlg->m_pRasterAnn->GetAnnTool())
{
case ANN_TOOL_USER_FIRST:
//create the objects
m_pDlg->m_pRasterAnn->AnnSetSelected(m_pDlg->m_pRasterAnn->AnnContainer, FALSE, TRUE);

//Add an undo node to undo the creation of these objects.
m_pDlg->m_pRasterAnn->AnnAddUndoNode();

m_pDlg->m_pRasterAnn->AnnCreate(ANN_OBJECT_RECT, TRUE, TRUE);
m_hRectObject = m_pDlg->m_pRasterAnn->GetAnnObject();

m_pDlg->m_pRasterAnn->AnnCreate(ANN_OBJECT_ELLIPSE, TRUE, TRUE);
hEllipseObject = m_pDlg->m_pRasterAnn->GetAnnObject();

//set the automation defaults to the objects newly created
m_pDlg->m_pRasterAnn->AnnSetAutoDefaults(m_hRectObject, 0);
m_pDlg->m_pRasterAnn->AnnSetAutoDefaults(m_hEllipseObject, 0);

//start defining them from the x, y coordinate
m_pDlg->m_pRasterAnn->AnnDefine(m_hRectObject, (float)x, (float)y, ANN_DEFINE_BEGINSET);
m_pDlg->m_pRasterAnn->AnnDefine(m_hEllipseObject, (float)x, (float)y, ANN_DEFINE_BEGINSET);
}
}

void CRasterAnnSink::OnAnnMouseMove(short Button, short Shift, long x, long y)
{
//if left button pressed
if (Button == 1)
{
switch( m_pDlg->m_pRasterAnn->GetAnnTool())
{
case ANN_TOOL_USER_FIRST:
//update the objects from the x, y coordinate
m_pDlg->m_pRasterAnn->AnnDefine(m_hRectObject, (float)x, (float)y, ANN_DEFINE_UPDATE);
m_pDlg->m_pRasterAnn->AnnDefine(m_hEllipseObject, (float)x, (float)y, ANN_DEFINE_UPDATE);
break;

case ANN_TOOL_RECT:
AdjustMousePos (Shift, x, y);
break;
}
}
}

void CRasterAnnSink::OnAnnMouseUp(short Button, short Shift, long x, long y)
{
switch( m_pDlg->m_pRasterAnn->GetAnnTool())

{
case ANN_TOOL_USER_FIRST:
m_pDlg->m_pRasterAnn->AnnDefine(m_hRectObject, (float)x, (float)y, ANN_DEFINE_END);
m_pDlg->m_pRasterAnn->AnnDefine(m_hEllipseObject, (float)x, (float)y, ANN_DEFINE_END);
m_pDlg->m_pRasterAnn->AnnSetSelected(m_hRectObject, TRUE, FALSE);
m_pDlg->m_pRasterAnn->AnnSetSelected(m_hEllipseObject, TRUE, FALSE);
m_pDlg->m_pRasterAnn->AnnGroup(m_pDlg->m_pRasterAnn->AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, "");
m_hEllipseObject = 0;
m_hRectObject = 0;
break;

case ANN_TOOL_RECT:
AdjustMousePos(Shift, x, y);
break;
}
}


AnnMove example for Visual C++ 5.0

AnnMove example for C++ 5.0 and later

This example moves one or more selected annotation objects.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnmove()
{
//This example moves one or more selected annotation objects.
float fDeltaX;
float fDeltaY;

//Use pixels
m_LEADRasterView1.SetScaleMode(SCALEMODE_PIXEL);

//Specify arbitrary delta values.
fDeltaX = 20;
fDeltaY = -20;

//Move the selected annotations.
m_pRasterAnn->AnnMove(fDeltaX, fDeltaY, TRUE);
}


AnnNameBoundingRectLeft Example for Visual C++ 5.0

AnnNameBoundingRectLeft Example for Visual C++

//This sample displays the bounding rectangle of the annotation hObject
CString strMsg;
strMsg.Format(TEXT("Ann Name Bounding Rect:\n\tleft: %f\n\ttop: %f\n\twidth: %f\n\theight: %f"),
m_pRasterAnn->GetAnnNameBoundingRectLeft (hObject),
m_pRasterAnn->GetAnnNameBoundingRectTop (hObject),
m_pRasterAnn->GetAnnNameBoundingRectWidth (hObject),
m_pRasterAnn->GetAnnNameBoundingRectHeight (hObject)
);

MessageBox(strMsg);


AnnNameOptions example for C++ 5 and later

//'This sample enumerates all objects in a container,
//'changing the object name and making it display.
//'If the object is a button, the name is restricted to appear within the bitmap bounds.
//'If the object is not a button, the name is not restricted.
void CTutorDlg::ExampleAnnSetNameOptions(long hObject)
{
m_pRasterAnn->AnnEnumerate(hObject, ANN_FLAG_RECURSE | ANN_FLAG_NOTCONTAINER, "");
}

void CRasterAnnSink::OnAnnEnumerate(long hObject)
{
AnnObjectType ObjectType;

m_pRasterAnn->AnnNameOptions->Flags = ANN_NAME_ALL;
m_pRasterAnn->AnnGetNameOptions (hObject);

m_pRasterAnn->AnnGetType (hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType == ANN_OBJECT_BUTTON)
{
m_pRasterAnn->AnnNameOptions->EnableShowName = FALSE;
m_pRasterAnn->AnnNameOptions->AnnotationName = " Name Restricted";
m_pRasterAnn->AnnNameOptions->EnableNameRestrict = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontBold = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontItalic = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontStrikeOut = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontUnderline = FALSE;
m_pRasterAnn->AnnNameOptions->EnableNameBackTransparent = FALSE;
}
else
{
m_pRasterAnn->AnnNameOptions->EnableShowName = TRUE;
m_pRasterAnn->AnnNameOptions->AnnotationName = " Name UnRestricted";
m_pRasterAnn->AnnNameOptions->EnableNameRestrict = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontBold = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontItalic = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontStrikeOut = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontUnderline = TRUE;
m_pRasterAnn->AnnNameOptions->EnableNameBackTransparent = TRUE;
}

m_pRasterAnn->AnnNameOptions->X = 10;
m_pRasterAnn->AnnNameOptions->Y = 10 ;
m_pRasterAnn->AnnNameOptions->FaceNameColor = RGB(0, 0, 0);
m_pRasterAnn->AnnNameOptions->BackNameColor = RGB(255, 255, 255);
m_pRasterAnn->AnnNameOptions->FontName = "Arial";
m_pRasterAnn->AnnNameOptions->FontSize = 12;

m_pRasterAnn->AnnNameOptions->Flags = ANN_NAME_ALL;
m_pRasterAnn->AnnSetNameOptions(hObject);
}


AnnNameRectLeft Example for Visual C++ 5.0

AnnNameRectLeft Example for Visual C++

//This sample displays the defining rectangle of the annotation hObject
CString strMsg;

strMsg.Format(TEXT("Ann Name Rect:\n\tleft: %f\n\ttop: %f\n\twidth: %f\n\theight: %f"),
m_pRasterAnn->GetAnnNameRectLeft (hObject),
m_pRasterAnn->GetAnnNameRectTop (hObject),
m_pRasterAnn->GetAnnNameRectWidth (hObject),
m_pRasterAnn->GetAnnNameRectHeight (hObject)
);

MessageBox(strMsg);


Annotation Colors Example for Visual C++ 5.0

Annotation Colors Example for Visual C++

OLE_COLOR cr;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->Load (m_RasterView2.GetRaster, "C:\\TEMP\\flagsel.bmp", 0, 1, 1);
m_pRasterAnn->AnnSetBitmap (hStamp, m_RasterView2.GetRaster(), FALSE);
m_pRasterAnn->AnnSetAutoBackColor (m_pRasterAnn->GetAnnAutomation (), ANN_OBJECT_ALL, RGB(40, 80, 160));
cr = m_pRasterAnn->AnnGetAutoBackColor (m_pRasterAnn->GetAnnAutomation (), ANN_OBJECT_POLYGON);
CString text;
text.Format(TEXT("AutoBackColor: %X"), cr);
AfxMessageBox(text);

if(!m_pRasterAnn->AnnGetTransparent (hStamp))
m_pRasterAnn->AnnSetTransparent (hStamp, TRUE, FALSE);

m_pRasterAnn->AnnSetTransparentColor (hStamp, RGB(0, 255, 0), FALSE);
cr = m_pRasterAnn->AnnGetTransparentColor (hStamp);
text.Format(TEXT("TransparentColor: %X"), cr);
AfxMessageBox(text);

m_pRasterAnn->AnnSetBackColor (hPlgn, RGB(100, 20, 200), FALSE);
cr = m_pRasterAnn->AnnGetBackColor (hPlgn);
text.Format(TEXT("BackColor: %X"), cr);
AfxMessageBox(text);

m_pRasterAnn->AnnSetForeColor (hPlgn, RGB(180, 220, 120), FALSE);
cr = m_pRasterAnn->AnnGetForeColor (hPlgn);
text.Format(TEXT("ForeColor: %X"), cr);
AfxMessageBox(text);
m_pRasterAnn->AnnGetBitmap (hStamp, m_RasterView1.GetRaster());


Annotation_Declaration_InformationC4

Annotation Declaration Information

Assume the following class member declarations:
CLEADRasterView m_LEADRasterView1; // LEADRasterView control
ILEADRasterAnnotation * m_pRasterAnn; // LEAD Annotation COM object

The following code is called when the application starts
CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&m_pRasterAnn);

//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Attach the annotation object to the raster view control
IDispatch *pDispatch=NULL;
LPUNKNOWN pIUnknownNoRelease = m_LEADRasterView1.GetControlUnknown();
pIUnknownNoRelease->QueryInterface(IID_IDispatch, (void**)&pDispatch);
m_pRasterAnn->PutAnnParentRasterView(pDispatch);

if(pDispatch)
pDispatch->Release();

m_pRasterAnn->PutAnnAutoUpdate(TRUE);

*** The following code is called when the application ends
m_pRasterAnn->Release();


AnnParentRasterView example for Visual C++ 5.0

AnnParentRasterView example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This sample shows the minimal code to use the LEAD Annotation COM object
// m_LEADRasterView1 is a LEAD Raster View control
void CTutorDlg::OnButtonSample()
{
ILEADRasterAnnotation *pRasterAnn;

CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&pRasterAnn);

//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Attach the annotation object to the raster view control
IDispatch *pDispatch=NULL;
LPUNKNOWN pIUnknownNoRelease = m_LEADRasterView1.GetControlUnknown();
pIUnknownNoRelease->QueryInterface(IID_IDispatch, (void**)&pDispatch);
pRasterAnn->PutAnnParentRasterView(pDispatch);

if(pDispatch)
pDispatch->Release();

pRasterAnn->PutAnnAutoUpdate(TRUE);

//...
//... the rest of the program
//...

pRasterAnn->Release();
}


AnnPointOptions example for C++ 5 and later

// This example toggles the appearance of a point annotation object
// The appearance toggles between bitmap to circle

void CTutorDlg::ExampleAnnSetPointOptions(long hObject)
{
AnnObjectType ObjectType;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if( ObjectType != ANN_OBJECT_POINT )
MessageBox(TEXT("This Object is not an Point Option")) ;

m_pRasterAnn->AnnPointOptions->Flags = ANN_POINT_ALL;
m_pRasterAnn->AnnGetPointOptions (hObject);

if (m_pRasterAnn->AnnPointOptions->PointRaster == NULL)
{
MessageBox(TEXT("There is no raster associated "));
Return ;
}

if(m_pRasterAnn->AnnPointOptions->EnablePointUseBitmap == TRUE)
{
m_pRasterAnn->AnnPointOptions->EnablePointUseBitmap = FALSE;
m_pRasterAnn->AnnPointOptions->EnablePointFixedSize = FALSE;
m_pRasterAnn->AnnPointOptions->EnablePointTransparentFill = FALSE;

m_pRasterAnn->AnnPointOptions->PointBorderColor = RGB(0, 0, 0);
m_pRasterAnn->AnnPointOptions->PointFillColor = RGB(255, 255, 0);
m_pRasterAnn->AnnPointOptions->PointRadius = 12;

m_pRasterAnn->AnnPointOptions->Flags = (ANN_POINT_USE_BITMAP |
ANN_POINT_RADIUS |
ANN_POINT_BORDER_COLOR |
ANN_POINT_FILL_COLOR |
ANN_POINT_TRANSPARENT_FILL |
ANN_POINT_FIXED_SIZE);
}
else
{
//Change Point appearance to a bitmap
m_pRasterAnn->AnnPointOptions->EnablePointUseBitmap = TRUE;
m_pRasterAnn->AnnPointOptions->EnablePointBitmapTransparent = TRUE;
m_pRasterAnn->AnnPointOptions->PointBitmapTransparentColor= RGB(255, 255, 255);
}

m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnSetPointOptions(hObject);
}


AnnPopFixedState example for C++ 5 and later

//This example enables the"fixed" property for all objects in the container that
//have been temporarily disabled with a call to L_AnnPushFixedState.
//For an example using the magnifying glass, see the source code
//for the main COM annotation demo.
void CAnnSample2Dlg::SampleAnnPopFixedState(long hContainer)
{
m_pRasterAnn->Flags = ANN_FLAG_RECURSE | ANN_FLAG_NOINVALIDATE;
m_pRasterAnn->AnnPopFixedState (hContainer);

}


AnnPredefinedRaster example for C++ 5 and later

//'This example does the following:
//'1. Gets the current point bitmap
//'2. Inverts it
//'3. Sets the inverted bitmap as the default point bitmap
void CTutorDlg::ExampleGetPredefineRaster()
{
ILEADRasterProcess *m_RasterProc = NULL;
//CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterIO);

m_LEADRasterView1.GetRaster ().SetBitmap(m_pRasterAnn->GetAnnPredefinedRaster(ANN_BITMAP_POINT)->GetBitmap());
m_RasterProc->Invert (m_LEADRasterView1.GetRaster().m_lpDispatch);
m_pRasterAnn->PutAnnPredefinedRaster(ANN_BITMAP_POINT, (ILEADRaster *)(m_LEADRasterView1.GetRaster().m_lpDispatch));
}


AnnPushFixedState example for C++ 5 and later

// This example temporarily disables the"fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarly painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main COM annotation demo.
void CAnnSample2Dlg::SampleAnnPushFixedState(long hContainer)
{
m_pRasterAnn->Flags = ANN_FLAG_RECURSE | ANN_FLAG_NOINVALIDATE;
m_pRasterAnn->AnnPushFixedState (hContainer);
}


AnnRestrictCursor example for C++ 5 and later

//'Example for AnnConvert, AnnRestrictCursor
//'This example restricts the cursor to 10 pixels on either side
//'of the bounding box of the annotation object. For example,
//'if the object is a rectangle, the mouse cursor will be restricted
//'to an area that is 10 pixels larger than the rectangle
void CTutorDlg::ExampleAnnRestrictCursor(long hObject)
{
long hContainer;
AnnObjectType ObjectType;
double BoundsTop;
double BoundsLeft;
double BoundsWidth;
double BoundsHeight;
double BoundsRight ;
double BoundsBottom ;
double OldClipTop ;
double OldClipLeft ;
double OldClipRight ;
double OldClipBottom;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if(( ObjectType != ANN_OBJECT_AUTOMATION) && (ObjectType != ANN_OBJECT_CONTAINER) )
MessageBox(TEXT("This object is not an Automation Object and it is not a Container Object"));

hContainer = m_pRasterAnn->AnnGetTopContainer(hObject);

BoundsTop = m_pRasterAnn->GetAnnRectTop(hObject);
BoundsLeft = m_pRasterAnn->GetAnnRectLeft(hObject);
BoundsWidth = m_pRasterAnn->GetAnnRectWidth(hObject);
BoundsHeight = m_pRasterAnn->GetAnnRectHeight(hObject);

m_pRasterAnn->PointsCount = 2;
m_pRasterAnn->ContainerPointX = BoundsLeft;
m_pRasterAnn->ContainerPointY = BoundsTop;
m_pRasterAnn->AnnConvert(hObject, ANN_CONVERT_TO_CLIENT);

m_pRasterAnn->PointIndex = 0;
BoundsLeft = m_pRasterAnn->ClientPointX;
BoundsTop = m_pRasterAnn->ClientPointY;

BoundsRight = (BoundsWidth + BoundsLeft) + 10;
BoundsBottom = (BoundsHeight + BoundsTop) + 10;
BoundsTop = BoundsTop - 10;
BoundsLeft = BoundsLeft - 10;

m_pRasterAnn->AnnRestrictCursor(hContainer, (long)BoundsLeft, (long)BoundsTop, (long)BoundsRight, (long)BoundsBottom, 0, 0, FALSE);

OldClipTop = m_pRasterAnn->TopPreviousClip;
OldClipLeft = m_pRasterAnn->LeftPreviousClip;
OldClipRight = m_pRasterAnn->RightPreviousClip;
OldClipBottom = m_pRasterAnn->BottomPreviousClip;

//'When done with restricting cursor, call the line below
//ClipCursor
}


AnnRotate example for Visual C++ 5.0

AnnRotate example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example uses the AnnFlip, AnnReverse, and AnnRotate methods. To code this example, add a command button with and ID of IDC_TEST to the example you created in Loading and Displaying an Image. For best results when you run the example, draw two objects in opposite corners, and use the right mouse button to select all annotation objects. The command button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate methods.

void CTutorDlg::OnButtonAnnrotate()
{
CString MyCaption;
CWnd *pButton = GetDlgItem(IDC_BUTTON_ANNROTATE);
pButton->GetWindowText(MyCaption);
if (MyCaption == TEXT("Flip"))
{
// Flip using the center of the bitmap as the axis.
L_FLOAT fBitmapHeight;
fBitmapHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight ();
m_pRasterAnn->AnnFlip(VARIANT_TRUE, fBitmapHeight / 2, VARIANT_TRUE);
pButton->SetWindowText(TEXT("Reverse"));
}
else if (MyCaption == TEXT("Reverse"))
{
// Reverse using the center of the bitmap as the axis.
L_FLOAT fBitmapWidth;
fBitmapWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth();
m_pRasterAnn->AnnReverse(VARIANT_TRUE, fBitmapWidth / 2, VARIANT_TRUE);
pButton->SetWindowText(TEXT("Rotate"));
}
else if (MyCaption == TEXT("Rotate"))
{
// Rotate 90 degrees using the center of the bitmap as the axis.
L_FLOAT fBitmapHeight;
L_FLOAT fBitmapWidth;
fBitmapHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight();
fBitmapWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth();
m_pRasterAnn->AnnRotate(VARIANT_TRUE, fBitmapWidth / 2, fBitmapHeight / 2, 90.0f, VARIANT_FALSE);
pButton->SetWindowText(TEXT("Flip"));
}
else
{
pButton->SetWindowText(TEXT("Flip"));
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
m_pRasterAnn->PutAnnTool(ANN_TOOL_REDACT);
AfxMessageBox(TEXT("Draw two objects, use the right mouse button to select all, then click the command button"));
}
}


AnnRotateAngle example for C++ 5 and later

void CTutorDlg::ExampleAnnGetRotateAngle(long hObject)
{
CString szMsg ;
double RadiansAngle ;
double DegreesAngle ;

RadiansAngle = m_pRasterAnn->AnnGetAngle(hObject);
If (m_pRasterAnn->GetAnnError() != 0)
{
szMsg.Format(TEXT("There is an error equal to = %d "), m_pRasterAnn->GetAnnError());
MessageBox (szMsg);
Return ;
}

DegreesAngle = RadiansAngle * 180 / 3.1415926535;

szMsg.Format(TEXT("Angle Rotation : Radias = %f \n\t Degrees = %f "), RadiansAngle, DegreesAngle);
MessageBox (szMsg);

return 1;
}


AnnRTFText example for C++ 5 and later

// This sample loads a rich text annotation object with text
//It illustrates how AnnRTFText can treat the text as Rich Text, or plain text

// hObject: the Rich Text annotation object
// uFormat: the format of the retrieved text--one of
// RTF_FORMAT_TEXT
// RTF_FORMAT_RTF

#define RICH_STRING "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033\
{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\ \\red255\\green0\\blue0;\\red255\\green255\\blue255;\
\\red51\\green102\\blue0;\\red0\\green0\\blue255;\
\\red0\\green0\\blue0;}\\viewkind4\\uc1\\pard\\cf1\
\\highlight2\\ul\\fs20 Rich \\cf3\\ulnone\\b Text \
\\cf4\\b0\\i String\\cf5\\i0\\par}"

void CAnnSample2Dlg::SampleAnnTextRTF(long hObject,long uFormat)
{
CString pszFormat;
CString RTF ;
long ulength ;
TCHAR *pText;
TCHAR szMsg[200];

switch (uFormat)
{
case RTF_FORMAT_TEXT:
pszFormat = TEXT("RTF_FORMAT_TEXT");
m_pRasterAnn->Flags = 0;
m_pRasterAnn->put_AnnRTFText(hObject, uFormat, (BSTR)RICH_STRING);
break;
case RTF_FORMAT_RTF:
pszFormat = TEXT("RTF_FORMAT_RTF");
m_pRasterAnn->Flags = 0;
m_pRasterAnn->put_AnnRTFText(hObject, uFormat ,(BSTR)RICH_STRING);
}

m_pRasterAnn->GetAnnRTFText(hObject, uFormat);

ulength = m_pRasterAnn->RTFTextLength;

pText = (CHAR *)malloc((ulength+1)*sizeof(CHAR));

lstrcpy (pText, m_pRasterAnn->GetAnnRTFText(hObject, uFormat));

wsprintf(szMsg, TEXT("Format: %s\nLength: %d"), pszFormat, ulength);
MessageBox(pText, szMsg, MB_OK);

free(pText);
}


AnnSaveArray example for Visual C++ 5.0

AnnSaveArray example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnsavearray()
{
long lSize;
HFILE hFile;
void * pData=NULL;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

MyVar.Clear();
m_pRasterAnn->AnnSaveArray(ANN_FMT_NATIVE, VARIANT_TRUE, pltRasVar, SAVE_OVERWRITE, 0);
lSize = pltRasVar->ItemCount;
_tcreat(TEXT("c:\\test.ann"), 0);
hFile = _tfopen(TEXT("c:\\test.ann"), OF_READWRITE);
pData = GlobalAlloc(GHND,lSize);

for(long i=0; i<lSize; i++)
pData[i] = pltRasVar->ShortItemValue(i);

_lwrite(hFile, (LPCSTR)pData, lSize);
_lclose(hFile);
pltRasVar->Release ();
GlobalFree(pData);
}


AnnSaveMemory example for Visual C++ 5.0

AnnSaveMemory example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

This example lets you save the current annotations to a file in memory, and lets you load the annotations that were saved.

1. | Start with the project that you created in Creating and Using Annotations.
2. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

HGLOBAL m_hMem;
long m_iSize;

3. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | AnnSaveMem | Save In Memory
 | AnnLoadMem | Load From Memory
4. | Code the AnnSaveMem button's Click procedure as follows:

void CMfc40Dlg::OnAnnSaveMem()
{
if (m_pRasterAnn->AnnSaveMemory((long FAR *)&m_hMem, ANN_FMT_NATIVE, VARIANT_FALSE, &m_iSize, SAVE_OVERWRITE, 0) != 0)
AfxMessageBox(TEXT("Error calling AnnSaveMemory"));
}

5.

Code the AnnLoadMem button's Click procedure as follows:

void CMfc40Dlg::OnAnnLoadMem()
{
//Load the annotations from the memory-resident file.
if ((m_pRasterAnn->AnnLoadMemory((OLE_HANDLE)m_hMem, m_iSize, 1) != 0))
AfxMessageBox(TEXT("Error calling AnnLoadMemory"));
else
AfxMessageBox(TEXT("AnnLoadMemory succeeded"));
::GlobalFree(m_hMem);
}

6.

Run your program to test it.


AnnSaveTag example for Visual C++ 5.0

AnnSaveTag example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

The following example saves selected objects as a Wang compatible TIFF tag.

//This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image
void CTutorDlg::OnButtonAnnsavetag()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

m_pRasterAnn->AnnSaveTag (pRasterIO, VARIANT_TRUE, VARIANT_FALSE);
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\testwang.tif",
(RasterFileConstants)FILE_CCITT_GROUP4,
1,
(QFactorConstants)2,
SAVE_OVERWRITE);

//clear the LEAD raster view control
m_LEADRasterView1.GetRaster().SetBitmap(0);

//Reload the image with the wang-compatible annotations
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\testwang.tif", 0, 0, 1);
m_pRasterAnn->AnnLoad("c:\\testwang.tif", 1);
m_pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;

pRasterIO->Release();
}


AnnSelect example for Visual C++ 5.0

AnnSelect example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

void CRasterAnnSink::OnAnnSelect(ILEADRasterVariant * pltRasVar, short uCount)
{
AnnObjectType nType;
long x;
int nPolyCount;
CString strMsg= TEXT("");
long hObject;

nPolyCount = 0;
for (x = 0; x < uCount; x++)
{
hObject = pltRasVar->LongItemValue (x);
m_pDlg->m_pRasterAnn->AnnGetType(hObject);
nType = m_pDlg->m_pRasterAnn->GetAnnType();
if (nType == ANN_OBJECT_POLYGON)
nPolyCount++;
}
strMsg.Format(TEXT("%d objects were selected. %d Polygon Objects were selected."), uCount, nPolyCount);
AfxMessageBox(strMsg);
}


AnnSelectRect Example for Visual C++ 5.0

AnnSelectRect Example for Visual C++

m_pRasterAnn->AnnSelectRect (m_pRasterAnn->GetAnnContainer (), 10, 10, 200, 100);
m_pRasterAnn->AnnSelectPoint (m_pRasterAnn->GetAnnContainer(), 300, 300);
if(m_pRasterAnn->AnnGetSelected (hPlgn))
{
m_pRasterAnn->AnnRemove (hPlgn);
m_pRasterAnn->AnnSetSelected (hPlgn, FALSE, FALSE);
}
else
m_pRasterAnn->AnnInsert (m_pRasterAnn->GetAnnContainer (), hPlgn, FALSE);

CString msg;
msg.Format(TEXT("Left: %f, Top: %f, Width: %f, Height:%f"),
(double)m_pRasterAnn->GetAnnSelectRectLeft (m_pRasterAnn->GetAnnContainer()),
(double)m_pRasterAnn->GetAnnSelectRectTop (m_pRasterAnn->GetAnnContainer ()),
(double)m_pRasterAnn->GetAnnSelectRectWidth (m_pRasterAnn->GetAnnContainer()),
(double)m_pRasterAnn->GetAnnSelectRectHeight (m_pRasterAnn->GetAnnContainer ()));


AnnSetAutoMenuItemEnable Example for Visual C++ 5.0

AnnSetAutoMenuItemEnable Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnsetautomenuenable()
{
// disable the Delete menu item from all the selected objects
CString strMsg = TEXT("");
OLE_HANDLE hAnnContainer = NULL;
hAnnContainer = m_pRasterAnn->GetAnnContainer();
m_pRasterAnn->AnnSetAutoMenuItemEnable(
hAnnContainer,
ANN_OBJECT_CONTAINER,
ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE | ANN_FLAG_SELECTED,
strMsg.AllocSysString()
);

// disable the Delete menu item from all the ellipse objects
OLE_HANDLE hAnnAutomation = NULL;
hAnnAutomation = m_pRasterAnn->GetAnnAutomation();
m_pRasterAnn->AnnSetAutoMenuItemEnable(
hAnnAutomation,
ANN_OBJECT_ELLIPSE, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED,
0,
strMsg.AllocSysString()
);
}


AnnSetAutoText Example for Visual C++ 5.0

AnnSetAutoText Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

void CTutorDlg::OnButtonAnnsetautotext()
{
BSTR bstrText;
CString strText;
m_pRasterAnn->AnnGetAutoText(ANN_AUTOTEXT_MENU_UNDO);
bstrText = m_pRasterAnn->GetAnnAutoText();
strText = bstrText;
::SysFreeString(bstrText);
strText += TEXT(" - New");
m_pRasterAnn->AnnSetAutoText(ANN_AUTOTEXT_MENU_UNDO,strText.AllocSysString());
}


AnnSetFillModeExt example for Visual C++

// The following example toggles through all supported fill modes for an annotation object.
// The background color is set to blue in each case
void CAnnCOMView::ExampleAnnGetFillModeExt()
{
int nRet = 0;
short nFillMode =0;
long hObject =0;

m_pltAnn->AnnCreate(ANN_OBJECT_HILITE, TRUE, TRUE);
hObject = m_pltAnn->GetAnnObject();
m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);

nRet = m_pltAnn->AnnSetSelected(hObject, TRUE, FALSE);
nRet = m_pltAnn->AnnGetFillModeExt(hObject);
nRet = m_pltAnn->AnnSetBackColor(hObject, RGB(0, 0, 255), TRUE);
nFillMode = m_pltAnn->AnnFillMode;

switch(nFillMode)
{
case ANN_FILLMODE_TRANSPARENT:
nFillMode = ANN_FILLMODE_TRANSLUCENT;
break;

case ANN_FILLMODE_TRANSLUCENT:
nFillMode = ANN_FILLMODE_OPAQUE;
break;

case ANN_FILLMODE_OPAQUE:
nFillMode = ANN_FILLMODE_ALPHA;
break;

case ANN_FILLMODE_ALPHA:
default:
nFillMode = ANN_FILLMODE_TRANSPARENT;
break;
}

// Arbitrarily set an alpha value of 128
// Note that this value is used only if the nFillMode is ANN_FILLMODE_ALPHA

nRet = m_pltAnn->AnnSetFillModeExt(hObject, nFillMode, 128, TRUE);

nRet = m_pltAnn->AnnGetFillModeExt(hObject);
if (m_pltAnn->AnnFillMode == ANN_FILLMODE_ALPHA)
{
CString strMsg;
strMsg.Format(TEXT("Alpha : %d"), m_pltAnn->AnnAlpha);
MessageBox(strMsg);
}
}


AnnSetMetaFile Example for Visual C++ 5.0

AnnSetMetafile Example for Visual C++

HMETAFILE hMeta;
VARIANT_BOOL bEnh;
hMeta = (HMETAFILE)m_pRasterAnn->AnnGetPredefinedMetafile (ANN_METAFILE_IMPORTANT );
bEnh = m_pRasterAnn->GetAnnPredefinedMetafileEnhanced();
m_pRasterAnn->AnnSetPredefinedMetafile (ANN_METAFILE_TOPSECRET, (long)hMeta);
m_pRasterAnn->AnnSetMetafile (hStamp, 0, ANN_METAFILE_TOPSECRET, FALSE);
AfxMessageBox(TEXT("stamp set to TopSecret"));

hMeta = (HMETAFILE)m_pRasterAnn->AnnGetMetafile (hStamp);
switch(::GetObjectType(hMeta))
{
case OBJ_ENHMETAFILE:
AfxMessageBox(TEXT("Type is EMF"));
case OBJ_METAFILE:
AfxMessageBox(TEXT("Type is WMF"));
}


AnnSetOptions example for Visual C++

void CAnnCOMView::ExampleAnnSetOptions()
{
long lOptions;
CString strMsg;

lOptions = m_pltAnn->AnnGetOptions();

if((lOptions & ANN_OPTIONS_NEW_SIDE_HANDLES))
{
lOptions &= !ANN_OPTIONS_NEW_SIDE_HANDLES;
strMsg = TEXT("Draw a rectangular object and select it. Note there are no side handles. Run this example again to enable the side handles.");
}
else
{
lOptions |= ANN_OPTIONS_NEW_SIDE_HANDLES;
strMsg = TEXT("Draw a rectangular object and select it. Note the side handles. Run this example again to disable the side handles.");
}

m_pltAnn->AnnSetOptions(lOptions);
MessageBox(strMsg);
}


AnnSetPolyFillMode Example for Visual C++ 5.0

AnnSetPolyFillMode Example for Visual C++

short nNodes;
VARIANT_BOOL bShow;
long nCount;
m_pRasterAnn->AnnSetFillPattern (hPlgn, (m_pRasterAnn->AnnGetFillPattern (hPlgn) + 1) % 7, FALSE);
m_pRasterAnn->AnnSetFillMode (hPlgn, (m_pRasterAnn->AnnGetFillMode (hPlgn) + 1) % 3, FALSE);
m_pRasterAnn->AnnSetPolyFillMode (hPlgn, 1 - m_pRasterAnn->AnnGetPolyFillMode (hPlgn), FALSE);
m_pRasterAnn->AnnSetLineStyle (hPlgn, (m_pRasterAnn->AnnGetLineStyle (hPlgn) + 1) % 6, FALSE);
m_pRasterAnn->AnnSetLineWidth (hPlgn, float(int(m_pRasterAnn->AnnGetLineWidth (hPlgn)) % 4 + 1), FALSE);
nNodes = m_pRasterAnn->AnnGetNodes (hPlgn);
bShow = m_pRasterAnn->GetAnnShowNodes();
m_pRasterAnn->AnnGetPointCount (hPlgn);
nCount = m_pRasterAnn->GetAnnPointCount();
m_pRasterAnn->AnnSetNodes (hPlgn, !bShow, short((nNodes + 1) % nCount), FALSE);


AnnSetROP2 Example for Visual C++ 5.0

AnnSetROP2 Example for Visual C++

m_pRasterAnn->AnnSetROP2 (hPlgn, (m_pRasterAnn->AnnGetROP2 (hPlgn) + 1) % 3, FALSE);


AnnSetSecondaryBitmap Example for Visual C++ 5.0

AnnSetSecondaryBitmap Example for Visual C++

m_pRasterAnn->AnnSetSecondaryBitmap (hPushPin, m_RasterView2.GetRaster(), FALSE);
m_pRasterAnn->PutAnnUserMode (ANN_USERMODE_RUN);
AfxMessageBox(TEXT("secondary bitmap set"));
m_pRasterAnn->AnnGetSecondaryBitmap (hPushPin, m_RasterView1.GetRaster ());


AnnSetTextOptions example for Visual C++

// The following example changes some of the text options of
// a text-based annotation. It changes the text color to blue,
// and toggles the ShowBorder option:
void CAnnCOMView::ExampleAnnSetTextOptions()
{
int nRet = 0;
long lOptions = 0;
CString strMsg;
long hObject;

m_pltAnn->AnnCreate(ANN_OBJECT_TEXT, TRUE, TRUE);
hObject = m_pltAnn->GetAnnObject();
m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);

lOptions = m_pltAnn->AnnGetOptions();
nRet = m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_TEXT_OPTIONS);
if (nRet != 0)
return;

nRet = m_pltAnn->AnnGetTextOptions(hObject, ANN_TEXT_SHOW_TEXT | ANN_TEXT_SHOW_BORDER | ANN_TEXT_TEXTCOLOR);
if (nRet != 0)
return;

strMsg.Format(TEXT("Old Options: ShowText[%d], ShowBorder[%d], TextColor[0x%x]"),
m_pltAnn->AnnShowText,
m_pltAnn->AnnShowBorder,
m_pltAnn->AnnTextColor);

MessageBox(strMsg);

// Change some options
nRet = m_pltAnn->AnnSetTextOptions(hObject, m_pltAnn->AnnShowText, !m_pltAnn->AnnShowBorder, RGB(0, 0, 255), 0, ANN_TEXT_SHOW_BORDER | ANN_TEXT_TEXTCOLOR, FALSE);
if (nRet != 0)
return;

nRet = m_pltAnn->AnnGetTextOptions(hObject, ANN_TEXT_SHOW_TEXT | ANN_TEXT_SHOW_BORDER | ANN_TEXT_TEXTCOLOR);
if (nRet != 0)
return;

strMsg.Format(TEXT("New Options: ShowText[%d], ShowBorder[%d], TextColor[0x%x]"),
m_pltAnn->AnnShowText,
m_pltAnn->AnnShowBorder,
m_pltAnn->AnnTextColor);

MessageBox(strMsg);
}


AnnSetUnit Example for Visual C++ 5.0

AnnSetUnit Example for Visual C++

short nUnit;
m_pRasterAnn->AnnGetUnit (hCrossProd);
nUnit = m_pRasterAnn->GetAnnUnit();
nUnit = (nUnit + 1) % 10;
m_pRasterAnn->AnnSetUnit (hCrossProd, nUnit | ANN_UNIT_DEF_ABBR, "", 2, FALSE);
m_pRasterAnn->AnnSetGaugeLength (hCrossProd, 3, FALSE);
CString msg;
msg.Format(TEXT("Unit: %s\nDistance: %f\nGauge Length: %f"),
(LPCTSTR)m_pRasterAnn->AnnGetUnit (hCrossProd),
(double)m_pRasterAnn->AnnGetDistance (hCrossProd),
(double)m_pRasterAnn->AnnGetGaugeLength (hCrossProd));
AfxMessageBox(msg);


AnnSetUser Example for Visual C++ 5.0

AnnSetUser Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnsetuser()
{
// hide the selected objects
OLE_HANDLE hAnnContainer = NULL;
hAnnContainer = m_pRasterAnn->GetAnnContainer();
m_pRasterAnn->AnnSetVisible(hAnnContainer, 0, ANN_FLAG_RECURSE | ANN_FLAG_SELECTED, "");

// set the selected objects to belong to user XXX
m_pRasterAnn->AnnSetUser(hAnnContainer, "", "xxx", VARIANT_TRUE);
}


AnnSetWnd Example for Visual C++ 5.0

AnnSetWnd Example for Visual C++

long oldWnd = m_pRasterAnn->AnnGetWnd (hPlgn);
m_pRasterAnn->AnnSetWnd (hPlgn, (long)m_hWnd);
m_pRasterAnn->AnnSetVisible (hPlgn, FALSE, 0, "");
m_pRasterAnn->AnnSetVisible(hPlgn, TRUE, 0, "");
AfxMessageBox(TEXT("will restore old window"));
m_pRasterAnn->AnnSetWnd (hPlgn, oldWnd);


AnnShowLockedIcon Example for Visual C++ 5.0

AnnShowLockedIcon Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

This example toggles the AnnShowLockedIcon property.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnshowlockedicon()
{
CString strMsg;
m_pRasterAnn->PutAnnShowLockedIcon(!m_pRasterAnn->GetAnnShowLockedIcon());
strMsg.Format(TEXT("AnnShowLockedIcon: %s "), m_pRasterAnn->GetAnnShowLockedIcon() == VARIANT_TRUE ? TEXT("True") : TEXT("False") );
AfxMessageBox(strMsg);
}


AnnTextAlign example for C++ 5 and later

void CTutorDlg::ExampleAnnTextAlginment(long hObject )
{
AnnObjectType ObjectType ;
long Align ;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_TEXT)
MessageBox(TEXT("This Object is not a Text Object"));

Align = m_pRasterAnn->GetAnnTextAlign(hObject);

if (Align = TEXT_ALIGN_CENTER )
Align = TEXT_ALIGN_LEFT;
else
Align = TEXT_ALIGN_CENTER;

m_pRasterAnn->Flags = 0;
m_pRasterAnn->PutAnnTextAlign(hObject,Align);

}


AnnTextEdit example for Visual C++

// This example programmatically makes an annotation text object
//hObject go into edit mode
//Note that hObject must be a text-based annotation

void CAnnCOMView::OnExampleAnnTextEdit ()
{
int nRet = 0;
CString szError;
long hObject;

m_pltAnn->AnnCreate(ANN_OBJECT_TEXT, TRUE, TRUE);
hObject = m_pltAnn->GetAnnObject();
m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);

nRet = m_pltAnn->AnnTextEdit(hObject);

switch(nRet)
{
case 0:
szError = "";
break;
case ERROR_AUTOMATION_INV_HANDLE:
szError = "AnnTextEdit failed because you are not in automated mode";
break;
case ERROR_INV_PARAMETER:
szError = "AnnTextEdit failed because hObject was not text-based";
break;
default:
szError = "AnnTextEdit failed";
break;
}

if (!szError.IsEmpty())
MessageBox(szError, TEXT("Error"), MB_OK);
}


AnnTextExpandTokens example for C++ 5 and later

void CTutorDlg::ExampleAnnTextExpandToken( long hObject)
{
AnnObjectType ObjectType ;
VARIANT_BOOL bTextExpandToken;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_TEXT)
MessageBox (TEXT("This Object is not an Text Object"));

bTextExpandToken = m_pRasterAnn->GetAnnTextExpandTokens(hObject);

bTextExpandToken = ~bTextExpandToken;

m_pRasterAnn->PutAnnTextExpandTokens(hObject,bTextExpandToken);

if (bTextExpandToken == TRUE)
MessageBox (TEXT("Text Expand Token"));
else
MessageBox (TEXT("Text Not Expand Token"));
}


AnnTextPointerFixed example for C++ 5 and later

void CTutorDlg::ExampleAnnTextPointerFixed(long hObject)
{
AnnObjectType ObjectType;
VARIANT_BOOL bTextPointerFixed;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_TEXT)
MessageBox (TEXT("This Object is not an Text Object"));

bTextPointerFixed = m_pRasterAnn->GetAnnTextPointerFixed(hObject);

if (bTextPointerFixed = TRUE)
bTextPointerFixed = FALSE;
else
bTextPointerFixed = TRUE;

m_pRasterAnn->PutAnnTextPointerFixed(hObject,bTextPointerFixed);

}


AnnTextRotate example for C++ 5 and later

void CTutorDlg::ExampleAnnTextRotate(long hObject)
{
AnnObjectType ObjectType ;
long Angle ;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_TEXT )
MessageBox(TEXT("This Object is not an Text Object"));

Angle = m_pRasterAnn->GetAnnTextRotate(hObject);

Angle = Angle + TEXT_ROTATE_90;

m_pRasterAnn->Flags = 0 ;
m_pRasterAnn->PutAnnTextRotate(hObject, Angle);

}


AnnTicMarkLength example for C++ 5 and later

void CTutorDlg::ExampleAnnTicMarkLength(long hObject)
{
AnnObjectType ObjectType;
double Length;

m_pRasterAnn->AnnGetType(hObject);
ObjectType = m_pRasterAnn->GetAnnType();

if (ObjectType != ANN_OBJECT_POLYRULER && ObjectType != ANN_OBJECT_RULER )
MessageBox(TEXT("This Object is not a POLYRULER or a RULER Object"));

Length = m_pRasterAnn->GetAnnTicMarkLength(hObject);

Length = Length + 10;

m_pRasterAnn->PutAnnTicMarkLength(hObject,Length);

}


AnnToolChecked example for Visual C++ 5.0

AnnToolChecked example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//This event is fired when the user clicks on an annotation toolbar button.
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnToolChecked(short iTool)
{
CString strMsg;

switch(iTool)
{
case ANN_TOOL_SELECT:
strMsg = TEXT("Selection pointer tool");
break;

case ANN_TOOL_LINE:
strMsg = TEXT("Line tool");
break;

case ANN_TOOL_RECT:
strMsg = TEXT("Rectangle tool");
break;

case ANN_TOOL_ELLIPSE:
strMsg = TEXT("Ellipse tool");
break;
//...
//...
//...
default:
strMsg = TEXT("User defined tool");
break;
}

AfxMessageBox(strMsg);
}


AnnToolDestroy example for Visual C++ 5.0

AnnToolDestroy example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//AnnToolDestroy gets fired when the user closes the annotation toolbar
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnToolDestroy()
{
AfxMessageBox(TEXT("You have closed the toolbar."));
}


AnnUndo Example for Visual C++ 5.0

AnnUndo Example for C++ 5.0 and later

'This example does an "undo" on the last annotation change.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

'Note that AnnUndoEnable must be set to TRUE
void CTutorDlg::OnButtonAnnundo()
{
m_pRasterAnn->AnnUndo();
}


AnnUndoEnable Example for Visual C++ 5.0

AnnUndoEnable Example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example sets the annotation undo depth to 10 and
//enables the annotation undo capability
void CTutorDlg::OnButtonAnnundoenable()
{
m_pRasterAnn->PutAnnUndoEnable (TRUE);
m_pRasterAnn->PutAnnUndoDepth(10);
}


AnnUngroup Example for Visual C++ 5.0

AnnUngroup Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

void CTutorDlg::OnButtonAnnungroup()
{
OLE_HANDLE hAnnContainer = NULL;
hAnnContainer = m_pRasterAnn->GetAnnContainer ();
m_pRasterAnn->AnnUngroup(hAnnContainer, ANN_FLAG_SELECTED | ANN_FLAG_RECURSE, "");
}


AnnUnlock Example for Visual C++ 5.0

AnnUnlock Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This is also the example for AnnGetLocked method.
//If an object is found to be locked, using AnnGetLocked method, the object is unlocked, by AnnUnlock, using the key "abcd".
//m_hGlobalAnn is a global handle to an annotation object
void CTutorDlg::OnButtonAnnunlock()
{
VARIANT_BOOL bLocked;
m_pRasterAnn->AnnGetLocked(m_hGlobalAnn);
bLocked = m_pRasterAnn->GetAnnLocked();
if (bLocked = VARIANT_TRUE)
m_pRasterAnn->AnnUnlock(m_hGlobalAnn, "abcd");
}


AnnUnlocked example for Visual C++ 5.0

AnnUnlocked example for C++ 5.0 and later

For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"

//The following is an example of an AnnUnlocked event.
//
//For details on event handling of the COM objects in MFC,
// and m_pDlg and m_pRasterAnn delcarations, refer to
// the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnUnlocked(long hAnnObject)
{
CString strMsg;

strMsg.Format(TEXT("AnnObject: %x was unlocked."), hAnnObject);
AfxMessageBox(strMsg);
}


AnnUnrealize Example for Visual C++ 5.0

AnnUnrealize Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

'This examples Unrealizes all redact objects in the container.
void CTutorDlg::OnButtonAnnunrealize()
{
m_pRasterAnn->AnnUnrealize(m_pRasterAnn->GetAnnContainer(), TRUE);
}


AntiAlias example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->AntiAlias (m_RasterView1.GetRaster(), 128, 3, ANTIALIAS_1);

pRasterProc->Release();


Appearance Example for Visual C++ 5.0

Appearance Example for C++ 5.0 and later

This example toggles the Appearance property.

void CTutorDlg::OnButton1()
{
if (m_LEADRasterView1.GetAppearance() == RASTERVIEW_APPEARANCE_FLAT)
m_LEADRasterView1.SetAppearance(RASTERVIEW_APPEARANCE_THREED);
else
m_LEADRasterView1.SetAppearance(RASTERVIEW_APPEARANCE_FLAT);
}


ApplyMathLogic Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ApplyMathLogic(m_LeadRasterView.GetRaster (),151,AML_OP_MUL |
CHANNEL_MASTER |
AML_VALUE_NOP |
AML_RES_NOP);

m_pRasterProc->Release();


ApplyModalityLUT2 Example for C++ 5.0 and later

int CTestImgProcView::TestModalityLUT(BOOL bLinear)
{
SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
int nRet;
sabFldData[0].cElements = 65536;
sabFldData[0].lLbound = 0;
HRESULT hr;
SAFEARRAY * psaFieldData = SafeArrayCreate(VT_VARIANT | VT_I4, 1, sabFldData);
long ix[1]; //For the position of the elements within the array.
long data;

if (bLinear)
{
nRet = m_pRasterProc->ApplyLinearModalityLUT(m_LeadRasterView.GetRaster(), 0, 0.5, 0);
}
else
{
for(int i = 0; i < 65536; ++i)
{
ix[0] = i;
data = i/2;
hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

VariantInit(&vData);

V_VT(&vData) = VT_ARRAY | VT_I4;
vData.parray = psaFieldData;
m_pRasterProc->ApplyModalityLUT2(m_LeadRasterView.GetRaster(), vData, 0, 0);
}
return nRet;
}


ApplyModalityLUT Example for C++ 5.0 and later

int CTestImgProcView::TestModalityLUT(BOOL bLinear)
{
ILEADRasterVariant * pRasterVar = NULL;
CoCreateInstance(
CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVar
);

pRasterVar->Type = VALUE_ARRAY_LONG;
pRasterVar->ItemCount = 65536;

if (bLinear)
{
nRet = m_pRasterProc->ApplyLinearModalityLUT(m_LeadRasterView.GetRaster(), 0, 0.5, 0);
}
else
{
for(int i = 0; i < 65536; ++i)
{
pRasterVar->PutLongItemValue(i, i/2);
}
m_pRasterProc->ApplyModalityLUT(m_LeadRasterView.GetRaster(), pRasterVar, 0, 0);
}
return nRet; }


ApplyVOILUT2 Example for C++ 5.0 and later

int CTestImgProcView::TestVOI2LUT(BOOL bLinear)
{
SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
int nRet;
sabFldData[0].cElements = 4096;
sabFldData[0].lLbound = 0;
HRESULT hr;
SAFEARRAY * psaFieldData = SafeArrayCreate(VT_VARIANT | VT_I4, 1, sabFldData);
long ix[1]; //For the position of the elements within the array.
long data;

if (bLinear)
{
nRet = m_pRasterProc->ApplyLinearVOILUT(m_LeadRasterView.GetRaster(), 0, 0.5, 0);
}
else
{
for(int i = 0; i < 4096; ++i)
{
if(i<30)
{
ix[0] = 0;
data = 0;
hr = SafeArrayPutElement(psaFieldData, ix, &data);
}
else
if (i > 630)
{
ix[0] = 630;
data = 630;
hr = SafeArrayPutElement(psaFieldData, ix, &data);
}
else
{
ix[0] = i;
data = i;
hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

}

VariantInit(&vData);

V_VT(&vData) = VT_ARRAY | VT_I4;
vData.parray = psaFieldData;
m_pRasterProc->ApplyVOILUT2(m_LeadRasterView.GetRaster(), vData, 0, 0);
}
return nRet;
}


ApplyVOILUT Example for C++ 5.0 and later

int CTestImgProcView::TestVOILUT(BOOL bLinear)
{
ILEADRasterVariant * pRasterVar = NULL;
CoCreateInstance(
CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVar
);

pRasterVar->Type = VALUE_ARRAY_LONG;
pRasterVar->ItemCount = 4096;
if (bLinear)
{
nRet = m_pRasterProc->ApplyLinearVOILUT(m_LeadRasterView.GetRaster(), 0, 0.5, 0);
}
else
{
for(int i = 0; i < 4096; ++i)
{
if(i<30)
{
pRasterVar->PutLongItemValue(i, 0);
}
else
if (i > 630)
{
pRasterVar->PutLongItemValue(i,630);
}
else
{
pRasterVar->PutLongItemValue(i,i);
}

}

m_pRasterProc->ApplyVOILUT(m_LeadRasterView.GetRaster(), pRasterVar, 0, 0);
}
return nRet;
}


AutoAnimate Example for Visual C++ 5.0

AutoAnimate Example for C++ 5.0 and later

This example gets information about an animated file, uses the information to position the LEAD control, and plays the animation as it loads the file.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Declare variables for positioning the control.
int DisplayWidth, DisplayHeight, DisplayLeft, DisplayTop;
// Force continued looping after the file loads.
m_LEADRasterView1.SetAutoAnimationLoop(AUTOANIMATIONLOOP_INFINITE);
// Get information about the file we will load.
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\eye.gif", 0, 0 );
// Exit if this is not an animated file.
if(pRasterIO->GetInfoAnimation() == FALSE)
{
MessageBox(TEXT("Not an animated file"), TEXT("Error"));
return;
}
// Calculate information for centering the LEAD control.
CRect rcClient;
GetClientRect(rcClient);
DisplayWidth = (int) pRasterIO->GetInfoAnimationWidth();
DisplayHeight = (int) pRasterIO->GetInfoAnimationHeight();
DisplayLeft = (rcClient.right - DisplayWidth) / 2;
DisplayTop= (rcClient.bottom - DisplayHeight) / 2;
// Center the LEAD control.
CRect rcWindow;
rcWindow.SetRect(DisplayLeft, DisplayTop,
DisplayLeft + DisplayWidth,
DisplayTop + DisplayHeight);
m_LEADRasterView1.MoveWindow(rcWindow);
// Set properties for playing the animation as is loads.
m_LEADRasterView1.SetAutoAnimate(TRUE);
m_LEADRasterView1.SetAutoRepaint(TRUE);
// Load the animated file.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\eye.gif", 0, 0, -1);
pRasterIO->Release();


AutoBinary Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AutoBinary(m_LeadRasterView.GetRaster ());
m_pRasterProc->Release();


AutoColorLevel Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AutoColorLevel(m_LeadRasterView.GetRaster (), 50, 50, AUTO_LEVEL);
m_pRasterProc->Release();


AutoPan Example for Visual C++ 5.0

AutoPan Example for C++ 5.0 and later

m_LEADRasterView1.SetAutoPan(TRUE);


AutoSegment Example for Visual C++ 5.0

AutoSegment Example for C++ 5.0 and later

void CT44Dlg::OnAutoSeg()
{
//Instantiate the sink class and hold a pointer to it.
m_pRasterMrcSink = new CRasterMrcSink;
m_pRasterMrcSink->m_pView = this;

ILEADRasterMrc* pRasterMrc;
ILEADRasterMrc* pRasterMrcDst;
int nSegID;
//Create the RasterMrc object
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrc);
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrcDst);

pRasterMrc->BaseBackColor = RGB(200, 255, 255);
pRasterMrc->BaseForeColor = RGB(0, 80, 0);
pRasterMrc->CombineFactor = 30;
pRasterMrc->CombineFlags = COMBINE_TRY;
pRasterMrc->Sensitivity = 25;
pRasterMrc->ImageType = IMAGETYPE_SCANNED;
pRasterMrc->AutoSegment(m_RasterView.GetRaster(), 60, 60);
pRasterMrc->EnumSegments();
pRasterMrc->CombineFlags = COMBINE_FORCE;
pRasterMrc->CombineSegments(0, 1);
pRasterMrc->SaveSegmentation("C:\\segments.sgm");
pRasterMrcDst->LoadSegmentation(m_RasterView.GetRaster(), "C:\\segments.sgm");
pRasterMrc->StopSegmentation();
pRasterMrc->StartSegmentation(m_RasterView.GetRaster());
nSegID = pRasterMrc->CreateNewSegment(m_RasterView.GetRaster(), 10, 10, 100, 100, SEGTYPE_PICTURE);
pRasterMrc->SetSegmentData(m_RasterView.GetRaster(), nSegID, 0, 0, 10, 10, SEGTYPE_TEXT_1BIT_BW);
pRasterMrcDst->StopSegmentation();
pRasterMrcDst->CopySegmentationHandle(pRasterMrc);
pRasterMrc->EnumSegments();
pRasterMrc->DeleteSegment(nSegID);
pRasterMrcDst->StopSegmentation();
pRasterMrcDst->StopSegmentation();
pRasterMrc->Release();
pRasterMrc = NULL;
pRasterMrcDst->Release();
pRasterMrcDst = NULL;
}
void CRasterMrcSink:: EnumSegments(long nSegId, long SegmentLeft, long SegmentTop,
long SegmentRight, long SegmentBottom,
MRCSegmentTypeConstants SegType)
{
ILEADRasterFXD *pRasterFXD=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFXD);

pRasterFXD->put_DrawPenWidth(2);
pRasterFXD->put_DrawFillStyle(DRAWFILLSTYLE_TRANSPARENT);
pRasterFXD->put_DrawMode(DRAWMODE_COPY_PEN);

if (SegType == SEGTYPE_TEXT_1BIT_BW)
pRasterFXD->put_DrawPenColor(0);
else if (SegType == SEGTYPE_TEXT_1BIT_COLORED)
pRasterFXD->put_DrawPenColor(RGB(255, 225, 0));
else if (SegType == SEGTYPE_TEXT_2BIT_COLORED)
pRasterFXD->put_DrawPenColor(RGB(0, 255, 0));
else if (SegType == SEGTYPE_GRAYSCALE_2BIT)
pRasterFXD->put_DrawPenColor(RGB(0, 0, 255));
else if (SegType == SEGTYPE_GRAYSCALE_8BIT)
pRasterFXD->put_DrawPenColor(RGB(255, 255, 255));
else if (SegType == SEGTYPE_PICTURE)
pRasterFXD->put_DrawPenColor(RGB(255, 0, 0));

pRasterFXD->DrawRectangle(NULL, m_pView->m_RasterView.GetClientDC(), SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom - SegmentTop);

pRasterFXD->Release();
}


AutoSize Example for Visual C++ 5.0

AutoSize Example for C++ 5.0 and later

This example shows how the AutoSize property works when loading and when rotating an image.

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView1.SetAutoSize(TRUE);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\eagle.cmp", 0, 0, 1);
MessageBox (TEXT("Control is sized to fit the loaded bitmap"), TEXT("Notice"), MB_OK);
pRasterProc->Rotate(m_LEADRasterView1.GetRaster(),
4500, ROTATE_RESIZE, RGB(0,0,0));
MessageBox (TEXT("Control is sized to fit the rotated bitmap"), TEXT("Notice"), MB_OK);
pRasterIO->Release();
pRasterProc->Release();


AutoTrim example for Visual C++ 5.0

AutoTrim example for C++ 5.0 and later

This example trims the bitmap with threshold of 10.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->AutoTrim(m_LEADRasterView1.GetRaster(), 10);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Average example for Visual C++ 5.0

Average example for C++ 5.0 and later

This example applies an average filter with a 3x3 neighborhood and redisplays the bitmap.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Average(m_LEADRasterView1.GetRaster(), 3);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


BackColor (ILEADRasterImgList) example for Visual C++ 5.0

BackColor (ILEADRasterImgList) example for C++ 5.0 and later

//set the background color to red
m_LEADImageList.SetBackColor(RGB(255, 0, 0));


BackColor example for Visual C++ 5.0

BackColor example for C++ 5.0 and later

This example sets the background color to red. You can zoom out to see the background color.

m_LEADRasterView1.SetBackColor(RGB(255, 0, 0));


BackErase example for Visual C++ 5.0

BackErase example for C++ 5.0 and later

This example turns off repainting of the background, then zooms out to show the effect when repainting.

m_LEADRasterView1.SetBackErase(FALSE);
m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView1.SetAutoScroll(FALSE);
// Calculate the values to zoom out by 10 percent and center the image.
m_LEADRasterView1.SetDstWidth(m_LEADRasterView1.GetDstWidth() * 0.9f);
m_LEADRasterView1.SetDstHeight(m_LEADRasterView1.GetDstHeight() * 0.9f);
m_LEADRasterView1.SetDstTop((m_LEADRasterView1.GetScaleHeight() - m_LEADRasterView1.GetDstHeight()) / 2);
m_LEADRasterView1.SetDstLeft((m_LEADRasterView1.GetScaleWidth() - m_LEADRasterView1.GetDstWidth()) / 2);
// Set the clipping area to the same as the destination rectangle
m_LEADRasterView1.SetDstClipWidth(m_LEADRasterView1.GetDstWidth());
m_LEADRasterView1.SetDstClipHeight(m_LEADRasterView1.GetDstHeight());
m_LEADRasterView1.SetDstClipTop(m_LEADRasterView1.GetDstTop());
m_LEADRasterView1.SetDstClipLeft(m_LEADRasterView1.GetDstLeft());
// Redisplay the image
m_LEADRasterView1.ForceRepaint();


BalanceColors example for Visual C++ 5 and later

float RedFactToRed = 0.25f;
float RedFactToGreen = 0.5f;
float RedFactToBlue = 0.25f;
float GreenFactToRed = 0.3f;
float GreenFactToGreen = 0.4f;
float GreenFactToBlue = 0.3f;
float BlueFactToRed = 0.1f;
float BlueFactToGreen = 0.6f;
float BlueFactToBlue = 0.3f;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->BalanceColors (m_RasterView.GetRaster (), RedFactToRed, RedFactToGreen, RedFactToBlue, GreenFactToRed, GreenFactToGreen, GreenFactToBlue, BlueFactToRed, BlueFactToGreen, BlueFactToBlue);
pRasterProc->Release();


Bending Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Bending(m_LeadRasterView.GetRaster(),100, 20, 100, 0, FILL_RPT |FILL_WOUTROT | BND_NORM );
m_pRasterProc->Release();


BinaryFilter example for Visual C++ 5.0

BinaryFilter example for C++ 5.0 and later

This example does omni-directional erosion of black objects and repaints the image.

//You must unlock support for this feature
//L_KEY_DOCUMENT represents the unlock support string

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->PutEnableMethodErrors(FALSE);
int nRet = pRasterProc->BinaryFilter(m_LEADRasterView1.GetRaster(),BFLT_EROSION_OMNI);
if (nRet != 0)
{
CString strErr;
strErr.Format(TEXT("BinaryFilter Error: %d\n"), nRet);
AfxMessageBox(strErr);
}
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


BitmapAlpha example for Visual C++ 5.0

BitmapAlpha example for C++ 5.0 and later

This example shows how to use the BitmapAlpha property to save a region in a file's alpha channel. It also shows how to use the region as a mask for transparency.

float rgntop;
float rgnleft;
float rgnwidth;
float rgnheight;
long hRGN;
long test;

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

m_LEADRasterView1.SetScaleMode (3);
pRasterIO->Load (m_LEADRasterView1.GetRaster (), "v:\\images\\eagle.cmp", 0, 0, 1);
m_LEADRasterView1.SetAutoRepaint (FALSE);
// Get an alpha channel bitmap, and fill it with white
m_LEADRasterView2.GetRaster().SetBitmap (m_LEADRasterView1.GetRaster().GetBitmapAlpha ());

m_LEADRasterView2.GetRaster().SetRgnColor (RGB(0, 0, 0), L_RGN_SETNOT);
test = m_LEADRasterView2.GetRaster().GetRgnArea ();

// test here, if test = 0, then Alpha is all Black
if (test == 0)
AfxMessageBox(TEXT("Alpha image is all black"));

pRasterProc->Fill (m_LEADRasterView2.GetRaster(), RGB(255, 255, 255));
rgntop = 0;
rgnleft = 0;
rgnwidth = m_LEADRasterView1.GetRaster().GetBitmapWidth ();
rgnheight = m_LEADRasterView1.GetRaster().GetBitmapHeight ();
// Create an elliptical region in the AlphaBitmap
m_LEADRasterView2.GetRaster().SetRgnEllipse (rgntop, rgnleft, rgnwidth, rgnheight, L_RGN_SET);
// Fill the region with black
pRasterProc->Fill (m_LEADRasterView2.GetRaster(), RGB(0, 0, 0));
// Free the region
m_LEADRasterView2.GetRaster().FreeRgn ();
// Update the alpha channel in the main bitmap
m_LEADRasterView1.GetRaster().SetBitmapAlpha (m_LEADRasterView2.GetRaster().GetBitmap ());
// Save the bitmap as 32-bit TGA
pRasterIO->Save (m_LEADRasterView1.GetRaster(), "d:\\temp\\test.tga", FILE_TGA, 32, (QFactorConstants)0, SAVE_OVERWRITE);
// Free the bitmaps
m_LEADRasterView1.GetRaster().SetBitmap (0);
m_LEADRasterView2.GetRaster().SetBitmap(0);
// Load the bitmap we just saved and get the alpha channel
pRasterIO->Load (m_LEADRasterView1.GetRaster(), "d:\\temp\\test.tga", 0, 0, 1);
m_LEADRasterView2.GetRaster().SetBitmap (m_LEADRasterView1.GetRaster().GetBitmapAlpha ());
// Create a region in the AlphaBitmap that includes all of the black pixels
m_LEADRasterView2.GetRaster().SetRgnColor (RGB(0, 0, 0), L_RGN_SET);
// Get the region from the AlphaBitmap and set it into the main bitmap
hRGN = m_LEADRasterView2.GetRaster().GetRgnHandle ();
m_LEADRasterView1.GetRaster().SetRgnHandle (hRGN, 0, 0, L_RGN_SET);
m_LEADRasterView1.SetPaintRgnOnly (TRUE);
m_LEADRasterView1.ForceRepaint ();
pRasterIO->Release();


BitmapBytesPerLine example for Visual C++ 5.0

BitmapBytesPerLine example for C++ 5.0 and later

ILEADRasterIO *RasterIO = NULL;
CString strOut;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&RasterIO);
RasterIO->Load(m_RasterView.GetRaster(),"c:\\1.bmp",0,0,1);
strOut.Format("Bytes Per Line = %d", m_RasterView.GetRaster().GetBitmapBytesPerLine( ) );
RasterIO->Release();


BitmapCompression example for Visual C++ 5.0

BitmapCompression example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

// This example toggles the bitmap's compression
long oldSize = m_RasterView1.GetRaster ().GetBitmapSize();

if(m_RasterView1.GetRaster().GetBitmapCompression() == COMP_NONE)
{
// Compress the bitmap
if(m_RasterView1.GetRaster().GetBitmapBits () == 24)
pRasterProc->SetBitmapCompression(m_RasterView1.GetRaster(), COMP_SUPER);
else if(m_RasterView1.GetRaster().GetBitmapBits () == 1)
pRasterProc->SetBitmap Compression(m_RasterView1.GetRaster(), COMP_RLE);
}
else // Bitmap is compressed. Uncompress it
pRasterProc->SetBitmap Compression(m_RasterView1.GetRaster(), COMP_NONE);

CString strMsg;
strMsg.Format(TEXT("old Size = %ld\nNew Size = %ld"), oldSize, m_RasterView1.GetRaster().GetBitmapSize());
AfxMessageBox(strMsg);

pRasterProc->Release();


BitmapDataPath Example for Visual C++ 5.0

BitmapDataPath Example for C++ 5.0 and later

This example shows how to load an image from the Internet. It uses the BitmapDataPath property to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.

NOTE: This is not a complete example for handing events, some steps have been omitted. For a complete example of how to handle events, refer to the example Updating a Gauge and Detecting a User Interrupt.

void CTutorDlg::OnOK()
{
// Start the asynchronous load.
m_pRasterIO->BitmapDataPath(m_LEADRasterView1.GetRaster(),
"http://www.leadtools.com/images/tiger2.cmp");
}

void CRasterIOSink::OnReadyStateChange(long ReadyState)
{
// Paint the image when loading is complete.
if(ReadyState == READYSTATE_COMPLETE)
{
m_pDlg->m_LEADRasterView1.SetAutoSetRects(TRUE);
m_pDlg->m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);
m_pDlg->m_LEADRasterView1.ForceRepaint();
}
}


BitmapDpi Example for C++ 5.0 and later

BitmapDpi Example for Visual C++

float x, y;
long hAuto;
m_pRasterAnn->AnnCreate (ANN_OBJECT_AUTOMATION, FALSE, FALSE);
hAuto = m_pRasterAnn->GetAnnObject();
x = m_pRasterAnn->AnnGetBitmapDpiX (hAuto);
y = m_pRasterAnn->AnnGetBitmapDpiY (hAuto);
CString msg;
msg.Format(TEXT("X: %f, Y: %f"), (double)x, (double)y);
AfxMessageBox(msg);
m_pRasterAnn->AnnSetBitmapDpiX (hAuto, x + 2, FALSE);
m_pRasterAnn->AnnSetBitmapDpiY (hAuto, y + 2, FALSE);
x = m_pRasterAnn->AnnGetBitmapDpiX (hAuto);
y = m_pRasterAnn->AnnGetBitmapDpiY (hAuto);
msg.Format(TEXT("X: %f, Y: %f"), (double)x, (double)y);
AfxMessageBox(msg);


BitmapToClient example for C++ 5.0 and later

CString szOut;

//Test a bitmap location for its screen location
m_LEADRasterView1.SetScaleMode (3); //pixels b/c I'm passing pixels
m_LEADRasterView1.BitmapToClient (50.0f, 50.0f);
szOut.Format(TEXT("\nClientX = %d\nClientY = %d"),
(long)m_LEADRasterView1.GetConvertX (),
(long)m_LEADRasterView1.GetConvertY ());
AfxMessageBox(szOut);


BitmapXres and BitmapYres example for Visual C++ 5.0

BitmapXres and BitmapYres example for C++ 5.0 and later

This example sets the bitmap's resolution to 300 x 600 DPI.

CString strMsg;
int xRes, yRes;
m_LEADRasterView1.GetRaster().SetBitmapXRes(300);
m_LEADRasterView1.GetRaster().SetBitmapYRes(600);

xRes = m_LEADRasterView1.GetRaster().GetBitmapXRes();
yRes = m_LEADRasterView1.GetRaster().GetBitmapYRes();
strMsg.Format(TEXT("xRes[%d] yRes[%d]"), xRes, yRes);
AfxMessageBox(strMsg);


BitonalScaling (ILEADRasterImgList) example for Visual C++ 5.0

BitonalScaling (ILEADRasterImgList) example for C++ 5.0 and later

m_LEADImageList.SetBitonalScaling(IMGLST_BITONALSCALING_NORMAL);
m_LEADImageList.LoadFromFile("G:\\Images\\MultiPage.tif", 1, 1, -1);
m_LEADImageList.EnsureVisible(m_LEADImageList.GetCount() - 1);
//force redrawing
m_LEADImageList.RedrawWindow ();
AfxMessageBox(TEXT("will enable bitonal scale to gray"));
//set the control to use scale to gray
m_LEADImageList.SetBitonalScaling(IMGLST_BITONALSCALING_SCALETOGRAY);
//force redrawing
m_LEADImageList.RedrawWindow ();


BitonalScaling example for Visual C++ 5.0

BitonalScaling example for C++ 5.0 and later

This example sets the display to use scale-to-gray and repaints the image. This affects only 1-bit images.

if (m_LEADRasterView1.GetRaster().IsSupportLocked(L_SUPPORT_DOCUMENT))
{
CString cMsg(TEXT("No scale to gray - You need to unlock Document/Medical capabilities"));
MessageBox(cMsg, TEXT("Error"));
}
else
{
m_LEADRasterView1.SetBitonalScaling(BITONALSCALING_SCALETOGRAY);
m_LEADRasterView1.ForceRepaint();
}


BooleanItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_ARRAY_BOOLEAN;
pltRasVar->ItemCount = 2;
pltRasVar->BooleanItemValue[0] = TRUE;
pltRasVar->BooleanItemValue[1] = FALSE;


BooleanValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_BOOLEAN;
pltRasVar->BooleanValue = TRUE;


BorderColor example for Visual C++ 5.0

BorderColor example for Visual C++ 5.0 and later

//This sets the border style to Fixed Single.
//And sets the border color to blue.
m_LEADImageList.SetAppearance(IMGLST_APPEARANCE_FLAT);
m_LEADImageList.SetBorderStyle(1);
m_LEADImageList.SetBorderColor(RGB(0, 0, 255));


BorderRemove example for Visual C++ 5.0

BorderRemove example for C++ 5.0 and later

void CTutorDlg::OnBorderRemove()
{
//Border Remove
//This example returns a region corresponding to the borders of a bitmap
//For the example, windows regions are returned in the BorderRemove Event and combined.
//In practice it would be easier and faster to just return a LEAD region representing the changes
//The border is removed from the image

//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);
//
//The following is declared in the CTutorDlg class
// HRGN m_hRgnAll;
//
//NOTE: This is not a complete example for handing events, some steps have been omitted.
//For a complete example of how to handle events, refer to the example
//Updating a Gauge and Detecting a User Interrupt.

int nRet;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;

//Enable the doc clean event
m_pRasterProc->EnableDocCleanEvents = TRUE;

//Create a NULL region
m_hRgnAll = NULL;
m_hRgnAll = CreateRectRgn(0, 0, 0, 0);
nRet = m_pRasterProc->BorderRemove(
m_LEADRasterView1.GetRaster(),
(BorderRemoveFlags)(BORDER_CALLBACK_REGION | BORDER_USE_VARIANCE),
BORDER_ALL,
20,
9,
3);

if (nRet == 0)
{
m_LEADRasterView1.GetRaster().FreeRgn();
m_LEADRasterView1.GetRaster().SetRgnHandle((long)m_hRgnAll, 0, 0, L_RGN_SET);
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
}

//delete the Windows Rgn
DeleteObject(m_hRgnAll);
m_hRgnAll = NULL;
}

void CRasterProcSink::OnBorderRemov(
long hRgn,
long uBorderToRemove,
float fBoundingRectLeft,
float fBoundingRectTop,
float fBoundingRectWidth,
float fBoundingRectHeight)
{
TCHAR pszBorder = TEXT("");
CString strMsg;

CombineRgn(m_pDlg->m_hRgnAll, m_pDlg->m_hRgnAll, (HRGN)hRgn, RGN_OR);

switch (uBorderToRemove)
{
case BORDER_TOP:
pszBorder = TEXT("Top");
break;

case BORDER_LEFT:
pszBorder = TEXT("Left");
break;

case BORDER_RIGHT:
pszBorder = TEXT("Right");
break;

case BORDER_BOTTOM:
pszBorder = TEXT("Bottom");
break;
}
strMsg.Format(TEXT("Border[%s] Bounds[Left,Top,Width,Height][%0.0f,%0.0f %0.0f,%0.0f]\n"),
pszBorder,
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight);
OutputDebugString(strMsg);

m_pDlg->m_pRasterProc->DocCleanSuccess = SUCCESS_NOREMOVE;
}


BorderStyle example for Visual C++ 5.0

BorderStyle example for C++ 5.0 and later

This example toggles the border style and repaints the image.

if (m_LEADRasterView1.GetBorderStyle() == 1)
m_LEADRasterView1.SetBorderStyle(0);
else
m_LEADRasterView1.SetBorderStyle(1);
m_LEADRasterView1.ForceRepaint();


BricksTexture example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->BricksTexture(m_LeadRasterView.GetRaster(), 60, 20, 0, 0, 3, 4, 315, 33, 20, 0, 10, 0, 0, BRICKS_SMOOTHEDOUT);
m_pRasterProc->Release();


BrowseDir example for Visual C++ 5.0

BrowseDir example for C++ 5.0 and later

m_pRasterThumbnail->PutEnableMethodErrors(FALSE);
m_pRasterThumbnail->PutStopOnError(FALSE);

m_pRasterThumbnail->PutFilter("*.*"); //search for all files

m_pRasterThumbnail->PutThumbnailWidth(150);
m_pRasterThumbnail->PutThumbnailHeight(150);
m_pRasterThumbnail->PutThumbnailBitsPerPixel(0);

m_pRasterThumbnail->PutMaintainAspect(TRUE);
m_pRasterThumbnail->PutForceSize(TRUE);
m_pRasterThumbnail->PutThumbnailBackgroundColor(RGB(0, 255, 0));

m_pRasterThumbnail->PutLoadStamp(TRUE);
m_pRasterThumbnail->PutResample(TRUE);

m_pRasterThumbnail->PutIncludeSubDirectories(FALSE);

m_pRasterThumbnail->PutExpandMultipage(FALSE);

m_pRasterThumbnail->PutMaxSizeDisk(0); //no filesize limit
m_pRasterThumbnail->PutMaxSizeMem(0); //no image size limit

m_pRasterThumbnail->PutDitherFlags(THMB_CRD_STUCKIDITHERING);
m_pRasterThumbnail->PutPaletteFlags(THMB_CRP_FIXEDPALETTE);

m_pRasterThumbnail->BrowseDir("g:\\images");


BumpMap Example for C++ 5.0 and later

ILEADRaster* m_pTmpRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pTmpRaster);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load (m_pTmpRaster, "c:\1.jpg", 0, 0, 1);
m_pRasterProc->BumpMap (m_LeadRasterView.GetRaster (), m_pTmpRaster, 5,
0,
3,
0,
0,
0,
0,
true,
50,
0);

m_pTmpRaster->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


ButtonColumns example for Visual C++ 5.0

ButtonColumns example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This sample resizes the annotation toolbar so that it has an additional column
void IncrementButtonColumns (ILEADRasterAnnToolBar * pAnnToolBar)
{
if ((pAnnToolBar) && (pAnnToolBar->GetToolBarhWnd()))
{
pAnnToolBar->PutButtonColumns(pAnnToolBar->GetButtonColumns() + 1);
}
}


ButtonMenuTool example for Visual C++ 5.0

ButtonMenuTool example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//Makes the first rubber stamp tool draw a rectangle.
void SetToolToRect (ILEADRasterAnnToolBar * pAnnToolbar)
{
int i;
for(i=0; i<pAnnToolbar->GetButtonCount(); i++)
{
// is this the button with the rubber stamps ?
if(pAnnToolbar->GetButtonToolCount(i) > 1)
pAnnToolbar->PutButtonMenuTool(i, 0, ANN_TOOL_RECT);
}
}


ButtonRows example for Visual C++ 5.0

ButtonRows example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This sample resizes the annotation toolbar so that it has an additional column.
void IncrementButtonRows (ILEADRasterAnnToolBar * pAnnToolBar)
{
if ((pAnnToolBar) && (pAnnToolBar->GetToolBarhWnd()))
{
pAnnToolBar->PutButtonRows(pAnnToolBar->GetButtonRows() + 1);
}
}


ButtonVisible example for Visual C++ 5.0

ButtonVisible example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the visible state of the button corresponding to iButtonIndex.
//The button index is zero based
void ToggleVisibleState (ILEADRasterAnnToolBar * pAnnToolBar, short iButtonIndex)
{
VARIANT_BOOL bVisible;
bVisible = pAnnToolBar->GetButtonVisible(iButtonIndex);
pAnnToolBar->PutButtonVisible(iButtonIndex, !bVisible);
}


Canvas example for Visual C++

ILEADRaster* m_pTmpRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pTmpRaster);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pTmpRaster, "c:\Sample1.jpg", 0, 0, 1);

m_pRasterProc->Canvas(m_LeadRasterView.GetRaster(), m_pTmpRaster, 100, 100, 0, 0, 10, CANVAS_SHIFT);

m_pTmpRaster->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


Capture example for Visual C++ 5.0

Capture example for C++ 5.0 and later

This example captures the current form and displays the captured image with scroll bars.

// Turn on the automatic display rectangles.
m_LEADRasterView1.SetAutoSetRects(TRUE);
CRect rcWindow;
GetWindowRect(&rcWindow);
m_LEADRasterView1.GetRaster().Capture(0, (float) rcWindow.left, (float) rcWindow.top,
(float) rcWindow.Width(), (float) rcWindow.Height());
m_LEADRasterView1.SetAutoScroll(TRUE);
m_LEADRasterView1.ForceRepaint();


CenterImage example for Visual C++ 5.0

CenterImage example for C++ 5.0 and later

//toggle CenterImage
m_LEADRasterView1.SetCenterImage(!m_LEADRasterView1.GetCenterImage());


Change example for Visual C++ 5.0

Change example for C++ 5.0 and later

Typically, you would use this event to flag changed image data and prompt the user to save the changes before closing a window or exiting an application. That use of the event cannot be tested properly without writing a complete application; so this example just shows you a simple test of the event.

void CTutorDlg::OnChangeLeadrasterview1(long nChange, long nReserved1, long nReserved2)
{
// TODO: Add your control notification handler code here
MessageBox(TEXT("Image data has changed"), TEXT("Test Message"), MB_OK);
}


ChannelMix Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ChannelMix(m_LeadRasterView.GetRaster (), 50, 0, 0, 0, 100, 100, 0, 0, 0, 0, 100, 0);

m_pRasterProc->Release();


Clear example for Visual C++ 5.0

Clear example for Visual C++ 5 and later

//empty the current list
m_LEADImageList.Clear();


ClientToBitmap example for Visual C++ 5.0

ClientToBitmap example for C++ 5.0 and later

void CTutor3Dlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
float BitmapX;
float BitmapY;

BitmapX = x;
BitmapY = y;
m_LEADRasterView1.ClientToBitmap (BitmapX, BitmapY);

//Change that pixel to White
m_LEADRasterView1.GetRaster().SetPixel(m_LEADRasterView1.GetConvertX (),
m_LEADRasterView1.GetConvertY (),
RGB(255,255,255));
}


Clouds example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Clouds(m_LeadRasterView.GetRaster(), 1000, 4, 10, 10, RGB(255, 255, 255), RGB(0,0,0), CLD_DIFFERENCE);
m_pRasterProc->Release();


CMYKRaster Example for C++ 5.0 and later

/* This example will load an array of CMYK TIFF files and increase the brightness of the K plane only */
/* (which will darken the image) and save the file as CMYK TIFF */
ILEADRaster * pRaster;
ILEADRasterProcess * pRasterProc;
ILEADRasterView * pRasterView;
void TestLoadCMYKArray(ILEADRasterIO * pRasterIO)
{
short nRet;

nRet = pRasterIO->GetFileInfo(pRaster, TEXT("cmyk.tif"), 0, 0);
if (nRet != 0)
{
MessageBox(NULL, "Invalid source file", "Error", MB_OK);
return;
}

pRasterIO->CMYKRasterCount = 4;
nRet = pRasterIO->LoadFileCMYKArray(TEXT("cmyk.tif"), 8, 1);
if (nRet != 0)
{
MessageBox(NULL, "LoadFileCMYKArray failed!", "Error", MB_OK);
return;
}

/* The load has succeeded.
Increase the brightness of the K (black) plane by 50%
Note that this will DARKEN the image, because we increased the amount of black! */
nRet = pRasterProc->Intensity(pRasterIO->CMYKRaster[3], 500);
if (nRet != 0)
MessageBox(NULL, "Intensity failed!", "Error", MB_OK);
else
{
nRet = pRasterIO->SaveFileCMYKArray(TEXT("c:\\myCMYK.tif"), FILE_TIFLZW_CMYK, 8, 2, 0);
if (nRet != 0)
MessageBox(NULL, "SaveFileCMYKArray failed!", "Error", MB_OK);
}

pRasterView->RasterIO = pRasterIO;
pRasterView->EnablePaintCMYKArray = TRUE;
}


ColoredBalls example for Visual C++

IILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PutColoredBallsCount(7);

m_pRasterProc->PutColoredBalls (0, RGB(230,50,50));
m_pRasterProc->PutColoredBalls (0, RGB(230,200,160));
m_pRasterProc->PutColoredBalls (0, RGB(255,255,128));
m_pRasterProc->PutColoredBalls (0, RGB(240,50,100));
m_pRasterProc->PutColoredBalls (0, RGB(255,255,180));
m_pRasterProc->PutColoredBalls (0, RGB(170,240,100));
m_pRasterProc->PutColoredBalls (0, RGB(255,255,255));

m_pRasterProc->ColoredBalls(m_LeadRasterView.GetRaster(), 1000, 25, 15, 4500,
RGB(255,255,255),RGB(255,0,0),RGB(255,255,0),64,10,100, CLRBALLS_SHADING_CIRCULAR|CLRBALLS_STICKER|
CLRBALLS_IMAGE|CLRBALLS_BALLCLR_OPACITY);

m_pRasterProc->Release();


ColoredPencil example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->m_pRasterProc->ColoredPencil(m_LeadRasterView.GetRaster(), 50, 3);
m_pRasterProc->Release();


ColorHalfTone example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ColorHalfTone(m_LeadRasterView.GetRaster(), 15, 10800, 16200, 9000, 4500);
m_pRasterProc->Release();


ColorIntensityBalance Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->GetShadow()->Red = 60;
m_pRasterProc->GetShadow()->Green = 0;
m_pRasterProc->GetShadow()->Blue = 0;

m_pRasterProc->GetMidTone()->Red = 40;
m_pRasterProc->GetMidTone()->Green = 0;
m_pRasterProc->GetMidTone()->Blue = 0;

m_pRasterProc->GetHighLight()->Red = 70;
m_pRasterProc->GetHighLight()->Green = 0;
m_pRasterProc->GetHighLight()->Blue = 0;

m_pRasterProc->ColorIntensityBalance(m_LeadRasterView.GetRaster (),false);


ColorizeGray Example for C++ 5.0 and later

ILEADRaster* m_pRasterSrc= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterSrc);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pRasterSrc, "c:\\1.bmp", 0, 0, 1);

m_pRasterProc->GrayColorCount = 6;

m_pRasterProc->PutGrayColorThreshold(0,9999);
m_pRasterProc->PutGrayColorRed(0,255);
m_pRasterProc->PutGrayColorGreen(0,0);
m_pRasterProc->PutGrayColorBlue(0,0);

m_pRasterProc->PutGrayColorThreshold(1,19999);
m_pRasterProc->PutGrayColorRed(1,0);
m_pRasterProc->PutGrayColorGreen(1,255);
m_pRasterProc->PutGrayColorBlue(1,0);

m_pRasterProc->PutGrayColorThreshold(2,29999);
m_pRasterProc->PutGrayColorRed(2,0);
m_pRasterProc->PutGrayColorGreen(2,0);
m_pRasterProc->PutGrayColorBlue(2,255);

m_pRasterProc->PutGrayColorThreshold(3,39999);
m_pRasterProc->PutGrayColorRed(3,0);
m_pRasterProc->PutGrayColorGreen(3,255);
m_pRasterProc->PutGrayColorBlue(3,255);

m_pRasterProc->PutGrayColorThreshold(4,49999);
m_pRasterProc->PutGrayColorRed(4,255);
m_pRasterProc->PutGrayColorGreen(4,0);
m_pRasterProc->PutGrayColorBlue(4,255);

m_pRasterProc->PutGrayColorThreshold(5,59999);
m_pRasterProc->PutGrayColorRed(5,255);
m_pRasterProc->PutGrayColorGreen(5,255);
m_pRasterProc->PutGrayColorBlue(5,0);

m_pRasterProc->ColorizeGray(m_LeadRasterView.GetRaster (), m_pRasterSrc);

m_pRasterSrc->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


ColorLevel Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->MasterMinInput = 0;
m_pRasterProc->MasterMaxInput = 255;
m_pRasterProc->MasterMinOutput = 255;
m_pRasterProc->MasterMaxOutput = 0;
m_pRasterProc->MasterGamma = DEFAULT_GAMMA;

m_pRasterProc->RedMinInput = 120;
m_pRasterProc->RedMaxInput = 20;
m_pRasterProc->RedMinOutput = 255;
m_pRasterProc->RedMaxOutput = 255;
m_pRasterProc->RedGamma = DEFAULT_GAMMA;

m_pRasterProc->GreenMinInput = 0;
m_pRasterProc->GreenMaxInput = 100;
m_pRasterProc->GreenMinOutput = 200;
m_pRasterProc->GreenMaxOutput = 0;
m_pRasterProc->GreenGamma = DEFAULT_GAMMA;

m_pRasterProc->BlueMinInput = 20;
m_pRasterProc->BlueMaxInput = 200;
m_pRasterProc->BlueMinOutput = 0;
m_pRasterProc->BlueMaxOutput = 255;
m_pRasterProc->BlueGamma = DEFAULT_GAMMA;

m_pRasterProc->ColorLevel(m_LeadRasterView.GetRaster (), LEVEL_BLUE |LEVEL_MASTER);

m_pRasterProc->Release();


ColorReplace example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ReplaceColorsCount = 1;
m_pRasterProc->PutReplaceColorValue(0,RGB(200, 0, 35));
m_pRasterProc->PutReplaceColorFuzziness(0,100);
m_pRasterProc->ColorReplace(m_LeadRasterView.GetRaster(),9000, 0, 0);

m_pRasterProc->Release();


ColorRes example for Visual C++ 5.0

ColorRes example for C++ 5.0 and later

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
if (m_LEADRasterView1.GetRaster().GetBitmapBits() != 8)
{
BeginWaitCursor();
pRasterProc->ColorRes(m_LEADRasterView1.GetRaster(),
8, CRP_OPTIMIZEDPALETTE,
CRD_FLOYDSTEINDITHERING, 0);
m_LEADRasterView1.ForceRepaint();
EndWaitCursor();
}
pRasterProc->Release();


ColorResList Example for Visual C++ 5.0

ColorResList Example for C++ 5.0 and later

This example changes the hue of bitmaps in a list, then plays the list as an animation. When changing the hue, it preserves the transparent color.

short i; // Loop counter
short uCount; // Number of bitmaps in the list
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

OLE_COLOR TransparentColor; // Color used for transparency
// Save the current transparent color.
TransparentColor = m_LEADRasterView1.GetRaster().GetBitmapTransparentColor();
// Avoid repaints while we modify the bitmaps.
m_LEADRasterView1.SetAutoRepaint(FALSE);
// Change the hue of each bitmap in the list,
// and restore the transparent color as the last color in the palette.
uCount = m_LEADRasterView1.GetRaster().GetBitmapListCount();
for (i = 0; i < uCount; ++i)
{
m_LEADRasterView1.GetRaster().SetBitmapListIndex(i);
pRasterProc->Hue(m_LEADRasterView1.GetRaster(), i * 10);
m_LEADRasterView1.GetRaster().SetBitmapPalette(255, TransparentColor);
}
// Get an optimized palette for the whole list.
pRasterProc->ColorResList(m_LEADRasterView1.GetRaster(),
8, CRP_OPTIMIZEDPALETTE,
CRD_NODITHERING, 0);
// Update the palette that is used for playback.
for (i = 0; i < 256; ++ i)
m_LEADRasterView1.SetAnimationPalette(i,
m_LEADRasterView1.GetRaster().GetBitmapPalette(i));
// Start the animation.
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAnimationEnable(TRUE);
pRasterProc->Release();


ColorSpace Example for C++ 5.0 and later

pRasterIO->ColorSpace = COLORSPACE_BGR;
pRasterIO->IgnoreViewPerspective = TRUE;
pRasterIO->Load(pRaster, "test.tif", 0, 1, -1);


ColorThreshold example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

for(int i = 0; i < 3; ++i)
{
m_pRasterProc->PutComponentMinRange(i,128);
m_pRasterProc->PutComponentMaxRange(i,255);
m_pRasterProc->PutComponentFlags(i,CLTH_TYP_BANDPASS);
}

/*Apply color Threshold effect on the image*/
m_pRasterProc->ColorThreshold(m_LeadRasterView.GetRaster(), CLTH_RGB_SPACE);

m_pRasterProc->Release();


Combine example for Visual C++ 5.0

Combine example for C++ 5.0 and later

This example copies the Lead1 bitmap to Lead2, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap image. Trimming Lead2 lets you see the difference between filtered and nonfiltered regions.

ILEADRasterProcess *pRasterProc=NULL;
BeginWaitCursor();
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView2.GetRaster ().SetBitmap(m_LEADRasterView1.GetRaster().GetBitmap());
float TrimLeft = (m_LEADRasterView2.GetRaster().GetBitmapWidth() * 0.2f);
float TrimTop = (m_LEADRasterView2.GetRaster().GetBitmapHeight() * 0.2f);
float TrimWidth = (m_LEADRasterView2.GetRaster().GetBitmapWidth() * 0.6f);
float TrimHeight = (m_LEADRasterView2.GetRaster().GetBitmapHeight() * 0.6f);
pRasterProc->Trim(m_LEADRasterView2.GetRaster(),
TrimLeft, TrimTop, TrimWidth, TrimHeight);
pRasterProc->SpatialFilter(m_LEADRasterView2.GetRaster(),
FLT_LINESEG_LTOR);
float DstLeft = TrimLeft;
float DstTop = TrimTop;
float DstWidth = TrimWidth;
float DstHeight = TrimHeight;
float SrcLeft = 0.0f;
float SrcTop = 0.0f;
pRasterProc->Combine(m_LEADRasterView1.GetRaster(),
DstLeft, DstTop, DstWidth, DstHeight,
m_LEADRasterView2.GetRaster(),
SrcLeft, SrcTop, CB_OP_ADD);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();
EndWaitCursor();


CombineBitmapWarp example for Visual C++ 5.0

CombineBitmapWarp example for C++ 5.0 and later

int nRet;
long nPoints;

ILEADRasterProcess* pLEADRasterProcess;
ILEADRasterVariant * pltRasVarX = NULL;
ILEADRasterVariant * pltRasVarY = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarX);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarY);

::CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pLEADRasterProcess);

// Get the annotation points
m_pLEADRasterAnn->AnnGetPointCount(m_hObject); //get the number of points
nPoints = m_pLEADRasterAnn->getAnnPointCount();
m_pLEADRasterAnn->AnnGetPointX(m_hObject, pltRasVarX); //get the X coordinates
m_pLEADRasterAnn->AnnGetPointY(m_hObject, pltRasVarY); //get the Y coordinates

// Note that the bits per pixel of master and slave must be the same
// If palettized, the palettes must be the same
UINT uMasterBPP = m_RasterMaster.GetRaster().GetBitmapBits();
UINT uSlaveBPP = m_RasterSlave.GetRaster().GetBitmapBits();
if ((uMasterBPP < 24) || (uSlaveBPP < 24))
{
int nPalFlags = CRP_FIXEDPALETTE | CRP_BYTEORDERBGR;
int nDithFlags = CRD_NODITHERING;
UINT uBitsPerPixel = max(uMasterBPP, uSlaveBPP );
if (uMasterBPP != uBitsPerPixel)
pLEADRasterProcess->ColorRes(m_RasterMaster.GetRaster(), uBitsPerPixel, (ColorResPaletteConstants)nPalFlags, (ColorResDitherConstants)nDithFlags, 0);

if (uSlaveBPP != uBitsPerPixel)
pLEADRasterProcess->ColorRes(m_RasterSlave.GetRaster(), uBitsPerPixel, (ColorResPaletteConstants)nPalFlags, (ColorResDitherConstants)nDithFlags, 0);
}

pLEADRasterProcess->EnableMethodErrors = VARIANT_FALSE;
UINT uFlags = m_bBilinearInterpolate ? CBW_BILINEAR | CBW_RESERVED8 : CBW_RESERVED8;
BeginWaitCursor();
nRet = pLEADRasterProcess->CombineBitmapWarp(m_RasterMaster.GetRaster(), pltRasVarX, pltRasVarY, 4, m_RasterSlave.GetRaster(), 0, 0, (long)m_RasterSlave.GetRaster().GetBitmapWidth(), (long)m_RasterSlave.GetRaster().GetBitmapHeight(), (long)uFlags);
EndWaitCursor();

if (nRet == ERROR_FEATURE_NOT_SUPPORTED)
{
MessageBox(TEXT("Error--Feature not supported"));
}
else if (nRet != 0)
{
TCHAR *pszMsg = TEXT("One of the following caused the error:\n")
TEXT("1. Polygon must be concave\n")
TEXT("2. Polygon must lie completely on the master bitmap\n")
TEXT("3. The bits per pixel of the Master and Slave must be the same\n")
TEXT("4. Master or slave image not loaded\n");

MessageBox(pszMsg);
}
else
m_RasterMaster.ForceRepaint();

pltRasVarX->Release ();
pltRasVarY->Release ();


CombineExt example for Visual C++ 5.0

CombineExt example for C++ 5.0 and later

//This example copies the RasterView1 bitmap to RasterView2, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap image. Trimming RasterView2 lets you see the difference between filtered and nonfiltered regions.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

float TrimLeft, TrimTop, TrimWidth, TrimHeight;
float DstLeft, DstTop, DstWidth, DstHeight;
float SrcLeft, SrcTop;
m_RasterView2.GetRaster ().SetBitmap (m_RasterView1.GetRaster().GetBitmap ());
TrimLeft = (m_RasterView2.GetRaster().GetBitmapWidth () * 0.2);
TrimTop = (m_RasterView2.GetRaster().GetBitmapHeight () * 0.2);
TrimWidth = (m_RasterView2.GetRaster().GetBitmapWidth () * 0.6);
TrimHeight = (m_RasterView2.GetRaster().GetBitmapHeight () * 0.6);
pRasterProc->Trim(m_RasterView2.GetRaster(), TrimLeft, TrimTop, TrimWidth, TrimHeight);
pRasterProc->SpatialFilter(m_RasterView2.GetRaster(), FLT_LINESEG_HORZ);
DstLeft = TrimLeft;
DstTop = TrimTop;
DstWidth = TrimWidth;
DstHeight = TrimHeight;
SrcLeft = 0;
SrcTop = 0;
pRasterProc->CombineExt(m_RasterView1.GetRaster(), DstLeft, DstTop, DstWidth, DstHeight, m_RasterView2.GetRaster(), SrcLeft, SrcTop, CB_OP_ADD);
m_RasterView1.ForceRepaint ();

pRasterProc->Release();


Comment example for Visual C++ 5.0

Comment example for C++ 5.0 and later

This example does the following:

1. | Loads an image from a TIFF file.
2. | Updates the current comment array by reading comments from the file.
3. | Modifies one of the comments.
4. | Modifies and saves the file.
5. | Reads the comment that was saved, and displays it in a message box.

This example handles only string comments. For more complex comments, refer to Exif Examples.

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
ILEADRasterVariant * pltRasVar1 = NULL;
ILEADRasterVariant * pltRasVar2 = NULL;
ILEADRasterVariant * pltRasVarEmpty = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar1);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar2);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarEmpty);

// Specify the file that we will load and update.
CString FilePath = TEXT("d:\\temp\\tmp.tif");
// Get all of the current comments from the file.
// Temporarily disable errors so that we do not fail when comments are missing.
pRasterIO->PutEnableMethodErrors(FALSE);
for(short i = 0; i <= CMNT_LAST; ++i)
{
pRasterIO->PutComment(i, pltRasVarEmpty);
pRasterIO->PutComment(i,
pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, i));
}
pRasterIO->PutEnableMethodErrors(TRUE);
// Load and modify the image.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 0, 0, 1);
pRasterProc->Reverse(m_LEADRasterView1.GetRaster());
// Update the CMNT_SZDESC comment.
pltRasVar1 = pRasterIO->GetComment(CMNT_SZDESC);
pltRasVar1->Type = VALUE_STRING;
pltRasVar1->StringValue = "\nThis image has been reversed.";
pRasterIO->PutComment(CMNT_SZDESC, pltRasVar1);
// Save the file.
int SaveBits = m_LEADRasterView1.GetRaster().GetBitmapBits();
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), FILE_EXIF, SaveBits,
(QFactorConstants)0, SAVE_OVERWRITE);
// Read the comment that we saved.
pltRasVar2 = pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, CMNT_SZDESC);

// Display the message.
MessageBox(pltRasVar2->StringValue);
// Clear the comments from memory
for( i = 0; i <= CMNT_LAST; ++i)
pRasterIO->PutComment(i, pltRasVarEmpty);
pRasterIO->Release();
pRasterProc->Release();
pltRasVar1->Release();
pltRasVar2->Release();
pltRasVarEmpty->Release();


CompactFile Example for C++ 5.0 and later

Example 1:

void TestCompactFileExample1(ILEADRasterIO * pRasterIO)
{
/* This example will compact all the pages in a TIFF file. It will create a new file called dstfile.tif */
short nRet = pRasterIO->CompactFile(TEXT("srcfile.tif"), TEXT("dstfile.tif"), 0, 0, -1, SAVE_OVERWRITE, 0);
if(nRet != 0)
MessageBox(NULL, TEXT("Error compacting file!"), TEXT("ERROR"), MB_OK);
}

Example 2:

void TestCompactFileExample2(ILEADRasterIO * pRasterIO)
{
/* This example will compact all the pages in a TIFF file. It will append all the pages to an existing file called dstfile.tif */
short nRet = pRasterIO->CompactFile(TEXT("srcfile.tif"), TEXT("dstfile.tif"), 0, 0, -1, SAVE_APPEND, -1);
if (nRet != 0)
MessageBox(NULL, TEXT("Error compacting file!"), TEXT("ERROR"), MB_OK);
}


ContinueBrowse example for Visual C++ 5.0

ContinueBrowse example for C++ 5.0 and later

void CRasterThumbnailSink::OnThumbnailEvent(long Bitmap, char * pszFilename, short StatusCode, short nPercent)
{
//in this example, nCount is a global variable used to count the thumbnails
if(StatusCode == 0) //successful thumbnail generation
{
nCount++;
if(nCount > 20) //allow max of 20 thumbnails
{
// m_pDlg is a pointer to a user-defined class from the MFC CDialog class.
m_pDlg->m_pRasterThumbnail->PutContinueBrowse (FALSE); //stop the browse
return;
}
CString csOut;
TCHAR szInfoCompression[100]= TEXT("");
wcstombs(szInfoCompression, m_pDlg->m_pRasterThumbnail->GetInfoCompression(), 99);
csOut.Format(TEXT("%s\nFormat: %d\nCompression: %s\nBits: %d\nWidth: %d\nHeight:")
TEXT(" %d\nPage: %d\nTotalPages: %d\nSizeDisk: %ld\nSizeMem: %ld\nXRes: %d\nYRes: %d"),
pszFilename,
m_pDlg->m_pRasterThumbnail->GetInfoFormat (),
szInfoCompression,
m_pDlg->m_pRasterThumbnail->GetInfoBits (),
m_pDlg->m_pRasterThumbnail->GetInfoWidth (),
m_pDlg->m_pRasterThumbnail->GetInfoHeight (),
m_pDlg->m_pRasterThumbnail->GetInfoPage (),
m_pDlg->m_pRasterThumbnail->GetInfoTotalPages (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeDisk (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeMem (),
m_pDlg->m_pRasterThumbnail->GetInfoXRes (),
m_pDlg->m_pRasterThumbnail->GetInfoYRes ());
AfxMessageBox(csOut);
}
m_pDlg->m_pRasterThumbnail->PutContinueBrowse(TRUE); //continue the browse operation
}


ContourFilter example for Visual C++ 5.0

ContourFilter example for C++ 5.0 and later

short nRet;

//L_KEY_MEDICAL is the unlock support string for L_SUPPORT_MEDICAL
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_MEDICAL, L_KEY_MEDICAL);

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
nRet = pRasterProc->ContourFilter(m_LEADRasterView1.GetRaster(),
20, 35, 5, CONTOUR_APPROX_COLOR);
pRasterProc->Release();


Contrast example for Visual C++ 5.0

Contrast example for C++ 5.0 and later

This example increases the contrast and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Contrast(m_LEADRasterView1.GetRaster(), 50);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


ContrastBrightIntensity Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ContrastBrightIntensity(m_LeadRasterView.GetRaster (),-146, 385, 240);
m_pRasterProc->Release();


ControlWindow example for C++ 5.0 and later

HDC ctlDC;
HWND ctlWnd = (HWND)m_LEADRasterImgList1.GetControlWindow();
TCHAR *strOut = TEXT("Writing to Control Window");

if(ctlWnd)
{
ctlDC = ::GetDC(ctlWnd);
::TextOut(ctlDC, 10, 10, strOut, strlen(strOut));
::ReleaseDC(ctlWnd, ctlDC);
}


ConvertToColoredGray example for Visual C++ 5 and later

short RedFact = 300;
short GreenFact = 590;
short BlueFact = 110;
short RedGrayFact = 500;
short GreenGrayFact = 300;
short BlueGrayFact = 200;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->ConvertToColoredGray (m_RasterView.GetRaster (), RedFact, GreenFact, BlueFact, RedGrayFact, GreenGrayFact, BlueGrayFact);
pRasterProc->Release();


ConvertUnsignedToSigned Example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// Load the bitmap data as signed so we can use a different conversion
pRasterIO->LoadSigned= TRUE;
pRasterIO->Load (m_RasterView1.GetRasterRasterproperty(), "c:\\temp\\signed.tif", 0, 0, 1);
// use the non-default conversion "zero to center"
pRasterProc->ConvertSignedToUnsigned(m_RasterView1.GetRaster(), SHIFT_ZERO_TO_CENTER);

pRasterProc->Release();
pRasterIO->Release();


CopyMarkers example for C++ 5.0 and later

pMarker1->Load("c:\\ image1.jpg",0);
pMarker2->CreateMarkers();
pRasterIO->CopyMarkers (pMarker2,pMarker1);

for(int i=0;i<pMarker2->GetCount ();++i)
{
pMarker2->GetMarker (i);
wsprintf(str, TEXT("%d %d"), pMarker2->GetType (),
pMarker2->GetElementCount ());
MessageBox(NULL,str, TEXT("Print"),0);
}


Correlation Example for C++ 5.0 and later

CString strMsg;
ILEADRaster* m_pCorRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pCorRaster);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pCorRaster,
 "c:\\T.cmp", 0, 0, 1);

m_pRasterProc->CorrelationMaxPoints
 = 90;
m_pRasterProc->Correlation
 (m_LeadRasterView.GetRaster(),
 m_pCorRaster, 1, 1, 90);

for (int i = 0; i<m_pRasterProc->CorrelationCount;++i)
{
strMsg.Format (TEXT("X = %d\n ,Y = %d\n"),m_pRasterProc->GetCorrelationX(i),m_pRasterProc->GetCorrelationX(i));
MessageBox(strMsg);
}
m_pRasterProc->Release();
m_pCorRaster->Release();
m_pRasterIO->Release();


CorrelationList example for Visual C++

CString strMsg;
int iListCount = 0;
int iListIndex = 0;
int iListMaxPoints = 0;
int c = 0;

IILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

ILEADRaster *pRaster2=NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

pRaster2->Bitmap = 0;
for(int i = 0; i<5; ++i)
{
pRaster2->Bitmap = m_LeadRasterView.GetRaster().GetBitmap();
m_pRasterProc->Rotate(pRaster2, 7200 * i, (RotateConstants)0, RGB(255, 0, 0));
m_RasterView2.GetRaster().InsertBitmapListItem(-1, pRaster2->Bitmap);
}

m_pRasterProc->PutCorrelationListMaxPoints(90);
m_pRasterProc->CorrelationList(m_RasterView2.GetRaster(), 1, 2, 10);

iListCount = m_pRasterProc->GetCorrelationListCount();
iListMaxPoints = m_pRasterProc->GetCorrelationListMaxPoints();

for (c = 0; c<iListCount;++c)
{
iListIndex = m_pRasterProc->GetCorrelationListIndex(c);
strMsg.Format (TEXT("X = %d\n ,Y = %d\n"),
m_pRasterProc->GetCorrelationListX(iListIndex),
m_pRasterProc->GetCorrelationListY(iListIndex));

MessageBox(strMsg);
}

m_pRasterProc->Release();


CountLUTColors example for Visual C++ 5.0

CountLUTColors example for C++ 5 and later

Cstring strMsg;
m_LeadRasterView.GetRaster ().CountLUTColors( LUT_UNSIGNED);
strMsg.Format(TEXT( "Colors = %d First Index = %d"), m_LeadRasterView.GetRaster().LUTColorsCount, m_LeadRasterView.GetRaster().LUTColorsFirstIndex);


Create example for Visual C++ 5.0

Create example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example creates an annotation toolbar and adds a button to the toolbar.
//The button displays different images when selected/deselected
//The button has two tools associated with (line tool and button tool)
void CTutorDlg::CreateToolBar (ILEADRasterAnnToolBar * pAnnToolBar)
{
//Attach the annotation object to the raster view control
IDispatch *pDispatch=NULL;
LPUNKNOWN pIUnknownNoRelease = m_LEADRasterView1.GetControlUnknown();
pIUnknownNoRelease->QueryInterface(IID_IDispatch, (void**)&pDispatch);
pAnnToolBar->PutAnnParentRasterView(pDispatch);
if(pDispatch)
pDispatch->Release();

pAnnToolBar->PutVisible (VARIANT_TRUE);
pAnnToolBar->Create(0.0f, 0.0f, ANN_TOOLALIGN_TOP);
if (!pAnnToolBar->GetToolBarhWnd())
return;

//load button images
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pAnnToolBar->PutButtonTool(pAnnToolBar->GetButtonCount(), ANN_TOOL_USER_FIRST);
pRasterIO->Load (m_LEADRasterView1.GetRaster(), "e:\\lead14\\dist\\images\\Ulay1.bmp", 0, 0, 1);
pAnnToolBar->PutButtonBitmapUp(pAnnToolBar->GetButtonCount(), m_LEADRasterView1.GetRaster().GetBitmap());

pRasterIO->Load(m_LEADRasterView1.GetRaster(), "e:\\lead14\\dist\\images\\Ulay2.bmp", 0, 0, 1);
pAnnToolBar->PutButtonBitmapDown(pAnnToolBar->GetButtonCount(), m_LEADRasterView1.GetRaster().GetBitmap());
pRasterIO->Release();

pAnnToolBar->PutButtonToolTipTextID(pAnnToolBar->GetButtonCount(), -1);
pAnnToolBar->PutButtonToolTipText (pAnnToolBar->GetButtonCount (), "User defined tool");

CString strMsg;
CString strToolText = (char *)pAnnToolBar->GetButtonToolTipText(pAnnToolBar->GetButtonCount());
strMsg.Format(TEXT("AnnToolTipText: %s"), strToolText);

AfxMessageBox(strMsg);

//associate to menu items with the newly added button
int nButtonCount = pAnnToolBar->GetButtonCount();
pAnnToolBar->PutButtonToolCount(nButtonCount, 2);

pAnnToolBar->PutButtonMenuTool(nButtonCount, 0, ANN_TOOL_LINE);
pAnnToolBar->PutButtonMenuTextID(nButtonCount, 0, -1);
pAnnToolBar->PutButtonMenuText(nButtonCount, 0, "Line Tool");

pAnnToolBar->PutButtonMenuTool(nButtonCount, 1, ANN_TOOL_BUTTON);
pAnnToolBar->PutButtonMenuTextID(nButtonCount, 1, -1);
pAnnToolBar->PutButtonMenuText(nButtonCount, 1, "Button");

pAnnToolBar->PutButtonCount(nButtonCount + 1);
m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);

m_pRasterAnn->PutAutoSetTool(VARIANT_TRUE);

}


CreateBitmap, Size, and Combine example for C++ 5.0 and later

This example creates a bitmap for LEADRasterView2 (same size and BPS as LEADRasterView ) and fills it with green. It resizes the LEADRasterView1 bitmap, then uses a loop to do multiple combines with the LEADRasterView2 bitmap. It then copies the LEADRasterView2 bitmap to LEADRasterView1 and redisplays m_LEADRasterView1.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

BeginWaitCursor();
// Create the Lead2 bitmap. (The control must already be on the form).
int MyWidth = (int) m_LEADRasterView1.GetRaster().GetBitmapWidth();
int MyHeight = (int) m_LEADRasterView1.GetRaster().GetBitmapHeight();
int MyBPS = m_LEADRasterView1.GetRaster().GetBitmapBits();
m_LEADRasterView2.GetRaster().CreateBitmap((float) MyWidth, (float) MyHeight, MyBPS);
pRasterProc->Fill(m_LEADRasterView2.GetRaster(),
RGB(0, 255, 0)); // fill with green
// Resize the Lead1 bitmap
int ImageWidth = (int) (MyWidth * 0.3);
int ImageHeight = (int) (MyHeight * 0.3);
pRasterProc->Size(m_LEADRasterView1.GetRaster(),
(float) ImageWidth, (float) ImageHeight, RESIZE_RESAMPLE);
// Initialize the variables used for multiple combines.
int TestWidth = MyWidth; // Used for horizontal positioning
int TestHeight = MyHeight; // Used for vertical positioning
int VFactor = (int) (MyHeight / ImageHeight) + 1; // Number spaces between images
int VSpacing = (int) ((MyHeight % ImageHeight) / VFactor); // Pixels between images
int HFactor = (int) (MyWidth / ImageWidth) + 1; // Number spaces between images
int HSpacing = (int) ((MyWidth % ImageWidth) / HFactor); // Pixels between images
int DstT = VSpacing; // Top coordinate of the destination rectangle
int SrcL = 0; // Left coordinate of the source rectangle
int SrcT = 0; // Top coordinate of the source rectangle
int DstW = ImageWidth; // Width of the destination rectangle
int DstH = ImageHeight; // Height of the destination rectangle
int MyOp = CB_OP_ADD + CB_DST_0; // Operation flags used when combining images
// Do the loop that does the multiple combines
while(TestHeight > ImageHeight) // Vertical loop
{
DstT = MyHeight - TestHeight + VSpacing;
TestHeight = TestHeight - ImageHeight - VSpacing;
while(TestWidth > ImageWidth) // Horizontal loop
{
int DstL = MyWidth - TestWidth + HSpacing;
TestWidth = TestWidth - ImageWidth - HSpacing;
pRasterProc->Combine(m_LEADRasterView2.GetRaster(),
(float) DstL, (float) DstT,
(float) DstW, (float) DstH,
m_LEADRasterView1.GetRaster(),
(float) SrcL, (float) SrcT,
(CombineConstants) MyOp);
}
TestWidth = MyWidth;
}
// Copy the Lead2 bitmap to Lead1
m_LEADRasterView1.GetRaster().SetBitmap(m_LEADRasterView2.GetRaster().GetBitmap());
// Set the image display size to match the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.ForceRepaint(); // Repaint the image
pRasterProc->Release();
EndWaitCursor();


CreateObject Example for C++ 5.0 and later

For MFC, the factory object is not needed. The system API CoCreateInstanceLic can be used instead.


CreateMaskFromRgn example for C++ 5.0 and later

int nRet;
ILEADRasterIO *pRasterIO = NULL;

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

/* This example loads an image, sets a color region using black,
and then creates a 1-bit mask image from that bitmap. */

nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster (), "C:\\PARROTS.JPG", 0, 0, 1);
if (nRet == 0)
{
m_LEADRasterView1.GetRaster ().SetRgnColor(RGB(0, 0, 0), L_RGN_SET);
nRet = m_LEADRasterView1.GetRaster().CreateMaskFromRgn();
if (nRet == 0)
m_LEADRasterView2.GetRaster().SetBitmap (m_LEADRasterView1.GetRaster().GetMaskBitmap());

}

pRasterIO->Release();


CreateThumbnail example for Visual C++ 5.0

CreateThumbnailFromFile example for C++ 5.0 and later

void CTutorDlg::OnButton1()
{
m_pRasterThumbnail->PutLoadStamp(FALSE);
m_pRasterThumbnail->PutForceSize(TRUE);
m_pRasterThumbnail->PutThumbnailBackgroundColor(RGB(0,255,0));
m_pRasterThumbnail->PutThumbnailWidth(80);
m_pRasterThumbnail->PutThumbnailHeight(40);

m_pRasterThumbnail->CreateThumbnailFromFile("c:\\temp\\testdb6.tif", 1);
m_pRasterThumbnail->CreateThumbnailFromFile("c:\\temp\\testdb6.tif", 2);
m_pRasterThumbnail->CreateThumbnailFromFile("c:\\temp\\testdb6.tif", 3);
}

void CRasterThumbnailSink::OnThumbnailEvent(long Bitmap, char * pszFilename, short StatusCode, short nPercent)
{
if((StatusCode == 0) && (nPercent == 0) && (Bitmap != 0))
{
AfxMessageBox(pszFilename);
}
}


CreateUserBitmap example for Visual C++ 5.0

CreateUserBitmap example for C++ 5.0 and later

void CCOM_MMDlg::OnButton1()
{
// create an empty variant
COleVariant vEmpty;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;
ILEADRasterVariant * pltRasVarEmpty = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarEmpty);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);

// make sure I am using pixels
m_LEADRasterView1.SetScaleMode(3);

// Create the empty user bitmap.
m_LEADRasterView1.GetRaster().CreateUserBitmap(640, 480, 24, pltRasVarEmpty, 0);

long lDataSize = (640 * 480 * 24 / 8);

pltRasVar->Type = VALUE_ARRAY_BYTE;
pltRasVar->ItemCount = lDataSize;

for(int i = 0; i < lDataSize; i++)
pltRasVar->ShortItemValue (i) = 128; // gray

// set the bitmap data pointer
m_LEADRasterView1.GetRaster().SetBitmapDataPointer(pltRasVar,
lDataSize);

// save the bitmap
pRasterIO->Save(m_LEADRasterView1.GetRaster(), "d:\\temp\\gray.jpg",
FILE_JFIF, 0, (QFactorConstants)25, SAVE_OVERWRITE);

// when I go out of scope, the variant will be freed, so
// my bitmap data pointer will be invalid.
// I need to clear the bitmap data pointer
m_LEADRasterView1.GetRaster().SetBitmapDataPointer(pltRasVarEmpty, 0);
pRasterIO->Release();
pltRasVar->Release ();
pltRasVarEmpty->Release ();
}

void CCOM_MMDlg::OnButton2()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "d:\\temp\\gray.jpg", 0,
1, 1);
pRasterIO->Release();
}


CreateUserBitmap2 example for Visual C++ 5.0

CreateUserBitmap2 example for C++ 5.0 and later

void CCOM_MMDlg::OnButton1()
{
// create an empty variant
COleVariant vEmpty;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);

// make sure I am using pixels
m_LEADRasterView1.SetScaleMode(3);

// Create the empty user bitmap.
m_LEADRasterView1.GetRaster().CreateUserBitmap2(640, 480, 24, vEmpty, 0);

long lDataSize = (640 * 480 * 24 / 8);

SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = lDataSize;

SAFEARRAY *psa = SafeArrayCreate(VT_UI1, 1, rgsabound);

if(psa)
{
SafeArrayLock(psa);

for(int i = 0; i < lDataSize; i++)
((BYTE *)psa->pvData)[i] = 128; // gray

SafeArrayUnlock(psa);

COleVariant vBitmapData;

V_VT(&vBitmapData) = (VT_ARRAY | VT_UI1);
V_ARRAY(&vBitmapData) = psa;

// set the bitmap data pointer
m_LEADRasterView1.GetRaster().SetBitmapDataPointer2(vBitmapData, lDataSize);

// save the bitmap
pRasterIO->Save(m_LEADRasterView1.GetRaster(), "d:\\temp\\gray.jpg", FILE_JFIF, 0, (QFactorConstants)25, SAVE_OVERWRITE);

// when I go out of scope, the variant will be freed, so
// my bitmap data pointer will be invalid.
// I need to clear the bitmap data pointer
m_LEADRasterView1.GetRaster().SetBitmapDataPointer2(vEmpty, 0);
pRasterIO->Release();
}
}

void CCOM_MMDlg::OnButton2()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "d:\\temp\\gray.jpg", 0, 1, 1);
pRasterIO->Release();
}


CreateZoomView Example for Visual C++ 5.0 and later

ILEADRasterIO * pRasterIO = NULL;

ILEADRasterZoomView * pZoomView;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterZoomView,
NULL,
CLSCTX_ALL,
IID_ILEADRasterZoomView,
(void**)&pZoomView
);

hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

//L_KEY_DOCUMENT represents the unlock support string
m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\parrots.jpg"), 0, 0, 1);

pZoomView->SrcLeft = 0;
pZoomView->SrcTop = 0;
pZoomView->SrcWidth = 100;
pZoomView->SrcHeight = 100;

pZoomView->DstTop = 100;
pZoomView->DstLeft = 100;
pZoomView->DstWidth = 500;
pZoomView->DstHeight = 500;

pZoomView->BorderColor = RGB(255, 0, 0);
pZoomView->BorderStyle = ZOOM_VIEW_BORDERSTYLE_ROUNDED;
pZoomView->PenStyle = PEN_STYLE_DASHDOTDOT;

pZoomView->SrcBorderColor = RGB(255, 0, 0);
pZoomView->SrcBorderStyle = SOURCE_BORDERSTYLE_SIMPLE;
pZoomView->SrcPenStyle = PEN_STYLE_DOT;

pZoomView->EnableCallouts = TRUE;
pZoomView->CalloutColor = RGB(0, 0, 255);
pZoomView->CalloutPenStyle = PEN_STYLE_DASH;

pZoomView->ZoomFactor = 200;
pZoomView->Enabled = TRUE;
pZoomView->ForceDst = TRUE;
pZoomView->AnnContainer = 0;

m_RasterView.CreateZoomView(pZoomView);

pZoomView->Release();
pRasterIO->Release();


Cubism Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Cubism( m_LeadRasterView.GetRaster (), 5,15,200, 4500, RGB(255,0,0), CUB_COLOR | CUB_RECT | CUB_RAND);
m_pRasterProc->Release();


CurveToBezier example for Visual C++ 5.0

CurveToBezier example for C++ 5.0 and later

m_RasterView1.GetRaster ().SetCurveClose(CURVE_CLOSE);
m_RasterView1.GetRaster().SetCurveSize(4);
m_RasterView1.GetRaster().SetCurveX(1, 10);
m_RasterView1.GetRaster().SetCurveY(1, 30);
m_RasterView1.GetRaster().SetCurveX(2, 20);
m_RasterView1.GetRaster().SetCurveY(2, 240);
m_RasterView1.GetRaster().SetCurveX(3, 250);
m_RasterView1.GetRaster().SetCurveY(3, 260);
m_RasterView1.GetRaster().SetCurveX(0, 220);
m_RasterView1.GetRaster().SetCurveY(0, 10);
m_RasterView1.GetRaster().SetCurveTension(0.35f);
m_RasterView1.GetRaster().SetCurveType(CURVE_STANDAR);
m_RasterView1.GetRaster().SetRgnCurve(L_POLY_WINDING, L_RGN_SET);
m_RasterView1.SetRgnFrameType(RGNFRAME_ANIMATED);

m_RasterView1.GetRaster().CurveToBezier();

POINT *p = new POINT[m_RasterView1.GetRaster().GetBezierSize()];

for(int i = 0; i < m_RasterView1.GetRaster().GetBezierSize (); ++i)
{
p[i].x = m_RasterView1.GetRaster().GetBezierX(i);
p[i].y = m_RasterView1.GetRaster().GetBezierY(i);
}
CClientDC dc(this);
dc.PolyBezier(p, m_RasterView1.GetRaster().GetBezierSize ());


Cylindrical Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Cylindrical(m_LeadRasterView.GetRaster(),100, CYL_HORZ);
m_pRasterProc->Release();


dbCan... example for Visual C++ 5.0

dbCan... example for C++ 5.0 and later

This example displays property values in a message box. You can implement this example by adding a button, with this code, to the project described in Using ODBC to Access Image Data.

//ILEADRasterODBC *m_pRastODBC=NULL;
//CoCreateInstance(CLSID_LEADRasterODBC, NULL, CLSCTX_ALL, IID_ILEADRasterODBC, (void**)& m_pRastODBC);
CString TempStr, InfoStr;
InfoStr.Format(TEXT("dbCanAppend = %d\n"), m_pRastODBC->GetdbCanAppend ());
TempStr.Format(TEXT("dbCanRestart = %d\n"), m_pRastODBC->GetdbCanRestart());
InfoStr += TempStr;
TempStr.Format(TEXT("dbCanScroll = %d\n"), m_pRastODBC->GetdbCanScroll ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbCanUpdate = %d\n"), m_pRastODBC->GetdbCanUpdate ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbEditMode = %d\n"), m_pRastODBC->GetdbEditMode ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbIsBOF = %d\n"), m_pRastODBC->GetdbIsBOF ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbIsEOF = %d\n"), m_pRastODBC->GetdbIsEOF ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbIsDeleted = %d\n"), m_pRastODBC->GetdbIsDeleted());
InfoStr += TempStr;
TempStr.Format(TEXT("dbIsOpen = %d\n"), m_pRastODBC->GetdbIsOpen());
InfoStr += TempStr;
TempStr.Format(TEXT("dbLoadBits = %d\n"), m_pRastODBC->GetdbLoadBits ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbLockingMode = %d\n"), m_pRastODBC->GetdbLockingMode());
InfoStr += TempStr;
TempStr.Format(TEXT("dbRecordCount = %d\n"), m_pRastODBC->GetdbRecordCount ());
InfoStr += TempStr;
TempStr.Format(TEXT("dbCurrentRecord = %d (0 based)"), m_pRastODBC->GetdbCurrentRecord ());
InfoStr += TempStr;
MessageBox(InfoStr, TEXT("INFO"));
//m_pRastODBC->Release();


DblClick (ILEADRasterImgList) example for Visual C++ 5.0

DblClick (ILEADRasterImgList) example for C++ 5.0 and later

void CBrowseDlg::OnDblClickLeadimglistctrl1()
{
AfxMessageBox(TEXT("Control was Double-Clicked"));
}


DblClick example for Visual C++ 5.0

DblClick example for C++ 5.0 and later

This example demonstrates the DblClick event.

void CTutorDlg::OnDblClickLeadrasterview1()
{
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// TODO: Add your control notification handler code here
pRasterProc->Flip(m_LEADRasterView1.GetRaster()); //Just test the event
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();
}


DDB example for Visual C++ 5.0

DDB example for C++ 5.0 and later

This example copies the Lead1 bitmap to the clipboard as a DDB. It pastes the DDB into Lead2 and reverses the image. It then gets a DDB from Lead2, sets the same DDB to Lead1, and repaints.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

BeginWaitCursor();
int MyFlags = COPY_EMPTY + COPY_DDB + COPY_PALETTE;
m_LEADRasterView1.GetRaster().Copy((RasterCopyConstants)MyFlags);
m_LEADRasterView2.GetRaster().Paste(0);
pRasterProc->Reverse(m_LEADRasterView2.GetRaster());
long MyDC = m_LEADRasterView2.GetClientDC();
long MyDDB = m_LEADRasterView2.GetRaster().GetDDB(MyDC);
long MyPalette = m_LEADRasterView2.GetPalette(MyDC);
m_LEADRasterView1.GetRaster().SetDDB(MyDC, MyDDB, MyPalette);
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView2.ReleaseClientDC();
DeleteObject((HBITMAP) MyDDB);
DeleteObject((HPALETTE) MyPalette);
pRasterProc->Release();
EndWaitCursor();


DecodeABIC example for Visual C++

void CDemo::OnDecodeABIC()
{
int nFileSize, nRet;
CString strFileName;
unsigned char *pData = NULL;
int i;
unsigned char *pBmpData = NULL;

BITMAPINFO *pBmpInfo = NULL;
BITMAPFILEHEADER BmpFileHeader;

memset(&BmpFileHeader, 0, sizeof(BmpFileHeader));

ILEADRasterIO * pRasterIO = NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

ILEADRasterVariant * pInputData = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant, (void**)&pInputData);

ILEADRasterVariant * pOutputData = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant, (void**)&pOutputData);

m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_ABIC_READ, L_KEY_ABIC_READ);

pBmpInfo = (BITMAPINFO *)malloc(sizeof(*pBmpInfo) + 16 * sizeof(RGBQUAD));
memset(pBmpInfo, 0, sizeof(*pBmpInfo) + 16 * sizeof(RGBQUAD));

strFileName = "c:\\Image2Raw.ica";
CFile File(strFileName, CFile::modeRead);
nFileSize = File.GetLength();

pData = (unsigned char *)malloc(nFileSize);
File.Read(pData, nFileSize);
File.Close();

pInputData->vType = VALUE_ARRAY_BYTE;
pInputData->ItemCount = nFileSize;
for (i = 0; i< nFileSize; ++i)
{
pInputData->PutShortItemValue(i, pData[i]);
}

nRet = pRasterIO->DecodeABIC(pInputData, &pOutputData, 4, 472, 221, FALSE);

if(nRet == 0)
{
pBmpInfo->bmiHeader.biSize = sizeof(pBmpInfo->bmiHeader);
pBmpInfo->bmiHeader.biWidth = 472;
pBmpInfo->bmiHeader.biHeight = 221;
pBmpInfo->bmiHeader.biBitCount = 4;

BmpFileHeader.bfType = 'B' | ('M' << 8);
BmpFileHeader.bfSize = sizeof(*pBmpInfo) + 16 * sizeof(RGBQUAD) + sizeof(BmpFileHeader) + pOutputData->ItemCount;
BmpFileHeader.bfReserved1 = 0;
BmpFileHeader.bfReserved2 = 0;
BmpFileHeader.bfOffBits = sizeof(*pBmpInfo) + 16 * sizeof(RGBQUAD) + sizeof(BmpFileHeader);

for (i = 0; i < 16; ++i)
{
pBmpInfo->bmiColors[i].rgbBlue = 0x11 * i;
pBmpInfo->bmiColors[i].rgbRed = 0x11 * i;
pBmpInfo->bmiColors[i].rgbGreen = 0x11 * i;
pBmpInfo->bmiColors[i].rgbReserved = 0;
}

CFile OutputFile(TEXT("c:\\Abic.bmp"), CFile::modeWrite | CFile::modeCreate);

OutputFile.Write(&BmpFileHeader, sizeof(BmpFileHeader));
OutputFile.Write(pBmpInfo, sizeof(*pBmpInfo) + 16 * sizeof(RGBQUAD));

for(i = 0; i < pOutputData->ItemCount; ++i)
{
unsigned char Byte = (unsigned char) pOutputData->GetShortItemValue(i);
OutputFile.Write(&Byte, 1);
}

OutputFile.Close();
}

pRasterIO->Release();
pInputData->Release();
pOutputData->Release();
}


Deinterlace Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Deinterlace(m_LeadRasterView.GetRaster (), DEINTERLACE_SMOOTH | DEINTERLACE_ODD);
m_pRasterProc->Release();


DeleteBitmapListItems example for Visual C++ 5.0

DeleteBitmapListItems example for C++ 5.0 and later

This example deletes the first five bitmaps from the control's bitmap list. Then, it plays the animation to show that the bitmaps are missing.

//Delete the first five bitmaps.
m_LEADRasterView1.GetRaster().DeleteBitmapListItems(0, 5);
//Play the animation without looping.
m_LEADRasterView1.SetAnimationLoop(FALSE);
m_LEADRasterView1.SetAnimationEnable(TRUE);


DeleteMarker example for C++ 5.0 and later

pMarker1->Load("c:\\test.jpg",0);
pMarker1->GetMarker (0);
pMarker1->DeleteMarker (pMarker1->GetType (),0);
pRasterIO->SetMarkers (m_pMarker1,0);
pRasterIO->Save (m_LeadView.GetRaster() , "c:\\ image2.jpg" ,
FILE_EXIF_JPEG, 24, 2, 0);


DeleteMarkerAt example for C++ 5.0 and later

pMarker1->Load("c:\\ image1.jpg",0);
pMarker1->GetMarker (0);
pMarker1->DeleteMarkerAt (0);
pRasterIO->SetMarkers (m_pMarker1,0);
pRasterIO->Save (m_LeadView.GetRaster() , "c:\\ image2.jpg" ,
FILE_EXIF_JPEG, 24, 2, 0);


DeletePage example for Visual C++ 5.0

DeletePage example for C++ 5.0 and later

// delete page 1 from TEST.TIF
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// delete page 1 from TEST.TIF
pRasterIO->DeletePage("d:\\temp\\TEST.TIF", 1);
pRasterIO->Release();


DeleteTag Example for C++ 5.0 and later

/* The following example will delete the PAGENUMBER tag from page 2 of a TIFF file: */

void TestDeleteTag(ILEADRasterIO * pRasterIO)
{
short nRet;
nRet = pRasterIO->ReadTag("test.tif", 2, 297);
if (nRet == 0)
{
nRet = pRasterIO->DeleteTag("test.tif", 2, 297, 0);
if (nRet != 0)
MessageBox(NULL, TEXT("DeleteTag failed!"), TEXT("Error!"), MB_OK);
else
MessageBox(NULL, TEXT("DeleteTag SUCCEEDED!"), TEXT("Notice"), MB_OK);
}
else
MessageBox(NULL, TEXT("Page 2 does not have a tag number 297!"), TEXT("Error!"), MB_OK);
}


Desaturate Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Desaturate(m_LeadRasterView.GetRaster ());
m_pRasterProc->Release();


Deskew example for Visual C++ 5.0

Deskew example for C++ 5.0 and later

   ILEADRasterProcess* m_pRasterProc= NULL;
CString strMsg;
long iAngle = 0;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&m_pRasterProc);
m_pRasterProc->Deskew(m_LeadRasterView.GetRaster(),RGB(0,0,0),DSKW_PROCESS
 | DSKW_NOFILL | DSKW_DOCUMENTIMAGE);

iAngle = pRasterProc->GetDeskewAngle();
strMsg.Format(TEXT("Rotation: %d hundredths of degrees"), iAngle);
MessageBox(strMsg);

m_pRasterProc->Release();


DeskewExt example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CString strMsg;
long iAngle = 0;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->DeskewExt(m_LeadRasterView.GetRaster(), 1000, 2, 0, DSKW_PROCESS | DSKW_NOFILL| DSKW_LINEAR| DSKW_DOCUMENTIMAGE);

iAngle = m_pRasterProc->GetDeskewExtAngle();
strMsg.Format(TEXT("Rotation: %d hundredths of degrees"), iAngle);
MessageBox(strMsg);

m_pRasterProc->Release();


Despeckle example for Visual C++ 5.0

Despeckle example for C++ 5.0 and later

This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.

//You must unlock support for this feature
//L_KEY_DOCUMENT represents the unlock support string
m_LEADRasterView1.GetRaster().UnlockSupport (L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Despeckle(m_LEADRasterView1.GetRaster());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


DestroyZoomView Example for Visual C++ 5.0 and later

int nCount;

if(m_RasterView.GetHasZoomView())
{
nCount = m_RasterView.GetZoomViewsCount();
for (int i = 0; i<nCount ;++i)
m_RasterView.DestroyZoomView(nCount-i-1);
}


DIB example for Visual C++ 5.0

DIB example for C++ 5.0 and later

This example copies the LEADRasterView1 bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
BeginWaitCursor();
int MyFlags = COPY_EMPTY + COPY_DIB + COPY_PALETTE;
m_LEADRasterView1.GetRaster().Copy(MyFlags);
m_LEADRasterView2.GetRaster().Paste(0);
pRasterProc->Reverse(m_LEADRasterView2.GetRaster());
long MyDib = m_LEADRasterView2.GetRaster().GetDIB();
m_LEADRasterView1.GetRaster().SetDIB(MyDib);
m_LEADRasterView1.ForceRepaint();
GlobalFree((HGLOBAL) MyDib);
pRasterProc->Release();
EndWaitCursor();


DiceEffect Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->DiceEffect(m_LeadRasterView.GetRaster (), 16, 16, 0,
RGB(0, 0, 0),
BITMAP_RESIZE |
DICE_SIZE |
DICE_BORDER);
m_pRasterProc->Release();


DiffuseGlow example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->DiffuseGlow(m_LeadRasterView.GetRaster(),500, 500, 200, 50, RGB(255, 255, 255));
m_pRasterProc->Release();


DigitalSubtract Example for C++ 5.0 and later

ILEADRaster* m_pRasterSrc= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterSrc);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pRasterSrc, "c:\\1.bmp", 0, 0, 1);

m_pRasterProc->DigitalSubtract(m_LeadRasterView.GetRaster (), m_pRasterSrc, DS_CONTRASTENH);

m_pRasterSrc->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


DirectionEdgeStatistical example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->DirectionEdgeStatistical(m_LeadRasterView.GetRaster(), 15, 128,
4500,
RGB(255, 255, 255),
RGB(0, 0, 0));

m_pRasterProc->Release();


Directory Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Directory = "";
m_pRasterProc->ExtractMessage(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();


DiscreteFourierTransformation example for C++ 5.0 and later

int MaxXHarmonic ,MaxYHarmonic;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

MaxXHarmonic = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
MaxYHarmonic = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;

m_pRasterProc->InitFourierTransformation(m_LeadRasterView.GetRaster());

m_pRasterProc->DiscreteFourierTransformation(m_LeadRasterView.GetRaster(),
0,
MaxXHarmonic,
0,
MaxYHarmonic,
DFT_DFT |
DFT_GRAY |
DFT_RANGE |
DFT_INSIDE_X |
DFT_OUTSIDE_Y);

m_pRasterProc->FreeFourierTransformation();

m_pRasterProc->Release();


DispatchValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;
ILEADRaster * pltRaster=NULL;

pltRasVar->Type = VALUE_DISPATCH;
pltRasVar->DispatchValue = pltRaster;


DisplaceMap example for Visual C++

ILEADRaster* m_pTmpRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pTmpRaster);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pTmpRaster, "c:\Sample1.jpg", 0, 0, 1);

m_pRasterProc->DisplaceMap(m_LeadRasterView.GetRaster(), m_pTmpRaster, 5, 5, RGB(0,0,0), FILL_CLR | DSPL_TILE);

m_pTmpRaster->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


DisplayFourierTransformation example for C++ 5.0 and later

int MaxXHarmonic,MaxYHarmonic;

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

ILEADRaster* m_pDisplayRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pDisplayRaster);

m_pDisplayRaster->PutBitmap(m_LeadRasterView.GetRaster().GetBitmap());

MaxXHarmonic = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
MaxYHarmonic = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;

m_pRasterProc->InitFourierTransformation(m_LeadRasterView.GetRaster());
m_pRasterProc->DiscreteFourierTransformation(m_LeadRasterView.GetRaster(),
0,
MaxXHarmonic,
0,
MaxYHarmonic,
DFT_DFT |
DFT_GRAY |
DFT_RANGE |
DFT_INSIDE_X |
DFT_OUTSIDE_Y);

m_pRasterProc->DisplayFourierTransformation(m_pDisplayRaster, DSP_FT_MAG | DSP_FT_LOG);
m_LeadRasterView.GetRaster().SetBitmap(m_pDisplayRaster->GetBitmap());

m_pRasterProc->FreeFourierTransformation();
m_pDisplayRaster->Release();
m_pRasterProc->Release();


DJVResolution example for Visual C++ 5.0

DJVResolution example for C++ 5.0 and later

void CTestImgProcView::OnLoadDJV()
{
ILEADRasterIO *m_pRasterIO = NULL;

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);
/*Set new DJV option*/
m_pRasterIO->DJVResolution = 120;

/* Now load the DJV file */
m_pRasterIO->Load (m_LeadRasterView2.GetRaster(),
 "c:\\image1.DJVU", 0, 1, 1 );

m_pRasterIO->Release();
}


DocCleanSuccess example for Visual C++ 5.0

DocCleanSuccess example for C++ 5.0 and later

void CTutorDlg::OnButtonDotremove()
{
//This example updates a region with all 1x1 to 3x3 specks that are solid black
//if a speck has any white pixels, it is NOT part of the updated region
//The call is configured to update a single LEAD region with all changes
//The image itself is unchanged
//The DotRemove Event is used to display information about each speck that is removed

//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;
m_pRasterProc->EnableDocCleanEvents = TRUE;

int nRet = m_pRasterProc->DotRemove(
m_LEADRasterView1.GetRaster(),
(DotRemoveFlags)(DOT_USE_SIZE | DOT_SINGLE_REGION | DOT_LEAD_REGION | DOT_IMAGE_UNCHANGED),
1,1,3,3);

if (nRet == 0)
{
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
}
}

void CRasterProcSink::OnDotRemove(
long hRgn,
float fBoundingRectLeft,
float fBoundingRectTop,
float fBoundingRectWidth,
float fBoundingRectHeight,
long iWhiteCount,
long iBlackCount)
{
CString strMsg;

strMsg.Format(TEXT("Dot Found at [Left,Top,Width,Height] [%0.0f, %0.0f %0.0f, %0.0f] WhiteCount[%d] BlackCount[%d]\n"),
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iWhiteCount,
iBlackCount);

OutputDebugString(strMsg);

//Do not remove the speck if it contains any white pixels
m_pDlg->m_pRasterProc->DocCleanSuccess = (iWhiteCount > 0) ? SUCCESS_NOREMOVE : SUCCESS_REMOVE;
}


DoubleBuffer example for C++ 5.0 and later

ILEADRasterIO * pRasterIO = NULL;

HRESULT hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO);

m_RasterView.SetDoubleBuffer(TRUE);
pRasterIO->Load(m_RasterView.GetRaster(),
 TEXT("c:\\parrots.jpg"), 0, 0, 1);

pRasterIO->Release();


DoubleItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_ARRAY_DOUBLE;
pltRasVar->ItemCount = 2;
pltRasVar->DoubleItemValue[0] = 10.1;
pltRasVar->DoubleItemValue[1] = 20.2;


DoubleValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_DOUBLE;
pltRasVar->DoubleValue = 10.1;


DrawShape example for Visual C++ 5.0

DrawShape example for C++ 5.0 and later

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

{
ILEADRasterFXD *m_pltRasFxd=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&m_pltRasFxd);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

m_LEADRasterView1.SetAutoRepaint(FALSE);
// Load an image for the main control
pRasterIO->Load(m_LEADRasterView1.GetRaster().m_lpDispatch, "..\\..\\..\\..\\images\\image1.cmp", 0, 0, 1);
// Load an image for the background of the shape
pRasterIO->Load(m_LEADRasterView2.GetRaster().m_lpDispatch, "..\\..\\..\\..\\images\\ulay1.bmp", 0, 0, 1);
// Shape background
m_pltRasFxd->PutShapeBackgroundStyle(FXD_BACKSTYLE_TILED_IMAGE);
m_pltRasFxd->PutBackgroundImageTop(0);
m_pltRasFxd->PutBackgroundImageLeft(0);
m_pltRasFxd->PutBackgroundImageWidth(m_LEADRasterView2.GetRaster().GetBitmapWidth());
m_pltRasFxd->PutBackgroundImageHeight(m_LEADRasterView2.GetRaster().GetBitmapHeight());
// Shape location
m_pltRasFxd->PutShapeTop(50);
m_pltRasFxd->PutShapeLeft(50);
m_pltRasFxd->PutShapeWidth(m_LEADRasterView1.GetDstWidth() - 50);
m_pltRasFxd->PutShapeHeight(m_LEADRasterView1.GetDstHeight() - 50);
// Shape border
m_pltRasFxd->PutShapeBorderColor(RGB(255, 0, 0));
m_pltRasFxd->PutShapeBorderStyle(FXD_BORDERSTYLE_SOLID);
m_pltRasFxd->PutShapeBorderThickness(10);
m_pltRasFxd->PutShapeInnerBandHiliteColor(RGB(255, 255, 255));
m_pltRasFxd->PutShapeInnerBandShadowColor(0);
m_pltRasFxd->PutShapeInnerBandStyle(FXD_INNERSTYLE_RAISED);
m_pltRasFxd->PutShapeInnerBandThickness(2);
m_pltRasFxd->PutShapeOuterBandHiliteColor(RGB(0, 255, 0));
m_pltRasFxd->PutShapeOuterBandShadowColor(RGB(128, 128, 128));
m_pltRasFxd->PutShapeOuterBandStyle(FXD_OUTERSTYLE_RAISED);
m_pltRasFxd->PutShapeOuterBandThickness(2);
// Make the shape a permanent part of the bitmap
m_pltRasFxd->PutDrawPersistence(TRUE);
// Draw the shape
m_pltRasFxd->DrawShape((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL, FXD_SHAPE_RECTANGLE, m_LEADRasterView2.GetRaster().GetBitmap());
// Repaint
m_LEADRasterView1.SetAutoRepaint(TRUE);

pRasterIO->Release();
m_pltRasFxd->Release();
}


DrawStar Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX, CenterY, iStarWidth, iStarHeight;
CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight () / 2;
iStarWidth = m_LeadRasterView.GetRaster().GetBitmapWidth() / 2;
iStarHeight = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;

m_pRasterProc->DrawStar(m_LeadRasterView.GetRaster(), CenterX, CenterY, 5, iStarWidth, iStarHeight, 50, 0, 0, 0, 0, 0, 0, RGB(0, 0, 255), RGB(255, 0, 0), 100, STR_INSIDE);

m_pRasterProc->Release();


DrawText example for Visual C++ 5.0

DrawText example for C++ 5.0 and later

This example demonstrates most of the properties of a three-dimensional text object as it draws rotated text on the current bitmap.

ILEADRasterFXD *m_pltRasFxd=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&m_pltRasFxd);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

ILEADRasterProcess *pltRasProc = NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)& pltRasProc);

m_LEADRasterView1.SetAutoRepaint(FALSE);
// Load an image for the main control
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\lead\\images\\image1.cmp", 0, 0, 1);
// Load an image for the foreground of the text
pRasterIO->Load(m_LEADRasterView2.GetRaster(), "ulay1.bmp", 0, 0, 1);
// text location
m_pltRasFxd->PutTextTop(50);
m_pltRasFxd->PutTextLeft(50);
m_pltRasFxd->PutTextWidth(m_LEADRasterView1.GetDstWidth() - 50);
m_pltRasFxd->PutTextHeight(m_LEADRasterView1.GetDstHeight() - 50);
// The foreground image needs to be the correct size.
pltRasProc->Size(m_LEADRasterView1.GetRaster().m_lpDispatch, m_pltRasFxd->GetTextWidth(), m_pltRasFxd->GetTextHeight(), RESIZE_NORMAL);
// Text alignment and angle
m_pltRasFxd->PutTextAlign(FXD_TEXTALIGN_HCENTER_VCENTER);
m_pltRasFxd->PutTextAngle(450); // 45 degrees
// Text highlight color and style
m_pltRasFxd->PutTextHiliteColor(RGB(255, 255, 255));
m_pltRasFxd->PutTextStyle(FXD_TEXTSTYLE_DROPSHADOW);
// Text drop shadow
m_pltRasFxd->PutShadowColor(RGB(0, 0, 0));
m_pltRasFxd->PutShadowXDepth(5);
m_pltRasFxd->PutShadowYDepth(5);
// Make the text a permanent part of the bitmap
m_pltRasFxd->PutDrawPersistence(TRUE);
// Draw the text
m_pltRasFxd->DrawText((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL, "LEADTOOLS", m_LEADRasterView2.GetRaster().GetBitmap());
m_LEADRasterView1.ForceRepaint();

m_pltRasFxd->Release();
pRasterIO->Release();
pltRasProc->Release();


Dry Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Dry(m_LeadRasterView.GetRaster (),5);
m_pRasterProc->Release();


Dst... example for Visual C++ 5.0

Dst... example for C++ 5.0 and later

This example uses the destination rectangle properties to zoom in on an image.

// Calculate the values to zoom in by 10 percent and center the image.
m_LEADRasterView1.SetDstWidth(m_LEADRasterView1.GetDstWidth() * 1.1f);
m_LEADRasterView1.SetDstHeight(m_LEADRasterView1.GetDstHeight() * 1.1f);
m_LEADRasterView1.SetDstTop((m_LEADRasterView1.GetScaleHeight() - m_LEADRasterView1.GetDstHeight()) / 2);
m_LEADRasterView1.SetDstLeft((m_LEADRasterView1.GetScaleWidth() - m_LEADRasterView1.GetDstWidth()) / 2);
// Set the clipping area to the same as the destination rectangle
m_LEADRasterView1.SetDstClipWidth(m_LEADRasterView1.GetDstWidth());
m_LEADRasterView1.SetDstClipHeight(m_LEADRasterView1.GetDstHeight());
m_LEADRasterView1.SetDstClipTop(m_LEADRasterView1.GetDstTop());
m_LEADRasterView1.SetDstClipLeft(m_LEADRasterView1.GetDstLeft());
// Redisplay the image
m_LEADRasterView1.ForceRepaint();


DynamicBinary Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->DynamicBinary(m_LeadRasterView.GetRaster (),8,16);
m_pRasterProc->Release();


EdgeDetectEffect Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->EdgeDetectEffect(m_LeadRasterView.GetRaster (),50, 0, EDGE_SOLID);
m_pRasterProc->Release();


EdgeDetector example for Visual C++ 5.0

EdgeDetector example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->EdgeDetector (m_RasterView1.GetRaster (), 60, EDG_SOBEL_ALL);

pRasterProc->Release();


EdgeDetectorExt example for Visual C++ 5.0

EdgeDetectorExt example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->EdgeDetectorExt (m_RasterView1.GetRaster (), 60, EDG_SOBEL_ALL);

pRasterProc->Release();


EdgeDetectStatistical Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->EdgeDetectStatistical(m_LeadRasterView.GetRaster (),15, 128, RGB(255, 255, 255), RGB(0, 0, 0));
m_pRasterProc->Release();


EffectSpeed Example for C++ 5.0 and later

ILEADRasterIO *m_pRasterIO = NULL;
m_LeadRasterView.SetAutoRepaint(FALSE);
CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);

m_LeadRasterView.SetTransitionDelay(50);
m_pRasterIO->Load(m_LeadRasterView2.GetRaster().m_lpDispatch, "c:\\1.cmp", 0, 0, 1);
m_LeadRasterView.SetTransitionEffect(EFX_EFFECT_WIPE_RECTANGLE_OUT);
m_LeadRasterView.SetTransitionStyle(EFX_TRANSITION_GRADIENT);
m_LeadRasterView.EffectSpeed = 0;
m_LeadRasterView.EffectCycles = 0;
m_LeadRasterView.SetGradientStyle(EFX_GRADIENT_ANGLE_TO_LT);
m_LeadRasterView.SetGradientEndColor(RGB(0, 0, 0));
m_LeadRasterView.SetGradientStartColor(RGB(255, 255, 255));
m_LeadRasterView.SetGradientSteps(255);
m_LeadRasterView.SetAutoRepaint(TRUE);
m_pRasterIO->Release();


Emboss example for Visual C++ 5.0

Emboss example for C++ 5.0 and later

This example applies an emboss effect and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Emboss(m_LEADRasterView1.GetRaster(),
EMBOSS_NE, 500);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


EnableKeyboard example for Visual C++ 5.0

EnableKeyboard example for Visual C++ 5.0 and later

// toggle keyboard processing
m_LEADImageList.SetEnableKeyboard(! m_LEADImageList.GetEnableKeyboard());


EnableLoadInfoEvent Example for C++ 5.0 and later

ILEADRasterIO  *
 pRasterIO = NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO);
pRasterIO->EnableLoadInfoEvent
 = TRUE;
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\1.Fax"),
 0, 0, 1);
if(pRasterIO)
pRasterIO->Release();


EnableMethodErrors (ILEADRasterImgList) example for C++ 5 and later

TRY
{
m_LEADImageList.SetEnableMethodErrors(FALSE);
//call with invalid file name
m_LEADImageList.LoadDatabase("dd::yY");
AfxMessageBox(TEXT("no errors genererated so far"));
//enable error generation
m_LEADImageList.SetEnableMethodErrors(TRUE);
m_LEADImageList.LoadDatabase("dd::yY");
AfxMessageBox(TEXT("You should NOT get this message"));
}
CATCH_ALL(e)
{
e->ReportError();
}
END_CATCH_ALL
AfxMessageBox(TEXT("Proceeding after error was handled"));


EnableMethodErrors (ILEADRasterThumbnail) example for Visual C++ 5.0

EnableMethodErrors (ILEADRasterThumbnail) example for C++ 5.0 and later

//disable method errors
m_pRasterThumbnail->PutEnableMethodErrors (FALSE);


EnableMethodErrors example for Visual C++ 5.0

EnableMethodErrors example for C++ 5.0 and later

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle in this case).

ILEADRasterProcess *pRasterProc=NULL;
int ShearAngle = 9000; // This would be the user's inPut * 100
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->PutEnableMethodErrors(FALSE);
int nRet = pRasterProc->Shear(m_LEADRasterView1.GetRaster(),
ShearAngle, TRUE, RGB(0, 0, 255));
if(nRet == ERROR_INV_PARAMETER)
{
CString cMsg(TEXT("The angle cannot be more than 45 degrees"));
MessageBox(cMsg, TEXT("Error"));
}
else
{
m_LEADRasterView1.ForceRepaint();
}
pRasterProc->Release();


EnableOCRDrawing Example for C++ 5.0 and later

void TestFunction()
{
m_pLRasterDoc->ActivePageIndex = 0;
m_RasterView.SetRasterDocument(m_pLRasterDoc);
m_RasterView.SetEnableOCRDrawing(TRUE);
m_RasterView.SetSelectedZoneIndex(0);
m_RasterView.ForceRepaint();
}


EnableOLEDragMethod Example for C++ 5.0 and later

void COLEDragDlg::OnOLEGiveFeedbackLeadrasterview1()
{
m_RasterView1.SetEnableUseDefaultCursor(FALSE);
}

void COLEDragDlg::OnOLEGiveFeedbackLeadrasterview2()
{
m_RasterView2.SetEnableUseDefaultCursor(FALSE);
}

void COLEDragDlg::OnButton1()
{
ILEADRasterIO * pRasterIO=NULL;

HRESULT hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
if (FAILED(hr))
return;

pRasterIO->Load(m_RasterView2.GetRaster().m_lpDispatch, "d:\\images\\sample1.cmp", 0, 1, 1);
pRasterIO->Release();

m_RasterView1.SetEnableOLEDragMethod(TRUE);
m_RasterView2.SetEnableOLEDragMethod(TRUE);

CPictureHolder PictHolder;
COLEDragApp *pTheApp = (COLEDragApp *)AfxGetApp();

HICON hIcon = pTheApp->LoadStandardIcon(IDI_HAND);
PictHolder.CreateFromIcon(hIcon);

m_RasterView1.SetOLEDragCursor((IDispatch *)PictHolder.m_pPict);
m_RasterView2.SetOLEDragCursor((IDispatch *)PictHolder.m_pPict);
}

void COLEDragDlg::OnButton2()
{
m_RasterView1.SetEnableOLEDragMethod(FALSE);
m_RasterView2.SetEnableOLEDragMethod(FALSE);
}


EnablePaint example for Visual C++ 5.0

EnablePaint example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// disable the paint
m_LEADRasterView1.SetEnablePaint(FALSE);
// do whatever changes you want. The control will not repaint
pRasterProc->Size(m_LEADRasterView1.GetRaster(),
m_LEADRasterView1.GetRaster().GetBitmapWidth() * 2,
m_LEADRasterView1.GetRaster().GetBitmapHeight() * 2,
RESIZE_BICUBIC);
// re-enable the paint
m_LEADRasterView1.SetEnablePaint(TRUE);
// call ForceRepaint because the control will not automatically repaint
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


EnableRestrictToContainer example for C++ 5 and later

//'This examples toggles the "restrict to container" property.
//'If an object is restricted to the container, no part of it can be moved outside the container
void CTutorDlg::ExampleAnnSetRestrictToContainer(long hObject)
{
VARIANT_BOOL bRestrict;

bRestrict = m_pRasterAnn->GetEnableRestrictToContainer(hObject);

bRestrict = !bRestrict;

m_pRasterAnn->PutEnableRestrictToContainer(hObject,bRestrict);

if (bRestrict == TRUE)
MessageBox (TEXT("Restricted To Container"));
else
MessageBox (TEXT("Not Restricted To the Container"));
}


EnableZoomInRect example for Visual C++ 5.0

EnableZoomInRect example for C++ 5.0 and later

This example toggles the EnableZoomInRect property.

// Toggle the ZoomInRect setting
if (m_LEADRasterView1.GetEnableZoomInRect() == TRUE)
m_LEADRasterView1.SetEnableZoomInRect(FALSE);
else
m_LEADRasterView1.SetEnableZoomInRect(TRUE);


EncodeABIC example for Visual C++

void CDemo::OnEncodeABIC()
{
int nRet;
CString strFileName;
int i;

ILEADRaster * pRaster = NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);

ILEADRasterIO * pRasterIO = NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

ILEADRasterVariant * pInputData = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant, (void**)&pInputData);

ILEADRasterVariant * pOutputData = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant, (void**)&pOutputData);

m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_ABIC_READ, L_KEY_ABIC_READ);

nRet = pRasterIO->Load (pRaster, "c:\\Abic.bmp", 0, 0, 1);

pInputData = pRasterIO->SaveArray(pRaster, FILE_RAW, 0, (QFactorConstants)0);

nRet = pRasterIO->EncodeABIC(pInputData, 4, 472, 221, &pOutputData, FALSE);

if(nRet == 0)
{
CFile OutputFile(TEXT("c:\\Image2Raw.ica"), CFile::modeWrite | CFile::modeCreate);
int ddd = pOutputData->ItemCount;
for(i =0; i<pOutputData->ItemCount; ++i)
{
unsigned char Byte = (unsigned char) pOutputData->GetShortItemValue (i);
OutputFile.Write(&Byte, 1);
}

OutputFile.Close();
}

pRasterIO->Release();
pInputData->Release();
pOutputData->Release();
}


EnumerateMarkers example for C++ 5.0 and later

void CT44Dlg::OnEnumerateMarker()
{
pMarker1->Load("c:\\image1.jpg",0);
pMarker1->EnumMarkers ();
}

void CRasterODBCSink::OnEnumerateMarkers (long lType , long lElementCount )
{
TCHAR str[100];
wsprintf(str, TEXT("%d %d"),lType, lElementCount)
MessageBox(NULL,str, TEXT("Print"),0);

for(int i=0;i< lElementCount;++i)
{
pMarker1->Element(i);
wsprintf(str, TEXT("%d %d"),pMarker2->GetType (),
}
}


EnumFileTags Example for C++ 5.0 and later

void OnEnumTags(long uTag, long uType, long uCount)
{
CString csData;
csData.Format(TEXT("Tag = %d\nType = %d\nCount = %d\n"), uTag, uType, uCount);
MessageBox(NULL, csData, "Notice!", MB_OK);
pRasterIO->StopFireEnumTags = FALSE
}

void EnumTags(ILEADRasterIO * pRasterIO)
{
// Enumerate the tags
pRasterIO->EnumFileTags("file.tif", 0, 0);
}


EnumGeoKeys Example for Visual C++ 5.0

EnumGeoKeys Example for Visual C++

/* This is an efficient way of reading all the GeoKeys in a file */
ILEADRasterIO * pRasterIO = NULL;
void TestEnumFileGeoKeys()
{
short nRet = pRasterIO->EnumFileGeoKeys (TEXT("GeoTif.tif"), 0, 0);
if (nRet == 0)
MessageBox(NULL, TEXT("Enumeration SUCCEEDED!"), TEXT("Notice"), MB_OK);
else
MessageBox(NULL, TEXT("Error enumerating GeoKeys"), TEXT("Error"), MB_OK);
}

void OnEnumGeoKeys(long uTag, long uType, long uCount)
{
ILEADRasterVariant * pData;
CString csBuffer;

csBuffer.Format(TEXT("Key = %d\nType %s\nCount = %d\n"), uTag, (uType == TAG_ASCII) ? TEXT("ASCII") : (uType == TAG_SHORT) ? TEXT("SHORT") : TEXT("DOUBLE"), uCount);
MessageBox(NULL, csBuffer, TEXT("Key Info"), MB_OK);

pRasterIO->get_GeoKeyData (&pData);
if (uType == TAG_SHORT)
{
if (uCount == 1)
csBuffer.Format(TEXT("Key Value = %d"), pData->ShortValue);
else
csBuffer.Format(TEXT("Key Value = %d"), pData->ShortItemValue [0]);
}
else
{
if (uType == TAG_DOUBLE)
if (uCount == 1)
csBuffer.Format(TEXT("Key Value = %d"), pData->DoubleValue);
else
csBuffer.Format(TEXT("Key Value = %d"), pData->DoubleItemValue [0]);
}

MessageBox(NULL, csBuffer, TEXT("Data"), MB_OK);
pRasterIO->StopFireEnumGeoKeys = FALSE;
}


EnumSegments example for Visual C++ 5.0

EnumSegments example for C++ 5.0 and later

void CT44Dlg::OnEnumSeg()
{
m_pRasterMrc->EnumSegments();
SetWindowText(TEXT("Picture segments will be green-hashed"));
}

void CRasterMrcSink::OnEnumSegments(
long nSegId,
long SegmentLeft,
long SegmentTop,
long SegmentRight,
long SegmentBottom,
enum MRCSegmentTypeConstants SegType,
OLE_COLOR TextForeColor,
OLE_COLOR TextBackColor )
{
ILEADRasterFXD *pRasterFXD=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFXD);

pRasterFXD->DrawPenWidth = 6;
pRasterFXD->DrawPenColor = RGB(255, 0, 255);
if(SegType == SEGMENT_PICTURE)
pRasterFXD->DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE;
else
pRasterFXD->DrawFillStyle = DRAWFILLSTYLE_VERTICAL_LINE;
pRasterFXD->DrawRectangle(NULL, m_pDlg->m_RasterView.GetClientDC(), SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom - SegmentTop);

pRasterFXD->Release();
}


Exif example for Visual C++ 5.0

Exif example for C++ 5.0 and later

This example does the following:

1. | Reads all of the comments in an existing Exif file, updating the Comment array.
2. | Loads and modifies the file's image.
3. | Updates some of the comments in the comment array.
4. | Saves the file.
5. | Reads and displays the updated comments.

Note: Comments for GIF, TIFF, and DICOM files are simpler than the ones in this Exif example. With those file types, all of the comments are strings that you can get and set with simple assignments.

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
ILEADRasterVariant * pltRasVar1 = NULL;
ILEADRasterVariant * pltRasVar2 = NULL;
ILEADRasterVariant * pltRasVar3 = NULL;
ILEADRasterVariant * pltRasVarEmpty = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar1);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar2);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar3);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVarEmpty);

// Array index for general use.
long MyIndex;
// Value for clearing comments.
pltRasVarEmpty->Type = VALUE_STRING;
pltRasVarEmpty->StringValue = "";
// File that we will load and update.
CString FilePath = TEXT("d:\\temp\\exif1.tif");
// Get all of the current comments from an Exif file.
// Temporarily disable errors so that we do not fail when comments are missing.
pRasterIO->PutEnableMethodErrors(FALSE);
for(short i = 0; i <= CMNT_LAST; ++i)
{
pRasterIO->PutComment(i, pltRasVarEmpty);
pRasterIO->PutComment(i,
pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, i));
}
pRasterIO->PutEnableMethodErrors(TRUE);
// Load and modify the image.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 0, 0, 1);
pRasterProc->Reverse(m_LEADRasterView1.GetRaster());
// Update the date when the file is generated.
CTime RightNow = CTime::GetCurrentTime();
CString DateTimeString = RightNow.Format(TEXT("%Y:%m:%d %H:%M:%S"));
pltRasVar1->Type = VALUE_STRING;
pltRasVar1->StringValue = (PSTR) DateTimeString;
pRasterIO->PutComment(CMNT_SZDATETIMEDIGITIZED, pltRasVar1);
pRasterIO->PutComment(CMNT_SZSUBSECTIMEDIGITIZED, pltRasVarEmpty);
// Change the CMNT_SUBJECTDISTANCE comment to 4 1/3 meters.
pltRasVar2->Type = VALUE_ARRAY_LONG;
pltRasVar2->LongItemValue(0) = 13;
pltRasVar2->LongItemValue (0) = 3;
// Update the CMNT_SUBJECTDISTANCE comment.
pRasterIO->PutComment(CMNT_SUBJECTDISTANCE, pltRasVar2);
// Add an ASCII CMNT_USERCOMMENT comment.
// Specify the user comment string.
CString MyCommentText = TEXT("This is my new comment.");
int MyCommentSize = 8 + MyCommentText.GetLength();
// Define the array for the user comment.

pltRasVar3->Type = VALUE_ARRAY_BYTE;
pltRasVar3->ItemCount = MyCommentSize + 1;

// Fill in the ASCII prefix.
pltRasVar3->ShortItemValue(0) = 'A';
pltRasVar3->ShortItemValue (1) = 'S';
pltRasVar3->ShortItemValue (2) = 'C';
pltRasVar3->ShortItemValue (3) = 'I';
pltRasVar3->ShortItemValue (4) = 'I';
pltRasVar3->ShortItemValue (5) = '\0';
pltRasVar3->ShortItemValue (6) = '\0';
pltRasVar3->ShortItemValue (7) = '\0';
// Fill in the rest of the CMNT_USERCOMMENT comment.
for( i = 8; i < MyCommentSize; ++i)
{
pltRasVar3->ShortItemValue(i) = MyCommentText[i-8];
}
pltRasVar3->ShortItemValue (MyCommentSize) = '\0';
// Update the CMNT_USERCOMMENT comment.
pRasterIO->PutComment(CMNT_USERCOMMENT, pltRasVarEmpty);
pRasterIO->PutComment(CMNT_USERCOMMENT, pltRasVar3);
// Save the file.
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), FILE_EXIF, 24,
(QFactorConstants)0, SAVE_OVERWRITE);
// Read the comments that we saved.
pltRasVar1 = pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, CMNT_SZDATETIMEDIGITIZED);

pltRasVar2 = pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, CMNT_SUBJECTDISTANCE);

pltRasVar3 = pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(),
LPCTSTR(FilePath), 1, CMNT_USERCOMMENT);

// Format the Subject Distance as a string.
CString DistanceString;
DistanceString.Format(TEXT("%f"), (double)pltRasVar2->FloatItemValue (0) / pltRasVar2->FloatItemValue (1));
// Format the CMNT_SZDATETIMEDIGITIZED comment as a string.
CString NewDateTime(pltRasVar1->StringValue);
// Initialize the string for the message box.
CString MyMsg = TEXT("Subject Distance = ") + DistanceString + TEXT("\nDate/Time = ") + NewDateTime;
// Add the ASCII comment to the message, if the comment is there.

TCHAR OneCharacter;
OneCharacter = pltRasVar3->ShortItemValue (MyIndex);
if( OneCharacter == 'A')
{
MyMsg = MyMsg + TEXT("\n\n");
long ArraySize;
ArraySize = pltRasVar3->ItemCount ;
for ( MyIndex = 8; MyIndex <= ArraySize; MyIndex++)
{
OneCharacter = pltRasVar3->ShortItemValue (MyIndex);
MyMsg = MyMsg + CString(OneCharacter);
}
}
// Display the message.
MessageBox(MyMsg);
// Clear the comments from memory
for( i = 0; i <= CMNT_LAST; ++i)
pRasterIO->PutComment(i, pltRasVarEmpty);
pRasterIO->Release();
pRasterProc->Release();

pltRasVarEmpty->Release ();
pltRasVar1->Release ();
pltRasVar2->Release ();
pltRasVar3->Release ();


ExportBitmapList Example for C++ 5.0 and later

void CDemoDlg::OnLoadFromFile()
{
m_RasterImgList1.LoadFromFile("c:\\image1.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image2.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image3.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image4.jpg", 0, 0, -1);
//Export All Items From Images List Control
m_RasterImgList1.ExportBitmapList(0, m_RasterImgList1.GetCount());
}

void CDemoDlg::OnImport()
{
m_RasterImgList2.ImportBitmapList(m_RasterImgList1.GetExportedBitmapList(), 0, 2, "Image1", "Imported From List1");
}


ExtractMessage example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->ExtractMessage(m_LeadRasterView.GetRaster());
MessageBox(m_pRasterProc->Message);
m_pRasterProc->Release();


FastFourierTransformation example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Size (m_LeadRasterView.GetRaster(), 256, 512, RESIZE_BICUBIC);
m_pRasterProc->InitFourierTransformation(m_LeadRasterView.GetRaster());
/* Apply FFT*/
m_pRasterProc->FastFourierTransformation(m_LeadRasterView.GetRaster(), FFT_FFT | FFT_GRAY);

/* Free FFT buffer*/
m_pRasterProc->FreeFourierTransformation();

m_pRasterProc->Release();


FastLoad example for Visual C++

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->FastLoad = TRUE;
pRasterIO->Load (m_RasterView1.GetRaster(), "d:\\temp\\test2.abc", 0, 1, 1);
pRasterIO->Release();


FastRotate example for Visual C++ 5.0

FastRotate example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

This example uses fast rotation to rotate an image 90 degrees:

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->FastRotate(m_LEADRasterView1.GetRaster(),90);
pRasterProc->Release();


FeatherAlphaBlend example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
ILEADRaster *pRaster2=NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

pRaster2->CreateBitmap (800, 600, 24);
pRaster2->SetRgnRoundRect (50, 50, 500, 500, 150, 150, L_RGN_SET);
pRasterProc->CreateFadedMask (m_RasterView2.GetRaster (), pRaster2, 60, 20, 3, 0, FadedMaskConstants(FADE_DUMPFILL | FADE_NOTRANSPARENCY), 255, RGB(0, 0, 255));
pRasterIO->Load (pRaster2, "c:\\temp\\test.cmp", 0, 1, 1);
pRasterProc->FeatherAlphaBlend (m_RasterView1.GetRaster(), 0, 0, m_RasterView2.GetRaster().GetBitmapWidth (), m_RasterView2.GetRaster().GetBitmapHeight (), pRaster2, 0, 0, m_RasterView2.GetRaster());

pRaster2->Release();
pRasterProc->Release();
pRasterIO->Release();


FeedLoad example for Visual C++ 5.0

FeedLoad example for C++ 5.0 and later

This example uses StartFeedLoad, FeedLoad, and StopFeedLoad and loads a file through a buffer to simulate receiving a transmitted image.

#define BUFFERSIZE 1000
void CTutorDlg::OnFeedload()
{
LPSTR lp; /* pointer to the data */

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

pltRasVar->Type = VALUE_ARRAY_BYTE;
pltRasVar->ItemCount = BUFFERSIZE;

/* Now we have a variant and we can do the real work */
HFILE hf;
int bytesread;

#ifdef UNICODE

hf = _wopen (TEXT("v:\\images\\eagle.cmp"), OF_READ);

#else

hf = _lopen ("v:\\images\\eagle.cmp", OF_READ);

#endif
if(pRasterIO->StartFeedLoad(m_LEADRasterView1.GetRaster(), 0, 0, 1)) /* default bits per pixel and first page */
{
_lclose( hf );
MessageBox( TEXT("Error in StartFeedLoad !") );
return;
}
do
{
bytesread = (int)_hread( hf, lp, BUFFERSIZE );
if(pRasterIO->FeedLoad(pltRasVar, bytesread))
{
_lclose( hf );
MessageBox(TEXT("Error in FeedLoad !") );
return;
}
} while (bytesread > 0);
if(pRasterIO->StopFeedLoad())
{
_lclose( hf );
MessageBox(TEXT("Error in StopFeedLoad !") );
return;
}
pltRasVar->Release ();
pRasterIO->Release();
}


FileName Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Message = "";
m_pRasterProc->FileName ="c:\\1.txt";
m_pRasterProc->AddMessage(m_LeadRasterView.GetRaster ());
m_pRasterProc->Release();


FilePage Event Example for Visual C++ 5.0

FilePage Event Example for C++ 5.0 and later

This example shows how the FilePage event can be used to size and position a lead control when an image is loaded.

//NOTE: This is not a complete example for handing events, some steps have been omitted.
//For a complete example of how to handle events, refer to the example
//Updating a Gauge and Detecting a User Interrupt.

void CRasterIOSink::OnFilePage(void)
{
float HeightFactor, WidthFactor; // Factors for aspect ratio
float HeightAllowed, WidthAllowed; // Maximum width and height
float Width, Height, Left, Top; // Variables for control dimensions
/**********************************************/
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
HeightFactor = m_pDlg->m_pRasterIO->GetInfoHeight();
WidthFactor = m_pDlg->m_pRasterIO->GetInfoWidth();
CRect rcWindow;
m_pDlg->GetClientRect(rcWindow);
HeightAllowed = rcWindow.Height() * 3.0f / 4;
WidthAllowed = rcWindow.Width() * 3.0f / 4;
// Center the LEAD control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
Left = rcWindow.Width() / 8.0f;
Width = WidthAllowed;
Height = (Width * HeightFactor) / WidthFactor;
Top = (rcWindow.Height() - Height) / 2;
}
else
{
Top = rcWindow.Height() / 8.0f;
Height = HeightAllowed;
Width = (Height * WidthFactor) / HeightFactor;
Left = (rcWindow.Width() - Width) / 2;
}
rcWindow.SetRect(0, 0, (int) Width, (int) Height);
rcWindow.OffsetRect((int) Left, (int) Top);
m_pDlg->m_LEADRasterView1.MoveWindow(rcWindow);
// Turn off scroll bars to make sure we use the full client area.
m_pDlg->m_LEADRasterView1.SetAutoScroll(FALSE);
// Set the image display size to match the LEAD control
m_pDlg->m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_pDlg->m_LEADRasterView1.GetScaleWidth(),
m_pDlg->m_LEADRasterView1.GetScaleHeight());
m_pDlg->m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f,
m_pDlg->m_LEADRasterView1.GetScaleWidth(),
m_pDlg->m_LEADRasterView1.GetScaleHeight());
}


Fill example for Visual C++ 5.0

Fill example for C++ 5.0 and later

This example fills the bitmap with blue and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Fill(m_LEADRasterView1.GetRaster(),
RGB(0,0,255));
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Flip example for Visual C++ 5.0

Flip example for C++ 5.0 and later

This example flips the bitmap and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


FloaterDstClip... example for Visual C++ 5.0

FloaterDstClip... example for C++ 5.0 and later

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

// Declare local variables.
float AdjustX, AdjustY, NewLeft, NewTop, NewWidth, NewHeight;
// Set variables to use for adjustment increments.
AdjustX = m_LEADRasterView1.GetScaleWidth() / 20;
AdjustY = m_LEADRasterView1.GetScaleHeight() / 20;
// Determine new values, based on adjustments of current values.
NewLeft = m_LEADRasterView1.GetFloaterDstClipLeft() + AdjustX;
NewTop = m_LEADRasterView1.GetFloaterDstClipTop() + AdjustY;
NewWidth = m_LEADRasterView1.GetFloaterDstClipWidth() - (2 * NewLeft);
NewHeight = m_LEADRasterView1.GetFloaterDstClipHeight() - (2 * NewTop);
// Set the clipping rectangle to the new values.
m_LEADRasterView1.SetFloaterDstClipRect(NewLeft, NewTop, NewWidth, NewHeight);


FloatItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutType (VALUE_ARRAY_FLOAT);
pltRasVar->ItemCount = 2;
pltRasVar->FloatItemValue[0] = 5;
pltRasVar->FloatItemValue[1] = 10;


FloatValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutType(VALUE_FLOAT);
pltRasVar->PutFloatValue(5);


Font (ILEADRasterImgList) example for Visual C++ 5.0

Font (ILEADRasterImgList) example for C++ 5.0 and later

//change the font properties
m_LEADImageList.GetFont().SetName("Arial");
if(m_LEADImageList.GetFont().GetBold())
m_LEADImageList.GetFont().SetBold(FALSE);
else
m_LEADImageList.GetFont().SetBold(TRUE);


Font example for Visual C++ 5.0

Font example for C++ 5.0 and later

This example, in a MouseUp event, determines the size of a rectangle for a string in the specified font. It then draws the rectangle and draws the text on top of the rectangle.
//You must include FONT.H
//You must compile FONT.CPP
//Both are in \LEADTOOLS\INCLUDE
ILEADRasterFXD *pRasterFxd=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

float TextWidth;
float TextHeight;
COleFont myFont;
long hDC=NULL;

myFont.m_lpDispatch = pRasterFxd->GetFont();
CY size = myFont.GetSize();
size.Hi = 0; // Hi will be 0 unless you use a really big font
size.Lo = 32L * 10000L; // 32 point
myFont.SetSize(size);
pRasterFxd->PutDrawFontColor(RGB(0, 0, 255)); //Blue
pRasterFxd->PutTextStyle(FXD_TEXTSTYLE_NORMAL);
pRasterFxd->PutTextAlign(FXD_TEXTALIGN_HCENTER_VCENTER);
// Get the width and height of the text to be drawn.
hDC = m_LEADRasterView1.GetClientDC();
TextWidth = pRasterFxd->DrawTextWidth(hDC, "This is my text.");
TextHeight = pRasterFxd->DrawTextHeight(hDC, "This is my text.");
// Set the location for the text
pRasterFxd->PutTextTop (y);
pRasterFxd->PutTextLeft (x);
pRasterFxd->PutTextWidth (TextWidth);
pRasterFxd->PutTextHeight (TextHeight);
// Set the properties for drawing a rectangle behind the text.
pRasterFxd->PutDrawPenStyle(DRAWPENSTYLE_SOLID);
pRasterFxd->PutDrawMode(DRAWMODE_COPY_PEN);
pRasterFxd->PutDrawFillColor(RGB(0, 255, 0)); //Green
// Draw on the screen, not on the bitmap.
pRasterFxd->PutDrawPersistence(FALSE);
// Draw the rectangle, then draw the text.
pRasterFxd->DrawRectangle (NULL, hDC, x, y, TextWidth, TextHeight);
pRasterFxd->DrawText (NULL, hDC, "This is my text.", 0);
m_LEADRasterView1.ReleaseClientDC();
pRasterFxd->Release();


ForeColor example for Visual C++ 5.0

ForeColor example for C++ 5 and later

//set text color to blue
m_LEADImageList.SetForeColor(RGB(0, 0, 255));


Fragment example for Visual C++

IILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Fragment(m_LeadRasterView.GetRaster(), 15, 100);
m_pRasterProc->Release();


Frame... example for Visual C++ 5.0

Frame... example for C++ 5.0 and later

This example sets the control's frame properties. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView1.SetFrameThickness(2);
m_LEADRasterView1.SetFrameColor(RGB(0, 0, 0));
m_LEADRasterView1.SetFrameInnerStyle(EFX_INNERSTYLE_INSET);
m_LEADRasterView1.SetFrameOuterStyle(EFX_OUTERSTYLE_RAISED);
m_LEADRasterView1.SetFrameInnerHiliteColor(RGB(255, 255, 0)); // Yellow
m_LEADRasterView1.SetFrameInnerShadowColor(RGB(128, 128, 128)); // Dark Gray
m_LEADRasterView1.SetFrameOuterHiliteColor(RGB(255, 0, 0)); // Red
m_LEADRasterView1.SetFrameOuterShadowColor(RGB(192, 192, 192)); // Light Gray
m_LEADRasterView1.SetFrameInnerThickness (3);
m_LEADRasterView1.SetFrameOuterThickness (3);
m_LEADRasterView1.SetAutoRepaint(TRUE);


FreeHandShear Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int nMax=0;

m_pRasterProc->AmplitudesCount(4);

m_pRasterProc->PutUserLUTCurveX(0,0);
m_pRasterProc->PutUserLUTCurveY(0,0);

m_pRasterProc->PutUserLUTCurveX(1,3);
m_pRasterProc->PutUserLUTCurveY(1,10);

m_pRasterProc->PutUserLUTCurveX(2,9);
m_pRasterProc->PutUserLUTCurveY(2,-10);

m_pRasterProc->PutUserLUTCurveX(3,12);
m_pRasterProc->PutUserLUTCurveY(3,0);

m_pRasterProc->GetCurvePoints(GUB_LINEAR);

for(int i = 0; i < m_pRasterProc->AmplitudesCount; i++)
if(nMax <m_pRasterProc->GetCurve (i))
nMax = m_pRasterProc->GetCurve(i);

if(nMax)
for(i = 0; i <m_pRasterProc->AmplitudesCount; i++)
m_pRasterProc->PutCurve(i,(1000 * m_pRasterProc->GetCurve(i)/ abs(nMax) )) ;

m_pRasterProc->FreeHandShear(m_LeadRasterView.GetRaster(),100,RGB(0,0,0), FILL_RPT | SHR_HORZ);

m_pRasterProc->Release();


FreeHandWave Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->AmplitudesCount(4);

m_pRasterProc->PutUserLUTCurveX(0,0);
m_pRasterProc->PutUserLUTCurveY(0,0);

m_pRasterProc->PutUserLUTCurveX(1,3);
m_pRasterProc->PutUserLUTCurveY(1,10);

m_pRasterProc->PutUserLUTCurveX(2,9);
m_pRasterProc->PutUserLUTCurveY(2,-10);

m_pRasterProc->PutUserLUTCurveX(3,12);
m_pRasterProc->PutUserLUTCurveY(3,0);

m_pRasterProc->GetCurvePoints(GUB_LINEAR);

m_pRasterProc->FreeHandWave(m_LeadRasterView.GetRaster(), 100,10, 0 , 0, FILL_RPT |DIS_FRQ);
m_pRasterProc->Release();


FreePlaneBend Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PutUserLUTCurveSize(4);

m_pRasterProc->PutUserLUTCurveX(0,0);
m_pRasterProc->PutUserLUTCurveY(0,0);

m_pRasterProc->PutUserLUTCurveX(1,3);
m_pRasterProc->PutUserLUTCurveY(1,10);

m_pRasterProc->PutUserLUTCurveX(2,9);
m_pRasterProc->PutUserLUTCurveY(2,-10);

m_pRasterProc->PutUserLUTCurveX(3,12);
m_pRasterProc->PutUserLUTCurveY(3,0);

m_pRasterProc->GetCurvePoints(GUB_LINEAR);
m_pRasterProc->FreePlaneBend(m_LeadRasterView.GetRaster (), 200, RGB(255, 0, 0), FILL_CLR + FPB_VERT);

m_pRasterProc->Release();


FreeRadBend Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/ 2;

m_pRasterProc->PutUserLUTCurveSize(4);

m_pRasterProc->PutUserLUTCurveX(0,0);
m_pRasterProc->PutUserLUTCurveY (0,0);

m_pRasterProc->PutUserLUTCurveX(1,3);
m_pRasterProc->PutUserLUTCurveY(1,10);

m_pRasterProc->PutUserLUTCurveX(2,9);
m_pRasterProc->PutUserLUTCurveY(2,-10);

m_pRasterProc->PutUserLUTCurveX(3,12);
m_pRasterProc->PutUserLUTCurveY(3,0);

m_pRasterProc->GetCurvePoints (GUB_LINEAR);
m_pRasterProc->FreeRadBend( m_LeadRasterView.GetRaster (), 200, CenterX, CenterY,RGB(255, 0, 0), FILL_CLR + FILL_ROT);

m_pRasterProc->Release();


FrequencyFilter example for C++ 5.0 and later

int MaxXHarmonic,MaxYHarmonic;

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

ILEADRaster* m_pDisplayRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pDisplayRaster);

m_pDisplayRaster->PutBitmap(m_LeadRasterView.GetRaster().GetBitmap());
MaxXHarmonic = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
MaxYHarmonic = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;

m_pRasterProc->InitFourierTransformation (m_LeadRasterView.GetRaster());
m_pRasterProc->DiscreteFourierTransformation(m_LeadRasterView.GetRaster(),
0,
MaxXHarmonic,
0,
MaxYHarmonic,
DFT_DFT |
DFT_GRAY |
DFT_RANGE |
DFT_INSIDE_X |
DFT_OUTSIDE_Y);

m_pRasterProc->FrequencyFilter(0, MaxXHarmonic, 0, MaxYHarmonic, FRQ_INSIDE_X | FRQ_INSIDE_Y);
m_pRasterProc->DisplayFourierTransformation(m_pDisplayRaster, DSP_FT_MAG | DSP_FT_LOG);

m_LeadRasterView.GetRaster().SetBitmap( m_pDisplayRaster->GetBitmap());
m_pRasterProc->FreeFourierTransformation();

m_pRasterProc->Release();


FrequencyFilterMask example for C++ 5.0 and later

int MaxXHarmonic,MaxYHarmonic;

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

ILEADRaster* m_pNoisyRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pNoisyRaster);

ILEADRaster* m_pMaskRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pMaskRaster);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

MaxXHarmonic = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
MaxYHarmonic = m_LeadRasterView.GetRaster().GetBitmapHeight()/ 2;

m_pRasterProc->InitFourierTransformation(m_LeadRasterView.GetRaster());
m_pRasterIO->Load(m_pNoisyRaster, "c:\\NoisyXRay.CMP", 0, 0, 1);

/* Load the mask bitmap, keeping the bits per pixel of the file*/
m_pRasterIO->Load (m_pMaskRaster, "c:\\NoisyMask.CMP", 0, 0, 1);

m_pRasterProc->DiscreteFourierTransformation(m_pNoisyRaster,
0,
0,
0,
0,
DFT_DFT |
DFT_GRAY);

/* filter frequencies*/
m_pRasterProc->FrequencyFilterMask(m_pMaskRaster, true);

/* apply inverse DFT
After this call, the image should be clean*/
m_pRasterProc->DiscreteFourierTransformation(m_pNoisyRaster,
0,
0,
0,
0,
DFT_IDFT |
DFT_ALL |
DFT_IDFT_SCL);
m_pRasterProc->FreeFourierTransformation();

m_pMaskRaster->Release();
m_pNoisyRaster->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


FunctionalLight Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->LightRedAmplitude = 75;
m_pRasterProc->LightGreenAmplitude = 90;
m_pRasterProc->LightBlueAmplitude = 0;
m_pRasterProc->LightAngle = 9000;
m_pRasterProc->LightFrequency = 10;
m_pRasterProc->LightPhase = 5000;
m_pRasterProc->LightFlags = FL_LINEAR_QUADRATIC | FL_LINEAR_OUTER;
m_pRasterProc->LightXOrigin = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
m_pRasterProc->LightYOrigin = m_LeadRasterView.GetRaster().GetBitmapHeight () / 2;

m_pRasterProc->FunctionalLight(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();


GammaCorrect example for Visual C++ 5.0

GammaCorrect example for C++ 5.0 and later

This example applies a 2.2 gamma correction and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->GammaCorrect(m_LEADRasterView1.GetRaster(), 220);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


GammaCorrectExt example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->GammaCorrectExt(m_LeadRasterView.GetRaster(), 250, GMCR_YUV_SPACE);
m_pRasterProc->Release();


GaussianFilter example for Visual C++ 5 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->GaussianFilter (m_RasterView.GetRaster (), 20);
pRasterProc->Release();


GetBitmapClipSegments example for Visual C++ 5.0

GetBitmapClipSegments example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar = NULL;
float y;
long LBound, UBound;
float *pSegments;
int i, j;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

m_RasterView1.GetRaster().SetScaleMode(3); // use pixels
m_RasterView1.SetAutoRepaint(FALSE); // disable repainting

y = ( m_RasterView1.GetRaster().GetRgnTop() + m_RasterView1.GetRaster().GetRgnHeight() ) / 2;

// get the clip segments
pltRasVar = m_RasterView1.GetRaster().GetBitmapClipSegments(y);

// vSegments should be an array of floats.
if(pltRasVar->Type == VALUE_ARRAY_FLOAT)
{
// loop through all the segments
for(i = 0; i < pltRasVar->ItemCount ; i += 2)
{
// for every segment, set all the pixels to black
for(j = (int)pltRasVar->FloatItemValue(i) ; j < pltRasVar->FloatItemValue(i + 1); j++)
m_RasterView1.GetRaster().SetPixel((float)j, y, RGB(0, 0, 0));
}

m_RasterView1.SetAutoRepaint (TRUE); // re-enable repainting

}

pltRasVar->Release ();


GetBitmapDC example for Visual C++ 5.0

GetBitmapDC example for C++ 5.0 and later

Take the following steps to demonstrate how GDI functions can be used to print text on the bitmap and on the control. The text printed on the bitmap is a permanent part of the bitmap and becomes permanent if the bitmap is saved; whereas the text on the control is superficial and does not affect the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Go to the Project WorkSpace and click the ResourceView tab.
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new button under the Cancel button. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
5. | Double-click the button and change IDC_BUTTON1 to IDC_TEXT. Also, set the Caption to &Text.
6. | Press Ctrl-F4 to close all windows back to the Project Workspace.
7. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_TEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnText).
 | f. | Click the Edit Code button to start entering the code.
8. | Enter new code as follows:

void CTutorDlg::OnText()
{
// TODO: Add your control notification handler code here
// First, print text on the bitmap.
HDC hdcLead = (HDC)m_LEADRasterView1.GetRaster().GetBitmapDC();
HFONT hfnt = (HFONT)GetStockObject( SYSTEM_FONT );
HFONT hOldFont = (HFONT)SelectObject( hdcLead, hfnt );
static TCHAR mystring[] = TEXT("Text on the bitmap");
SetBkMode( hdcLead, OPAQUE );
// outPut black text on white background
SetBkColor( hdcLead, RGB(255,255,255) );
TextOut( hdcLead, 20, 40, mystring, lstrlen(mystring) );
// Select the old font
SelectObject( hdcLead, hOldFont );
// Release the device context
m_LEADRasterView1.GetRaster().ReleaseBitmapDC();
// Repaint the part of the image that has changed
m_LEADRasterView1.SetBackErase(FALSE);
m_LEADRasterView1.ForceRepaint();
// Allow full repainting again
m_LEADRasterView1.SetBackErase(TRUE);
// Now paint the control AFTER you repainted the window !
hdcLead = (HDC)m_LEADRasterView1.GetClientDC();
hOldFont = (HFONT)SelectObject( hdcLead, hfnt );
static TCHAR mystring2[] = TEXT("Text on the control");
// outPut black text on white background
SetBkColor( hdcLead, RGB(255,255,255) );
TextOut( hdcLead, 20, 20, mystring2, lstrlen(mystring2) );
// Select the old font
SelectObject( hdcLead, hOldFont );
// Release the device context
m_LEADRasterView1.ReleaseClientDC();

9.

Rebuild and run the application.


GetBitmapStatisticsInfo example for C++ 5.0 and later

CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->GetBitmapStatisticsInfo(m_LeadRasterView.GetRaster(), CHANNEL_MASTER, 0, 255);

strMsg.Format(TEXT("Bitmap Median : %d \n Bitmap Mean :%d \n Bitmap Min Value:%d \n\
Bitmap Max Value: %d \n Bitmap Pixels Count: %d \n Bitmap Selected Pixel Percent:%d \n\
Bitmap Standard Deviation: %d \n Bitmap Total Pixel Count: %d \n Bitmap Selected Pixel Percent:%d"),
m_pRasterProc->BitmapMedian,m_pRasterProc->BitmapMean,
m_pRasterProc->BitmapMinValue,m_pRasterProc->BitmapMaxValue,
m_pRasterProc->BitmapPixelsCount,m_pRasterProc->BitmapSelectedPixelPercent,
m_pRasterProc->BitmapStandardDeviation,m_pRasterProc->BitmapTotalPixelCount);

MessageBox(strMsg);
m_pRasterProc->Release();


GetColorCount Example for Visual C++ 5.0

GetColorCount Example for C++ 5.0 and later

This example displays a message box showing the number of unique colors in the control's current bitmap.

// Declare local variables.
TCHAR szMessage[80]; // Buffer for the MessageBox string
long NumberOfColors; // Number of colors in the bitmap
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// Get the number of colors in the bitmap.
NumberOfColors = pRasterProc->GetColorCount(m_LEADRasterView1.GetRaster());
// Display the result in a message.
wsprintf( szMessage, TEXT("The bitmap has %ld colors"), NumberOfColors );
MessageBox(szMessage, TEXT("Notice"));
pRasterProc->Release();


GetDIB2 example for C++ 5.0 and later

//This example takes a LEADRasterView1 control (m_LEADRasterView1) with an image,
//converts it to a V5 DIB and writes out the DIB as a bitmap file

#include <io.h>

#include <fcntl.h>
HGLOBAL hDIB;
int fp, nSize;
unsigned char *pDIB;
BITMAPFILEHEADER bfh;
PBITMAPINFOHEADER pbih;
int nDIBsize;

hDIB = (HGLOBAL)m_LEADRasterView1.GetRaster().GetDIB2 (DIB_BITMAPV5HEADER);

nDIBsize = GlobalSize(hDIB);

bfh.bfType = 0x4d42; //"BM";
bfh.bfSize = sizeof(BITMAPFILEHEADER) + nDIBsize;
bfh.bfReserved1 = 0;
bfh.bfReserved2 = 0;

pDIB = (unsigned char*)::GlobalLock(hDIB);
pbih = (PBITMAPINFOHEADER)pDIB;

// Compute the offset to the array of color indices.
bfh.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) +
pbih->biSize + pbih->biClrUsed * sizeof (RGBQUAD);

fp = _tfopen(TEXT("c:\\temp\\dib.bmp"), _O_RDWR | _O_CREAT | _O_BINARY, 0);//_S_IREAD | _S_IWRITE );
if (fp == 0)
return;

nSize = _write( fp, &bfh, sizeof(BITMAPFILEHEADER));
nSize = _write( fp, pDIB, nDIBsize);
_close(fp);

GlobalUnlock(hDIB);
GlobalFree(hDIB);
return;


GetFeretsDiameter example for C++ 5.0 and later

int Top, Bottom, Left, Right ;
CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

Top = m_LeadRasterView.GetRaster().GetBitmapHeight() / 4;
Bottom = m_LeadRasterView.GetRaster().GetBitmapHeight () * 6 / 4;
Left = m_LeadRasterView.GetRaster().GetBitmapWidth() / 4;
Right = m_LeadRasterView.GetRaster().GetBitmapWidth() * 3 / 4;
m_LeadRasterView.GetRaster().SetRgnEllipse(Left, Top, Right, Bottom, L_RGN_SET);
m_pRasterProc->GetRgnContourPoints(m_LeadRasterView.GetRaster());

for (int i = 0; i< m_pRasterProc->ContoursCount; ++i)
{
strMsg.Format(TEXT("(%d , %d)"),m_pRasterProc->GetContourX(i),m_pRasterProc->GetContourY(i));
MessageBox(strMsg);
}

m_pRasterProc->GetFeretsDiameter();
strMsg.Format(TEXT("Ferets Diameter Length :%d \n \
Ferets First Index :%d \n \
Ferets Second Index:%d \n"),
m_pRasterProc->FeretsDiameterLength,
m_pRasterProc->FeretsFirstIndex,
m_pRasterProc->FeretsSecondIndex);
MessageBox(strMsg);

m_pRasterProc->Release();


GetFileInfo example for Visual C++ 5.0

GetFileInfo example for C++ 5.0 and later

This example gets information about the specified file.

ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

// Initialize variables
CString fname = TEXT("d:\\lead14\\dist\\images\\image2.cmp");
// Update the variables
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
LPCTSTR(fname), 0, FILEINFO_TOTALPAGES);
// Read the updated properties
int fmt = pRasterIO->GetInfoFormat();
float width = pRasterIO->GetInfoWidth();
float height = pRasterIO->GetInfoHeight();
int bps = pRasterIO->GetInfoBits();
int xres = pRasterIO->GetInfoXRes();
int yres = pRasterIO->GetInfoYRes();
int pg = pRasterIO->GetInfoPage();
long sizd = pRasterIO->GetInfoSizeDisk();
long sizm = pRasterIO->GetInfoSizeMem();
CString cmp = (char*)pRasterIO->GetInfoCompress();

// Translate the meaning of the format constant
CString cFmt;
switch (fmt)
{
case FILE_PCX:
cFmt = TEXT("ZSoft PCX");
break;
case FILE_GIF:
cFmt = TEXT("CompuServe GIF");
break;
case FILE_TGA:
cFmt = TEXT("TARGA");
break;
case FILE_PNG:
cFmt = TEXT("Portable Network Graphics");
break;
case FILE_PSD:
cFmt = TEXT("Adobe Photoshop 3.0");
break;
case FILE_BMP:
cFmt = TEXT("Windows BMP");
break;
case FILE_OS2:
cFmt = TEXT("OS/2 BMP version 1.x");
break;
case FILE_OS2_2:
cFmt = TEXT("OS/2 BMP version 2.x");
break;
case FILE_WMF:
cFmt = TEXT("Windows Meta File");
break;
case FILE_EPS:
cFmt = TEXT("Encapsulated PostScript");
break;
case FILE_TIF:
cFmt = TEXT("Tagged Image File Format (TIFF, TIFLZW, or CCITT file)");
break;
case FILE_JTIF:
cFmt = TEXT("Tagged Image File with JPEG compression");
break;
case FILE_FAX_G3_1D:
cFmt = TEXT("Raw FAX, compressed using CCITT group 3, 1 dimension");
break;
case FILE_FAX_G3_2D:
cFmt = TEXT("Raw FAX, compressed using CCITT group 3, 2 dimensions");
break;
case FILE_FAX_G4:
cFmt = TEXT("Raw FAX, compressed using CCITT group 4");
break;
case FILE_WFX_G3_1D:
cFmt = TEXT("WinFax, compressed using CCITT group 3, 1 dimension");
break;
case FILE_WFX_G4:
cFmt = TEXT("WinFax, compressed using CCITT group 4");
break;
case FILE_ICA_G3_1D:
cFmt = TEXT("IOCA, compressed using CCITT group 3, 1 dimension");
break;
case FILE_ICA_G3_2D:
cFmt = TEXT("IOCA, compressed using CCITT group 3, 2 dimensions");
break;
case FILE_ICA_G4:
cFmt = TEXT("IOCA, compressed using CCITT group 4");
break;
case FILE_CMP:
cFmt = TEXT("LEAD proprietary compression format");
break;
case FILE_JFIF:
cFmt = TEXT("JPEG File Interchange Format");
break;
case FILE_WPG:
cFmt = TEXT("WordPerfect");
break;
case FILE_RAS:
cFmt = TEXT("Sun Raster");
break;
case FILE_CALS:
cFmt = TEXT("CALS Raster");
break;
case FILE_MAC:
cFmt = TEXT("MacPaint");
break;
case FILE_PCT:
cFmt = TEXT("Macintosh Pict");
break;
case FILE_MSP:
cFmt = TEXT("Microsoft Paint");
break;
case FILE_IMG:
cFmt = TEXT("GEM Image");
break;
case FILE_PCD:
cFmt = TEXT("Kodak PhotoCD");
break;
case FILE_EPSTIFF:
cFmt = TEXT("Encapsulated PostScript with an embedded TIFF file");
break;
default:
cFmt = TEXT("Unknown format");
break;
}
// Create the message string
TCHAR szMsg[512];
wsprintf(szMsg, TEXT("%s\n")
TEXT("Page = %u of %u\n")
TEXT("Format = %s\n")
TEXT("Width = %u\n")
TEXT("Height = %u\n")
TEXT("BitsPerPixel = %u\n")
TEXT("X resolution = %u\n")
TEXT("Y resolution = %u\n"),
LPCTSTR(fname), (UINT) pg, (UINT)pRasterIO->GetInfoTotalPages(), LPCTSTR(cFmt),
(UINT) width, (UINT) height, (UINT) bps,
(UINT) xres, (UINT) yres);
MessageBox(szMsg, TEXT("File Info"));
pRasterIO->Release();


GetFloaterHandle example for Visual C++ 5.0

GetFloaterHandle example for C++ 5.0 and later

The following is an alternative way of coding the PasteFloaterBtn button's click procedure in Outlining, Dragging, and Pasting a Region. This alternative uses the GetFloaterHandle and SetRgnHandle methods to specify the mask for the paste. It also shows how to use the HasRgn, FloaterWidth, and FloaterHeight properties.

void CTutorDlg::OnPastefloater()
{
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

// Variable for the Combine operation.
long MyOp;
// Variable for the saved region.
long SavedRgn;
// Variables for the client area coordinates.
float LCRgnX, LCRgnY , LCRgnWidth, LCRgnHeight;
// Variables for the bitmap coordinates.
float LBRgnX, LBRgnY , LBRgnWidth, LBRgnHeight;
// Exit this routine if there is no region.
if(m_LEADRasterView1.GetRaster().GetHasRgn() == FALSE) return;
// Save the region that is in the floater.
SavedRgn = m_LEADRasterView1.GetFloaterHandle();
// Get the floater into another bitmap
m_LEADRasterView2.SetScaleMode(m_LEADRasterView1.GetScaleMode());
m_LEADRasterView2.GetRaster().SetBitmap(m_LEADRasterView1.GetFloater());
// Get the floater's client coordinates into local variables.
LCRgnX = m_LEADRasterView1.GetFloaterDstLeft();
LCRgnY = m_LEADRasterView1.GetFloaterDstTop();
LCRgnWidth = m_LEADRasterView1.GetFloaterDstWidth();
LCRgnHeight = m_LEADRasterView1.GetFloaterDstHeight();
// Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - m_LEADRasterView1.GetDstLeft()) / ZoomFactorX) + m_LEADRasterView1.GetSrcLeft();
LBRgnY = ((LCRgnY - m_LEADRasterView1.GetDstTop()) / ZoomFactorY) + m_LEADRasterView1.GetSrcTop();
LBRgnWidth = m_LEADRasterView1.GetFloaterWidth();
LBRgnHeight = m_LEADRasterView1.GetFloaterHeight();
// Delete the floater.
m_LEADRasterView1.SetFloaterVisible(FALSE);
m_LEADRasterView1.SetFloater(0);
// Set the saved region to use as a mask for the Combine method.
m_LEADRasterView1.GetRaster().SetRgnHandle(SavedRgn, LBRgnX, LBRgnY, L_RGN_SET);
// Use the Combine method to paste the Lead2 bitmap into the Lead1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0; // Operation flags for a simple paste.
pRasterProc->Combine(m_LEADRasterView1.GetRaster(),
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight,
m_LEADRasterView2.GetRaster(),
0.0f, 0.0f, (CombineConstants)MyOp);
// Repaint the part of the client area that has changed.
m_LEADRasterView1.RepaintRect(LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, FALSE);
// Free the region.
m_LEADRasterView1.GetRaster().FreeRgn();
// Delete the region handle.
m_LEADRasterView1.GetRaster().DeleteRgnHandle(SavedRgn);
}


GetFunctionalLookupTable example for Visual C++ 5.0

GetFunctionalLookupTable example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->GetFunctionalLookupTable(0, 255, 5, GL_EXP);
pRasterProc->RemapIntensity (m_RasterView1.GetRaster(), CHANNEL_MASTER);

pRasterProc->Release();


GetGeoKey Example for Visual C++ 5.0

GetGeoKey Example for Visual C++

void TestGeoKey(ILEADRasterIO * pRasterIO)
{
// This example gets the value set for the GTModelTypeGeoKey key.
// Note that the example can be simpler by not allocating memory because this particular GeoKey has only one SHORT item. But I want to demonstrate how you call L_GetGeoKey twice and get the required size in the first call

short nRet = pRasterIO->GetGeoKey (1024);
if (nRet != 0)
MessageBox(NULL, TEXT("The GeoKey was not set, or an error occurred!"), "Error", MB_OK);
else
{
CString csBuffer;
long lType, lCount;

pRasterIO->get_GeoKeyType (&lType);
pRasterIO->get_GeoKeyCount (&lCount);
csBuffer.Format(TEXT("GeoKey Type = %d\nGeoKey Count = %d"), lType, lCount);
MessageBox(NULL, csBuffer, "Notice", MB_OK);
}
}


GetHistogram example for Visual C++ 5.0

GetHistogram example for C++ 5.0 and later

int nBrightest,nDarkest;
CString strMsg;

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->HistogramTableSize = 256;
m_pRasterProc->GetHistogram (m_LeadRasterView.GetRaster(), CHANNEL_RED | HIST_LOWHIGH_BITS);
nDarkest = 0;
nBrightest = 0;

for (int nIndex = 0 ;nIndex<256;++nIndex)
{
if (m_pRasterProc->GetHistogramTable(nIndex) != 0)
{
nBrightest = nIndex;
if (nDarkest == 0)
nDarkest = nIndex;
}
}

strMsg.Format(TEXT("Darkest red = %d Brightest red = %d"),nDarkest,nBrightest);
MessageBox(strMsg);
m_pRasterProc->Release();


GetHistogramGray example for Visual C++ 5.0

GetHistogramGray example for C++ 5.0 and later

//This example gets a histogram for a 12-bit or 16-bit grayscale image and then
//displays the number of occurrences of the brightest and darkest intensities
void CRemapHueDlg::OnGetHistogramGray()
{
int nRet;
CString strMsg;
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)

{
strMsg.Format(TEXT("Table size before call to GetHistogramGray: %d"), pRasterProc->GetHistogramGrayTableSize ());
MessageBox(strMsg);

nRet = pRasterProc->GetHistogramGray (m_LEADRasterView1.GetRaster());
if(nRet == 0)
{
m_LEADRasterView1.GetRaster().GetMinMaxVal ();
strMsg.Format(TEXT("Highest Intensity: 0x%0x Count: %d\nLowest Intensity: 0x%0x Count: %d"),
m_LEADRasterView1.GetRaster().GetMaxVal (),
pRasterProc->GetHistogramGrayTable(m_LEADRasterView1.GetRaster().GetMaxVal()),
m_LEADRasterView1.GetRaster().GetMinVal (),
pRasterProc->GetHistogramGrayTable (m_LEADRasterView1.GetRaster().GetMinVal())
);
MessageBox(strMsg);
}

strMsg.Format(TEXT("Table size of current histogram: %d"), pRasterProc->GetHistogramGrayTableSize());
MessageBox(strMsg);
pRasterProc->Release();
}
}


GetLayerMaskBitmap example for Visual C++ 5.0

GetLayerMaskBitmap example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

ILEADRaster *pRaster2=NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

pRasterIO->GetLayerMaskBitmap(m_RasterView1.GetRaster (), pRaster2, 1);
if(pRaster2->Bitmap == 0)
AfxMessageBox(TEXT("No Layer Mask Bitmap"));

pRaster2->Release();
pRasterIO->Release();


GetLinearVOILUT example for Visual C++ 5.0

GetLinearVOILUT example for C++ 5 and later

CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
int nRet;

m_pRasterProc->EnableMethodErrors = false;
nRet = m_pRasterProc->GetLinearVOILUT (m_LeadRasterView.GetRaster (), 0);
strMsg.Format(TEXT("Width = %d\n Center = %d"),m_pRasterProc->UserWindowWidth,m_pRasterProc->UserWindowCenter);

if (nRet == 0)
MessageBox(strMsg);

m_pRasterProc->Release();


GetMarkers example for C++ 5.0 and later

TCHAR str[100];
pMarker1->Load("c:\\image1.jpg",0);
pRasterIO->SetMarkers (pMarker1,0);
pRasterIO->Save (m_LeadView.GetRaster(),"c:\\image2.jpg",
FILE_EXIF_JPEG , 24 , 2 , 0);
pMarker2->GetMarkers (0);
for(int i=0;i<pMarker2->GetCount ();++i)
{
pMarker2->GetMarker (i);
wsprintf(str, TEXT("%d %d"),pMarker2->GetType (),
pMarker2- >GetElementCount ());
MessageBox(NULL,str, TEXT("Print"),0);
}


GetMemoryInfo example for Visual C++ 5.0

GetMemoryInfo example for C++ 5.0 and later

CString Msg;
m_RasterView.GetRaster().GetMemoryInfo();
Msg.Format("MemoryInfoTileViews = %d",m_RasterView.GetRaster().Get MemoryInfoTileViews ());


GetMemoryThresholds example for Visual C++ 5.0

GetMemoryThresholds example for C++ 5.0 and later

CString Msg;
m_RasterView.GetRaster().GetMemoryThresholds();
Msg.Format("MemoryTiledThreshold = %d",m_RasterView.GetRaster().GetMemoryTiledThreshold());


GetMinMaxBits example for Visual C++ 5.0

GetMinMaxBits example for C++ 5.0 and later

The following example retrieves the values for MinBit and MaxBit using GetMinMaxBits and writes the results.

CString cs;
m_LEADRasterView1.GetRaster().GetMinMaxBits();
cs.Format(TEXT("%d"), m_LEADRasterView1.GetRaster().GetMinBit());
m_Text1.SetWindowText(cs);
cs.Format(TEXT("%d"), m_LEADRasterView1.GetRaster().GetMaxBit());
m_Text2.SetWindowText(cs);


GetMinMaxVal example for Visual C++ 5.0

GetMinMaxVal example for C++ 5.0 and later

The following example retrieves the values for MinVal and MaxVal using GetMinMaxVal and writes the results.

CString cs;
//must call GetMinMaxVal first
m_LEADRasterView1.GetRaster().GetMinMaxVal();
cs.Format(TEXT("%ld"), m_LEADRasterView1.GetRaster().GetMinVal());
m_Text1.SetWindowText(cs);
cs.Format(TEXT("%ld"), m_LEADRasterView1.GetRaster().GetMaxVal());
m_Text2.SetWindowText(cs);


GetObjectInfo example for C++ 5.0 and later

CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->GetObjectInfo(m_LeadRasterView.GetRaster(),false);
strMsg.Format(TEXT("X = %d\n Y = %d\n Angle = %d\n Roundness = %d"),
m_pRasterProc->ObjectXPos,
m_pRasterProc->ObjectYPos,
m_pRasterProc->ObjectOrientationAngle,
m_pRasterProc->ObjectRoundness);

MessageBox(strMsg);
m_pRasterProc->Release();


GetOverlayBitmap example for Visual C++ 5.0

GetOverlayBitmap example for C++ 5.0 and later

int nRet;
int i;
CString strFile;

ILEADRaster *OverlayRaster = NULL;
CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&OverlayRaster
);

for(i = 0; i < 17; i++)
{
nRet = m_pRasterProc->GetOverlayBitmap(m_LeadRasterView.GetRaster(), i, OverlayRaster, OVERLAY_NOCOPY);
if(nRet == 0)
{
strFile.Format("C:\\%d_copy.cmp",i);

nRet = m_pRasterIO->Save(OverlayRaster,(LPTSTR)strFile.AllocSysString(), FILE_LEAD1BIT, 1, QFACTOR_LEAD_0,0);
if(nRet != 0)
AfxMessageBox("Error saving file!", MB_OK);
}
}

OverlayRaster->Release();


GetOverlayCount example for Visual C++ 5.0

GetOverlayCount example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
int Count;
Count = m_pRasterProc->GetOverlayCount(m_LeadRasterView.GetRaster(),0);
m_pRasterProc->Release();


GetRgnHandle example for Visual C++ 5.0

GetRgnHandle example for C++ 5.0 and later

The following code creates a region, saves its handle and adds the saved region beside the current region.

// Declare local variables.
float OffsetX, OffsetY;
long SavedRegion;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// Initialize the variables that we will manipulate to simulate mouse coordinates.
OffsetX = m_LEADRasterView1.GetRaster().GetBitmapWidth() / 8;
OffsetY = m_LEADRasterView1.GetRaster().GetBitmapHeight() / 6;
// Create an elliptical region.
m_LEADRasterView1.GetRaster().SetRgnEllipse(OffsetX, OffsetY, OffsetX, OffsetY, L_RGN_SET);
// Save a copy of the region.
SavedRegion = m_LEADRasterView1.GetRaster().GetRgnHandle();
// Add the saved region to the bitmap, offsetting it so that we can see it.
m_LEADRasterView1.GetRaster().SetRgnHandle(SavedRegion, OffsetX, OffsetY, L_RGN_OR);
// Delete the saved region.
m_LEADRasterView1.GetRaster().DeleteRgnHandle(SavedRegion);
// Fill the bitmap region with blue.
pRasterProc->Fill(m_LEADRasterView1.GetRaster(), RGB(0, 0, 255));
// Free the bitmap region.
m_LEADRasterView1.GetRaster().FreeRgn();
// Repaint the image so that we can see how the image was updated.
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


GetRgnPerimeterLength example for C++ 5.0 and later

int nTop, nBottom, nLeft, nRight ;
CString strMsg;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

nTop = m_LeadRasterView.GetRaster().GetBitmapHeight() / 3;
nBottom = m_LeadRasterView.GetRaster().GetBitmapHeight() * 2 / 3;
nLeft = m_LeadRasterView.GetRaster().GetBitmapWidth() / 3;
nRight = m_LeadRasterView.GetRaster().GetBitmapWidth() * 2 / 3;

m_LeadRasterView.GetRaster().SetRgnEllipse(nLeft, nTop, nRight, nBottom, L_RGN_SET);
m_pRasterProc->GetRgnPerimeterLength(m_LeadRasterView.GetRaster());
strMsg.Format(TEXT("Perimeter Length = %d"),m_pRasterProc->RgnPerimeterLength);

m_pRasterProc->Release();


GetTransformationParameters Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&m_pRasterProc);
int nRet;

nRet = m_pRasterProc->IsRegistrationMark(m_LeadRasterView.GetRaster (), RGS_T, 90,
 110, 31, 29);
if (nRet == 0)
MessageBox (TEXT("it is a registration mark"));
m_pRasterProc->Release();

m_pRasterProc->PutReferencePointsX(0,81400);
m_pRasterProc->PutReferencePointsY(0,11300);

m_pRasterProc->PutReferencePointsX(1,78600);
m_pRasterProc->PutReferencePointsY(1,87400);

m_pRasterProc->PutReferencePointsX(2,79400);
m_pRasterProc->PutReferencePointsX(2,116000);

m_pRasterProc->MarksCount
 = 3;

m_pRasterProc->GetMark(0)->Type = RGS_T;
m_pRasterProc->GetMark(0)->MinScale
 = 90;
m_pRasterProc->GetMark(0)->MaxScale
 = 110;
m_pRasterProc->GetMark(0)->Width
 = 31;
m_pRasterProc->GetMark(0)->Height
 = 29;
m_pRasterProc->GetMark(0)->Top
 = 72;
m_pRasterProc->GetMark(0)->Left
 = 741;
m_pRasterProc->GetMark(0)->Bottom
 = 171;
m_pRasterProc->GetMark(0)->Right
 = 896;
m_pRasterProc->GetMark(0)->NumberOfExpectedMarks
 = 1;

m_pRasterProc->GetMark(1)->Type = RGS_T;
m_pRasterProc->GetMark(1)->MinScale = 90;
m_pRasterProc->GetMark(1)->MaxScale = 110;
m_pRasterProc->GetMark(1)->Width = 31;
m_pRasterProc->GetMark(1)->Height = 29;
m_pRasterProc->GetMark(1)->Top = 836;
m_pRasterProc->GetMark(1)->Left = 706;
m_pRasterProc->GetMark(1)->Bottom = 908;
m_pRasterProc->GetMark(1)->Right = 840;
m_pRasterProc->GetMark(1)->NumberOfExpectedMarks = 1;

m_pRasterProc->GetMark(2)->Type = RGS_T;
m_pRasterProc->GetMark(2)->MinScale = 90;
m_pRasterProc->GetMark(2)->MaxScale = 110;
m_pRasterProc->GetMark(2)->Width = 31;
m_pRasterProc->GetMark(2)->Height = 29;
m_pRasterProc->GetMark(2)->Top = 1118;
m_pRasterProc->GetMark(2)->Left = 729;
m_pRasterProc->GetMark(2)->Bottom = 1199;
m_pRasterProc->GetMark(2)->Right = 852;
m_pRasterProc->GetMark(2)->NumberOfExpectedMarks = 1;

m_pRasterProc->SearchRegMarks
 (m_LeadRasterView.GetRaster());

for (int i = 0; i<3 ;++i)
{
m_pRasterProc->PutMarkPointX(i,
 m_pRasterProc->GetMark(i)->GetDetectedMarkPointX(0));
m_pRasterProc->PutMarkPointY(i,m_pRasterProc->GetMark(i)->GetDetectedMarkPointY (0));
}

m_pRasterProc->GetMarksCenterMass
 (m_LeadRasterView.GetRaster());

for (int i = 0; i<3 ;++i)
{
m_pRasterProc->PutTransformedPointsX(i,
 m_pRasterProc->GetMarkCMPointX(i));
m_pRasterProc->PutTransformedPointsY(i,
 m_pRasterProc->GetMarkCMPointY(i));
}

m_pRasterProc->GetTransformationParameters(m_LeadRasterView.GetRaster());
m_pRasterProc->ApplyTransformationParameters(m_LeadRasterView.GetRaster(),
m_pRasterProc->XTranslation,
m_pRasterProc->YTranslation,
m_pRasterProc->TransformationAngle,
m_pRasterProc->XScale,
m_pRasterProc->YScale,
RGS_SIZE_NORMAL|RGS_SIZE_FAVORWHITE);
}


GetUserLookupTable example for Visual C++ 5.0

GetUserLookupTable example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

long lPointCount;
pRasterProc->PutUserLUTCurveSize(3);
pRasterProc->PutUserLUTCurveX(0, 0);
pRasterProc->PutUserLUTCurveY(0, 0);
pRasterProc->PutUserLUTCurveX(1, 128);
pRasterProc->PutUserLUTCurveY(1, 150);
pRasterProc->PutUserLUTCurveX(2, 255);
pRasterProc->PutUserLUTCurveY(2, 255);
pRasterProc->GetUserLookupTable();
lPointCount = pRasterProc->GetUserLookupTablePointCount();
pRasterProc->RemapIntensity (m_RasterView1.GetRaster (), CHANNEL_MASTER);
CString strMsg;
strMsg.Format(TEXT("%ld Points were modified"), lPointCount);
AfxMessageBox(strMsg);

pRasterProc->Release();


GlassEffect Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->GlassEffect(m_LeadRasterView.GetRaster (), 20,10, GLASS_WFRQ | GLASS_HPER );
m_pRasterProc->Release();


GlowFilter Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->GlowFilter(m_LeadRasterView.GetRaster (), 5, 3, 0);
m_pRasterProc->Release();


Grayscale example for Visual C++ 5.0

Grayscale example for C++ 5.0 and later

This example converts the bitmap to 12-bit grayscale.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Grayscale(m_LEADRasterView1.GetRaster(), 12); //grayscale to 12-bit
pRasterProc->Release();


GrayscaleExt example for Visual C++ 5 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->GrayscaleExt (m_RasterView.GetRaster (), 300, 590, 110);
pRasterProc->Release();


GrayScaleToDuotone Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Grayscale(m_LeadRasterView.GetRaster (), 8);
for (int i = 0; i<256;++i)
{
m_pRasterProc->PutGrayScaleRed(i, i);
m_pRasterProc->PutGrayScaleGreen(i, 100);
m_pRasterProc->PutGrayScaleBlue(i,20);
}

m_pRasterProc->GrayScaleToDuotone(m_LeadRasterView.GetRaster(), RGB(0, 0, 0), 1);
m_pRasterProc->Release();


GrayScaleToMultitone Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Grayscale(m_LeadRasterView.GetRaster(), 8);

m_pRasterProc->PutMultitoneColors (0 ,RGB(255, 255, 0));
m_pRasterProc->PutMultitoneColors (0 ,RGB(255, 0, 0));

m_pRasterProc->GrayScaleToMultitone (m_LeadRasterView.GetRaster(),DT_DUOTONE,1, DT_LINEAR);

m_pRasterProc->Release();


Halftone example for Visual C++ 5.0

Halftone example for C++ 5.0 and later

int iDim = 5;
ILEADRaster* m_pRaster= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRaster);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

for (int i = 0; i<iDim*iDim+1;++i)
{
m_pRaster->Bitmap = m_LeadRasterView.GetRaster().GetBitmap();
m_pRasterProc->Rotate(m_pRaster, 360 * i, ROTATE_RESIZE, RGB(255, 0, 0));
m_LeadRasterView.GetRaster().InsertBitmapListItem(-1, m_pRaster->Bitmap);
}

m_pRasterProc->HalfTone (m_LeadRasterView.GetRaster(), HALFTONE_USERDEF, 0, 5 );

m_pRasterProc->Release();
m_pRaster->Release();


HalfTonePattern example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->HalfTonePattern(m_LeadRasterView.GetRaster(), 100, 200, 12, 2, 4500, RGB(255, 255, 255), RGB(255, 0, 0),HTPATTERN_LINE);
m_pRasterProc->Release();


HasMagGlass example for Visual C++ 5.0

HasMagGlass example for C++ 5.0 and later

if(m_LEADRasterView1.GetHasMagGlass())
{
SetWindowText(TEXT("Stop"));
//Stop the MagGlass
m_LEADRasterView1.StopMagGlass();
}
else
SetWindowText(TEXT("Error"));


hDocCleanRgn example for Visual C++ 5.0

hDocCleanRgn example for C++ 5.0 and later

void CTutorDlg::OnHolepunch()
{
//HolePunch Remove
//This example updates a windows region with all removed hole punches
//For the example, a windows region is updated and then converted to a LEAD region
//but in practice it would easier and faster to just update a LEAD region
//The HOLEPUNCH_USE_DPI flag instructs the API to determine the size of the hole punches
//based on the image DPI
//The image is modified
//The HolePunch Event is used to display information about each hole punch removed

//

//NOTE: This is not a complete example for handing events, some steps have been omitted.
//For a complete example of how to handle events, refer to the example
//Updating a Gauge and Detecting a User Interrupt.

//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);

int nRet;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;

//Enable the doc clean event
m_pRasterProc->EnableDocCleanEvents = TRUE;

nRet = m_pRasterProc->HolePunchRemove(
m_LEADRasterView1.GetRaster(),
(HolePunchRemoveFlags)(HOLEPUNCH_SINGLE_REGION | HOLEPUNCH_USE_DPI | HOLEPUNCH_USE_COUNT | HOLEPUNCH_USE_LOCATION),
2, 4, 0, 0, 0, 0, HOLEPUNCH_LEFT);

if (nRet == 0)
{
m_LEADRasterView1.GetRaster().FreeRgn();
m_LEADRasterView1.GetRaster().SetRgnHandle(m_pRasterProc->hDocCleanRgn, 0, 0, L_RGN_SET);
m_pRasterProc->hDocCleanRgn= 0; //no longer need rgn
if (nRet == 0)
{
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
}
}
}

void CRasterProcSink::OnHolePunchRemove(
long hRgn,
float fBoundingRectLeft,
float fBoundingRectTop,
float fBoundingRectWidth,
float fBoundingRectHeight,
long iHoleIndex,
long iHoleTotalCount,
long iWhiteCount,
long iBlackCount)
{
CString strMsg;

strMsg.Format(TEXT("HolePunch at [Left,Top,Width,Height][%0.0f, %0.0f, %0.0f, %0.0f] HoleIndex[%d] TotalCount[%d] WhiteCount[%d] BlackCount[%d]\n"),
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iHoleIndex,
iHoleTotalCount,
iWhiteCount,
iBlackCount);

OutputDebugString(strMsg);
}


HighPassFilter example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->HighPassFilter(m_LeadRasterView.GetRaster(), 10, 100);
m_pRasterProc->Release();


HistoContrast example for Visual C++ 5.0

HistoContrast example for C++ 5.0 and later

This example applies a histogram contrast to the bitmap and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->HistoContrast(m_LEADRasterView1.GetRaster(), 300);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


HistoEqualize example for Visual C++ 5.0

HistoEqualize example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->HistoEqualize (m_RasterView.GetRaster (), YUV_SPACE);
pRasterProc->Release();


HistogramTableSize example for Visual C++ 5.0

HistogramTableSize example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

if(m_RasterView1.GetRaster ().GetBitmapBits () == 64 || m_RasterView1.GetRaster().GetBitmapBits () == 48)
pRasterProc->HistogramTableSize= 65536;
else
pRasterProc->HistogramTableSize = 256;

pRasterProc->Release();


HolesRemovalBitmapRgn Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->HolesRemovalBitmapRgn (m_LeadRasterView.GetRaster () );
m_pRasterProc->Release();


HScrollInfo example for Visual C++ 5.0

HScrollInfo example for C++ 5.0 and later

void CTutorDlg::OnResizeLeadrasterview1()
{
if(!m_LEADRasterView1.m_hWnd)
return;
if(m_LEADRasterView1.GetHScrollInfo().GetVisible())
{
m_LEADRasterView1.GetHScrollInfo().SetPage(m_LEADRasterView1.GetHScrollInfo().GetMax() / 10);
m_LEADRasterView1.GetHScrollInfo().SetLine(10);
}
if(m_LEADRasterView1.GetVScrollInfo().GetVisible())
{
m_LEADRasterView1.GetVScrollInfo().SetPage(m_LEADRasterView1.GetVScrollInfo().GetMax() / 10);
m_LEADRasterView1.GetVScrollInfo().SetLine(10);
}
OutputDebugString(TEXT("*************\n"));
CString cs;
cs.Format(TEXT("HScrollMin: %d\n"), m_LEADRasterView1.GetHScrollInfo().GetMin());
OutputDebugString(cs);
cs.Format(TEXT("HScrollMax: %d\n"), m_LEADRasterView1.GetHScrollInfo().GetMax());
OutputDebugString(cs);
cs.Format(TEXT("VScrollMin: %d\n"), m_LEADRasterView1.GetVScrollInfo().GetMin());
OutputDebugString(cs);
cs.Format(TEXT("VScrollMax: %d\n"), m_LEADRasterView1.GetVScrollInfo().GetMax());
OutputDebugString(cs);
cs.Format(TEXT("-------------\n"));
OutputDebugString(cs);
cs.Format(TEXT("HScrollPage: %d\n"), m_LEADRasterView1.GetHScrollInfo().GetPage());
OutputDebugString(cs);
cs.Format(TEXT("HScrollLine: %d\n"), m_LEADRasterView1.GetHScrollInfo().GetLine());
OutputDebugString(cs);
cs.Format(TEXT("VScrollPage: %d\n"), m_LEADRasterView1.GetVScrollInfo().GetPage());
OutputDebugString(cs);
cs.Format(TEXT("VScrollLine: %d\n"), m_LEADRasterView1.GetVScrollInfo().GetLine());
OutputDebugString(cs);
cs.Format(TEXT("-------------\n"));
OutputDebugString(cs);
cs.Format(TEXT("HScrollPos: %d\n"), m_LEADRasterView1.GetHScrollInfo().GetPos());
OutputDebugString(cs);
cs.Format(TEXT("VScrollPos: %d\n"), m_LEADRasterView1.GetVScrollInfo().GetPos());
OutputDebugString(cs);
cs.Format(TEXT("-------------\n"));
OutputDebugString(cs);
cs.Format(TEXT("HScrollWidth: %f\n"), m_LEADRasterView1.GetHScrollInfo().GetWidth());
OutputDebugString(cs);
cs.Format(TEXT("VScrollWidth: %f\n"), m_LEADRasterView1.GetVScrollInfo().GetWidth());
OutputDebugString(cs);
}


HSV_HfromRGB example for Visual C++ 5.0

HSV_HfromRGB example for C++ 5.0 and later

//Takes an RGB, displays the RGB components, and displays the HSV components
void CRemapHueDlg::RGBtoHSV(OLE_COLOR color)
{
int nH, nS, nV;
CString strMsg;

ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
nH = pRasterProc->HSV_HfromRGB(color);
nS = pRasterProc->HSV_SfromRGB(color);
nV = pRasterProc->HSV_VfromRGB(color);

strMsg.Format(TEXT("RGB(%d,%d,%d) is HSV(%d,%d,%d)"),
GetRValue(color),
GetGValue(color),
GetBValue(color),
nH,
nS,
nV);
MessageBox(strMsg);
pRasterProc->Release();
}
}


Hue example for Visual C++ 5.0

Hue example for C++ 5.0 and later

This example rotates the hue 180 degrees and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Hue(m_LEADRasterView1.GetRaster(), 180);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


HueSaturationIntensity example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->HSICount = 1;
m_pRasterProc->PutHSIHue(0,18000);
m_pRasterProc->PutHSISaturation(0,0);
m_pRasterProc->PutHSIIntensity(0,0);
m_pRasterProc->PutHSIOuterLow(0,315);
m_pRasterProc->PutHSIOuterHigh(0,45);
m_pRasterProc->PutHSIInnerLow(0,345);
m_pRasterProc->PutHSIInnerHigh(0,15);

/* change the red color to green*/
m_pRasterProc->HueSaturationIntensity(m_LeadRasterView.GetRaster(), 0, 0, 0);

m_pRasterProc->Release();


IgnoreFilterList Example for C++ 5.0 and later

ILEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->IgnoreFilters("CMP,BMP,PCX,TIF");

AfxMessageBox(pRasterIO->IgnoreFilterList);

pRasterIO->Release();


IgnoreFilters example for Visual C++ 5.0

IgnoreFilters example for C++ 5.0 and later

This example shows how to ignore filters so that they are not loaded.

'Declare as a member of your Window Class
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);

// First, make sure PreLoaded Filters does not
// contain CMP, and that 0 filters can be cached
pRasterIO->PreLoadFilters(3, 0, "BMP,FAX,TIF");

// now, ignore cmp filter (never load cmp files)
pRasterIO->IgnoreFilters("CMP");


Impressionist Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Impressionist(m_LeadRasterView.GetRaster(),10,10);
m_pRasterProc->Release();


InfoHasAlpha example for Visual C++ 5.0

InfoHasAlpha example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

//load a 24-bit image
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"c:\\temp\\1.jpg", 24, 1, 1);

m_LEADRasterView2.GetRaster().SetBitmap(m_LEADRasterView1.GetRaster().GetBitmap());
//just make it 8-bit
pRasterProc->ColorRes(m_LEADRasterView1.GetRaster(), 8,
(ColorResPaletteConstants)0,
(ColorResDitherConstants)0, 0);
//now set an alpha channel

m_LEADRasterView1.GetRaster().SetBitmapAlpha(m_LEADRasterView2.GetRaster().GetBitmap());

//save and free
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\temp\\32.png", FILE_PNG, 32,
(QFactorConstants)0, 0);
m_LEADRasterView1.GetRaster().SetBitmap(0);
m_LEADRasterView2.GetRaster().SetBitmap(0);

AfxMessageBox(TEXT("Pause"));

//re-load
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"c:\\temp\\32.png", 0, 0);
if(pRasterIO->GetInfoHasAlpha())
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"c:\\temp\\32.png", 0, 1, 1);

m_LEADRasterView2.GetRaster().SetBitmap(m_LEADRasterView1.GetRaster().GetBitmapAlpha());
pRasterIO->Release();
pRasterProc->Release();


InfoLayers example for Visual C++ 5.0

InfoLayers example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// This example all the layers in a file to a bitmap list
pRasterIO->GetFileInfo(m_RasterView1.GetRaster (), "c:\\temp\\layers.psd", 0, 0);

if(pRasterIO->InfoLayers== 0)
AfxMessageBox(TEXT("This file has no layers!"));
else
{
// load the first layer directly
pRasterIO->LoadLayer(m_RasterView1.GetRaster(), "c:\\temp\\layers.psd", 0, 0);

// steal the bitmaps from the other object
m_RasterView1.GetRaster()SetRefBitmap (TRUE);

for(int i = 1; i < pRasterIO->InfoLayers; ++i)
{
// use a second control to load the other layers
// using LEAD1 to load the other layers would invalidate the bitmap list
pRasterIO->LoadLayer(m_RasterView2.GetRaster(), "c:\\temp\\layers.psd", 0, i);
// append the layer to the bitmap list
m_RasterView1.GetRaster()InsertBitmapListItem (-1, m_RasterView2.GetRaster().GetBitmap());
}
}

pRasterIO->Release();


InfoViewPerspective example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);
pRasterIO->GetFileInfo (m_LEADRasterView1.GetRaster(),
"v:\\images\\babe.cmp",
1, FILEINFO_TOTALPAGES);
CString cs;
cs.Format(TEXT("ViewPerspective:%d\n"), pRasterIO->GetInfoViewPerspective ());
AfxMessageBox(cs);


Insert example for Visual C++ 5.0

Insert example for C++ 5.0 and later

//load an image
theApp.m_pRasterIO->Load (theApp.m_pRaster, "v:\\images\\eagle.cmp", 0, 0, 1);
//insert it into the ImageList control
m_LEADImageList.Insert(theApp.m_pRaster->Bitmap, "testing", 1);
m_LEADImageList.EnsureVisible(m_LEADImageList.GetCount() - 1);


InsertAt example for Visual C++ 5.0

InsertAt example for C++ 5.0 and later

//load an image
theApp.m_pRasterIO->Load (theApp.m_pRaster, "v:\\images\\eagle.cmp", 0, 0, 1);
//insert it into the ImageList control as the fourth item (after 3)
m_LEADImageList.InsertAt(theApp.m_pRaster->Bitmap, "test2", 1, 3);


InsertBitmapListItem Example for Visual C++ 5.0

InsertBitmapListItem Example for C++ 5.0 and later

This example loads an ordinary file and uses it to create and play an animation. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
float nMax = 160.0f; // Maximum width or height for bitmaps in the list
float BitmapWidth, BitmapHeight; // Width and height of the bitmap
short i; // Loop counter

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterIO->Load(m_LEADRasterView2.GetRaster(),
"d:\\lead14\\dist\\images\\image1.cmp",
0, 0, 1);
BitmapWidth = m_LEADRasterView2.GetRaster().GetBitmapWidth();
BitmapHeight = m_LEADRasterView2.GetRaster().GetBitmapHeight();
// Reduce memory requirements, if necessary. Only small bitmaps play smoothly.
if(BitmapWidth > nMax)
pRasterProc->Size(m_LEADRasterView2.GetRaster(),
nMax, (BitmapHeight * nMax) / BitmapWidth,
RESIZE_RESAMPLE);
else if(BitmapHeight > nMax)
pRasterProc->Size(m_LEADRasterView2.GetRaster(),
(BitmapWidth * nMax) / BitmapHeight, nMax,
RESIZE_RESAMPLE);
// Dither to an optimized palette, leaving the last color blank to use
// for transparency.
pRasterProc->ColorRes(m_LEADRasterView2.GetRaster(),
8, CRP_IDENTITYPALETTE,
CRD_FLOYDSTEINDITHERING, 255);
// Set an arbitrary transparent color in the last position of the bitmap palette.
m_LEADRasterView2.GetRaster().SetBitmapPalette(255, RGB(212, 222, 202));
// Set the playback values that will apply to all bitmaps in the list.
m_LEADRasterView2.GetRaster().SetBitmapDelay(10);
m_LEADRasterView2.GetRaster().SetBitmapTop(0.0f);
m_LEADRasterView2.GetRaster().SetBitmapLeft(0.0f);
m_LEADRasterView2.GetRaster().SetBitmapEnableTransparency(TRUE);
m_LEADRasterView2.GetRaster().SetBitmapTransparentColor(16777216 + 255); // Specified by palette index
m_LEADRasterView2.GetRaster().SetBitmapDisposalMethod(ANIMATIONDISPOSAL_RESTOREPREVIOUS);
// Free the LEAD1 control's current bitmap list.
m_LEADRasterView1.GetRaster().SetBitmapList(0);
// Populate the bitmap list in the LEAD1 control.
for (i = 0; i <= 36; ++ i)
{
m_LEADRasterView1.GetRaster().InsertBitmapListItem(i, m_LEADRasterView2.GetRaster().GetBitmap());
// Rotate, using the transparent color as the fill color.
m_LEADRasterView1.GetRaster().SetBitmapListIndex(i);
pRasterProc->Rotate(m_LEADRasterView1.GetRaster(),
1000 * i, (RotateConstants)0,
16777216 + 255);
}
/* Set the animation playback properties */
m_LEADRasterView1.SetAnimationBackColor(RGB(0,0,255));
m_LEADRasterView1.SetAnimationBitsPerPixel(8);
m_LEADRasterView1.SetAnimationHeight(m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetAnimationWidth(m_LEADRasterView1.GetScaleWidth());
m_LEADRasterView1.SetAnimationLoop(FALSE);
for (i = 0; i < 256; ++ i)
m_LEADRasterView1.SetAnimationPalette(i, m_LEADRasterView1.GetRaster().GetBitmapPalette(i));
// Set properties for a scaled animation.
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAutoSetRects(FALSE);
// Set the image display size to match the LEAD control.
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
// Start the animation.
m_LEADRasterView1.SetAnimationEnable(TRUE);
// Free the LEAD2 control's bitmap.
m_LEADRasterView2.GetRaster().SetBitmapList(0);
pRasterIO->Release();
pRasterProc->Release();


InsertFromBitmapList example for Visual C++ 5.0

InsertFromBitmapList example for C++ 5.0 and later

//load 5 pages
theApp.m_pRasterIO->Load (theApp.m_pRaster, "G:\\Images\\MultiPage.tif", 0, 2, 5);
m_LEADImageList.InsertFromBitmapList(theApp.m_pRaster->BitmapList, "from List");


InsertMarker example for C++ 5.0 and later

pMarker1->Load("c:\\ image1.jpg",0);
pMarker1->GetMarker (0);
pMarker2->CreateMarkers();
pMarker2->PutType (pMarker1->GetType ());
pMarker2->PutElementCount (pMarker2->GetElementCount ());

for (int i=0;i<pMarker2->GetElementCount ();++i)
m_pMarker2->PutElement (i,m_pMarker1->GetElement (i));

m_pMarker2->InsertMarker (0);


Intensity example for Visual C++ 5.0

Intensity example for C++ 5.0 and later

This example lightens the bitmap and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Intensity(m_LEADRasterView1.GetRaster(), 150);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


IntensityDetect example for Visual C++ 5.0

IntensityDetect example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->IntensityDetect(m_LeadRasterView.GetRaster(),128,
255,
RGB(0, 0, 0),
RGB(255, 255, 255),
CHANNEL_MASTER);
m_pRasterProc->Release();


Invert example for Visual C++ 5.0

Invert example for C++ 5.0 and later

This example inverts the bitmap's colors and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Invert(m_LEADRasterView1.GetRaster());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


InvertedText example for Visual C++ 5.0

InvertedText example for C++ 5.0 and later

void CTutorDlg::OnInvertedtext()
{
//InvertedText
//This example finds all inverted text regions greater than 5 inches in width and 1/2 inch in height
//and inverts the text so that it appears normal
//The InvertedText Event is used to display additional information about the inverted text regions
//A LEAD region is updated to show all of the changes

//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);

int nRet;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;

//Enable the doc clean event
m_pRasterProc->EnableDocCleanEvents = TRUE;

nRet = m_pRasterProc->InvertedText (
m_LEADRasterView1.GetRaster(),
(InvertedTextFlags)(INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION | INVERTEDTEXT_USE_DPI),
5000,
500,
70,
95);
if (nRet == 0)
{
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
}
}
void CRasterProcSink::OnInvertedText(
long hRgn,
float fBoundingRectLeft,
float fBoundingRectTop,
float fBoundingRectWidth,
float fBoundingRectHeight,
long iWhiteCount,
long iBlackCount)
{
CString strMsg;
strMsg.Format(TEXT("Inverted at [Left,Top,Width,Height][%0.0f,%0.0f,%0.0f,%0.0f] WhiteCount[%d] BlackCount[%d]\n"),
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iWhiteCount,
iBlackCount);
OutputDebugString(strMsg);
}


IsGrayscale example for Visual C++ 5.0

IsGrayscale example for C++ 5.0 and later

GrayscaleTypes IsGray;
IsGray = (GrayscaleTypes)m_LEADRasterView1.GetRaster().GetIsGrayscale ();
if(IsGray == GRAY_NO)
AfxMessageBox(TEXT("Not Grayscale"));
else
AfxMessageBox(TEXT("Is Grayscale"));


ISISAcquire example for Visual C++ 5.0

ISISAcquire example for C++ 5.0 and later

short nRet;
ILEADRasterISIS *pRasterISIS;
ILEADRaster *pRaster;
CWnd *m_pMainWnd;
//The following example acquires a single image using ISISAcquire.
pRasterISIS->PutEnableMethodErrors (FALSE);
nRet = pRasterISIS->ISISLoadDriver ();
if (nRet == 0)
{
nRet = pRasterISIS->ISISAcquire ( (long)m_pMainWnd->m_hWnd, pRaster, ISIS_SHOWUI, ISIS_BITMAP_LIST_OVERWRITE );
pRasterISIS->ISISUnloadDriver ();
}
if (nRet != 0)
{
if (nRet != ERROR_ISIS_CANCEL)
AfxMessageBox(TEXT("Error during ISIS Scan!"));
}


ISISAcquireMulti example for Visual C++ 5.0

ISISAcquireMulti example for C++ 5.0 and later

ISISTagValueConstants nMaxPages;
ILEADRasterISIS *pRasterISIS;
ILEADRaster *pRaster;
CWnd *m_pMainWnd;
short nRet;
//The following example prepares for scanning multiple images by setting tags and enabling the ISISPage event and then scans multiple images, using ISISAcquireMulti method.

nMaxPages = (ISISTagValueConstants)10;
pRasterISIS->PutEnableMethodErrors (FALSE);
pRasterISIS->PutEnableISISEvent (TRUE);
nRet = pRasterISIS->ISISLoadDriver ();
if (nRet == 0)
{
pRasterISIS->ISISSetTag (TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
pRasterISIS->ISISGetTag (TAG_MAXPAGES);
NMaxPages = pRasterISIS->GetISISTagValue();
pRasterISIS->ISISSetTag(TAG_SCANAHEAD_MAXPAGES, ISISTagValueConstants((short)nMaxPages / 2));
pRasterISIS->ISISSetTag(TAG_COMPRESSION, TAG_COMPRESSION_G4);
nRet = pRasterISIS->ISISAcquireMulti ((long)m_pMainWnd->m_hWnd, pRaster, "d:\\temp\\mfctest.tif", ISIS_SHOWUI, FILE_CCITT_GROUP4, TRUE, ISIS_BITMAP_LIST_OVERWRITE );
pRasterISIS->ISISUnloadDriver ();
if (nRet != 0)
{
if (nRet == ERROR_USER_ABORT)
{
CString csMsg;
csMsg.Format(TEXT("Acquire canceled, %d pages were aborted!\n"),
pRasterISIS->GetPagesDiscarded () );
AfxMessageBox(csMsg);
}
else if (nRet != ERROR_ISIS_CANCEL)
AfxMessageBox(TEXT("Error During ISIS Scan"));
}
else
AfxMessageBox(TEXT("Image(s) acquired to file(s) d:\\temp\\mfctest.tif"));
}


IsISISAvailable example for Visual C++ 5.0

IsISISAvailable example for C++ 5.0 and later

//The following example tests to see if ISIS is available. If not, then a message is output in MsgBox.
ILEADRasterISIS *pRasterISIS;
if (pRasterISIS->GetPagesDiscarded () == 0)
AfxMessageBox(TEXT("ISIS Support not installed!"));


ISISSelect example for Visual C++ 5.0

ISISSelect example for C++ 5.0 and later

//The following example displays the ISISSelect DialogBox and writes a message indicating which ISIS Scanner Driver was selected.
ILEADRasterISIS *pRasterISIS;
CWnd *m_pMainWnd;
pRasterISIS->ISISSelect ((long)m_pMainWnd->m_hWnd);
CString csMsg;
csMsg.Format(TEXT("%s was selected!"),
pRasterISIS->GetDriverName () );
AfxMessageBox(csMsg);


ISISSetScanOptions example for Visual C++ 5.0

ISISSetScanOptions example for C++ 5.0 and later

ILEADRasterISIS *pRasterISIS;
CWnd *m_pMainWnd;
pRasterISIS->ISISLoadDriver ();
pRasterISIS->ISISSetScanOptions ((long)m_pMainWnd->m_hWnd);
pRasterISIS->ISISUnloadDriver ();


IsRegistrationMark Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
int nRet;

nRet = m_pRasterProc->IsRegistrationMark(m_LeadRasterView.GetRaster (), RGS_T, 90, 110, 31, 29);
if (nRet == 0)
MessageBox (TEXT("it is a registration mark"));
m_pRasterProc->Release();


IsSigned example for Visual C++ 5.0

IsSigned example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// Load the bitmap data as signed so we can use a different conversion
pRasterIO->LoadSigned= TRUE;
pRasterIO->Load (m_RasterView1.GetRaster (), "c:\\temp\\signed.tif", 0, 0, 1);
// use the non-default conversion "zero to center"
pRasterProc->ConvertSignedToUnsigned(m_RasterView1.GetRaster(), SHIFT_ZERO_TO_CENTER);

pRasterProc->Release();
pRasterIO->Release();


Item example for Visual C++ 5.0

Item example for C++ 5.0 and later

CLEADRasterImageListItem LEADItem;
long lCount,x,lSelCount;

m_LEADImageList.SelectAll(FALSE);
//set the 4th and 6th items as selected
LEADItem = m_LEADImageList.Item(3);
LEADItem.SetSelected (TRUE);
LEADItem = m_LEADImageList.Item(5);
LEADItem.SetSelected (TRUE);

//now, count the selected items
lCount = m_LEADImageList.GetCount();
lSelCount = 0;
for(x=0; x<lCount; x++)
{
LEADItem = m_LEADImageList.Item(x);
if(LEADItem.GetSelected())
lSelCount++;
}
CString csOut;
csOut.Format(TEXT("%ld Items were selected!"), lSelCount);
AfxMessageBox(csOut);


ItemBackgroundColor example for Visual C++ 5.0

ItemBackgroundColor example for C++ 5.0 and later

//set to yellow
m_LEADImageList.SetItemBackgroundColor(RGB(255, 255, 0) );


ItemSelected example for Visual C++ 5.0

ItemSelected example for C++ 5.0 and later

void CBrowseDlg::OnItemSelectedLeadimglistctrl1(long nIndex)
{
this->SetWindowText(m_LEADImageList.Item(nIndex).GetText() + TEXT(" was selected!"));
}


ItemUnSelected Example for Visual C++ 5.0

ItemUnSelected example for C++ 5.0 and later

void CBrowseDlg::OnItemUnSelectedLeadimglistctrl1(long nIndex)
{
this->SetWindowText(m_LEADImageList.Item(nIndex).GetText() + TEXT(" was un-selected! "));
}


ItemWidth example for Visual C++ 5.0

ItemWidth example for C++ 5.0 and later

//set item display options
m_LEADImageList.SetItemWidth(150);
m_LEADImageList.SetItemHeight(150);
m_LEADImageList.SetItemVerticalSpacing(20);
m_LEADImageList.SetItemHorizontalSpacing(20);
m_LEADImageList.SetDisplayItemText(! m_LEADImageList.GetDisplayItemText());


J2KCompressionControl example for Visual C++ 5.0

J2KCompressionControl example for C++ 5.0 and later

ILEADRasterIO *pIO=NULL;

::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pIO);
// compress a lossless file
pIO->J2KSetDefaults ();
pIO->J2KCompressionControl = J2K_COMP_LOSSLESS;
pIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\temp\\lossless.j2k",
FILE_J2K, 0, (QFactorConstants)0, SAVE_OVERWRITE);
pIO->Release();


J2KCompressionRatio example for Visual C++ 5.0

J2KCompressionRatio example for C++ 5.0 and later

ILEADRasterIO *pIO=NULL;

::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pIO);
// compress a JPEG2000 file using 100:1 comp ratio
pIO->J2KSetDefaults ();
pIO->J2KCompressionControl = J2K_COMP_RATIO;
pIO->J2KCompressionRatio = 100.0f;
pIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\temp\\100_to_1.j2k",
FILE_J2K, 0, (QFactorConstants)0, SAVE_OVERWRITE);
pIO->Release();


J2KROIControl example for Visual C++ 5.0

J2KROIControl example for C++ 5.0 and later

m_pRasterIO->J2KSetDefaults ();
// Set our options
m_pRasterIO->J2KCompressionRatio = 1000;
m_pRasterIO->J2KCompressionControl = J2K_COMP_RATIO;
m_pRasterIO->J2KUseROI = TRUE;
m_pRasterIO->J2KROIControl = J2K_USEOPTION_RECT;
m_pRasterIO->J2KROILeft = 200;
m_pRasterIO->J2KROITop = 200;
m_pRasterIO->J2KROIWidth = 600;
m_pRasterIO->J2KROIHeight = 600;

m_pRasterIO->J2KXTsiz = 100;
m_pRasterIO->J2KYTsiz = 100;
// Save the bitmap to disk
m_pRasterIO->Save (m_LEADRasterView.GetRaster(), "c:\\image1.j2k", FILE_J2K, 24, (QFactorConstants)2, SAVE_OVERWRITE);


J2KSetDefaults example for Visual C++ 5.0

J2KSetDefaults example for C++ 5.0 and later

ILEADRasterIO *pIO=NULL;

::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pIO);
CString csmsg;
CString cstemp;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_J2K, L_KEY_J2K);

// Display all the default JPEG2000 advanced options
pIO->J2KSetDefaults ();

cstemp.Format(TEXT("J2KUseColorTransform = %d\n"), pIO->J2KUseColorTransform);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedQuantization = %d\n"), pIO->J2KDerivedQuantization);
csmsg = csmsg + cstemp;

cstemp.Format(TEXT("J2KXOsiz = %d\n"), pIO->J2KXOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYOsiz = %d\n"), pIO->J2KYOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KXTsiz = %d\n"), pIO->J2KXTsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYTsiz = %d\n"), pIO->J2KYTsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KXTOsiz = %d\n"), pIO->J2KXTOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYTOsiz = %d\n"), pIO->J2KYTOsiz);
csmsg = csmsg + cstemp;

cstemp.Format(TEXT("J2KDecompLevel = %d\n"), pIO->J2KDecompLevel);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KProgressOrder = %d\n"), pIO->J2KProgressOrder);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCodBlockWidth = %d\n"), pIO->J2KCodBlockWidth);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCodBlockHeight = %d\n"), pIO->J2KCodBlockHeight);
csmsg = csmsg + cstemp;

cstemp.Format(TEXT("J2KCBS_SelectiveACBypass = %d\n"), pIO->J2KCBS_SelectiveACBypass);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_ResetContextOnBoundaries = %d\n"), pIO->J2KCBS_ResetContextOnBoundaries);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_TerminationOnEachPass = %d\n"), pIO->J2KCBS_TerminationOnEachPass);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_VerticallyCausalContext = %d\n"), pIO->J2KCBS_VerticallyCausalContext);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_PredictableTermination = %d\n"), pIO->J2KCBS_PredictableTermination);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_ErrorResilienceSymbol = %d\n"), pIO->J2KCBS_ErrorResilienceSymbol);
csmsg = csmsg + cstemp;

cstemp.Format(TEXT("J2KGuardBits = %d\n"), pIO->J2KGuardBits);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedBaseMantissa = %d\n"), pIO->J2KDerivedBaseMantissa);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedBaseExponent = %d\n"), pIO->J2KDerivedBaseExponent);
csmsg = csmsg + cstemp;

cstemp.Format(TEXT("J2KUseSOPMarker = %d\n"), pIO->J2KUseSOPMarker);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KUseEPHMarker = %d\n"), pIO->J2KUseEPHMarker);
csmsg = csmsg + cstemp;

AfxMessageBox(csmsg);


J2KTargetFileSize example for Visual C++ 5.0

J2KTargetFileSize example for C++ 5.0 and later

ILEADRasterIO *pIO=NULL;

::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pIO);
// compress a 30K JPEG2000 file
pIO->J2KSetDefaults();
pIO->J2KCompressionControl = J2K_COMP_TARGETSIZE;
pIO->J2KTargetFileSize = (30 * 1024);
pIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\temp\\30k.j2k",
FILE_J2K, 0, (QFactorConstants)0, SAVE_OVERWRITE);
pIO->Release();


JBIG2GBATX1 Example for C++ 5.0 and later

ILEADRasterIO * pRasterIO = NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_JBIG2, L_KEY_JBIG2);
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\1.jpg"), 0, 0, 1);

pRasterIO->JBIG2TemplateType = 0;
pRasterIO->JBIG2GBATX1 = 3;
pRasterIO->JBIG2GBATY1 = -1;
pRasterIO->JBIG2GBATX2 = -3;
pRasterIO->JBIG2GBATY2 = -1;
pRasterIO->JBIG2GBATX3 = 2;
pRasterIO->JBIG2GBATY3 = -2;
pRasterIO->JBIG2GBATX4 = -2;
pRasterIO->JBIG2GBATY4 = -2;
pRasterIO->JBIG2SaveFlags = JBIG2_TPON;

pRasterIO->Save(m_RasterView.GetRaster(), TEXT("c:\1.jp2"), FILE_JBIG, 1, QFACTOR_LEAD_0, 0);

if(pRasterIO)
pRasterIO->Release();


KeyDown example for Visual C++ 5.0

KeyDown example for C++ 5.0 and later

void CBrowseDlg::OnKeyDownLeadimglistctrl1(short KeyCode, short Shift)
{
CString s;
s.Format(TEXT("Key %d is down"), KeyCode);
this->SetWindowText(s);
}


KeyPress (ILEADRasterImgList) example for Visual C++ 5.0

KeyPress (ILEADRasterImgList) example for C++ 5.0 and later

void CBrowseDlg::OnKeyPressLeadimglistctrl1(short KeyAscii)
{
CString s;
this->GetWindowText(s);
this->SetWindowText(s + TEXT(" Key ") + (TCHAR)KeyAscii + TEXT(" was pressed"));
}


KeyPress example for Visual C++ 5.0

KeyPress example for C++ 5.0 and later

Note: This example failed during testing, because MFC 4.0 did not pass the KeyPress event. However the ScaleMode code inside the if statement will work if you use it in another event, such as a command button's click event.

void CMFCTestDlg::OnKeyPressLeadrasterview1(short KeyAscii)
{
// This is example uses the KeyPress event to implement a custom scale mode.
// There is no particular reason to Put this code in this event, except that
// we needed examples of both the event and the scale mode.
if (KeyAscii == 67) // Uppercase C
{
// This example sets a custom scale mode and uses it to crop the
// display. Keep in mind that the actual height and width do not change.
// Only the unit of measure changes.
// Change the scale so that origin is moved one-third right and one-third down
m_LEADRasterView1.SetScaleLeft(-1.0f);
m_LEADRasterView1.SetScaleTop(-1.0f);
m_LEADRasterView1.SetScaleWidth(3.0f);
m_LEADRasterView1.SetScaleHeight(3.0f);
// Crop the display so that it takes up the middle third of the height and width
m_LEADRasterView1.SetDstClipLeft(0.0f);
m_LEADRasterView1.SetDstClipTop(0.0f);
m_LEADRasterView1.SetDstClipWidth(1.0f);
m_LEADRasterView1.SetDstClipHeight(1.0f);
m_LEADRasterView1.ForceRepaint();
}
}


KeyUp (ILEADRasterImgList) example for Visual C++ 5

KeyUp example for C++ 5.0 and later

void CBrowseDlg::OnKeyUpLeadimglistctrl1(short KeyCode, short Shift)
{
CString s;
TCHAR sz[1000];
this->GetWindowText(sz, sizeof(sz));
s.Format(TEXT("%s Key %d was released"));
this->SetWindowText(s);
}


LensFlare Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth ()/4;

int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/4;
m_pRasterProc->LensFlare(m_LeadRasterView.GetRaster(),CenterX, CenterY ,100, LNS_TYPE_1, RGB(100, 150, 10));
m_pRasterProc->Release();


LevelLowBit example for Visual C++ 5.0

LevelLowBit example for C++ 5.0 and later

This is also the example for LevelHighBit.

This example sets LevelLowBit and LevelHighBit to display the image using only the eight least significant bits.

m_LEADRasterView1.SetAutoRepaint(FALSE);
//use least significant 8 bits
m_LEADRasterView1.GetRaster().SetLevelLowBit(0);
m_LEADRasterView1.GetRaster().SetLevelHighBit(7);

m_LEADRasterView1.SetAutoRepaint(TRUE);


LevelLUT example for Visual C++ 5.0

LevelLUT example for C++ 5.0 and later

This is also the example for MinVal property and MaxVal property.

The following example sets LevelLowBit and LevelHighBit to use all bits. It then gets the minimum and maximum bits and intensity values for the image, and sets the LUT so that pixels with values in the minimum range are mapped to the color RED, while pixels with values in the maximum range are mapped to BLUE.

long min;
long max;
long i;

m_LEADRasterView1.SetAutoRepaint(FALSE);
//use all bits
m_LEADRasterView1.GetRaster().SetLevelLowBit(0);
m_LEADRasterView1.GetRaster().SetLevelHighBit(m_LEADRasterView1.GetRaster().GetBitmapBits() - 1);

m_LEADRasterView1.GetRaster().GetMinMaxBits();
m_LEADRasterView1.GetRaster().GetMinMaxVal();
max = m_LEADRasterView1.GetRaster().GetMaxVal();
min = m_LEADRasterView1.GetRaster().GetMinVal();

//set LUT so that min range maps to RED and max range maps to BLUE
for( i=min; i<min+100; i++ )
m_LEADRasterView1.GetRaster().SetLevelLUT(i, RGB(255, 0, 0));
for( i=max-100; i<max; i++ )
m_LEADRasterView1.GetRaster().SetLevelLUT(i, RGB(0, 0, 255));

m_LEADRasterView1.SetAutoRepaint(TRUE);


LevelLUTLength example for Visual C++ 5.0

LevelLUTLength example for C++ 5.0 and later

This example writes out the number of entries in the LUT.

CString cs;
cs.Format(TEXT("%d"), m_LEADRasterView1.GetRaster().GetLevelLUTLength());
m_Edit5.SetWindowText(cs);


Light Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/ 2;

int iWidth = max( m_LeadRasterView.GetRaster().GetBitmapHeight(),
m_LeadRasterView.GetRaster().GetBitmapWidth () / 2);
int iHeight = min( m_LeadRasterView.GetRaster().GetBitmapHeight(),
m_LeadRasterView.GetRaster().GetBitmapWidth() / 2);

m_pRasterProc->Light(m_LeadRasterView.GetRaster(),CenterX, CenterY,
iWidth,iHeight,0,100,0, RGB(255,255,255),100, 1, 100, 0, RGB(255,255,255), LGT_SPOTLIGHT);

m_pRasterProc->Release();


LightControl Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PutLightLowerAvr(0,100);
m_pRasterProc->PutLightLowerAvr(1,120);
m_pRasterProc->PutLightLowerAvr(2,80);

m_pRasterProc->PutLightAvr(0, 150);
m_pRasterProc->PutLightAvr(1,140);
m_pRasterProc->PutLightAvr(2,128);

m_pRasterProc->PutLightUpperAvr(0 , 190);
m_pRasterProc->PutLightUpperAvr(1,200);
m_pRasterProc->PutLightUpperAvr(2,228);

m_pRasterProc->LightControl(m_LeadRasterView.GetRaster (), RGB_SPACE);
m_pRasterProc->Release();


LineProfile example for Visual C++ 5 and later

LineProfile example for Visual C++ 5.0 and later

long maxR = 0, maxG = 0, maxB = 0;
int i;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->LineProfile (m_RasterView.GetRaster (), 10, 10, 220, 120);
for(i=0; i<pRasterProc->GetLineProfileSize (); ++i)
{
if(pRasterProc->GetLineProfileRed(i) > maxR) maxR = pRasterProc->GetLineProfileRed(i);
if(pRasterProc->GetLineProfileGreen (i) > maxG) maxG = pRasterProc->GetLineProfileGreen(i);
if(pRasterProc->GetLineProfileBlue (i) > maxB) maxB = pRasterProc->GetLineProfileBlue(i);
}
pRasterProc->Release();
CString msg;
msg.Format(TEXT("maxR=%ld, maxG=%ld, maxB=%ld"), maxR, maxG, maxB);
AfxMessageBox(msg);


LineRemove example for Visual C++ 5.0

LineRemove example for C++ 5.0 and later

void CTutorDlg::OnLineremove()
{
//Line Remove
//This examples removes vertical lines that are at least 200 pixels in length
//and no more than 5 pixels in width
//The lines can have gaps up to two pixels in length
//The LineRemove Event is used to display information about each line removed
//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);

int nRet;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;
m_pRasterProc->EnableDocCleanEvents = TRUE;

nRet = m_pRasterProc->LineRemove(
m_LEADRasterView1.GetRaster(),
LINE_USE_GAP,
200,
5,
7,
10,
2,
0,
LINEREMOVE_HORIZONTAL);
}

void CRasterProcSink::OnLineRemove(
float fStartRow,
float fStartCol,
float fLength,
long hRgnLine)
{
CString strMsg;

strMsg.Format(TEXT("Line at [R,C] [%0.0f,%0.0f] Length[%0.0f]\n"),
fStartRow,
fStartCol,
fLength);
OutputDebugString(strMsg);
}


Load (ILEADMarkers) example for C++ 5.0 and later

ILEADRasterIO *pRasterIO;
ILEADMarkers *pMarker1;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADMarkers, NULL, CLSCTX_ALL, IID_ILEADMarkers, (void**)&pMarker1);

pRasterIO->Load(m_LeadView.GetRaster(), "c:\\image1.jpg", 0, 0, 1 );
pMarker1->Load("c:\\ image1.jpg",0);
pRasterIO->SetMarkers (pMarker1,0);
pRasterIO->Save (m_LeadView.GetRaster(), "c:\\image2.jpg",FILE_EXIF_JPEG, 24, 2, 0);


Load example for Visual C++ 5.0

Load example for C++ 5.0 and later

long nPages;
m_pRasterMrc->put_EnableMethodErrors (TRUE);
m_pRasterMrc->GetPagesCount("d:\\temp\\testT44.mrc");
nPages = m_pRasterMrc->GetMRCPagesCount();
CString msg;
msg.Format(TEXT("File has %ld pages"), nPages);
SetWindowText(msg);
// load last page
m_pRasterMrc->Load(m_RasterView.GetRaster(), "d:\\temp\\testT44.mrc", nPages);


LoadArray example for Visual C++ 5.0

LoadArray example for C++ 5.0 and later

long lCount;
HFILE hFile;
HGLOBAL hData=NULL;
void FAR* pData=NULL;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

hFile = _lopen("v:\\images\\babe.cmp", OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData = GlobalLock(hData);

_lread(hFile, pData, lCount);

pltRasVar->Type = VALUE_ARRAY_BYTE;
pltRasVar->ItemCount = lCount;

for(long i=0; i<lCount; i++)
pltRasVar->ShortItemValue(i) = (short)pData[i];

GlobalUnlock(hData);
GlobalFree(hData);

pRasterIO->LoadArray(m_LEADRasterView1.GetRaster(),
pltRasVar, 0, 0, -1, lCount);
pRasterIO->Release();
pltRasVar->Release();
_lclose(hFile);


LoadArray2 example for Visual C++ 5.0

LoadArray2 example for C++ 5.0 and later

long lCount;
COleVariant MyVar;
HFILE hFile;
HGLOBAL hData=NULL;
void FAR* pData=NULL;
SAFEARRAY FAR *psa;
SAFEARRAYBOUND rgsabound[1];
ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

MyVar.Clear();

hFile = _lopen("v:\\images\\babe.cmp", OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData = GlobalLock(hData);

_lread(hFile, pData, lCount);

rgsabound[0].lLbound = 0;
rgsabound[0].cElements = lCount;
psa = SafeArrayCreate(VT_UI1, 1, rgsabound);

SafeArrayLock(psa);
memcpy(psa->pvData, pData, lCount);
SafeArrayUnlock(psa);

V_VT(&MyVar) = (VT_ARRAY | VT_UI1);
V_ARRAY(&MyVar) = psa;

GlobalUnlock(hData);
GlobalFree(hData);

pRasterIO->LoadArray2(m_LEADRasterView1.GetRaster(),
MyVar, 0, 0, -1, lCount);
pRasterIO->Release();
_lclose(hFile);


LoadCompressed example for Visual C++ 5.0

LoadCompressed example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->LoadCompressed= LOAD_UNCOMPRESSED;
// now "test.tif" will be loaded uncompressed
pRasterIO->Load (m_RasterView1.GetRaster (), "c:\\temp\\test.cmp", 0, 1, 1);

pRasterIO->Release();


LoadDatabase example for Visual C++ 5.0

LoadDatabase example for C++ 5.0 and later

int i;
// select 2nd to 4th items
for(i=1; i<=3; ++i)
m_LEADImageList.Item(i).SetSelected(TRUE);
//save all selected items to a multipage file
m_LEADImageList.SaveDatabase("d:\\temp\\testing.tif", TRUE);
AfxMessageBox(TEXT("about to reload file"));
//clear list
m_LEADImageList.Clear();
//reload file
m_LEADImageList.LoadDatabase ("d:\\temp\\testing.tif");


LoadFromFile example for Visual C++ 5.0

LoadFromFile example for C++ 5.0 and later

// load all images after the first
m_LEADImageList.LoadFromFile("G:\\Images\\MultiPage.tif", 0, 2, -1);


LoadICCProfile Example for Visual C++ 5.0

LoadICCProfile Example for C++ 5.0 and later

ILEADRasterIO *pRasterIO = NULL;
ILEADRasterVariant *pData = NULL;
int nRet;
FILE *fp;

CoCreateInstance(CLSID_LEADRasterVariant,NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pData);
CoCreateInstance(CLSID_LEADRasterIO,NULL, CLSCTX_ALL, IID_ILEADRasterIO,(void**)&pRasterIO);

fp = fopen(TEXT("c:\\MyICC.ICM"),"wb");

nRet = pRasterIO->LoadICCProfile(TEXT("c:\\dst_rgb_image.tif"), pData, 1);

for(int i =0;i<pData->GetItemCount ();++i)
{
int tmp = pData->GetShortItemValue (i);
fwrite(&tmp,1,1,fp);
}
pRasterIO->Release();
pData->Release();
fclose(fp);


LoadICCProfile2 Example for Visual C++ 5.0

LoadICCProfile2 Example for C++ 5.0 and later

ILEADRasterIO *pRasterIO = NULL;
VARIANT Data;
FILE *fp;
int nRet;
long uBound;

CoCreateInstance(CLSID_LEADRasterIO,NULL, CLSCTX_ALL, IID_ILEADRasterIO,(void**)&pRasterIO);

VariantInit(&Data);

fp = fopen(TEXT("c:\\MyICC.ICM"),"wb");

nRet = pRasterIO->LoadICCProfile2(TEXT("c:\\dst_rgb_image.tif"), &Data, 1);
SafeArrayGetUBound(Data.parray, 1, &uBound);

for(long i =0;i<(uBound+1);++i)
{
int tmp;
SafeArrayGetElement(Data.parray, &i, &tmp);
fwrite(&tmp,1,1,fp);
}

VariantClear(&Data);
pRasterIO->Release();
fclose(fp);


LoadIFD example for Visual C++ 5.0

LoadIFD example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// All examples will assume that "test.tif" has over 1002 images
// This example will load pages 1000 and 1001 after getting the information for page 1000:
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"d:\\temp\\test.tif", 1000, 0);
// Setting LoadIFD to InfoIFD indicates that 1000 is treated as page 1
pRasterIO->PutLoadIFD(pRasterIO->GetInfoIFD());
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\temp\\test.tif", 0, 1, 2);
// Reset LoadIFD to 0 so other TIF files will be handled properly
pRasterIO->PutLoadIFD(0);
pRasterIO->Release();


LoadInfo example for Visual C++ 5.0

LoadInfo... example for C++ 5.0 and later

Take the following steps to exercise the LoadInfo event and LoadInfo... properties. The example creates a raw FAX file, then loads the file it just created. (Getting format information from an unfamiliar file is beyond the scope of this example.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Edit TUTORDLG.H and insert the following lines in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

public:
// Declare variables for demonstrating raw FAX.
int MyInfoBits;
long MyInfoFlags;
int MyInfoFormat;
float MyInfoHeight;
long MyInfoOffset;
float MyInfoWidth;
int MyInfoXRes;
int MyInfoYRes;

3.

Add a CommandButton control and code its click procedure as follows:

void CTutorDlg::OnButton1()
{
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView1.SetScaleMode (3); // Pixels
// Make the image look OK as a 1-bit image.
pRasterProc->Size(m_LEADRasterView1.GetRaster(),
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight(),
RESIZE_RESAMPLE);
pRasterProc->Halftone(m_LEADRasterView1.GetRaster(),
HALFTONE_VIEW, 45);
// Set the form-level variables to the values we will use when loading.
MyInfoBits = 1;
MyInfoFlags = LOADINFO_TOPLEFT;
MyInfoFormat = FILE_FAX_G3_2D;
MyInfoHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight();
MyInfoOffset = 0;
MyInfoWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth();
MyInfoXRes = m_LEADRasterView1.GetRaster().GetBitmapXRes();
MyInfoYRes = m_LEADRasterView1.GetRaster().GetBitmapYRes();
// Save the image as raw FAX; then load the saved file.
// Format information will be supplied in the LoadInfo event.
m_pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.tif", FILE_FAX_G3_2D,
1, (QFactorConstants)1, SAVE_OVERWRITE);
m_pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.tif", 0, 0, 1);
// Repaint the newly loaded image.
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();
}

4.

Edit the TUTORDLG.H file and change the definition of CTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
ILEADRasterIO *m_pRasterIO;
CRasterIOSink *m_pRasterIOSink;
IConnectionPoint *m_pIOCP;
DWORD m_dwIOCookie;

5.

Edit the TUTORDLG.CPP file and add the following code to the end of the OnInitDialog function:

//Instantiate the sink class and hold a pointer to it.
m_pRasterIOSink = new CRasterIOSink;
m_pRasterIOSink->m_pDlg = this;

//Create the RasterIO object
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&m_pRasterIO);

//Establish a connection between source and sink.
LPUNKNOWN pIOUnkSink = m_pRasterIOSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterIO, DIID__LEADRasterIOEvents, pIOUnkSink, FALSE, &m_dwIOCookie);

6. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterIOSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterIOSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterIOSink();
protected:

In the RasterIOSink.h file, add the following to the top of the file:
class CTutorDlg;

In the RasterIOSink.h file, add the following to the CRasterIOSink class in the //Attributes public section:

// Attributes
public:
CTutorDlg *m_pDlg;

In the RasterIOSink.cpp file, add the following to the top of the file (after the #include "RasterIOSink.h")

#include "tutorDlg.h"

7. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "RasterIOSink.h"

8. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterIOSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:

afx_msg void OnLoadInfo(void);

9. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterIOSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterIOSink,"LoadInfo",2,OnLoadInfo,VT_EMPTY,VTS_NONE)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART tothe following:

INTERFACE_PART(CRasterIOSink, DIID__LEADRasterIOEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterIOSink::OnLoadInfo()
{
// Use the form-level variables to supply format information.
m_pDlg->m_pRasterIO->PutLoadInfoBits(m_pDlg->MyInfoBits);
m_pDlg->m_pRasterIO->PutLoadInfoFlags((LoadInfoFlagConstants)m_pDlg->MyInfoFlags);
m_pDlg->m_pRasterIO->PutLoadInfoFormat((RasterFileConstants)m_pDlg->MyInfoFormat);
m_pDlg->m_pRasterIO->PutLoadInfoHeight(m_pDlg->MyInfoHeight);
m_pDlg->m_pRasterIO->PutLoadInfoOffset(m_pDlg->MyInfoOffset);
m_pDlg->m_pRasterIO->PutLoadInfoWidth(m_pDlg->MyInfoWidth);
m_pDlg->m_pRasterIO->PutLoadInfoXRes(m_pDlg->MyInfoXRes);
m_pDlg->m_pRasterIO->PutLoadInfoYRes(m_pDlg->MyInfoYRes);
}

10. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
11. | Enter new code as follows:

void CTutorDlg::OnDestroy()
{
//Terminate a connection between source and sink.
LPUNKNOWN pIOUnkSink = m_pRasterIOSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterIO, DIID__LEADRasterIOEvents,
pIOUnkSink, FALSE, m_dwIOCookie);
delete m_pRasterIOSink;
m_pRasterIO->Release();
CDialog::OnDestroy();
}

12.

Run your program to test it.


LoadMemory example for Visual C++ 5.0

LoadMemory example for C++ 5.0 and later

This example uses WIN32 API calls to load a file into memory, then uses the LoadMemory method to load the memory-resident file into a bitmap.

void CTutorDlg::OnLoadMemory()
{
HFILE hf;
HGLOBAL hMem;
LPSTR lpMem;
long iSize;
ILEADRasterIO *pRasterIO=NULL;

#ifdef UNICODE

hf = _wopen (TEXT("d:\\lead14\\dist\\images\\image1.cmp"), OF_READ);

#else

hf = _lopen ("d:\\lead14\\dist\\images\\image1.cmp", OF_READ);

#endif
iSize = _llseek( hf, 0, SEEK_END );
_llseek( hf, 0, SEEK_SET );
if( (hMem = GlobalAlloc( GMEM_MOVEABLE, iSize)) == NULL )
{
_lclose( hf );
MessageBox(TEXT("Not enough memory to hold the file in memory!") );
return;
}
if( (lpMem = (LPSTR)GlobalLock(hMem)) == NULL )
{
_lclose( hf );
GlobalFree( hMem );
MessageBox(TEXT("Not enough memory to hold the file in memory!") );
return;
}
if( _hread( hf, lpMem, iSize) != iSize )
{
_lclose( hf );
GlobalUnlock( hMem );
GlobalFree( hMem );
MessageBox(TEXT("Error reading file") );
return;
}
_lclose( hf );
GlobalUnlock( hMem );
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
if(pRasterIO->LoadMemory(m_LEADRasterView1.GetRaster(),
(long)hMem, 0, 0, -1, iSize ) )
MessageBox(TEXT("Error calling LoadMemory") );
else
MessageBox(TEXT("LoadMemory succeeded") );
GlobalFree( hMem );
pRasterIO->Release();
}


LoadOffset example for Visual C++ 5.0

LoadOffset example for C++ 5.0 and later

void COffsetCOMView::OnFileSave()
{
int nRet,nDataSize =0;
short nOffsetBegin = 0;

CString m_strHeader = TEXT("Lead Technologies Corporation");

FILE *fp = fopen(TEXT("c:\\1.cmp"),"w");
nDataSize = m_strHeader.GetLength()*sizeof(TCHAR);
TCHAR *Data = (TCHAR *)malloc((nDataSize+1)*sizeof(TCHAR));
memset(Data,0,nDataSize);
memcpy(Data ,m_strHeader.GetBuffer(nDataSize),nDataSize);

nOffsetBegin = nDataSize + sizeof(nOffsetBegin);
fwrite(&nOffsetBegin ,2,1,fp);
fwrite(Data,nDataSize,1,fp);

if(Data)
{
free(Data);
Data = NULL;
}
fclose(fp);

nRet = m_pRasterIO->SaveOffset(m_RasterView.GetRaster(),
TEXT("C:\\1.cmp"),
nOffsetBegin,
FILE_LEAD,
0,
(QFactorConstants)-1,
0);

if (nRet == 0)
{
CString strMsg;
strMsg.Format(TEXT("Size of the
 embedded image file = %d"),m_pRasterIO->GetFileSizeWritten());
MessageBox(strMsg,TEXT("SUCCESS"));
}
}

void COffsetCOMView::OnFileLoadoffset()
{
short nOffsetBegin;
fpos_t FileSize =0;

FILE *fp = fopen(TEXT("c:\\1.cmp"),"rb");
fread(&nOffsetBegin,sizeof(nOffsetBegin),1,fp);
fseek(fp ,0,SEEK_END);
fgetpos(fp,&FileSize);
fclose(fp);

int nRet = m_pRasterIO->LoadOffset(m_RasterView.GetRaster(),
TEXT("c:\\1.cmp"),
nOffsetBegin,
(long)(FileSize-nOffsetBegin),
0, 0, 1);
}


LoadResize example for Visual C++ 5.0

LoadResize example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->LoadResize(m_RasterView1.GetRaster (), "c:\\temp\\test.cmp", 250, 50, LoadResizeConstants (RESIZE_RESAMPLE), 0);

pRasterIO->Release();


LoadStatus Example for C++ 5.0 and later

ILEADRasterIO * pRasterIO = NULL;
int nRet = 0;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

nRet = pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\parrots.jpg"), 0, 0, 1);

if(nRet == 0)
{
if(pRasterIO->LoadStatus == 0)
MessageBox(TEXT("The image was loaded successfully and with no errors"), TEXT("SUCCESS"), MB_OK);
else
MessageBox(TEXT("The image was loaded, but it might have corrupted areas"), TEXT("Warning!"), MB_OK);
}
else
MessageBox(TEXT("The load failed!"), "ERROR", MB_OK);

pRasterIO->Release();


LoadUseViewPerspective example for Visual C++ 5.0

LoadUseViewPerspective example for C++ 5.0 and later

Note: This topic is for Document/Medical only.
This example times the loading of a bitmap with and without changing the internal view perspective.

// Declare local variables.
CTime StartTime, EndTime;
CTimeSpan DeltaTime;
ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

// Do not include paints when measuring time.
m_LEADRasterView1.SetAutoRepaint(FALSE);
// Time the load using the bitmap's view perspective.
pRasterIO->PutLoadUseViewPerspective(TRUE);
StartTime = CTime::GetCurrentTime();
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\o3.tif",
0, 0, 1);
EndTime = CTime::GetCurrentTime();
DeltaTime = EndTime - StartTime;
MessageBox (DeltaTime.Format(TEXT("%S seconds loaded as is") ), TEXT("Notice"), MB_OK);
// Time the load that converts the bitmap's view perspective.
pRasterIO->PutLoadUseViewPerspective(FALSE);
StartTime = CTime::GetCurrentTime();
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\o3.tif",
0, 0, 1);
EndTime = CTime::GetCurrentTime();
DeltaTime = EndTime - StartTime;
MessageBox (DeltaTime.Format(TEXT("%S seconds converted on load") ), TEXT("Notice"), MB_OK);
pRasterIO->Release();


LocalHistoEqualize Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->LocalHistoEqualize(m_LeadRasterView.GetRaster(), 15, 15, 100, 100 , YUV_SPACE, CHANNEL_MASTER);

m_pRasterProc->Release();


LongItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutType(VALUE_ARRAY_LONG);
pltRasVar->PutItemCount(2);
pltRasVar->PutLongItemValue(0, 500);
pltRasVar->PutLongItemValue(1, 1000);


LongValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutType(VALUE_LONG);
pltRasVar->PutLongValue(500);


LZWAutoClear example for Visual C++

ILEADRasterIO * pRasterIO = NULL;
int nRet = 0;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

nRet = pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\parrots.jpg"), 0, 0, 1);

pRasterIO->LZWAutoClear = FALSE;

pRasterIO->Save(m_RasterView.GetRaster(), TEXT("c:\\1.tif"), FILE_TIFLZW, 24, QFACTOR_LEAD_0, 0);

pRasterIO->Release();


MagGlassOwnerDraw Example for C++ 5.0 and later

BOOL CAnnMagGlassDlg::OnInitDialog()
{
.
.
.
.
HRESULT hr;

m_pRasterIO = NULL;
m_pRasterAnn = NULL;

m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT,L_KEY_DOCUMENT);

hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&m_pRasterIO);

if (FAILED (hr))
{
return FALSE;
}

hr = CoCreateInstance(CLSID_LEADRasterAnnotation, NULL,
 CLSCTX_ALL,
IID_ILEADRasterAnnotation, (void**)&m_pRasterAnn);

if (FAILED (hr))
{
return FALSE;
}

m_pRasterIO->Load(m_RasterView.GetRaster(),"c:\\1.bmp",0,0,1);

IDispatch *pDispatch=NULL;
(m_RasterView.GetControlUnknown())->QueryInterface(IID_IDispatch,
 (void**)&pDispatch);

m_pRasterAnn->PutAnnParentRasterView(pDispatch);
m_pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
m_pRasterAnn->AnnCreate(ANN_OBJECT_BUTTON,
 true, true);

m_hObject = m_pRasterAnn->GetAnnObject();

m_pRasterAnn->PutAnnRectHeight(m_hObject,100);
m_pRasterAnn->PutAnnRectWidth(m_hObject,200);
m_pRasterAnn->PutAnnRectLeft(m_hObject,50);
m_pRasterAnn->PutAnnRectTop(m_hObject,50);

return TRUE; // return TRUE unless you set the focus
 to a control
}

void CAnnMagGlassDlg::OnStartMagGlass()
{
m_RasterView.SetEnableMagGlassDraw(true);
m_pRasterAnn->PutAnnEnableMagGlass(true);
m_RasterView.StartMagGlass(200, 200,
 200, RGB(0, 0, 0),
RGB(255, 255, 255), false, 1,
false, CROSSHAIR_FINE, false, false);
}

void CAnnMagGlassDlg::OnStopMagGlass()
{
m_RasterView.StopMagGlass();
m_RasterView.SetEnableMagGlassDraw(false);
m_pRasterAnn->PutAnnEnableMagGlass(false);
}
void CAnnMagGlassDlg::OnMagGlassOwnerDraw(long
 hWnd, long hMemDC, long lXPos, long lYPos, long lMagGlassTop, long lMagGlassLeft,
 long lMagGlassBottom, long lMagGlassRight)
{
m_pRasterAnn->AnnMagGlass(hMemDC,
 lXPos, lYPos, 200, 200, 200);
}


MagGlassPaintIntensity Example for C++ 5.0 and later

void CSampleDlg::StartMagnifyingGlass()
{
int nRet;
CString szMsg;

// Setting the Magnifying Glass Paint contrast, gamma and intensity
m_LeadRasterView.SetMagGlassPaintContrast(m_LeadRasterView.GetMagGlassPaintContrast() + 100);
m_LeadRasterView.SetMagGlassPaintGamma(m_LeadRasterView.GetMagGlassPaintGamma() + 100);
m_LeadRasterView.SetMagGlassPaintIntensity(m_LeadRasterView.GetMagGlassPaintIntensity() + 100);

// Starting the Magnifying Glass
nRet = m_LeadRasterView.StartMagGlass(100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), false, 1, false, CROSSHAIR_FINE, true, true);
if (nRet != 0)
{
szMsg.Format(TEXT("Error Starting the Magnifying Glass, Error: %d"), nRet);
AfxMessageBox(szMsg);
}
}


MaskConvolution example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->MaskConvolution(m_LeadRasterView.GetRaster(), 500, 45, 3, MSKC_EMBOSS);
m_pRasterProc->Release();


MathFunction example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->MathFunction (m_LeadRasterView.GetRaster(), MF_LOG, 100);
m_pRasterProc->Release();


MaxFilter example for Visual C++ 5.0

MaxFilter example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

This example erodes dark objects and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->MaxFilter(m_LEADRasterView1.GetRaster(), 3);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Median example for Visual C++ 5.0

Median example for C++ 5.0 and later

This example applies a median filter with a 3x3 neighborhood and redisplays the bitmap.
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Median(m_LEADRasterView1.GetRaster(), 3);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


MinFilter example for Visual C++ 5.0

MinFilter example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

This example dilates dark objects and repaints the image.
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->MinFilter(m_LEADRasterView1.GetRaster(), 3);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Mosaic example for Visual C++ 5.0

Mosaic example for C++ 5.0 and later

This example applies a mosaic effect with 8x8 tiles and redisplays the bitmap.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Mosaic(m_LEADRasterView1.GetRaster(), 8);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


MosaicTiles example for Visual C++

int iTWidth, iTHeight;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iTWidth = m_LeadRasterView.GetRaster().GetBitmapWidth () / 5;
iTHeight = m_LeadRasterView.GetRaster().GetBitmapHeight () / 5;
m_pRasterProc->MosaicTiles(m_LeadRasterView.GetRaster(), 50, 7, iTWidth, iTHeight, 0, 0, MSCT_CART | MSCT_SHADOWGRAY, SHADOW_E, 0, RGB(0,0,0), RGB(255, 255, 255));
m_pRasterProc->Release();


MotionBlur example for Visual C++

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->MotionBlur(m_RasterView1.GetRaster (), 12, 4500, FALSE);

pRasterProc->Release();


MouseDown example for Visual C++ 5.0

MouseDown example for C++ 5.0 and later

void CBrowseDlg::OnMouseDownLeadimglistctrl1(short Button, short Shift, float x, float y)
{
int nItem;

nItem = m_LEADImageList.HitTest(x, y);

if(nItem >= 0)
{
m_LEADImageList.SetSelectionColor(RGB(255, 0, 0));
m_LEADImageList.Item (nItem).SetSelected(TRUE);
}
}


MouseMove example for Visual C++ 5.0

MouseMove example for C++ 5.0 and later

float gLastX = 0, gLastY = 0;
void CBrowseDlg::OnMouseMove Leadimglistctrl1(short Button, short Shift, float x, float y)
{
gLastX = x;
gLastY = y;
}

void CBrowseDlg::OnClickLeadimglistctrl1()
{
long lIndex;
//manual selection?
if( m_LEADImageList.GetAllowSelection() == IMGLST_ALLOWSELECTION_NONE)
{
lIndex = m_LEADImageList.HitTest(gLastX, gLastY); //did we hit an item?
if( lIndex >= 0 && lIndex < m_LEADImageList.GetCount())
{
//set item as selected
m_LEADImageList.SelectAll(FALSE);
//make sure the item is selected
m_LEADImageList.Item (lIndex).SetSelected(TRUE );
}
}
}


MousePointer example for Visual C++ 5.0

MousePointer example for C++ 5.0 and later

// Set the pointer to a crosshair
m_LEADImageList.SetMousePointer(2);


MouseUp example for Visual C++ 5.0

MouseUp example for C++ 5.0 and later

void CBrowseDlg::OnMouseUpLeadimglistctrl1 (short Button, short Shift, float x, float y)
{
long nItem;

nItem = m_LEADImageList.HitTest(x, y);

if(nItem >= 0)
{
m_LEADImageList.SetSelectionColor(RGB(0, 0, 255));
m_LEADImageList.Item (nItem).SetSelected(TRUE);
}
}


MouseWheel example for Visual C++ 5.0

MouseWheel example for C++ 5.0 and later

void CMyClass::OnMouseWheel(short nDelta,
 short Shift, long x, long y)
{
if (Shift ==2) //CONTROL Key is Pressed
{
if(nDelta < 0)
{
if (m_LeadView.GetPaintZoomFactor()
 < 100 * 16)
{
m_LeadView.SetPaintZoomFactor(m_LeadView.GetPaintZoomFactor()
 * 2);
}
}
else
{
if (m_LeadView.GetPaintZoomFactor()
 > 100 / 16)
m_LeadView.SetPaintZoomFactor(m_LeadView.GetPaintZoomFactor()
 / 2);
}
}
else
{
m_LeadView.GetVScrollInfo().SetPos(m_LeadView.GetVScrollInfo().GetPos()
 - nDelta);
}
}

void CMyClass::OnLoad()
{
HRESULT hr;
ILEADRasterIO *pRasterIO = NULL;

hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

if(SUCCEEDED(hr))
{
pRasterIO->Load((IDispatch *)m_LeadView.GetRaster().m_lpDispatch
 ,"c:\\1.bmp",0,0,1);
m_LeadView.SetEnableMouseWheel(TRUE);
}

pRasterIO->Release();
}


Multiply Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Multiply(m_LeadRasterView.GetRaster(),151);
m_pRasterProc->Release();


MultiScaleEnhancement Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->MultiScaleEnhancement(m_LeadRasterView.GetRaster (),2000, 4,
MSE_DEFAULT, 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
m_pRasterProc->Release();


NumberFramesInOverlay example for Visual C++ 5.0

NumberFramesInOverlay example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
CString strOut;

m_pRasterProc->GetOverlayAttributes( m_LeadRasterView.GetRaster() , 0, OVERLAYATTRIBUTES_FLAGS);

strOut.Format("NumberFramesInOverlay = %d\n"
"ImageFrameOrigin = %d\n"
"ActivationLayer = %s",
m_pRasterProc->OverlayAttributes->NumberFramesInOverlay,
m_pRasterProc->OverlayAttributes->ImageFrameOrigin,
m_pRasterProc->OverlayAttributes->ActivationLayer);

MessageBox(strOut);
m_pRasterProc->Release();


Ocean Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Ocean(m_LeadRasterView.GetRaster (), 20,6,TRUE);
m_pRasterProc->Release();


ODBC Example for Visual C++ 5.0

ODBC Example for C++ 5.0 and later

Take the following steps to create and use a simple database, containing only images. (For a more sophisticated approach, refer to Using ODBC to Access Image Data.)

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS or CompuServe forum. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Start with a copy of the project that you created in Loading and Displaying an Image.
 | Note: This example changes the initialization of the window; so using a copy of the original project prevents problems with later reuse of the original project.
2. | Create an ODBC data source, and name it LEADACCESS. The data source should have one long binary field, the table name should be ltvcpic and the field name should be photo. For a description of how to create an appropriate data source, refer to Using ODBC to Access Image Data.
3. | Add #import statements to your program so you can access the LEADRasterODBC constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following line to the end of the file (keep in mind, you may have to change the path to where the dll's reside):
 |  | #import "c:\\winnt\\system32\\ LTRBC14n.dll" no_namespace, named_guids
4. | Edit TUTORDLG.H and insert the following line in the definition of CTutorDlg after DECLARE_MESSAGE_MAP():

// These variables let us synchronize the LEADRasterODBC control's ODBC
ILEADRasterODBC *m_pRastODBC=NULL;

5.

Edit the TUTORDLG.CPP member function CTutorDlg::OnInitDialog. After the comment // TODO: Add extra initialization here, replace the code with the following:

CoCreateInstance(CLSID_LEADRasterODBC, NULL, CLSCTX_ALL, IID_ILEADRasterODBC, (void**)& m_pRastODBC);
// Position and size the main form so that it takes up most of the screen.
float Width = GetSystemMetrics(SM_CXSCREEN) * 0.9f;
float Height = GetSystemMetrics(SM_CYSCREEN) * 0.8f;
float Left = (GetSystemMetrics(SM_CXSCREEN) - Width) / 2.0f;
float Top = (GetSystemMetrics(SM_CYSCREEN) - Height) / 2.0f;
MoveWindow((int) Left, (int) Top, (int) Width, (int) Height);
m_LEADRasView1.SetAutoRepaint(FALSE); // Take control of when the image paints
m_LEADRasterView1.SetPaintPalette(PAINTPALETTE_AUTO);
m_LEADRasterView1.SetEnableMethodErrors(FALSE);
// Make first param "ODBC;" to select data source from a listbox.
int nRet = m_pRastODBC->dbOpen("ODBC;DSN=LEADACCESS", "ltvcpic", "photo", 0);
if (nRet)
{
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
if (m_pRastODBC->GetdbIsEOF() && m_pRastODBC->GetdbIsBOF())
{
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
}
m_pRastODBC->dbMoveFirst();
m_pRastODBC->PutdbLoadBits(0);
m_pRastODBC->PutdbLockingMode(DB_LOCKINGMODE_OPTIMISTIC);
ImageInit();
}
return TRUE;

6.

Edit the TUTORDLG.H file. After the line DECLARE_MESSAGE_MAP() in the class CTutorDlg, add the following line:

VOID ImageInit();

7.

Edit the TUTORDLG.CPP file. Add the following member function.

VOID CTutorDlg::ImageInit()
{
CWaitCursor wait; // display hourglass
float HeightFactor;
float WidthFactor;
float HeightAllowed;
float WidthAllowed;
float Width = GetSystemMetrics(SM_CXSCREEN) * 0.9f;
float Height = GetSystemMetrics(SM_CYSCREEN) * 0.8f;
float Left = (GetSystemMetrics(SM_CXSCREEN) - Width) / 2.0f;
float Top = (GetSystemMetrics(SM_CYSCREEN) - Height) / 2.0f;
if (m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
m_LEADRasterView1.ForceRepaint();
return;
}
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
HeightFactor = m_LEADRasterView1.GetRaster().GetBitmapHeight();
WidthFactor = m_LEADRasterView1.GetRaster().GetBitmapWidth();
CRect rcWindow;
GetClientRect(rcWindow);
HeightAllowed = rcWindow.Height() * 3.0f / 4;
WidthAllowed = rcWindow.Width() * 3.0f / 4;
// Center the LEADRasterView control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
Left = rcWindow.Width() / 8.0f;
Width = WidthAllowed;
Height = (Width * HeightFactor) / WidthFactor;
Top = (rcWindow.Height() - Height) / 2;
}
else
{
Top = rcWindow.Height() / 8.0f;
Height = HeightAllowed;
Width = (Height * WidthFactor) / HeightFactor;
Left = (rcWindow.Width() - Width) / 2;
}
rcWindow.SetRect(0, 0, (int) Width, (int) Height);
rcWindow.OffsetRect((int) Left, (int) Top);
m_LEADRasterView1.MoveWindow(rcWindow);
// Turn off scroll bars to make sure we use the full client area.
m_LEADRasterView1.SetAutoScroll(FALSE);
// Set the image display size to match the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
// Display the image
m_LEADRasterView1.ForceRepaint(); // Repaint the image
}

8. | In this step and the next one, change the resource file to add some buttons. For the first button, do the following:
 | a. | Click on the ResourceView tab of the Project Workspace.
 | b. | Double-click on the tutor resources folder.
 | c. | Double-click on Dialog.
 | d. | Double-click on IDD_TUTOR_DIALOG.
 | e. | Select the command button control on the Controls toolbar.
 | f. | Click and drag on the dialog window to create and position the button.
 | g. | Double-click the button just created to bring up the Push Button Properties window.
 | h. | Change the ID to IDC_ADDNEW and the caption to Add New.
 | i. | Close the window.
9. | For the other buttons, repeat Step 6 with the following differences for each button:

- With an ID of IDC_LOAD and caption Load

- With an ID of IDC_UPDATE and caption Update

- With an ID of IDC_DELETE and caption Delete

- With an ID of IDC_FIRST and caption |<

- With an ID of IDC_PREV and caption <

- With an ID of IDC_NEXT and caption >

- With an ID of IDC_LAST and caption >|

10. | Select the CANCEL button and press DEL to remove it.
11. | Double-click the OK button and rename it to Exit.
12. | Press CTRL-F4 twice and answer YES to the message to save.
13. | Add code for the IDC_FIRST button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_FIRST.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnFirst).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnFirst()
{
CWaitCursor wait; // display hourglass
if (m_pRastODBC->GetdbIsEOF() && m_Lead1.GetDbIsBOF())
{
MessageBox(TEXT("The database is empty"), TEXT("NOTICE"), MB_OK);
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
}
else
{
m_pRastODBC->dbMoveFirst();
// Viewed image is in the database (after repaint)
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("Update"));
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
GetDlgItem(IDC_LAST)->EnableWindow(TRUE);
GetDlgItem(IDC_NEXT)->EnableWindow(TRUE);
}
ImageInit();
}

14. | Add code for the IDC_PREV button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_PREV.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnPrev).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnPrev()
{
CWaitCursor wait; // display hourglass
if (!m_pRastODBC->GetdbIsBOF())
{
m_pRastODBC->dbMovePrev();
// Viewed image is in the database (after repaint)
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("Update"));
}
// don't combine with above as an else case!
if (m_pRastODBC->GetdbIsBOF()) // BOF
{
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
if (!m_pRastODBC->GetdbIsEOF())
{
m_pRastODBC->dbMoveNext(); // move off BOF
MessageBox(TEXT("Already at first record"), TEXT("NOTICE"), MB_OK);
}
else // BOF && EOF
{
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
}
}
else
{
GetDlgItem(IDC_LAST)->EnableWindow(TRUE);
GetDlgItem(IDC_NEXT)->EnableWindow(TRUE);
ImageInit();
}
}

15. | Add code for the IDC_NEXT button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_NEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnNext).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnNext()
{
CWaitCursor wait; // display hourglass
if (!m_pRastODBC->GetdbIsEOF())
{
m_pRastODBC->dbMoveNext();
// Viewed image is in the database (after repaint)
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("Update"));
}
// don't combine with above as an else case!
if (m_pRastODBC->GetdbIsEOF()) // EOF
{
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
if (!m_pRastODBC->GetdbIsBOF())
{
m_pRastODBC->dbMovePrev(); // move back from EOF
MessageBox(TEXT("Already at last record"), TEXT("NOTICE"), MB_OK);
}
else // EOF && BOF
{
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
}
}
else
{
GetDlgItem(IDC_FIRST)->EnableWindow(TRUE);
GetDlgItem(IDC_PREV)->EnableWindow(TRUE);
ImageInit();
}
}

16. | Add code for the IDC_LAST button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LAST.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnLast).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnLast()
{
CWaitCursor wait; // display hourglass
if (m_pRastODBC->GetdbIsEOF() && m_Lead1.GetDbIsBOF())
{
MessageBox(TEXT("The database is empty"), TEXT("NOTICE"), MB_OK);
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
}
else
{
m_pRastODBC->dbMoveLast();

// Viewed image is in the database (after repaint)
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("Update"));

GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(TRUE);
GetDlgItem(IDC_FIRST)->EnableWindow(TRUE);
}
ImageInit();
}

17. | Add code for the IDC_DELETE button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_DELETE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDelete).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnDelete()
{
CWaitCursor wait; // display hourglass
TCHAR buffer[10];
if (m_pRastODBC->GetdbCanUpdate() == FALSE)
{
MessageBox(TEXT("You cannot update this database."), TEXT("ERROR"));
return;
}
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->GetWindowText(buffer, 7);
// Update button's text will be UPDATE if an image has been loaded but
// not updated.
if (isupper(buffer[1]))
{
MessageBox(TEXT("Viewed image is not in database"), TEXT("ERROR"), MB_OK);
// User can do a MoveNext and MovePrev to see what the current image
// currently is.
return;
}
if (m_pRastODBC->GetdbIsEOF() && m_pRastODBC->GetdbIsBOF())
{
MessageBox(TEXT("The database is empty"), TEXT("NOTICE"), MB_OK);
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
}
else if (!m_pRastODBC->GetdbIsBOF() && !m_pRastODBC->GetdbIsEOF())
{
if (m_pRastODBC->GetdbEditMode() == DB_EDITMODE_ADDNEW)
{
// User selected Add New and then Delete without an Update.
// Update the empty record first before deleting it.
int nRet = m_pRastODBC->dbUpdate(FILE_CMP, 24, QFACTOR_PQ1);
if (!nRet)
{
m_pRastODBC->dbMoveLast(); // new records are added to the end
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_FIRST)->EnableWindow(TRUE);
GetDlgItem(IDC_PREV)->EnableWindow(TRUE);
}
}
m_pRastODBC->dbDelete();
if (m_pRastODBC->GetdbIsDeleted() == FALSE)
{
MessageBox(TEXT("Unable to delete record!"), TEXT("ERROR"));
return;
}
if (m_pRastODBC->GetdbCanRestart() == TRUE)
{
m_pRastODBC->dbRequery(); // moves you to the first image in the database
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
if (m_pRastODBC->GetdbIsEOF())
{
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
}
else
{
GetDlgItem(IDC_NEXT)->EnableWindow(TRUE);
GetDlgItem(IDC_LAST)->EnableWindow(TRUE);
}
}
else
{
m_pRastODBC->dbMovePrev();
GetDlgItem(IDC_LAST)->EnableWindow(TRUE);
GetDlgItem(IDC_NEXT)->EnableWindow(TRUE);
if (m_pRastODBC->GetdbIsBOF()) // just before first record
{
m_pRastODBC->dbMoveNext(); // move forward to first record
GetDlgItem(IDC_FIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_PREV)->EnableWindow(FALSE);
if (m_pRastODBC->GetdbIsEOF()) // just past last record
{
// no more records left
MessageBox(TEXT("The database is empty"), TEXT("NOTICE"), MB_OK);
m_LEADRasterView1.ForceRepaint();
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
}
}
}
ImageInit();
// Viewed image is in the database (after repaint)
pButton->SetWindowText(TEXT("Update"));
}
}

18. | Add code for the IDC_LOAD button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_LOAD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnLoad).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnLoad()
{
CFileDialog OpenFile(TRUE, NULL, TEXT("*.*"));
if (OpenFile.DoModal() == IDOK)
{
CWaitCursor wait; // display hourglass
int nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster(), OpenFile.GetPathName(), 0, 0, 1);
if (!nRet)
{
m_pRastODBC->PutRaster((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch());
ImageInit();
// Remind user that the image has not been updated in the database.
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("UPDATE"));
}
else
{
AfxMessageBox(TEXT("Error loading image."));
if (m_pRastODBC->GetdbEditMode() == DB_EDITMODE_ADDNEW)
OnLast(); // cancel Add New
}
}
}

19. | Add code for the IDC_UPDATE button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_UPDATE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnUpdate).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnUpdate()
{
CWaitCursor wait; // display hourglass
int nRet, nEditMode;
if (m_pRastODBC->GetdbCanUpdate() == FALSE)
{
MessageBox(TEXT("You cannot update this database."), TEXT("ERROR"));
return;
}
// Save Edit mode in a temp variable since dbUpdate() clears the edit mode.
nEditMode = m_pRastODBC->GetdbEditMode();
if ((nEditMode == DB_EDITMODE_NONE) &&
! m_pRastODBC->GetdbIsBOF() && ! m_pRastODBC->GetdbIsEOF())
m_pRastODBC->dbEdit();
if (m_pRastODBC->GetdbEditMode() != DB_EDITMODE_NONE)
{
// dbUpdate() clears the EditMode flag.
nRet = m_pRastODBC->dbUpdate(FILE_CMP, 24, QFACTOR_PQ1);
// Viewed image is in the database (after repaint)
CWnd *pButton = GetDlgItem(IDC_UPDATE);
pButton->SetWindowText(TEXT("Update"));
if (!nRet)
{
if (nEditMode == DB_EDITMODE_ADDNEW)
{
m_pRastODBC->dbMoveLast();
GetDlgItem(IDC_LAST)->EnableWindow(FALSE);
GetDlgItem(IDC_NEXT)->EnableWindow(FALSE);
GetDlgItem(IDC_FIRST)->EnableWindow(TRUE);
GetDlgItem(IDC_PREV)->EnableWindow(TRUE);
}
}
else
{
TCHAR buffer[50];
wsprintf(buffer, TEXT("LEAD Error %d saving image to database."), nRet);
MessageBox(buffer, TEXT("ERROR"), MB_OK);
}
}
else
{
MessageBox(TEXT("Sequence Error - no record to update."), TEXT("ERROR"), MB_OK);
}
}

20. | Add code for the IDC_ADDNEW button as follows:
 | a. | Press Ctrl-W to go to the MFC Class Wizard.
 | b. | In the Class name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_ADDNEW.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddnew).
 | f. | Click the Edit Code button to start entering the code.
 | g. | Edit the function to appear as follows:

void CTutorDlg::OnAddnew()
{
CWaitCursor wait; // display hourglass
// TODO: Add your control notification handler code here
if (m_pRastODBC->GetdbCanAppend() == FALSE)
{
MessageBox(("You cannot append to this database."), TEXT("ERROR"));
return;
}
m_pRastODBC->dbAddNew();
m_LEADRasterView1.ForceRepaint(); // no image for a new record
wait.Restore();
OnLoad();
}

21. | Open the ClassWizard (CTRL-W), and do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
 | f. | Edit the function to appear as follows:

void CTutorDlg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
m_pRastODBC->dbClose();
m_pRastODBC->Release();
}

22.

Rebuild and run the application.


Offset example for Visual C++

int iHShift,iVShift;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iHShift = m_LeadRasterView.GetRaster ().GetBitmapWidth() / 2;
iVShift = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;
m_pRasterProc->Offset(m_LeadRasterView.GetRaster(), iHShift, iVShift, 0, OFFSET_FILL_WRAP);
m_pRasterProc->Release();


Oilify example for Visual C++ 5.0

Oilify example for C++ 5.0 and later

This example applies an oil-painting effect and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Oilify(m_LEADRasterView1.GetRaster(), 10);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


OLECompleteDrag Example for C++ 5.0 and later

void COLEDragDlg::OnOLEStartDragLeadrasterview2(short Button, short Shift, long x, long y)
{
CString csBuffer;
csBuffer.Format(TEXT("LEADRasterView2: OLE Start Drag at pos X = %d and pos y = %d"), x, y);
AfxMessageBox(csBuffer);
}

void COLEDragDlg::OnOLECompleteDragLeadrasterview2(short Button, short Shift, long x, long y)
{
CString csBuffer;
csBuffer.Format(TEXT("LEADRasterView2: OLE Complete Drag at pos X = %d and pos y = %d"), x, y);
AfxMessageBox(csBuffer);
}

void COLEDragDlg::OnOLEDragOverLeadrasterview2(short Button, short Shift, long x, long y)
{
CString csBuffer;
csBuffer.Format(TEXT("LEADRasterView2: OLE Drag Over at pos X = %d and pos y = %d"), x, y);
AfxMessageBox(csBuffer);
}


OLEDropAllowed example for Visual C++ 5.0

OLEDropAllowed example for C++ 5.0 and later

This example toggles the OLEDropAllowed property.

if(m_LEADRasterView1.GetOleDropAllowed() == FALSE)
m_LEADRasterView1.SetOleDropAllowed(TRUE);
else
m_LEADRasterView1.SetOleDropAllowed(FALSE);


OLEDropFile example for Visual C++ 5.0

OLEDropFile example for C++ 5.0 and later

void CMFCTestDlg::OnOleDropFileLeadrasterview1(LPCTSTR pszName)
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

// when a file is dropped, bring up a dialog box and ask the user
// whether to load the file or not
if(MessageBox(pszName, TEXT(""), MB_YESNO) == IDYES)
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
pszName, 0, 1, 1);
else
MessageBox(TEXT("File Not Loaded!"), TEXT(""));
pRasterIO->Release();
}


OLEStartDrag (ILEADRasterImgList) example for Visual C++ 5.0

OLEStartDrag (ILEADRasterImgList) example for C++ 5.0 and later

BOOL COLEDragDropDlg::OnInitDialog()
{
.
.
.
m_LeadImgList2.SetDisplayItemText(true);
m_LeadImgList2.SetScrollStyle(IMGLST_SCROLLSTYLE_VERTICAL);
m_LeadImgList2.SetItemHeight(150);
m_LeadImgList2.SetItemWidth(150);
m_LeadImgList2.SetAllowSelection(IMGLST_ALLOWSELECTION_MULTI);

m_LeadImgList1.LoadFromFile("c:\\1.bmp",0,0,1);
return TRUE; // return TRUE unless you set the focus
 to a control
}

void COLEDragDropDlg::OnStartDrag()
{
m_LeadImgList1.SetEnableOLEDragMethod(true);
m_LeadImgList2.SetEnableOLEDragMethod(true);

CPictureHolder PicHolder;
PicHolder.CreateFromIcon(IDR_MAINFRAME);

m_LeadImgList1.SetOLEDragCursor((IDispatch
 *)PicHolder.m_pPict);
m_LeadImgList2.SetOLEDragCursor((IDispatch *)PicHolder.m_pPict);
}

void COLEDragDropDlg::OnStopDrag()
{
m_LeadImgList1.SetEnableOLEDragMethod(false);
m_LeadImgList2.SetEnableOLEDragMethod(false);
}

void COLEDragDropDlg::OnImgList1_OLECompleteDrag(short
 Button, short Shift, long x, long y)
{
CString tmp;
tmp.Format("Drag Complete for Item# %d \n",m_LeadImgList1.HitTest(x,
 y));
m_strHistory += tmp;
}

void COLEDragDropDlg::OnImgList1_OLEDragOver(short Button,
 short Shift, long x, long y)
{
CString tmp;
tmp.Format("Drag Over Item# %d \n",m_LeadImgList1.HitTest(x,
 y));
m_strHistory += tmp;
}

void COLEDragDropDlg::OnImgList1_OLEGiveFeedback()
{
m_LeadImgList1.SetEnableUseDefaultCursor(false);
}

void COLEDragDropDlg::OnImgList1_OLEStartDrag(short Button,
 short Shift, long x, long y)
{
CString tmp;
tmp.Format("Drag Start for Item# %d \n",m_LeadImgList1.HitTest(x,
 y));
m_strHistory += tmp;
}

void COLEDragDropDlg::OnShowHistory()
{
MessageBox(m_strHistory);
}


OptimizeBuffer Example for Visual C++ 5.0 and later

void CRasterOptimizerSink::OnOptimize (short nPercent)
{
CString strMsg;
strMsg.Format(TEXT("%d"),nPercent);
MessageBox(NULL,strMsg, TEXT("Optimizing"), 0);
}

void COptimizerDlg::OnOptimizeBuffer()
{
int nRet = 0;

ILEADRasterIO * pRasterIO = NULL;
ILEADRasterVariant * pOrgData = NULL;
ILEADRasterVariant * pOptData = NULL;
ILEADOptimizeOptions * pOptions = NULL;

HRESULT hr;

hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

hr = CoCreateInstance(
CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pOrgData
);

hr = CoCreateInstance(
CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pOptData
);

hr = CoCreateInstance(
CLSID_LEADOptimizeOptions ,
NULL,
CLSCTX_ALL,
IID_ILEADOptimizeOptions,
(void**)&pOptions
);

pRasterIO->Load (m_RasterView1.GetRaster(), TEXT("c:\\slices\\eye.gif"),0,0,1);
pOrgData = pRasterIO->SaveArray(m_RasterView1.GetRaster(), FILE_JPEG, 24, QFACTOR_LEAD_0);

pOptions->Distance = m_pImageOptmizer->DefaultOptions ()->Distance;
pOptions->JPEGColorSpace = m_pImageOptmizer->DefaultOptions ()->JPEGColorSpace ;
pOptions->Percent = m_pImageOptmizer->DefaultOptions ()->Percent ;
pOptions->PickSamePalette = m_pImageOptmizer->DefaultOptions ()->PickSamePalette;
pOptions->PNGQFactor= m_pImageOptmizer->DefaultOptions ()->PNGQFactor ;
pOptions->JPEGQFactor = m_pImageOptmizer->DefaultOptions ()->JPEGQFactor;

nRet = m_pImageOptmizer->OptimizeBuffer (pOrgData, &pOptData, pOptions, TRUE);

if (nRet == 0)
{
pRasterIO->LoadArray (m_RasterView2.GetRaster(), pOptData, 0, 0, -1, pOptData->ItemCount);
}

pRasterIO->Release();
pOrgData->Release();
pOptData->Release();
pOptions->Release();
}


OptimizeDir example for Visual C++ 5.0

OptimizeDir example for C++ 5.0 and later

void CRasterOptimizerSink::OnOptimizeDir ()
{
static int nFileCount = 1;
CString strMsg;

switch(theApp.m_pImageOptmizer->GetDirectoryInfo ()->GetStatusCode ())
{
case OPTIMIZE_SUCCESS :
MessageBox(0,TEXT("Operation Successfully Done"),0,0);
break;

case OPTIMIZE_DIR_PRE_OPTIMIZING_IMAGE:
MessageBox (0, TEXT("Operation Successfully Done"),TEXT("Note"),0);
break;

case OPTIMIZE_DIR_OPTIMIZING_IMAGE:
{
long nFilePercent = theApp.m_pImageOptmizer->GetDirectoryInfo ()->FilePercent;
CString OrginalFileName = theApp.m_pImageOptmizer->GetDirectoryInfo ()->OrginalFileName.copy();
CString OptimizedFileName = theApp.m_pImageOptmizer->GetDirectoryInfo ()->OptimizedFileName.copy();
long nTotalFolderFilesCount =theApp.m_pImageOptmizer->GetDirectoryInfo ()->TotalFolderFilesCount;
long nPercent = theApp.m_pImageOptmizer->GetDirectoryInfo ()->GetOptimizeOptions()->GetPercent();
long nTotalPercent = theApp.m_pImageOptmizer->GetDirectoryInfo()->TotalPercent;
strMsg.Format(TEXT("%d %% of optimizing %s to %s \nFiles %d of %d Total Prcent = %d Percent = %d"),
nFilePercent,
OrginalFileName,
OptimizedFileName,
nFileCount,
nTotalFolderFilesCount,
nTotalPercent,
nPercent);
MessageBox(NULL, strMsg, TEXT("Optimizing"), MB_OK);

// if nFilePercent = 100 increment the counter by 1
if((nFilePercent == 100) && ((nFileCount + 1) <= nTotalFolderFilesCount))
nFileCount++;

}
break;

default:
{
CString OrginalFileName = theApp.m_pImageOptmizer->GetDirectoryInfo ()->OrginalFileName.copy();
long nFilePercent = theApp.m_pImageOptmizer->GetDirectoryInfo ()->FilePercent;
/* report error to user */
/* Give the user the ability to skip the current image only or cancel the whole operation*/
strMsg.Format(TEXT("Error: %d - Optimizing Image!\n%s\nPress OK to skip this file and optimize the next one!"),
nFilePercent, OrginalFileName);
if(MessageBox(NULL, strMsg, TEXT("Error"), MB_OKCANCEL|MB_ICONERROR) == IDOK)
theApp.m_pImageOptmizer->OptimizingError = ERROR_OPT_SKIPIMAGE;
else
theApp.m_pImageOptmizer->OptimizingError = ERROR_OPT_ABORT;
}
break;
}
}

void COptimizerDlg::OnOptimizeDir()
{
theApp.m_pImageOptmizer->EnableMethodErrors = FALSE;
int nRet=theApp.m_pImageOptmizer->OptimizeDir(TEXT("c:\\Org"), TEXT("C:\\Opt"), theApp.m_pImageOptmizer->DefaultOptions(), TEXT("*.jpg;*.bmp;*.tmp"), true, true);
}


OriginX example for Visual C++ 5.0

OriginX example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
CString strOut;
m_pRasterProc->GetOverlayAttributes( m_LeadRasterView.GetRaster(), 0, OVERLAYATTRIBUTES_FLAGS);
strOut.Format("Origin(x,y) : (%d , %d)",m_pRasterProc->OverlayAttributes->OriginX , m_pRasterProc->OverlayAttributes->OriginY);
MessageBox(strOut);
m_pRasterProc->Release();


OwnerDrawItem event example for Visual C++ 5

OwnerDrawItem event example for C++ 5 and later

void CTutorDlg::OnOwnerDrawItemLeadimglistctrl1(long nIndex, long hDC, float ItemLeft, float ItemTop, float ItemRight, float ItemBottom, float ItemBackLeft, float ItemBackTop, float ItemBackRight, float ItemBackBottom)
{
//use Windows GDI to custom paint the items
//make sure you have previously set ScaleMode to Pixels (3) so
//that you get these values in Pixels rather than Twips!!!!!!!
//ex. m_LEADRasterImgList1.ScaleMode = 3 'pixels

CString szText;
szText = m_LEADRasterImgList1.Item(nIndex).GetText();

Ellipse((HDC)hDC, (long)ItemLeft, (long)ItemTop, (long)ItemRight, (long)ItemBottom);
TextOut((HDC)hDC, (long)ItemLeft, (long)ItemTop, szText, szText.GetLength());
}


OwnerDrawItems example for Visual C++ 5

OwnerDrawItems example for C++ 5 and later

//toggle OwnerDraw
m_LEADRasterImgList1.SetOwnerDrawItems(!m_LEADRasterImgList1.GetOwnerDrawItems());


Paint event, Enabled property, and hWnd property example for Visual C++ 5.0

Paint event example for C++ 5.0 and later

This example uses some Windows API functions to demonstrate the following:

Paint event
Click event
Enabled property
hWnd property

1. | Start with the project that you created in Loading and Displaying an Image.
2. | In the project Workspace, click the ResourceView tab .
3. | Double-click Dialog and double-click IDD_TUTOR_DIALOG to bring up the application's dialog box.
4. | Add a new button beside the OK button. To do this, select the button control on the Controls toolbar. Then, click and drag to position the button on the dialog box.
5. | Double-click the button and change IDC_BUTTON1 to IDC_TOGGLE. Also, set the Caption to Toggle.
6. | Similarly add a label beneath the Toggle button, naming it IDC_DIRECTIONS, with no Caption.
7. | Close all the windows until you reach the project window, answering yes when asked whether to save the changes.
8. | Edit TUTORDLG.CPP by double-clicking the file.
9. | Near the top of the file (after the last of the preprocessor directives) add the following code:

TCHAR ClickEnabledDir[] = TEXT("Click on the image for a splat");
TCHAR ClickDisabledDir[] = TEXT("Click does nothing");
TCHAR ClickEnabledTog[] = TEXT("&Disable Click");
TCHAR ClickDisabledTog[] = TEXT("&Enable Click");

10.

In the function BOOL CTutorDlg::OnInitDialog(), add the following code before the return:

// Set toggling values
m_LEADRasterView1.SetEnabled(TRUE);
GetDlgItem(IDC_DIRECTIONS)->SetWindowText(ClickEnabledDir);
GetDlgItem(IDC_TOGGLE)->SetWindowText(ClickEnabledTog);

11. | Close the file, choosing Yes when asked whether to save the changes.
12. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_TOGGLE.
 | c. | In the Messages list box, select BN_CLICKED.
 | d. | Click the Add function button. Choose OK for the default function name (OnToggle).
 | e. | Click the Edit Code button to start entering the code.
13. | Edit the OnToggle function so that it appears as follows:

void CTutorDlg::OnToggle()
{
if (m_LEADRasterView1.GetEnabled())
{
m_LEADRasterView1.SetEnabled(FALSE);
GetDlgItem(IDC_DIRECTIONS)->SetWindowText(ClickDisabledDir);
GetDlgItem(IDC_TOGGLE)->SetWindowText(ClickDisabledTog);
}
else
{
m_LEADRasterView1.SetEnabled(TRUE);
GetDlgItem(IDC_DIRECTIONS)->SetWindowText(ClickEnabledDir);
GetDlgItem(IDC_TOGGLE)->SetWindowText(ClickEnabledTog);
}
}

14. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | c. | In the Messages list box, select Click.
 | d. | Click the Add function button. Choose OK for the default function name (OnClickLeadrasterview1).
 | e. | Click the Edit Code button to start entering the code as follows:

void CSaveArrayDlg::OnClickLeadrasterview1()
{
HWND hCtl;
long nScaleMode;
RECT MyRect;
hCtl = (HWND)m_LEADRasterView1.GetWindow();
nScaleMode = m_LEADRasterView1.GetScaleMode();
m_LEADRasterView1.SetScaleMode(3); // Pixels
MyRect.left = 0;
MyRect.top = 0;
MyRect.bottom = (long)m_LEADRasterView1.GetScaleHeight();
MyRect.right = (long)m_LEADRasterView1.GetScaleWidth();
CWnd::FromHandle(hCtl)->InvalidateRect (&MyRect, TRUE);
m_LEADRasterView1.SetScaleMode(nScaleMode);
}

15. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select IDC_LEADRASTERVIEW1.
 | c. | In the Messages list box, select Paint.
 | d. | Click the Add function button. Choose OK for the default function name (OnPaintLeadrasterview1).
 | e. | Click the Edit Code button to start entering the code as follows:

void CTutorDlg::OnPaintLeadrasterview1(long hDC)
{
CDC *LeadClientDC;
HWND hLeadWnd;
int xStart, xDelta, xEnd;
int yStart, yDelta, yEnd;
int i;
static int seed = 2;
srand(seed);
hLeadWnd = (HWND)m_LEADRasterView1.GetWindow();
// Create a device context for the control that the GDI functions can access
LeadClientDC = CDC::FromHandle((HDC)m_LEADRasterView1.GetClientDC());
// Draw random lines on the control. This overlay does not affect the bitmap.
xStart = (int)((rand() * (long)m_LEADRasterView1.GetScaleWidth() / RAND_MAX) + 1);
yStart = (int)((rand() * (long)m_LEADRasterView1.GetScaleHeight() / RAND_MAX) + 1);
LeadClientDC->MoveTo(xStart, yStart);
for( i = 1; i < 50; i++)
{
xDelta = (int)(81L * rand() / RAND_MAX) - 40;
yDelta = (int)(81L * rand() / RAND_MAX) - 40;
xEnd = xStart + xDelta;
yEnd = yStart + yDelta;
LeadClientDC->LineTo(xEnd, yEnd);
LeadClientDC->MoveTo(xStart, yStart);
}
// Remove the lock from the device control
m_LEADRasterView1.ReleaseClientDC();
seed = rand();
}

16.

Rebuild and run the application.


PaintContrast example for Visual C++ 5.0

PaintContrast example for C++ 5.0 and later

This example increases the contrast for painting images.

m_LEADRasterView1.SetPaintContrast(m_LEADRasterView1.GetPaintContrast () + 100);
m_LEADRasterView1.ForceRepaint();


PaintDither (ILEADRasterImgList) example for Visual C++ 5.0

PaintDither (ILEADRasterImgList) example for C++ 5.0 and later

//set the control to use error diffusion
long IMGLST_PAINTDITHER_DIFFUSION;
m_LEADImageList.SetPaintDither(IMGLST_PAINTDITHER_DIFFUSION);


PaintDither example for Visual C++ 5.0

PaintDither example for C++ 5.0 and later

This example turns on error diffusion and redisplays the bitmap.

m_LEADRasterView1.SetPaintDither(PAINTDITHER_DIFFUSION);
m_LEADRasterView1.ForceRepaint();


PaintEffect example for Visual C++ 5.0

PaintEffect example for C++ 5.0 and later

The following functions use the KeyDown and KeyUp events to repaint the image with effects.

VOID CSampleDlg::OnKeyDownLeadrasterview1(short KeyCode, short Shift)
{
if (KeyCode == 116) // Code for F5
{
m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView1.SetBackErase(TRUE);
m_LEADRasterView1.SetEffectGrain(20);
m_LEADRasterView1.SetEffectDelay(50);
m_LEADRasterView1.SetWandSize(5);
m_LEADRasterView1.SetWandColor(RGB(255,255,0)); // Yellow wand
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_RECTANGLE_IN);
m_LEADRasterView1.ForceRepaint();
}
}
VOID CSampleDlg::LEADRasterView1_OnKeyUp(short KeyCode, short Shift)
{
if (KeyCode == 116) // Code for F5
{
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_RECTANGLE_IN);
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_NONE);
}
}


PaintEffectMaxPasses example for Visual C++ 4.0

PaintEffectMaxPasses example for C++ 4.0 and later

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

void CTutorDlg::OnButton1()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO); m_LEADRasterView1.SetAutoRepaint(FALSE);
// Set the effect
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
m_LEADRasterView1.SetPaintEffectMaxPasses(5); // 5 total passes
m_LEADRasterView1.SetPaintEffectPass(1); // Start with pass number 1
m_LEADRasterView1.SetPaintNotificationDelay(200); // Delay 200 milliseconds between passes
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\lead\\images\\image1.cmp", 0, 0, 1); // load the image
m_LEADRasterView1.SetAutoRepaint(TRUE);
pRasterIO->Release();
}
void CTutorDlg::OnPaintNotificationLeadrasterview1(short uPass, short uType)
{
// If the first pass is complete
if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0))
{
// Toggle the effect from left_to_right to right_to_left
if (m_LEADRasterView1.GetPaintEffect()== EFX_EFFECT_WIPE_L_TO_R)
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_R_TO_L);
else
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
}
}


PaintGamma example for Visual C++ 5.0

PaintGamma example for C++ 5.0 and later

This example increases the gamma correction for painting images.

m_LEADRasterView1.SetPaintGamma(m_LEADRasterView1.GetPaintGamma() + 100);
m_LEADRasterView1.ForceRepaint();


PaintIntensity example for Visual C++ 5.0

PaintIntensity example for C++ 5.0 and later

This example increases the intensity for painting images.

m_LEADRasterView1.SetPaintIntensity(m_LEADRasterView1.GetPaintIntensity() + 100);
m_LEADRasterView1.ForceRepaint();


PaintPalette example for Visual C++ 5.0

PaintPalette example for C++ 5.0 and later

This example sets the paint palette to the palette of each Lead control. It then loads two images and dithers them to 8 bits per pixel with optimized palettes, and displays them side by side. In 8-bit display mode, you can see the palette problems that result when you do not use a fixed palette.

ILEADRasterIO *pRasterIO1=NULL;
ILEADRasterIO *pRasterIO2=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO1);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO2);
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

// Disable automatic repainting of the image.
m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView2.SetAutoRepaint(FALSE);
// Turn off scroll bars to make sure we use the full client area.
m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView2.SetAutoScroll(FALSE);
// Clear the bitmaps from memory
m_LEADRasterView1.GetRaster().SetBitmap(0);
m_LEADRasterView2.GetRaster().SetBitmap(0);
BeginWaitCursor();
// Load the bitmaps. These path names may be different on your system.
pRasterIO1->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\image1.cmp", 0, 0, 1);
pRasterIO2->Load(m_LEADRasterView2.GetRaster(),
"d:\\lead14\\dist\\images\\image2.cmp", 0, 0, 1);
// Change the bitmaps to 8 BPS with optimized palettes
pRasterProc->ColorRes(m_LEADRasterView1.GetRaster(),
8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
pRasterProc->ColorRes(m_LEADRasterView2.GetRaster(),
8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
// Make the controls visible so that we can size and position them.
// They will not really appear until we load an image and paint it.
m_LEADRasterView1.ShowWindow(SW_NORMAL);
m_LEADRasterView2.ShowWindow(SW_NORMAL);
// Set the variables used for preserving the aspect ratio.
float HeightFactor1 = m_LEADRasterView1.GetRaster().GetBitmapHeight();
float WidthFactor1 = m_LEADRasterView1.GetRaster().GetBitmapWidth();
float HeightFactor2 = m_LEADRasterView2.GetRaster().GetBitmapHeight();
float WidthFactor2 = m_LEADRasterView2.GetRaster().GetBitmapWidth();
CRect rcWindow;
GetWindowRect(rcWindow);
float ScaleWidth = (float) rcWindow.Width();
float ScaleHeight = (float) rcWindow.Height();
float HeightAllowed = ScaleHeight * 0.8f;
float WidthAllowed = ScaleWidth * 0.45f;
// Center each LEAD control on half of the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
float Left;
float Width;
float Height;
float Top;
CRect rcControl;
if ((WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed)
{
Left = (ScaleWidth / 4) - (WidthAllowed / 2);
Width = WidthAllowed;
Height = (Width * HeightFactor1) / WidthFactor1;
Top = (ScaleHeight - Height) / 2;
}
else
{
Top = (ScaleHeight - HeightAllowed) / 2;
Height = HeightAllowed;
Width = (Height * WidthFactor1) / HeightFactor1;
Left = (ScaleWidth / 4) - (Width / 2);
}
rcControl.SetRect(0, 0, (int) Width, (int) Height);
rcControl.OffsetRect((int) Left, (int) Top);
m_LEADRasterView1.MoveWindow(rcControl);
if ((WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed)
{
Left = (ScaleWidth * 3/4) - (WidthAllowed / 2);
Width = WidthAllowed;
Height = (Width * HeightFactor2) / WidthFactor2;
Top = (ScaleHeight - Height) / 2;
}
else
{
Top = (ScaleHeight - HeightAllowed) / 2;
Height = HeightAllowed;
Width = (Height * WidthFactor2) / HeightFactor2;
Left = (ScaleWidth * 3 / 4) - (Width / 2);
}
rcControl.SetRect(0, 0, (int) Width, (int) Height);
rcControl.OffsetRect((int) Left, (int) Top);
m_LEADRasterView2.MoveWindow(rcControl);
// Set the image display sizes to match the LEAD controls
m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView2.SetDstRect(0.0f, 0.0f,
m_LEADRasterView2.GetScaleWidth(),
m_LEADRasterView2.GetScaleHeight());
m_LEADRasterView2.SetDstClipRect(0.0f, 0.0f,
m_LEADRasterView2.GetScaleWidth(),
m_LEADRasterView2.GetScaleHeight());
// Display the images
m_LEADRasterView1.SetPaintPalette(PAINTPALETTE_AUTO);
m_LEADRasterView2.SetPaintPalette(PAINTPALETTE_AUTO);
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView2.ForceRepaint();
pRasterIO1->Release();
pRasterIO2->Release();
pRasterProc->Release();
EndWaitCursor();


PaintROP3 example for Visual C++ 5.0

PaintROP3 example for C++ 5.0 and later

This example demonstrates the PaintROP3 property.

// Paint an inverted image.
m_LEADRasterView1.SetPaintROP3( SRCINVERT );
m_LEADRasterView1.InvalidateRect(NULL);


PaintScaling (ILEADRasterImgList) Example for Visual C++ 5.0

PaintScaling (ILEADRasterImgList) example for C++ 5.0 and later

//toggle through the paint scale modes
switch(m_LEADImageList.GetPaintScaling())
{
case IMGLST_PAINTSCALING_NORMAL:
m_LEADImageList.SetPaintScaling(IMGLST_PAINTSCALING_RESAMPLE);
this->SetWindowText(TEXT("Resample"));
break;
case IMGLST_PAINTSCALING_RESAMPLE:
m_LEADImageList.SetPaintScaling(IMGLST_PAINTSCALING_BICUBIC);
this->SetWindowText(TEXT("Bicubic"));
break;
case IMGLST_PAINTSCALING_BICUBIC:
m_LEADImageList.SetPaintScaling(IMGLST_PAINTSCALING_NORMAL);
this->SetWindowText(TEXT("Normal"));
break;
}
//force redraw
m_LEADImageList.RedrawWindow ();


PaintScaling Example for Visual C++ 5.0

PaintScaling Example for C++ 5.0 and later

// This example sets the display to use bilinear interpolation
m_LEADRasterView1.SetPaintScaling(PAINTSCALING_RESAMPLE);


PaintSizeMode Example for Visual C++ 5.0

PaintSizeMode Example for C++ 5.0 and later

This example shows how to set the PaintSizeMode property so that the control uses only a vertical scroll bar.

m_LEADRasterView1.SetAutoScroll(TRUE);
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FITSIDES);
m_LEADRasterView1.ForceRepaint();


PaintSizeUseDPI example for Visual C++ 5.0

PaintSizeUseDPI example for C++ 5.0 and later

This example toggles the PaintSizeUseDPI property.

if (m_LEADRasterView1.GetPaintSizeUseDPI() == FALSE)
m_LEADRasterView1.SetPaintSizeUseDPI(TRUE);
else
m_LEADRasterView1.SetPaintSizeUseDPI(FALSE);


PaintTransitionMaxPasses example for C++ 5.0 and later

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

#include "L_ComEfx.h"
void CTutorDlg::OnPaintTransitionMaxPasses()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
m_LEADRasterView1.SetAutoRepaint(FALSE);
// Set the effect
m_LEADRasterView1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
m_LEADRasterView1.SetEffectDelay(20);
m_LEADRasterView1.SetPaintTransitionMaxPasses(5); // 5 total passes
m_LEADRasterView1.SetPaintTransitionPass(1); // Start with pass number 1
m_LEADRasterView1.SetPaintNotificationDelay(200); // Delay 200 milliseconds between passes
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "..\\..\\..\\..\\images\\image1.cmp", 0, 0, 1); // load the image
m_LEADRasterView1.SetAutoRepaint(TRUE);
pRasterIO->Release();
}


PaintWhileLoad example for Visual C++ 5.0

PaintWhileLoad example for C++ 5.0 and later

This example causes the LEAD control to paint the image as it loads.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

m_LEADRasterView1.SetPaintWhileLoad(TRUE);
// Get information about the image so that we can size the control.
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\image2.cmp", 0, 0 );
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
CRect rcWindow;
CRect rcControl;
GetClientRect(&rcWindow);
GetWindowRect(&rcControl);
float HeightFactor = pRasterIO->GetInfoHeight();
float WidthFactor = pRasterIO->GetInfoWidth();
float HeightAllowed = rcWindow.Height() * 3.0f / 4.0f;
float WidthAllowed = rcWindow.Width() * 3.0f / 4.0f;
// Center the LEAD control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
rcControl.SetRect(0, 0,
(int) WidthAllowed,
(int) ((WidthAllowed * HeightFactor) / WidthFactor));
rcControl.OffsetRect(rcWindow.Width() / 8,
(rcWindow.Height() - rcControl.Height()) / 2);
}
else
{
rcControl.SetRect(0, 0,
(int) ((HeightAllowed * WidthFactor) / HeightFactor),
(int) HeightAllowed);
rcControl.OffsetRect((rcWindow.Width() - rcControl.Width()) / 2,
rcWindow.Height() / 8);
}
m_LEADRasterView1.MoveWindow(rcControl);
// Set the image display sizes to match the LEAD controls
float ImageHeight = m_LEADRasterView1.GetScaleHeight();
float ImageWidth = m_LEADRasterView1.GetScaleWidth();
float BitmapHeight = pRasterIO->GetInfoHeight();
float BitmapWidth = pRasterIO->GetInfoWidth();
m_LEADRasterView1.SetSrcRect(0.0f, 0.0f, BitmapWidth, BitmapHeight);
m_LEADRasterView1.SetSrcClipRect(0.0f, 0.0f, BitmapWidth, BitmapHeight);
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, ImageWidth, ImageHeight);
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, ImageWidth, ImageHeight);
// Load the file
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\image2.cmp", 0, 0, 1);
pRasterIO->Release();


PaintZoomFactor Example for Visual C++ 5.0

PaintZoomFactor Example for C++ 5.0 and later

This example shows how to set the PaintZoomFactor property so that image is scaled 200 percent for display.

m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_ZOOM);
m_LEADRasterView1.SetPaintZoomFactor(200.0f);
m_LEADRasterView1.ForceRepaint();


Password Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Password = "password";
m_pRasterProc->Message = "Lead Tools";
m_pRasterProc->AddMessage(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();


PatternStyle (ILEADRasterFXD) example for Visual C++ 5.0

PatternStyle (ILEADRasterFXD) example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterFXD *pRasterFXD=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL,
IID_ILEADRasterFXD, (void**)&pRasterFXD);

m_LEADRasterView1.SetAutoRepaint(FALSE);
//Load an image for the main control
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "v:\\images\\babe.cmp", 0,
0, 1);
//Shape background
pRasterFXD->ShapeBackgroundStyle = FXD_BACKSTYLE_OPAQUE;
pRasterFXD->PatternStyle = FXD_PATTERN_CROSS;
pRasterFXD->PatternBackColor = RGB(255, 0, 0); //red
pRasterFXD->PatternForeColor = RGB(0, 0, 255); //blue
//Shape location
pRasterFXD->ShapeTop = 50.0f;
pRasterFXD->ShapeLeft = 50.0f;
pRasterFXD->ShapeWidth = m_LEADRasterView1.GetDstWidth() - 50.0f;
pRasterFXD->ShapeHeight = m_LEADRasterView1.GetDstHeight() - 50.0f;
//Make the shape a permanent part of the bitmap
pRasterFXD->DrawPersistence = TRUE;
pRasterFXD->DstLeft = 0;
pRasterFXD->DstTop = 0;
pRasterFXD->DstRight =
(long)m_LEADRasterView1.GetRaster().GetBitmapWidth();
pRasterFXD->DstBottom =
(long)m_LEADRasterView1.GetRaster().GetBitmapHeight();
pRasterFXD->SrcLeft = 0;
pRasterFXD->SrcTop = 0;
pRasterFXD->SrcRight =
(long)m_LEADRasterView1.GetRaster().GetBitmapWidth();
pRasterFXD->SrcBottom =
(long)m_LEADRasterView1.GetRaster().GetBitmapHeight();
pRasterFXD->ScaleMode = SCALEMODE_PIXEL;
pRasterFXD->ClientSizeX = 5;
pRasterFXD->ClientSizeY = 5;
//Draw the shape

pRasterFXD->DrawShape((ILEADRaster*)m_LEADRasterView1.GetRaster().m_lpDispatch, 0, FXD_SHAPE_RECTANGLE, 0);
//Repaint
m_LEADRasterView1.SetAutoRepaint(TRUE);
pRasterFXD->Release();
pRasterIO->Release();


PatternStyle example for Visual C++ 5.0

PatternStyle example for C++ 5.0 and later

This example paints a transition with a diagonal cross pattern.

m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView1.SetTransitionDelay(50);

ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster().m_lpDispatch, "..\\..\\..\\..\\images\\image1.cmp", 0, 0, 1);
pRasterIO->Release();

//c:\\lead\\images\\image1.cmp", 0, 0, 1);
m_LEADRasterView1.SetTransitionEffect(EFX_EFFECT_WIPE_RECTANGLE_OUT);
m_LEADRasterView1.SetTransitionStyle(EFX_TRANSITION_PATTERN);
m_LEADRasterView1.SetPatternStyle(EFX_PATTERN_DIAG_CROSS);
m_LEADRasterView1.SetPatternBackColor(RGB(255, 0, 0));
m_LEADRasterView1.SetPatternForeColor(RGB(0, 0, 255));
m_LEADRasterView1.SetAutoRepaint(TRUE);


PCDRes example for Visual C++ 5.0

PCDRes example for C++ 5.0 and later

This example checks for a high resolution image and loads it if possible.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CString myfile(TEXT("s:\\temp\\images\\ike\\0795image01.pcd")); // No PCD sample image is included with LEADTOOLS
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
LPCTSTR(myfile), 0, 0 );
CString msg;
if(pRasterIO->GetInfoPCDRes(PCDRES_4BASE))
{
pRasterIO->PutPCDRes(PCDRES_4BASE);
msg = TEXT("Loading 1024 x 1536 resolution");
}
else
{
pRasterIO->PutPCDRes(PCDRES_BASE);
msg = TEXT("Loading 512 x 768 resolution");

}
MessageBox(msg);
BeginWaitCursor();
// Turn on the automatic display rectangles and the scroll bars.
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetAutoScroll(TRUE);
// Load the file.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
LPCTSTR(myfile), 0, 0, 1);
m_LEADRasterView1.ForceRepaint();
pRasterIO->Release();
EndWaitCursor();


PDFCompInsertMRC Example for Visual C++ 5.0 and later

void CTestPDFCOMP::OnInsertWithtMRC()
{
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pltRaster);
if (FAILED(hr))
return;

hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pltRasterIO);
if (FAILED(hr))
{
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

hr = CoCreateInstance(CLSID_LEADPDFCompressor, NULL, CLSCTX_ALL, IID_ILEADPDFCompressor, (void**)&m_pltPDFComp);
if (FAILED(hr))
{
m_pltRasterIO->Release();
m_pltRasterIO = NULL;
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

m_pltRasterIO-> LoadArray (m_pltRaster,"c:\\Image.cmp",0,0,1);

m_pltPDFComp->EnableMethodErrors = FALSE;
m_pltPDFComp->PDFCompInit (TRUE);

m_pltPDFComp->PDFCompSetCompression ( (PDFCOMP_1BIT_COMPRESSION_TYPE_ENABLED | PDFCOMP_2BIT_COMPRESSION_TYPE_ENABLED | PDFCOMP_PICTURE_COMPRESSION_TYPE_ENABLED), PDFCOMP_1BIT_COMP_TYPE_JBIG2, PDFCOMP_2BIT_COMP_TYPE_ZIP, PDFCOMP_PICTURE_COMP_TYPE_JPEG, 50);

m_pltPDFComp->ImageQuality = PDFCOMPIMAGEQUALITY_USER;
m_pltPDFComp->OutputQuality = PDFCOMPOUTPUTQUALITY_USER;

m_pltPDFComp->Flags = PDFCOMP_FAVOR_ONE_BIT | PDFCOMP_WITHBACKGROUND
m_pltPDFComp->CleanSize = 7;
m_pltPDFComp->SegmentQuality = 50;
m_pltPDFComp->ColorThreshold = 25;
m_pltPDFComp->BackGroundThreshold = 15;
m_pltPDFComp->CombineThreshold = 100;

m_pltPDFComp->PDFCompInsertMRC (m_pltRaster);
m_pltPDFComp->PDFCompWrite ("c:\\output.pdf");
m_pltPDFComp->PDFCompFree ();

m_pltRasterIO->Release();
m_pltRaster->Release();
m_pltPDFComp->Release();
m_pltPDFComp = NULL;
m_pltRasterIO = NULL;
m_pltRaster = NULL;
}

void CRasterPDFCompSink::onPDFCompEvent(long nPage)
{

if (nPage == 1)
{
CString str ;

str.Format(TEXT("Left Value of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentLeft ) ;
MessageBox(str);

str.Format(TEXT("Right Value of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentRight ) ;
MessageBox(str);

str.Format(TEXT("Top Value of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentTop ) ;
MessageBox(str);

str.Format(TEXT("Bottom Value of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentBottom ) ;
MessageBox(str);

str.Format(TEXT("Segment type of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentType ) ;
MessageBox(str);

str.Format(TEXT("Color Count of Segment 0 = = %d "), m_pltPDFComp-> MRCSegmentInfo.SegmentColorsCount ) ;
MessageBox(str);

COLORREF Color;
m_pltPDFComp-> MRCSegmentInfo.get_SegmentColors (0, &Color);

str.Format(TEXT("Color 0 of Segment 0 = = %d "), Color ) ;
MessageBox(str);
}

m_pltPDFComp->EnableAddSegment = TRUE;
}


PDFCompInsertNormal Example for Visual C++ 5.0 and later

void CTestPDFCOMP::OnInsertWithoutMRC()
{
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pltRaster);
if (FAILED(hr))
return;

hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pltRasterIO);
if (FAILED(hr))
{
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

hr = CoCreateInstance(CLSID_LEADPDFCompressor, NULL, CLSCTX_ALL, IID_ILEADPDFCompressor, (void**)&m_pltPDFComp);
if (FAILED(hr))
{
m_pltRasterIO->Release();
m_pltRasterIO = NULL;
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

m_pltRasterIO-> LoadArray (m_pltRaster,"c:\\Image.cmp",0,0,1);

m_pltPDFComp->PDFCompInit (FALSE);
m_pltPDFComp->PDFCompInsertNormal(m_pltRaster);
m_pltPDFComp->PDFCompWrite ("c:\\output.pdf");
m_pltPDFComp->PDFCompFree ();

m_pltRasterIO->Release();
m_pltRaster->Release();
m_pltPDFComp->Release();
m_pltPDFComp = NULL;
m_pltRasterIO = NULL;
m_pltRaster = NULL;
}


PDFEncryptFlags example for Visual C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->PutPDFUserPassword ("UserPassword");
pRasterIO->PutPDFOwnerPassword("OwnerPassword");
pRasterIO->PutEnablePDF128bit(true);
pRasterIO->PutPDFEncryptFlags(PDF_SECURITY_REV2_PRINTDOCUMENT);

pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\test.PDF", FILE_RAS_PDF,
24, (QFactorConstants)QFACTOR_LEAD_0, SAVE_OVERWRITE);

pRasterIO->Release();


PDFInitDir example for Visual C++ 5.0 and later

BOOL CPDFTest::OnInitDialog()
{
.
.
.
// TODO: Add extra initialization here
CoInitialize(NULL);

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);
if (FAILED(hr))
{
MessageBox(TEXT("Error Creating
 Raster IO Object"));
}

return TRUE; // return TRUE unless you set the focus
 to a control
}
void CPDFTest::OnGetPDFInitDir()
{
MessageBox(m_pRasterIO->GetPDFInitDir());
}

void CPDFTest::OnSetPDFInitDir()
{
m_pRasterIO->PutPDFInitDir("c:\\Runtime
 PDF\\PDF");
}


PDFSaveLowMemory example for Visual C++ 5.0 and later

LEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->PDFSaveLowMemory = TRUE;
pRasterIO->Save(m_LEADRasterView1.GetRaster(), "c:\\temp\\tmp.pdf", FILE_RAS_PDF_G4, 1, (QFactorConstants)1, SAVE_OVERWRITE);
pRasterIO->Release();


PDFSaveUseDPI example for Visual C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
//Use image DPI when saving as PDF
pRasterIO->PDFSaveUseDPI = TRUE;
//Save image as Raster PDF with CCITT G4 compression
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"c:\\temp\\tmp.pdf",
FILE_RAS_PDF_G4, 1,
(QFactorConstants)1, SAVE_OVERWRITE);
pRasterIO->Release();


PDFXResolution example for C++ 5.0 and later

//This example does the following :
// 1- Changes the horizontal and vetical PDF resolutions to 150 dpi .
// 2- Sets the pixel depth to 8 .
// 3- Disables both font and graphics anti-aliasing.
// 4- Forces the PDF module to use it's own installed fonts.
// 5- Loads a PDF file using the new settings.
ILEADRasterIO *pRasterIO=NULL;
//unlock PDF support, you will need the actual key
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_PDF, "TestKey");

CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);
//Set horizontal resolution
pRasterIO->put_PDFXResolution(150);
//Set vertial resolution
pRasterIO->put_PDFYResolution(150);
//Set Display depth
pRasterIO->put_PDFDisplayDepth (8);
//No font anti-aliasing
pRasterIO->put_PDFTextAlpha (1);
//No graphics anti-aliasing
pRasterIO->put_PDFGraphicsAlpha (1);
//Use fonts installed by the PDF module
pRasterIO->put_PDFUseLibFonts (TRUE);
//Load the PDF file
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\temp\\Test.pdf", 0, 0, 1);
pRasterIO->Release();


Perlin example for Visual C++

int iXCircle, iYCircle;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iXCircle = m_LeadRasterView.GetRaster().GetBitmapWidth() / 2;
iYCircle = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;
m_pRasterProc->Perlin(m_LeadRasterView.GetRaster(), 0, 10, 8, 50, RGB(0,0,0), RGB(255, 0, 0),iXCircle, iYCircle, 4, 20, PRL_PURE |PRL_CIRCLE);
m_pRasterProc->Release();


Perspective example for Visual C++

IILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PutPerspectivePointsX(0, (long)( m_LeadRasterView.GetRaster().GetBitmapWidth() * 3 / 9));
m_pRasterProc->PutPerspectivePointsY(0, (long)( m_LeadRasterView.GetRaster().GetBitmapHeight() * 1 / 12));
m_pRasterProc->PutPerspectivePointsX(1, (long)( m_LeadRasterView.GetRaster().GetBitmapWidth() * 3 / 4));
m_pRasterProc->PutPerspectivePointsY(1, (long)( m_LeadRasterView.GetRaster().GetBitmapHeight() * 2 / 12));
m_pRasterProc->PutPerspectivePointsX(2, (long)( m_LeadRasterView.GetRaster().GetBitmapWidth() * 2 / 10));
m_pRasterProc->PutPerspectivePointsY(2, (long)( m_LeadRasterView.GetRaster().GetBitmapHeight() * 8 / 10));
m_pRasterProc->PutPerspectivePointsX(3, (long)( m_LeadRasterView.GetRaster().GetBitmapWidth() * 10 / 11));
m_pRasterProc->PutPerspectivePointsY(3, (long)( m_LeadRasterView.GetRaster().GetBitmapHeight() * 7 / 10));

m_pRasterProc->Perspective(m_LeadRasterView.GetRaster(), RGB(255,255,255), PERSPECTIVE_IMAGE);

m_pRasterProc->Release();


Picturize example for Visual C++ 5.0

Picturize example for C++ 5.0 and later

// replace the current image in the main control with an image created
// from all the images present in c:\images. Resize all images present in that directory
// to 8x8 pixels and load them all in memory before proceeding

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

m_LEADRasterView1.SetScaleMode(SCALEMODE_PIXEL);
pRasterProc->Picturize(
m_LEADRasterView1.GetRaster(),
"d:\\erase\\images",
(PicturizeConstants)(PICTURIZE_LOADALL | PICTURIZE_RESIZE),
8,
8);

pRasterProc->Release();


PicturizeBitmapList example for Visual C++

PicturizeBitmapList example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->PicturizeBitmapList(m_RasterView1.GetRaster (), 20, 15, 200, m_RasterView2.GetRaster());

pRasterProc->Release();


PicturizeSingle example for Visual C++

PicturizeSingle example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->Load (m_RasterView2.GetRaster (), "c:\\temp\\test.cmp", 0, 1, 1);
pRasterProc->PicturizeSingle (m_RasterView1.GetRaster(), m_RasterView2.GetRaster(), 20, 15, 200);

pRasterProc->Release();
pRasterIO->Release();


Pixel example for Visual C++ 5.0

Pixel example for C++ 5.0 and later

This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

void CMfc2Dlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
long xycolor;
float xfraction;
float yfraction;
float xPixel;
float yPixel;
// In MFC 4.0 you get pixels; so set the scalemode accordingly.
m_LEADRasterView1.SetScaleMode(3);
m_LEADRasterView1.SetAutoRepaint(FALSE);
// Translate mouse coordinates to fractions of the destination width and height.
xfraction = (x - m_LEADRasterView1.GetDstLeft()) / m_LEADRasterView1.GetDstWidth();
yfraction = (y - m_LEADRasterView1.GetDstTop()) / m_LEADRasterView1.GetDstHeight();
// Convert fractions to bitmap pixel coordinates.
xPixel = (m_LEADRasterView1.GetSrcWidth() * xfraction) + m_LEADRasterView1.GetSrcLeft();
yPixel = (m_LEADRasterView1.GetSrcHeight() * yfraction) + m_LEADRasterView1.GetSrcTop();
// Make the whole line the same color as the pixel.
xycolor = m_LEADRasterView1.GetRaster().GetPixel(xPixel, yPixel);
for(xPixel=0; xPixel<m_LEADRasterView1.GetRaster().GetBitmapWidth();xPixel++)
{
m_LEADRasterView1.GetRaster().SetPixel(xPixel,yPixel,xycolor);
}
m_LEADRasterView1.ForceRepaint();
}


Pixelate Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster().GetBitmapWidth()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight()/2;
m_pRasterProc->Pixelate(m_LeadRasterView.GetRaster(),5, 10, 100, CenterX, CenterY, PIX_AVR | PIX_RAD | PIX_WPER |PIX_HPER);
m_pRasterProc->Release();


PixelData example for Visual C++ 5.0

PixelData example for C++ 5.0 and later

This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

void CTutorDlg::OnMouseDownLeadrasterview1 (short Button, short Shift, float x, float y)
{
ILEADRasterVariant * pltRasVar = NULL;
float xfraction;
float yfraction;
float xPixel;
float yPixel;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
// In MFC you get pixels; so set the scale mode accordingly.
m_RasterView1.GetRaster().SetScaleMode(3);
m_RasterView1.SetAutoRepaint(FALSE);
// Translate mouse coordinates to fractions of the destination width and height.
xfraction = (x - m_RasterView1.GetDstLeft()) / m_RasterView1.GetDstWidth();
yfraction = (y - m_RasterView1.GetDstTop()) / m_RasterView1.GetDstHeight();

// Convert fractions to bitmap pixel coordinates.
xPixel = (m_RasterView1.GetSrcWidth() * xfraction) + m_RasterView1.GetSrcLeft();
yPixel = (m_RasterView1.GetSrcHeight() * yfraction) + m_RasterView1.GetSrcTop();
// Make the whole line the same color as the pixel.
pltRasVar = m_RasterView1.GetRaster ().GetPixelData(xPixel, yPixel);
//disable repainting
m_RasterView1.SetAutoRepaint (FALSE);
for(xPixel=0; xPixel<m_RasterView1.GetRaster().GetBitmapWidth();xPixel++)
{
m_RasterView1.GetRaster().SetPixelData(xPixel,yPixel,pltRasVar);
}
// re-enable repainting
m_RasterView1.SetAutoRepaint (TRUE);
pltRasVar->Release();
}


Plane Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/ 2;
m_pRasterProc->Plane(m_LeadRasterView.GetRaster(), CenterX, CenterY, 0, CenterY, CenterX, -1,0,25,0,100, 20000, RGB(255,0,0), RGB(0,0,0), PLANE_RIGHT | PLANE_LEFT | PLANE_FILL_CLR);
m_pRasterProc->Release();


PlaneBend Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/ 2;

m_pRasterProc->PlaneBend( m_LeadRasterView.GetRaster(), CenterX,CenterY,0,CenterY*2,CenterX,-1, 0, 100,400,0,100, 20000, RGB(255,0,0), RGB(0,0,0), PLANE_DOWN | PLANE_UP | PLANE_FILL_CLR);
m_pRasterProc->Release();


PlasmaFilter example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PlasmaFilter(m_LeadRasterView.GetRaster(), 0, 0, 0, 50, 0, 30, PLSTYP_DIAGONAL | PLSCLR_RGB2);
m_pRasterProc->Release();


PLTPenColor Example for C++ 5.0 and later

void CDemoView::OnLoadPLT()
{
ILEADRasterIO *m_pRasterIO = NULL;
CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);

int iPen;
int iWidth;
COLORREF crColor;

for (iPen=0; iPen<8 ; iPen++)
{
iWidth= ceil(iPen/2) + 1;
switch ( iWidth )
{
case 1:
{
crColor= RGB ( 255, 0, 0 );
break;
}

case 2:
{
crColor= RGB ( 0, 255, 0 );
break;
}

case 3:
{
crColor= RGB ( 0, 0, 255 );
break;
}

case 4:
{
crColor= RGB ( 255, 255, 0 );
break;
}

default:
crColor= RGB ( 255, 0, 255 );
}

/* Change Pen width */
m_pRasterIO->PLTPenWidth[iPen]= iWidth;

/* Change Pen color */
m_pRasterIO->PLTPenColor[iPen]= crColor;
}

/* Now load the PLT file */
m_pRasterIO->Load(m_LeadRasterView.GetRaster() ,"c:\\image1.plt", 0, 0, 1 );
m_pRasterIO->Release();
}


Pointillist example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Pointillist(m_RasterView.GetRaster(), 25, RGB(255, 255, 255), POINTILLIST_COLOR | POINTILLIST_POINT);
m_pRasterProc->Release();


Polar Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Polar(m_LeadRasterView.GetRaster(), 0, FILL_RPT | CART_TO_POL);
m_pRasterProc->Release();


Posterize example for Visual C++ 5.0

Posterize example for C++ 5.0 and later

This example applies a six-color poster effect and redisplays the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Posterize(m_LEADRasterView1.GetRaster(), 6);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


PreferredLoadFormat Example for Visual C++ 5.0

PreferredLoadFormat Example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->PutPreferredLoadFormat(FILE_CMP);
//....... load a file
pRasterIO->Release();


PreLoadFilterList Example for C++ 5.0 and later

ILEADRasterIO* pRasterIO= NULL;

CString cs;

BSTR t;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->PreLoadFilters(2, 1, TEXT("BMP,PCX,TIF"));

t = pRasterIO->PreLoadFilterList;

cs.Format(TEXT("%s Fixed: %ld Cached: %ld"),

CString(t),

pRasterIO->PreLoadFilterFixedCount,

pRasterIO->PreLoadFilterCachedCount);

AfxMessageBox(cs);

SysFreeString(t);

pRasterIO->Release();


PreLoadFilters Example for Visual C++ 5.0

PreLoadFilters Example for C++ 5.0 and later

This example shows how to preload filters.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
//preload the BMP, PCX, FAX, and TIFF filters,
//and allow 1 filter to be cached, while always
//keeping 3 loaded.
pRasterIO->PreLoadFilters(3, 1, "BMP,PCX,FAX,TIF");
//..... load an image
pRasterIO->Release();


PrinterScaleHeight Example for Visual C++ 5.0

PrinterScaleHeight Example for C++ 5.0 and later

void CTutorDlg::OnPrinterScaleHeight()
{
long hDC;

hDC = m_LEADRasterView1.PrintStart();
//print 1/4 of the printable region
m_LEADRasterView1.Render(hDC, 0, 0, m_LEADRasterView1.GetPrinterScaleWidth() / 4, m_LEADRasterView1.GetPrinterScaleHeight() / 4);
m_LEADRasterView1.PrintEnd(hDC);
}


PrintNewPage example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
float HeightFactor, WidthFactor, HeightAllowed, WidthAllowed;
float ControlWidth, ControlHeight;
long MyPrinter=0;

CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL,
CLSCTX_ALL, IID_ILEADRasterProcess,
(void**)&pRasterProc);

//change this to a file on your system
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "v:\\images\\eagle.cmp", 0, 1, 1);

//note, there will be no samples for other platforms, this function is not necessary in other languages):
// Set the variables used for preserving the aspect ratio.
HeightFactor = m_LEADRasterView1.GetRaster().GetBitmapHeight();
WidthFactor = m_LEADRasterView1.GetRaster().GetBitmapWidth ();
// Allow a maximum of 3x3 inches on a 300dpi printer
HeightAllowed = 900.0f;
WidthAllowed = 900.0f;
// Print the LEAD control, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
ControlWidth = WidthAllowed;
ControlHeight = (ControlWidth * HeightFactor) / WidthFactor;
}
else
{
ControlHeight = HeightAllowed;
ControlWidth = (ControlHeight * WidthFactor) / HeightFactor;
}

//start the print job
MyPrinter = m_LEADRasterView1.PrintStart ();
m_LEADRasterView1.Render (MyPrinter, 0.0f, 0.0f, ControlWidth, ControlHeight);
//flip the image
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
//start a new page
m_LEADRasterView1.PrintNewPage(MyPrinter);
//print the flipped image
m_LEADRasterView1.Render (MyPrinter, 0.0f, 0.0f, ControlWidth, ControlHeight);
//end the print job
m_LEADRasterView1.PrintEnd (MyPrinter);
pRasterIO->Release();
pRasterProc->Release();


ProgressivePasses Example for Visual C++ 5.0

ProgressivePasses Example for C++ 5.0 and later

This example shows how to save and load a progressive file.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->PutEnableMethodErrors(FALSE);

// Save the current image as a progressive CMP file.
pRasterIO->PutProgressivePasses(8);
pRasterIO->Save(m_LEADRasterView1.GetRaster(),"d:\\temp\\tmp.jpg", FILE_JFIF,24, (QFactorConstants)200, SAVE_OVERWRITE);

// Set properties to show progressive paints when we load.
m_LEADRasterView1.SetPaintWhileLoad(TRUE);
m_LEADRasterView1.SetAutoSetRects(FALSE);

// Load the file we just saved.
pRasterIO->PutProgressivePasses(PROGRESSIVEPASSES_WHEN_MEANINGFUL);
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "d:\\temp\\tmp.jpg", 0, 0, 1);

// Restore the default behavior.
pRasterIO->PutProgressivePasses(0);
pRasterIO->Release();


PTKResolution Example for C++ 5.0 and later

void CTestImgProcView::OnLoadPtk()
{
ILEADRasterIO *m_pRasterIO = NULL;

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);
/*Set new PTK option*/
m_pRasterIO->PTKResolution = 120;

/* Now load the PTK file */
m_pRasterIO->Load (m_LeadRasterView2.GetRaster(), "c:\\image1.Ptk", 0, 1, 1 );

m_pRasterIO->Release();
}


Punch Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster().GetBitmapWidth()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight()/2;
m_pRasterProc->Punch(m_LeadRasterView.GetRaster(),100,100,CenterX,CenterY , RGB(0,0,0), FILL_RPT | FILL_WOUTROT );
m_pRasterProc->Release();


PuzzleEffect Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
m_pRasterProc->PuzzleEffect(m_LeadRasterView.GetRaster (), 10, 10, 0,
RGB(0, 0, 0),
PUZZLE_BORDER |
PUZZLE_SHUFFLE |
PUZZLE_COUNT |
BITMAP_RESIZE);
m_pRasterProc->Release();


RadialBlur Example for C++ 5.0 and later

CoInitialize(NULL);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&m_pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_LeadView.GetRaster(),"c:\\1.bmp",0,0,1);
m_pRasterProc->RadialBlur(m_LeadView.GetRaster(), 50, 10, 50, 50);


RadWave Example for C++ 5.0 and later

CoInitialize(NULL);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&m_pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterIO->Load(m_LeadView.GetRaster(),"c:\\1.bmp",0,0,1);
m_pRasterProc->RadWave(m_LeadView.GetRaster(),5, 25, 0, 20, 20, 0, FILL_RPT| DIS_FRQ );


RasterizeViewMode example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);
/* This example will set current viewport mode to L2D_USE_WIDTH_AND_HEIGHT,
sets the current viewport size to 400*400 pixels and then loads a DXF file */
//You must unlock support for this feature
//L_KEY_VECTOR_DXF represents the unlock support string
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_VECTOR_DXF, L_KEY_VECTOR_DXF);

/* Set viewport mode to L2D_USE_WIDTH_HEIGHT */
pRasterIO->put_RasterizeViewMode (L2D_USE_WIDTH_HEIGHT);
/* Set viewport size to 400*400 pixels */
pRasterIO->put_RasterizeViewportWidth (400);
pRasterIO->put_RasterizeViewportHeight (400);
/* Load a DXF file */
pRasterIO->Load (m_LEADRasterView1.GetRaster(), "s:\\temp\\images\\dxf\\Test.dxf", 0, 0, 1);
pRasterIO->Release();


RawLoad Example for Visual C++ 5.0

RawLoad Example for C++ 5.0 and later

//This example loads RAW data into a LEAD control
//Raw data parameters are set in the LoadInfo event, which gets called
//when the file format is FILE_RAW, or any unrecognized file format
//The LoadInfo event obtains information through class variables
//
//NOTE: This is not a complete example for handling events, some steps have
//been omitted. For a complete example of how to handle events, refer to the
//example "Updating a Gauge and Detecting a User Interrupt".

//class variables used in the LoadInfo event
// int nWidth; //width of image
// int nHeight; //height of image
// int nBitsPerPixel; //bits per pixel of image--if palettized, a gray palette is generated
// int nViewPerspective; //view perspective of raw data (TOP_LEFT, BOTTOM_LEFT, etc)
// int bOrderBGR; //TRUE if order BGR, FALSE if order RGB
// unsigned long nOffset; //offset into file where raw data begins
// int bPadding; //TRUE if each line of data is padded to four bytes
// int bReverseBits; //TRUE if the bits of each byte are reversed

void CRawDlg::RawLoad(TCHAR * pszFileName)
{
int nRet;
TCHAR szMsg[200];
ILEADRasterIO *m_pRasterIO=NULL;

//Fill in the class variables
//The class variables will get access in the LoadInfo event
m_nWidth = 294;
m_nHeight = 415;
m_nBitsPerPixel = 24;
m_nViewPerspective = BOTTOM_LEFT;
m_bOrderBGR = TRUE;
m_nOffset = 250;
m_bPadding = TRUE;
m_bReverseBits = TRUE;

nRet = m_pRasterIO->Load (m_RasterView.GetRaster(), pszFileName, m_nBitsPerPixel, 0, 1);
if (nRet == 0)
wsprintf(szMsg, TEXT("SUCCESS file load: %s"), pszFileName);
else
wsprintf(szMsg, TEXT("FAILED--file load: %s"), pszFileName);
AfxMessageBox(szMsg);
}

void CRasterIOSink::OnLoadInfo ()
{
unsigned int uColors, i;
unsigned int uGray;
unsigned int uFlags;

m_pDlg->m_RasterView.SetScaleMode (3);
m_pDlg->m_pRasterIO->LoadInfoFormat = FILE_RAW;
m_pDlg->m_pRasterIO->LoadInfoWidth = (float)m_pDlg->m_nWidth;
m_pDlg->m_pRasterIO->LoadInfoHeight = (float)m_pDlg->m_nHeight;
m_pDlg->m_pRasterIO->LoadInfoBits = m_pDlg->m_nBitsPerPixel;
m_pDlg->m_pRasterIO->LoadInfoXRes = 150;
m_pDlg->m_pRasterIO->LoadInfoYRes = 150;
m_pDlg->m_pRasterIO->LoadInfoOffset = m_pDlg->m_nOffset;
uFlags = 0;

if (m_pDlg->m_bPadding)
uFlags |= LOADINFO_PAD4;

if (m_pDlg->m_bOrderBGR == FALSE)
uFlags |= LOADINFO_ORDERRGB;

if (m_pDlg->m_bReverseBits)
uFlags |= LOADINFO_LSB;

switch(m_pDlg->m_nViewPerspective)
{
case TOP_LEFT:
uFlags |= LOADINFO_TOPLEFT;
break;

case BOTTOM_LEFT:
uFlags |= LOADINFO_REVERSE;
break;

case TOP_RIGHT: //BOTTOM_LEFT180
uFlags |= LOADINFO_BOTTOMLEFT180;
break;

case BOTTOM_RIGHT: //TOP_LEFT180
uFlags |= LOADINFO_TOPLEFT180;
break;

case RIGHT_TOP: //TOP_LEFT90
uFlags |= LOADINFO_TOPLEFT90;
break;

case LEFT_BOTTOM: //TOP_LEFT270
uFlags |= LOADINFO_TOPLEFT270;
break;

case LEFT_TOP: //BOTTOM_LEFT90
uFlags |= LOADINFO_BOTTOMLEFT90;
break;

case RIGHT_BOTTOM: //BOTTOM_LEFT270
uFlags |= LOADINFO_BOTTOMLEFT270;
break;
}

//if image is palettized create a grayscale palette
if (m_pDlg->m_nBitsPerPixel <= 8)
{
uColors = 1 << m_pDlg->m_nBitsPerPixel;
uFlags |= LOADINFO_PALETTE;

for (i=0; i<uColors; i++)
{
uGray = (i * 256) / uColors;
m_pDlg->m_pRasterIO->PutIOPalette (i, RGB(uGray, uGray, uGray));
}
}
m_pDlg->m_pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)uFlags;
}


RawSave Example for Visual C++ 5.0

RawSave Example for C++ 5.0 and later

//This example saves a LEAD bitmap as RAW data starting at offset uOffset
//The data is padded so that each line of bytes is evenly divides 4
//The bits in each byte are reversed before saving
//The Bits per pixel of the raw data is the same as the bits per pixel LEAD1
//If LEAD1 is a palettized image, the palette is not saved--only the raw data
void CRawDlg::RawSave(TCHAR * pszFileName, unsigned long uOffset)
{
int nRet;
TCHAR szMsg[200];
ILEADRasterIO *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
if (pRasterIO != NULL)
{

pRasterIO->SaveLSB = TRUE;
pRasterIO->SavePad4 = TRUE;
nRet = pRasterIO->SaveOffset (m_RasterView.GetRaster(), pszFileName, uOffset, (RasterFileConstants)FILE_RAW, 0, (QFactorConstants)0, 0);
if (nRet == 0)
wsprintf(szMsg, TEXT("SUCCESS file save: %s Size[%d]"), pszFileName, pRasterIO->GetFileSizeWritten());
else
wsprintf(szMsg, TEXT("FAILED file save: %s"), pszFileName);
AfxMessageBox(szMsg);
pRasterIO->Release();
}
}


ReadFileCommentOffset Example for C++ 5.0 and later

/* The following sample will create a file with an offset and will read a comment from the file it just saved: */

ILEADRaster * pRaster;
ILEADRasterVariant * pRasterVar;

void TestReadFileCommentOffset(ILEADRasterIO * pRasterIO)
{
short nRet; /* Return value */

/* Load an existing bitmap */
nRet = pRasterIO->Load(pRaster, TEXT("eagle.cmp"), 0, 1, -1);
if (nRet != 0)
{
MessageBox(NULL, "Load has failed!", "FAILURE", MB_OK);
return;
}

pRasterVar->Type = VALUE_STRING;
pRasterVar->PutStringValue(TEXT("This is a 29-character string"));

/* set and save a comment into a file with an offset */
pRasterIO->put_Comment(CMNT_SZARTIST, pRasterVar);

/* Save the image file with an offset inside the TOFFSET.TST file */
nRet = pRasterIO->SaveOffset(pRaster, TEXT("eagle.cmp"), 30, FILE_TIF, 1, QFACTOR_LEAD_0, SAVE_OVERWRITE);

/* free the bitmap */
pRaster->Free();

/* Notify the user with a message box */
if (nRet != 0)
{
MessageBox(NULL, TEXT("Error saving file"), TEXT("Error"), MB_OK);
return;
}

/***** Now load the file we just saved ****/
/* Get the comment size */
nRet = pRasterIO->ReadFileCommentOffset(TEXT("eagle.cmp"),
30,
pRasterIO->FileSizeWritten,
CMNT_SZARTIST,
pRasterVar);

MessageBox(NULL, pRasterVar->GetStringValue(), "SUCCESS", MB_OK);
return;
}


ReadLoadResolutions Example for Visual C++ 5.0

ReadLoadResolutions Example for C++ 5.0 and later

This example shows how to use the methods and properties for FlashPix files.

ILEADRasterIO *pRasterIO=NULL;
CString TempStr, InfoStr; // For composing message strings
int LoadResolutionCount; // Number of resolutions available

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

// Initialize the display
m_LEADRasterView1.SetAutoScroll(FALSE);
m_LEADRasterView1.SetAutoSetRects(TRUE);
m_LEADRasterView1.SetPaintSizeMode(PAINTSIZEMODE_FIT);
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"v:\\images\\image5.fpx", 0, 0 );
// Update information about the available resolutions.
pRasterIO->ReadLoadResolutions("v:\\images\\image5.fpx");
// Update a local variable with the number of resolutions.
LoadResolutionCount = pRasterIO->GetLoadResolutionCount();
// Display a message box that shows the available sizes.
InfoStr = TEXT("Available dimensions:\n");
for(int i = 0; i < LoadResolutionCount; ++i)
{
TempStr.Format(TEXT("%d X %d\n"),
(int)pRasterIO->GetLoadResolutionWidth(i),
(int)pRasterIO->GetLoadResolutionHeight(i));
InfoStr += TempStr;
}
MessageBox( InfoStr, TEXT("File Information"));
// Set the size to load, the smallest size in this case.
pRasterIO->SetLoadResolution(m_LEADRasterView1.GetRaster(),
pRasterIO->GetInfoFormat(),
pRasterIO->GetLoadResolutionWidth(0),
pRasterIO->GetLoadResolutionHeight(0));
// Get the dimensions that we just set and display them.
pRasterIO->GetLoadResolution(pRasterIO->GetInfoFormat());
InfoStr = TEXT("Size that will be loaded:\n\n");
TempStr.Format(TEXT("%d X %d\n"),
(int)pRasterIO->GetLoadResolutionWidth(0),
(int)pRasterIO->GetLoadResolutionHeight(0));
InfoStr += TempStr;
MessageBox(InfoStr, TEXT("File Information"));
// Load the bitmap, keeping the bits per pixel of the file.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\image5.fpx", 0, 0, 1);
pRasterIO->Release();


ReadTagMemory example for C++ 5.0 and later

void CTestDlg::OnReadTagMemory()
{
int nRet;
long hMem;
long lSize;

ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
 IID_ILEADRasterVariant, (void **)&pltRasVar);

pltRasVar->Type = VALUE_STRING;
pltRasVar->StringValue
 = "My text string";

m_pRasterIO->SetTag(32768, TAG_ASCII, 0, pltRasVar);
nRet = m_pRasterIO->SaveMemory(m_LEADRasterView.GetRaster(),
 &hMem, FILE_TIF, m_LEADRasterView.GetRaster().GetBitmapBits(), QFACTOR_LEAD_0,
 0, &lSize);

nRet = m_pRasterIO->ReadTagMemory
 (hMem, 1, 32768, lSize);

GetAndDisplayTag(0);

pltRasVar->Release ();
}

void CTestDlg::GetAndDisplayTag(long lTag)
{
int uTagType = m_pRasterIO->GetTagType(lTag);
long lTagCount = m_pRasterIO->GetTagCount(lTag);
CString MsgString, Str1;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
 IID_ILEADRasterVariant, (void **)&pltRasVar);

pltRasVar = m_pRasterIO->GetTagData(lTag);

MsgString.Format(TEXT("Type = %d"), uTagType);

Str1.Format(TEXT("\r\nCount = %ld"), lTagCount);
MsgString += Str1;

if(uTagType == TAG_ASCII)
{
MsgString += TEXT("\r\nData =
 ");
MsgString += pltRasVar->StringValue;
}
else if(uTagType == TAG_RATIONAL || uTagType == TAG_SRATIONAL)
{
long *pData;
pData = (long*)GlobalAlloc(GHND,pltRasVar->ItemCount);

for(long i=0; i<lTagCount; i++)
{
pData[i] = pltRasVar->GetShortItemValue(i);
}

for(i = 0; i < lTagCount; i++)
{
Str1.Format(TEXT("\r\nData(%d)
 = %ld/%ld"), i, pData[i*2], pData[i*2+1]);
MsgString += Str1;
}

GlobalFree(pData);
}
else
{
long *pData;
pData = (long*)GlobalAlloc(GHND,pltRasVar->ItemCount);
for(long i=0; i<lTagCount; i++)
pData[i] = pltRasVar->GetShortItemValue(i);

for(i = 0; i < lTagCount; i++)
{
switch(uTagType)
{
case
 TAG_LONG:
Str1.Format(TEXT("\r\nData(%d)
 = %u"), i, ((unsigned long*)pData)[i]); break;
case
 TAG_SLONG:
Str1.Format(TEXT("\r\nData(%d)
 = %d"), i, ((signed long*)pData)[i]); break;
case
 TAG_SHORT:
Str1.Format(TEXT("\r\nData(%d)
 = %u"), i, (int)((unsigned short*)pData)[i]); break;
case
 TAG_SSHORT:
Str1.Format(TEXT("\r\nData(%d)
 = %d"), i, (int)((signed short*)pData)[i]); break;
case
 TAG_BYTE:
case
 TAG_UNDEFINED:
Str1.Format(TEXT("\r\nData(%d)
 = %u"), i, (int)((TCHAR *)pData)[i]); break;
case
 TAG_SBYTE:
Str1.Format(TEXT("\r\nData(%d)
 = %d"), i, (int)((TCHAR *)pData)[i]); break;
case
 TAG_FLOAT:
Str1.Format(TEXT("\r\nData(%d)
 = %f"), i, (double)((float*)pData)[i]); break;
case
 TAG_DOUBLE:
Str1.Format(TEXT("\r\nData(%d)
 = %f"), i, ((double*)pData)[i]); break;
}
MsgString += Str1;
}
GlobalFree(pData);
}
MessageBox(MsgString);
}


ReadyState Example for Visual C++ 5.0

ReadyState Example for C++ 5.0 and later

This example shows how to use the ReadyState property to test whether an asynchronous load is in progress.

NOTE: This is not a complete example for handing events, some steps have been omitted. For a complete example of how to handle events, refer to the example Updating a Gauge and Detecting a User Interrupt.

if (m_pRasterIO->GetReadyState() == READYSTATE_LOADING)
MessageBox (TEXT("Still loading the image"), TEXT("Notice"), MB_OK);


RefBitmap example for Visual C++ 5.0

RefBitmap example for C++ 5.0 and later

void CDemoView::OnRefbitmap()
{
//This example demonstrates the RefBitmap property
//Assume that m_RasterView is a LEADRasterView OCX
ILEADRaster *pRaster;
HRESULT hr;
TCHAR szMsg[100];

hr = CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pRaster);

ILEADRasterIO *pRasterIO;
hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO);

//Load an image into MyRaster object
pRasterIO->Load (pRaster, "d:\\work\\images\\rgbw.bmp", 0, 0, 1);
wsprintf(szMsg, TEXT("pRaster->Bitmap should be non-zero: %x"), pRaster->Bitmap);
AfxMessageBox(szMsg);

//Have the LEADRasterView1 control "steal" the MyRaster bitmap
m_RasterView.GetRaster().SetRefBitmap(TRUE);
m_RasterView.GetRaster().SetBitmap(pRaster->Bitmap);

//The MyRaster Bitmap has been invalidated
wsprintf(szMsg, TEXT("pRaster->Bitmap should be zero: %x"), pRaster->Bitmap);
AfxMessageBox(szMsg);

pRaster->Release();
pRasterIO->Release();
}


RefBitmapList example for Visual C++ 5.0

RefBitmapList example for C++ 5.0 and later

// tell m_Lead1 to "steal" the bitmap list from m_Lead2
m_LEADRasterView1.GetRaster().SetRefBitmapList(TRUE);
// move the bitmap list from m_Lead2 to m_Lead1
m_LEADRasterView1.GetRaster().SetBitmapList(m_LEADRasterView2.GetRaster().GetBitmapList());
// restore the default value for RefBitmapList
m_LEADRasterView1.GetRaster().SetRefBitmapList(FALSE);
// for safety, let m_Lead2 know that its list has been emptied
m_LEADRasterView2.GetRaster().SetBitmapList(NULL);


RemapHue example for Visual C++ 5.0

RemapHue example for C++ 5.0 and later

//This example changes all green hues(and hues near green) to the hue of crNewColor

#define INCREMENT(x) ((x+1)%256)
#define DECREMENT(x) ((x+255)%256)
#define ADD(x,y) ((x+y)%256)

void CRemapHueDlg::OnRemapHue()
{
int i;
int nHueGreen;
int nHueNewColor;
int nHueChange;
OLE_COLOR crNewColor;
int iCount;
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
if((m_RasterView.GetRaster ().GetBitmapBits () == 16 && m_RasterView.GetRaster().GetIsGrayscale())
|| m_RasterView.GetRaster().GetBitmapBits() == 64 || m_RasterView.GetRaster().GetBitmapBits() == 48)
pRasterProc->RemapHueTablesSize = 65536;
else if(m_RasterView.GetRaster().GetBitmapBits() == 12)
pRasterProc->RemapHueTablesSize= 4096;
else
pRasterProc->RemapHueTablesSize = 256;
for (i=0; i< pRasterProc->RemapHueTablesSize; i++)
{
pRasterProc->PutMaskTable (i,0);
pRasterProc->PutHTable (i,i);
}

//Get the hue for green
nHueGreen = pRasterProc->HSV_HfromRGB(RGB(0, 255, 0));

//Obtain new hue (crNewColor can be any color)
crNewColor = RGB(255, 255, 0);
nHueNewColor = pRasterProc->HSV_HfromRGB (crNewColor);
nHueChange = nHueNewColor - nHueGreen;

if (nHueChange < 0)
nHueChange = nHueChange + 256;

//Set values in uHueTable, uMaskTable
pRasterProc->PutHTable(nHueGreen, ADD(pRasterProc->GetHTable(nHueGreen), nHueChange) );
pRasterProc->PutMaskTable(nHueGreen, 1);

//set the hues near green (+/- 10)
iCount = 0;
i = INCREMENT(nHueGreen);
while (iCount < 10)
{
pRasterProc->PutHTable(i, ADD(pRasterProc->GetHTable(i), nHueChange) );
pRasterProc->PutMaskTable(i, 1);
i = INCREMENT(i);
iCount++;
}
iCount = 0;
i = DECREMENT(nHueGreen);
while (iCount < 10)
{
pRasterProc->PutHTable(i, ADD(pRasterProc->GetHTable(i), nHueChange));
pRasterProc->PutMaskTable(i, 1);
i = DECREMENT(i);
iCount = iCount + 1;
}
pRasterProc->RemapHue (m_RasterView.GetRaster(), TRUE, TRUE, FALSE, FALSE);
pRasterProc->Release();
}
}


RemapTableSize example for Visual C++ 5.0

RemapTableSize example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

if((m_RasterView1.GetRaster ().GetBitmapBits () == 16 && m_RasterView1.GetRaster().GetIsGrayscale())
|| m_RasterView1.GetRaster().GetBitmapBits () == 64 || m_RasterView1.GetRaster().GetBitmapBits () == 48)
pRasterProc->RemapTableSize = 65536;
else if(m_RasterView1.GetRaster().GetBitmapBits() == 12)
pRasterProc->RemapTableSize= 4096;
else
pRasterProc->RemapTableSize = 256;

pRasterProc->Release();

pRasterProc->Release();


Remove example for Visual C++ 5.0

Remove example for C++ 5.0 and later

//remove the 2nd item from the ImageList Control
m_LEADImageList.Remove(1);


RemoveRedeye example for Visual C++

RemoveRedeye example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

m_RasterView1.GetRaster ().SetRgnEllipse (80, 55, 35, 30, L_RGN_SET);
pRasterProc->RemoveRedeye (m_RasterView1. GetRaster (), RGB(5, 20, 10), 125, 100);

pRasterProc->Release();


RenderCenter example for Visual C++

HDC hdcPrinter;

PRINTDLG printdlg;

DOCINFO docinfo;

// get and prepare the printer DC

memset( &printdlg, 0, sizeof(printdlg) );

printdlg.lStructSize = sizeof(printdlg);

printdlg.Flags = PD_RETURNDC;

if( !PrintDlg(&printdlg) )

return;

if( (hdcPrinter = printdlg.hDC) == NULL )

{

if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);

if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);

return;

}

docinfo.cbSize = sizeof(docinfo);

docinfo.lpszDocName = "Print example using LEADTOOLS.";

docinfo.lpszOutput = NULL;

docinfo.fwType = 0L;

if( StartDoc(hdcPrinter, &docinfo) <= 0)

{

if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);

if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);

DeleteDC(hdcPrinter);

}

StartPage(hdcPrinter);

// print the image

TextOut( hdcPrinter, 0, 0, "Center the image on the page", strlen("Center the image on the page"));

m_LEADRasterView1.SetRenderCenter(TRUE);

m_LEADRasterView1.Render((long)hdcPrinter, 0, 0, m_LEADRasterView1.GetRaster().GetBitmapWidth(), m_LEADRasterView1.GetRaster().GetBitmapHeight());

//Finish the page and finish the print job

EndPage( hdcPrinter );

EndDoc( hdcPrinter );

//clean up

if( printdlg.hDevMode ) GlobalFree(printdlg.hDevMode);

if( printdlg.hDevNames) GlobalFree(printdlg.hDevNames);

DeleteDC(hdcPrinter);


Resize (ILEADRasterImgList) example for Visual C++ 5.0

Resize (ILEADRasterImgList) example for C++ 5.0 and later

void CBrowseDlg::OnResizeLeadimglistctrl1()
{
this->SetWindowText(TEXT("Control Resized"));
}


Resize event example for Visual C++ 5.0

Resize event example for C++ 5.0 and later

1. | Add a Static Text control as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the tutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_TUTOR_DIALOG to design the dialog box.
 | e. | Click the Static Text control; then click and drag its shape in the dialog box.
 | f. | Double-click the new control to edit its properties.
 | g. | Change the ID to IDC_TEXT1.
 | h. | Press Ctrl-F4 to close all windows back to the Project Workspace.
2. | Do the following to add m_Text1 to the CTutorDlg class and link the variable to the Static Text control using dynamic data exchange:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_TEXT1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_Text1 as the variable name, Control as the category, and Cstatic as the variable type.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
3. | Add a Command button to your project, and code its click procedure to resize the control using the MoveWindow function:

m_LEADRasterView1.MoveWindow(0,0,100,100,TRUE);

4.

Edit the OnResizeLead1 procedure as follows:

void CTutorDlg::OnResizeLeadrasterview1()
{
TCHAR szText[128];
CRect rcWindow;
if (m_LEADRasterView1.m_hWnd)
{
m_LEADRasterView1.GetWindowRect(rcWindow);
wsprintf(szText, TEXT("Control size: %u, %u"), rcWindow.Width(), rcWindow.Height());
m_Text1.SetWindowText(szText);
m_Text1.UpdateWindow();
}
}


ResizeRgn example for Visual C++

m_RasterView1.SetRgnFrameType (RGNFRAME_ANIMATED);
m_RasterView1.GetRaster ().SetRgnRect (40, 60, 280, 200, L_RGN_SET);
AfxMessageBox(TEXT("About to resize"));
m_RasterView1.GetRaster().ResizeRgn (20, RGN_CONTRACT, FALSE);


RevEffect example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->RevEffect(m_LeadRasterView.GetRaster(), 3, 37);
m_pRasterProc->Release();


RGBfromHSV example for Visual C++ 5.0

RGBfromHSV example for C++ 5.0 and later

//Takes an HSV, displays the HSV components, and displays the RGB components
void CRemapHueDlg::HSVtoRGB(int nH, int nS, int nV)
{
OLE_COLOR cr;
int nRed, nGreen, nBlue;
CString strMsg;

ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
cr = pRasterProc->RGBfromHSV (nH, nS, nV);
nRed = GetRValue(cr);
nGreen = GetGValue(cr);
nBlue = GetBValue(cr);
strMsg.Format(TEXT("HSV(%d,%d,%d) is RGB(%d,%d,%d)"), nH, nS, nV, nRed, nGreen, nBlue);
MessageBox(strMsg);
pRasterProc->Release();
}
}


RgnChange example for Visual C++ 5.0

RgnChange example for C++ 5.0 and later

This code for the RgnChange event updates a static text control using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

The first two steps describe how to add a static text control. The last step shows the sample code.

1. | Add a Static Text control as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the tutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_TUTOR_DIALOG to design the dialog box.
 | e. | Click the Static Text control; then click and drag its shape in the dialog box.
 | f. | Right-click the new control to edit its properties.
 | g. | Change the ID to IDC_TEXT1.
 | h. | Press Ctrl-F4 to close all windows back to the Project Workspace.
2. | Do the following to add m_Text1 to the CTutorDlg class and link the variable to the Static Text control using dynamic data exchange:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_TEXT1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_Text1 as the variable name, Control as the category, and Cstatic as the variable type.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
3. | Use the MFC ClassWizard to add the RgnChange event, and code it as follows:

void CTutorDlg::OnRgnChangeLeadrasterview1()
{
TCHAR szText[128];
CRect rcWindow;
m_LEADRasterView1.GetWindowRect(rcWindow);
wsprintf(szText,
TEXT("Number of pixels in region: %u "),
m_LEADRasterView1.GetRaster().GetRgnArea());
m_Text1.SetWindowText(szText);
m_Text1.UpdateWindow();
}


RgnFrameColor example for Visual C++ 5.0

RgnFrameColor example for C++ 5.0 and later

m_LEADRasterView1.SetRgnFrameColor(RGB(0, 0, 255));
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
m_LEADRasterView1.GetRaster().SetRgnRect(10.0f, 10.0f, 200.0f, 200.0f, L_RGN_SET);


RingEffect Example for C++ 5.0 and later

int iXorg,iYorg,iRadius;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iXorg = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
iYorg = m_LeadRasterView.GetRaster().GetBitmapHeight () / 2;
iRadius = iXorg;

m_pRasterProc->RingEffect(m_LeadRasterView.GetRaster(), iXorg, iYorg,
iRadius, 10, 0,
RGB(0, 0, 0), 100,
RING_COLOR |
RING_FIXEDANGLE |
RING_MAXRADIUS);
m_pRasterProc->Release();


Ripple Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster().GetBitmapWidth()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight()/2;
m_pRasterProc->Ripple(m_LeadRasterView.GetRaster(), 20, 10,0,0 ,CenterX,CenterY, RGB(0,0,0),FILL_RPT);
m_pRasterProc->Release();


ROIMean example for Visual C++ 5.0

ROIMean example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
CString strOut;

m_pRasterProc->GetOverlayAttributes(m_LeadRasterView.GetRaster(),0,OVERLAYATTRIBUTES_FLAGS);
strOut.Format("ROIMean = %d \n"
"ROIArea = %d\n"
"ROIStandardDeviation = %f",
m_pRasterProc->OverlayAttributes->ROIMean,
m_pRasterProc->OverlayAttributes->ROIArea,
m_pRasterProc->OverlayAttributes->ROIStandardDeviation
);

MessageBox(strOut);
m_pRasterProc->Release();


RomanMosaic example for Visual C++

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->RomanMosaic(m_LeadRasterView.GetRaster(), 15, 15, 5, SHADOW_E, 0, RGB(0,0,0), RMN_RECT | RMN_SHADOWGRAY);
m_pRasterProc->Release();


Rotate example for Visual C++ 5.0

Rotate example for C++ 5.0 and later

This example rotates the bitmap 45 degrees and redisplays the image. It resizes the bitmap to accommodate the rotation and uses blue as the fill color.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Rotate(m_LEADRasterView1.GetRaster(),
4500, ROTATE_RESIZE, RGB(0, 0, 255));
m_LEADRasterView1.SetAutoSetRects(TRUE); // Make sure the display rectangles are adjusted
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


RowCount example for Visual C++ 5.0

RowCount example for C++ 5.0 and later

long LinesPerPage,IMGLST_SCROLLSTYLE_VERTICAL;
CString s;
if(m_LEADImageList.GetScrollStyle() == IMGLST_SCROLLSTYLE_VERTICAL)
LinesPerPage = m_LEADImageList.GetRowCount() / m_LEADImageList.GetPageCount();
else
LinesPerPage = m_LEADImageList.GetColumnCount() / m_LEADImageList.GetPageCount();
s.Format(TEXT("LinesPerPage = %d"), LinesPerPage);

AfxMessageBox(s);


Rows example for Visual C++ 5.0

Rows example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
CString strOut;

m_pRasterProc->GetOverlayAttributes(m_LeadRasterView.GetRaster(),0,OVERLAYATTRIBUTES_FLAGS);
strOut.Format("Rows = %d\n"
"Columns = %d",
m_pRasterProc->OverlayAttributes->Rows,
m_pRasterProc->OverlayAttributes->Columns);

MessageBox(strOut);
m_pRasterProc->Release();


RTFPaperHeight Example for C++ 5.0 and later

/* This example loads a RTF file, with a custom top margin, bottom margin, left margin, right margin, Paper width, and Paper height */
void CDemoView::OnLoadRtf()
{
ILEADRasterIO *m_pRasterIO = NULL;
CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);

m_pRasterIO->RTFTopMarg = 0.9;
m_pRasterIO->RTFBottomMarg= 0.9;
m_pRasterIO->RTFLeftMarg= 1.3;
m_pRasterIO->RTFRightMarg= 1.3;

m_pRasterIO->RTFPaperWidth= 8.25;
m_pRasterIO->RTFPaperHeight= 11.5;

/* Now load the RTF file */
m_pRasterIO->Load(m_LeadRasterView.GetRaster(), "c:\\image1.rtf", 0, 1, 1 );

m_pRasterIO->Release();
}


SampleTarget Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->SampleTarget(m_LeadRasterView.GetRaster (), RGB(50, 100, 150), RGB(60, 90 , 150), SAMP_RED| SAMP_MID);
m_pRasterProc->Release();


Saturation example for Visual C++ 5.0

Saturation example for C++ 5.0 and later

This example increases the saturation of colors in the bitmap and redisplays the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Saturation(m_LEADRasterView1.GetRaster(), 1000);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Save (ILEADRasterMrc) example for Visual C++ 5.0

Save (ILEADRasterMrc) example for C++ 5.0 and later

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


Save example for Visual C++ 5.0

Save example for C++ 5.0 and later

This example saves the image as a BMP file, loads the new file, and redisplays the bitmap.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
BeginWaitCursor();
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.bmp", FILE_BMP,
8, (QFactorConstants)1, SAVE_OVERWRITE);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.bmp", 0, 0, 1);
m_LEADRasterView1.ForceRepaint();
pRasterIO->Release();
EndWaitCursor();


SaveArray example for Visual C++ 5.0

SaveArray example for C++ 5.0 and later

long lSize;
HFILE hFile;
void HUGEP* pData=NULL;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\chess.bmp", 0, 1, 1);

pltRasVar = pRasterIO->SaveArray(m_LEADRasterView1.GetRaster(),
FILE_BMP, 0, (QFactorConstants)0);
_tcreat(TEXT("c:\\temp\\test.bmp"), 0);
hFile = _tfopen(TEXT("c:\\temp\\test.bmp"), OF_READWRITE);

lSize = pltRasVar->ItemCount;
pData = GlobalAlloc(GHND,lSize);
_lwrite(hFile, (LPCSTR)pData, lSize);
_lclose(hFile);

//get some info on the memory array
pRasterIO->GetArrayInfo(m_LEADRasterView1.GetRaster(), pltRasVar, 1, lSize);
CString cs;
cs.Format(TEXT("Format = %d"), pRasterIO->GetInfoFormat());
AfxMessageBox(cs);
pRasterIO->Release();
pltRasVar->Release ();
GlobalFree(pData);


SaveBuffer example for Visual C++ 5.0

SaveBuffer example for C++ 5.0 and later

//This sample loads the file 'szFileName', and saves it to memory buffer allocated by the user
//The original memory buffer is 1 bytes, which is too small to accommodate the image
//The SaveBuffer callback gets called as necessary, allowing the user to reallocate the memory buffer as needed
//When the image is completely saved in memory, it is loaded into a second LEAD control

//The following are public class members
//HANDLE m_lHeap;
//LPVOID m_lHeapAddress;

void CTutorDlg::SampleLoadSaveBuffer(LPTSTR szFileName)
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

DWORD dwCookie;
CRasterIOSink *pRasterIOSink;
//Instantiate the sink class and hold a pointer to it.
pRasterIOSink = new CRasterIOSink;
pRasterIOSink->m_pDlg = this;
pRasterIOSink->m_pRasterIO = pRasterIO;
//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = pRasterIOSink->GetIDispatch (FALSE);
AfxConnectionAdvise(pRasterIO, DIID__LEADRasterIOEvents, pUnkSink, FALSE, &dwCookie);

long lHeapInitialSize, lMemInitialSize;
short nRet;

//Create the heap
m_lHeap = 0;
lHeapInitialSize = 1000;
m_lHeap = HeapCreate(0, lHeapInitialSize, 0);

//Allocate the first chunk of memory to be 100 bytes
m_lHeapAddress = 0;
lMemInitialSize = 1;
m_lHeapAddress = HeapAlloc(m_lHeap, 0, lMemInitialSize);

pRasterIO->Load (m_RasterView1.GetRaster (), szFileName, 0, 0, 1);
pRasterIO->SaveBufferSize= lMemInitialSize;
pRasterIO->SaveBufferAddress= long(m_lHeapAddress);
pRasterIO->EnableSaveBufferEvent= TRUE;
nRet = pRasterIO->SaveBuffer(m_RasterView1.GetRaster(), FILE_TIF, 24, QFACTOR_LEAD_0, SAVE_OVERWRITE);
if (nRet != 0)
{
CString strMsg;
strMsg.Format(TEXT("SaveBuffer Error: %d"), nRet);
AfxMessageBox(strMsg);
}

//Load the file in memory into a second LEAD Raster object
nRet = pRasterIO->LoadBuffer(m_RasterView2.GetRaster(), pRasterIO->SaveBufferAddress, 24, 0, 1, pRasterIO->SaveBufferSize);

//Free the allocated memory
HeapFree(m_lHeap, 0, m_lHeapAddress);

//Destroy the heap
HeapDestroy(m_lHeap);

//Terminate a connection between source and sink.
pUnkSink = pRasterIOSink->GetIDispatch (FALSE);
AfxConnectionUnadvise(pRasterIO, DIID__LEADRasterIOEvents, pUnkSink, FALSE, dwCookie);
delete pRasterIOSink;
pRasterIOSink = NULL;

pRasterIO->Release();
}

void CRasterIOSink::OnSaveBuffer( long uRequiredSize )
{
//The SaveBuffer event allows the user to reallocate the buffer as needed
m_pDlg->m_lHeapAddress = HeapReAlloc(m_pDlg->m_lHeap, 0, m_pDlg->m_lHeapAddress, uRequiredSize);
if(!m_pDlg->m_lHeapAddress)
{
AfxMessageBox(TEXT("HeapReAlloc Error"));
m_pRasterIO->EnableSaveBufferEvent= FALSE;
}
else
{
m_pRasterIO->SaveBufferSize = uRequiredSize;
m_pRasterIO->SaveBufferAddress = long(m_pDlg->m_lHeapAddress);
}
}


SaveICCProfile Example for Visual C++ 5.0 and later

ILEADRasterIO *pRasterIO = NULL;
ILEADRasterVariant *pData = NULL;
int nRet;

CoCreateInstance(CLSID_LEADRasterVariant,NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pData);
CoCreateInstance(CLSID_LEADRasterIO,NULL, CLSCTX_ALL, IID_ILEADRasterIO,(void**)&pRasterIO);

nRet = pRasterIO->LoadICCProfile (TEXT("c:\\dst_rgb_image.tif"), pData, 1);
nRet = pRasterIO->SaveICCProfile (TEXT("c:\\image.tif"), pData, 1);

pRasterIO->Release();
pData->Release();


SaveICCProfile2 Example for Visual C++ 5.0 and later

ILEADRasterIO *pRasterIO = NULL;
VARIANT Data;
int nRet;
long uBound;

CoCreateInstance(CLSID_LEADRasterIO,NULL, CLSCTX_ALL, IID_ILEADRasterIO,(void**)&pRasterIO);

VariantInit(&Data);

nRet = pRasterIO->LoadICCProfile2 (TEXT("c:\\dst_rgb_image.tif"), &Data, 1);
nRet = pRasterIO->SaveICCProfile2 (TEXT("c:\\image.tif "), &Data, 1);

VariantClear(&Data);
pRasterIO->Release();


SaveIFD example for Visual C++ 5.0

SaveIFD example for C++ 5.0 and later

// This example will add 100 pages to a file faster by continuously using the IFD of the last page
int nPage;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Save page 1, to make sure the file exists
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\test.tif", FILE_TIF,
0, (QFactorConstants)0, SAVE_APPEND);
for(nPage = 2; nPage <= 100; nPage++)
{
// get the IFD of the last page
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"d:\\temp\\test.tif", 100000, 0);
pRasterIO->PutSaveIFD(pRasterIO->GetInfoIFD());
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\test.tif", FILE_TIF,
0, (QFactorConstants)0, SAVE_APPEND);
}
// reset the SaveIFD property so the other Save calls will work properly
pRasterIO->PutSaveIFD(0);
pRasterIO->Release();


SaveInterlaced example for Visual C++ 5.0

SaveInterlaced example for C++ 5.0 and later

This example saves the current image as an interlaced GIF file, then loads the saved image with a paint-while-load effect that shows the interlaced behavior.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
//Save the current image as an interlaced GIF file.
pRasterIO->PutSaveInterlaced(TRUE);
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.gif", FILE_GIF,
8, (QFactorConstants)1, SAVE_OVERWRITE);
//Clear the bitmap so that we can see the paint-while-load effect.
m_LEADRasterView1.GetRaster().SetBitmap(0);
//Paint the image while loading, showing that it is interlaced.
m_LEADRasterView1.SetPaintWhileLoad(TRUE);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\temp\\tmp.gif", 0, 0, 1);
pRasterIO->Release();


SaveLayers example for Visual C++ 5.0

SaveLayers example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

ILEADRaster *pRaster2=NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

// Save all the extra bitmaps in the bitmap list as layers
pRasterIO->SaveLayers= TRUE;
for(int i=1 ; i<m_RasterView1.GetRaster ().GetBitmapListCount(); ++i)
{
// reset the layer info so all the layers are saved from 0,0 offset
pRasterIO->PutLayerLeft(m_RasterView1.GetRaster(), i, 0);
pRasterIO->PutLayerTop(m_RasterView1.GetRaster(), i, 0);
pRasterIO->PutLayerBlendModeKey(m_RasterView1.GetRaster(), i, "dark");
pRasterIO->PutLayerClipping(m_RasterView1.GetRaster(), i, 0);
pRasterIO->PutLayerOpacity(m_RasterView1.GetRaster(), i, 40);

pRaster2->Bitmap = 0;
pRasterIO->SetLayerMaskBitmap(m_RasterView1.GetRaster(), pRaster2, i);
}
// set the active bitmap to be the first in the list
pRasterIO->Save(m_RasterView1.GetRaster (), "c:\\temp\\layers.psd", FILE_PSD, 0, QFACTOR_LEAD_0, SAVE_OVERWRITE);

pRaster2->Release();
pRasterIO->Release();


SaveList example for Visual C++

void CSegDemoApp::OnFileSaveMulti()
{
int nRet =0;
ILEADRasterMrc * pRasterMrc1 = NULL;
ILEADRasterMrc * pRasterMrc2 = NULL;
ILEADRasterIO * pRasterIO = NULL;
ILEADRaster *pRaster =NULL;
ILEADRaster *pRasterList =NULL;

CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRasterList);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrc1);
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrc2);

pRasterIO->Load(pRaster, TEXT("c:\\1.jpg"), 0, 0, 1);
nRet = pRasterMrc1->AutoSegmentExt(pRaster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND | SGM_FAVOR_TWOBIT);
pRasterList->InsertBitmapListItem(-1, pRaster->Bitmap);

pRasterIO->Load (pRaster, TEXT("c:\\2.jpg"), 0, 0, 1);
nRet = pRasterMrc2->AutoSegmentExt(pRaster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND | SGM_FAVOR_TWOBIT);
pRasterList->InsertBitmapListItem (-1, pRaster->Bitmap);

pRasterIO->PutMRCRasterCount(2);
pRasterIO->PutMRCRaster(0, pRasterMrc1);
pRasterIO->PutMRCRaster(1, pRasterMrc2);

pRasterIO->PutMaskCoder(MRC_MASK_COMPRESSION_FAX_G3_1D);
pRasterIO->PutPictureCoder(MRC_PICTURE_COMPRESSION_JPEG);
pRasterIO->PutPictureQFactor(10);
pRasterIO->PutGrayscale8BitCoder(MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT);
pRasterIO->PutGrayscale8BitQFactor(2);
pRasterIO->PutGrayscale2BitCoder(MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT);
pRasterIO->PutText2BitCoder(MRC_TEXT_COMPRESSION_JBIG_2BIT);

nRet = pRasterIO->SaveList(pRasterList, TEXT("c:\\Multi.tif"), FILE_TIF_MRC);

if(pRasterMrc1)
{
pRasterMrc1->Release();
}
if(pRasterMrc2)
{
pRasterMrc2->Release();
}
if(pRasterIO)
{
pRasterIO->Release();
}
if(pRaster)
{
pRaster->Release();
}
if(pRasterList)
{
pRasterList->Release();
}
}


SaveLSB example for Visual C++ 5.0

SaveLSB example for C++ 5.0 and later

// This example saves a bitmap compatible with the requirements
// of the TIFF Class F format
// make sure we are using pixels
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView1.SetScaleMode(3);
pRasterIO->PutSaveLSB(TRUE);
pRasterIO->PutSavePageNumberTag(TRUE);
m_LEADRasterView1.GetRaster().SetBitmapXRes(204);
m_LEADRasterView1.GetRaster().SetBitmapYRes(196);
// scale the bitmap (preserving the aspect ratio) to have
// a width of 1728 pixels
pRasterProc->Size(m_LEADRasterView1.GetRaster(),
1728.0f,
m_LEADRasterView1.GetRaster().GetBitmapHeight() * 1728
/ m_LEADRasterView1.GetRaster().GetBitmapWidth(),
(ResizeConstants)0);
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\lsb.tif",
FILE_CCITT_GROUP3_1DIM,
1, (QFactorConstants)0, SAVE_OVERWRITE);
pRasterIO->Release();
pRasterProc->Release();


SaveMemory example for Visual C++ 5.0

SaveMemory example for C++ 5.0 and later

This example uses SaveMemory to save a bitmap to a memory-resident file, uses GetMemoryInfo to examine the file size; then uses WIN32 API calls to save the file to disk and free the memory.

void CTutorDlg::OnSaveMemory()
{
long hMem;
long iSize;
LPSTR lpMem;
HFILE hf;
TCHAR szText[256];
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

if(pRasterIO->SaveMemory(m_LEADRasterView1.GetRaster(),
&hMem, FILE_CMP, 24,
(QFactorConstants)-1,
SAVE_OVERWRITE, &iSize ))
{
MessageBox(TEXT("Error calling SaveMemory"));
return;
}
if(pRasterIO->GetMemoryInfo(m_LEADRasterView1.GetRaster(),
hMem, 0, iSize))
{
GlobalFree((HGLOBAL)hMem);
MessageBox(TEXT("Error calling GetMemoryInfo"));
return;
}
/* Ask for a confirmation to save this file */
wsprintf(szText,
TEXT("File info: \r %u x %u x %u BPP \rSize in memory: %lu \rSize on disk %lu"),
(unsigned int)pRasterIO->GetInfoWidth(),
(unsigned int)pRasterIO->GetInfoHeight(),
(unsigned int)pRasterIO->GetInfoBits(),
(unsigned long)pRasterIO->GetInfoSizeMem(),
(unsigned long)pRasterIO->GetInfoSizeDisk());
if( MessageBox(szText, TEXT("Write this file on disk ?"), MB_YESNO) != IDYES )
{
GlobalFree((HGLOBAL)hMem);
return;
}
if( (lpMem = (LPTSTR)GlobalLock((HGLOBAL)hMem)) == NULL )
{
GlobalFree((HGLOBAL)hMem);
MessageBox(TEXT("Error calling GlobalLock"));
return;
}

#ifdef UNICODE

hf = _wopen (TEXT("d:\\temp\\savemem.cmp"), OF_CREATE);

#else

hf = _lopen ("d:\\temp\\savemem.cmp", OF_CREATE);

#endif
if( hf == 0 )
{
GlobalUnlock((HGLOBAL)hMem);
GlobalFree((HGLOBAL)hMem);
MessageBox(TEXT("Error calling GlobalLock"));
return;
}
if( _lwrite( hf, lpMem, iSize ) != (UINT)iSize )
MessageBox(TEXT("Error calling GlobalLock"));
else
MessageBox(TEXT("savemem.cmp was saved successfully on disk."));
_lclose( hf );
GlobalUnlock((HGLOBAL)hMem);
GlobalFree((HGLOBAL)hMem);
pRasterIO->Release();
}


SaveMemory2 example for Visual C++ 5.0

SaveMemory2 example for C++ 5.0 and later

void CSaveMemory2Dlg::OnSave()
{
LPSTR lpMem;
HFILE hf;
TCHAR szText[256];
OFSTRUCT OF;

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

if(pRasterIO->SaveMemory2(m_LEADRasterView1.GetRaster(),
FILE_BMP, 4,
(QFactorConstants)0,
SAVE_REPLACE))
{
MessageBox(TEXT("Error calling SaveMemory"));
return;
}
if(pRasterIO->GetMemoryInfo(m_LEADRasterView1.GetRaster(),
pRasterIO->GetSaveMemory2Handle(), 0, pRasterIO->GetSaveMemory2Size()))
{
pRasterIO->PutSaveMemory2Handle(0);
MessageBox(TEXT("Error calling GetMemoryInfo"));
return;
}
/* Ask for a confirmation to save this file */
wsprintf(szText,
TEXT("File info: \r %u x %u x %u BPP \rSize in memory: %lu \rSize on disk %lu"),
(unsigned int)pRasterIO->GetInfoWidth(),
(unsigned int)pRasterIO->GetInfoHeight(),
(unsigned int)pRasterIO->GetInfoBits(),
(unsigned long)pRasterIO->GetInfoSizeMem(),
(unsigned long)pRasterIO->GetInfoSizeDisk());
if( MessageBox(szText, TEXT("Write this file on disk ?"), MB_YESNO) != IDYES )
{
pRasterIO->PutSaveMemory2Handle(0);
return;
}

lpMem = (char*)GlobalLock((HGLOBAL)pRasterIO->GetSaveMemory2Handle());
if( lpMem == NULL )
{
pRasterIO->PutSaveMemory2Handle(0);
MessageBox(TEXT("Error calling GlobalLock"));
return;
}

#ifdef UNICODE
hf = OpenFile(TEXT("c:\\savemem.bmp"),&OF, OF_CREATE);
#else
hf = OpenFile ("c:\\savemem.bmp", &OF,OF_CREATE);
#endif

if( hf == -1 )
{
GlobalUnlock((HGLOBAL)pRasterIO->GetSaveMemory2Handle());
pRasterIO->PutSaveMemory2Handle(0);
MessageBox(TEXT("Error calling GlobalLock"));
return;
}
if( _lwrite( hf, lpMem, pRasterIO->GetSaveMemory2Size()) != (UINT)pRasterIO->GetSaveMemory2Size())
MessageBox(TEXT("Error calling GlobalLock"));
else
MessageBox(TEXT("savemem.cmp was saved successfully on disk."));
_lclose( hf );
GlobalUnlock((HGLOBAL)pRasterIO->GetSaveMemory2Handle());
pRasterIO->PutSaveMemory2Handle(0);
pRasterIO->Release();
}


SaveNoPalette example for Visual C++ 5.0

SaveNoPalette example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterProc->Grayscale(m_RasterView1.GetRaster (), 8);
pRasterIO->SaveNoPalette = TRUE;
pRasterIO->Save(m_RasterView1.GetRaster(), "d:\\temp\\testnopal.tif", FILE_TIF, 0, QFACTOR_LEAD_0, 0);
pRasterIO->SaveNoPalette= FALSE;
pRasterIO->Save(m_RasterView1.GetRaster(), "d:\\temp\\testpal.tif", FILE_TIF, 0, QFACTOR_LEAD_0, 0);

pRasterProc->Release();
pRasterIO->Release();


SavePage example for Visual C++ 5.0

SavePage example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// replace page 1 from TEST.TIF
pRasterIO->PutSavePage(1);
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
"d:\\temp\\TEST.TIF", FILE_TIF,
8, (QFactorConstants)0, SAVE_REPLACE);
pRasterIO->Release();


SaveResolutionCount example for Visual C++ 5.0

SaveResolutionCount example for C++ 5.0 and later

int i;
CString csOut;
CString cstmp;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

// assume that our bitmap is 800 x 600
// save 3 resolutions
pRasterIO->PutSaveResolutionCount(3);

pRasterIO->PutSaveResolutionWidth(0,800.0f);
pRasterIO->PutSaveResolutionHeight(0,600.0f);
pRasterIO->PutSaveResolutionWidth(1,400.0f);
pRasterIO->PutSaveResolutionHeight(1,300.0f);
pRasterIO->PutSaveResolutionWidth(2,200.0f);
pRasterIO->PutSaveResolutionHeight(2,150.0f);

// get the SaveResolution info

csOut.Format(TEXT("SaveResolutionCount = %d"),
pRasterIO->GetSaveResolutionCount());
AfxMessageBox(csOut);

csOut.Empty();
for( i = 0; i<pRasterIO->GetSaveResolutionCount(); i++ )
{
cstmp.Format(TEXT("SaveResolution(%d) = %.2f x %.2f\n"),
i,
pRasterIO->GetSaveResolutionWidth(i),
pRasterIO->GetSaveResolutionHeight(i));
csOut = csOut + cstmp;
}
AfxMessageBox(csOut);
pRasterIO->Release();


SaveTileWidth example for Visual C++ 5.0

SaveTileWidth example for C++ 5.0 and later

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// save TIF files with a tile size of 512x512
m_RasterView1.GetRaster ().SetScaleMode(SCALEMODE_PIXEL); // use pixels for the tile size
pRasterIO->SaveTileWidth= 512;
pRasterIO->SaveTileHeight= 512;
pRasterIO->Save(m_RasterView1.GetRaster(), "c:\\temp\\tiled.tif", FILE_CCITT_GROUP4, 0, QFACTOR_LEAD_0, SAVE_OVERWRITE);

pRasterIO->Release();


SaveToFile example for Visual C++ 5.0

SaveToFile example for C++ 5.0 and later

int i;
// select 2nd to 4th items
for(i=1; i<=3; ++i)
m_LEADImageList.Item (i).SetSelected(TRUE);

DeleteFile(TEXT("d:\\temp\\testing.tif"));

//save all selected items to a multipage file
m_LEADImageList.SaveToFile("d:\\temp\\testing.tif", FILE_TIF_CMP, 0, QFACTOR_QS, TRUE);

AfxMessageBox(TEXT("about to reload file"));
//clear list
m_LEADImageList.Clear();
//reload file
m_LEADImageList.LoadFromFile("d:\\temp\\testing.tif", 0, 1, -1);


SaveWithStamp example for Visual C++ 5.0

SaveWithStamp example for C++ 5.0 and later

This example saves the image in a JPEG file that includes a thumbnail (stamp) image. It then loads the thumbnail from the new file.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
int SavedMode = m_LEADRasterView1.GetScaleMode();
m_LEADRasterView1.SetScaleMode(3); // Use pixels for sizing the thumbnail
pRasterIO->SaveWithStamp(m_LEADRasterView1.GetRaster(),
"d:\\temp\\stamp.jpg", FILE_JFIF,
24, (QFactorConstants)30, 150.0f, 100.0f, 24);
m_LEADRasterView1.SetScaleMode(SavedMode);
pRasterIO->LoadStamp(m_LEADRasterView1.GetRaster(),
"d:\\temp\\stamp.jpg");
m_LEADRasterView1.ForceRepaint();
pRasterIO->Release();


ScaleMode example for Visual C++ 5.0

ScaleMode example for C++ 5.0 and later

//setup a custom scale
m_LEADImageList.SetScaleMode(SCALEMODE_USER);
m_LEADImageList.SetScaleWidth(600);
m_LEADImageList.SetScaleHeight(300);
m_LEADImageList.SetScaleTop(200);
m_LEADImageList.SetScaleLeft(200);


Scroll event example for Visual C++ 5.0

Scroll event example for C++ 5.0 and later

1. | Add a Static Text control as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the tutor resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_TUTOR_DIALOG to design the dialog box.
 | e. | Click the Static Text control; then click and drag its shape in the dialog box.
 | f. | Double-click the new control to edit its properties.
 | g. | Change the ID to IDC_TEXT1.
 | h. | Press Ctrl-F4 to close all windows back to the Project Workspace.
2. | Do the following to add m_Text1 to the CTutorDlg class and link the variable to the Static Text control using dynamic data exchange:
 | a. | Press Ctrl-W to go to the MFC ClassWizard.
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CTutorDlg.
 | d. | In the Control IDs list, select IDC_TEXT1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_Text1 as the variable name, Control as the category, and Cstatic as the variable type.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
3. | Edit the LEADRasterView1_OnScroll procedure as follows:

VOID CSampleDlg::OnScrollLeadrasterview1()
{
TCHAR cStr[128];
wsprintf(cStr, TEXT("Image origin: %g, %g"),
(double)m_LEADRasterView1.GetDstLeft(),
(double) m_LEADRasterView1.GetDstTop());
m_Text1.SetWindowText(cStr);
m_Text1.UpdateWindow();
}


Scroll example for Visual C++ 5.0

Scroll example for C++ 5.0 and later

void CBrowseDlg::OnScrollLeadimglistctrl1()
{
CString s;
s.Format(TEXT("Page: %d of %d"), m_LEADImageList.GetCurrentPage (), m_LEADImageList.GetPageCount());
this->SetWindowText(s);
}


ScrollItems example for Visual C++ 5.0

ScrollItems example for C++ 5.0 and later

//scroll items down 2 lines
m_LEADImageList.ScrollItems(2);


ScrollStyle example for Visual C++ 5.0

ScrollStyle example for C++ 5.0 and later

//Set scroll style to horizontal
m_LEADImageList.SetScrollStyle(IMGLST_SCROLLSTYLE_HORIZONTAL);


Segment example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Segment(m_LeadRasterView.GetRaster(), 20, SGM_RGB);
m_pRasterProc->Release();


SegmentExt example for Visual C++

void CSegDemoApp::OnFileSaveMulti()
{
int nRet =0;
ILEADRasterMrc * pRasterMrc1 = NULL;
ILEADRasterMrc * pRasterMrc2 = NULL;
ILEADRasterIO * pRasterIO = NULL;
ILEADRaster *pRaster =NULL;
ILEADRaster *pRasterList =NULL;

CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRasterList);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrc1);
CoCreateInstance(CLSID_LEADRasterMrc, NULL, CLSCTX_ALL, IID_ILEADRasterMrc, (void**)&pRasterMrc2);

pRasterIO->Load(pRaster, TEXT("c:\\1.jpg"), 0, 0, 1);
pRasterMrc1->StartSegmentation (pRaster);
nRet = pRasterMrc1->SegmentExt(pRaster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND | SGM_FAVOR_TWOBIT);
pRasterMrc1->StopSegmentation();
pRasterList->InsertBitmapListItem(-1, pRaster->Bitmap);

pRasterIO->Load (pRaster, TEXT("c:\\2.jpg"), 0, 0, 1);
pRasterMrc2->StartSegmentation (pRaster);
nRet = pRasterMrc2->SegmentExt(pRaster, 5, 50, 25, 10, 75, SGM_WITHOUTBKGRND | SGM_FAVOR_TWOBIT);
pRasterMrc1->StopSegmentation ();
pRasterList->InsertBitmapListItem (-1, pRaster->Bitmap);

pRasterIO->PutMRCRasterCount(2);
pRasterIO->PutMRCRaster(0, pRasterMrc1);
pRasterIO->PutMRCRaster(1, pRasterMrc2);

pRasterIO->PutMaskCoder(MRC_MASK_COMPRESSION_FAX_G3_1D);
pRasterIO->PutPictureCoder(MRC_PICTURE_COMPRESSION_JPEG);
pRasterIO->PutPictureQFactor(10);
pRasterIO->PutGrayscale8BitCoder(MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT);
pRasterIO->PutGrayscale8BitQFactor(2);
pRasterIO->PutGrayscale2BitCoder(MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT);
pRasterIO->PutText2BitCoder(MRC_TEXT_COMPRESSION_JBIG_2BIT);

nRet = pRasterIO->SaveList(pRasterList, TEXT("c:\\Multi.tif"), FILE_TIF_MRC);

if(pRasterMrc1)
{
pRasterMrc1->Release();
}
if(pRasterMrc2)
{
pRasterMrc2->Release();
}
if(pRasterIO)
{
pRasterIO->Release();
}
if(pRaster)
{
pRaster->Release();
}
if(pRasterList)
{
pRasterList->Release();
}
}


SelectData Example for C++ 5.0 and later

ILEADRaster* m_pRasterSrc= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterSrc);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pRasterSrc, "c:\\1.bmp", 0, 0, 1);

m_pRasterProc->SelectData(m_LeadRasterView.GetRaster (),
m_pRasterSrc,
RGB(233, 10, 77),
2,
6,
25,
true);
m_pRasterSrc->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


SelectedItems example for Visual C++ 5

SelectedItems example for C++ 5 and later

long x;
x = m_LEADRasterImgList1.GetSelectedCount();
while(x > 0)
{
m_LEADRasterImgList1.SelectedItems(0).SetSelected(FALSE);
x = m_LEADRasterImgList1.GetSelectedCount();
}


SelectionStyle example for Visual C++ 5.0

SelectionStyle example for C++ 5.0 and later

//show selected items as pressed buttons
m_LEADImageList.SetSelectionStyle(IMGLST_SELECTIONSTYLE_PRESSEDBUTTON);
AfxMessageBox(TEXT("about to change selection style"));
m_LEADImageList.SetSelectionStyle(IMGLST_SELECTIONSTYLE_SELECTCOLOR);
//set to RED
m_LEADImageList.SetSelectionColor(RGB(255, 0, 0) );


SelectiveColor Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->PutSelectiveColorCyan(0,-100);

m_pRasterProc->PutSelectiveColorCyan(1,34);
m_pRasterProc->PutSelectiveColorMagenta(1,100);
m_pRasterProc->PutSelectiveColorYellow(1,40);
m_pRasterProc->PutSelectiveColorBlack(1,100);

m_pRasterProc->PutSelectiveColorCyan(1,100);

m_pRasterProc->PutSelectiveColorCyan(2,-65);
m_pRasterProc->PutSelectiveColorMagenta(2,-39);
m_pRasterProc->PutSelectiveColorYellow(2,63);
m_pRasterProc->SelectiveColor(m_LeadRasterView.GetRaster ());

m_pRasterProc->Release();


SetGeoKey Example for Visual C++ 5.0

SetGeoKey Example for Visual C++

ILEADRasterVariant *pRasVar = NULL;
void TestSetGeoKey(ILEADRasterIO * pRasterIO)
{
/* This example sets the GTModelTypeGeoKey key to the Project Coordination System value */

pRasterIO->put_GeoKeyType (TAG_SHORT);
pRasterIO->put_GeoKeyCount (1);

pRasVar->Type = VALUE_SHORT;
pRasVar->ShortValue = 1;
pRasterIO->put_GeoKeyData (pRasVar);
pRasterIO->SetGeoKey (1024);
/* Every GeoTIFF file I save from now on will contain this GeoKey */
}


SetMemoryInfo example for Visual C++ 5.0

SetMemoryInfo example for C++ 5.0 and later

// change the tiled bitmap so is can use as many cache buffers as possible:

m_RasterView.GetRaster().SetMemoryInfoType (0);
m_RasterView.GetRaster().SetMemoryInfoTileSize (0);
m_RasterView.GetRaster().SetMemoryInfoTotalTiles (0);
m_RasterView.GetRaster().SetMemoryInfoConventionalTiles (0);
m_RasterView.GetRaster().SetMemoryInfoMaxTileViews (0xFFFFFFFF);
m_RasterView.GetRaster().SetMemoryInfoTileViews(0xFFFFFFFF);
m_RasterView.GetRaster().SetMemoryInfoFlags (SET_MEMORYINFO_MAXTILEVIEWS|
SET_MEMORYINFO_TILEVIEWS);
m_RasterView.GetRaster().SetMemoryInfo();


SetMemoryThresholds example for Visual C++ 5.0

SetMemoryThresholds example for C++ 5.0 and later

/* Allocate tiled bitmaps when more than 75% of the computer memory is used, or for bitmaps larger than 100MB. */

m_RasterView.GetRaster().SetMemoryTiledThreshold(-25);
m_RasterView.GetRaster().SetMaxConventionalSize(1024 * 102400);
m_RasterView.GetRaster().SetTiledBitmapsSize (0);
m_RasterView.GetRaster().SetMemoryConventionalTile(0);
m_RasterView.GetRaster().SetMemoryConventionalBuffers(0);
m_RasterView.GetRaster().SetMemoryFlags (MEMORY_TILED_THRESHOLD | MEMORY_MAX_CONV_SIZE);
m_RasterView.GetRaster().SetMemoryThresholds();


SetMinMaxBits Example for C++ 5.0 and later

ILEADRasterProcess *pRasterProcess;
CoCreateInstance(CLSID_LEADRasterProcess,
NULL,
CLSCTX_ALL,
IID_ILEADRasterProcess,
(void**)&pRasterProcess);

// set the grayscale LUT
if((m_LEADRasterView1.GetRaster().GetIsGrayscale() != GRAY_NO) && (m_LEADRasterView1.GetRaster().GetBitmapBits() > 8))
{
m_LEADRasterView1.GetRaster().GetMinMaxBits();
m_LEADRasterView1.GetRaster().SetMinMaxBits(m_LEADRasterView1.GetRaster().GetMinBit(), m_LEADRasterView1.GetRaster().GetMaxBit());
m_LEADRasterView1.GetRaster().GetMinMaxVal();
float window;
float center;
window = (float)(m_LEADRasterView1.GetRaster().GetMaxVal() - m_LEADRasterView1.GetRaster().GetMinVal());
center = window / 2.0f;
pRasterProcess->ApplyLinearVOILUT(m_LEADRasterView1.GetRaster(), window, center, (VOILUTConstants)0);
}
pRasterProcess->Release();


SetOverlayAttributes example for Visual C++ 5.0

SetOverlayAttributes example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int nRet;
ILEADRaster *OverlayRaster = NULL;

CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&OverlayRaster
);
m_pRasterIO->Load(OverlayRaster,"c:\\dic2.cmp",0,0,1);
m_pRasterProc->SetOverlayBitmap(m_LeadRasterView.GetRaster() , 0, OverlayRaster, OVERLAY_MOVE);
if (nRet == 0)
{
m_pRasterProc->OverlayAttributes->Color = RGB(255, 255, 255);
m_pRasterProc->OverlayAttributes->Flags = OVERLAY_AUTOPROCESS |
OVERLAY_AUTOPAINT;
m_pRasterProc->OverlayAttributes->OriginX = 0;
m_pRasterProc->OverlayAttributes->OriginY = 0;
m_pRasterProc->OverlayAttributes->BitPosition =
m_LeadRasterView.GetRaster().GetBitmapBits() - 1;
m_pRasterProc->SetOverlayAttributes (m_LeadRasterView.GetRaster(), 0, OVERLAYATTRIBUTES_COLOR + OVERLAYATTRIBUTES_FLAGS + OVERLAYATTRIBUTES_ORIGIN + OVERLAYATTRIBUTES_BITINDEX);

m_pRasterProc-> Release();
OverlayRaster-> Release();


SetRgnBorder Example for C++ 5.0 and later

void CDemoView::OnSetRgnBorder()
{
m_LeadRasterView.GetRaster().SetRgnBorder( 0, 0,RGB(0,0,0), RGB(20,30,15), RGB(15,30,10), L_RGN_SET );
m_LeadRasterView.SetRgnFrameType(RGNFRAME_ANIMATED);
m_LeadRasterView.ForceRepaint();
}


SetRgn... example for Visual C++ 5.0

SetRgn... example for C++ 5.0 and later

This example demonstrates the SetRgnEllipse, SetRgnRect, SetRgnRoundRect, and SetRgnPolygon methods by simulating client area coordinates. Normally, you would get the coordinates interactively from mouse events and would use Windows GDI functions to outline the shape of each region before it is created.

To create the polygonal region, this example uses the PolygonSize, PolygonX, and PolygonY properties.

Also, to demonstrate the SetRgnColor method, it uses the Fill method to fill the region with a solid color, then uses the fill color to create a new region.

// Declare local variables
float ZoomFactorX, ZoomFactorY; // For translating positioning information
float OffsetX, OffsetY, CurrentX, CurrentY; // To simulate mouse coordinates
float SimLeft, SimTop, SimWidth, SimHeight; // To simulate mouse coordinates
float LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, eW, eH;// For bitmap coordinates
int i; // Loop counter
// Set up some arrays to use as client area grid values for drawing a polygon.
int xPoint[] = {0, -1, 2, 1, 1, 2, -1, -2};
int yPoint[] = {0, -1, -1, 1, -1, 1, 1, 1};
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

// Initialize the variables that we will manipulate to simulate mouse coordinates.
OffsetX = m_LEADRasterView1.GetScaleWidth() / 15;
OffsetY = m_LEADRasterView1.GetScaleHeight() / 15;
CurrentX = OffsetX;
CurrentY = OffsetY;
// Set the zoom factors.
ZoomFactorX = m_LEADRasterView1.GetDstWidth() / m_LEADRasterView1.GetSrcWidth();
ZoomFactorY = m_LEADRasterView1.GetDstHeight() / m_LEADRasterView1.GetSrcHeight();
// Start by simulating the drawing of a rectangle.
SimLeft = CurrentX;
SimTop = CurrentY;
SimWidth = OffsetX * 2;
SimHeight = OffsetY * 2;
// Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) - (m_LEADRasterView1.GetDstLeft() / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft();
LBRgnTop = (SimTop / ZoomFactorY) - (m_LEADRasterView1.GetDstTop() / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop();
LBRgnWidth = SimWidth / ZoomFactorX;
LBRgnHeight = SimHeight / ZoomFactorY;
// Create the rectangular region, outline it, and display a message so that we can see what happened.
m_LEADRasterView1.GetRaster().SetRgnRect(LBRgnLeft, LBRgnTop,
LBRgnWidth, LBRgnHeight,
L_RGN_SET);
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_STATIC);
MessageBox(TEXT("Here is the rectangular region"));
// Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + OffsetX;
CurrentY = CurrentY + OffsetY;
// Next, simulate the drawing of an ellipse.
SimLeft = CurrentX;
SimTop = CurrentY;
SimWidth = OffsetX * 3;
SimHeight = OffsetY * 2;
// Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) - (m_LEADRasterView1.GetDstLeft() / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft();
LBRgnTop = (SimTop / ZoomFactorY) - (m_LEADRasterView1.GetDstTop() / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop();
LBRgnWidth = SimWidth / ZoomFactorX;
LBRgnHeight = SimHeight / ZoomFactorY;
// Add the elliptical region, using a Boolean OR,
// and display a message so that we can see what happened.
m_LEADRasterView1.GetRaster().SetRgnEllipse(LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_OR);
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_STATIC);
MessageBox(TEXT("Here is the added ellipse, with a Boolean OR"));
// Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + OffsetX;
CurrentY = CurrentY + OffsetY;
// Next, simulate the drawing of a rounded rectangle.
SimLeft = CurrentX;
SimTop = CurrentY;
SimWidth = OffsetX * 3;
SimHeight = OffsetY * 2;
// Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft = (SimLeft / ZoomFactorX) - (m_LEADRasterView1.GetDstLeft() / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft();
LBRgnTop = (SimTop / ZoomFactorY) - (m_LEADRasterView1.GetDstTop() / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop();
LBRgnWidth = SimWidth / ZoomFactorX;
LBRgnHeight = SimHeight / ZoomFactorY;
// Define an ellipse to use for the corners.
eW = LBRgnWidth / 4;
eH = LBRgnHeight / 4;
// Add the rounded rectangular region, using a Boolean exclusive OR,
// and display a message so that we can see what happened.
m_LEADRasterView1.GetRaster().SetRgnRoundRect(LBRgnLeft, LBRgnTop,
LBRgnWidth, LBRgnHeight,
eW, eH, L_RGN_XOR);
MessageBox(TEXT("Here is the rounded rectangle, with a Boolean XOR"));
// Move the current mouse position so that we overlap the existing region.
CurrentX = CurrentX + (2 * OffsetX);
CurrentY = CurrentY + (2 * OffsetY);
// Initialize the polygon size using an arbitrary number.
// This number will be increased dynamically.
m_LEADRasterView1.GetRaster().SetPolygonSize(5);
// Fill in the array for the polygon. This simulates a user's mouse clicks.
for( i = 0; i <= 7; ++i)
{
CurrentX = CurrentX + (xPoint[i] * OffsetX);
CurrentY = CurrentY + (yPoint[i] * OffsetY);
m_LEADRasterView1.GetRaster().SetPolygonX (i, (CurrentX / ZoomFactorX)
- (m_LEADRasterView1.GetDstLeft() / ZoomFactorX)
+ m_LEADRasterView1.GetSrcLeft());
m_LEADRasterView1.GetRaster().SetPolygonY (i, (CurrentY / ZoomFactorY)
- (m_LEADRasterView1.GetDstTop() / ZoomFactorY)
+ m_LEADRasterView1.GetSrcTop());
if (i + 1 == m_LEADRasterView1.GetRaster().GetPolygonSize())
m_LEADRasterView1.GetRaster().SetPolygonSize(m_LEADRasterView1.GetRaster().GetPolygonSize() + 5);
}
// Adjust the polygon size to the actual number of points.
m_LEADRasterView1.GetRaster().SetPolygonSize(i);
// Add the polygonal region, using a Boolean OR,
// and display a message so that we can see what happened.
m_LEADRasterView1.GetRaster().SetRgnPolygon(L_POLY_WINDING, L_RGN_OR);
MessageBox(TEXT("Here is the added polygon, with a Boolean OR"));
// Fill the resulting polygon with red, and display a message.
pRasterProc->Fill(m_LEADRasterView1.GetRaster(), RGB(255, 0, 0));
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_NONE);
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("Using SetRgnColor and L_RGN_SETNOT, all else will become blue."));
// Clean up memory
m_LEADRasterView1.GetRaster().FreeRgn();
// Do the final region.
m_LEADRasterView1.GetRaster().SetRgnColor(RGB(255, 0, 0), L_RGN_SETNOT);
pRasterProc->Fill(m_LEADRasterView1.GetRaster(), RGB(0, 0, 255));
m_LEADRasterView1.ForceRepaint();
// Clean up memory
m_LEADRasterView1.GetRaster().FreeRgn();
m_LEADRasterView1.GetRaster().SetPolygonSize(0);
pRasterProc->Release();


SetRgnColorHSVRange example for Visual C++ 5.0

SetRgnColorHSVRange example for C++ 5.0 and later

//This example sets a region corresponding to all pure green (Hue = 85)
//and colors near green (+/- 10)
//where Saturation is at least 40 and Value is at least 40
void CRemapHueDlg::OnSetRgnColorHSVRange()
{
int H0,S0,V0,H1,S1,V1;

H0 = 75;
S0 = 40;
V0 = 40;

H1 = 95;
S1 = 255;
V1 = 255;
m_RasterView.GetRaster().SetRgnColorHSVRange(H0, S0, V0, H1, S1, V1, L_RGN_SET);
m_RasterView.SetRgnFrameType(RGNFRAME_ANIMATED);
}


SetRgnColorRGBRange example for Visual C++ 5.0

SetRgnColorRGBRange example for C++ 5.0 and later

//This example sets a region corresponding to all colors that
//have an rgb that include red but no green and no blue
void CRemapHueDlg::OnSetRgnColorRGBRange()
{
OLE_COLOR rgbLo;
OLE_COLOR rgbHi;

rgbLo = RGB(1, 0, 0);
rgbHi = RGB(255, 0, 0);
m_RasterView.GetRaster().SetRgnColorRGBRange(rgbLo, rgbHi, L_RGN_SET);
m_RasterView.SetRgnFrameType(RGNFRAME_ANIMATED);
}


SetRgnFromMask example for C++ 5 and later

ILEADRasterIO *pRasterIO = NULL;
ILEADRaster *pRaster;
int nRet;

CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pRaster
);

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

// This example sets a region into a bitmap using a 1-bit black-and-white mask image.
nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster (), "c:\\parrots.jpg", 16, 0, 1);
nRet = pRasterIO->Load(m_LEADRasterView2.GetRaster(), "c:\\Test2.jpg", 16, 0, 1);
m_LEADRasterView1.GetRaster().SetMaskBitmap(m_LEADRasterView2.GetRaster().GetBitmap());
m_LEADRasterView1.GetRaster().SetRgnFromMask(L_RGN_SET);
m_LEADRasterView1.GetRaster().SetMaskBitmap(0);

pRasterIO->Release();
pRaster->Release();


SetRgnMagicWand example for Visual C++ 5.0

SetRgnMagicWand example for C++ 5.0 and later

void CMfcmagDlg::OnMouseUpLeadrasterview1(short Button, short Shift, float x, float y)
{
m_LEADRasterView1.SetScaleMode(3);
m_LEADRasterView1.GetRaster().SetRgnMagicWand((float)x, (float)y, 10, L_RGN_SET);
m_LEADRasterView1.SetRgnFrameType(2);
}


SetSelection example for Visual C++ 5.0

SetSelectionBitmap example for C++ 5.0 and later

theApp.m_pRasterIO->Load (theApp.m_pRaster, "d:\\temp\\circ.bmp", 24, 0, 1);
m_LEADImageList.SetSelectionBitmap(RGB(255, 255, 255), theApp.m_pRaster->Bitmap);
m_LEADImageList.SetSelectionStyle(IMGLST_SELECTIONSTYLE_USERBITMAP);


SetSrcClipRect example for Visual C++ 5.0

SetSrcClipRect example for C++ 5.0 and later

This example crops the image by reducing the source clipping area and repaints the image.

float NewLeft = m_LEADRasterView1.GetSrcClipLeft() + (m_LEADRasterView1.GetSrcClipWidth() * 0.1f);
float NewTop = m_LEADRasterView1.GetSrcClipTop() + (m_LEADRasterView1.GetSrcClipHeight() * 0.1f);
float NewWidth = m_LEADRasterView1.GetSrcClipWidth() * 0.8f;
float NewHeight = m_LEADRasterView1.GetSrcClipHeight() * 0.8f;
if (NewWidth > 1 && NewHeight > 1)
m_LEADRasterView1.SetSrcClipRect(NewLeft, NewTop, NewWidth, NewHeight);
m_LEADRasterView1.ForceRepaint();


SetSrcRect example for Visual C++ 5.0

SetSrcRect example for C++ 5.0 and later

This example zooms in on the image by reducing the source rectangle and repaints the image.

float NewLeft = m_LEADRasterView1.GetSrcLeft() + (m_LEADRasterView1.GetSrcWidth() * 0.1f);
float NewTop = m_LEADRasterView1.GetSrcTop() + (m_LEADRasterView1.GetSrcHeight() * 0.1f);
float NewWidth = m_LEADRasterView1.GetSrcWidth() * 0.8f;
float NewHeight = m_LEADRasterView1.GetSrcHeight() * 0.8f;
if (NewWidth > 1 && NewHeight >1)
m_LEADRasterView1.SetSrcRect(NewLeft, NewTop, NewWidth, NewHeight);
m_LEADRasterView1.ForceRepaint();


SetTag example for Visual C++ 5.0

SetTag example for C++ 5.0 and later

void CTest4Dlg::OnSetAndReadTag()
{
long *pData;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

// create a variant containing 4 elements. Note that this
// is needed only if we use the TAG_LONG tags...

pltRasVar->ItemCount = 4;
pltRasVar->Type = VALUE_LONG;
pltRasVar->LongItemValue (0) = 1;
pltRasVar->LongItemValue (1) = 2;
pltRasVar->LongItemValue (2) = 3;
pltRasVar->LongItemValue (3) = 127;

// set a tag using one of the following:
// m_pRasterIO->SetTag(32768, TAG_ASCII, 0, COleVariant("My text string"));
// m_pRasterIO->SetTag(32768, TAG_BYTE, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_DOUBLE, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_FLOAT, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_LONG, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_RATIONAL, 2, myArray);
// m_pRasterIO->SetTag(32768, TAG_SBYTE, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_SHORT, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_SLONG, 4, myArray);
// m_pRasterIO->SetTag(32768, TAG_SRATIONAL, 2, myArray);
// m_pRasterIO->SetTag(32768, TAG_SSHORT, 4, myArray);
m_pRasterIO->SetTag(32768, TAG_UNDEFINED, 4, pltRasVar);

// Write the tag. This file must already exist
m_pRasterIO->WriteTag("d:\\temp\\Test.tif", 1);
OnReadTag();
pltRasVar->Release ();
}

void CTestDlg::OnReadTag()
{
// read the tag back
m_pRasterIO->ReadTag("d:\\temp\\Test.tif", 1, 32768L);
GetAndDisplayTag(0);
}

void CTestDlg::GetAndDisplayTag(long lTag)
{
int uTagType = m_pRasterIO->GetTagType(lTag);
long lTagCount = m_pRasterIO->GetTagCount(lTag);
CString MsgString, Str1;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

pltRasVar = m_pRasterIO->GetTagData(lTag);

MsgString.Format(TEXT("Type = %d"), uTagType);

Str1.Format(TEXT("\r\nCount = %ld"), lTagCount);
MsgString += Str1;

if(uTagType == TAG_ASCII)
{
MsgString += TEXT("\r\nData = ");
MsgString += pltRasVar->StringValue;
}
else if(uTagType == TAG_RATIONAL || uTagType == TAG_SRATIONAL)
{
long *pData;
pData = GlobalAlloc(GHND,pltRasVar->ItemCount);
for(long i=0; i<lCount; i++)
pData[i] = pltRasVar->ShortItemValue(i);

for(long i = 0; i < lTagCount; i++)
{
Str1.Format(TEXT("\r\nData(%d) = %ld/%ld"), i, pData[i*2], pData[i*2+1]);
MsgString += Str1;
}

GlobalFree(pData);
}
else
{
long *pData;
pData = GlobalAlloc(GHND,pltRasVar->ItemCount);
for(long i=0; i<lCount; i++)
pData[i] = pltRasVar->ShortItemValue(i);

for(long i = 0; i < lTagCount; i++)
{
switch(uTagType)
{
case TAG_LONG:
Str1.Format(TEXT("\r\nData(%d) = %u"), i, ((unsigned long*)pData)[i]); break;
case TAG_SLONG:
Str1.Format(TEXT("\r\nData(%d) = %d"), i, ((signed long*)pData)[i]); break;
case TAG_SHORT:
Str1.Format(TEXT("\r\nData(%d) = %u"), i, (int)((unsigned short*)pData)[i]); break;
case TAG_SSHORT:
Str1.Format(TEXT("\r\nData(%d) = %d"), i, (int)((signed short*)pData)[i]); break;
case TAG_BYTE:
case TAG_UNDEFINED:
Str1.Format(TEXT("\r\nData(%d) = %u"), i, (int)((unsigned TCHAR *)pData)[i]); break;
case TAG_SBYTE:
Str1.Format(TEXT("\r\nData(%d) = %d"), i, (int)((signed TCHAR *)pData)[i]); break;
case TAG_FLOAT:
Str1.Format(TEXT("\r\nData(%d) = %f"), i, (double)((float*)pData)[i]); break;
case TAG_DOUBLE:
Str1.Format(TEXT("\r\nData(%d) = %f"), i, ((double*)pData)[i]); break;
}
MsgString += Str1;
}
GlobalFree(pData);
}
MessageBox(MsgString);
}

void CTestDlg::OnGetTag()
{
GetAndDisplayTag (32768L);
}


Sharpen example for Visual C++ 5.0

Sharpen example for C++ 5.0 and later

This example increases the sharpness of the bitmap and redisplays the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Sharpen(m_LEADRasterView1.GetRaster(), 100);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Shear example for Visual C++ 5.0

Shear example for C++ 5.0 and later

This example shears the bitmap 5 degrees horizontally and redisplays the image. It uses blue as the fill color.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Shear(m_LEADRasterView1.GetRaster(), 500, TRUE,
RGB(0,0,255));
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


ShiftData Example for C++ 5.0 and later

ILEADRaster* m_pRasterSrc= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterSrc);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pRasterSrc, "c:\\1.bmp", 0, 0, 1);

m_pRasterProc->ShiftData(m_LeadRasterView.GetRaster (),
m_pRasterSrc,
2,
6,
3,
8);
m_pRasterSrc->Release();
m_pRasterIO->Release();
m_pRasterProc->Release();


ShiftMinimumToZero example for Visual C++

int nShiftAmount = 0;

IILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->ShiftMinimumToZero(m_LeadRasterView.GetRaster());
nShiftAmount = m_pRasterProc->GetShiftAmount();

m_pRasterProc->MultiScaleEnhancement(m_LeadRasterView.GetRaster(), 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
m_pRasterProc->ShiftZeroToNegative(m_LeadRasterView.GetRaster(), nShiftAmount, -32767, 32766, 0, 65535);
m_pRasterProc->Release();


ShortItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutType(VALUE_ARRAY_SHORT);
pltRasVar->PutItemCount(2);
pltRasVar->PutShortItemValue(0, 5);
pltRasVar->PutShortItemValue(1, 10);


ShortValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->PutEnableMethodErrors(FALSE);
pltRasVar->PutType(VALUE_SHORT);
pltRasVar->PutShortValue(5);
if (pltRasVar->GetError() == 0)
::MessageBox(NULL, TEXT("The short value is set correctly"), TEXT("Notice!"), MB_OK);


Skeleton Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Skeleton(m_LeadRasterView.GetRaster () ,128);
m_pRasterProc->Release();


SkipFile example for Visual C++ 5.0

SkipFile example for C++ 5.0 and later

void CRasterThumbnailSink::OnThumbnailEvent(long Bitmap, TCHAR * pszFilename, short StatusCode, short nPercent)
{
CString csOut;
CString cs;
//in this example, nCount is a global variable used to count the thumbnails
switch(StatusCode)
{
case 0: //successful thumbnail generation
//save thumbnails in a multipage TIFF file
nCount++;
if(nCount > 20) //allow max of 20 thumbnails
{
m_pDlg->m_pRasterThumbnail->PutContinueBrowse (FALSE); //stop the browse
return;
}
csOut.Format(TEXT("%s\nFormat: %d\nCompression: %d\nBits: %d\nWidth: %d\nHeight: %d\nPage: %d\nTotalPages: %d\nSizeDisk: %ld\nSizeMem: %ld\nXRes: %d\nYRes: %d"),
pszFilename,
m_pDlg->m_pRasterThumbnail->GetInfoFormat(),
m_pDlg->m_pRasterThumbnail->GetInfoCompression(),
m_pDlg->m_pRasterThumbnail->GetInfoBits (),
m_pDlg->m_pRasterThumbnail->GetInfoWidth(),
m_pDlg->m_pRasterThumbnail->GetInfoHeight(),
m_pDlg->m_pRasterThumbnail->GetInfoPage (),
m_pDlg->m_pRasterThumbnail->GetInfoTotalPages (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeDisk (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeMem (),
m_pDlg->m_pRasterThumbnail->GetInfoXRes (),
m_pDlg->m_pRasterThumbnail->GetInfoYRes ());
AfxMessageBox(csOut);
break;
case BROWSE_PRELOAD:
csOut = pszFilename;
cs = pszFilename;
cs = cs.Right(4);
//check the extension, if it is ".DOC", then skip
if(!cs.CompareNoCase(TEXT(".DOC"))
{
m_pDlg->m_pRasterThumbnail->PutSkipFile(TRUE);
AfxMessageBox(TEXT("skipping - ") + csOut);
}
break;
}
m_pDlg->m_pRasterThumbnail->PutContinueBrowse (TRUE); //continue the browse operation
}


Slice Example for Visual C++ 5.0 and later

void CDemoView::OnImageSlice()
{
int nRet = theApp.m_pRasterProcess->Slice (m_RasterView.GetRaster (), 500, RGB(0,0,0), SLICE_DESKEW|SLICE_DESKEW_LINEAR|SLICE_CUT_SLICES, TRUE);
CString strMsg;
strMsg.Format(TEXT("Deskew Angle : %d"), theApp.m_pRasterProcess->SliceDeskewAngle);
MessageBox(strMsg);
}
void CRasterProcSink::OnSliceBitmap (long Bitmap, long lLeft, long lTop, long lWidth, long lHeight, long lAngle)
{
static int nCount =1;

ILEADRasterIO * pRasterIO = NULL;
ILEADRaster * pSliceRaster = NULL;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

hr = CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pSliceRaster
);

TCHAR strFileName[MAX_PATH];
wsprintf(strFileName, TEXT("c:\\Slices\\%d.bmp"), nCount);

pSliceRaster->PutBitmap (Bitmap);

int nRet = pRasterIO->Save (pSliceRaster, strFileName,FILE_BMP, 24, (QFactorConstants)1, SAVE_OVERWRITE);

if (nRet == 0)
{
nCount ++;
if(nCount > 10)

theApp.m_pRasterProcess->ContinueSlicing = FALSE;
}

pSliceRaster->Release();
pRasterIO->Release();
}


Smooth example for Visual C++ 5.0

Smooth example for C++ 5.0 and later

void CTutorDlg::OnButtonSmooth()
{
//This example smooths all nicks and bumps up to 2 pixels in length
//Long bumps/nicks are treated before short bumps/nicks
//A LEAD region is updated to show all the changes
//The Smooth Event is used to display information about bump or nick

//The following is declared and created in in the CTutorDlg class constructor
// ILEADRasterProcess *m_pRasterProc=NULL;
// hr = CoCreateInstance(
// CLSID_LEADRasterProcess,
// NULL,
// CLSCTX_ALL,
// IID_ILEADRasterProcess,
// (void**)&m_pRasterProc);
//NOTE: This is not a complete example for handing events, some steps have been omitted.
//For a complete example of how to handle events, refer to the example
//Updating a Gauge and Detecting a User Interrupt.

int nRet;

m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
m_pRasterProc->EnableMethodErrors = FALSE;

m_pRasterProc->EnableDocCleanEvents = TRUE;
m_pRasterProc->DocCleanSuccess = SUCCESS_REMOVE;
nRet = m_pRasterProc->Smooth(
m_LEADRasterView1.GetRaster(),
2,
(SmoothFlags)(SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION | SMOOTH_FAVOR_LONG)
);
if (nRet == 0)
{
m_LEADRasterView1.SetRgnFrameType(RGNFRAME_COLOR);
}

void CRasterProcSink::OnSmooth(
long nBumpOrNick,
float fStartRow,
float fStartCol,
float fLength,
long uHorV
)

{
CString strMsg;

LPTSTR pszType = (nBumpOrNick == SMOOTH_BUMP) ? TEXT("Bump") : TEXT("Nick");
LPTSTR pszHorV = (uHorV = SMOOTH_HORIZONTAL_ELEMENT) ? TEXT("Horz") : TEXT("Vert");

strMsg.Format(TEXT("Found %s[%s] at [%0.0f,%0.0f]\tLength[%0.0f]\n"),
pszType,
pszHorV,
fStartRow,
fStartCol,
fLength);
OutputDebugString(strMsg);
}


SmoothEdges Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->SmoothEdges(m_LeadRasterView.GetRaster (), 75, 0);
m_pRasterProc->Release();


Solarize example for Visual C++ 5.0

Solarize example for C++ 5.0 and later

This example applies a solarize effect and repaints the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Solarize(m_LEADRasterView1.GetRaster(), 100);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Sort example for Visual C++ 5.0

Sort example for C++ 5.0 and later

//Sort the items in ascending order
m_LEADImageList.Sort(TRUE);


SortExt Example for C++ 5.0 and later

void CDemoDlg::OnLoadFromFile()
{
m_RasterImgList1.LoadFromFile("c:\\image1.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image2.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image3.jpg", 0, 0, -1);
m_RasterImgList1.LoadFromFile ("c:\\image4.jpg", 0, 0, -1);
m_RasterImgList1.SortExt(TRUE, FALSE, FALSE, 0);
}


SpatialFilter example for Visual C++ 5.0

SpatialFilter example for C++ 5.0 and later

This example applies Laplacian line detection and redisplays the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->SpatialFilter(m_LEADRasterView1.GetRaster(),
FLT_LAPLACE_1);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Spherize Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth ()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/2;
m_pRasterProc->Spherize (m_LeadRasterView.GetRaster(), 100, CenterX,CenterY, RGB(0,0,0), FILL_RPT | FILL_WOUTROT);
m_pRasterProc->Release();


Src... example for Visual C++ 5.0

Src... example for C++ 5.0 and later

This example uses the source rectangle properties to zoom in on the image.

// Calculate the values to zoom in by 10 percent and center the image.
m_LEADRasterView1.SetAutoSetRects(FALSE);
if (m_LEADRasterView1.GetSrcWidth() > 1 && m_LEADRasterView1.GetSrcHeight() > 1)
{
m_LEADRasterView1.SetSrcWidth(m_LEADRasterView1.GetSrcWidth() * 0.9f);
m_LEADRasterView1.SetSrcHeight(m_LEADRasterView1.GetSrcHeight() * 0.9f);
m_LEADRasterView1.SetSrcTop((m_LEADRasterView1.GetRaster().GetBitmapHeight() - m_LEADRasterView1.GetSrcHeight()) / 2);
m_LEADRasterView1.SetSrcLeft((m_LEADRasterView1.GetRaster().GetBitmapWidth() - m_LEADRasterView1.GetSrcWidth()) / 2);
}
// Set the clipping area to the same as the destination rectangle
m_LEADRasterView1.SetSrcClipWidth(m_LEADRasterView1.GetSrcWidth());
m_LEADRasterView1.SetSrcClipHeight(m_LEADRasterView1.GetSrcHeight());
m_LEADRasterView1.SetSrcClipTop(m_LEADRasterView1.GetSrcTop());
m_LEADRasterView1.SetSrcClipLeft(m_LEADRasterView1.GetSrcLeft());
// Redisplay the image
m_LEADRasterView1.ForceRepaint();


STable example for Visual C++ 5.0

STable example for C++ 5.0 and later

//This example remaps the saturation of each color to one half its original
void CRemapHueDlg::OnSTable()
{
int i;
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
for (i=0; i<256; i++)
{
pRasterProc->PutSTable (i, i/2);
}
pRasterProc->RemapHue (m_RasterView.GetRaster(), FALSE, FALSE, TRUE, FALSE);
}
pRasterProc->Release();
}


StopMagGlass example for Visual C++ 5.0

StopMagGlass example for C++ 5.0 and later

m_LEADRasterView1.SetScaleMode(3);

// Set MagGlass flags
// In this case the masked colors from the Magnifying Glass area will be all the colors
// except those colors which will be set using MagGlassMask property
m_LEADRasterView1.SetMagGlassFlags (MAGGLASS_MASK_INVERT);

//set the color mask to mask out all colors except a few shades of black
m_LEADRasterView1.SetMagGlassMaskCount(3);
m_LEADRasterView1.SetMagGlassMask(0, RGB(0, 0, 0));
m_LEADRasterView1.SetMagGlassMask(1, RGB(1, 1, 1));
m_LEADRasterView1.SetMagGlassMask(2, RGB(2, 2, 2));
m_LEADRasterView1.SetRgnFrameType(0);
m_LEADRasterView1.StartMagGlass(100.0f, 100.0f, 400, RGB(255, 0, 0), RGB(128, 128, 128), TRUE, 1.0f, FALSE, CROSSHAIR_FINE, TRUE, TRUE);
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
m_LEADRasterView1.StopMagGlass ();


StretchIntensity example for Visual C++ 5.0

StretchIntensity example for C++ 5.0 and later

This example stretches the intensity and redisplays the image.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->StretchIntensity(m_LEADRasterView1.GetRaster());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


StringItemValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_ARRAY_STRING;
pltRasVar->ItemCount = 2;
pltRasVar->StringItemValue[0] = "My 1st String";
pltRasVar->StringItemValue[1] = "My 2nd String";


StringValue example for C++ 5.0 and later

ILEADRasterVariant * pltRasVar=NULL;

pltRasVar->Type = VALUE_STRING;
pltRasVar->StringValue = "My String Value";


SubtractBackground example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->SubtractBackground(m_LeadRasterView.GetRaster(),
50,
SBK_1_1,
100,
SBK_BG_DARK |
SBK_RES_SHOW);
m_pRasterProc->Release();


SwapColors example for Visual C++ 5 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->SwapColors (m_RasterView.GetRaster (), SWAP_RG);
pRasterProc->Release();


Swirl Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth ()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/2;
m_pRasterProc->Swirl (m_LeadRasterView.GetRaster(), 180, CenterX,CenterY);
m_pRasterProc->Release();


TempDirectory Example for C++ 5.0 and later

m_RasterView.GetRaster().SetTempDirectory("C:\\Temp");


TextureAlphaBlend Example for C++ 5.0 and later

ILEADRaster* m_pRasterSrc= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterSrc);

ILEADRaster* m_pRasterMask= NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterMask);

ILEADRaster* m_pRasterUnderlay = NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pRasterUnderlay);

ILEADRasterIO* m_pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pRasterIO);

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterIO->Load(m_pRasterSrc, "C:\\image1.cmp", 0, 0, 1);
m_pRasterIO->Load(m_pRasterMask, "C:\\FadeMask.cmp", 0, 0, 1);

m_pRasterProc->TextureAlphaBlend(m_LeadRasterView.GetRaster (), 0, 0, 100, 100, m_pRasterSrc, 0, 0, m_pRasterMask, 100, NULL, 0, 0);

m_pRasterProc->Release();
m_pRasterIO->Release();
m_pRasterMask->Release();
m_pRasterSrc->Release();
m_pRasterUnderlay->Release();


TextWordWrap example for Visual C++ 5.0

TextWordWrap example for C++ 5.0 and later

This example wraps text inside the rectangle that is specified for the text object.

// Text location
m_pltRasFxd->PutTextTop(10);
m_pltRasFxd->PutTextLeft(10);
m_pltRasFxd->PutTextWidth(150);
m_pltRasFxd->PutTextHeight(150);
// Text alignment and angle
m_pltRasFxd->PutTextAlign(FXD_TEXTALIGN_LEFT_VCENTER);
m_pltRasFxd->PutTextAngle(0);
// Enable word wrap
m_pltRasFxd->PutTextWordWrap(TRUE);
m_pltRasFxd->DrawText(NULL, m_LEADRasView1.GetClientDC(), "LEADTOOLS Supports WordWrap when drawing text.", NULL);


Tool example for Visual C++ 5.0

Tool example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This sample displays the current tool, and then changes it to ANN_TOOL_RECT
void SampleTool(ILEADRasterAnnToolBar * pAnnToolBar)
{
CString strTool;
AnnToolConstants nTool;

nTool = pAnnToolBar->GetTool();

strTool.Format(TEXT("Annotation Tool: %d"), nTool);

switch (nTool)
{
case ANN_TOOL_SELECT:
strTool = TEXT("Select");
break;

case ANN_TOOL_LINE:
strTool = TEXT("Line");
break;

case ANN_TOOL_RECT:
strTool = TEXT("Rect");
break;

case ANN_TOOL_ELLIPSE:
strTool = TEXT("Ellipse");
break;

case ANN_TOOL_POLYLINE:
strTool = TEXT("Polyline");
break;

case ANN_TOOL_POLYGON:
strTool = TEXT("Polygon");
break;

case ANN_TOOL_POINTER:
strTool = TEXT("Pointer");
break;

case ANN_TOOL_FREEHAND:
strTool = TEXT("Freehand");
break;

case ANN_TOOL_HILITE:
strTool = TEXT("hilite");
break;
////...other tools
}

AfxMessageBox(TEXT("Current tool: ") + strTool);
AfxMessageBox(TEXT("Changing to ANN_TOOL_RECT"));
pAnnToolBar->PutTool(ANN_TOOL_RECT);
}


TransitionEffect example for Visual C++ 5.0

TransitionEffect example for C++ 5.0 and later

This example paints a transition with a 255-step grayscale gradient.

m_LEADRasterView1.SetAutoRepaint(FALSE);
m_LEADRasterView1.SetTransitionDelay(50);
pRasterIO->Load(m_LEADRasterView1.GetRaster().m_lpDispatch, "c:\\lead\\images\\image1.cmp", 0, 0, 1);
m_LEADRasterView1.SetTransitionEffect(EFX_EFFECT_WIPE_RECTANGLE_OUT);
m_LEADRasterView1.SetTransitionStyle(EFX_TRANSITION_GRADIENT);
m_LEADRasterView1.SetGradientStyle(EFX_GRADIENT_ANGLE_TO_LT);
m_LEADRasterView1.SetGradientEndColor(RGB(0, 0, 0));
m_LEADRasterView1.SetGradientStartColor(RGB(255, 255, 255));
m_LEADRasterView1.SetGradientSteps(255);
m_LEADRasterView1.SetAutoRepaint(TRUE);


Transparent example for Visual C++ 5.0

Transparent example for C++ 5.0 and later

long x,y;
//set the backcolor of the control to BLUE
m_LEADRasterView1.SetBackColor(RGB(0,0,255));
AfxMessageBox(TEXT("Pause"));
//create a 100x100 image
m_LEADRasterView1.GetRaster().CreateBitmap(100.0f, 100.0f, 24);
//fill some of the image with RED, the rest with black
m_LEADRasterView1.SetAutoRepaint(FALSE);
for(y=0; y<100; y++)
{
for(x=0; x<25; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(255,0,0));
for(x=25; x<75; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(0,0,0));
for(x=75; x<100; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(255,0,0));
}
m_LEADRasterView1.SetAutoRepaint(TRUE);
AfxMessageBox(TEXT("Pause"));
//now, set Red as the transparent color
m_LEADRasterView1.GetRaster().SetBitmapTransparentColor(RGB(255,0,0));
m_LEADRasterView1.GetRaster().SetBitmapEnableTransparency(TRUE);
AfxMessageBox(TEXT("Pause"));
//now set the control transparent
m_LEADRasterView1.SetTransparent(TRUE);


Trim example for Visual C++ 5.0

Trim example for C++ 5.0 and later

This example trims one-tenth from the bitmap and repaints the image.

float NewLeft = m_LEADRasterView1.GetRaster().GetBitmapWidth() * .1f;
float NewTop = m_LEADRasterView1.GetRaster().GetBitmapHeight() * .1f;
float NewWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth() * .8f;
float NewHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight() * .8f;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Trim(m_LEADRasterView1.GetRaster(),
NewLeft, NewTop, NewWidth, NewHeight);
// Set the image display size to match the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();


Tunnel Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth () / 2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/ 2;
m_pRasterProc->Tunnel(m_LeadRasterView.GetRaster(), CenterX, CenterY, 0, CenterY*2, CenterX, -1,0, 25,0,100, 20000, RGB(255,0,0), RGB(0,0,0),TUN_AXIS_WIDTH | PLANE_FILL_CLR);

m_pRasterProc->Release();


TXTTopMarg Example for C++ 5.0 and later

void Demo::LoadTxtFile()
{
//This example loads a TXT file, with a top margin, bottom margin, left margin, right margin ,font color, font size and bold formatting defined by the user
ILEADRasterIO * pRasterIO = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//Change TXT Options values
pRasterIO->TXTTopMarg = 1;
pRasterIO->TXTBottomMarg = 1;
pRasterIO->TXTRightMarg = 1.5;
pRasterIO->TXTLeftMarg = 1.5;
pRasterIO->TXTPaperWidth = 10;
pRasterIO->TXTPaperHeight = 10;
pRasterIO->TXTFaceName = "Arial";
pRasterIO->TXTFontSize = 12;
pRasterIO->TXTFontColor = RGB(255, 0, 0);
pRasterIO->TXTHighlight = RGB(0, 0, 255);
pRasterIO->TXTStrikeThrough = FALSE;
pRasterIO->TXTBold = TRUE;
pRasterIO->TXTItalic = FALSE;
pRasterIO->TXTUnderLine = FALSE;
pRasterIO->TXTEnabled = TRUE;

// Now load the TXT file
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\1.txt"), 0, 0, 1);

if(pRasterIO)
{
pRasterIO->Release();
}
}


Type example for Visual C++ 5.0

Type example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
CString strOut;

m_pRasterProc->GetOverlayAttributes(m_LeadRasterView.GetRaster(),0,OVERLAYATTRIBUTES_FLAGS);

strOut.Format("Type = %s \n"
"BitsAllocated = %d\n"
"Description = %s\n"
"Subtype = %s\n"
"Label = %s\n",
m_pRasterProc->OverlayAttributes->Type,
m_pRasterProc->OverlayAttributes->BitsAllocated,
m_pRasterProc->OverlayAttributes->Description,
m_pRasterProc->OverlayAttributes->Subtype,
m_pRasterProc->OverlayAttributes->Label);

MessageBox(strOut);
m_pRasterProc->Release();


Underlay example for Visual C++ 5.0

Underlay example for C++ 5.0 and later

This example loads a bitmap into m_Lead2 and uses it as a tiled underlay for m_Lead1.

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView2.ShowWindow(SW_HIDE);
pRasterIO->Load(m_LEADRasterView2.GetRaster(),
"d:\\lead14\\dist\\images\\ulay1.bmp", 0, 0, 1);
pRasterProc->Underlay(m_LEADRasterView1.GetRaster(),
m_LEADRasterView2.GetRaster(),
UNDERLAY_TILE);
m_LEADRasterView1.ForceRepaint();
pRasterIO->Release();
pRasterProc->Release();


UnsharpMask example for Visual C++ 5 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->UnsharpMask (m_RasterView.GetRaster (), 200, 15, 50, RGB_SPACE);
pRasterProc->Release();


UpdateMagGlassFromHandle Example for C++ 5.0 and later

BOOL CSampleDlg::OnInitDialog()
{
.
.
.
bLeftButton = false;
m_LeadRasterView.SetEnableMethodErrors(false);
m_pRasterIO->Load(m_LeadRasterView.GetRaster(),"Sample1.cmp ",0,0,1);
m_pRasterIO->Load(m_LeadRasterView2.GetRaster(),"Sample2.cmp ",0,0,1);
m_LeadRasterView.SetMagGlassFlags(MAGGLASS_MANUAL_UPDATE);

// Starting the Magnifying Glass
m_LeadRasterView.StartMagGlass(100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), false, 1, false, CROSSHAIR_FINE, true, true);

// Updating the Magnifying Glass bitmap of 1st control with bitmap of the
// 2nd control that has the same width and height.
m_LeadRasterView.UpdateMagGlassFromHandle(m_LeadRasterView2. GetRaster().GetBitmap(), true);

hMagGlassCursor = LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_MAGGLASS_CURSOR));
.
.
.
}

void CSampleDlg::OnMagGlassCursorLeadrasterview1()
{
// Check if the left button is not down and the Magnifying Glass is started
if (!(bLeftButton) && (m_LeadRasterView.GetHasMagGlass()))
::SetCursor(hMagGlassCursor);
}

void CSampleDlg::OnMouseDownLeadrasterview1(short Button, short Shift, float x, float y)
{
int nRet;
CString szMsg;

// Check if this is a left button and the Magnifying Glass is started
if (Button != 1 || !( m_LeadRasterView.GetHasMagGlass()))
return;

// Move the Magnifying Glass to the hit position
nRet = m_LeadRasterView.SetMagGlassPos((float) x, (float) y);
if (nRet != 0)
{
szMsg.Format(TEXT("Error while displaying Magnifying Glass, Error: %d"), nRet);
AfxMessageBox(szMsg);
return;
}

// Show the Magnifying Glass
nRet = m_LeadRasterView.ShowMagGlass(true);
if (nRet != 0)
{
szMsg.Format(TEXT("Error while displaying Magnifying Glass, Error: %d"), nRet);
AfxMessageBox(szMsg);
return;
}

// Left button is currently pressed
bLeftButton = true;

// Hide the cursor
::ShowCursor(false);
}

void CSampleDlg::OnMouseMoveLeadrasterview1(short Button, short Shift, float x, float y)
{
int nRet;
CString szMsg;

// Check if this is a left button and the Magnifying Glass is started
if (Button != 1 || !( m_LeadRasterView.GetHasMagGlass()))
return;

// Move the Magnifying Glass to the mouse position
nRet = m_LeadRasterView.SetMagGlassPos((float) x, (float) y);
if (nRet != 0)
{
szMsg.Format(TEXT("Error while Moving Magnifying Glass, Error: %d"), nRet);
AfxMessageBox(szMsg);
}
}

void CSampleDlg::OnMouseUpLeadrasterview1(short Button, short Shift, float x, float y)
{
int nRet;
CString szMsg;

// Check if this is a left button and the Magnifying Glass is started
if (Button != 1 || !( m_LeadRasterView.GetHasMagGlass()))
return;

// Show the Magnifying Glass
nRet = m_LeadRasterView.ShowMagGlass(false);
if (nRet != 0)
{
szMsg.Format(TEXT("Error while Hiding Magnifying Glass, Error: %d"), nRet);
AfxMessageBox(szMsg);
}

// Left button is released
bLeftButton = true;

// Show the cursor
::ShowCursor(true);
}


UpdateMagGlassShape example for C++ 5.0 and later

HRGN hRgn=NULL;
m_LEADRasterView1.SetScaleMode (3);
m_LEADRasterView1.SetRgnFrameType (0);
m_LEADRasterView1.StartMagGlass(100.0f, 100.0f, 400,
RGB(255, 0, 0), RGB(128, 128, 128),
TRUE, 1, FALSE, CROSSHAIR_FINE,
TRUE, TRUE);
hRgn = CreateRoundRectRgn(0, 0, 100, 100, 25, 25);
m_LEADRasterView1.UpdateMagGlassShape (MAGGLASS_SHAPE_HRGN, (long)hRgn);
DeleteObject(hRgn);
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
m_LEADRasterView1.StopMagGlass();


UpdateOverlayBits example for Visual C++ 5.0

UpdateOverlayBits example for C++ 5.0 and later

int nRet;
ILEADRaster *OverlayRaster = NULL;
CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&OverlayRaster
);

m_pRasterIO->Load(OverlayRaster,"c:\\dic2.cmp",0,0,1);
m_pRasterProc->SetOverlayBitmap(m_LeadRasterView.GetRaster() , 0, OverlayRaster, OVERLAY_MOVE);
if (nRet = 0)
{
m_pRasterProc->OverlayAttributes->Color = RGB(255, 255, 255);
m_pRasterProc->OverlayAttributes->Flags = OVERLAY_AUTOPROCESS | OVERLAY_AUTOPAINT;
m_pRasterProc->OverlayAttributes->OriginX = 0;
m_pRasterProc->OverlayAttributes->OriginY = 0;
m_pRasterProc->OverlayAttributes->BitPosition = m_LeadRasterView.GetRaster().GetBitmapBits() - 1;
m_pRasterProc->SetOverlayAttributes (m_LeadRasterView.GetRaster(), 0, OVERLAYATTRIBUTES_COLOR + OVERLAYATTRIBUTES_FLAGS + OVERLAYATTRIBUTES_ORIGIN + OVERLAYATTRIBUTES_BITINDEX);
}
m_pRasterProc-> UpdateOverlayBits( m_LeadRasterView.GetRaster(), 0, SETOVERLAYBITS_FROMOVERLAY);
m_pRasterProc-> Release();
OverlayRaster-> Release();


UpdateZoomView Example for Visual C++ 5.0 and later

ILEADRasterZoomView * pZoomView;
int nCount = 0;

HRESULT hr = CoCreateInstance(
CLSID_LEADRasterZoomView,
NULL,
CLSCTX_ALL,
IID_ILEADRasterZoomView,
(void**)&pZoomView
);

if (m_RasterView.GetHasZoomView())
{
nCount = m_RasterView.GetZoomViewsCount();
for (int i = 0; i< nCount; ++i)
{
pZoomView->Index = i;
m_RasterView.GetZoomView(pZoomView);
pZoomView->EnableCallouts = FALSE;
m_RasterView.UpdateZoomView(pZoomView);
}
}

pZoomView->Release();


UseFastConversion example for Visual C++

void CDemo::OnLoad()
{
ILEADRasterIO * pRasterIO = NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->PutUseFastConversion(TRUE);
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\1.jpg"), 0, 0, 1);

if(pRasterIO)
{
pRasterIO->Release();
}
}


UserFilter example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->UserFilterWidth = 3;
m_pRasterProc->UserFilterHeight = 3;
m_pRasterProc->UserFilterXCenter = 1;
m_pRasterProc->UserFilterYCenter = 1;
m_pRasterProc->UserFilterDivisor = 1;
m_pRasterProc->UserFilterOffset = 0;
m_pRasterProc->UserFilterFlags = UD_SUM;

for (int i = 0; i<m_pRasterProc->UserFilterWidth;++i)
{
for (int j = 0; j< m_pRasterProc->UserFilterHeight;++j)
{
if (j == 1 || i == 1)
{
if (j == 1 && i == 1)
{
m_pRasterProc->PutUserFilterData(i, j,5);
}
else
{
m_pRasterProc->PutUserFilterData(i, j, -1);
}
}
else
{
m_pRasterProc->PutUserFilterData(i, j , 0);
}
}
}

m_pRasterProc->UserFilter(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();


UseLUT example for Visual C++ 5.0

UseLUT example for C++ 5.0 and later

void CMfcDemoDlg::OnLoad()
{

long nHigh,nLow;

ILEADRasterIO *pRasterIO = NULL;
ILEADRasterProcess *pRasterProc = NULL;

CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);

CoCreateInstance(
CLSID_LEADRasterProcess,
NULL,
CLSCTX_ALL,
IID_ILEADRasterProcess,
(void**)&pRasterProc
);

pRasterIO->Load((m_RasterView.GetRaster()),"c:\\16.jpg",16,0,1);

m_RasterView.GetRaster().GetMinMaxBits();
m_RasterView.GetRaster().GetMinMaxVal();

m_RasterView.GetRaster().SetLevelLowBit(0);
m_RasterView.GetRaster().SetLevelHighBit(m_RasterView.GetRaster().GetBitmapBits()
 - 1);

nLow = m_RasterView.GetRaster().GetMinBit ();

nHigh = 1<<(m_RasterView.GetRaster().GetMaxBit() - m_RasterView.GetRaster().
GetMinBit() + 1);

//allocate the LUT
m_RasterView.GetRaster().SetLevelLUT(nHigh -
 1, 0);

//fill the entire LUT with gradient from RED to BLUE
m_RasterView.GetRaster().WindowLevelFillLUT(
 RGB(255, 0, 0),
RGB(0, 0, 255),
nLow, nHigh,
m_RasterView.GetRaster().GetMinBit (),
m_RasterView.GetRaster().GetMaxBit(),
m_RasterView.GetRaster().GetMinVal(),
m_RasterView.GetRaster().GetMaxVal(),
0,
FILLLUT_INSIDE | FILLLUT_LINEAR);

m_RasterView.GetRaster().SetUseLUT (TRUE);
pRasterProc->ColorRes(m_RasterView.GetRaster(),24,
 CRP_BYTEORDERBGR, CRD_NODITHERING, 0);

pRasterIO->Release();
pRasterProc->Release();
}


UserPalette and BitmapPalette example for Visual C++ 5.0

UserPalette and BitmapPalette example for C++ 5.0 and later

This example demonstrates the UserPalette and BitmapPalette properties.

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
// Specify a blue and white user palette
pRasterProc->PutUserPalette(0, RGB(0, 0, 255));
pRasterProc->PutUserPalette(1, RGB(255, 255, 255));
// Implement the user palette
pRasterProc->ColorRes(m_LEADRasterView1.GetRaster(),
1, CRP_USERPALETTE,
CRD_ORDEREDDITHERING, 2);
// Display the blue and white image
m_LEADRasterView1.ForceRepaint();
MessageBox(TEXT("This is the user palette. Click OK to change the bitmap palette."));
// Change the bitmap palette to red and white
m_LEADRasterView1.GetRaster().SetBitmapPalette(0, RGB(255, 0, 0));
m_LEADRasterView1.GetRaster().SetBitmapPalette(1, RGB(255, 255, 255));
// Display the red and white image
m_LEADRasterView1.ForceRepaint();


UserSegmentInfo Example for Visual C++ 5.0 and later

void CTestPDFCOMP::OnInsertWitUserSegments()
{

ILEADRaster* m_pltRaster;
ILEADRasterIO* m_pltRasterIO;
ILEADPDFCompressor* m_pltPDFComp;

CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pltRaster);
if (FAILED(hr))
return;

hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pltRasterIO);
if (FAILED(hr))
{
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

hr = CoCreateInstance(CLSID_LEADPDFCompressor, NULL, CLSCTX_ALL, IID_ILEADPDFCompressor, (void**)&m_pltPDFComp);
if (FAILED(hr))
{
m_pltRasterIO->Release();
m_pltRasterIO = NULL;
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}

m_pltRasterIO-> LoadArray (m_pltRaster,"c:\\Image.cmp",0,0,1);

m_pltPDFComp->PDFCompInit (FALSE);

m_pltPDFComp->UserSegmentInfoCount = 2;

m_pltPDFComp->UserSegmentInfo[0]->SegmentLeft = 0;
m_pltPDFComp->UserSegmentInfo[0]->SegmentBottom = m_pltRaster->BitmapHeight / 2;
m_pltPDFComp->UserSegmentInfo[0]->SegmentRight = m_pltRaster->BitmapWidth / 2;
m_pltPDFComp->UserSegmentInfo[0]->SegmentType = PDFCOMP_SEGMENT_TYPE_PICTURE;
m_pltPDFComp->UserSegmentInfo[0]->SegmentColorsCount = 0;

m_pltPDFComp->UserSegmentInfo[1]->SegmentTop = m_pltRaster->BitmapHeight / 2;
m_pltPDFComp->UserSegmentInfo[1]->SegmentLeft = m_pltRaster->BitmapHeight / 2;
m_pltPDFComp->UserSegmentInfo[1]->SegmentBottom = m_pltRaster->BitmapHeight;
m_pltPDFComp->UserSegmentInfo[1]->SegmentRight = m_pltRaster->BitmapWidth;
m_pltPDFComp->UserSegmentInfo[1]->SegmentType = PDFCOMP_SEGMENT_TYPE_PICTURE;
m_pltPDFComp->UserSegmentInfo[1]->SegmentColorsCount = 0;

m_pltPDFComp->PDFCompInsertSegments ( m_pltRaster, RGB(255,255,255), TRUE);

m_pltPDFComp->PDFCompWrite ("c:\\output.pdf");
m_pltPDFComp->PDFCompFree ();

m_pltRasterIO->Release();
m_pltRaster->Release();
m_pltPDFComp->Release();
m_pltPDFComp = NULL;
m_pltRasterIO = NULL;
m_pltRaster = NULL;
}


UserShape Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->LightAngle = 9000;
m_pRasterProc->LightFrequency = 10;
m_pRasterProc->LightFlags = FL_FREEHAND | FL_ADD;
m_pRasterProc->UserShapeCount = 10;

for (int i = 0; i<m_pRasterProc->UserShapeCount;++i)
{
m_pRasterProc->PutUserShape(i, i * 100);
}

m_pRasterProc->FunctionalLight(m_LeadRasterView.GetRaster ());
m_pRasterProc->Release();


ViewSize example for Visual C++ 5

ViewSize example for C++ 5 and later

int nSize;
int nFirst;
int nLast;
int nCols;
int nCount;

//NOTE: assume scroll style = SCROLLSTYLE_VERTICAL
//get the view size
nSize = m_LEADRasterImgList1.GetViewSize();
//get the first visible item
nFirst = m_LEADRasterImgList1.GetFirstVisibleItem();
//get the column count
nCols = m_LEADRasterImgList1.GetColumnCount();
//calculate the index of last visible item
nLast = nFirst + (nSize * nCols) - 1; //0 based index
nCount = m_LEADRasterImgList1.GetCount();
if (nLast > nCount - 1)
nLast = nCount - 1;
CString out;
out.Format(TEXT("nSize = %d\nnFirst = %d\nnLast = %d\nnCols = %d\nnCount = %d\n"), nSize, nFirst, nLast, nCols, nCount);
AfxMessageBox(out);


Vignette example for Visual C++

int iXCenter, iYCenter;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iXCenter = m_LeadRasterView.GetRaster().GetBitmapWidth() / 2;
iYCenter = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;
m_pRasterProc->Vignette(m_LeadRasterView.GetRaster(), iXCenter, iYCenter, 50, 100, iXCenter, iYCenter, RGB(0,0,255), VIG_ELLIPSE | VIG_FILLIN);
m_pRasterProc->Release();


Vtable example for Visual C++ 5.0

VTable example for C++ 5.0 and later

//This example remaps the "value" of each color to one half its original
void CRemapHueDlg::OnVTable()
{
int i;
ILEADRasterProcess *pRasterProc=NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (pRasterProc != NULL)
{
for (i=0; i<256; i++)
{
pRasterProc->PutVTable (i, i/2);
}
pRasterProc->RemapHue (m_RasterView.GetRaster(), FALSE, FALSE, FALSE, TRUE);
}
pRasterProc->Release();
}


vType example for C++ 5 and later

ILEADRasterVariant * pltRasVar=NULL;
pltRasVar->PutEnableMethodErrors(FALSE);
pltRasVar->PutvType(VALUE_SHORT);
pltRasVar->PutShortValue(5);
if (pltRasVar->GetError() == 0)
::MessageBox(NULL, TEXT("The short value is set correctly"),
 TEXT("Notice!"), MB_OK);


Wave Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

m_pRasterProc->Wave(m_LeadRasterView.GetRaster (), 20, 25 ,0 ,100 ,100, RGB(0,0,0) ,FILL_RPT | DIS_PER | WV_SIN );
m_pRasterProc->Release();


Wind Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->Wind(m_LeadRasterView.GetRaster (), 40, 180,0);
m_pRasterProc->Release();


Window example for Visual C++ 5.0

Window example for C++ 5.0 and later

//This example shows how to call one of the Windows API functions and pass the ImageList Control's //Window property as a parameter.

//hide the control
::ShowWindow(HWND(m_LEADImageList.GetWindow()), SW_HIDE);
AfxMessageBox(TEXT("wait"));
//restore the window
::ShowWindow(HWND(m_LEADImageList.GetWindow()), SW_HIDE);


WindowLevel example for Visual C++ 5.0

WindowLevel example for C++ 5.0 and later

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
//WindowLevel for Display
pRasterProc->Grayscale(m_LEADRasterView1.GetRaster(), 12);//Grayscale image to 12-bit
m_LEADRasterView1.GetRaster().SetLevelLowBit(8);//use 4 most significant bits
m_LEADRasterView1.GetRaster().SetLevelHighBit(11);
m_LEADRasterView1.WindowLevel();
pRasterProc->Release();

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
//WindowLevel image processing
pRasterProc->Grayscale(m_LEADRasterView1.GetRaster(), 12);//Grayscale image to 12-bit
m_LEADRasterView1.GetRaster().SetLevelLowBit(8);//use 4 most significant bits
m_LEADRasterView1.GetRaster().SetLevelHighBit(11);
pRasterProc->WindowLevel(m_LEADRasterView1.GetRaster());
pRasterProc->Release();

//This example loads a 16-bit grayscale, fills the window level lookup table,
//and window levels the bitmap for display only
long i;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
//Load a 16-bit grayscale image
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\dicom\\image2.dic",
0, 0, 1);
m_LEADRasterView1.SetAutoRepaint(FALSE);

//Use all bits
m_LEADRasterView1.GetRaster().SetLevelLowBit(0);
m_LEADRasterView1.GetRaster().SetLevelHighBit(m_LEADRasterView1.GetRaster().GetBitmapBits() - 1);

m_LEADRasterView1.GetRaster().GetMinMaxBits();
m_LEADRasterView1.GetRaster().GetMinMaxVal();

//Set LUT so the range is from pure blue to pure red
for(i=m_LEADRasterView1.GetRaster().GetMinVal(); i<m_LEADRasterView1.GetRaster().GetMaxVal();i++)
m_LEADRasterView1.GetRaster().SetLevelLUT(i, RGB(i % 256, 0, 256 - i % 256));

//Window level for display only--leave the bitmap data unchanged
m_LEADRasterView1.WindowLevel();
m_LEADRasterView1.ForceRepaint();
pRasterIO->Release();
pRasterProc->Release();


WindowLevelFillLUT example for Visual C++ 5.0

WindowLevelFillLUT example for C++ 5.0 and later

   long nHigh;
long nLow;
long
 fSigned;

m_LeadRasterView.GetRaster().GetMinMaxBits();
m_LeadRasterView.GetRaster().GetMinMaxVal();

m_LeadRasterView.GetRaster().SetLevelLowBit(0);
m_LeadRasterView.GetRaster().SetLevelHighBit(m_LeadRasterView.GetRaster().GetBitmapBits() - 1);

nLow = m_LeadRasterView.GetRaster().GetMinBit();

nHigh = 1<<(m_LeadRasterView.GetRaster().GetMaxBit() - m_LeadRasterView.GetRaster().
GetMinBit() + 1);

//allocate the LUT
m_LeadRasterView.GetRaster().SetLevelLUT(nHigh - 1, 0);

//set
 the FILLLUT_SIGNED flag for signed images
fSigned
 = FILLLUT_UNSIGNED;
if
 (m_LeadRasterView.GetRaster().GetIsSigned())
{
fSigned
 = FILLLUT_SIGNED;
}

//fill the entire LUT with gradient from RED to BLUE
m_LeadRasterView.GetRaster().WindowLevelFillLUT( RGB(255, 0, 0),
RGB(0, 0, 255),
nLow, nHigh,
m_LeadRasterView.GetRaster().GetMinBit(),
m_LeadRasterView.GetRaster().GetMaxBit(),
m_LeadRasterView.GetRaster().GetMinVal(),
m_LeadRasterView.GetRaster().GetMaxVal(),
0,
FILLLUT_INSIDE | FILLLUT_LINEAR
 | fSigned);

//now use it
m_LeadRasterView.WindowLevel();


WMFResolution example for Visual C++ 5.0

WMFResolution example for C++ 5.0 and later

//This example displays the default resolution stored in a WMF,
//changes the resolution to 150 dpi, and then loads the image

CString str;
//Display resolution stored in WMF
//Note that InfoXRes and InfoYRes will return the same value
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
"v:\\compiler\\vb40\\metafile\\arrows\\2darrow1.wmf",0, 0);
str.Format(TEXT("InfoXRes: %d\nInfoYRes: %d"),
pRasterIO->GetInfoXRes(),
pRasterIO->GetInfoYRes());
AfxMessageBox(str);

//Set resolution so WMF is loaded at 150 dpi
pRasterIO->put_WMFResolution(150);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\compiler\\vb40\\metafile\\arrows\\2darrow1.wmf",0,0,1);
pRasterIO->Release();


WriteComment example for Visual C++ 5.0

WriteComment example for C++ 5.0 and later

void CTest4Dlg::OnSetComment()
{
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

pltRasVar->Type = VALUE_STRING;
pltRasVar->StringValue = "Me";
pRasterIO->PutComment(CMNT_SZARTIST, pltRasVar);
pRasterIO->WriteComment("d:\\temp\\Test.tif", 1);

pltRasVar = pRasterIO->ReadComment(m_LEADRasterView1.GetRaster(), "d:\\temp\\Test.tif",
1, CMNT_SZARTIST);
MessageBox(pltRasVar->StringValue);
pRasterIO->Release();
pltRasVar->Release ();
}


WriteGeoKey Example for Visual C++ 5.0

WriteGeoKey Example for Visual C++

/* Displays a GeoKey */
void DisplayKey(long uTag, long uType, long uCount, ILEADRasterVariant * pData)
{
CString csBuffer;

csBuffer.Format(TEXT("Key = %d\nType %s\nCount = %d\n"), uTag, (uType == TAG_ASCII) ? TEXT("ASCII") : (uType == TAG_SHORT) ? TEXT("SHORT") : TEXT("DOUBLE"), uCount);
MessageBox(NULL, csBuffer, TEXT("Key Data"), MB_OK);

if (uType == TAG_SHORT)
{
if (uCount == 1)
csBuffer.Format(TEXT("Key Value = %d"), pData->ShortValue);
else
csBuffer.Format(TEXT("Key Value = %d"), pData->ShortItemValue [0]);
}
else
{
if (uType == TAG_DOUBLE)
if (uCount == 1)
csBuffer.Format(TEXT("Key Value = %d"), pData->DoubleValue);
else
csBuffer.Format(TEXT("Key Value = %d"), pData->DoubleItemValue [0]);
}

MessageBox(NULL, csBuffer, TEXT("Data"), MB_OK);
}

/* This example sets the GTModelTypeGeoKey key (1024), writes it to an existing file and reads the key back */
ILEADRasterVariant * pRasVar = NULL;
void TestReadFileGeoKey(ILEADRasterIO * pRasterIO)
{
pRasVar->Type = VALUE_SHORT;
pRasVar->ShortValue = 1;

pRasterIO->put_GeoKeyType (TAG_SHORT);
pRasterIO->put_GeoKeyCount (1);
pRasterIO->put_GeoKeyData (pRasVar);

// set the GTModelTypeGeoKey key
pRasterIO->SetGeoKey (1024);

// write the GeoKey to an existing file
short nRet = pRasterIO->WriteFileGeoKey (TEXT("GeoTIFF.tif"), 0, SAVE_OVERWRITE);
if (nRet == 0)
{
nRet = pRasterIO->ReadFileGeoKey (TEXT("GeoTIFF.tif"), 1024);
if (nRet == 0)
{
long uType, uCount;
pRasterIO->get_GeoKeyType (&uType);
pRasterIO->get_GeoKeyCount (&uCount);
pRasterIO->get_GeoKeyData (&pRasVar);

DisplayKey(1024, uType, uCount, pRasVar);
}
}
}


WriteMarkerAction example for Visual C++ 5.0

WriteMarkerAction example for C++ 5.0 and later

void CTutorDlg::OnButtonWritemarker()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

DWORD dwCookie;
CRasterIOSink *pRasterIOSink;
//Instantiate the sink class and hold a pointer to it.
pRasterIOSink = new CRasterIOSink;
pRasterIOSink->m_pDlg = this;
pRasterIOSink->m_pRasterIO = pRasterIO;
//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = pRasterIOSink->GetIDispatch(FALSE);
AfxConnectionAdvise(pRasterIO, DIID__LEADRasterIOEvents, pUnkSink, FALSE, &dwCookie);

// Rotate the file 90 degrees
pRasterIO->TransformFile("c:\\temp\\1.jpg", "c:\\temp\\2.jpg", FILE_TRANSFORM_ROTATE90, 1);

//Terminate a connection between source and sink.
pUnkSink = pRasterIOSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(pRasterIO, DIID__LEADRasterIOEvents, pUnkSink, FALSE, dwCookie);
delete pRasterIOSink;
pRasterIOSink = NULL;

pRasterIO->Release();
}

void CRasterIOSink::OnTransformMarker ( short iMarker, long lSize, ILEADRasterVariant * vData, short iTransform )
{
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
// I will replace the comment present in the file with my own comment
if(iMarker == 0xFE)
{
pltRasVar->Type = VALUE_STRING;
pltRasVar->StringValue = "My comment";

m_pRasterIO->WriteMarkerAction = WRITEMARKER_IGNORE;
m_pRasterIO->WriteMarker(iMarker, 10,pltRasVar );
}

pltRasVar->Release();
}


WriteMetaData example for C++ 5.0 and later

pMarker1->Load("c:\\image1.jpg",0);
pRasterIO->SetMarkers (pMarker1 ,0);
pRasterIO->WriteMetaData ("c:\\image2.tif",METADATA_ALL);


ZigZag example for Visual C++

int iXCenter, iYCenter;
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

iXCenter = m_LeadRasterView.GetRaster().GetBitmapWidth() / 2;
iYCenter = m_LeadRasterView.GetRaster().GetBitmapHeight() / 2;
m_pRasterProc->ZigZag(m_LeadRasterView.GetRaster(), 50, 1000, 10, 0, iXCenter, iYCenter, 0, FILL_RPT | ZG_POND);
m_pRasterProc->Release();


ZoomBlur Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth ()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/2;
m_pRasterProc->ZoomBlur(m_LeadRasterView.GetRaster(), 50, 5,CenterX,CenterY); m_pRasterProc->Release();


ZoomIn example for Visual C++ 5.0

ZoomIn example for C++ 5.0 and later

This example calls ZoomIn() method to zoom in on a captured image.

m_LEADRasterView1.ZoomIn();


ZoomInDone example for Visual C++ 5.0

ZoomInDone example for C++ 5.0 and later

This example triggers the ZoomInDone event and displays a message that the ZoomIn image has been captured.

void CZoomDlg::OnZoomInDoneLeadctrl1(long x, long y)
{
CString cs;

cs.Format(TEXT("ZoomIn Captured: %ld,%ld"), x, y);
AfxMessageBox(cs);
}


ZoomWave Example for C++ 5.0 and later

ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);

int CenterX = m_LeadRasterView.GetRaster ().GetBitmapWidth ()/2;
int CenterY = m_LeadRasterView.GetRaster().GetBitmapHeight ()/2;
m_pRasterProc->ZoomWave(m_LeadRasterView.GetRaster(), 20, 10, 0, 0, CenterX, CenterY RGB(0,0,0), FILL_RPT);
m_pRasterProc->Release();


Tutorial for C++ Builder Programmers

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

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Using ODBC to Access Image Data

Implementing a Database with the MS ADO Data Control

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Using the Magnifying Glass

Using a PanWindow

Miscellaneous Examples


Loading and Displaying an Image (C++ Builder 4.0)

Take the following steps to start a project and to add some code that displays an image on the main form:

1. | Start C++ Builder 4.0.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control, as you want it to appear at run time.
4. | Add a button to your form and name it as follows:
 | Name | Caption
 | LoadLead | Load Image
5. | Code the main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
//Set defaults for displaying the image
//These are all persistent properties that can be set in the properties
 box->
LEADRasterView1->Appearance
 = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle
 = 1;
LEADRasterView1->BackColor
 = (TColor)RGB(255, 255, 125);
LEADRasterView1->PaintDither
 = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette
 = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint
 = True;
LEADRasterView1->AutoSize
 = False;
LEADRasterView1->AutoSetRects
 = True;
LEADRasterView1->PaintSizeMode
 = PAINTSIZEMODE_FIT;
LEADRasterView1->EnableFireMouse2Event
 = true;
}

6.

Code the LoadLead button's click procedure as follows:

void __fastcall TForm1::LoadLeadClick(TObject *Sender)
{
ILEADRasterIO * pRasterIO;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO);
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"),
 0, 0, 1);
pRasterIO->Release();
}

7. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14.5), and Press Ok.
8. | At the beginning of the Unit1.h file, Include these files.

#include "Ltrasteriolib_tlb.h"
#include "Ltrasterlib_tlb.h"

9. | Run your program to test it.
10. | Save the project to use as a starting point for other tasks in this tutorial.


Zooming Out and Zooming In (C++ Builder 4.0)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD RasterView control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add two buttons to your form and name them as follows:
 | Name | Caption
 | ZoomIn | Zoom In
 | ZoomOut | Zoom Out
3. | Code the ZoomIn button's click procedure as follows:

void __fastcall TForm1::ZoomInClick(TObject *Sender)
{
LEADRasterView1->AutoSetRects
 = True;
LEADRasterView1->PaintSizeMode
 = PAINTSIZEMODE_ZOOM;
LEADRasterView1->PaintZoomFactor
 = LEADRasterView1->PaintZoomFactor + 10;
}

4.

Code the ZoomOut button's click procedure as follows:

void __fastcall TForm1::ZoomOutClick(TObject *Sender)
{
LEADRasterView1->AutoSetRects= True;
LEADRasterView1->PaintSizeMode= PAINTSIZEMODE_ZOOM;
if ( LEADRasterView1->PaintZoomFactor> 10 )
LEADRasterView1->PaintZoomFactor= LEADRasterView1->PaintZoomFactor
 - 10;
}

5.

Run your program to test it.


Dynamically Positioning the Control (C++ Builder 4.0)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the LeadLoad button's click procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying an Image.

void __fastcall TForm1::LoadLeadClick(TObject *Sender)
{
ILEADRasterIO * pRasterIO;
long int HeightFactor;
long int WidthFactor;
long int HeightAllowed;
long int WidthAllowed;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO);
// Get file information
pRasterIO->GetFileInfo
 (LEADRasterView1->Raster,
 AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0);
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
HeightFactor = pRasterIO->InfoHeight;
WidthFactor = pRasterIO->InfoWidth;
HeightAllowed = ClientHeight * 3.0f / 4;
WidthAllowed = ClientWidth * 3.0f / 4;
// Center the LEAD control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1->Left = ClientWidth / 8.0f;
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (Width * HeightFactor) / WidthFactor;
LEADRasterView1->Top = (ClientHeight - Height) / 2;
}
else
{
LEADRasterView1->Top = ClientHeight / 8.0f;
LEADRasterView1->Height = HeightAllowed;
LEADRasterView1->Width = (Height * WidthFactor) / HeightFactor;
LEADRasterView1->Left = (ClientWidth - Width) / 2;
}
// Set up for handling our own display rectangles.
LEADRasterView1->AutoScroll
 = false;
LEADRasterView1->AutoRepaint
 = true;
// Load the bitmap
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"),
 0, 0, 1);
// Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect
 (0.0f, 0.0f,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect
 (0.0f, 0.0f,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
pRasterIO->Release();
}

3.

Run your program to test it.


Zooming In on a Selection (C++ Builder 4.0)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

void __fastcall TForm1::LEADRasterView1MouseDown2(TObject
 *Sender,
short Button, short Shift, long x, long y)
{
//Enable AutoRubberBand
LEADRasterView1->AutoRubberBand
 = true;
LEADRasterView1->MousePointer
 = 2;
}

3.

Code the LEADRasterView1 control's Rubberband procedure, as the following:

void __fastcall TForm1::LEADRasterView1RubberBand
 (TObject *Sender)
{
int zoomleft;
int zoomtop;
int zoomwidth;
int zoomheight;

LEADRasterView1->MousePointer
 = 0;
//Zoom in on the selection
zoomleft = LEADRasterView1->RubberBandLeft;
zoomtop = LEADRasterView1->RubberBandTop;
zoomwidth = LEADRasterView1->RubberBandWidth;
zoomheight = LEADRasterView1->RubberBandHeight;
//Zoom in on the rectangle defined by the rubberband
LEADRasterView1->ZoomToRect
 (zoomleft, zoomtop, zoomwidth, zoomheight);
LEADRasterView1->Refresh () ;
}

4.

Run your program to test it.


Outlining, Dragging, and Pasting a Region (C++ Builder 4.0)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a second LEAD RasterView control, name it LEADRasterView2, and set its Visible property to False.
 | Note: for simplicity, this example uses 2 controls. In order to save memory, your application could use a dynamically created ILEADRaster object instead of the 2nd LEAD Raster View control.
3. | Add the following form-level variables to the Unit1.h file private declarations section. In online help, you can use the Edit pull-down menu to copy the block of code.

bool ReadyToDrag; //The state after marking the region but before dragging
bool Dragging; //The state when the mouse is used for dragging the floater
float StartX; //Starting X position in screen twips
float StartY; //Starting Y position in screen twips
float FloaterX; //Floater X position in screen twips
float FloaterY; //Floater Y position in screen twips
float ZoomFactorX; //Used for translating positioning information
float ZoomFactorY; //Used for translating positioning information

4. | At the top of your main form, add two buttons and name them as follows:
 | Name | Caption
 | SelRgnBtn | Select Region
 | PasteFloaterBtn | Paste Floater
5. | Code SelRgnBtn control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::SelRgnBtnClick(TObject *Sender)
{
LEADRasterView1->RgnFrameType
 = RGNFRAME_ANIMATED;
LEADRasterView1->Raster->RefBitmap
 = false ;
LEADRasterView1->RgnMarkingMode
 = RGNMARK_FREEHAND;
ShowMessage ( "Draw a freehand region" ) ;
}

6.

Code the PasteFloaterBtn control's Click procedure:

void __fastcall TForm1::PasteFloaterBtnClick(TObject
 *Sender)
{
LEADRasterProcess* pRasterProc= NULL;;
float LCRgnX;
float LCRgnY;
float LCRgnWidth;
float LCRgnHeight;
float LBRgnX;
float LBRgnY;
float LBRgnWidth;
float LBRgnHeight;
CombineConstants MyOp ;

//Do nothing if there is no floater
if (LEADRasterView1->Floater
 == 0 )
return;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&pRasterProc);
//Get the floater into another bitmap
LEADRasterView2->Raster->RefBitmap
 = false;
LEADRasterView2->ScaleMode
 = LEADRasterView1->ScaleMode;
LEADRasterView2->Raster->Bitmap
 = LEADRasterView1->Floater;
//Get the floater's client coordinates into local variables
LCRgnX = LEADRasterView1->FloaterDstLeft;
LCRgnY = LEADRasterView1->FloaterDstTop;
LCRgnWidth = LEADRasterView1->FloaterDstWidth;
LCRgnHeight = LEADRasterView1->FloaterDstHeight;
//Delete the floater->
LEADRasterView1->FloaterVisible
 = false;
LEADRasterView1->Floater
 = 0;
//Translate the client coordinates to bitmap coordinates
LBRgnX = ((LCRgnX - LEADRasterView1->DstLeft)
 / ZoomFactorX) + LEADRasterView1->SrcLeft;
LBRgnY = ((LCRgnY - LEADRasterView1->DstTop)
 / ZoomFactorY) + LEADRasterView1->SrcTop;
LBRgnWidth = LCRgnWidth / ZoomFactorX;
LBRgnHeight = LCRgnHeight / ZoomFactorY;
//Reposition the region to use as a mask for the Combine method
LEADRasterView1->Raster->OffsetRgn
 ( LBRgnX - LEADRasterView1->Raster->Rgnleft,
 LBRgnY - LEADRasterView1->Raster->Rgntop
 ) ;
//Use the Combine method to paste the Lead2 bitmap into the Lead1 bitmap
MyOp = (CombineConstants)(CB_OP_ADD + CB_DST_0) ; //Operation flags for
 a simple paste
pRasterProc->Combine ( LEADRasterView1->Raster,
 LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2->Raster,
 0, 0, MyOp ) ;
//Repaint the part of the client area that has changed
LEADRasterView1->RepaintRect
 (LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, false);
//Free the region
LEADRasterView1->Raster->FreeRgn
 ( ) ;
pRasterProc->Release();
}

7.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

void __fastcall TForm1::LEADRasterView1MouseDown2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
float BitmapX;
float BitmapY;
float NewX;
float NewY;
float NewWidth;
float NewHeight;

//Do nothing if we are drawing a region.
if (LEADRasterView1->RgnMarkingMode
 != RGNMARK_NONE)
return;
//Save the starting position, in case we need it.
StartY= y;
StartX= x;
//If we are ready to drag the selection, get a floater.
if (ReadyToDrag)
{
//Translate the current mouse coordinates.
//These coordinates account for the zoom factor and offset.
ZoomFactorX = LEADRasterView1->DstWidth
 / LEADRasterView1->SrcWidth;
ZoomFactorY = LEADRasterView1->DstHeight
 / LEADRasterView1->SrcHeight;
BitmapX = (x / ZoomFactorX) - (LEADRasterView1->DstLeft
 / ZoomFactorX)
+ LEADRasterView1->SrcLeft;
BitmapY = (y / ZoomFactorY) - (LEADRasterView1->DstTop
 / ZoomFactorY)
+ LEADRasterView1->SrcTop;
//Continue to create the floater if the mouse is pointing to the region
 we marked

if ( LEADRasterView1->Raster->IsPtInRgn
 (BitmapX, BitmapY) )
{
//Hide the region frame->
LEADRasterView1->RgnFrameType
 = RGNFRAME_NONE;
//Create the floater bitmap, which will be the part of the main bitmap
 that is
//in the region's bounding rectangle
LEADRasterView1->Floater
 = LEADRasterView1->Raster->Bitmap;
//Translate the bitmap region coordinates to client area coordinates
NewY = ((LEADRasterView1->Raster->Rgntop
 - LEADRasterView1->SrcTop)
 * ZoomFactorY)
+ LEADRasterView1->DstTop;
NewX = ((LEADRasterView1->Raster->Rgnleft
 - LEADRasterView1->SrcLeft)
 * ZoomFactorX)
+ LEADRasterView1->DstLeft;
NewWidth = LEADRasterView1->Raster->RgnWidth
 * ZoomFactorX;
NewHeight = LEADRasterView1->Raster->RgnHeight
 * ZoomFactorY;
//Set the initial display position of the floater
LEADRasterView1->SetFloaterDstRect
 ( NewX, NewY, NewWidth, NewHeight) ;
//Set form-level variables
FloaterY = LEADRasterView1->FloaterDstTop;
FloaterX = LEADRasterView1->FloaterDstLeft;
LEADRasterView1->FloaterVisible
 = True;
Dragging = True;
ReadyToDrag = False;
}
}
}

8.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

void __fastcall TForm1::LEADRasterView1MouseMove2(TObject
 *Sender,
short Button, short Shift, long x, long y)
{
float xDelta;
float yDelta;
float NewX;
float NewY;
float NewWidth;
float NewHeight;

//Do nothing if we are drawing a region.
if (LEADRasterView1->RgnMarkingMode
 !=RGNMARK_NONE)
return;
//Reposition the floater if we are dragging it.
if ((Dragging) && (Button == 1) && (LEADRasterView1->Floater != 0))
{
if ( LEADRasterView1->IsPtInFloater
 (x, y))
{
//Update the position variables->
xDelta = x - StartX;
yDelta = y - StartY;
NewX = FloaterX + xDelta;
NewY = FloaterY + yDelta;
NewWidth = LEADRasterView1->FloaterDstWidth
 ;
NewHeight = LEADRasterView1->FloaterDstHeight;
//Reposition the floater
LEADRasterView1->SetFloaterDstRect
 (NewX, NewY, NewWidth, NewHeight) ;
//Save the form-level position variables->
FloaterY = NewY;
FloaterX = NewX;
StartY = y;
StartX = x;
}
}
}

9.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

void __fastcall TForm1::LEADRasterView1MouseUp2(TObject
 *Sender,
short Button, short Shift, long x, long y)
{
//if we were drawing a region, set up for the next operation.
if ( LEADRasterView1->RgnMarkingMode
 != RGNMARK_NONE )
{
LEADRasterView1->RgnMarkingMode = RGNMARK_NONE;
LEADRasterView1->RgnFrameType
 = RGNFRAME_STATIC;
ReadyToDrag = True;
ShowMessage ( "Now, drag the selection to another place." ) ;
}
}

10. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
11. | At the beginning of the Unit1.cpp file, include this file:

#include "LTRASTERPROCLib_TLB.h"

12.

Run your program to test it.


Creating and Using Annotations (C++ Builder 4.0)

Note:

This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Annotation Library (14.5 and Press Ok.
3. | At the beginning of the Unit1.h file, include this file.

#include "LTANNLib_TLB.h"

4. | If you didn’t install LEADEventSink, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
5. | Open the LEvntSnk.hpp file and delete those lines from the TLEADAbstractEventSink class.

private:
void *__IDispatch; /* IDispatch */

public:
operator IDispatch*(void) { return (IDispatch*)&__IDispatch; }
operator IUnknown*(void) { return (IUnknown*)&__IDispatch; }
and save the file.

6. | From the ActiveX controls, Add the LEvntSnk control to your form.
7. | Add the following variable’s decalaration to Unit1.h Private section.

LEADRasterAnnotation * pRasterAnn;
LEADRasterAnnToolBar * pRasAnnToolbar;
int NewTag;

8.

Add the following code to the LoadLead click’s procedure.

 LEADRasterView1->Raster ->UnlockSupport
 (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));

CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation,
 (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar,
 (void**)&pRasAnnToolbar);
//Connect the raster annotation object to the RasterView control
pRasterAnn->AnnParentRasterView
 = LEADRasterView1->Raster;

//Enable left button drawing of annotations
pRasterAnn->AnnAutoDrawEnable
 = True;

//Enable right-click to display annotation menus
pRasterAnn->AnnAutoMenuEnable
 = True;
pRasterAnn->AnnUserMode
 = ANN_USERMODE_DESIGN;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);

9.

Code the Close event’s procedure as follows:

void __fastcall TForm1::FormClose(TObject *Sender,
 TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasAnnToolbar)
pRasAnnToolbar-> Release();
}

10. | At the top of your main form, add four buttons and name them as follows:
 | Name | Caption
 | AnnToggle | Start
 | IOToggle | Save
 | ClipboardToggle | Copy
 | Realize | Realize
11. | Code the AnnToggle control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::AnnToggleClick(TObject *Sender)
{
//Use the button to toggle between design mode and run mode
if (AnnToggle->Caption == "Start")
{
pRasterAnn->AnnUserMode
 = ANN_USERMODE_DESIGN;
pRasterAnn->AnnTool
 = ANN_TOOL_BUTTON;
//Make run mode the next thing.
AnnToggle->Caption= "Run Mode";
ShowMessage ("In design mode now. Draw a button object.");
}
else
{
if (AnnToggle->Caption == "Design Mode")
{
pRasterAnn->AnnUserMode= ANN_USERMODE_DESIGN;
pRasterAnn->AnnTool= ANN_TOOL_BUTTON;
//Make run mode the next thing.
AnnToggle->Caption= "Run Mode";
}
else //The button takes us to run mode
{
pRasterAnn->AnnUserMode
 = ANN_USERMODE_RUN;
ShowMessage ("Click on your new button");
AnnToggle->Caption= "Design Mode";
}
}
}

12.

Code the IOToggle control's Click procedure as follows:

void __fastcall TForm1::IOToggleClick(TObject *Sender)
{
int nRet;

//Disable errors so that we can trap our own.
pRasterAnn->EnableMethodErrors
 = False;
//Use the button to toggle between saving and loading annotations
if (IOToggle->Caption == "Save")
{
//Do nothing if there are no annotations.
if (pRasterAnn->AnnContainer
 == 0)
return;
//Save the all annotations.
nRet = pRasterAnn->AnnSave
 (AnsiToOLESTR("c:\\temp\\tmp.ann"), ANN_FMT_NATIVE, False, SAVE_OVERWRITE,
 1);
if (nRet == 0)
{
IOToggle->Caption = "Load";
ShowMessage ("Use the right mouse button to delete any annotations,
 then click Load");
}
else
ShowMessage ("Error code: " + IntToStr(nRet));
}
else
{
//We are loading annotations
//Make sure we are in design mode
pRasterAnn->AnnUserMode
 = ANN_USERMODE_DESIGN;
//Load the annotations.
nRet = pRasterAnn->AnnLoad
 (AnsiToOLESTR("c:\\temp\\tmp.ann"), 1);
if (nRet == 0)
IOToggle->Caption = "Save";
else
ShowMessage ("No annotations to load");
}
}

13.

Code the ClipboardToggle control's Click procedure as follows. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)

void __fastcall TForm1::ClipboardToggleClick(TObject
 *Sender)
{
int nRet;

//Disable errors so that we can trap our own.
pRasterAnn->EnableMethodErrors
 = False;
//Use the button to toggle between copying and pasting annotations
if (ClipboardToggle->Caption == "Copy")
{
//Do nothing if there are no annotations.
if (pRasterAnn->AnnContainer
 == 0)
return;
//Copy all annotations to the clipboard.
nRet = pRasterAnn->AnnCopy
 (ANN_FMT_NATIVE, False, True);
if (nRet == 0)
{
//Make pasting the next thing.
ClipboardToggle->Caption = "Paste";
ShowMessage ("Use the right mouse button to delete any annotations,
 then click Paste");
}
else
ShowMessage ("Error code: " + IntToStr(nRet));
}
else //We are pasting annotations
{
//Make sure we are in design mode
pRasterAnn->AnnUserMode
 = ANN_USERMODE_DESIGN;
//Paste the annotations
if (pRasterAnn->AnnPasteReady)
{
pRasterAnn->AnnPaste
 ();
ClipboardToggle->Caption = "Copy";
}
else
ShowMessage ("No annotations to paste");
}
}

14.

Code the Realize control's Click procedure (which renders the annotation objects to the bitmap) as follows:

void __fastcall TForm1::RealizeClick(TObject *Sender)
{
pRasterAnn->AnnRealize
 (false);
LEADRasterView1->ForceRepaint
 ();
ShowMessage ("Annotations are now rendered to the bitmap");
}

15.

Code the LEADEventSink1 OnInvoke event as follows:

void __fastcall TForm1::LEADEventSink1Invoke (TObject
 *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
long lTag;
int hObject;
AnnObjectType ObjectType;

switch (DispID)
{

case LEADRASTERANNOTATIONEVENTS_ANNCREATE:
{
hObject= (OleVariant)(Params.rgvarg[0]);
//Update the tag if we need one.
pRasterAnn->AnnGetType
 (hObject);
ObjectType= pRasterAnn-> get_AnnType_(
 );
if ((ObjectType == ANN_OBJECT_BUTTON) || (ObjectType
 == ANN_OBJECT_HOTSPOT))
{
NewTag++;
pRasterAnn->AnnSetTag
 (hObject, NewTag);
}
}
break;

case LEADRASTERANNOTATIONEVENTS_ANNDESTROY:
{
hObject= (OleVariant)(Params.rgvarg[0]);
pRasterAnn->AnnGetTag
 (hObject);
lTag= pRasterAnn->get_AnnTag ( );
ShowMessage ("The object tagged " + IntToStr((int)lTag)
 + " is deleted.");
}
break;

case LEADRASTERANNOTATIONEVENTS_ANNCLICKED:
{
hObject= (OleVariant)(Params.rgvarg[0]);
pRasterAnn->AnnGetTag (hObject);
lTag= pRasterAnn->get_AnnTag ( );
ShowMessage ("This is what we do for the button tagged
 " + IntToStr((int)lTag));
}
break;

case LEADRASTERANNOTATIONEVENTS_ANNDRAWN:
{
pRasterAnn->AnnTool
 = ANN_TOOL_SELECT;
ShowMessage ("Use the right mouse button to modify this object; then
 click on Run Mode to test it");
}
}
}

16.

Run your program to test it.


Using ODBC to Access Image Data(C++ Builder)

Using ODBC to Access Image Data (C++ Builder 4)

This lesson describes how to use the LEADTOOLS ODBC features to maintain images in a table with other data. In this lesson, you accomplish the following:

Create a database with one table containing images and names for the images.

Create an ODBC data source that references the table.

Use a data control to manage the table and to access the names.

Use the LEADTOOLS methods to access the images through the ODBC data source.

Use SQL SELECT statements to maintain a sorted view of the records.

Synchronize the record pointers so that the two views of the same table are always correct.

Note: | In C++ Builder, a simpler alternative is to use the LEAD control as a data-aware control.
Note: | The LEADTOOLS ActiveX requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is http://www.leadtools.com/odbc32.htm. The file to download is ODBC32.ZIP.

1. | Start Visual Basic.
2. | On the Add Ins menu, select the Data Manager option (Visual Data Manager in VB5).
3. | Create a new database.
 | On the File menu, select New Database, and specify Microsoft Access 7.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | Add a table.
 | Use the right mouse button, and select the New Table menu option.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary (or Binary). Size: N/A.
7. | Close the Database Manager.
8. | Add a data control to the bottom of your form and change its properties as follows:
 | a. | Set the DatabaseName property to leadpic.mdb. (Use the browser to get the full path name.)
 | b. | Set the RecordSource property to the following:
 |  | SELECT who FROM people ORDER BY who
 | c. | Set the Name property to Dpeople.
9. | On the Tools pull-down menu, use the Custom Controls option to add the LEAD OLE Custom Control module to your project.
10. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
11. | In the Properties box for the LEADRasterView control, make the following changes:
 | a. | Set the BorderStyle property to 1. This adds a 1-pixel border to the control.
 | b. | Set the Name property to LeadRasterView1.
12. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
13. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
14. | Add the LEAD Raster ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
15. | Add the LEAD Raster Annotation ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Annotation Object Library (14.5).
16. | Add the following code to the general declarations section of your project.

Public RasterIO As LEADRasterIO
Public RasterProc As LEADRasterProcess
Public WithEvents As LeadRasODBC As LEADRasterODBC
Public RasAnn As LEADRasterAnnotation

17.

Add the following code to the end of the Form_Load event handler.

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO.145 ")
'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess.145 ")
'Create the RasterODBC Object
Set LeadRasODBC = CreateObject("LEADRasterODBC.LEADRasterODBC.145 ")

'Create the RasAnn Object
Set RasAnn = CreateObject("LEADRasterAnnotation. LEADRasterAnnotation.145")

18. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the DataField property to who.
 | c. | Set the Name property to Cwho.
19. | From the Windows Control Panel, create the ODBC data source as follows:
 | a. | Open the ODBC administrator and click the Add button.
 | b. | Select Microsoft Access driver and click the OK button.
 | c. | Enter the name LEADODBC.
 | d. | Click the Select directory button and select the path to the database that you created.
 | e. | Click the OK button; click the next OK button; then click the Close button.
20. | In Visual Basic, add the following code to your form's general declarations. In online help, you can use the Edit pull-down menu to copy the block of code.

' The Windows Sleep function lets us synchronize requeries on adds and deletes
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
' These are variables for implementing the dbMove method
Public OldPosition, NewPosition As Long
' This variable lets us make the dbMove method conditional
Public NormalMove As Boolean

21.

Add the following code to the form's Load procedure.

LeadRasODBC.EnableMethodErrors = FALSE
On Error GoTo ERRORHANDLER
' Turn off automatic scrolling and repainting
LeadRasterView1.AutoScroll = False
LeadRasterView1.AutoRepaint = False
' Open the database.
' Use the same SELECT statement that is used for the data control.
' Note that the image field must be listed first in the SELECT statement.
DString = "ODBC;DSN=LEADODBC"
SelString = "SELECT photo,* FROM people ORDER BY who"
LeadRasODBC.dbOpen DString, SelString, "photo", DB_OPENOPTIONS_NONE
' Set the LEAD control's database properties
LeadRasODBC.dbLoadBits = 24
LeadRasODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
' Enable use of the dbMove method in the data control's Reposition event
If (LeadRasODBC.dbIsBOF And LeadRasODBC.dbIsEOF) = False Then
NormalMove = True
End If
Exit Sub
ERRORHANDLER:
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

22.

Add the following code to the form's Unload procedure.

LeadRasODBC.dbClose

23. | Add a CommonDialog control to your form.
24. | Add a CommandButton control to your form, change its Caption property to Add Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Get an image file
' This filter list is complete, except for GIF.
CommonDialog1.Filter = "Grapics|*.cmp; *.jpg; *.jff; *.jtf; *.bmp; *.tif; *.tga; *.pcx; *.cal; *.mac; *.mac; *.img; *.msp; *.wpg; *.wpg; *.ras; *.pct; *.pcd; *.eps; *.wmf"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DialogTitle = "Open File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
Myfile = CommonDialog1.filename
' Suspend use of the dbMove method in the data control's Reposition event
NormalMove = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Hide the LEAD control to avoid unnecessary repaints
LeadRasterView1.Visible = False
' Add and update the record, without inserting the image
Dpeople.Recordset.AddNew
Cwho = Myfile
Dpeople.Recordset.Update
' Wait for the update to take effect
Call Sleep(5000)
' Requery the data control's recordset
Dpeople.Recordset.Requery
' Requery the LEAD RasterODBC object's recordset and make sure it is
' synchronized with the data control.
LeadRasODBC.dbRequery
NormalMove = True ' Do normal record synchronization
Dpeople.Recordset.MoveLast
If LeadRasODBC.dbCurrentRecord <> Dpeople.Recordset.AbsolutePosition Then
MsgBox "Synchronization error!" + Chr(13) + "Delete the record and exit"
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
Screen.MousePointer = 0
Exit Sub
End If
' Go to the new record, and show the LEAD control
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
LeadRasterView1.Visible = True
' Load the image file and update the recordset
LeadRasODBC.dbEdit
RasterIO.Load LeadRasterView1.Raster, Myfile, 0, 0, 1
LeadRasODBC.Raster = LeadRasterView1.Raster
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscales
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

25.

Add another CommandButton control to your form, change its Caption property to Delete Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Disable the normal record synchronization and hide the LEAD ODBC control.
NormalMove = False
LeadRasterView1.Visible = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Save the current position
RecMarker = Dpeople.Recordset.AbsolutePosition
' Delete the record and wait for the deletion to take effect
Dpeople.Recordset.Delete
Call Sleep(5000)
' Requery the recordsets, move to the last record,
' and initialize the NewPosition global variable.
Dpeople.Recordset.Requery
LeadRasODBC.dbRequery
Dpeople.Recordset.MoveLast
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition
' Make sure the LEADODBC control is on the last record.
LeadRasODBC.dbMoveNext
If LeadRasODBC.dbIsEOF Then
LeadRasODBC.dbMovePrev
Else
MsgBox "Synchronization error!" + Chr(13) + "Restart the application"
Exit Sub
End If
' Return to the old record position, if possible.
NormalMove = True
LeadRasterView1.Visible = True
RelativePosition = RecMarker - NewPosition
If RelativePosition < 0 Then
Dpeople.Recordset.Move RelativePosition
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

26.

Add another CommandButton control to your form, change its Caption property to Flip Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Flip the image and update the record
RasterProc.Flip LeadRasterView1.Raster
LeadRasODBC.dbEdit
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscale
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
Exit Sub
ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditInProgress Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

27.

Add the following code to the LEADRasterODBC control's ODBCChange event:

' Avoid processing events that occur before the bitmap is fully loaded
If LeadRasterView1.Raster.Bitmap = 0 Then
LeadRasterView1.ForceRepaint
Exit Sub
End If
RasAnn.LEADRaster = LeadRasODBC.Raster
LeadRasODBC.AnnContainer = 0
LeadRasODBC.AnnContainer = RasAnn.AnnContainer
' Calculate the display rectangle to fit the image inside the control
HeightAllowed = LeadRasterView1.ScaleHeight
WidthAllowed = LeadRasterView1.ScaleWidth
If (HeightAllowed * LeadRasterView1.Raster.BitmapWidth / LeadRasterView1.Raster.BitmapHeight) <= WidthAllowed Then
DisplayTop = 0
DisplayHeight = HeightAllowed
DisplayWidth = DisplayHeight * LeadRasterView1.Raster.BitmapWidth / LeadRasterView1.Raster.BitmapHeight
DisplayLeft = (LeadRasterView1.ScaleWidth - DisplayWidth) / 2
Else
DisplayLeft = 0
DisplayWidth = WidthAllowed
DisplayHeight = DisplayWidth * LeadRasterView1.Raster.BitmapHeight / LeadRasterView1.Raster.BitmapWidth
DisplayTop = (LeadRasterView1.ScaleHeight - DisplayHeight) / 2
End If
'Set the image display size
LeadRasterView1.SetDstRect DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight
LeadRasterView1.SetDstClipRect DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight
LeadRasterView1.ForceRepaint

28.

Add the following code to the Dpeople control's Validate event:

' Set the OldPosition, which is used in a calculation in the Reposition event
OldPosition = Dpeople.Recordset.AbsolutePosition

29.

Add the following code to the Dpeople control's Reposition event:

' Use the dbMove method to move the LEAD control to the current record
If NormalMove Then
' The current position is the NewPosition
' The OldPosition is set in the Validate event
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition - OldPosition
End If

30.

Run your program to test it.


Implementing a Database with the MS ADO Data Control (C++ Builder 4)

In Visual Basic, the LEADTOOLS OLEDB control is a OLEDB data bound control. This means you can associate the LEADTOOLS OLEDB control with an ADO data control so that the LEADTOOLS OLEDB control's bitmap is bound to a specified field in the data control's recordset.

Take the following steps to start a project and to add some code that associates the LEADTOOLS OLEDB control with an ADO data control:

1. | Start C++ Builder.
2. | On the Add-Ins menu, select the Visual Data Manager option.
3. | On the Data Manager window's Select File menu, select the New Database option.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | In the Database Manager window, click the New button.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary. Size: N/A.
7. | Close the Database Manager
8. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
9. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
10. | Add the following code to the general declarations section of your project.

Public RasterIO As LEADRasterIO
Public RasterProc As LEADRasterProcess

11.

Add the following code to the end of the Form_Load event handler.

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO.145 ")
'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess.145 ")

12. | On the Project pull-down menu, use the Components option to add the MS ADO data control to your project. Then add an ADO control to the bottom of your form and change its properties as follows:
 | a. | Set the ConnectionString property to connect to leadpic.mdb. (Use the browser to properly build the connection string using the OLEDB ODBC Provider.)
 | b. | Set the RecordSource by setting the CommandType to adCommandTable and the table to the "people" table.
 | c. | Set the Name property to Dpeople.
13. | On the Project pull-down menu, use the Components option to add the LEADRasterView Control module to your project.
14. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
15. | On the Project pull-down menu, use the Components option to add the LEADTOOLS Raster OLE DB Custom Control module to your project. Select the LEADTOOLS Raster OLE DB control; then add the control to your main form.
16. | In the Properties box for the LEADTOOLS Raster OLE DB control, make the following changes:
 | a. | Set the DataSource property to Dpeople.
 | b. | Leave the DataMember property empty, in order to use the default for this data source.
17. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the Name property to Cwho.
18. | Add three command buttons to your form and name them as follows:
 | Name | Caption
 | AddPhoto | Add Photo
 | DeletePhoto | Delete Photo
 | FlipPhoto | Flip Photo
19. | On the Project pull-down menu, use the Components option to add the Microsoft Common Dialog Control module to your project.
20. | Add a Microsoft CommonDialog Control to your form.
21. | Add the following code to the form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = APPEARANCE_FLAT
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

'databind performed at design-time except for datafield
LEADRasterOLEDB1.DataField = "photo"
Cwho.DataField = "who"

' Set the data properties on the LEAD Raster OLE DB control
LEADRasterOLEDB1.DataLoadBits = 0
LEADRasterOLEDB1.DataSaveBits = 24
LEADRasterOLEDB1.DataSaveFormat = FILE_LEAD
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
LEADRasterOLEDB1.EnableMethodErrors = True

22.

Code the AddPhoto button's Click event as follows:

On Error GoTo ERRORHANDLER
'release any reference
LEADRasterOLEDB1.Raster.Bitmap = 0
CommonDialog1.Filter = "Grapics|*.cmp;*.jpg;*.jff;*.jtf;*.bmp;*.tif;*.tga;*.pcx;*.cal;*.mac;*.mac;*.img;*.msp;*.wpg;*.wpg;*.ras;*.pct;*.pcd;*.eps;*.wmf"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DialogTitle = "Open File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
Myfile = CommonDialog1.FileName
If Myfile = "" Then Exit Sub

Dpeople.Recordset.AddNew
RasterIO.Load LEADRasterView1.Raster, Myfile, 0, 1, 1
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True
Cwho = Myfile

' Specify the appropriate properties for saving the image in the database
If LEADRasterView1.Raster.BitmapBits = 1 Then
LEADRasterOLEDB1.DataSaveBits = 1
LEADRasterOLEDB1.DataSaveFormat = FILE_LEAD1BIT
ElseIf LEADRasterView1.Raster.BitmapBits = 4 Then
LEADRasterOLEDB1.DataSaveBits = 4
LEADRasterOLEDB1.DataSaveFormat = FILE_PCX
ElseIf LEADRasterView1.Raster.IsGrayscale = GRAY_NO Then
LEADRasterOLEDB1.DataSaveBits = 24
LEADRasterOLEDB1.DataSaveFormat = FILE_CMP
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
Else 'save as grayscale
LEADRasterOLEDB1.DataSaveBits = 8
LEADRasterOLEDB1.DataSaveFormat = FILE_CMP
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
End If

Dpeople.Recordset.Update

' Requery the data control's recordset
Dpeople.Recordset.Requery
Exit Sub

ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
If (Err.Number <> ERROR_DLG_CANCELED) Then
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description
End If

23.

Code the DeletePhoto button's Click event as follows:

Dpeople.Recordset.Delete
Dpeople.Recordset.MoveFirst

24.

Code the FlipPhoto button's Click event as follows:

RasterProc.Flip LeadRasterView1.Raster
LEADRasterOLEDB1.Raster.Bitmap = 0
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True

25.

Add the following code to the LEAD Raster OLEDB control's DataLoaded event:

If (nStatus = 0) Then
LEADRasterView1.Raster.RefBitmap = True 'don't make a copy
LEADRasterView1.Raster.Bitmap = LEADRasterOLEDB1.Raster.Bitmap 'send the image to the LEADRasterView
LEADRasterView1.Raster.RefBitmap = False 'reset
ElseIf (nStatus = ERROR_FILENOTFOUND) Then 'if it's an empty record
LEADRasterView1.Raster.Bitmap = 0
ElseIf (nStatus <> ERROR_FILENOTFOUND) Then 'if it's not an empty record
LEADRasterView1.Raster.Bitmap = 0
MsgBox "Error loading from database!"
End If
LEADRasterView1.ForceRepaint
LEADRasterOLEDB1.DataDirty = False

26.

Add the following code to the LEAD Raster OLEDB control's DataSaved event:

LEADRasterOLEDB1.Raster.Bitmap = 0 'free the current reference
LEADRasterView1.Raster.Bitmap = 0 'free the current bitmap
If (nStatus <> 0) Then
LEADRasterView1.ForceRepaint
MsgBox "Error saving to database!"
End If

27.

Run your program to test it.


Printing Multiple Images (C++ Builder 4)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Select a Button control; and add it to your main form. Put it at the top of the form to keep it away from the image.
3. | Change the Button control's Caption to Print Twice on One Page.
4. | Add the following code to the Button control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
TPrinter * Prntr = Printer();

LEADRasterProcess * pRasterProc;
//Declare the variable for printed text
AnsiString Msg;
//Declare the variables for pixel measurements
int TextHeightInPixels;
int UsableWidth;
int UsableHeight;
int MaxImageHeight;
//Declare the variables for sizing and positioning the image
long int PrintLeft;
long int PrintTop;
long int PrintHeight;
long int PrintWidth;
//Declare variables used for preserving aspect ratios
int WidthFactor;
int HeightFactor;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&pRasterProc);
//Set the variables used for preserving the aspect ratio
HeightFactor = LEADRasterView1->Raster->BitmapHeight;
WidthFactor= LEADRasterView1->Raster->BitmapWidth;

//Set the pointer to an hourglass
Screen->Cursor = crHourGlass;
//Get the page width and height in pixels (dots)
UsableWidth = Prntr->PageWidth ;
UsableHeight = Prntr->PageHeight ;
//Print a title at the top of the page
Msg= "This is a print example using LEADTOOLS ActiveX->";
Prntr->BeginDoc ( );
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y,
 Msg);
//Get the maximum height of one image,
//assuming two equal-size images and space for 12 lines of text
TextHeightInPixels = Prntr->Canvas->TextHeight (Msg);
MaxImageHeight = (UsableHeight - (12 * TextHeightInPixels)) / 2;
//Size and position the first image, preserving the aspect ratio
//Check to see if using the maximum width will make the image too tall
//Set the dimensions based on the result
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1;
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y;
PrintWidth = UsableWidth;
PrintHeight = PrintWidth * HeightFactor / WidthFactor;
}
else
{
PrintLeft = 1;
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the first image
LEADRasterView1->Render ((long)Prntr->Handle,
 PrintLeft, PrintTop, PrintWidth, PrintHeight);
//Update the current printing position
Prntr->Canvas->MoveTo ( 1, Prntr->Canvas->PenPos.y +
 PrintHeight + TextHeightInPixels );
//Print a blank line, then print a caption for the next picture
Msg = " " ;
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y,
 Msg ) ;
Msg = "This is the second picture, which is modified before printing:";
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y
 + TextHeightInPixels, Msg ) ;
//Stretch the intensity of the bitmap for the second printing
//to show the difference between the second picture and the first
pRasterProc->StretchIntensity
 ( LEADRasterView1->Raster
 ) ;
//Size and position the second image, preserving the aspect ratio
//The coding is the same as for the first image
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1; //This is for flush left-> Use 0 for centering
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintWidth = UsableWidth ;
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor;
}
else
{
PrintLeft = 1 ;//This is for flush left-> Use 0 for centering
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the second image
LEADRasterView1->Render ((long)Prntr->Handle,
 PrintLeft, PrintTop, PrintWidth, PrintHeight);
//Finish the page and finish the print job
Prntr->NewPage ( ) ;
Prntr->EndDoc ( ) ;
pRasterProc->Release ();
//Set the mouse pointer back to the default
Screen->Cursor = crDefault;
}

5. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
 | At the beginning of the Unit1.cpp file, include these files

#include <printers.hpp>
#include "LTRASTERPROCLib_TLB.h"

6.

Run your program to test it.


Writing and Reading Multi-Page Files (C++ Builder 4)

Take the following steps to create a Multi-Page file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support Multi-Page files.

1. | Start C++ Builder.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | Select the LEAD RasterView control; then add two controls to your main form. The size and position does not matter.
4. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Load Multi-Page File
5. | Code the Button1 Click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code. This code loads two bitmaps, saves them both into a single Multi-Page TIFF file, loads them again from the TIFF file, and displays them side-by-side.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
LEADRasterIO * pRasterIO1;
LEADRasterIO * pRasterIO2 ;
int HeightFactor1, WidthFactor1;
int HeightFactor2, WidthFactor2;
int HeightAllowed, WidthAllowed;
int ImageWidth1, ImageHeight1;
int ImageWidth2, ImageHeight2;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO1);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO2);

//Disable automatic repainting of the image.
LEADRasterView1->AutoRepaint
 = False;
LEADRasterView2->AutoRepaint = False;
//Turn off scroll bars to make sure we use the full client area
LEADRasterView1->AutoScroll
 = False;
LEADRasterView2->AutoScroll = False;
//Position and size the main form so that it takes up most of the
 screen
Width = Screen->Width * 0.9 ;
Height= Screen->Height* 0.8 ;
Left = (Screen->Width- Width) / 2;
Top = (Screen->Height- Height)/ 2;
//Display the form and set the mouse pointer to an hourglass

Screen->Cursor = crHourGlass;
//Load the bitmaps-> These hard-coded path names may be different
 on your system
pRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"),0,
 0, 1 ) ;
pRasterIO2->Load ( LEADRasterView2->Raster, AnsiToOLESTR("v:\\images\\image2.cmp"),0,
 0, 1 ) ;

//Save the bitmaps to a single multipage TIFF file
pRasterIO1->Save ( LEADRasterView1->Raster,
 AnsiToOLESTR("v:\\images\\combined.mpt"), FILE_TIF, 24,(QFactorConstants)0,
 SAVE_OVERWRITE);
pRasterIO2->Save ( LEADRasterView2->Raster, AnsiToOLESTR("v:\\images\\combined.mpt"),
 FILE_TIF, 24,(QFactorConstants)0, SAVE_APPEND);
//Get information about the images so that we can size the controls
pRasterIO1->GetFileInfo
 ( LEADRasterView1->Raster, WideString("v:\\images\\combined.mpt"),
 1, 0 ) ;
pRasterIO2->GetFileInfo ( LEADRasterView2->Raster,
 WideString("v:\\images\\combined.mpt"), 2, 0 );
//Clear the bitmaps from memory
LEADRasterView1->Raster->Bitmap
 = 0;
LEADRasterView2->Raster->Bitmap = 0;
//Make the controls visible so that we can size and position them
//They will not really appear until we load an image and paint it
LEADRasterView1->Visible = True;
LEADRasterView2->Visible = True;
//Set the variables used for preserving the aspect ratio
HeightFactor1 = pRasterIO1->InfoHeight;
WidthFactor1 = pRasterIO1->InfoWidth;
HeightFactor2 = pRasterIO2->InfoHeight;
WidthFactor2 = pRasterIO2->InfoWidth;
HeightAllowed = Height * 0.8;
WidthAllowed = Width * 0.45;
//Center each LEAD control on half of the form, preserving the aspect
 ratio
//Check to see if using the maximum width will make the image too
 tall
//Set the dimensions based on the result
if ((WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed)
{
LEADRasterView1->Left = (Width / 4) - (WidthAllowed / 2);
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (LEADRasterView1->Width * HeightFactor1)
 / WidthFactor1;
LEADRasterView1->Top = (Height - LEADRasterView1->Height) /
 2;
}
else
{
LEADRasterView1->Top = (Height - HeightAllowed) / 2;
LEADRasterView1->Height = HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor1)
 / HeightFactor1;
LEADRasterView1->Left = (Width / 4) - (LEADRasterView1->Width
 / 2);
}
if ((WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed)
{
LEADRasterView2->Left = (Width * 3 / 4) - (WidthAllowed / 2);
LEADRasterView2->Width = WidthAllowed;
LEADRasterView2->Height = (LEADRasterView2->Width * HeightFactor2)
 / WidthFactor2;
LEADRasterView2->Top = (Height - LEADRasterView2->Height) /
 2;
}
else
{
LEADRasterView2->Top = (Height - HeightAllowed) / 2;
LEADRasterView2->Height = HeightAllowed;
LEADRasterView2->Width = (LEADRasterView2->Height * WidthFactor2)
 / HeightFactor2;
LEADRasterView2->Left = (Width * 3 / 4) - (LEADRasterView2->Width
 / 2);
}
//Load the bitmaps from the multipage TIFF file
pRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\combined.mpt"),
 24, 1, 1);
pRasterIO2->Load ( LEADRasterView2->Raster, AnsiToOLESTR("v:\\images\\combined.mpt"),
 24, 2, 1);
//Set the image display sizes to match the LEAD controls
ImageWidth1 = LEADRasterView1->ScaleWidth;
ImageHeight1 = LEADRasterView1->ScaleHeight;
LEADRasterView1->SetDstRect
 ( 0, 0, ImageWidth1, ImageHeight1);
LEADRasterView1->SetDstClipRect
 ( 0, 0, ImageWidth1, ImageHeight1);
//Set the image display sizes to match the LEAD controls
ImageWidth2 = LEADRasterView2->ScaleWidth;
ImageHeight2 = LEADRasterView2->ScaleHeight;
LEADRasterView2->SetDstRect ( 0, 0, ImageWidth2, ImageHeight2);
LEADRasterView2->SetDstClipRect (0, 0, ImageWidth2, ImageHeight2);

//Display the images
LEADRasterView1->ForceRepaint
 () ;
LEADRasterView2->ForceRepaint() ;
pRasterIO1->Release ();
pRasterIO2-> Release();
//Set the mouse pointer back to the default
Screen->Cursor= crDefault;
}

6. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14.5).
7. | At the beginning of the Unit1.cpp file, include the file:

#include "Ltrasteriolib_tlb.h"

8.

Run your program to test it.


Drawing Simple Lines and Shapes (C++ Builder 4)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD 3D Raster DrawEffect Object Library (14.5), and Press Ok.
3. | Add the following variable to Unit1.h private declarations section.

LEADRasterFXD * pRasterFxd;

4.

Add the following code to the end of the form's Create procedure.

//Create the RasterFxd Object
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

5.

Code the Form’s Close event as the following:

void __fastcall TForm1::FormClose(TObject *Sender,
 TCloseAction &Action)
{
if (pRasterFxd)
pRasterFxd->Release();
}

6.

Add the following variables to Unit1.h private declarations section:

int DrawObject; //the object we are drawing
float StartX;//Starting X position
float StartY;//Starting Y position
float EndX;//Ending X position
float EndY;//Ending Y position

7.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows.This code selects a different drawing object each time the event occurs.

void __fastcall TForm1::LEADRasterView1MouseDown2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Use the same scale mode as the mouse.
LEADRasterView1->ScaleMode
 = 1;
//Save the starting position.
StartX = x;
StartY = y;
EndX = x;
EndY = y;
//Cycle through the types of drawing objects.
switch(DrawObject)
{

case 0:
DrawObject = 1 ;//Line
break;

case 1:
DrawObject = 2 ;//Rectangle
break;

case 2:
DrawObject = 0 ;//Ellipse
break;
default:
DrawObject = 0;
}
pRasterFxd->DstLeft
 = 0;
pRasterFxd->DstTop
 = 0;
pRasterFxd->DstRight
 = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->DstBottom
 = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->SrcLeft
 = 0;
pRasterFxd->SrcTop
 = 0;
pRasterFxd->SrcRight
 = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->SrcBottom
 = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->ScaleMode
 = 3;
}

8.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows. This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one.

void __fastcall TForm1::LEADRasterView1MouseMove2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Declare local variables
float OldEndX, OldEndY;
float OldDrawX, OldDrawY, OldWidth, OldHeight;
float DrawX, DrawY, NewWidth, NewHeight;
HDC h_DC;

if (Button == 1)
{
//Set the drawing styles
pRasterFxd->DrawPenStyle
 = DRAWPENSTYLE_SOLID;
pRasterFxd->DrawMode
 = DRAWMODE_INVERT;
pRasterFxd->DrawFillStyle
 = DRAWFILLSTYLE_TRANSPARENT;
pRasterFxd->DrawPersistence
 = False; // On the window, not the bitmap
//Save the previous ending mouse position
OldEndX = EndX;
OldEndY = EndY;
//Get the current mouse position->
EndX = x;
EndY = y;
//Calculate the origin of the current object
if (EndX > StartX)
DrawX = StartX;
else
DrawX = EndX;

if (EndY > StartY)
DrawY = StartY;
else
DrawY = EndY;

//Calculate the origin of the previous object
if (OldEndX > StartX)
OldDrawX = StartX;
else
OldDrawX = OldEndX;

if (OldEndY > StartY)
OldDrawY = StartY;
else
OldDrawY = OldEndY;

//Calculate the height and width of the current object
NewHeight = abs(StartY - EndY);
NewWidth = abs(StartX - EndX);
//Calculate the height and width of the previous object
OldHeight = abs(StartY - OldEndY);
OldWidth = abs(StartX - OldEndX);
//Erase the old object and draw the new one
h_DC = (HDC)LEADRasterView1->GetClientDC
 ();
switch (DrawObject)
{
case 0: //Ellipse
{
pRasterFxd->DrawEllipse
 (NULL, (long)h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
pRasterFxd->DrawEllipse (NULL, (long)h_DC, DrawX,
 DrawY, NewWidth, NewHeight);
}
break;
case 1: //Line
{
pRasterFxd->DrawLine
 (NULL, (long)h_DC, StartX, StartY, OldEndX, OldEndY);
pRasterFxd->DrawLine (NULL, (long)h_DC, StartX, StartY,
 EndX, EndY);
}
break;
case 2: //Rectangle
{
pRasterFxd->DrawRectangle
 (NULL, (long)h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
pRasterFxd->DrawRectangle (NULL, (long)h_DC, DrawX,
 DrawY, NewWidth, NewHeight);
}
break;

default:
break;
}
LEADRasterView1->ReleaseClientDC
 ();
}
}

9.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows. This code sets the drawing style and draws the object on the bitmap.

void __fastcall TForm1::LEADRasterView1MouseUp2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Declare local variables.
float DrawX, DrawY, NewWidth, NewHeight;

//Set the drawing style.
pRasterFxd->DrawPenStyle
 = DRAWPENSTYLE_SOLID;
pRasterFxd->DrawPenWidth
 = 2;
pRasterFxd->DrawPenColor
 = RGB(255, 0, 0) ;//Red
pRasterFxd->DrawMode
 = DRAWMODE_COPY_PEN;
pRasterFxd->DrawFillColor
 = RGB(0, 255, 0); //Green;
pRasterFxd->DrawFillStyle
 = DRAWFILLSTYLE_HORIZONTAL_LINE;
pRasterFxd->DrawPersistence
 = True ;//On the bitmap
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the object
if (EndX > StartX)
DrawX = StartX;
else
DrawX = EndX;

if (EndY > StartY)
DrawY = StartY;
else
DrawY = EndY;

//Determine the height and width of the object
NewHeight = abs(StartY - EndY);
NewWidth = abs(StartX - EndX);
//Draw the object
switch(DrawObject)
{
case 0: //Ellipse
pRasterFxd->DrawEllipse
 (LEADRasterView1->Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
case 1: //Line
pRasterFxd->DrawLine
 (LEADRasterView1->Raster,
 0, StartX, StartY, EndX, EndY);
break;
case 2: //Rectangle
pRasterFxd->DrawRectangle
 (LEADRasterView1->Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
}
LEADRasterView1->ForceRepaint
 ();
}

10.

At the beginning of the Unit1.h file, include the file

#include "LTRASTERFXDLib_TLB.h"

11.

Run your program to test it.


Cropping a Bitmap (C++ Builder 4.0)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following variables to the Private section in your main form:

bool Cropping; //the state when the mouse is used for cropping
int StartX; //Starting X position in screen pixels
int StartY; //Starting Y position in screen pixels
int EndX; //Ending X position in screen pixels
int EndY; //Ending Y position in screen pixels

3. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Button1
 | Put it control at the top of the form to keep it away from the image.
4. | Code the Button1 click’s Procedure as the follwing, in online help; you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1->ScaleMode
 = 1;
//Initialize cropping so that you can do it more than once
if (Cropping)
{
//Set the clipping area to match the image->
LEADRasterView1->SetDstClipRect
 (LEADRasterView1->DstLeft,
LEADRasterView1->DstTop,
LEADRasterView1->DstWidth,
LEADRasterView1->DstHeight);
//Display the image
LEADRasterView1->ForceRepaint
 ();
}
//Set a global variable to let other events know that you are cropping
Cropping = True;
//Set the pointer to a crosshair
LEADRasterView1->MousePointer
 = 2;
}

5.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows.

void __fastcall TForm1::LEADRasterView1MouseDown2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Save the starting position
StartX= x;
StartY= y;
//Make the rubberband invisible until the mouse moves
LEADRasterView1->RubberBandVisible
 = False;
}

6.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

void __fastcall TForm1::LEADRasterView1MouseMove2(TObject
 *Sender,
short Button, short Shift, long x, long y)
{
float rbX, rbY, rbWidth, rbHeight;

if ((Cropping) && (Button == 1))
{
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the rubberband rectangle, regardless of which
 way the mouse moves
if (EndX > StartX)
rbX = StartX;
else
rbX = EndX;

if (EndY > StartY)
rbY = StartY;
else
rbY = EndY;
//Determine the height and width of the rubberband rectangle
rbHeight = abs(StartY - EndY);
rbWidth = abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1->SetRubberBandRect
 (rbX, rbY, rbWidth, rbHeight);
//Alternatively, you could use the following properties to set the
//rubberband rectangle->
LEADRasterView1->RubberBandHeight
 = rbHeight;
LEADRasterView1->RubberBandLeft
 = rbX;
LEADRasterView1->RubberBandTop
 = rbY;
LEADRasterView1->RubberBandWidth
 = rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1->RubberBandVisible
 e= True;
}
}

7.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

void __fastcall TForm1::LEADRasterView1MouseUp2
 (TObject *Sender,
short Button, short Shift, long x, long y)
{
float CropLeft, CropTop, CropWidth, CropHeight;
if (Cropping)
{
//Get the current mouse position
EndX= x;
EndY= y;
//Get the origin of the clipping rectangle->
//Allow for different mouse drag directions
if (StartX < EndX)
CropLeft = StartX;
else
CropLeft = EndX;

if (StartY < EndY)
CropTop = StartY;
else
CropTop = EndY;
//Get the height and width of the cropped area
CropWidth = abs(EndX - StartX);
CropHeight = abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1->SetDstClipRect
 (CropLeft, CropTop, CropWidth, CropHeight);
LEADRasterView1->ForceRepaint
 () ;
LEADRasterView1->RubberBandVisible
 e = False;
LEADRasterView1->MousePointer
 = crDefault;
}
}

8. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button2 | Trim
 | This button will be used to trim the bitmap in memory and redisplay the bitmap.
 | Put it at the top of the form to keep it away from the image.
9. | Code the Button2 click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::Button2Click(TObject *Sender)
{
float XFactor, YFactor;
float NewLeft, NewTop, NewWidth, NewHeight;
float HeightFactor, WidthFactor;
float HeightAllowed, WidthAllowed;
LEADRasterProcess * pRasterProc;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);

Screen->Cursor = crHourGlass;
//Use the clipping rectangle's percentage offsets in the image rectangle
//to determine the trimmed rectangle in the bitmap.
//Using percentages allows for the possibility that the image is zoomed.
XFactor = LEADRasterView1->Raster->BitmapWidth
 / LEADRasterView1->DstWidth;
YFactor = LEADRasterView1->Raster->BitmapHeight
 / LEADRasterView1->DstHeight;
NewTop = (LEADRasterView1->DstClipTop
 - LEADRasterView1->DstTop)
 * YFactor;
NewLeft = (LEADRasterView1->DstClipLeft
 - LEADRasterView1->DstLeft)
 * XFactor;
NewWidth = LEADRasterView1->DstClipWidth
 * XFactor;
NewHeight = LEADRasterView1->DstClipHeight
 * YFactor;
//Make sure display rectangles are automatically adjusted.
LEADRasterView1->AutoSetRects
 = True;
//Trim the bitmap.
pRasterProc->Trim ( LEADRasterView1->Raster, NewLeft, NewTop, NewWidth,
 NewHeight);
pRasterProc-> Release ( ) ;
//Size and redisplay the control, using the new bitmap size.
//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1->Raster->BitmapHeight;
WidthFactor = LEADRasterView1->Raster->BitmapWidth;
HeightAllowed = Height - (Height / 4);
WidthAllowed = Width - (Width / 4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1->Left = Width / 8;
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (LEADRasterView1->Width * HeightFactor)
 / WidthFactor;
LEADRasterView1->Top = (Height - LEADRasterView1->Height) / 2;
}
else
{
LEADRasterView1->Top = Height / 8;
LEADRasterView1->Height= HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor)
 / HeightFactor;
LEADRasterView1->Left = (Width - LEADRasterView1->Width) / 2;
}
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1->AutoScroll
 = False;
//Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect
 (0, 0, LEADRasterView1->ScaleWidth,
 LEADRasterView1->ScaleHeight
 );
LEADRasterView1->SetDstClipRect
 (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight
 ) ;
//Display the image
LEADRasterView1->ForceRepaint
 ();
Screen->Cursor = crDefault;
}

10. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
11. | The beginning of Unit1 file, include the file:

#include "LTRASTERPROCLib_TLB.h"

12.

Run your program to test it.


Creating, Viewing, and Merging Color Separations (C++ Builder 4)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Do Separations
 | Put it at the top of the form to keep it away from the image.
3. | Add the following variables to Unit1.h file private declarations section.

LEADRasterProcess * pRasterProc;
//Count the button clicks and take the next step with each click
int ClickCount;

4.

Add the following code to the end of the form's Create procedure.

//Create the RasterProcess Object
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ClickCount= 0;

5.

Code the Form’s Close event as the following:

void __fastcall TForm1::FormClose(TObject
 *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release ();
}

6.

Code the Buuton1 click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString Msg;

Cursor = crHourGlass;
//Turn off the automatic display rectangles.
LEADRasterView1->AutoSetRects
 = False;
LEADRasterView1->Raster->RefBitmap
 = False;
switch (ClickCount)
{
case 0:
{
pRasterProc->ColorSeparate
 ( LEADRasterView1->Raster,
 COLORSEP_CMYK ) ;
//Just for fun, add contrast to the K plane
LEADRasterView1->Raster->Bitmap
 = pRasterProc->get_ColorPlanes
 (3) ;//Copy the K plane
pRasterProc->Contrast
 (LEADRasterView1->Raster, 300) ;//Increase the contrast
pRasterProc->set_ColorPlanes (3, LEADRasterView1->Raster->Bitmap)
 ;//Update the K plane
Msg = "Separated. Keep clicking to see separations, then merge";
ShowMessage (Msg) ;
}
break;
case 1:
{
LEADRasterView1->Raster->Bitmap = pRasterProc->get_ColorPlanes(0);
 //Cyan
LEADRasterView1->ForceRepaint
 ( );
}
break;
case 2:
{
LEADRasterView1->Raster->Bitmap
 = pRasterProc->get_ColorPlanes(1); //Magenta
LEADRasterView1->ForceRepaint ( ) ;
}
break;
case 3:
{
LEADRasterView1->Raster->Bitmap = pRasterProc->get_ColorPlanes
 (2); //Yellow
LEADRasterView1->ForceRepaint ( );
}
break;

case 4:
{
LEADRasterView1->Raster->Bitmap = pRasterProc->get_ColorPlanes(3);
 // K
LEADRasterView1->ForceRepaint
 ( );
}
break;

case 5:
{
pRasterProc->ColorMerge
 ( LEADRasterView1->Raster,
 COLORSEP_CMYK ) ;
LEADRasterView1->ForceRepaint
 ( );
pRasterProc->set_ColorPlanes(0, 0);
pRasterProc->set_ColorPlanes(1, 0);
pRasterProc->set_ColorPlanes(2, 0);
pRasterProc->set_ColorPlanes
 (3, 0);
Msg = "Merged, with more contrast in the K plane";
ShowMessage (Msg);
}
break;

default:
{
ClickCount = -1;
Msg = "Cycle is finished";
ShowMessage ( Msg ) ;
}
}
ClickCount++;
Cursor= crDefault;
}

7. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
8. | At the beginning of Unit1.h file, include this file

#include "LTRASTERPROCLib_TLB.h"

9.

Run your program to test it. Notice that you can click the button several times to create the separations, view each of them, and merge them to recreate the original bitmap.


Updating a Gauge and Detecting a User Interrupt (C++ Builder)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add 2 Button controls to your main form. Put them at the top of the form to keep it away from the image, name them as follows:
 | Name | Caption
 | Button1 | Do Median
 | Button2 | Quit
3. | Add a TrackBar control to your main Form, and change the Max property of it to 100.
4. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
5. | Open the LEvntSnk.hpp file and delete those lines from the TLEADAbstractEventSink class.

private:
void *__IDispatch; /* IDispatch */

public:
operator IDispatch*(void) { return (IDispatch*)&__IDispatch; }
operator IUnknown*(void) { return (IUnknown*)&__IDispatch; }

 | And save the file.
6. | From the ActiveX controls, Add the LEvntSnk control to your form.
7. | Add the Variables to the Private section of Form1:

bool fEscape; //Use to indicate the user interrupt
bool fInProc; //Use to avoid closing the form during processing
LEADRasterProcess * pRasterProc;

8.

Now, add the following to the Form's Create event to create the ILEADRasterProcess object

// Create the Rasterproc object.
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);

9.

Code the Button1 Click’s procedure as follows:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
//Enable the ProgressStatus event
pRasterProc->EnableProgressEvent
 = true;
//Initialize the indicators
fEscape = false; //The user does not want to quit
fInProc = true; //Processing is taking place
//Perform a relatively slow median filter
pRasterProc->Median (LEADRasterView1->Raster, 4);
//Clean up
fInProc = False; //Processing is no longer taking place
LEADRasterView1->ForceRepaint
 ();
}

10.

Code the LEADEventSink1 OnInvoke event as follows:

 void __fastcall TForm1:: LEADEventSink1Invoke(TObject
 *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_PROGRESSSTATUS:
{
int iPrecent= (OleVariant)(Params.rgvarg[0]);

Application->ProcessMessages (); //Detect Windows events
if (!fEscape) // Look for the Click on the Quit button
{
TrackBar1->Position= iPrecent;
}
else
pRasterProc->EnableProgressEvent
 = false; //Cancel the task
}
}
}

11.

Code the Button2 click’s procedure as follows:

void __fastcall TForm1::Button2Click(TObject *Sender)
{
fEscape= True; //The user wants to quit
TrackBar1->Position= 0 ;
}

12.

Code the Form1 CloseQuery procedure as follows:

void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose)
{
if (fInProc) //If processing is taking place
CanClose= false; //Do not let the user close the form
}

13. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
14. | At the beginning of the Unit1.h file include the file:

#include "LTRASTERPROCLib_TLB.h"

15.

Run your program to test it.


Using the Magnifying Glass (C++ Builder)

Take the following steps to enable the generation of the MagGlassExt event and updating the zoomed image using the Internet COM object toolkit.

1. | Start C++ Builder.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Internet Object Library (14.5).
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Object Library (14.5)
5. | On the Project pull-down menu, use the Import Type library… and select the LEAD RasterIO Object Library (14.5).
6. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control, as you want it to appear at run time.
7. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
8. | Open the LEvntSnk.hpp file and delete those lines from the TLEADAbstractEventSink class.

private:
void *__IDispatch; /* IDispatch */

public:
operator IDispatch*(void) { return (IDispatch*)&__IDispatch; }
operator IUnknown*(void) { return (IUnknown*)&__IDispatch; }

 | and save the file.
9. | From the ActiveX controls, Add the LEvntSnk control to your form.
10. | Add seven command buttons to your main form and name them as follows:
 | Name | Caption
 | StartUpServer | Start Up Server
 | ShutDownServer | Shut Server Down
 | ConnectToRemoteServer | Connect To Remote Server
 | DisconnectFromRemoteServer | Disconnect From Remote Server
 | LoadRemoteImage | Load Remote Image
 | StartMagnifyingGlass | Start Magnifying Glass
 | StopMagnifyingGlass | Stop Magnifying Glass
11. | Add an Edit box to your main form and name it as follows:
 | Name
 | RemoteComputer
12. | Set the Text property to the name of the computer you will use as a server.
13. | Declare the following in the Private section of Unit1.h

short hServer; //handle to server
long gnCommandID;
bool bMagGlass;
LEADRasterIO* pRasterIO;
LEADRasterInet* pLEADNet1;

14.

Add the following initialization code to the main form's Show procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormShow(TObject
 *Sender)
{
LEADRaster* pLEADRas= NULL;

// Initialize some variables
hServer = 0;
gnCommandID = 0;
bMagGlass = False;

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties
 box.
LEADRasterView1->Appearance
 = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle
 = 1;
LEADRasterView1->BackColor
 = (TColor)RGB(255, 255, 125);
LEADRasterView1->PaintDither
 = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette
 = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint
 = True;
LEADRasterView1->AutoSize
 = False;
LEADRasterView1->AutoSetRects
 = True;
LEADRasterView1->PaintSizeMode
 = PAINTSIZEMODE_FIT;

// Create the Raster IO and Raster Inet objects
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterInet, NULL, CLSCTX_ALL, IID_ILEADRasterInet,
 (void**)&pLEADNet1);
LEADEventSink1->Connect (pLEADNet1, DIID__LTRASINETEvents);

// Create a temp LEADRaster object and use it
// to unlock support for the Inet object
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster,
 (void**)&pLEADRas);
pLEADRas->Release();
// Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
// RasterIO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1->EnableMethodErrors
 = False;
pRasterIO->EnableMethodErrors= False;
pLEADNet1->EnableMethodErrors  = 0;
}

15.

Code the main form's Close procedure as follows:

void __fastcall TForm1::FormClose(TObject
 *Sender, TCloseAction &Action)
{
short i;
//Disconnect all connections
pLEADNet1->ConnectListNum ;
for (i = 0; i < pLEADNet1->ConnectListNum; i ++)
pLEADNet1->InetDisconnect
  (pLEADNet1->get_ConnectList
 (i));

if (bMagGlass)
LEADRasterView1->StopMagGlass
 ();

if (pLEADNet1)
pLEADNet1->Release();
if (pRasterIO)
pRasterIO->Release();

}

16.

Code the StartUpServer button's click procedure as follows:

void __fastcall TForm1::StartUpServerClick(TObject
 *Sender)
{
int nRet;
//Initialize server on port 1000
nRet= pLEADNet1->InetServerInit
  (1000);
hServer= pLEADNet1->InetServerHandle
 ;
if (nRet != 0)
ShowMessage ("Error Initializing server: " + IntToStr(nRet));
}

17.

Code the ShutDownServer button's click procedure as follows:

void __fastcall TForm1::ShutDownServerClick(TObject
 *Sender)
{
int nRet;

if (hServer != 0)
{
nRet= pLEADNet1->InetServerClose
  ((short)hServer);

if (nRet != 0)
ShowMessage ("Error Shutting Down server: " + IntToStr(nRet));
else
hServer= 0;
}
}

18.

Code the LEADEventSink1 OnInvoke event as follows:

void __fastcall TForm1::LEADEventSink1Invoke(TObject
 *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
short hComputer;
BSTR hName;
int nRet;
short iComputer;
BSTR sRemote;
int nStatus;
ILEADRasterVariant* vColorBuffer= NULL;
ILEADRasterVariant* vString= NULL;
int InetCommand;
int nCommandID;
int nError;
LEADRasterInetPacket* nParams;
AnsiString strTemp;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&vColorBuffer);

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&vString);
switch (DispID)
{

case LEADRASTERINETEVENTS_INETACCEPT:
{
nRet= pLEADNet1->InetAcceptConnect
  ((short)hServer);
hComputer= pLEADNet1->InetConnectedComputer
 ;

if (nRet != 0)
{
ShowMessage ("Error accepting connection: " + IntToStr(nRet));
return;
}

pLEADNet1->InetGetHostName
  ((short)hComputer,
 HOST_NAME_DESCRP);
hName= pLEADNet1->InetHostName
 ;
//Add to our list
pLEADNet1->set_SendList
 (pLEADNet1->SendListNum ,
 hComputer);
strTemp = hName;
ShowMessage ("Connection accepted from: " + strTemp);
}
break;

case LEADRASTERINETEVENTS_INETCONNECTED:
{

iComputer= (OleVariant)(Params.rgvarg[0]);
//Get remote host name
pLEADNet1->InetGetHostName (iComputer, HOST_NAME_DESCRP);
sRemote= pLEADNet1->InetHostName
 ;

//Add this connection to our SendList
pLEADNet1->set_SendList (pLEADNet1->SendListNum
 , iComputer);
strTemp = sRemote;
ShowMessage ("Successfully connected to remote computer:
 " + strTemp);
}
break;

case LEADRASTERINETEVENTS_INETDISCONNECTED:
{
if (hServer == 0)
ShowMessage ("Disconnect from remote server");
else
ShowMessage ("Connection to remote computer closed");
}
break;

case LEADRASTERINETEVENTS_INETRECEIVECMD:
{
InetCommand= (OleVariant)(Params.rgvarg[5]);
nCommandID= (OleVariant)(Params.rgvarg[4]);
nError= (OleVariant)(Params.rgvarg[3]);
nParams = (LEADRasterInetPacket*)(Params.rgvarg[2].pdispVal);

nStatus= ERROR_FEATURE_NOT_SUPPORTED;

if (nError != 0)
nStatus= ERROR_TRANSFER_ABORTED;
else
{
switch (InetCommand)
{
case INETCMD_LOAD:
{
//check the validity of the parameters
if ((nParams->ParamCount == 4) &&
(nParams->get_ParamType(0) == PARAM_TYPE_STRING) &&
(nParams->get_ParamType(1) == PARAM_TYPE_INT32) &&
(nParams->get_ParamType(2) == PARAM_TYPE_INT32) &&
(nParams->get_ParamType(3) == PARAM_TYPE_UINT32))
{

nStatus= pRasterIO->Load(
 LEADRasterView1->Raster,
nParams->get_ParamValue(0)->StringValue,
(short)nParams->get_ParamValue(1)->LongValue,
1,
1 );

if (nStatus != 0)
ShowMessage ("Load Bitmap failed with error code: "
 + IntToStr(nStatus));
else
{
nStatus= pLEADNet1->InetSendBitmap
 (LEADRasterView1->Raster,
 FILE_CMP, 0, QFACTOR_PQ2);

if (nStatus != 0)
ShowMessage ("SendBitmap failed with error code: "
 + IntToStr(nStatus));
}
}
else
nStatus= ERROR_INV_PARAMETER; //Invalid parameters

pLEADNet1->InetSendLoadRsp
 (nCommandID, 0, 0,
 NULL, (short)nStatus);
return;
}

case INETCMD_GET_MAGGLASS_DATA:
{
//check the validity of the parameters
if ((nParams->ParamCount == 5) && (nParams->get_ParamType(0)
 == PARAM_TYPE_UINT32)
&& (nParams->get_ParamType(1) == PARAM_TYPE_UINT32)
 && (nParams->get_ParamType(2) == PARAM_TYPE_USTRING)
&& (nParams->get_ParamType(3) == PARAM_TYPE_INT32) &&
 (nParams->get_ParamType(4) == PARAM_TYPE_INT32))
{
if (LEADRasterView1->Raster->Bitmap
 != 0)
{
vString->set_Type ( VALUE_STRING );
vString->StringValue= nParams->get_ParamValue(2)->StringValue;

nStatus= pLEADNet1->InetGetMagGlassData
 (LEADRasterView1->Raster,
vColorBuffer,
vString,
nParams->get_ParamValue(3)->LongValue,
nParams->get_ParamValue(4)->LongValue);

if (nStatus != 0)
ShowMessage ("InetGetMagGlassData failed with error code: " +
 IntToStr(nStatus));
}
else
nStatus= ERROR_INV_PARAMETER; //Invalid parameter
}
else
nStatus= ERROR_INV_PARAMETER; //Invalid parameters
vString->set_Type ( VALUE_STRING
 );
vString->StringValue= nParams->get_ParamValue(2)->StringValue;

pLEADNet1->InetSendGetMagGlassDataRsp
 (nCommandID,
vColorBuffer,
vString,
nParams->get_ParamValue(3)->LongValue,
nParams->get_ParamValue(4)->LongValue,
0,
NULL,
(short)nStatus);
return;
}
}
}
pLEADNet1->InetSendRsp ((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, (short)nStatus);
}
break;

case LEADRASTERINETEVENTS_INETRECEIVEBITMAP:
{
LEADRasterView1->Raster->Bitmap = (long)(Params.rgvarg[0].lVal);
}
break;

case LEADRASTERINETEVENTS_INETRECEIVERSP:
{
InetCommand= (OleVariant)(Params.rgvarg[6]);
nError= (OleVariant)(Params.rgvarg[4]);
nStatus= (OleVariant)(Params.rgvarg[3]);
nParams = (LEADRasterInetPacket*)(Params.rgvarg[2].pdispVal);

if (nError != 0)
return;

switch (InetCommand)
{
case INETCMD_LOAD:
{
if (nStatus != 0)
ShowMessage ("Load failed with error code: " + IntToStr(nStatus));
}
break;

case INETCMD_GET_MAGGLASS_DATA:
{
if (nStatus == 0)
{
if ((nParams->ParamCount == 6) &&
(nParams->get_ParamType(0) == PARAM_TYPE_UINT32) &&
(nParams->get_ParamType(1) == PARAM_TYPE_USTRING) &&
(nParams->get_ParamType(2)== PARAM_TYPE_UINT32) &&
(nParams->get_ParamType(3) == PARAM_TYPE_USTRING) &&
(nParams->get_ParamType(4)== PARAM_TYPE_INT32) &&
(nParams->get_ParamType(5) == PARAM_TYPE_INT32))
{
nRet= LEADRasterView1->UpdateMagGlass
 (nParams->get_ParamValue(1),
nParams->get_ParamValue(3),
nParams->get_ParamValue(4)->LongValue,
nParams->get_ParamValue(5)->LongValue,
True);

if (nRet != 0)
ShowMessage ("UpdateMagGlass failed with error code: "
 + IntToStr(nRet));
}
else
ShowMessage ("Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA
 response");
}
else
ShowMessage ("Get MagGlass Data from server with error code
 " + IntToStr(nStatus));
}
break;
}
}
break;
}
if (vColorBuffer)
{
vColorBuffer ->Release ( );
vColorBuffer= NULL;
}
if (vString)
{
vString ->Release ( );
vString = NULL;
}
}

19.

Code the ConnectToRemoteServer button's click procedure as follows:

void __fastcall TForm1::ConnectToRemoteServerClick(TObject
 *Sender)
{
int nRet;
//Connect to remote computer on port 1000
nRet= pLEADNet1->InetConnect  (AnsiToOLESTR(RemoteComputer->Text.c_str()),
 1000);

if (nRet != 0)
ShowMessage ("Error connecting to " + RemoteComputer->Text
 + ": " + IntToStr(nRet));
}

20.

Code the DisconnectFromRemoteServer button's click procedure as follows:

void __fastcall TForm1::DisconnectFromRemoteServerClick(TObject
 *Sender)
{
int nRet;

/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList*/
nRet= pLEADNet1->InetDisconnect
  (pLEADNet1->get_SendList
 (0));
if (nRet != 0)
ShowMessage ("Error disconnecting from remote: " + IntToStr(nRet));
}

21.

Code the LoadRemoteImage button's click procedure as follows:

void __fastcall TForm1::LoadRemoteImageClick(TObject
 *Sender)
{
int nRet;

nRet= pLEADNet1->InetSendLoadCmd
  (999, AnsiToOLESTR("v:\\images\\Eagle.cmp"),
 0, 1);

if ((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
ShowMessage ("ERROR " + IntToStr(nRet) + " calling
 InetSendLoadCmd.");
}

22.

Code the StartMagnifyingGlass button's click procedure as follows:

void __fastcall TForm1::StartMagnifyingGlassClick(TObject
 *Sender)
{
int nRet;

if ((LEADRasterView1->Raster->Bitmap
 != 0) && (hServer == 0))
{
//Enable MagGlassExt event.
if (LEADRasterView1->EnableMagGlassEvent
 == False)
LEADRasterView1->EnableMagGlassEvent= True;

LEADRasterView1->RgnFrameType
 = 0;

//Start the Magnifying Glass
nRet= LEADRasterView1->StartMagGlass
 (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE,
 True, True);

if (nRet == 0)
bMagGlass= True;
}
}

23.

Code the StopMagnifyingGlass button's click procedure as follows:

void __fastcall TForm1::StopMagnifyingGlassClick(TObject
 *Sender)
{
int nRet;

if ((LEADRasterView1->Raster->Bitmap
 != 0) && (hServer == 0))
{
nRet= LEADRasterView1->StopMagGlass
 ();

if (nRet == 0)
bMagGlass= False;
}
}

24.

Code the LEADRasterView1’s MagGlassExt event as follows:

void __fastcall TForm1::LEADRasterView1MagGlassExt(TObject
 *Sender,
long nMaskPlaneStart, long nMaskPlaneEnd, void* pvMaskPlane)
{
int nRet;

gnCommandID++;

nRet= pLEADNet1->InetSendGetMagGlassDataCmd
  (gnCommandID,
 0, (ILEADRasterVariant*)pvMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if ((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
ShowMessage ("ERROR " + IntToStr(nRet) + " calling
 InetSendGetMagGlassDataCmd.");
}

25.

At the beginning of the Unit1.h file, include those files:

#include "LEADRasterInetLib_TLB.h"
#include "LTRASTERLib_TLB.h"
#include "LTRASTERIOLib_TLB.h"
#include "f:\lead14\dist\include\L_OcxErr.h"
 /* change the path to be compatible with the file in your PC*/

26. | Run the exe file two times to execute two applications.
27. | In the first application press Start Up Server button.
28. | In the second application fill the edit box with the IP Address of the Remote computer on which you run the first application as Server then press Connect To Remote Server button to connect to the specified address.
29. | After that press the Load Remote Image button of application number two to load an image on Server then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support, then start press the left key and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using a PanWindow (C++ Builder 4.0)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Replace the Main Form Create Procedure to the follwing.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
//Set defaults for displaying the image
//These are all persistent properties that can be set in the properties
 box->
LEADRasterView1->Appearance
 = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle
 = 1;
LEADRasterView1->BackColor
 = (TColor)RGB(255, 255, 125);
LEADRasterView1->PaintDither
 = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette
 = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint
 = True;
LEADRasterView1->AutoSize
 = False;
LEADRasterView1->AutoSetRects
 = True;
LEADRasterView1->PaintSizeMode
 = PAINTSIZEMODE_NORMAL;
}

3. | Add a RadioButton to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | Check1 | Pan Window
4. | Add a Button to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | PanWindow | Show Pan Window
5. | Code the PanWindow click’s procedure as the following:

void __fastcall TForm1::PanWindowClick(TObject *Sender)
{
LEADRasterView1->BackErase
 = False;
//set the location of the PanWindow
LEADRasterView1->PanWinX
 = 100;
LEADRasterView1->PanWinY
 = 100;
//set the size of the PanWindow
//requested width
LEADRasterView1->PanWinWidth
 = 150;
//requested height
LEADRasterView1->PanWinHeight
 = 200;

LEADRasterView1->PanWinPointer
 = 12;
LEADRasterView1->PanWinTitle
 = "PanWindow";
LEADRasterView1->PanWinRectColor
 = (TColor)RGB(0, 0, 255);
LEADRasterView1->PanWinSysMenu
 = True;
//use the settings for LEADRasterView1.
LEADRasterView1->PanWinPaintPalette
 = LEADRasterView1->PaintPalette;
LEADRasterView1->PanWinBitonalScaling
 = LEADRasterView1->BitonalScaling;
LEADRasterView1->PanWinPaintScaling
 = LEADRasterView1->PaintScaling;
LEADRasterView1->PanWinPaintDither
 = LEADRasterView1->PaintDither;
//show the Pan Window
LEADRasterView1->ShowPanWin
 (True);
Check1->Checked= True;
}

6.

Code the LEADRasterView1 PanWin event procedure as follows:

void __fastcall TForm1::LEADRasterView1PanWin(TObject
 *Sender,
long hPanWin, short iFlag)
{
if (iFlag == PANWIN_DESTROYED)
Check1->Checked= False ;//indicate no more Pan Window
}

7.

Run your program to test it.


Miscellaneous Examples (C++ Builder 4.0)

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test any of the following examples by adding a button to one of the previous lessons in the tutorial, and pasting the sample code in the Click procedure.

In most cases, you can add the button after the first lesson Loading and Displaying an Image. In cases where you need to zoom in or zoom out, you must first finish Zooming Out and ZoomingIn.

AboutBox example for C++ Builder

AddNoise example for C++ Builder

Animate Event Example for C++ Builder

AnimationEnable Example for C++ Builder

AnnAddUndoNode Example for C++ Builder

AnnAutoDialogFontSize Example for C++ Builder

AnnAutoDrawEnable Example for C++ Builder

AnnAutomation Example for C++ Builder

AnnAutoMenuEnable Example for C++ Builder

AnnChange example for C++ Builder

AnnContainer Example for C++ Builder

AnnDataPath example for C++ Builder

AnnDestroy example for C++ Builder

AnnEnumerate example for C++ Builder

AnnEnumerate method example for C++ Builder

AnnGetAutoMenuItemEnable example for C++ Builder

AnnGetGrouping example for C++ Builder

AnnGetHyperlinkParam example for C++ Builder

AnnGetHyperlinkString example for C++ Builder

AnnGetHyperlinkType example for C++ Builder

AnnGetObjectFromTag example for C++ Builder

AnnGetPoint... example for C++ Builder

AnnGetSelectList example for C++ Builder

AnnGetVisible example for C++ Builder

AnnGroup example for C++ Builder

AnnHyperlink example for C++ Builder

AnnHyperlinkMenu example for C++ Builder

AnnHyperlinkMenuEnable example for C++ Builder

AnnInsert example for C++ Builder

AnnLoadArray example for C++ Builder

AnnLock example for C++ Builder

AnnLocked example for C++ Builder

AnnMenu example for C++ Builder

AnnMouseDown example for C++ Builder

AnnMove example for C++ Builder

AnnParentRasterView example for C++ Builder

AnnRectLeft example for C++ Builder

AnnRotate example for C++ Builder

AnnSaveArray example for C++ Builder

AnnSaveMemory example for C++ Builder

AnnSaveTag example for C++ Builder

AnnSelect example for C++ Builder

AnnSetAutoMenuItemEnable Example for C++ Builder

AnnSetAutoText Example for C++ Builder

AnnSetUser Example for C++ Builder

AnnShowLockedIcon Example for C++ Builder

AnnToolChecked Example for C++ Builder

AnnToolDestroy Example for C++ Builder

AnnUndo Example for C++ Builder

AnnUndoEnable Example for C++ Builder

AnnUngroup Example for C++ Builder

AnnUnlock Example for C++ Builder

AnnUnlocked Example for C++ Builder

AnnUnrealize Example for C++ Builder

Appearance Example for C++ Builder

AutoAnimate Example for C++ Builder

AutoPan Example for C++ Builder

AutoSize Example for C++ Builder

AutoTrim example for C++ Builder

Average example for C++ Builder

BackColor example for C++ Builder

BackErase example for C++ Builder

BinaryFilter example for C++ Builder

BitmapAlpha example for C++ Builder

BitmapDataPath Example for C++ Builder

BitmapToClient example for C++ Builder

BitmapXres and BitmapYres example for C++ Builder

BitonalScaling example for C++ Builder

BorderRemove example for C++ Builder

BorderStyle example for C++ Builder

ButtonColumns example for C++ Builder

ButtonMenuTool example for C++ Builder

ButtonRows example for C++ Builder

ButtonVisible example for C++ Builder

Capture example for C++ Builder

Change example for C++ Builder

Click example for C++ Builder

ClientToBitmap example for C++ Builder

ColorRes example for C++ Builder

ColorResList Example for C++ Builder

Combine example for C++ Builder

Comment example for C++ Builder

ContourFilter example for C++ Builder

Contrast example for C++ Builder

Create example for C++ Builder

Create Bitmap, Size, and Combine example for C++ Builder

dbCan... example for C++ Builder

DblClick example for C++ Builder

DDB example for C++ Builder

DeleteBitmapListItems example for C++ Builder

DeletePage example for C++ Builder

Deskew example for C++ Builder

Despeckle example for C++ Builder

DIB example for C++ Builder

DocCleanSuccess example for C++ Builder

DrawShape example for C++ Builder

DrawText example for C++ Builder

Dst... example for C++ Builder

Emboss example for C++ Builder

EnableMethodErrors example for C++ Builder

EnablePaint example for C++ Builder

EnableZoomInRect example for C++ Builder

Exif example for C++ Builder

FastRotate example for C++ Builder

FeedLoad example for C++ Builder

FilePage Event Example for C++ Builder

Fill example for C++ Builder

Flip example for C++ Builder

FloaterDstClip... example for C++ Builder

Font example for C++ Builder

Frame... example for C++ Builder

GammaCorrect example for C++ Builder

GetBitmapDC example for C++ Builder

GetColorCount Example for C++ Builder

GetDIB2 Example for C++ Builder

GetFileInfo example for C++ Builder

GetFloaterHandle example for C++ Builder

GetHistogram example for C++ Builder

GetHistogramGray example for C++ Builder

GetMinMaxBits Example for C++ Builder

GetMinMaxVal Example for C++ Builder

GetRgnHandle example for C++ Builder

Grayscale example for C++ Builder

Halftone example for C++ Builder

hDocCleanRgn example for C++ Builder

HistoContrast example for C++ Builder

HistoEqualize example for C++ Builder

HSV_HfromRGB example for C++ Builder

Hue example for C++ Builder

IgnoreFilters example for C++ Builder

InfoHasAlpha example for C++ Builder

InfoViewPerspective Example for C++ Builder

InsertBitmapListItem Example for C++ Builder

Intensity example for C++ Builder

IntensityDetect example for C++ Builder

Invert example for C++ Builder

InvertedText example for C++ Builder

IsGrayscale example for C++ Builder

J2KCompressionControl Example for C++ Builder

J2KCompressionRatio Example for C++ Builder

J2KSetDefaults Example for C++ Builder

J2KTargetFileSize Example for C++ Builder

KeyPress example for C++ Builder

LevelLowBit example for C++ Builder

LevelHighBit example for C++ Builder

LevelLUT example for C++ Builder

LevelLUTLength example for C++ Builder

LineRemove example for C++ Builder

LoadArray example for C++ Builder

LoadCompressed example for C++ Builder

LoadIFD example for C++ Builder

LoadInfo... example for C++ Builder

LoadMemory example for C++ Builder

LoadUseViewPerspective example for C++ Builder

MaxFilter example for C++ Builder

Median example for C++ Builder

MinFilter example for C++ Builder

MinVal example for C++ Builder

Mosaic example for C++ Builder

ODBC Example for C++ Builder

Oilify example for C++ Builder

OLEDropAllowed example for C++ Builder

OLEDropFile example for C++ Builder

Paint event example for C++ Builder

PaintContrast example for C++ Builder

PaintDither example for C++ Builder

PaintEffect example for C++ Builder

PaintEffectMaxPasses example for C++ Builder

PaintGamma example for C++ Builder

PaintIntensity example for C++ Builder

PaintPalette example for C++ Builder

PaintROP3 example for C++ Builder

PaintScaling Example for C++ Builder

PaintSizeMode Example for C++ Builder

PaintSizeUseDPI example for C++ Builder

PaintTransitionMaxPasses example for C++ Builder

PaintWhileLoad example for C++ Builder

PaintZoomFactor Example for C++ Builder

PatternStyle example for C++ Builder

PatternStyle (ILEADRasterFXD) example for C++ Builder

PCDRes example for C++ Builder

PDFSaveUseDPI Example for C++ Builder

PDFXResolution example for C++ Builder

Picturize example for C++ Builder

Pixel example for C++ Builder

Posterize example for C++ Builder

PreferredLoadFormat Example for C++ Builder

PreLoadFilters Example for C++ Builder

PrintNewPage Example for C++ Builder

PrinterScaleHeight Example for C++ Builder

ProgressivePasses Example for C++ Builder

RasterizeViewMode Example for C++ Builder

RawLoad Example for C++ Builder

RawSave Example for C++ Builder

ReadLoadResolutions Example for C++ Builder

ReadyState Example for C++ Builder

RefBitmap Example for C++ Builder

RefBitmapList Example for C++ Builder

RemapHue example for C++ Builder

Resize event example for C++ Builder

RGBfromHSV example for C++ Builder

RgnChange example for C++ Builder

RgnFrameColor example for C++ Builder

Rotate example for C++ Builder

Saturation example for C++ Builder

Save example for C++ Builder

SaveArray example for C++ Builder

SaveIFD example for C++ Builder

SaveInterlaced example for C++ Builder

SaveLSB example for C++ Builder

SaveMemory example for C++ Builder

SavePage example for C++ Builder

SaveResolutionCount example for C++ Builder

SaveWithStamp example for C++ Builder

Scroll event example for C++ Builder

SetRgn... example for C++ Builder

SetRgnColorHSVRange example for C++ Builder

SetRgnColorRGBRange example for C++ Builder

SetRgnMagicWand example for C++ Builder

SetSrcClipRect example for C++ Builder

SetSrcRect example for C++ Builder

SetTag example for C++ Builder

Sharpen example for C++ Builder

Shear example for C++ Builder

Smooth example for C++ Builder

Solarize example for C++ Builder

SpatialFilter example for C++ Builder

Src... example for C++ Builder

Stable example for C++ Builder

StopMagGlass example for C++ Builder

StretchIntensity example for C++ Builder

TextWordWrap example for C++ Builder

Tool example for C++ Builder

TransitionEffect example for C++ Builder

Transparent example for C++ Builder

Trim example for C++ Builder

UpdateMagGlassShape example for C++ Builder

Underlay example for C++ Builder

UserPalette and BitmapPalette example for C++ Builder

VTable example for C++ Builder

WindowLevel example for C++ Builder

WindowLevelFillLUT example for C++ Builder

WMFResolution example for C++ Builder

WriteComment example for C++ Builder

ZoomIn example for C++ Builder

ZoomInDone example for C++ Builder


AboutBox example for C++ Builder

//This example displays the LEADTOOLS COM RasterView Control information.
LEADRasterView1->AboutBox ();


AddNoise example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->AddNoise ( LEADRasterView1->Raster, 500, CHANNEL_RED);
LEADRasterView1->ForceRepaint ( ) ;
pRasterProc-> Release ();


Animate Event Example for C++ Builder

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (LEADRasterView1->AnimationEnable)
LEADRasterView1->AnimationEnable= False;
else
LEADRasterView1->AnimationEnable = True;
}

void __fastcall TForm1::LEADRasterView1Animate (TObject *Sender,
TOLEBOOL bEnable)
{
if (bEnable)
Button1->Caption= "&Stop Animation";
else
Button1->Caption= "&Start animation";
}


AnimationEnable Example for C++ Builder

This example loads and plays an animated file. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

LEADRasterIO * pRasterIO;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//Load all pages of a GIF file.
pRasterIO->Load ( LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\eye.gif"), 0, 1, -1 ) ;

pRasterIO-> Release ( );
//Set properties for a scaled animation.
LEADRasterView1->AutoRepaint = True;
LEADRasterView1->AutoSetRects = False;
//Set the image display size to match the LEAD control.
LEADRasterView1->SetDstRect ( 0, 0,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect ( 0, 0,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
//Allow a continuous loop.
LEADRasterView1->AnimationLoop = True;
//Start the animation.
LEADRasterView1->AnimationEnable = True;


AnnAddUndoNode Example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}

//This example creates two annotation notes as a single undo operation
void __fastcall TForm1::Button2Click(TObject *Sender)
{
long hObject1;
long hObject2;

//Call the AddUndoNode method to add an undo node to the container.
pRasterAnn->AnnAddUndoNode ();

//Disable the undo feature
pRasterAnn->AnnUndoEnable = False;

//Perform the operations to be combined into one undo.
pRasterAnn->AnnCreate (ANN_OBJECT_NOTE, true, true);
hObject1= pRasterAnn->AnnObject;
pRasterAnn->set_AnnRectLeft (hObject1, 0);
pRasterAnn->set_AnnRectTop (hObject1, 0);
pRasterAnn->set_AnnRectWidth (hObject1, 100);
pRasterAnn->set_AnnRectHeight (hObject1, 100);

pRasterAnn->AnnCreate (ANN_OBJECT_NOTE, true, true);
hObject2= pRasterAnn->AnnObject;
pRasterAnn->set_AnnRectLeft(hObject2, 0);
pRasterAnn->set_AnnRectTop(hObject2, 100);
pRasterAnn->set_AnnRectWidth(hObject2, 100);
pRasterAnn->set_AnnRectHeight(hObject2, 100);

//Re-enable the undo feature
pRasterAnn->AnnUndoEnable = True;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}


AnnAutoDialogFontSize Example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}

//This example will set the dialog fonts to use Courier 15
void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnSetAutoText (ANN_AUTOTEXT_DIALOG_FONT, AnsiToOLESTR("Courier New"));
pRasterAnn->AnnAutoDialogFontSize = 15;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}


AnnAutoDrawEnable Example for C++ Builder

Note:

This topic is for Document/Medical only.

This example toggles the AnnAutoDrawEnable property.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
if (pRasterAnn->AnnAutoDrawEnable)
pRasterAnn->AnnAutoDrawEnable = false;
else
pRasterAnn->AnnAutoDrawEnable = true;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}


AnnAutomation Property Example for C++ Builder

#include "l_bitmap.h"

//Global declarations
1LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}
//This example shows how you can use the AnnAutomation property
//to access the automation object through API functions.
//You must link to the ltann_bc.lib import lib
#include "l_bitmap.h"
void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;
unsigned int IsBold; //Is the object's text bold
long hAnnObject;

hAnnObject = pRasterAnn->AnnAutomation;

// Toggle the default font bold property
L_AnnGetFontBold
  ((void *)hAnnObject, &IsBold);
if (IsBold != 0)
ShowMessage ("Removing bold");
else
ShowMessage ("Making bold");

nRet = L_AnnSetFontBold
  ((void * )hAnnObject, !IsBold, 0);
if (nRet != 1)
ShowMessage ("L_AnnSetFontBold failed: " + IntToStr(nRet));
}
}


AnnAutoMenuEnable Example for C++ Builder

Note:

This topic is for Document/Medical only.

This example toggles the AnnAutoMenuEnable property.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
if (pRasterAnn->AnnAutoMenuEnable)
pRasterAnn->AnnAutoMenuEnable = false;
else
pRasterAnn->AnnAutoMenuEnable = true;
}


AnnChange example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

//This example tests the AnnChange event.
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
int hAnnObject;
AnsiString Buffer;
long nTag;

switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNCHANGE:
{
hAnnObject= (OleVariant)(Params.rgvarg[0]);
pRasterAnn->AnnGetTag (hAnnObject);
nTag= pRasterAnn->AnnTag;
Buffer = " This is a change for the button tagged " + IntToStr((int)nTag);
ShowMessage (Buffer.c_str());
}
break;
}

}


AnnContainer example for C++ Builder

void __fastcall TForm1::LEADRasterOLEDB1DataLoaded(TObject *Sender,
short nStatus)
{
if (nStatus == 0)
{
pRasterAnn->AnnContainer = 0;
pRasterAnn->AnnContainer = LEADRasterOLEDB1->AnnContainer;
}
else
{
if (nStatus != ERROR_FILENOTFOUND) //if it's not an empty record
ShowMessage ( "Error loading from database!") ;
}
LEADRasterView1->ForceRepaint ( ) ;
}


AnnDataPath example for C++ Builder

Note:

This topic is for Document/Medical only.

This example shows how to load an annotation file from the Internet.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);|
| pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnUserMode = ANN_USERMODE_RUN;
pRasterAnn->AnnDataPath (AnsiToOLESTR("http://www.leadtools.com/images/test.ann"));
}


AnnDestroy example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnDestroy (pRasterAnn->AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED);
}


AnnEnumerate example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

//This example causes the AnnEnumerate event to get fired for all annotations in the //container.
void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnEnumerate (pRasterAnn->AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, AnsiToOLESTR(""));
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
int hObject;
AnsiString Msg;

switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNENUMERATE:
{
hObject= (OleVariant)(Params.rgvarg[0]);
sprintf( Msg.c_str(),"Annotation Handle: %x", hObject);
ShowMessage (Msg.c_str());
}
break;
}
}


AnnEnumerate method example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example enumerates through all objects in the AnnContainer
For each object, the AnnEnumerate event is fired*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnEnumerate (pRasterAnn->AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, AnsiToOLESTR(""));

}


AnnGetAutoMenuItemEnable example for C++ Builder

//This example disables the "delete" menu item from the annotation hGlobalAnn.
//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;
long hGlobalAnn;

//Note that hGlobalAnn should be a valid value before clicking Button2.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
AnnMenuConstants iEnable;
//This example disables the "delete" menu item from the annotation hGlobalAnn.
pRasterAnn->AnnSetAutoMenuItemEnable (hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, AnsiToOLESTR(""));
pRasterAnn->AnnGetAutoMenuItemEnable (hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE);
iEnable= pRasterAnn->AnnAutoMenuItemEnable;
switch (iEnable)
{
case ANN_MENU_ENABLED:
ShowMessage ("ANN_MENU_ENABLED");
break;
case ANN_MENU_DISABLED:
ShowMessage ("ANN_MENU_DISABLED");
break;

case ANN_MENU_DEFAULT:
ShowMessage ("ANN_MENU_DEFAULT");
break;
}
}


AnnGetGrouping example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example toggles the 'group' state of all objects in the main container*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
bool bGroup;

//Get current group state
bGroup= pRasterAnn->AnnGetGrouping (pRasterAnn->AnnContainer);

//Toggle the group state
pRasterAnn->AnnSetGrouping (pRasterAnn->AnnContainer, !bGroup, 0);

//Display the group state
if (pRasterAnn->AnnGetGrouping(pRasterAnn->AnnContainer))
ShowMessage ("Objects in AnnContainer are grouped");
else
ShowMessage ("Objects in AnnContainer are not grouped");
}


AnnGetHyperlinkParam example for C++ Builder

Note:

This topic is for Document/Medical only.

This example retrieves parameters using AnnGetHyperlinkParam.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
long nParam0;
long nParam1;
long nParam2;
long nParam3;
long nParam4;

pRasterAnn->AnnSetHyperlinkMsg (hGlobalAnn, ANN_LINK_ANNEVENT5, 1, 2, 3, 4, 5);

pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 0);
nParam0= pRasterAnn->AnnHyperlinkParam;
pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 1);
nParam1= pRasterAnn->AnnHyperlinkParam;
pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 2);
nParam2= pRasterAnn->AnnHyperlinkParam;
pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 3);
nParam3= pRasterAnn->AnnHyperlinkParam;
pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 4);
nParam4= pRasterAnn->AnnHyperlinkParam;
ShowMessage ("HyperlinkParams: " + IntToStr((int)nParam0) + "," + IntToStr((int)nParam1) + "," + IntToStr((int)nParam2) + "," + IntToStr((int)nParam3) + "," + IntToStr((int)nParam4));
}


AnnGetHyperlinkString example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

//This examples assumes that hGlobalAnn is a handle to a button annotation.
//A hyperlink string is set and retrieved
void __fastcall TForm2::Button2Click(TObject *Sender)
{
BSTR bstrHyperlink;
AnsiString szString;
pRasterAnn->AnnSetHyperlinkString (hGlobalAnn, ANN_LINK_WEBPAGE, AnsiToOLESTR("http://www.leadtools.com"));
pRasterAnn->AnnGetHyperlinkString (hGlobalAnn);
bstrHyperlink= pRasterAnn->AnnHyperlinkString;
szString= bstrHyperlink;
::SysFreeString(bstrHyperlink);
ShowMessage (szString);
}


AnnGetHyperlinkType example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

//This examples determines the type of the hyperlink and then displays the
//params if the type is ANN_LINK_ANNEVENT or ANN_LINK_ANNEVENT5
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{

switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNHYPERLINK:
{
int lParam5= OleVariant(Params.rgvarg[0]);
int lParam4= OleVariant(Params.rgvarg[1]);
int lParam3= OleVariant(Params.rgvarg[2]);
int lParam2= OleVariant(Params.rgvarg[3]);
int lParam1= OleVariant(Params.rgvarg[4]);
int iParamCount= OleVariant(Params.rgvarg[5]);
int hObject= OleVariant(Params.rgvarg[6]);
AnsiString msgStr;
short nType;

pRasterAnn->AnnGetHyperlinkType (hObject);
nType= pRasterAnn->AnnHyperlinkType;
if ((nType == ANN_LINK_ANNEVENT5) || (nType == ANN_LINK_ANNEVENT))
{
if (iParamCount >= 0)
msgStr= IntToStr(iParamCount) + " params are valid \n";
if (iParamCount >= 1)
msgStr = msgStr + "Param1: " + IntToStr(lParam1) + "\n";

if (iParamCount >= 2)
msgStr = msgStr + "Param2: " + IntToStr(lParam2) + "\n";

if (iParamCount >= 3)
msgStr = msgStr + "Param3: " + IntToStr(lParam3) + "\n";

if (iParamCount >= 4)
msgStr = msgStr + "Param4: " + IntToStr(lParam4) + "\n";

if (iParamCount == 5)
msgStr = msgStr + "Param5: " + IntToStr(lParam5) + "\n";
}
else
msgStr= "Invalid Type";
ShowMessage (msgStr);
}
break;
}
}


AnnGetObjectFromTag example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

//This example retrieves the annotation handle for tag no. 1
void __fastcall TForm1::Button2Click(TObject *Sender)
{
AnsiString Msg;
long hTagObject;
long lTag;

ShowMessage ("I Will Looking For an Object With Tag = 1");
pRasterAnn->AnnGetObjectFromTag (pRasterAnn->AnnContainer, 1, False);
hTagObject= pRasterAnn->AnnTagObject;
pRasterAnn->AnnGetTag (hTagObject);
lTag= pRasterAnn->AnnTag;
if (lTag== 1)
{
sprintf(Msg.c_str(), "Annotation Found with tag 1 : %x", hTagObject);
ShowMessage (Msg.c_str());
}
else
ShowMessage ("Annotation NOT found with tag 1 ");
}


AnnGetPoint... example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*In the AnnDrawn event, this example checks to see if the annotation object is a polygon.
If it is a polygon, the example gets the number of points that define the object;
then it gets the arrays of X and Y coordinates and displays the points in a message box.*/
void __fastcall TForm1::LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
int hAnnObject;
AnnObjectType nType;

int i;
ILEADRasterVariant* pRasterVarX; //array for the X coordinates
ILEADRasterVariant* pRasterVarY; //array for the Y coordinates
long nPoints; //number of points in the object
AnsiString msgStr;
float x, y;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarX);

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarY);

switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNDRAWN:
{
hAnnObject= OleVariant(Params.rgvarg[0]);
pRasterAnn->AnnGetType(hAnnObject);
nType= pRasterAnn->get_AnnType_();
if (nType == ANN_OBJECT_POLYGON) //Is the object a polygon?
{
ShowMessage ("Object is a Polygon");

pRasterAnn->AnnGetPointCount(hAnnObject); //get the number of points
nPoints= pRasterAnn->AnnPointCount;
pRasterAnn->AnnGetPointX((long)hAnnObject, pRasterVarX); //get the X coordinates
pRasterAnn-> AnnGetPointY ((long)hAnnObject, pRasterVarX); //get the Y coordinates
msgStr = "(";
ShowMessage ("The polygon points " +IntToStr((int)nPoints)+ " are:");
for (i=0; i<nPoints; i++)
{
x= pRasterVarX->get_LongItemValue(i - 1);
y= pRasterVarY->get_LongItemValue(i - 1);
msgStr= msgStr + "{" + FloatToStr(x) + "," + FloatToStr(y) + "}";
}

msgStr += ")";

ShowMessage (msgStr);
}
}
break;
}
if ( pRasterVarX )
pRasterVarX->Release ( );

if ( pRasterVarY )
pRasterVarY->Release ( );
}


AnnGetSelectList example for C++ Builder

Note:

This topic is for Document/Medical only.

This example gets the number of selected annotation objects; then it gets an array of the selected object handles and checks to see if any of the objects in the array are polygons.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
AnnObjectType nType;
int a;
bool bSelected;
int nCount;
int hObject;
ILEADRasterVariant* pRasterVarObjects; //array for the selected object handles
bSelected= False;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarObjects);

pRasterAnn->AnnGetSelectCount( );
nCount= pRasterAnn->AnnSelectCount;//get number of selected objects
pRasterAnn->AnnGetSelectList( pRasterVarObjects ); //get the handles of the selected objects
ShowMessage (IntToStr(nCount) + " objects were selected" );
for (a = 0; a < nCount; a ++)
{
hObject= pRasterVarObjects->get_LongItemValue(a);
pRasterAnn->AnnGetType(hObject);
nType= pRasterAnn->get_AnnType_();
if (nType == ANN_OBJECT_POLYGON) //Is the object a polygon?
bSelected = True;
}
if (!bSelected)
ShowMessage ("No Polygon Objects were selected");
if ( pRasterVarObjects )
{
pRasterVarObjects->Release();
pRasterVarObjects= NULL;
}
}


AnnGetVisible example for C++ Builder

//This example toggles the visible state of the annotation container.
void __fastcall TForm1::Button2Click(TObject *S1ender)
{
TOLEBOOL bVisible;

pRasterAnn->AnnGetVisible (pRasterAnn->AnnContainer);
bVisible= pRasterAnn->AnnVisible;
if (bVisible)
bVisible= false;
else
bVisible= true;
pRasterAnn->AnnSetVisible (pRasterAnn->AnnContainer, bVisible, ANN_FLAG_RECURSE, AnsiToOLESTR(""));
pRasterAnn->AnnGetVisible (pRasterAnn->AnnContainer);
bVisible= pRasterAnn->AnnVisible;
if (bVisible)
ShowMessage ("AnnGetVisible: True");
else
ShowMessage ("AnnGetVisible: False");
}


AnnGroup example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnGroup (pRasterAnn->AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, AnsiToOLESTR(""));
}


AnnHyperlink example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{

switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNHYPERLINK:
{
int hObject= (OleVariant)(Params.rgvarg[6]);
int iParamCount= (OleVariant)(Params.rgvarg[5]);
int lParam1= (OleVariant)(Params.rgvarg[4]);
int lParam2= (OleVariant)(Params.rgvarg[3]);
int lParam3= (OleVariant)(Params.rgvarg[2]);
int lParam4= (OleVariant)(Params.rgvarg[1]);
int lParam5= (OleVariant)(Params.rgvarg[0]);
AnsiString msgstr;
short nType;

pRasterAnn->AnnGetHyperlinkType (hObject);
nType= pRasterAnn->AnnHyperlinkType;
if ((nType == ANN_LINK_ANNEVENT5) || (nType == ANN_LINK_ANNEVENT))
{
if (iParamCount >= 0)
msgstr = IntToStr(iParamCount) + " params are valid\n";

if (iParamCount >= 1)
msgstr = msgstr + "Param1: " + IntToStr(lParam1) + "\n";

if (iParamCount >= 2)
msgstr = msgstr + "Param2: " + IntToStr(lParam2) + "\n";

if (iParamCount >= 3)
msgstr = msgstr + "Param3: " + IntToStr(lParam3) + "\n";

if (iParamCount >= 4)
msgstr = msgstr + "Param4: " + IntToStr(lParam4) + "\n";

if (iParamCount == 5)
msgstr = msgstr + "Param5: " + IntToStr(lParam5) + "\n";
}
else
msgstr = "Invalid Type";

ShowMessage (msgstr);
}
}
}


AnnHyperlinkMenu example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*The AnnHyperLinkMenu event occurs whenever the user clicks on the Hyperlink menu item provided for automated annotations.
The menu item is enabled and disabled using AnnHyperlinkMenuEnable property.
The following is an example of AnnHyperlinkMenu event code, which includes a call to AnnSetHyperlinkMsg.*/
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNHYPERLINKMENU:
{
int hObject;
ILEADRasterVariant* pRasterVarObjects= NULL;
int nCount;
int x;

pRasterVarObjects= (ILEADRasterVariant*)(Params.rgvarg[1].pdispVal);
nCount= (OleVariant)(Params.rgvarg[0]);

/*set HyperLink to type ANNLINK_ANNEVENT5
and set the 5 params to some values.*/
for (x = 0; x < nCount; x ++ )
{
hObject= pRasterVarObjects->get_LongItemValue(x);
pRasterAnn->AnnSetHyperlinkMsg(hObject, ANN_LINK_ANNEVENT5, 5, 4, 3, 2, 1);
}
}
}
}


AnnHyperlinkMenuEnable example for C++ Builder

Note:

This topic is for Document/Medical only.

This example toggles the AnnHyperlinkMenuEnable property.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
if (pRasterAnn->AnnHyperlinkMenuEnable )
{
pRasterAnn->AnnHyperlinkMenuEnable= false;
ShowMessage ("AnnHyperlinkMenuEnable: True");
}
else
{
pRasterAnn->AnnHyperlinkMenuEnable = true;
ShowMessage ("AnnHyperlinkMenuEnable: False ");
}
}


AnnInsert example for C++ Builder

Note:

This topic is for Document/Medical only.

//This example
//1.creates an ellipse annotation object
//2.sizes the ellipse
//3.inserts the ellipse into the annotation container
void __fastcall TForm1::AnnInsertClick(TObject *Sender)
{
long hEllipseObject;

pRasterAnn->AnnCreate (ANN_OBJECT_ELLIPSE, false, true) ;
hEllipseObject= pRasterAnn->AnnObject;
pRasterAnn->set_AnnRectLeft (hEllipseObject, 0);
pRasterAnn->set_AnnRectTop (hEllipseObject, 0);
pRasterAnn->set_AnnRectWidth (hEllipseObject, 100);
pRasterAnn->set_AnnRectHeight (hEllipseObject, 100);
pRasterAnn->AnnInsert ( pRasterAnn->AnnContainer, hEllipseObject, false ) ;
}


AnnLoadArray example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::AnnLoadArrayClick(TObject *Sender)
{
long lCount;
HFILE hFile;
HGLOBAL hData=NULL;
char * pData=NULL;
ILEADRasterVariant* pRasterVarBuffer= NULL;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarBuffer);
if ( pRasterVarBuffer )
{
hFile = _lopen("c:\\test.ann", OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData = (char*)GlobalLock(hData);

_lread(hFile, pData, lCount);

pRasterVarBuffer->set_Type( VALUE_ARRAY_BYTE );
pRasterVarBuffer->ItemCount= lCount;

for ( int i= 0; i < lCount; i ++ )
{
pRasterVarBuffer->set_ShortItemValue( i, (short)pData[i] );
}
GlobalUnlock(hData);
GlobalFree(hData);

pRasterAnn->AnnLoadArray( pRasterVarBuffer, lCount, 1 );
_lclose(hFile);

if ( pRasterVarBuffer )
{
pRasterVarBuffer->Release();
pRasterVarBuffer= NULL;
}
}

}


AnnLock example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::AnnLockClick(TObject *Sender)
{
/*This example locks objects of type ANN_OBJECT_ELLIPSE using the key "LEADTOOLS".*/
int nType;
int x;
bool bSelected;
int nCount;
ILEADRasterVariant* pRasterVarObjects= NULL; //array for the selected object handles
int hObject;

//lock only the ellipse objects that are selected

bSelected = False;
CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarObjects);
if ( pRasterVarObjects )
{
pRasterAnn->AnnGetSelectCount( ); //get number of selected objects
nCount= pRasterAnn->AnnPointCount;
pRasterAnn->AnnGetSelectList(pRasterVarObjects); //get the handles of the selected objects
for (x = 0; x < nCount; x ++ )
{
hObject= pRasterVarObjects->get_LongItemValue(x);
pRasterAnn->AnnGetType(hObject);
nType= (short)pRasterAnn->get_AnnType_();
if (nType == ANN_OBJECT_ELLIPSE) //Is the object an ellipse?
{
bSelected = true;
pRasterAnn->AnnLock(hObject, AnsiToOLESTR("LEADTOOLS"), false);
}
}
if (bSelected != True)
ShowMessage ("No Ellipse Objects were selected");

if ( pRasterVarObjects )
{
pRasterVarObjects->Release();
pRasterVarObjects= NULL;
}
}
}


AnnLocked example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*The following is an example of an AnnLocked event.*/
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNLOCKED:
{
int hAnnObject = (OleVariant)(Params.rgvarg[0]);
ShowMessage ("AnnObject: " + IntToStr(hAnnObject) + " was locked!" );
}
}
}


AnnMenu example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNMENU:
{

int hMenu = (OleVariant)(Params.rgvarg[0]);
AnsiString szout;
int nID;
LEADRasterAnnMenu* pRasAnnMenu= NULL;
ILEADRasterAnnMenu *pPopupMenuItem = NULL;
short x;

HRESULT hr = CoCreateInstance(CLSID_LEADRasterAnnMenu,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnMenu,
(void**)&pRasAnnMenu
);

if (SUCCEEDED(hr) && (pRasAnnMenu != NULL) )
{

pRasAnnMenu->SetAnnMenu (hMenu);
pRasAnnMenu->EnableMethodErrors = false;
szout = "There are " + IntToStr(pRasAnnMenu->Count) + " Items";
ShowMessage (szout);
szout = "Original Text for item#2: ";
szout = szout + pRasAnnMenu->get_ItemString(1);
ShowMessage (szout);
//set new string
pRasAnnMenu->set_ItemString (1, AnsiToOLESTR("TestText"));
szout = "Custom Text for item#2: ";
szout = szout + pRasAnnMenu->get_ItemString(1);
ShowMessage (szout);

//make 3rd and 4th menu items have the same command id
nID = pRasAnnMenu->get_ItemID (3);
pRasAnnMenu->set_ItemID(2, nID);

//check all unchecked menu items that are not popup submenus
//disable all enabled menu items that are not popup submenus
for (x = 0; x <= pRasAnnMenu->Count; x ++)
{
if (pRasAnnMenu->get_ItemType (x) == ANN_MENUITEMTYPE_NORMAL)
{
if (pRasAnnMenu->get_ItemChecked (x))
pRasAnnMenu->set_ItemChecked(x, true);
if (pRasAnnMenu->get_ItemEnabled (x))
pRasAnnMenu->set_ItemEnabled(x, false);
}
}

//insert 2 user-defined menu items
pRasAnnMenu->AddItem (AnsiToOLESTR("Test&1"), ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 0, (short)(pRasAnnMenu->Count - 1));
pRasAnnMenu->AddItem (AnsiToOLESTR("Test&2"), ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 1, (short)(pRasAnnMenu->Count - 1));

//delete the last menu item
pRasAnnMenu->DeleteItem ((short)(pRasAnnMenu->Count - 1));

//delete the first menu item
pRasAnnMenu->DeleteItem (0);

//insert a popup menu
pRasAnnMenu->AddItem (AnsiToOLESTR("Popup"), ANN_MENUITEMTYPE_SUBMENU, 0, pRasAnnMenu->Count);

//get the new item, and add some items to it
pRasAnnMenu->GetSubMenu ((short)(pRasAnnMenu->Count - 1), &pPopupMenuItem);

pPopupMenuItem->AddItem (AnsiToOLESTR("Popup&1"), ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 2, pPopupMenuItem->Count);
pPopupMenuItem->AddItem (AnsiToOLESTR("Popup&2"), ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 3, pPopupMenuItem->Count);

pRasAnnMenu->Release();
}
}
break;

case LEADRASTERANNOTATIONEVENTS_ANNUSERMENU:
{
int nID = (OleVariant)(Params.rgvarg[0]);
if (nID == ANN_EVENT_MENUFIRST)
pRasterAnn->AnnFlip (false, 0, true);
else
ShowMessage ("nID = ANN_EVENT_MENUFIRST + " + IntToStr(nID - ANN_EVENT_MENUFIRST));
}
break;
}
}


AnnMouseDown example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;
long hRectObject;
long hEllipseObject;
long x0;
long y0;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example shows
1.
How to create a custom annotation (circle inside a square)
Set the AnnTool property to ANN_TOOL_USER_FIRST to see how this works

2.
How to restrict the rectangle annotation to be a square
Set AnnTool property to ANN_TOOL_RECTANGLE to see how this works*/

void AdjustMousePos(int Shift, long x, long y)
{

int dx;
int dy;
if (Shift == 1)
{
// if shift key is down, force the creation of squares
dx = abs(x - x0);
dy = abs(y - y0);
if (dx > dy)
{
// adjust y to be as far from y0 as x is from x0
if (y > y0)
y = y0 + dx;
else
y = y0 - dx;
}
else
{
// adjust x to be as far from x0 as y is from y0
if (x > x0)
x = x0 + dy;
else
x = x0 - dy;
}
// set the mouse cursor and update its position
pRasterAnn->SetMousePos (x, y, false);
}
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNMOUSEDOWN:
{
int x = (OleVariant)(Params.rgvarg[1]);
int y = (OleVariant)(Params.rgvarg[0]);

x0 = x;
y0 = y;
switch (pRasterAnn->AnnTool)
{
case ANN_TOOL_USER_FIRST:
{
//create the objects
pRasterAnn->AnnSetSelected (pRasterAnn->AnnContainer, false, true);
//Add an undo node to undo the creation of these objects.
pRasterAnn->AnnAddUndoNode ();

pRasterAnn->AnnCreate (ANN_OBJECT_RECT, true, true);
hRectObject= pRasterAnn->AnnObject;
pRasterAnn->AnnCreate (ANN_OBJECT_ELLIPSE, true, true);
hEllipseObject= pRasterAnn->AnnObject;
// set the automation defaults to the objects newly created
pRasterAnn->AnnSetAutoDefaults (hRectObject, 0);
pRasterAnn->AnnSetAutoDefaults (hEllipseObject, 0);
// start defining them from the x, y coordinate
pRasterAnn->AnnDefine (hRectObject, x, y, ANN_DEFINE_BEGINSET);
pRasterAnn->AnnDefine (hEllipseObject, x, y, ANN_DEFINE_BEGINSET);
}
break;
}
}
break;

case LEADRASTERANNOTATIONEVENTS_ANNMOUSEMOVE:
{
int Button = (OleVariant)(Params.rgvarg[3]);
int Shift = (OleVariant)(Params.rgvarg[2]);
int x = (OleVariant)(Params.rgvarg[1]);
int y = (OleVariant)(Params.rgvarg[0]);

if (Button == 1)
{
switch (pRasterAnn->AnnTool)
{
case ANN_TOOL_USER_FIRST:
{
//update the objects from the x, y coordinate
pRasterAnn->AnnDefine (hRectObject, x, y, ANN_DEFINE_UPDATE);
pRasterAnn->AnnDefine (hEllipseObject, x, y, ANN_DEFINE_UPDATE);
}
break;
case ANN_TOOL_RECT:
AdjustMousePos (Shift, x, y);
break;
}
}
}
break;
case LEADRASTERANNOTATIONEVENTS_ANNMOUSEUP:
{
int Shift = (OleVariant)(Params.rgvarg[2]);
int x = (OleVariant)(Params.rgvarg[1]);
int y = (OleVariant)(Params.rgvarg[0]);

switch (pRasterAnn->AnnTool)
{
case ANN_TOOL_USER_FIRST:
{
pRasterAnn->AnnDefine (hRectObject, x, y, ANN_DEFINE_END);
pRasterAnn->AnnDefine (hEllipseObject, x, y, ANN_DEFINE_END);
pRasterAnn->AnnSetSelected (hRectObject, true, false);
pRasterAnn->AnnSetSelected (hEllipseObject, true, false);
pRasterAnn->AnnGroup (pRasterAnn->AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, AnsiToOLESTR(""));
hEllipseObject = 0;
hRectObject = 0;
}
break;

case ANN_TOOL_RECT:
AdjustMousePos (Shift, x, y);
break;
}

}
break;
}
}


AnnMove example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example moves one or more selected annotation objects.*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
int DeltaX;
int DeltaY;

//Use pixels
LEADRasterView1->ScaleMode = 3;

//Specify arbitrary delta values.
DeltaX = 20;
DeltaY = -20;

//Move the selected annotations.
pRasterAnn->AnnMove (DeltaX, DeltaY, true);
}


AnnParentRasterView example for C++ Builder

/*This sample shows the minimal code to use the LEAD Annotation COM object
LEADRasterView1 is a LEAD Raster View control*/

void __fastcall TForm1::AnnParentRasterViewClick(TObject *Sender)
{
LEADRasterAnnotation * pRasterAnn;

CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR( L_KEY_DOCUMENT ));

//Attach the annotation object to the raster view control
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;

//Automatically update annotations with raster changes
pRasterAnn->AnnAutoUpdate = true;

//...
//... the rest of the program
//...
pRasterAnn->Release();
}


AnnRectLeft example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example creates two annotation notes as a single undo operation*/
void __fastcall TForm1::AnnAddUndoNodeClick(TObject *Sender)
{
long hObject1;
long hObject2;

//Call the AddUndoNode method to add an undo node to the container.
pRasterAnn->AnnAddUndoNode ();

//Disable the undo feature
pRasterAnn->AnnUndoEnable = False;

//Perform the operations to be combined into one undo.
pRasterAnn->AnnCreate (ANN_OBJECT_NOTE, true, true);
hObject1= pRasterAnn->AnnObject;
pRasterAnn->set_AnnRectLeft (hObject1, 0);
pRasterAnn->set_AnnRectTop (hObject1, 0);
pRasterAnn->set_AnnRectWidth (hObject1, 100);
pRasterAnn->set_AnnRectHeight (hObject1, 100);

pRasterAnn->AnnCreate (ANN_OBJECT_NOTE, true, true);
hObject2= pRasterAnn->AnnObject;
pRasterAnn->set_AnnRectLeft(hObject2, 0);
pRasterAnn->set_AnnRectTop(hObject2, 100);
pRasterAnn->set_AnnRectWidth(hObject2, 100);
pRasterAnn->set_AnnRectHeight(hObject2, 100);

//Re-enable the undo feature
pRasterAnn->AnnUndoEnable = True;
}


AnnRotate example for C++ Builder

Note:

This topic is for Document/Medical only.

/*This example uses the AnnFlip, AnnReverse, and AnnRotate methods. To code this example, add a command button named Test to the example you created in Loading and Displaying an Image. For best results when you run the example, draw two objects in opposite corners, and use the right mouse button to select all annotation objects. The command button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate methods.*/
//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::AnnRotateClick(TObject *Sender)
{
AnsiString MyCaption;

MyCaption = AnnRotate->Caption;
if (MyCaption == "Flip")
{
//Flip using the center of the bitmap as the axis->
pRasterAnn->AnnFlip (True, LEADRasterView1->Raster->BitmapHeight / 2, True);
AnnRotate ->Caption = "Reverse";
}
else
{
if (MyCaption == "Reverse")
{
//Reverse using the center of the bitmap as the axis->
pRasterAnn->AnnReverse (True, LEADRasterView1->Raster->BitmapWidth / 2, True);
AnnRotate->Caption = "Rotate";
}
else
{
if (MyCaption == "Rotate")
{
//Rotate 90 degrees using the center of the bitmap as the axis->
pRasterAnn->AnnRotate (True, LEADRasterView1->Raster->BitmapWidth / 2, LEADRasterView1->Raster->BitmapHeight / 2, 90, True);
AnnRotate->Caption = "Flip";
}
else
{
AnnRotate->Caption = "Flip";
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
pRasterAnn->AnnTool = ANN_TOOL_REDACT;
ShowMessage ("Draw two objects, use the right mouse button to select all, then click the command button");
}
}
}
}


AnnSaveArray example for C++ Builder

Note:

This topic is for Document/Medical only.

'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
long lSize;
HFILE hFile;
char * pData= NULL;
ILEADRasterVariant* pRasterVarBuffer= NULL;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarBuffer);
if ( pRasterVarBuffer )
{
pRasterAnn->AnnSaveArray(ANN_FMT_NATIVE, true, pRasterVarBuffer, SAVE_OVERWRITE, 0);
lSize = pRasterVarBuffer->ItemCount;

_lcreat("c:\\test.ann", 0);
hFile = _lopen("c:\\test.ann", OF_READWRITE);
pData= (char*) GlobalAlloc(GHND, lSize );
if ( pData )
{
for (int i= 0; i < lSize; i ++)
{
pData[i]= pRasterVarBuffer->get_ShortItemValue(i);
}
_lwrite(hFile, (LPCSTR)pData, lSize);
_lclose(hFile);
GlobalFree (pData);
}
if ( pRasterVarBuffer )
{
pRasterVarBuffer->Release();
pRasterVarBuffer= NULL;
}
}
}


AnnSaveMemory example for C++ Builder

Note:

This topic is for Document/Medical only.

This example lets you save the current annotations to a file in memory, and lets you load the annotations that were saved.

1. | Start with the project that you created in Creating and Using Annotations.
2. | Declare the following in the private section of your main form:

HGLOBAL hMemGlobal;
long iSizeGlobal;

3. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | AnnSaveMem | Save In Memory
 | AnnLoadMem | Load From Memory
4. | Code the AnnSaveMem button's Click procedure as follows:

void __fastcall TForm1::AnnSaveMemClick(TObject *Sender)
{
if (pRasterAnn->AnnSaveMemory
 ((long*)&hMemGlobal, (Ltannlib_tlb::AnnFMTConstants)ANNFMT_NATIVE,
 False, &iSizeGlobal) != 0)
ShowMessage ("Error calling AnnSaveMemory");

}

5.

Code the AnnLoadMem button's Click procedure as follows:

//Load the annotations from the memory-resident file.
void __fastcall TForm1::AnnLoadMemClick(TObject *Sender)
{
if (pRasterAnn->AnnLoadMemory
 ((long)hMemGlobal, iSizeGlobal) != 0 )
ShowMessage ("Error calling AnnLoadMemory");
else
ShowMessage ("AnnLoadMemory succeeded");
GlobalFree (hMemGlobal);

}

6.

Run your program to test it.


AnnSaveTag example for C++ Builder

Note: | Also works with Access 95 and 97.
Note: | This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image.*/
void __fastcall TForm1::AnnSaveTagClick(TObject *Sender)
{
LEADRasterIO * pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterAnn->AnnSaveTag (pRasterIO, true, false);
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\testwang.tif"), FILE_CCITT_GROUP4, 1, (QFactorConstants)2, SAVE_OVERWRITE);

//clear the LEAD raster view control
LEADRasterView1->Raster->Bitmap = 0;

//Reload the image with the wang-compatible annotations
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\testwang.tif"), 0, 0, 1);
pRasterAnn->AnnLoad (AnsiToOLESTR("c:\\testwang.tif"), 1);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
pRasterIO->Release();
}


AnnSelect example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example for the AnnSelect event displays a message box showing the number of selected annotation objects. It then goes through the array of selected objects to see if any of them are polygons.*/
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNSELECT:
{
int nType;
int x;
int nPolyCount;
ILEADRasterVariant* pRasterVarObjects= NULL;
int nCount;
int hObject;

nPolyCount = 0;
nCount = (OleVariant)(Params.rgvarg[0]);
pRasterVarObjects= (ILEADRasterVariant*)(Params.rgvarg[1].pdispVal);
for (x = 0; x < nCount; x ++ )
{
hObject= pRasterVarObjects->get_LongItemValue(x);
pRasterAnn->AnnGetType(hObject);
nType= pRasterAnn->get_AnnType_ ( );
if (nType == ANN_OBJECT_POLYGON)
nPolyCount ++;
}
ShowMessage (IntToStr(nCount) + " objects were selected. " + IntToStr(nPolyCount) + " Polygon Objects were selected");
}
break;
}
}


AnnSetAutoMenuItemEnable Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
// disable the Delete menu item from all the selected objects
pRasterAnn->AnnSetAutoMenuItemEnable (pRasterAnn->AnnContainer, 0, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, AnsiToOLESTR(""));
// disable the Delete menu item from all the ellipse objects
pRasterAnn->AnnSetAutoMenuItemEnable (pRasterAnn->AnnAutomation, ANN_OBJECT_ELLIPSE, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, 0, AnsiToOLESTR(""));
}


AnnSetAutoText Example for C++ Builder

Note:

This topic is for Document/Medical only.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
BSTR TestText;
AnsiString strText;
pRasterAnn->AnnGetAutoText (ANN_AUTOTEXT_MENU_UNDO);
TestText= pRasterAnn->AnnAutoText;
strText= TestText;
::SysFreeString(TestText);
strText += " - New";

pRasterAnn->AnnSetAutoText (ANN_AUTOTEXT_MENU_UNDO, AnsiToOLESTR(strText.c_str()));
}


AnnSetUser Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
//hide the selected objects
pRasterAnn->AnnSetVisible (pRasterAnn->AnnContainer, false, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, AnsiToOLESTR(""));
//set the selected objects to belong to user XXX
pRasterAnn->AnnSetUser (pRasterAnn->AnnContainer, AnsiToOLESTR(""), AnsiToOLESTR("xxx"), true);
}


AnnShowLockedIcon Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example toggles the AnnShowLockedIcon property.*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
if (pRasterAnn->AnnShowLockedIcon)
{
pRasterAnn->AnnShowLockedIcon= false;
ShowMessage ("AnnShowLockedIcon: True");
}
else
{
pRasterAnn->AnnShowLockedIcon= true;
ShowMessage ("AnnShowLockedIcon: False");
}
}


AnnToolChecked Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNTOOLCHECKED:
{
int iTool = (OleVariant)(Params.rgvarg[0]);
AnsiString TestString;

switch (iTool)
{
case ANN_TOOL_SELECT:
TestString = "Selection pointer tool";
break;

case ANN_TOOL_LINE:
TestString = "Line tool";
break;

case ANN_TOOL_RECT:
TestString = "Rectangle tool";
break;

case ANN_TOOL_ELLIPSE:
TestString = "Ellipse tool";
break;
//...
//...
//...
default:
TestString = "User defined tool";
}
ShowMessage (TestString);
}
break;
}
}


AnnToolDestroy Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNTOOLDESTROY:
{
ShowMessage ("You have closed the toolbar.");
}
break;
}
}


AnnUndo Example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example does an "undo" on the last annotation change
Note that AnnUndoEnable must be set to TRUE*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnUndo ();
}


AnnUndoEnable Example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example sets the annotation undo depth to 10 and
enables the annotation undo capability*/
void __fastcall TForm1:: Button2Click (TObject *Sender)
{
pRasterAnn->AnnUndoEnable = true;
pRasterAnn->AnnUndoDepth = 10;
}


AnnUngroup Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This examples ungroups all annotation objects that are grouped and selected.*/
void __fastcall TForm1:: Button2Click (TObject *Sender)
{
pRasterAnn->AnnUngroup (pRasterAnn->AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, AnsiToOLESTR(""));
}


AnnUnlock Example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This is also the example for AnnGetLocked method.
If an object is found to be locked, using AnnGetLocked method, the object is unlocked, by AnnUnlock, using the key "abcd".
hGlobalAnn is a global handle to an annotation object*/
void __fastcall TForm1:: Button2Click (TObject *Sender)
{
TOLEBOOL bLocked;
pRasterAnn->AnnGetLocked (hGlobalAnn);
blocked= pRasterAnn->AnnLocked;
if (bLocked)
pRasterAnn->AnnUnlock (hGlobalAnn, AnsiToOLESTR("abcd"));
}


AnnUnlocked Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERANNOTATIONEVENTS_ANNUNLOCKED:
{
int hAnnObject = (OleVariant)(Params.rgvarg[0]);
ShowMessage ("AnnObject: " + IntToStr(hAnnObject) + " was unlocked!");
}
break;
}
}


AnnUnrealize Example for C++ Builder

Note:

This topic is for Document/Medical only.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example Unrealizes all redact objects in the container*/
void __fastcall TForm1::Button2Click(TObject *Sender)
{
pRasterAnn->AnnUnrealize (pRasterAnn->AnnContainer, true);
}


Appearance Example for C++ Builder

This example toggles the Appearance property.

if (LEADRasterView1->Appearance == RASTERVIEW_APPEARANCE_FLAT )
LEADRasterView1->Appearance= RASTERVIEW_APPEARANCE_THREED;
else
LEADRasterView1->Appearance= RASTERVIEW_APPEARANCE_FLAT;


AutoAnimate Example for C++ Builder

This example gets information about an animated file, uses the information to position the LEAD control, and plays the animation as it loads the file.

LEADRasterIO * pRasterIO= NULL;
RECT rcClient;
// Declare variables for positioning the control.
int DisplayWidth, DisplayHeight, DisplayLeft, DisplayTop;

CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Force continued looping after the file loads.
LEADRasterView1->AutoAnimationLoop = AUTOANIMATIONLOOP_INFINITE;
// Get information about the file we will load.
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("E:\\lead14\\dist\\images\\eye.gif"), 0, 0);
// Exit if this is not an animated file.
if (pRasterIO->InfoAnimation == False)
{
ShowMessage ("Not an animated file");
return;
}
// Calculate information for centering the LEAD control.
::GetClientRect (Handle, &rcClient);
DisplayWidth= (int) pRasterIO->InfoAnimationWidth;
DisplayHeight= (int) pRasterIO->InfoAnimationHeight;
DisplayLeft= (int)(rcClient.right - DisplayWidth / 2);
DisplayTop= (int)(rcClient.bottom - DisplayHeight / 2);
// Center the LEAD control.
MoveWindow (LEADRasterView1->Handle, DisplayLeft, DisplayTop, DisplayLeft + DisplayWidth, DisplayTop + DisplayHeight, False);
// Set properties for playing the animation as is loads.
LEADRasterView1->AutoAnimate = True;
LEADRasterView1->AutoRepaint = True;
//Load the animated file.
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR ("E:\\lead14\\dist\\images\\eye.gif"), 0, 0, -1);
pRasterIO->Release ();


AutoPan Example for C++ Builder

//toggle AutoPan
LEADRasterView1->AutoPan= !LEADRasterView1-> AutoPan;


AutoSize Example for C++ Builder

This example shows how the AutoSize property works when loading and when rotating an image.

LEADRasterProcess *pRasterProc;
LEADRasterIO *pRasterIO;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->AutoSize = True;
pRasterIO->Load ( LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1 ) ;
ShowMessage ( "Control is sized to fit the loaded bitmap" ) ;
pRasterProc->Rotate ( LEADRasterView1->Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 0)) ;
ShowMessage ( "Control is sized to fit the rotated bitmap" ) ;

pRasterProc-> Release();
pRasterIO-> Release();


AutoTrim example for C++ Builder

This example trims the bitmap with threshold of 10.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->AutoTrim (LEADRasterView1->Raster, 10);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );
}


Average example for C++ Builder

This example applies an average filter with a 3x3 neighborhood and redisplays the bitmap.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Average (LEADRasterView1->Raster, 3);
LEADRasterView1->ForceRepaint ( );
pRasterProc-> Release ( );


BackColor example for C++ Builder

This example sets the background color to red. You can zoom out to see the background color.

LEADRasterView1->BackColor = (TColor)RGB(255,0,0);


BackErase example for C++ Builder

This example turns off repainting of the background, and then zooms out to show the effect when repainting.

LEADRasterView1->BackErase = False;
LEADRasterView1->AutoRepaint = False;
LEADRasterView1->AutoScroll = False;
//Calculate the values to zoom out by 10 percent and center the image
LEADRasterView1->DstWidth = LEADRasterView1->DstWidth * 0.9;
LEADRasterView1->DstHeight = LEADRasterView1->DstHeight * 0.9;
LEADRasterView1->DstTop = (LEADRasterView1->ScaleHeight - LEADRasterView1->DstHeight) / 2;
LEADRasterView1->DstLeft = (LEADRasterView1->ScaleWidth - LEADRasterView1->DstWidth) / 2;
//Set the clipping area to the same as the destination rectangle
LEADRasterView1->DstClipWidth = LEADRasterView1->DstWidth;
LEADRasterView1->DstClipHeight = LEADRasterView1->DstHeight;
LEADRasterView1->DstClipTop = LEADRasterView1->DstTop;
LEADRasterView1->DstClipLeft = LEADRasterView1->DstLeft;
//Redisplay the image
LEADRasterView1->ForceRepaint ( );


BinaryFilter example for C++ Builder

This example does omni-directional erosion of black objects and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
pRasterProc->BinaryFilter (LEADRasterView1->Raster, BFLT_EROSION_OMNI);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release ( );


BitmapAlpha example for C++ Builder

This example shows how to use the BitmapAlpha property to save a region in a file's alpha channel. It also shows how to use the region as a mask for transparency.

float rgntop;
float rgnleft;
float rgnwidth;
float rgnheight;
long int hRGN;
LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

LEADRasterView1->ScaleMode = 3;
pRasterIO->Load ( LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1 ) ;
LEADRasterView1->AutoRepaint = False;

//Get an alpha channel bitmap, and fill it with white
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->BitmapAlpha;
pRasterProc->Fill ( LEADRasterView2->Raster, RGB(255, 255, 255)) ;
rgntop = 0;
rgnleft = 0;
rgnwidth = LEADRasterView1->Raster->BitmapWidth;
rgnheight = LEADRasterView1->Raster->BitmapHeight;
//Create an elliptical region in the AlphaBitmap
LEADRasterView2->Raster->SetRgnEllipse ( rgntop, rgnleft, rgnwidth, rgnheight, L_RGN_SET ) ;
//Fill the region with black
pRasterProc->Fill ( LEADRasterView2->Raster, RGB(0, 0, 0)) ;
//Free the region
LEADRasterView2->Raster->FreeRgn ( ) ;
//Update the alpha channel in the main bitmap
LEADRasterView1->Raster->BitmapAlpha = LEADRasterView2->Raster->Bitmap;
//Save the bitmap as 32-bit TGA
pRasterIO->Save ( LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\test.tga"), FILE_TGA, 32, (QFactorConstants)0, SAVE_OVERWRITE ) ;
//Free the bitmaps
LEADRasterView1->Raster->Bitmap = 0;
LEADRasterView2->Raster->Bitmap = 0;
//Load the bitmap we just saved and get the alpha channel
pRasterIO->Load ( LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\test.tga"), 0, 0, 1 ) ;
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->BitmapAlpha;
//Create a region in the AlphaBitmap that includes all of the black pixels
LEADRasterView2->Raster->SetRgnColor ( RGB(0, 0, 0), L_RGN_SET ) ;
//Get the region from the AlphaBitmap and set it into the main bitmap
hRGN = LEADRasterView2->Raster->GetRgnHandle ( ) ;
LEADRasterView1->Raster->SetRgnHandle ( hRGN, 0, 0, L_RGN_SET ) ;
LEADRasterView2->Raster->DeleteRgnHandle ( hRGN ) ;
LEADRasterView1->PaintRgnOnly = True;
LEADRasterView1->ForceRepaint ( );
pRasterProc-> Release( );
pRasterIO-> Release ( );


BitmapDataPath Example for C++ Builder

This example shows how to load an image from the Internet. It uses the BitmapDataPath method to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.

LEADRasterIO *pRasterIO;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADEventSink1->Connect (pRasterIO, DIID__LEADRasterIOEvents);
pRasterIO->BitmapDataPath (LEADRasterView1->Raster, AnsiToOLESTR("http://www.leadtools.com/images/tiger2.cmp"));
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterIO)
pRasterIO-> Release( );
}

void __fastcall TForm1::LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERIOEVENTS_READYSTATECHANGE:
{
int ReadyState = (OleVariant) (Params.rgvarg[0]);
//Paint the image when loading is complete.
if (ReadyState == RASTER_READYSTATE_COMPLETE)
{
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
LEADRasterView1->ForceRepaint();
}
}
break;
}
}


BitmapToClient example for C++ Builder

AnsiString szOut;

//Test a bitmap location for its screen location
LEADRasterView1->ScaleMode = 3; //pixels b/c I'm passing pixels
LEADRasterView1->BitmapToClient (50, 50);
szOut= "";
szOut= szOut + "ClientX = " + IntToStr((int)LEADRasterView1->ConvertX) + "\n";
szOut= szOut + "ClientY = " + IntToStr((int)LEADRasterView1->ConvertY) + "\n";
ShowMessage (szOut);


BitmapXRes and BitmapYRes example for C++ Builder

This example sets the bitmap's resolution to 300 x 600 DPI.

LEADRasterView1->Raster->BitmapXRes = 300;
LEADRasterView1->Raster->BitmapYRes = 600;


BitonalScaling example for C++ Builder

This example sets the display to use scale-to-gray and repaints the image. This affects only 1-bit images.

if (LEADRasterView1->Raster->IsSupportLocked (L_SUPPORT_DOCUMENT))
ShowMessage ("No scale to gray - You need to unlock Document/Medical capabilities");
else
{
LEADRasterView1->BitonalScaling = BITONALSCALING_SCALETOGRAY;
LEADRasterView1->ForceRepaint ();
}


BorderRemove example for C++ Builder

HRGN hRgnAll;
LEADRasterProcess * pRasterProc= NULL;

/*Create the RasterProcess object and UnlockSupport*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//...
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
//...
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;

/*Border Remove
This example returns a region corresponding to the borders of a bitmap
For the example, windows regions are returned in the BorderRemove Event and combined.
In practice it would be easier and faster to just return a LEAD region representing the changes
The border is removed from the image*/

//Enable the doc clean event
pRasterProc->EnableDocCleanEvents = True;
//Create a Nil region
hRgnAll= CreateRectRgn(0, 0, 0, 0);
nRet= pRasterProc->BorderRemove (LEADRasterView1->Raster,
(BorderRemoveFlags)(BORDER_CALLBACK_REGION + BORDER_USE_VARIANCE),
BORDER_ALL, 20, 9, 3);
if (nRet == 0)
{
LEADRasterView1->Raster->FreeRgn ();
LEADRasterView1->Raster->SetRgnHandle ((long)hRgnAll, 0, 0, L_RGN_SET);
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
}
//delete the Windows Rgn
DeleteObject (hRgnAll);
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_BORDERREMOVE:
{
int hRgn;
int uBorderToRemove;
float fBoundingRectLeft;
float fBoundingRectTop;
float fBoundingRectWidth;
float fBoundingRectHeight;
char * szBorder;
char crOut[256];

hRgn= OleVariant(Params.rgvarg[5]);
uBorderToRemove= OleVariant(Params.rgvarg[4]);
fBoundingRectLeft= OleVariant(Params.rgvarg[3]);
fBoundingRectTop= OleVariant(Params.rgvarg[2]);
fBoundingRectWidth= OleVariant(Params.rgvarg[1]);
fBoundingRectHeight= OleVariant(Params.rgvarg[0]);
CombineRgn ((void*)hRgnAll, (void*)hRgnAll, (void*)hRgn, (int)RGN_OR);
switch (uBorderToRemove)
{
case BORDER_TOP:
szBorder= "Top";
break;

case BORDER_LEFT:
szBorder= "Left";
break;

case BORDER_RIGHT:
szBorder= "Right";
break;

case BORDER_BOTTOM:
szBorder= "Bottom";
break;
}
sprintf(crOut,"Border - %s Bounds:%f,%f,%f,%f",
szBorder,
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight);

OutputDebugString(crOut);
pRasterProc->DocCleanSuccess = SUCCESS_REMOVE;
}
break;
}
}


BorderStyle example for C++ Builder

This example toggles the border style and repaints the image.

if (LEADRasterView1->BorderStyle == 1)
LEADRasterView1->BorderStyle= 0;
else
LEADRasterView1->BorderStyle= 1;
LEADRasterView1->ForceRepaint ();


ButtonColumns example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void IncrementButtonColumns(LEADRasterAnnToolBar * pAnnToolBar)
{
if (pAnnToolBar->ToolBarhWnd != 0)
pAnnToolBar->ButtonColumns ++;
}


ButtonMenuTool example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*Makes the first rubber stamp tool draw a rectangle*/
void SetToolToRect(LEADRasterAnnToolBar * pAnnToolBar)
{
short i;
for (i = 0; i < pAnnToolBar->ButtonCount; i ++)
{
//is this the button with the rubber stamps ?
if (pAnnToolBar->get_ButtonToolCount (i) > 1)
pAnnToolBar->set_ButtonMenuTool (i, 0, ANN_TOOL_RECT);
}
}


ButtonRows example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void IncrementButtonRows(LEADRasterAnnToolBar * pAnnToolBar)
{
if (pAnnToolBar->ToolBarhWnd == 0)
return;
pAnnToolBar->ButtonRows ++;
}


ButtonVisible example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

void ToggleVisibleState(LEADRasterAnnToolBar* pAnnToolBar, short iButtonIndex)
{
if (pAnnToolBar->get_ButtonVisible(iButtonIndex))
{
pAnnToolBar->set_ButtonVisible (iButtonIndex, false);
ShowMessage ("Button Index " + IntToStr(iButtonIndex) + " visible state is False");
}
else
{
pAnnToolBar->set_ButtonVisible(iButtonIndex, true);
ShowMessage ("Button Index " + IntToStr(iButtonIndex) + " visible state is True");
}

}


Capture example for C++ Builder

This example captures the current form and displays the captured image with scroll bars.

int OldMode;

//Turn on the automatic display rectangles.
LEADRasterView1->AutoSetRects = True;
//Set the scale mode to twips temporarily
OldMode = LEADRasterView1->ScaleMode;
LEADRasterView1->ScaleMode = 1;
LEADRasterView1->Raster->Capture (0, Left, Top, Width, Height);
LEADRasterView1->AutoScroll = True;
LEADRasterView1->ForceRepaint ();
//Set the scale mode to the previous mode
LEADRasterView1->ScaleMode = OldMode;


Change example for C++ Builder

Typically, you would use this event to flag changed image data and prompt the user to save the changes before closing a window or exiting an application. That use of the event cannot be tested properly without writing a complete application; so this example just shows you a simple test of the event.

This example is for an ILEADRaster Object created at run-time.

LEADRaster* pMyRaster;

void __fastcall TForm1::Button2Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pMyRaster);
LEADEventSink1->Connect (pMyRaster, DIID__LEADRasterEvents);
//create a new bitmap
pMyRaster->ScaleMode = (RasterScaleModeConstants)3;
pMyRaster->CreateBitmap (100, 100, 24); //this will fire the Change event
pMyRaster->Release();
}
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTEREVENTS_CHANGE:
{
int nChange = (OleVariant)(Params.rgvarg[2]);
ShowMessage ("Image data changed: " + IntToStr(nChange));
}
break;
}
}


Click and MouseIcon example for C++ Builder

Click example for C++ Builder

This example demonstrates the Click event.

/*This example, on a click event, toggles between the default
mouse pointer.*/
void __fastcall TForm1::LEADRasterView1Click (TObject *Sender)
{
if (!LEADRasterView1->MousePointer)
LEADRasterView1->MousePointer= 12;
else
LEADRasterView1->MousePointer= 0;
}


ClientToBitmap example for C++ Builder

float BitmapX;
float BitmapY;

BitmapX= x;
BitmapY= y;
LEADRasterView1->ClientToBitmap (BitmapX, BitmapY);
//Change that pixel to White
LEADRasterView1->Raster->set_Pixel (LEADRasterView1->ConvertX, LEADRasterView1->ConvertY, (TColor)RGB(255, 255, 255));


ColorRes example for C++ Builder

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
if (LEADRasterView1->Raster->BitmapBits != 8)
{
Cursor= crHourGlass;
pRasterProc->ColorRes (LEADRasterView1->Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
LEADRasterView1->ForceRepaint ();
Cursor= crDefault;
}
pRasterProc-> Release( );


ColorResList Example for C++ Builder

This example changes the hue of bitmaps in a list, and then plays the list as an animation. When changing the hue, it preserves the transparent color.

short i; // Loop counter
int nCount; // Number of bitmaps in the list
long int TransparentColor; // Color used for transparency
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

// Save the current transparent color
TransparentColor = LEADRasterView1->Raster->BitmapTransparentColor;
// Avoid repaints while we modify the bitmaps
LEADRasterView1->AutoRepaint = False;
// Change the hue of each bitmap in the list,
// and restore the transparent color as the last color in the palette
nCount = LEADRasterView1->Raster->BitmapListCount;
for (i = 0; i< nCount; i ++)
{
LEADRasterView1->Raster->BitmapListIndex = i;
pRasterProc->Hue (LEADRasterView1->Raster, (short)(i * 10));
LEADRasterView1->Raster->set_BitmapPalette (255, TransparentColor);
}
// Get an optimized palette for the whole list
pRasterProc->ColorResList (LEADRasterView1->Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_NODITHERING, 0);
// Update the palette that is used for playback
for (i = 0; i < 256; i++)
LEADRasterView1->AnimationPalette [i] = LEADRasterView1->Raster->get_BitmapPalette(i);
// Start the animation
LEADRasterView1->AutoRepaint = True;
LEADRasterView1->AnimationEnable = True;
pRasterProc-> Release( );


Combine example for C++ Builder

This example copies the LEADRasterView1 bitmap to LEADRasterView2, trims and filters the copied image, and combines the filtered image with the original LEADRasterView1 bitmap image. Trimming LEADRasterView2 lets you see the difference between filtered and nonfiltered regions.

float SrcLeft;
float SrcTop;
float DstLeft;
float DstTop;
float DstWidth;
float DstHeight;
float fTrimLeft;
float fTrimTop;
float fTrimWidth;
float fTrimHeight;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

Cursor= crHourGlass;
LEADRasterView2->Raster->RefBitmap = False;
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->Bitmap;
fTrimLeft= (LEADRasterView2->Raster->BitmapWidth * 0.2);
fTrimTop = (LEADRasterView2->Raster->BitmapHeight * 0.2);
fTrimWidth = (LEADRasterView2->Raster->BitmapWidth * 0.6);
fTrimHeight = (LEADRasterView2->Raster->BitmapHeight * 0.6);
pRasterProc->Trim (LEADRasterView2->Raster, fTrimLeft, fTrimTop, fTrimWidth, fTrimHeight);
pRasterProc->SpatialFilter (LEADRasterView2->Raster, FLT_LINESEG_LTOR);
DstLeft = fTrimLeft;
DstTop = fTrimTop;
DstWidth = fTrimWidth;
DstHeight = fTrimHeight;
SrcLeft= 0;
SrcTop = 0;
pRasterProc->Combine (LEADRasterView1->Raster,DstLeft, DstTop,
DstWidth, DstHeight,
LEADRasterView2->Raster,
SrcLeft, SrcTop, CB_OP_ADD);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );
Cursor= crDefault;


Comment example for C++ Builder

This example does the following:

1. | Loads an image from a TIFF file.
2. | Updates the current comment array by reading comments from the file.
3. | Modifies one of the comments.
4. | Modifies and saves the file.
5. | Reads the comment that was saved, and displays it in a message box.

This example handles only string comments. For more complex comments, refer to Exif Examples.

AnsiString MyCommentText; //String for CMNT_SZDESC
AnsiString FilePath; //File to be updated
long i; //Loop counter and array index
LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;
ILEADRasterVariant* pRasterVarEmpty;
ILEADRasterVariant* pRasterVar;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVarEmpty);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVar);
//Specify the file that we will update.
FilePath = "c:\\temp\\Test.tif";
//Get all of the current comments from the file.
//Temporarily disable method errors so that we do not fail when comments are missing.
pRasterIO->EnableMethodErrors = False;
for (i = 0; i<= CMNT_LAST; i++)
{
pRasterIO->set_Comment ((short)i, pRasterVarEmpty);
pRasterIO->set_Comment((short)i, pRasterIO->ReadComment(LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()), 1, (short)i));
}
//Load and modify the image.
pRasterIO->EnableMethodErrors = False;
pRasterIO->Load(LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()), 0, 0, 1);
pRasterProc->Reverse(LEADRasterView1->Raster);
//Update the CMNT_SZDESC comment.
MyCommentText = "\nThis image has been reversed.";
pRasterVar->set_Type( VALUE_STRING );
pRasterVar= pRasterIO->get_Comment(CMNT_SZDESC);
pRasterVar->StringValue= pRasterVar->StringValue & MyCommentText;
pRasterIO->set_Comment ( CMNT_SZDESC, pRasterVar );
//Save the file and read the comment that we saved.
pRasterIO->Save(LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()), FILE_TIF, LEADRasterView1->Raster->BitmapBits, (QFactorConstants)0, SAVE_OVERWRITE);
pRasterVar= pRasterIO->ReadComment (LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()), 1, CMNT_SZDESC);
//Display the message
ShowMessage (pRasterVar->StringValue );
//Clear the comments from memory
for (i = 0; i<= CMNT_LAST; i++)
pRasterIO->set_Comment((short)i, pRasterVarEmpty);

if ( pRasterProc )
pRasterProc-> Release( );
if ( pRasterProc )
pRasterIO-> Release( );
if ( pRasterVarEmpty )
pRasterVarEmpty->Release ( );
if ( pRasterVar )
pRasterVar->Release ( );


ContourFilter example for C++ Builder

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->ContourFilter (LEADRasterView1->Raster,
20, 35, 5, CONTOUR_APPROX_COLOR);
pRasterProc-> Release( );


Contrast example for C++ Builder

This example increases the contrast and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Contrast (LEADRasterView1->Raster, 50);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release ( );


Create Bitmap, Size, and Combine example for C++ Builder

This example creates a bitmap for Raster2 (same size and BPS as LEADRasterView1.Raster) and fills it with green. It resizes the LEADRasterView1.Raster bitmap, and then uses a loop to do multiple combines with the Raster2 bitmap. It then copies the Raster2 bitmap to LEADRasterView1 and redisplays LEADRasterView1.

float DstT;
float DstL;
float SrcL;
float SrcT;
float DstW;
float DstH;
float MyWidth;
float MyHeight;
int MyBPS;
int ImageWidth;
int ImageHeight;
int TestWidth;
int TestHeight;
int VFactor;
int VSpacing;
int HFactor;
int HSpacing;
LEADRaster* pRaster2;
CombineConstants MyOP;
LEADRasterProcess* pRasterProc= NULL;

Cursor= crHourGlass;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

// Create the Raster2 bitmap->
MyWidth = LEADRasterView1->Raster->BitmapWidth;
MyHeight = LEADRasterView1->Raster->BitmapHeight;
MyBPS = LEADRasterView1->Raster->BitmapBits;
pRaster2->CreateBitmap (MyWidth, MyHeight, (short)MyBPS);
pRasterProc->Fill (pRaster2, RGB(0, 255, 0)); // fill with green
// Resize the LEADRasterView1 bitmap
ImageWidth = MyWidth * 0.3;
ImageHeight = MyHeight * 0.3;
pRasterProc->Size (LEADRasterView1->Raster, ImageWidth, ImageHeight, RESIZE_RESAMPLE);
// Initialize the variables used for multiple combines->
TestWidth = MyWidth; // Used for horizontal positioning
TestHeight = MyHeight; // Used for vertical positioning
VFactor = (MyHeight / ImageHeight) + 1; // Number spaces between images
VSpacing = ((int)MyHeight % ImageHeight) / VFactor; // Pixels between images
HFactor = (MyWidth / ImageWidth) + 1; // Number spaces between images
HSpacing = ((int)MyWidth % ImageWidth) / HFactor; // Pixels between images
SrcL = 0; // Left coordinate of the source rectangle
SrcT = 0; // Top coordinate of the source rectangle
DstW = ImageWidth; // Width of the destination rectangle
DstH = ImageHeight; // Height of the destination rectangle
MyOP = (CombineConstants)(CB_OP_ADD + CB_DST_0); // Operation flags used when combining images
// Do the loop that does the multiple combines
while (TestHeight > ImageHeight) // Vertical loop
{
DstT = MyHeight - TestHeight + VSpacing;
TestHeight = TestHeight - ImageHeight - VSpacing;
while (TestWidth > ImageWidth) //Horizontal loop
{
DstL = MyWidth - TestWidth + HSpacing;
TestWidth = TestWidth - ImageWidth - HSpacing;
pRasterProc->Combine (pRaster2, DstL, DstT, DstW, DstH, LEADRasterView1->Raster, SrcL, SrcT, MyOP);
}
TestWidth = MyWidth;
}
// Copy the Raster2 bitmap to LEADRasterView1
LEADRasterView1->Raster->Bitmap = pRaster2->Bitmap ;
//Set the image display size to match the LEADRasterView control
LEADRasterView1->SetDstRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->ForceRepaint (); // Repaint the image
pRasterProc-> Release( );
pRaster2-> Release( );

Cursor= crDefault;


Create example for C++ Builder

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (pRasterAnn)
pRasterAnn->Release ();
if (pRasterAnnToolbar)
pRasterAnnToolbar-> Release();
}

/*This example creates an annotation toolbar and adds a button to the toolbar.
The button displays different images when selected/deselected
The button has two tools associated with (line and button tool)*/
void __fastcall TForm1::CreateToolBarClick(TObject *Sender)
{
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterAnnToolbar->AnnParentRasterView = LEADRasterView1->Raster;
pRasterAnnToolbar->Visible = True;

pRasterAnnToolbar->Create (0, 0, ANN_TOOLALIGN_TOP);
if (pRasterAnnToolbar->ToolBarhWnd)
{
AnsiString Msg;
BSTR strToolText;

pRasterAnnToolbar->set_ButtonTool (pRasterAnnToolbar->ButtonCount, ANN_TOOL_USER_FIRST);
pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("e:\\lead14\\dist\\images\\Ulay1.bmp"), 0, 0, 1);
pRasterAnnToolbar->set_ButtonBitmapUp (pRasterAnnToolbar->ButtonCount, LEADRasterView2->Raster->Bitmap);
pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("e:\\lead14\\dist\\images\\Ulay2.bmp"), 0, 0, 1);
pRasterAnnToolbar->set_ButtonBitmapDown (pRasterAnnToolbar->ButtonCount, LEADRasterView2->Raster->Bitmap);
pRasterAnnToolbar->set_ButtonToolTipTextID (pRasterAnnToolbar->ButtonCount, -1);
pRasterAnnToolbar->set_ButtonToolTipText (pRasterAnnToolbar->ButtonCount, AnsiToOLESTR("User defined tool"));
pRasterAnnToolbar->get_ButtonToolTipText((short)pRasterAnnToolbar->ButtonCount, &strToolText);
Msg = "AnnToolTipText: ";
Msg += strToolText;
ShowMessage (Msg);

pRasterAnnToolbar->set_ButtonToolCount (pRasterAnnToolbar->ButtonCount, 2);

pRasterAnnToolbar->set_ButtonMenuTool (pRasterAnnToolbar->ButtonCount, 0, ANN_TOOL_LINE);
pRasterAnnToolbar->set_ButtonMenuTextID (pRasterAnnToolbar->ButtonCount, 0, -1);
pRasterAnnToolbar->set_ButtonMenuText (pRasterAnnToolbar->ButtonCount, 0, AnsiToOLESTR("User defined tool"));

pRasterAnnToolbar->set_ButtonMenuTool(pRasterAnnToolbar->ButtonCount, 1, ANN_TOOL_BUTTON);
pRasterAnnToolbar->set_ButtonMenuTextID(pRasterAnnToolbar->ButtonCount, 1, -1);
pRasterAnnToolbar->set_ButtonMenuText(pRasterAnnToolbar->ButtonCount, 1, AnsiToOLESTR("Button"));

pRasterAnnToolbar->ButtonCount++;
pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;

pRasterAnn->AutoSetTool = True;

}
pRasterIO-> Release( );
}


dbCan... example for C++ Builder

This example displays property values in a message box. You can implement this example by adding a button, with this code, to the project described in ODBC Example for C++ Builder.

// LEADRasterODBC * pRastODBC=NULL;
// CoCreateInstance(CLSID_LEADRasterODBC, NULL, CLSCTX_ALL, IID_ILEADRasterODBC, (void**)& pRastODBC);
AnsiString TempStr, InfoStr;

InfoStr= "dbCanAppend = "+ IntToStr((int)pRastODBC->dbCanAppend) + "\n";
TempStr= "dbCanRestart= "+ IntToStr((int)pRastODBC->dbCanRestart) + "\n";
InfoStr += TempStr;
TempStr = "dbCanScroll= "+ IntToStr((int)pRastODBC->dbCanScroll)+ "\n";
InfoStr += TempStr;
TempStr = "dbCanUpdate= "+ IntToStr((int)pRastODBC->dbCanUpdate) + "\n" ;
InfoStr += TempStr;
TempStr= "dbEditMode = "+ IntToStr(pRastODBC->dbEditMode) + "\n";
InfoStr += TempStr;
TempStr= "dbIsBOF = "+ IntToStr((int)pRastODBC->dbIsBOF)+ "\n";
InfoStr += TempStr;
TempStr= "dbIsEOF = "+ IntToStr((int)pRastODBC->dbIsEOF)+ "\n";
InfoStr += TempStr;
TempStr= "dbIsDeleted = "+ IntToStr((int)pRastODBC->dbIsDeleted)+ "\n";
InfoStr += TempStr;
TempStr= "dbIsOpen = "+ IntToStr((int)pRastODBC->dbIsOpen) +"\n";
InfoStr += TempStr;
TempStr= "dbLoadBits = "+ IntToStr(pRastODBC->dbLoadBits) + "\n";
InfoStr += TempStr;
TempStr= "dbLockingMode = "+ IntToStr(pRastODBC->dbLockingMode) + "\n";
InfoStr += TempStr;
TempStr= "dbRecordCount = "+ IntToStr((int)pRastODBC->dbRecordCount) + "\n";
InfoStr += TempStr;
TempStr= "dbCurrentRecord = (0 based)"+ IntToStr((int)pRastODBC->dbCurrentRecord)+"\n";
InfoStr += TempStr;
ShowMessage(InfoStr);
// pRastODBC->Release();


DblClick example for C++ Builder

This example demonstrates the DblClick event.

void __fastcall TForm1::LEADRasterView1DblClick (TObject *Sender)
{
LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->Flip (LEADRasterView1->Raster); //Just test the event
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );
}


DDB example for C++ Builder

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DDB. It pastes the DDB into LEADRasterView2.Raster and reverses the image. It then gets a DDB from LEADRasterView2, sets the same DDB to LEADRasterView, and repaints.

HDC MyDC;
long int MyDDB;
long int MyPalette;
RasterCopyConstants MyFlags;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

Cursor= crHourGlass;
MyFlags= (RasterCopyConstants)(COPY_EMPTY + COPY_DDB + COPY_PALETTE);
LEADRasterView1->Raster->Copy (MyFlags);
if (LEADRasterView2->Raster->Paste (PASTE_ISREADY) == 0)
ShowMessage ("Invalid data on the clipboard");
else
LEADRasterView2->Raster->Paste ((RasterPasteConstants)0);

pRasterProc->Reverse (LEADRasterView2->Raster);
MyDC= (HDC)LEADRasterView2->GetClientDC ();
MyDDB= LEADRasterView2->Raster->GetDDB ((long)MyDC);
MyPalette= LEADRasterView2->GetPalette ((long)MyDC);
LEADRasterView1->Raster->SetDDB ((long)MyDC, (long)MyDDB, (long)MyPalette);
LEADRasterView1->ForceRepaint ();
LEADRasterView2->ReleaseClientDC ();
pRasterProc-> Release( );
Cursor= crDefault;


DeleteBitmapListItems example for C++ Builder

This example deletes the first five bitmaps from the control's bitmap list. Then, it plays the animation to show that the bitmaps are missing.

//Delete the first five bitmaps.
LEADRasterView1->Raster->DeleteBitmapListItems (1, 5);
//Play the animation without looping.
LEADRasterView1->AnimationLoop = False;
LEADRasterView1->AnimationEnable = True;


DeletePage example for C++ Builder

LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//delete page 1 from TEST.TIF
pRasterIO->DeletePage (AnsiToOLESTR("c:\\temp\\test.tif"), 1);
pRasterIO-> Release( );


Deskew example for C++ Builder

This example automatically straightens the bitmap and repaints the image. The image to be straightened should be mainly text.

long lAngle;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->Deskew(LEADRasterView1->Raster, RGB(255, 0, 0), 0);
lAngle= pRasterProc->DeskewAngle;

pRasterProc-> Release ( );
ShowMessage ("Rotation: " + IntToStr((int)lAngle) + "' hundredths of degrees");


Despeckle example for C++ Builder

This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.

LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->Despeckle (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc->Release ( );


DIB example for C++ Builder

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

long MyDib;
RasterCopyConstants MyFlags;
LEADRasterProcess * pRasterProc;

Cursor= crHourGlass;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
MyFlags= (RasterCopyConstants)(COPY_EMPTY + COPY_DIB + COPY_PALETTE);
LEADRasterView1->Raster->Copy (MyFlags);
if (LEADRasterView2->Raster->Paste (PASTE_ISREADY) == 0)
ShowMessage ("Invalid data on the clipboard");
else
LEADRasterView2->Raster->Paste ((RasterPasteConstants)0);

pRasterProc->Reverse (LEADRasterView2->Raster);
MyDib= LEADRasterView2->Raster->GetDIB ();
LEADRasterView1->Raster->SetDIB (MyDib);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );
Cursor= crDefault;


DocCleanSuccess example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

/*Create the RasterProcess object and UnlockSupport*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//.....
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
//.....
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}
/*This example updates a region with all 1x1 to 3x3 specks that are solid black
If a speck has any white pixels, it is NOT part of the updated region
The call is configured to update a single LEAD region with all changes
The image itself is unchanged
The DotRemove Event is used to display information about each speck that is removed*/

void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;

pRasterProc->EnableDocCleanEvents = true;
nRet = pRasterProc->DotRemove (LEADRasterView1->Raster, (DotRemoveFlags)(DOT_USE_SIZE + DOT_SINGLE_REGION + DOT_LEAD_REGION + DOT_IMAGE_UNCHANGED), 1, 1, 3, 3);
if (nRet == 0)
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_DOTREMOVE:
{
float fBoundingRectLeft;
float fBoundingRectTop;
float fBoundingRectWidth;
float fBoundingRectHeight;
int iWhiteCount;
int iBlackCount;
char szTemp[256];

fBoundingRectLeft= OleVariant(Params.rgvarg[5]);
fBoundingRectTop= OleVariant(Params.rgvarg[4]);
fBoundingRectWidth= OleVariant(Params.rgvarg[3]);
fBoundingRectHeight= OleVariant(Params.rgvarg[2]);
iWhiteCount= OleVariant(Params.rgvarg[1]);
iBlackCount= OleVariant(Params.rgvarg[0]);
sprintf(szTemp,"Dot Found at %f,%f,%f,%f WhiteCount= %d BlackCount= %d",
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iWhiteCount,
iBlackCount);

OutputDebugString(szTemp);
// Do not remove the speck if it contains any white pixels
pRasterProc->DocCleanSuccess = (iWhiteCount > 0) ? SUCCESS_NOREMOVE : SUCCESS_REMOVE;
}
break;
}
}


DrawShape example for C++ Builder

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

LEADRasterIO* pRasterIO= NULL;
LEADRasterFXD* pRasterFxd;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

LEADRasterView1->AutoRepaint = False;
//Load an image for the main control
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1);
//Load an image for the background of the shape
pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("c:\\temp\\ulay1.bmp"), 0, 0, 1);
//Shape background
pRasterFxd->ShapeBackgroundStyle = FXD_BACKSTYLE_TILED_IMAGE;
pRasterFxd->BackgroundImageTop = 0;
pRasterFxd->BackgroundImageLeft = 0;
pRasterFxd->BackgroundImageWidth = LEADRasterView2->Raster->BitmapWidth;
pRasterFxd->BackgroundImageHeight = LEADRasterView2->Raster->BitmapHeight;
//Shape location
pRasterFxd->ShapeTop = 50;
pRasterFxd->ShapeLeft = 50;
pRasterFxd->ShapeWidth = LEADRasterView1->DstWidth - 50;
pRasterFxd->ShapeHeight = LEADRasterView1->DstHeight - 50;
//Shape border
pRasterFxd->ShapeBorderColor = RGB(255, 0, 0);
pRasterFxd->ShapeBorderStyle = FXD_BORDERSTYLE_SOLID;
pRasterFxd->ShapeBorderThickness = 10;
pRasterFxd->ShapeInnerBandHiliteColor = RGB(255, 255, 255);
pRasterFxd->ShapeInnerBandShadowColor = 0;
pRasterFxd->ShapeInnerBandStyle = FXD_INNERSTYLE_RAISED;
pRasterFxd->ShapeInnerBandThickness = 2;
pRasterFxd->ShapeOuterBandHiliteColor = RGB(0, 255, 0);
pRasterFxd->ShapeOuterBandShadowColor = RGB(128, 128, 128);
pRasterFxd->ShapeOuterBandStyle = FXD_OUTERSTYLE_RAISED;
pRasterFxd->ShapeOuterBandThickness = 2;
//Make the shape a permanent part of the bitmap
pRasterFxd->DrawPersistence = True;
pRasterFxd->DstLeft = 0;
pRasterFxd->DstTop = 0;
pRasterFxd->DstRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->DstBottom =LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->SrcLeft = 0;
pRasterFxd->SrcTop = 0;
pRasterFxd->SrcRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->SrcBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->ScaleMode = 3;
pRasterFxd->ClientSizeX = 5;
pRasterFxd->ClientSizeY = 5;
//Draw the shape
pRasterFxd->DrawShape (LEADRasterView1->Raster, 0, FXD_SHAPE_RECTANGLE, LEADRasterView2->Raster->Bitmap);
//Repaint
LEADRasterView1->AutoRepaint = True;

pRasterFxd-> Release();
pRasterProc-> Release( );
pRasterIO-> Release( );


DrawText example for C++ Builder

This example demonstrates most of the properties of a three-dimensional text object as it draws rotated text on the current bitmap.

LEADRasterIO* pRasterIO= NULL;
LEADRasterFXD* pRasterFxd;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

LEADRasterView1->AutoRepaint = False;
LEADRasterView1->ScaleMode = 3;
//Load an image for the main control
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_NORMAL;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\tmp.jpg"), 0, 0, 1);
//Load an image for the foreground of the text
pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("c:\\temp\\ulay1.bmp"), 0, 0, 1);
//Text location
pRasterFxd->TextTop = 50;
pRasterFxd->TextLeft = 50;
pRasterFxd->TextWidth = LEADRasterView1->DstWidth - 50;
pRasterFxd->TextHeight = LEADRasterView1->DstHeight - 50;
//The foreground image needs to be the correct size
pRasterProc->Size (LEADRasterView2->Raster, pRasterFxd->TextWidth, pRasterFxd->TextHeight, (ResizeConstants)0);
//Text alignment and angle
pRasterFxd->TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER;
pRasterFxd->TextAngle = 450; //45 degrees
//Text highlight color and style
pRasterFxd->TextHiliteColor = RGB(255, 255, 255);
pRasterFxd->TextStyle = FXD_TEXTSTYLE_DROPSHADOW;
//Text drop shadow
pRasterFxd->ShadowColor = RGB(0, 0, 0);
pRasterFxd->ShadowXDepth = 5;
pRasterFxd->ShadowYDepth = 5;
//Make the text a permanent part of the bitmap
pRasterFxd->DrawPersistence = True;
pRasterFxd->DstLeft = 0;
pRasterFxd->DstTop = 0;
pRasterFxd->DstRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->DstBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->SrcLeft = 0;
pRasterFxd->SrcTop = 0;
pRasterFxd->SrcRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->SrcBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->ScaleMode = 3;
//Draw the text
pRasterFxd->DrawText (LEADRasterView1->Raster, 0, AnsiToOLESTR("LEADTOOLS"), LEADRasterView1->Raster->Bitmap);
LEADRasterView1->ForceRepaint ();

pRasterFxd-> Release( );
pRasterProc-> Release( );
pRasterIO-> Release ( );


Dst... example for C++ Builder

// Declare local variables
float ClHeight, ClWidth;

// Set variables for the client area of the control.
ClHeight = LEADRasterView1->ScaleHeight;
ClWidth = LEADRasterView1->ScaleWidth;
//Calculate the values to zoom in by 10 percent and center the image.
LEADRasterView1->PaintSizeUseDPI = False;
LEADRasterView1->DstWidth = LEADRasterView1->DstWidth * 1.1;
LEADRasterView1->DstHeight = LEADRasterView1->DstHeight * 1.1;
LEADRasterView1->DstTop = (ClHeight - LEADRasterView1->DstHeight) / 2;
LEADRasterView1->DstLeft = (ClWidth - LEADRasterView1->DstWidth) / 2;
//Set the clipping area to the same as the destination rectangle
LEADRasterView1->DstClipWidth = LEADRasterView1->DstWidth;
LEADRasterView1->DstClipHeight = LEADRasterView1->DstHeight;
LEADRasterView1->DstClipTop = LEADRasterView1->DstTop;
LEADRasterView1->DstClipLeft = LEADRasterView1->DstLeft;
//Redisplay the image
LEADRasterView1->ForceRepaint ();


Emboss example for C++ Builder

This example applies an emboss effect and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Emboss ( LEADRasterView1->Raster, EMBOSS_NE, 500 ) ;
LEADRasterView1->ForceRepaint ( );
pRasterProc-> Release ( );


EnableMethodErrors example for C++ Builder

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle using ILEADRasterProcess in this case).

//Declare local variables.
short ShearAngle, nRet;
AnsiString cMsg;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
ShearAngle= 9000 ;// This would be the user's input * 100
pRasterProc->EnableMethodErrors = False;
nRet= pRasterProc->Shear (LEADRasterView1->Raster, ShearAngle, True, RGB(0, 0, 255));
if (nRet == 20013)
{
cMsg= "The angle cannot be more than 45 degrees";
MessageBox (Handle, cMsg.c_str(), "Error", MB_OK);
}
else
{
if (nRet == 0)
LEADRasterView1->ForceRepaint ();
else
ShowMessage ( "Error: " + IntToStr (nRet)) ;
}
pRasterProc-> Release( );


EnablePaint example for C++ Builder

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//disable the paint
LEADRasterView1->EnablePaint = False;
//do whatever changes you want-> The control will not repaint
pRasterProc->Size ( LEADRasterView1->Raster, LEADRasterView1->Raster->BitmapWidth * 2,
LEADRasterView1->Raster->BitmapHeight * 2, RESIZE_BICUBIC ) ;
// re-enable the paint
LEADRasterView1->EnablePaint = True;
// call ForceRepaint because the control will not automatically repaint
LEADRasterView1->ForceRepaint ( ) ;
pRasterProc-> Release ( );


EnableZoomInRect example for C++ Builder

This example toggles the EnableZoomInRect property.

//Toggle the ZoomInRect setting
LEADRasterView1->EnableZoomInRect= !LEADRasterView1->EnableZoomInRect;


Exif example for C++ Builder

This example does the following:

1. | Read all of the comments in an existing Exif file, updating the Comment array.
2. | Loads and modifies the file's image.
3. | Updates some of the comments in the comment array.
4. | Saves the file.
5. | Reads and displays the updated comments.

Note:

Comments for GIF, TIFF, and DICOM files are simpler than the ones in this Exif example. With those file types, all of the comments are strings that you can get and set with simple assignments.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString MyCommentText; /* String for CMNT_USERCOMMENT */
int MyCommentSize; /* Size of the comment array */
AnsiString NewCommentText; /* String for CMNT_USERCOMMENT that we read
 */
AnsiString TmpString; /* For parsing the comment string into bytes */
AnsiString FilePath, DistanceString, ThisDate, MyMsg; /*Miscellaneous */
int ArraySize; /* Array measurements */
int i; /* Counter */
LEADRasterIO* pMyRasterIO= NULL;
LEADRasterProcess* pMyRasterProcess= NULL;
LEADRasterVariant* pRasterVarEmpty= NULL;
LEADRasterVariant* pRasterVar1= NULL;
LEADRasterVariant* pRasterVar2= NULL;
LEADRasterVariant* pRasterVar3= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO,
 (void**)&pMyRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&pMyRasterProcess);

CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVarEmpty);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVar1);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVar2);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVar3);

//Specify the file that we will update.
FilePath = "c:\\exif1.tif";
//Get all of the current comments from an Exif file.
//Temporarily disable method errors so that we do not fail when comments
 are missing->
pMyRasterIO->EnableMethodErrors
 = false;
for (i = 1; i <=CMNT_LAST; i++)
{
pMyRasterIO->set_Comment((short)i,
 pRasterVarEmpty);
pMyRasterIO->set_Comment((short)i, pMyRasterIO->ReadComment(LEADRasterView1->Raster,
 AnsiToOLESTR(FilePath.c_str()), 0, (short)i));
}
pMyRasterIO->EnableMethodErrors= True;
//Load and modify the image
pMyRasterIO->Load(LEADRasterView1->Raster,
 AnsiToOLESTR(FilePath.c_str()), 0, 0, 1);
pMyRasterProcess->Reverse(LEADRasterView1->Raster);

/* Update the date when the file is generated */
ThisDate= FormatDateTime("yyyy:mm:dd hh:nn:ss", Now());
pRasterVar1->set_Type(
 VALUE_STRING );
pRasterVar1->StringValue=
 (wchar_t*)ThisDate.c_str();

pMyRasterIO->set_Comment(CMNT_SZDATETIMEDIGITIZED, pRasterVar1);
pMyRasterIO->set_Comment(CMNT_SZSUBSECTIMEDIGITIZED, pRasterVarEmpty);
//Change the subject distance to 4 1/3 meters
pRasterVar2->set_Type ( VALUE_ARRAY_LONG );
pRasterVar2->ItemCount=
 2;
pRasterVar2->set_LongItemValue(0,
 13);
pRasterVar2->set_LongItemValue(1, 3);

pMyRasterIO->set_Comment (CMNT_SUBJECTDISTANCE, pRasterVar2);
//Specify the user comment string
MyCommentText = "This is my new comment.";
MyCommentSize = 8 + StrLen(MyCommentText.c_str());

//Define the array for the user comment.
pRasterVar3->set_Type ( VALUE_ARRAY_BYTE );
pRasterVar3->ItemCount= MyCommentSize;

//Fill in the ASCII prefix.
pRasterVar3->set_ShortItemValue(0,
 'A');
pRasterVar3->set_ShortItemValue(1, 'S');
pRasterVar3->set_ShortItemValue(2, 'C');
pRasterVar3->set_ShortItemValue(3, 'I');
pRasterVar3->set_ShortItemValue(4, 'I');
pRasterVar3->set_ShortItemValue(5, 0);
pRasterVar3->set_ShortItemValue(6, 0);
pRasterVar3->set_ShortItemValue(7, 0);

//Fill in the rest of the comment, starting at the end->
for (i = 8; i<= (MyCommentSize - 1); i++)
{
TmpString = MyCommentText.SubString(i-7, 1);
pRasterVar3->set_ShortItemValue(i, Byte (TmpString[1]));
}
pRasterVar3->set_ShortItemValue(MyCommentSize, Byte (0));

//Update the user comment.
pMyRasterIO->set_Comment (CMNT_USERCOMMENT, pRasterVarEmpty);
pMyRasterIO->set_Comment(CMNT_USERCOMMENT, pRasterVar3);
//Save the file and read the comments that we saved.
pMyRasterIO->Save(LEADRasterView1->Raster,
 AnsiToOLESTR(FilePath.c_str()), FILE_EXIF, 24, (QFactorConstants)0, SAVE_OVERWRITE);
pRasterVar1= pMyRasterIO->ReadComment (LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()),
 1, CMNT_SZDATETIMEDIGITIZED);
pRasterVar2= pMyRasterIO->ReadComment(LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()),
 (short)1, CMNT_SUBJECTDISTANCE);
pRasterVar3= pMyRasterIO->ReadComment(LEADRasterView1->Raster, AnsiToOLESTR(FilePath.c_str()),
 (short)1, CMNT_USERCOMMENT);

//Interpret the Subject-Distance RATIONAL.
DistanceString = FloatToStr((float)(pRasterVar2->get_LongItemValue(0)/pRasterVar2->get_LongItemValue(1)));

//Initialize the string for the message box->
MyMsg = "Subject Distance = " + DistanceString + "\nDate/Time
 = " + pRasterVar1->StringValue;
//Add the ASCII comment if it is there
if( pRasterVar3->get_ShortItemValue(0) == Byte ("A"))
{
ArraySize = pRasterVar3->ItemCount;
for (i = 8; i <= ArraySize; i ++)
{
NewCommentText = NewCommentText + (char)(Integer(pRasterVar3->get_ShortItemValue(i)));
}
MyMsg = MyMsg + "\n\n" + NewCommentText;
}

//Display the message->
Application->MessageBox(MyMsg.c_str(), "File Comments",
 MB_OK);
//Clear the comments from memory
for (i = 0; i <= CMNT_LAST; i ++)
pMyRasterIO->set_Comment ((short)i, pRasterVarEmpty);

if ( pMyRasterProcess )
pMyRasterProcess-> Release( );

if ( pMyRasterIO )
pMyRasterIO-> Release( );

if ( pRasterVarEmpty )
pRasterVarEmpty-> Release( );

if ( pRasterVar1 )
pRasterVar1-> Release( );

if ( pRasterVar2 )
pRasterVar2-> Release( );

if ( pRasterVar3 )
pRasterVar3-> Release( );

}


FastRotate example for C++ Builder

This example uses fast rotation to rotate an image 90 degres:

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->FastRotate ( LEADRasterView1->Raster, 90 ) ;
pRasterProc-> Release( );


FeedLoad example for C++ Builder

This example uses StartFeedLoad, FeedLoad, and StopFeedLoad and loads a file through a buffer to simulate receiving a transmitted image.

#define BUFFERSIZE 1000
void __fastcall TForm1::Button2Click(TObject *Sender)
{
LPSTR lp; /* pointer to the data */
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant* pRasterVar= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance( CLSID_LEADRasterVariant, NULL, CLSCTX_ALL, IID_ILEADRasterVariant,(void**)&pRasterVar);

pRasterVar->set_Type(VALUE_ARRAY_BYTE);
pRasterVar->ItemCount= BUFFERSIZE;
/* Now we have a variant and we can do the real work */
HFILE hf;
int bytesread;
OFSTRUCT of;
if( (hf = OpenFile("v:\\images\\eagle.cmp", &of, OF_READ)) == HFILE_ERROR)
{
ShowMessage ( "Error opening file !" );
return;
}
if(pRasterIO->StartFeedLoad(LEADRasterView1->Raster, 0, 0, 1)) /* default bits per pixel and first page */
{
_lclose( hf );
ShowMessage( "Error in StartFeedLoad !" );
return;
}
do
{
bytesread = (int)_hread( hf, lp, BUFFERSIZE );
if(pRasterIO->FeedLoad(pRasterVar, (long)bytesread))
{
_lclose( hf );
ShowMessage( "Error in FeedLoad !" );
return;
}
} while (bytesread > 0);
if(pRasterIO->StopFeedLoad())
{
_lclose( hf );
ShowMessage( "Error in StopFeedLoad !" );
return;
}
if ( pRasterIO )
pRasterIO->Release();
if ( pRasterVar )
pRasterVar->Release();
}


FilePage Event Example for C++ Builder

This example shows how the FilePage event can be used to size and position a RasterView Control when an image is loaded.

LEADRasterIO* pRasterIO= NULL;

//Use Load to load an image
void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADEventSink1->Connect (pRasterIO, DIID__LEADRasterIOEvents);
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\24bit.bmp"), 0, 1, 1);
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterIO)
pRasterIO->Release();
}
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERIOEVENTS_FILEPAGE:
{
float HeightFactor, WidthFactor; // Factors for aspect ratio
float HeightAllowed, WidthAllowed; // Maximum width and height

// Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor= pRasterIO->InfoHeight;
WidthFactor= pRasterIO->InfoWidth;
HeightAllowed= ClientHeight * 3 / 4;
WidthAllowed= ClientWidth * 3 / 4;
//Center the LEAD RasterView control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1->Left= ClientWidth / 8;
LEADRasterView1->Width= WidthAllowed;
LEADRasterView1->Height= (LEADRasterView1->Width * HeightFactor) / WidthFactor;
LEADRasterView1->Top= (ClientHeight - LEADRasterView1->Height) / 2;
}
else
{
LEADRasterView1->Top= ClientHeight / 8;
LEADRasterView1->Height= HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor) / HeightFactor;
LEADRasterView1->Left = (ClientWidth - LEADRasterView1->Width) / 2;
}
// Set the image display size to match the LEAD RasterView control.
LEADRasterView1->AutoScroll = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->AutoRepaint = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
}
break;
}
}


Fill example for C++ Builder

This example fills the bitmap with blue and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Fill (LEADRasterView1->Raster, RGB(0, 0, 255));
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Flip example for C++ Builder

This example flips the bitmap and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Flip (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


FloaterDstClip... example for C++ Builder

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

float AdjustX, AdjustY;
float NewLeft, NewTop;
float NewWidth, NewHeight;

//Set variables to use for adjustment increments.
AdjustX = LEADRasterView1->ScaleWidth / 20;
AdjustY = LEADRasterView1->ScaleHeight / 20;
//Determine new values, based on adjustments of current values->
NewLeft = LEADRasterView1->FloaterDstClipLeft + AdjustX;
NewTop = LEADRasterView1->FloaterDstClipTop + AdjustY;
NewWidth = LEADRasterView1->FloaterDstClipWidth - (2 * NewLeft);
NewHeight = LEADRasterView1->FloaterDstClipHeight - (2 * NewTop);
//Set the clipping rectangle to the new values->
LEADRasterView1->SetFloaterDstClipRect (NewLeft, NewTop, NewWidth, NewHeight);


Font example for C++ Builder

This example, in a MouseUp event, determines the size of a rectangle for a string in the specified font. It then draws the rectangle and draws the text on top of the rectangle.

AnsiString TestText;
float TextWidth;
float TextHeight;
LEADRasterFXD* pRasterFxd;
long hDC;
TFont * TempFont = new TFont();

CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

hDC = LEADRasterView1->GetClientDC();
//Specify the text, font, and styles
TestText = "This is my text.";
SetOleFont ( TempFont, pRasterFxd->Font ) ;
TempFont->Name = "Times New Roman";
TempFont->Size = 16;
SetOleFont ( TempFont, pRasterFxd->Font ) ;
pRasterFxd->DrawFontColor = RGB(0, 0, 255); //Blue
pRasterFxd->TextStyle = FXD_TEXTSTYLE_NORMAL;
pRasterFxd->TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER;
//Get the width and height of the text to be drawn->
TextWidth = pRasterFxd->DrawTextWidth (hDC, AnsiToOLESTR(TestText.c_str()));
TextHeight = pRasterFxd->DrawTextHeight(hDC, AnsiToOLESTR(TestText.c_str()));
//set the location for the text
pRasterFxd->TextTop = y;
pRasterFxd->TextLeft = x;
pRasterFxd->TextWidth = TextWidth;
pRasterFxd->TextHeight = TextHeight;
//Set the properties for drawing a rectangle behind the text->
pRasterFxd->DrawPenStyle = DRAWPENSTYLE_SOLID;
pRasterFxd->DrawMode = DRAWMODE_COPY_PEN;
pRasterFxd->DrawFillColor = RGB(0, 255, 0); //Green
//Draw on the screen, not on the bitmap->
pRasterFxd->DrawPersistence = False;
//Draw the rectangle, then draw the text->
pRasterFxd->DrawRectangle (NULL, hDC, x, y, TextWidth, TextHeight);
pRasterFxd->DrawText (NULL, hDC, AnsiToOLESTR(TestText.c_str()), 0);
LEADRasterView1->ReleaseClientDC( );
TempFont-> Free ( ) ;
pRasterFxd-> Release( );


Frame... example for C++ Builder

This example sets the control's frame properties. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

LEADRasterView1->AutoRepaint = False;
LEADRasterView1->FrameThickness = 2;
LEADRasterView1->FrameColor = (TColor)RGB(0, 0, 0);
LEADRasterView1->FrameInnerStyle = EFX_INNERSTYLE_INSET;
LEADRasterView1->FrameOuterStyle = EFX_OUTERSTYLE_INSET;
LEADRasterView1->FrameInnerHiliteColor = (TColor)RGB(255, 255, 0); //Yellow
LEADRasterView1->FrameInnerShadowColor = (TColor)RGB(128, 128, 128); //Dark Gray
LEADRasterView1->FrameOuterHiliteColor = (TColor)RGB(255, 0, 0); //Red
LEADRasterView1->FrameOuterShadowColor = (TColor)RGB(192, 192, 192); //Light Gray
LEADRasterView1->FrameInnerThickness = 3;
LEADRasterView1->FrameOuterThickness = 3;
LEADRasterView1->AutoRepaint = True;


GammaCorrect example for C++ Builder

This example applies a 2.2 gamma correction and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->GammaCorrect (LEADRasterView1->Raster, 220);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


GetBitmapDC example for C++ Builder

Take the following steps to demonstrate how GDI functions can be used to print text on the bitmap and on the control. The text printed on the bitmap is a permanent part of the bitmap and becomes permanent if the bitmap is saved, whereas the text on the control is superficial and does not affect the bitmap.

Note:

For an easier way of drawing text, refer to the DrawText example.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | GDI for Text
3. | Code the Button1 control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.
 | Notice that the code prints in two different places: the bitmap and the control. You can see the difference when you run the program.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
HDC LeadDC;
HDC LeadClientDC;
HFONT hfnt;
HFONT hOldFont;
AnsiString mystring;

//Ensure that the Lead control is visible
LEADRasterView1->Visible = True;
//First, print text on the bitmap->
//Create a device context for the bitmap that the GDI functions can access
LeadDC = (HDC)LEADRasterView1->Raster->GetBitmapDC
 ();
//Get the system font and select it-> The old font is saved->
//Using other fonts is more complex-> Refer to the Windows API documentation->
hfnt = (HFONT)GetStockObject(SYSTEM_FONT);
hOldFont = (HFONT)SelectObject(&LeadDC, &hfnt);
//Make the background transparent, so that the text will overlay the image
SetBkMode(LeadDC, TRANSPARENT);
//Assign the string value
mystring = "Text on the bitmap";
//Print the text on the bitmap-> This is a permanent change in the bitmap
TextOut(LeadDC, 20, 40, mystring.c_str(), StrLen(mystring.c_str()));
//Restore the previous font
SelectObject(&LeadDC, &hOldFont);
//Remove the lock from the device control
LEADRasterView1->Raster->ReleaseBitmapDC
 ();
//Repaint the part of the image that has changed
LEADRasterView1->BackErase
 = False;
LEADRasterView1->ForceRepaint
 ();
//Allow full repainting again
LEADRasterView1->BackErase = True;
//Next, print text on the control.
//Create a device context for the control that the GDI functions can access
LeadClientDC = (HDC)LEADRasterView1->GetClientDC
 ();
//Get the system font and select it. The old font is saved.
//Using other fonts is more complex. Refer to the Windows API documentation.
hfnt = (HFONT)GetStockObject(SYSTEM_FONT);
hOldFont = (HFONT)SelectObject(&LeadDC, &hfnt);
//Make the background transparent, so that the text will overlay the image
SetBkMode(LeadClientDC, TRANSPARENT);
//Assign the string value
mystring = "Text on the LEAD control";
//Print the text on the control->
//This is an overlay that does not affect the bitmap.
TextOut(LeadClientDC, 20, 80, mystring.c_str(), StrLen(mystring.c_str()));
//Restore the previous font
SelectObject(LeadClientDC, hOldFont);
//Remove the lock from the device control
LEADRasterView1->ReleaseClientDC
 ();
}

4.

Run your program to test it. Notice that the text printed on the bitmap is scaled as part of the bitmap. If you zoom in, it becomes larger, and if you zoom out, it becomes smaller. The text printed on the control is the normal size for the system font and is not affected by zooming.


GetColorCount Example for C++ Builder

This example displays a message box showing the number of unique colors in the control's current bitmap.

LEADRasterProcess* pRasterProc= NULL;
AnsiString szMessage; //Buffer for the MessageBox string
int NumberOfColors; //Number of colors in the bitmap

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//Get the number of colors in the bitmap
NumberOfColors= pRasterProc->GetColorCount (LEADRasterView1->Raster);
pRasterProc-> Release( );
//Display the result in a message
szMessage= "The bitmap has " + IntToStr(NumberOfColors) + " colors";
MessageBox (Handle, szMessage.c_str(), "Notice", MB_OK ) ;


GetDIB2 example for C++ Builder

//This example gets the image from LEADRasterView1 as a V5 DIB
//and then loads the DIB into LEADRasterView2
long MyDIB;

//LEADRasterView1 has an image at this point
MyDIB= LEADRasterView1->Raster->GetDIB2 (DIB_BITMAPV5HEADER);
LEADRasterView2->Raster->SetDIB (MyDIB);
//Free the DIB using the Windows API
GlobalFree ((void*)MyDIB);


GetFileInfo example for C++ Builder

This example gets information about the specified file.

//Declare local variables
AnsiString cMsg, cmp, cFmt, fname;
int pg, fmt;
float LeadWidth, LeadHeight;
int bps, xres, yres, sizd, sizm;
LEADRasterIO* pRasterIO= NULL;

// Initialize variables
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
fname = "c:\\temp\\test.tif";
pg = 0;
xres= pRasterIO->InfoXRes;
yres= pRasterIO->InfoYRes;

// Update the variables
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR(fname.c_str()), pg, FILEINFO_TOTALPAGES);
// Read the updated properties
fmt = pRasterIO->InfoFormat;
LeadWidth = pRasterIO->InfoWidth;
LeadHeight = pRasterIO->InfoHeight;
bps = pRasterIO->InfoBits;
pg = pRasterIO->InfoPage;
sizd = pRasterIO->InfoSizeDisk;
sizm = pRasterIO->InfoSizeMem;
cmp = pRasterIO->InfoCompress;
// Translate the meaning of the format constant
switch (fmt)
{
case FILE_PCX:
cFmt = "ZSoft PCX";
break;

case FILE_GIF:
cFmt = "CompuServe GIF";
break;

case FILE_TGA:
cFmt = "TARGA";
break;

case FILE_PNG:
cFmt = "Portable Network Graphics";
break;

case FILE_PSD:
cFmt = "Adobe Photoshop 3->0";
break;

case FILE_BMP:
cFmt = "Windows BMP";
break;

case FILE_OS2:
cFmt = "OS/2 BMP version 1->x";
break;

case FILE_OS2_2:
cFmt = "OS/2 BMP version 2->x";
break;

case FILE_WMF:
cFmt = "Windows Meta File";
break;

case FILE_EPS:
cFmt = "Encapsulated PostScript";
break;

case FILE_MAC:
cFmt = "MacPaint";
break;

case FILE_PCT:
cFmt = "Macintosh Pict";
break;
case FILE_MSP:
cFmt = "Microsoft Paint";
break;

case FILE_IMG:
cFmt = "GEM Image";
break;

case FILE_PCD:
cFmt = "Kodak PhotoCD";
break;

case FILE_EPSTIFF:
cFmt = "Encapsulated PostScript with an embedded TIFF file";
break;
default:
cFmt = "Unknown format";
}
// Create the message string
cMsg = fname + "\nPage = " + IntToStr(pg) + " of " + IntToStr((int)pRasterIO->InfoTotalPages) + "\nFormat = " + cFmt + "\n";
cMsg = cMsg + "Width = " + IntToStr((int)LeadWidth) + "\nHeight = " + IntToStr((int)LeadHeight) + "\n";
cMsg = cMsg + "Size in memory = " + IntToStr(sizm) + "\nSize on disk = " + IntToStr(sizd) + "\n";
cMsg = cMsg + "Bits per pixel = " + IntToStr(bps) + "\n";
cMsg = cMsg + "X resolution = " + IntToStr(xres) + "\nY resolution = " + IntToStr(yres);
pRasterIO-> Release( );
//Display the message box
MessageBox (Handle, cMsg.c_str(), "File Info", MB_OK);


GetFloaterHandle example for C++ Builder

This example uses the GetFloaterHandle and SetRgnHandle methods to specify the mask for the paste. It also shows how to use the HasRgn, FloaterWidth, and FloaterHeight properties.

//Note that ZoomFactorX, ZoomFactorY must be declared as a global variables, and
//have a correct data when you use this code.
//Declare the variable for the Combine operation.
long MyOp;
//Declare the variable for the saved region.
long SavedRgn;
//Declare the variables for the client area coordinates.
float LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight;
//Declare the variables for the bitmap coordinates.
float LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight;

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//Exit this routine if there is no region.
if (LEADRasterView1->Raster->HasRgn == false)
return;
//Save the region that is in the floater.
SavedRgn = LEADRasterView1->GetFloaterHandle ();
//Get the floater into another bitmap
LEADRasterView2->ScaleMode = LEADRasterView1->ScaleMode;
LEADRasterView2->Raster->RefBitmap = False;
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Floater;
//Get the floater//s client coordinates into local variables.
LCRgnX = LEADRasterView1->FloaterDstLeft;
LCRgnY = LEADRasterView1->FloaterDstTop;
LCRgnWidth = LEADRasterView1->FloaterDstWidth;
LCRgnHeight = LEADRasterView1->FloaterDstHeight;
//Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - LEADRasterView1->DstLeft) / ZoomFactorX) + LEADRasterView1->SrcLeft;
LBRgnY = ((LCRgnY - LEADRasterView1->DstTop) / ZoomFactorY) + LEADRasterView1->SrcTop;
LBRgnWidth = LEADRasterView1->FloaterWidth;
LBRgnHeight = LEADRasterView1->FloaterHeight;
//Delete the floater.
LEADRasterView1->FloaterVisible = False;
LEADRasterView1->Floater = 0;
//Set the saved region to use as a mask for the Combine method.
LEADRasterView1->Raster->SetRgnHandle (SavedRgn, LBRgnX, LBRgnY, L_RGN_SET);
//Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0; //Operation flags for a simple paste.
pRasterProc->Combine (LEADRasterView1->Raster,
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight,
LEADRasterView2->Raster,
0, 0, (CombineConstants)MyOp);
//Repaint the part of the client area that has changed.
LEADRasterView1->RepaintRect (LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False);
//Free the region.
LEADRasterView1->Raster->FreeRgn ();
//Delete the region handle.
LEADRasterView1->Raster->DeleteRgnHandle (SavedRgn);
pRasterProc-> Release( );


GetHistogram example for C++ Builder

The following code does a CMYK separation and uses a histogram to find the brightest and darkest intensities in the K plane of the bitmap. It then remaps the intensities to use the full range and merges the color planes to recreate the bitmap:

long MyIndex;
int Brightest;
int Darkest;
int CurrentRange;
int Offset;

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
Cursor= crHourGlass;
//Do a CMYK color separation and copy the K plane to the bitmap
pRasterProc->ColorSeparate (LEADRasterView1->Raster, COLORSEP_CMYK);
LEADRasterView1->Raster->Bitmap = 0; //Free the bitmap
LEADRasterView1->Raster->Bitmap = pRasterProc->get_ColorPlanes (3); //Copy the K plane
//Load the histogram
pRasterProc->GetHistogram (LEADRasterView1->Raster, CHANNEL_MASTER);
//Find the brightest and darkest intensities in the image
MyIndex = 0;
Brightest = 0;
Darkest = -1;
while (MyIndex < 256)
{
if (pRasterProc->get_HistogramTable ((short)MyIndex) > 0)
{
Brightest = MyIndex;
if (Darkest == -1)
Darkest = MyIndex;
}
MyIndex = MyIndex + 1;
}
//Remap the intensities to use the full range
MyIndex = Darkest;
CurrentRange= Brightest - Darkest;
if (CurrentRange > 0)
{
while (MyIndex <= Brightest)
{
Offset = MyIndex - Darkest;
pRasterProc->set_RemapTable ((short)MyIndex, (short)((255 * Offset) / CurrentRange));
MyIndex = MyIndex + 1;
}
pRasterProc->RemapIntensity (LEADRasterView1->Raster, CHANNEL_MASTER);
}
//Merge the color planes and free them from memory
pRasterProc->set_ColorPlanes (3, LEADRasterView1->Raster->Bitmap); //Update the K plane
pRasterProc->ColorMerge (LEADRasterView1->Raster, COLORSEP_CMYK);
pRasterProc->set_ColorPlanes(0, 0);
pRasterProc->set_ColorPlanes(1, 0);
pRasterProc->set_ColorPlanes(2, 0);
pRasterProc->set_ColorPlanes(3, 0);
//Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->ForceRepaint ();
Cursor= crDefault;
pRasterProc-> Release( );


GetHistogramGray example for C++ Builder

//This example gets a histogram for a 12-bit or 16-bit grayscale image and then
//displays the number of occurrences of the brightest and darkest intensities
int nRet;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

ShowMessage ("Table size before call to GetHistogramGray: " + IntToStr((int)pRasterProc->HistogramGrayTableSize));
nRet = pRasterProc->GetHistogramGray (LEADRasterView1->Raster);
if (nRet== 0)
{
LEADRasterView1->Raster->GetMinMaxVal ();
ShowMessage ("Highest Intensity: 0x" + IntToHex((int)LEADRasterView1->Raster->MaxVal, 4) + " Count: " + IntToStr((int)pRasterProc->get_HistogramGrayTable (LEADRasterView1->Raster->MaxVal))
+ "\nLowest Intensity: 0x" + IntToHex((int)LEADRasterView1->Raster->MinVal, 4) + " Count: " + IntToStr((int)pRasterProc->get_HistogramGrayTable(LEADRasterView1->Raster->MinVal)));
}
ShowMessage ("Table size of current histogram: " + IntToStr((int)pRasterProc->HistogramGrayTableSize));
pRasterProc-> Release( );


GetMinMaxBits example for C++ Builder

The following example retrieves the values for MinBit and MaxBit using GetMinMaxBits and writes the results.

LEADRasterView1->Raster->GetMinMaxBits ();
Edit1->Text= IntToStr(LEADRasterView1->Raster->MinBit);
Edit2->Text= IntToStr(LEADRasterView1->Raster->MaxBit);


GetMinMaxVal example for C++ Builder

The following example retrieves the values for MinVal and MaxVal using GetMinMaxVal and writes the results.

// add 2 EditBox controls for testing
//must call GetMinMaxVal first
LEADRasterView1->Raster->GetMinMaxVal ();
Edit1->Text= IntToStr((int)LEADRasterView1->Raster->MinVal);
Edit2->Text= IntToStr((int)LEADRasterView1->Raster->MaxVal);


GetRgnHandle example for C++ Builder

The following code creates a region, saves its handle and adds the saved region beside the current region.

long SavedRegion;
float OffsetX, OffsetY;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//Initialize the variables that we will manipulate to simulate mouse coordinates
OffsetX= LEADRasterView1->Raster->BitmapWidth / 8;
OffsetY= LEADRasterView1->Raster->BitmapHeight / 6;
//Create an elliptical region.
LEADRasterView1->Raster->SetRgnEllipse (OffsetX, OffsetY, OffsetX, OffsetY, L_RGN_SET);
//Save a copy of the region.
SavedRegion= LEADRasterView1->Raster->GetRgnHandle ();
//Add the saved region to the bitmap, offsetting it so that we can see it
LEADRasterView1->Raster->SetRgnHandle (SavedRegion, OffsetX, OffsetY, L_RGN_OR);
//Delete the saved region.
LEADRasterView1->Raster->DeleteRgnHandle (SavedRegion);
//Fill the bitmap region with blue
pRasterProc->Fill (LEADRasterView1->Raster, RGB(0, 0, 255));
//Free the bitmap region
LEADRasterView1->Raster->FreeRgn ();
//Repaint the image so that we can see how the image was updated
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );


Grayscale example for C++ Builder

This example converts the bitmap to 12-bit grayscale.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Grayscale (LEADRasterView1->Raster, 12); //Grayscale image to 12-bit
pRasterProc-> Release( );


Halftone example for C++ Builder

This example halftone the bitmap with a horizontal pattern and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Halftone (LEADRasterView1->Raster, HALFTONE_PRINT, 0);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


hDocCleanRgn example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

/*Create the RasterProcess object and UnlockSupport*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//.....
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
//.....
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;
/*HolePunch Remove
This example updates a windows region with all removed hole punches
For the example, a windows region is updated and then converted to a LEAD region
but in practice it would easier and faster to just update a LEAD region
The HOLEPUNCH_USE_DPI flag instructs the API to determine the size of the hole punches
based on the image DPI
The image is modified
The HolePunch Event is used to display information about each hole punch removed*/

pRasterProc->EnableDocCleanEvents = True;
nRet= pRasterProc->HolePunchRemove (LEADRasterView1->Raster,
(HolePunchRemoveFlags)(HOLEPUNCH_SINGLE_REGION + HOLEPUNCH_USE_DPI + HOLEPUNCH_USE_COUNT + HOLEPUNCH_USE_LOCATION),
2, 4, 0, 0, 0, 0, HOLEPUNCH_LEFT);

if (nRet == 0)
{
LEADRasterView1->Raster->FreeRgn ( ) ;
LEADRasterView1->Raster->SetRgnHandle ( pRasterProc->hDocCleanRgn, 0, 0, L_RGN_SET);
pRasterProc->hDocCleanRgn= 0; //no longer need rgn
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
}

}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}
void __fastcall TForm1::LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_HOLEPUNCHREMOVE:
{

float fBoundingRectLeft= (OleVariant)(Params.rgvarg[7]);
float fBoundingRectTop= (OleVariant)(Params.rgvarg[6]);
float fBoundingRectWidth= (OleVariant)(Params.rgvarg[5]);
float fBoundingRectHeight= (OleVariant)(Params.rgvarg[4]);
int iHoleIndex= (OleVariant)(Params.rgvarg[3]);
int iHoleTotalCount= (OleVariant)(Params.rgvarg[2]);
int iWhiteCount= (OleVariant)(Params.rgvarg[1]);
int iBlackCount= (OleVariant)(Params.rgvarg[0]);

char szTemp[256];
sprintf(szTemp,"HolePunch at [Left,Top,Width,Height] %f,%f,%f,%f HoleIndex= %d TotalCount= %d WhiteCount= %d BlackCount= %d",
fBoundingRectLeft, fBoundingRectTop, fBoundingRectWidth, fBoundingRectHeight, iHoleIndex,
iHoleTotalCount, iWhiteCount, iBlackCount);

OutputDebugString (szTemp);
}
break;
}
}


HistoContrast example for C++ Builder

This example applies a histogram contrast to the bitmap and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->HistoContrast (LEADRasterView1->Raster, 300);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


HistoEqualize example for C++ Builder

This example equalizes the bitmap's histogram and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->HistoEqualize (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


HSV_HfromRGB example for C++ Builder

//Takes an RGB, displays the RGB components, and displays the HSV components
void RGBtoHSV(::OLE_COLOR cr)
{
int red;
int green;
int blue;
int h;
int s;
int v;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
red = GetRValue (cr);
green = GetGValue(cr);
blue = GetBValue(cr);

h = pRasterProc->HSV_HfromRGB (cr);
s = pRasterProc->HSV_SfromRGB (cr);
v = pRasterProc->HSV_VfromRGB (cr);

ShowMessage( "RGB (" + IntToStr(red) + "," + IntToStr(green) + "," + IntToStr(blue) + ") is HSV(" + IntToStr(h) + "," + IntToStr(s) + "," + IntToStr(v) + ")" );
pRasterProc-> Release( );
}


Hue example for C++ Builder

This example rotates the hue 180 degrees and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Hue (LEADRasterView1->Raster, 180);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


IgnoreFilters example for C++ Builder

This example shows how to ignore filters so that certain files are not loaded.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//First, make sure PreLoaded Filters does not
//contain CMP, and that 0 filters can be cached
pRasterIO->PreLoadFilters (3, 0, AnsiToOLESTR("BMP,FAX,TIF"));
//now, ignore cmp filter (never load cmp files)
pRasterIO->IgnoreFilters (AnsiToOLESTR("CMP"));

pRasterIO-> Release( );


InfoHasAlpha example for C++ Builder

LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\1.jpg"), 24, 1, 1); //load a 24-bit image
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->Bitmap;
pRasterProc->ColorRes (LEADRasterView1->Raster,
8,
(ColorResPaletteConstants)0,
(ColorResDitherConstants)0,
0); //just make it 8-bit
//now set an alpha channel
LEADRasterView1->Raster->BitmapAlpha = LEADRasterView2->Raster->Bitmap;

//save and free
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\32.png"), FILE_PNG, 32, (QFactorConstants)0, 0);
LEADRasterView1->Raster->Bitmap = 0;
LEADRasterView2->Raster->Bitmap = 0;

ShowMessage("Pause");

//re-load
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\32.png"), 0, 0);
if (pRasterIO->InfoHasAlpha)
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\32.png"), 0, 1, 1);

LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->BitmapAlpha;

pRasterProc-> Release( );
pRasterIO-> Release( );


InfoViewPerspective Example for C++ Builder

ILEADRasterIO *pRasterIO;
CoCreateInstance(CLSID_LEADRasterIO, NULL,
CLSCTX_ALL, IID_ILEADRasterIO,
(void**)&pRasterIO);

pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\babe.cmp"), 1, FILEINFO_TOTALPAGES);
ShowMessage (IntToStr(pRasterIO->InfoViewPerspective));
pRasterIO-> Release();


InsertBitmapListItem Example for C++ Builder

This example loads an ordinary file and uses it to create and play an animation. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
double nMax; // Maximum width or height for bitmaps in the list
double BitmapWidth; // Width of the bitmap
double BitmapHeight; // Height of the bitmap
short I; // Loop Counter
LEADRasterIO * pRasterIO=NULL;
LEADRasterProcess* pRasterProc=NULL;
LEADRaster* pRaster2=NULL ;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster2);

nMax = 160;
pRasterIO->Load (pRaster2, AnsiToOLESTR("v:\\images\\24bit.bmp"), 0, 0, 1);
BitmapWidth = pRaster2->BitmapWidth;
BitmapHeight = pRaster2->BitmapHeight;
// Reduce memory requirements, if necessary. Only small bitmaps play smoothly.
if (BitmapWidth > nMax)
pRasterProc->Size (pRaster2, nMax, (BitmapHeight * nMax) / BitmapWidth, RESIZE_RESAMPLE);
else
{
if(BitmapHeight > nMax)
pRasterProc->Size (pRaster2, (BitmapWidth * nMax) / BitmapHeight, nMax, RESIZE_RESAMPLE);
}
// Dither to an optimized palette, leaving the last color blank to use
// for transparency.
pRasterProc->ColorRes (pRaster2, 8, CRP_IDENTITYPALETTE, CRD_FLOYDSTEINDITHERING, 255);
// Set an arbitrary transparent color in the last position of the bitmap palette.
pRaster2->set_BitmapPalette (255, RGB(212, 222, 202));
// Set the playback values that will apply to all bitmaps in the list.
pRaster2->BitmapDelay = 10;
pRaster2->BitmapTop = 0;
pRaster2->BitmapLeft = 0;
pRaster2->BitmapEnableTransparency = True;
pRaster2->BitmapTransparentColor = 16777216 + 255; // Specified by palette index
pRaster2->BitmapDisposalMethod = ANIMATIONDISPOSAL_RESTOREBACKGROUND;
// Free the LEADRasterView1 control//s current bitmap list.
LEADRasterView1->Raster->BitmapList = 0;
// Populate the bitmap list in the LEADRasterView1 control.
LEADRasterView1->EnablePaint = False;
for (I = 0; I<= 36; I ++)
{
LEADRasterView1->Raster->InsertBitmapListItem (I, pRaster2->Bitmap);
// Rotate, using the transparent color as the fill color.
LEADRasterView1->Raster->BitmapListIndex =I;
pRasterProc->Rotate (LEADRasterView1->Raster, 1000 * I, (RotateConstants)0, 16777216 + 255);
}
LEADRasterView1->EnablePaint = true;
// Set the animation playback properties
LEADRasterView1->AnimationBackColor = (TColor)RGB(0, 0, 255);
LEADRasterView1->AnimationBitsPerPixel = 8;
LEADRasterView1->AnimationHeight = LEADRasterView1->ScaleHeight;
LEADRasterView1->AnimationWidth = LEADRasterView1->ScaleWidth;
LEADRasterView1->AnimationLoop = false;
for (I = 0; I <= 255; I++)
LEADRasterView1->AnimationPalette [I] = LEADRasterView1->Raster->get_BitmapPalette (I);

// Set properties for a scaled animation.
LEADRasterView1->AutoRepaint = true;
LEADRasterView1->AutoSetRects = false;
// Set the image display size to match the LEAD Raster View control.
LEADRasterView1->SetDstRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
// Start the animation.
LEADRasterView1->AnimationEnable = true;
// Free the Raster2 object//s bitmap list.
pRaster2->BitmapList = 0;
pRasterProc-> Release( );
pRasterIO-> Release( );
pRaster2 -> Release( );
}


Intensity example for C++ Builder

This example lightens the bitmap and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Intensity (LEADRasterView1->Raster, 150);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


IntensityDetect example for C++ Builder

This example filters the bitmap to get the lightest intensities and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->IntensityDetect (LEADRasterView1->Raster, 200, 255);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Invert example for C++ Builder

This example inverts the bitmap's colors and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Invert (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


InvertedText example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;
//InvertedText
//This example finds all inverted text regions greater than 5 inches in width and 1/2 inch in height
//and inverts the text so that it appears normal
//The InvertedText Event is used to display additional information about the inverted text regions
//A LEAD region is updated to show all of the changes
pRasterProc->EnableDocCleanEvents = True;
nRet= pRasterProc->InvertedText (LEADRasterView1->Raster, (InvertedTextFlags)(INVERTEDTEXT_SINGLE_REGION + INVERTEDTEXT_LEAD_REGION + INVERTEDTEXT_USE_DPI), 5000, 500, 70, 95);
if (nRet == 0)
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_INVERTEDTEXT:
{
float fBoundingRectLeft= (OleVariant)(Params.rgvarg[5]);
float fBoundingRectTop= (OleVariant)(Params.rgvarg[4]);
float fBoundingRectWidth= (OleVariant)(Params.rgvarg[3]);
float fBoundingRectHeight= (OleVariant)(Params.rgvarg[2]);
int iWhiteCount= (OleVariant)(Params.rgvarg[1]);
int iBlackCount= (OleVariant)(Params.rgvarg[0]);
AnsiString strTemp;
strTemp = "Inverted at [Left,Top,Width,Height]" + FloatToStr(fBoundingRectLeft) +","+
FloatToStr(fBoundingRectTop) + "," + FloatToStr(fBoundingRectWidth) +","+
FloatToStr(fBoundingRectHeight) +" WhiteCount=" +
IntToStr(iWhiteCount) + " BlackCount= " +
IntToStr(iBlackCount);

OutputDebugString(strTemp.c_str());
}
break;
}
}


IsGrayscale example for C++ Builder

This example tests to see if the bitmap is grayscale.

GrayscaleTypes IsGray;

IsGray= LEADRasterView1->Raster->IsGrayscale;
if (IsGray == GRAY_NO)
ShowMessage("Not Grayscale");
else
ShowMessage("Is Grayscale");


J2KCompressionControl Example for C++ Builder

LEADRasterIO * pRasterIO = NULL;

CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

//compress a lossless file
pRasterIO->J2KSetDefaults ();
pRasterIO->J2KCompressionControl_ = J2K_COMP_LOSSLESS;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR ("c:\\temp\\lossless.j2k"), FILE_J2K, 0, (QFactorConstants) 0, SAVE_OVERWRITE);
pRasterIO->Release();


J2KCompressionRatio Example for C++ Builder

LEADRasterIO * pRasterIO = NULL;

CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Compress a JPEG2000 file using 100:1 comp ratio
pRasterIO->J2KSetDefaults ();
pRasterIO->J2KCompressionControl_= J2K_COMP_RATIO;
pRasterIO->J2KCompressionRatio = 100;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR ("c:\\temp\\100_to_1.j2k"), FILE_J2K, 0, (QFactorConstants) 0, SAVE_OVERWRITE);
pRasterIO->Release();


J2KSetDefaults Example for C++ Builder

J2KSetDefaults Example for Delphi

LEADRasterIO * pRasterIO = NULL;
AnsiString csmsg;
AnsiString cstemp;

CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_J2K, AnsiToOLESTR (L_KEY_J2K));

// Display all the default JPEG2000 advanced options
pRasterIO->J2KSetDefaults ();
csmsg= "";
if ( pRasterIO->J2KUseColorTransform )
cstemp= "J2KUseColorTransform = True \n";
else
cstemp= "J2KUseColorTransform = False \n";

csmsg= csmsg + cstemp;
if ( pRasterIO->J2KDerivedQuantization )
cstemp= "J2KDerivedQuantization = True \n";
else
cstemp= "J2KDerivedQuantization = False \n";
csmsg= csmsg + cstemp;

cstemp= "J2KXOsiz = " + IntToStr((int)pRasterIO->J2KXOsiz) + "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KYOsiz = " + IntToStr((int)pRasterIO->J2KYOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KXTsiz = "+ IntToStr((int)pRasterIO->J2KXTsiz) + "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KYTsiz = "+ IntToStr((int)pRasterIO->J2KYTsiz)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KXTOsiz = " + IntToStr((int)pRasterIO->J2KXTOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KYTOsiz = " + IntToStr((int)pRasterIO->J2KYTOsiz) + "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KDecompLevel = "+ IntToStr((int)pRasterIO->J2KDecompLevel)+ "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KProgressOrder = " + IntToStr((int)pRasterIO->J2KProgressOrder) + "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KCodBlockWidth = " + IntToStr((int)pRasterIO->J2KCodBlockWidth) + "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KCodBlockHeight = " + IntToStr((int)pRasterIO->J2KCodBlockHeight) + "\n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_SelectiveACBypass )
cstemp= "J2KCBS_SelectiveACBypass = True \n";
else
cstemp= "J2KCBS_SelectiveACBypass = False \n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_ResetContextOnBoundaries )
cstemp= "J2KCBS_ResetContextOnBoundaries = True \n";
else
cstemp= "J2KCBS_ResetContextOnBoundaries = False \n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_TerminationOnEachPass )
cstemp= "J2KCBS_TerminationOnEachPass = True \n";
else
cstemp= "J2KCBS_TerminationOnEachPass = False \n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_VerticallyCausalContext )
cstemp= "J2KCBS_VerticallyCausalContext = True \n";
else
cstemp= "J2KCBS_VerticallyCausalContext = False \n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_PredictableTermination )
cstemp= "J2KCBS_PredictableTermination = True \n";
else
cstemp= "J2KCBS_PredictableTermination = False \n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KCBS_ErrorResilienceSymbol )
cstemp= "J2KCBS_ErrorResilienceSymbol = True \n";
else
cstemp= "J2KCBS_ErrorResilienceSymbol = False \n";
csmsg= csmsg + cstemp;

cstemp= "J2KGuardBits = " + IntToStr((int)pRasterIO->J2KGuardBits)+ "\n";
csmsg= csmsg + cstemp;

cstemp= "J2KDerivedBaseMantissa = " + IntToStr ((int) pRasterIO->J2KDerivedBaseMantissa)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KDerivedBaseExponent = " + IntToStr ((int) pRasterIO->J2KDerivedBaseExponent)+ "\n";
csmsg= csmsg + cstemp;

if ( pRasterIO->J2KUseSOPMarker )
cstemp= "J2KUseSOPMarker = True \n";
else
cstemp= "J2KUseSOPMarker = False \n";
csmsg= csmsg + cstemp;

if (pRasterIO->J2KUseEPHMarker)
cstemp= "J2KUseEPHMarker = True \n";
else
cstemp= "J2KUseEPHMarker = False \n";
csmsg= csmsg + cstemp;

ShowMessage (csmsg);
pRasterIO->Release();


J2KTargetFileSize example for C++ Builder

J2KTargetFileSize Example for Delphi

LEADRasterIO * pRasterIO = NULL;

CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
//compress a 30K JPEG2000 file
pRasterIO->J2KSetDefaults ();
pRasterIO->J2KCompressionControl_= J2K_COMP_TARGETSIZE;
pRasterIO->J2KTargetFileSize = 30 * 1024;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR ("c:\\temp\\30k.j2k"), FILE_J2K, 0, (QFactorConstants) 0, SAVE_OVERWRITE);
pRasterIO->Release ();


KeyPress example for C++ Builder

This example demonstrates the KeyPress event.

//This example uses the KeyPress event to implement a custom scale mode.
//There is no particular reason to put this code in this event
//This sample is just here to provide an example of both the Key Press event
//and the scale mode.
void __fastcall TForm1::LEADRasterView1KeyPress (TObject *Sender,
short KeyAscii)
{
if (KeyAscii == 67) //Uppercase C
{
//This example sets an custom scale mode and uses it to crop the
//display. Keep in mind that the actual height and width do not change.
//Only the unit of measure changes.
//Change the scale so that origin is moved one-third right and one-third down
LEADRasterView1->ScaleLeft = -1;
LEADRasterView1->ScaleTop = -1;
LEADRasterView1->ScaleWidth = 3;
LEADRasterView1->ScaleHeight = 3;
//Crop the display so that it takes up the middle third of the height and width
LEADRasterView1->DstClipLeft = 0;
LEADRasterView1->DstClipTop = 0;
LEADRasterView1->DstClipWidth = 1;
LEADRasterView1->DstClipHeight = 1;
LEADRasterView1->ForceRepaint ();
}
}


LevelLowBit example for C++ Builder

This is also the example for LevelHighBit.

This example sets LevelLowBit and LevelHighBit to display the image using only the eight least significant bits.

LEADRasterView1->AutoRepaint = False;
//use least significant 8 bits
LEADRasterView1->Raster->LevelLowBit = 0;
LEADRasterView1->Raster->LevelHighBit = 7;
LEADRasterView1->AutoRepaint= True;


LevelLUT example for C++ Builder

This is also the example for MinVal property and MaxVal property.

The following example sets LevelLowBit and LevelHighBit to use all bits, gets the minimum and maximum bits and intensity values for the image, and then sets the LUT so that pixels with values in the minimum range are mapped to the color RED, while pixels with values in the maximum range are mapped to BLUE.

long min;
long max;
long i;

LEADRasterView1->AutoRepaint = False;
//use all bits
LEADRasterView1->Raster->LevelLowBit = 0;
LEADRasterView1->Raster->LevelHighBit = (short)(LEADRasterView1->Raster->BitmapBits - 1);

LEADRasterView1->Raster->GetMinMaxBits ();
LEADRasterView1->Raster->GetMinMaxVal ();
max = LEADRasterView1->Raster->MaxVal;
min = LEADRasterView1->Raster->MinVal;

//set LUT so that min range maps to RED and max range maps to BLUE
for (i = min; i <= min + 100; i ++)
LEADRasterView1->Raster->set_LevelLUT (i, RGB(255, 0, 0));
for (i = max - 100; i <= max; i ++)
LEADRasterView1->Raster->set_LevelLUT(i, RGB(0, 0, 255));
LEADRasterView1->AutoRepaint = True;


LevelLUTLength example for C++ Builder

This example writes out the number of entries in the LUT.

Edit1->Text= IntToStr((int)LEADRasterView1->Raster->LevelLUTLength);


LineRemove example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

/*Create the RasterProcess object and UnlockSupport*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//.....
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
//.....
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
/*Line Remove
This examples removes vertical lines that are at least 200 pixels in length
and no more than 5 pixels in width
The lines can have gaps up to two pixels in length
The LineRemove Event is used to display information about each line removed*/
pRasterProc->EnableDocCleanEvents = true;
pRasterProc->LineRemove (LEADRasterView1->Raster, LINE_USE_GAP, 200, 5, 7, 10, 2, 0, LINEREMOVE_HORIZONTAL);
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_LINEREMOVE:
{
float fStartRow= (OleVariant)(Params.rgvarg[3]);
float fStartCol= (OleVariant)(Params.rgvarg[2]);
float fLength= (OleVariant)(Params.rgvarg[1]);
AnsiString strTemp;
strTemp = "Line at [R,C] " + FloatToStr(fStartRow) + "," + FloatToStr(fStartCol) +
" Length=" + FloatToStr(fLength);
OutputDebugString(strTemp.c_str());
}
break;
}
}


LoadArray example for C++ Builder

void __fastcall TForm1::LoadArrayClick(TObject *Sender)
{
long lCount;
HFILE hFile;
HGLOBAL hData=NULL;
char* pData=NULL;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant* pRasterVar= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVar);

hFile = _lopen("c:\\babe.cmp", OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData= (char*)GlobalLock(hData);

_lread(hFile, pData, lCount);

pRasterVar->set_Type(VALUE_ARRAY_BYTE);
pRasterVar->ItemCount= lCount;

for (int i=0; i < lCount; i ++ )
{
pRasterVar->set_ShortItemValue(i, pData[i]);
}

GlobalUnlock(hData);
GlobalFree(hData);

pRasterIO->LoadArray( LEADRasterView1->Raster,
pRasterVar,
0,
0,
-1,
lCount);
_lclose(hFile);

if ( pRasterIO )
pRasterIO->Release();

if ( pRasterVar )
pRasterVar->Release();
}


LoadCompressed example for C++ Builder

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->LoadCompressed = True;
//now the file will be loaded compressed
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\test.tif"), 0, 0, 1);
pRasterIO-> Release( );


LoadIFD example for C++ Builder

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//All examples will assume that "test.tif" has over 1002 images
// This example will load pages 1000 and 1001 after getting the information for page 1000:
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Test.tif"), 1000, 0);
// Setting LoadIFD to InfoIFD indicates that 1000 is treated as page 1
pRasterIO->LoadIFD = pRasterIO->InfoIFD;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Test.tif"), 0, 0, 2);
// Reset LoadIFD to 0 so other TIF files will be handled properly
pRasterIO->LoadIFD = 0;
pRasterIO-> Release( );


LoadInfo... example for C++ Builder

Take the following steps to exercise the LoadInfo event and LoadInfo... properties. The example creates a raw FAX file, and then loads the file it just created. (Getting format information from an unfamiliar file is beyond the scope of this example.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
3. | At the beginning of the Unit1.h file, include this file:

#include "LTRASTERPROCLib_TLB.h"

4. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
5. | From the ActiveX controls, Add the LEvntSnk control to your form.
6. | Add the following variables to Unit1.h Private declaration section:

int MyInfoBits;
int MyInfoFlags;
int MyInfoFormat;
float MyInfoHeight;
long MyInfoOffset;
float MyInfoWidth;
int MyInfoXRes;
int MyInfoYRes;
LEADRasterIO * pMyRasterIO;

7.

Add the following to LoadLead Click’s Procedure:

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pMyRasterIO);
LEADEventSink1->Connect (pMyRasterIO, DIID__LEADRasterIOEvents);

8.

Code the Close event procedure as follows:

void __fastcall TForm1::FormClose(TObject *Sender,
 TCloseAction &Action)
{
if(pMyRasterIO)
pMyRasterIO->Release();
}

9. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Button1
10. | Code the Button1 click’s procedure as follows:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
LEADRasterProcess * pRasterProc;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&pRasterProc);
LEADRasterView1->ScaleMode
 = 3; //Pixels
//Make the image look OK as a 1-bit image.
pRasterProc->Size (LEADRasterView1->Raster,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight,
 RESIZE_RESAMPLE);
pRasterProc->Halftone (LEADRasterView1->Raster,
 HALFTONE_VIEW, 45);
pRasterProc->Release ( ) ;
//Set the form-level variables to the values we will use when loading.
MyInfoBits = 1;
MyInfoFlags = LOADINFO_TOPLEFT;
MyInfoFormat = FILE_FAX_G3_2D;
MyInfoHeight = LEADRasterView1->Raster->BitmapHeight;
MyInfoOffset = 0;
MyInfoWidth = LEADRasterView1->Raster->BitmapWidth;
MyInfoXRes = LEADRasterView1->Raster->BitmapXRes;
MyInfoYRes = LEADRasterView1->Raster->BitmapYRes;
//Save the image as raw FAX; then load the saved file.
//Format information will be supplied in the LoadInfo event.
pMyRasterIO->Save (LEADRasterView1->Raster,
 AnsiToOLESTR("c:\\temp\\tmp.tif"), FILE_FAX_G3_2D,
1, (QFactorConstants)1, SAVE_OVERWRITE);

pMyRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\tmp.tif"),
 0, 0, 1);
//Repaint the newly loaded image.
LEADRasterView1->ForceRepaint
 ();
}

11.

Code the pMyRasterIO object's LoadInfo event as follows:

void __fastcall TForm1:: LEADEventSink1Invoke(TObject
 *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERIOEVENTS_LOADINFO:
{
pMyRasterIO->LoadInfoBits
 =(short) MyInfoBits;
pMyRasterIO->LoadInfoFlags
 = (LoadInfoFlagConstants)MyInfoFlags;
pMyRasterIO->LoadInfoFormat
 =(RasterFileConstants) MyInfoFormat;
pMyRasterIO->LoadInfoHeight
 = MyInfoHeight;
pMyRasterIO->LoadInfoOffset
 = MyInfoOffset;
pMyRasterIO->LoadInfoWidth
 = MyInfoWidth;
pMyRasterIO->LoadInfoXRes
 = MyInfoXRes;
pMyRasterIO->LoadInfoYRes
 = MyInfoYRes;
}
break;
}
}

12.

Run your program to test it.


LoadMemory example for C++ Builder

This example uses WIN32 API calls to load a file into memory, and then uses the LoadMemory method to load the memory-resident file into a bitmap.

long hf; // For WIN32 declare this as Long
HGLOBAL hMem; // For WIN32 declare this as Long
void * lpMem = NULL;
long iSize;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// Load the file into memory
hf = FileOpen("v:\\images\\image1.cmp", fmOpenRead);

if (hf <= 0 )
{
MessageDlg("Error opening file!", mtError, TMsgDlgButtons() << mbOK, 0);
return;
}
iSize = FileSeek(hf,0,2);
FileSeek(hf, 0, 0);
hMem = GlobalAlloc(GMEM_MOVEABLE,iSize);

if (hMem == 0)
{
FileClose (hf);
MessageDlg("Not enough memory to hold the file in memory!", mtError, TMsgDlgButtons() << mbOK, 0);
return;
}
lpMem= GlobalLock(hMem);
if (!lpMem)
{
FileClose (hf);
GlobalFree(hMem);
MessageDlg("Not enough memory to hold the file in memory!", mtError, TMsgDlgButtons() << mbOK, 0);
return;
}

if (FileRead(hf, lpMem, iSize) < iSize)
{
FileClose (hf);
GlobalUnlock(hMem);
GlobalFree(hMem);
MessageDlg("Error reading file!", mtError, TMsgDlgButtons() << mbOK, 0);
return;
}
GlobalUnlock (hMem);
FileClose (hf);

//Load the bitmap from the memory-resident file.
if (pRasterIO->LoadMemory (LEADRasterView1->Raster, (long)hMem, 0, 0, -1, iSize) != 0)
MessageDlg ("Error calling LoadMemory", mtError, TMsgDlgButtons() << mbOK, 0);
else
MessageDlg ("LoadMemory succeeded", mtInformation, TMsgDlgButtons() << mbOK, 0);
GlobalFree (hMem);
pRasterIO-> Release( );


LoadUseViewPerspective example for C++ Builder

Note:

This topic is for Document/Medical only.

This example times the loading of a bitmap with and without changing the internal view perspective.

double StartTime, EndTime, DeltaTime;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//Do not include paints when measuring time.
LEADRasterView1->AutoRepaint = False;
//Time the load using the bitmap//s view perspective
pRasterIO->LoadUseViewPerspective = True;
StartTime= Time();
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\bird.tif"), 0, 0, 1);
EndTime= Time();
DeltaTime= EndTime - StartTime;
ShowMessage(IntToStr((int)DeltaTime) + " seconds loaded as is");
//Time the load that converts the bitmap//s view perspective
pRasterIO->LoadUseViewPerspective= False;
StartTime= Time();
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\bird.tif"), 0, 0, 1);
EndTime= Time();
DeltaTime= EndTime - StartTime;
ShowMessage (IntToStr((int)DeltaTime) + " seconds converted on load");
pRasterIO-> Release( );


MaxFilter example for C++ Builder

This example erodes dark objects and repaints the image.

LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->MaxFilter (LEADRasterView1->Raster, 3);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Median example for C++ Builder

This example applies a median filter with a 3x3 neighborhood and redisplays the bitmap.

LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Median (LEADRasterView1->Raster, 3);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


MinFilter example for C++ Builder

Note:

This topic is for Document/Medical only.

This example dilates dark objects and repaints the image.

LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->MinFilter (LEADRasterView1->Raster, 3);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Mosaic example for C++ Builder

This example applies a mosaic effect with 8x8 tiles and redisplays the bitmap.

LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Mosaic (LEADRasterView1->Raster, 8);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


ODBC Example for C++ Builder

Take the following steps to create and use a simple ODBC database, containing only images. (For a more sophisticated approach, refer to Using ODBC to Access Image Data.)

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Make a copy of the project that you created in Loading and Displaying an Image; then load the copied project.
2. | In the Add-Ins menu, select the Data Manager...
3. | In the Data Manager Window's File menu, select New, and create an Access database named c:\lead\lead.mdb.
4. | Click the New button, and create a table with one field as follows:
 | Name: | ltvbpic
 | Field Name: | photo
 | Data Type: | long binary
5. | Add the following LEAD Raster objects to your project,
 | a. LEADRasterODBC Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
 | b. LEADRasterProcess Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
6. | Add the following statment to your public section:

Public RasterODBC As New LEADRasterODBC

7. | Exit the Data Manager.
8. | Open the ODBC administrator and click the Add button.
9. | Select Microsoft Access driver and click the OK button.
10. | Enter the name LEADACCESS.
11. | Click the Select directory button and select the LEAD directory.
12. | Click the OK button; click the next OK button; then click the Close button.
13. | In C++ Builder, replace the code in the main form's init procedure as follows:

'Position and size the main form so that it takes up most of the screen.
Width = Screen.Width * 0.9
Height = Screen.Height * 0.8
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
' Set the position and size of the LEAD control.
' Allow for a border of 1/8 of the form size.
' The units of measure do not matter, since we are calculating proportions.
HeightAllowed = ScaleHeight * 3 / 4
WidthAllowed = ScaleWidth * 3 / 4
LEADRasterView1.Left = (ScaleWidth - WidthAllowed) / 2
LEADRasterView1.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = HeightAllowed
'Turn off automatic repainting and turn on scroll bars.
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = True
'Set the image display size to match the LEADRasterView control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
' Open the database.
RasterODBC.Raster = LEADRasterView1.Raster
DString = "ODBC;DSN=LEADACCESS"
RasterODBC.dbOpen DString, "ltvbpic", "photo", DB_OPENOPTIONS_NONE
RasterODBC.dbLoadBits = 24
RasterODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
LEADRasterView1.ForceRepaint
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
End If

14. | Add a common dialog control to your main form and name it Commdlg.
15. | At the top of your main form, add seven command buttons and name them as follows: Add, Update, Delete, FirstRec, NextRec, PrevRec, and LastRec.
16. | For the Add button, add the following code to the click procedure:

Dim RasterIO As New LEADRasterIO
If RasterODBC.dbCanAppend
 = False Then
msg = "You cannot add to this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbAddNew
CommDlg.Filter = "All Files|*.*"
CommDlg.Flags = cdlOFNFileMustExist
CommDlg.DialogTitle = "Open File"
CommDlg.CancelError = True
CommDlg.ShowOpen
filename = CommDlg.filename
RasterIO.Load LEADRasterView1.Raster, filename, 0, 0, 1
RasterODBC.Raster = LEADRasterView1.Raster
nret = RasterODBC.dbUpdate(FILE_CMP,
 0, QFACTOR_QMS)
If nret <> 0 Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbMoveLast
LEADRasterView1.ForceRepaint
msg = "Image added to the database."
answer = MsgBox(msg, 0, "LEAD")
NextRec.Enabled = True
PrevRec.Enabled = True
If RasterODBC.dbIsBOF = True
 Then
PrevRec.Enabled = False
Else
PrevRec.Enabled = True
End If
If RasterODBC.dbIsEOF = True
 Then
NextRec.Enabled = False
Else
NextRec.Enabled = True
End If
End If
End If

17.

For the Update button, add the following code to the click procedure:

Dim RasterProc As New LEADRasterProcess
If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
If RasterODBC.dbEditMode = DB_EDITMODE_NONE Then
RasterODBC.dbEdit
RasterProc.Flip LEADRasterView1.Raster
LEADRasterView1.ForceRepaint
End If
RasterODBC.dbUpdate FILE_CMP, 0, QFACTOR_QMS
End If

18.

For the Delete button, add the following code to the click procedure:

If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbDelete
RasterODBC.dbRequery
RasterODBC.dbMoveFirst
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
PrevRec.Enabled = False
End If
LEADRasterView1.ForceRepaint
End If

19.

For the First button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveFirst
PrevRec.Enabled = False
NextRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

20.

For the Next button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMoveNext
If RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
RasterODBC.dbMovePrev
msg = "Already at last record."
answer = MsgBox(msg, 0, "Notice")
Else
PrevRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

21.

For the Prev button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMovePrev
If RasterODBC.dbIsBOF = True Then
PrevRec.Enabled = False
RasterODBC.dbMoveNext
msg = "Already at first record."
answer = MsgBox(msg, 0, "Notice")
Else
NextRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

22.

For the Last button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveLast
NextRec.Enabled = False
PrevRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

23.

Update the main form's unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
RasterODBC.dbClose
End Sub

24.

Run your program to test it.


Oilify example for C++ Builder

This example applies an oil-painting effect and repaints the image. The progress event is enabled because this Oilify method, with a neighborhood of 10, is slow.

LEADRasterProcess * pRasterProc= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//.....
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
pRasterProc->EnableProgressEvent = True;
pRasterProc->Oilify (LEADRasterView1->Raster, 10);
LEADRasterView1->ForceRepaint ();
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//.....
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
pRasterProc->EnableProgressEvent = True;
pRasterProc->Oilify (LEADRasterView1->Raster, 10);
LEADRasterView1->ForceRepaint ();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_PROGRESSSTATUS:
{
int iPercent= (OleVariant)(Params.rgvarg[0]);
Caption= IntToStr(iPercent);
}
break;
}
}


OLEDropAllowed example for C++ Builder

This example toggles the OLEDropAllowed property.

LEADRasterView1->OleDropAllowed= !LEADRasterView1->OleDropAllowed ;


OLEDropFile example for C++ Builder

This example displays the name of the file that was dropped, and then loads it.

void __fastcall TForm1::LEADRasterView1OleDropFile(TObject *Sender,
BSTR pszName)
{
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//when a file is dropped, bring up a dialog box and ask the user
//whether to load the file or not
if (MessageBox (Handle, (char*)pszName, "", MB_YESNO) == IDYES)
pRasterIO->Load (LEADRasterView1->Raster, pszName, 0, 1, 1);
else
ShowMessage ("File Not Loaded!");
pRasterIO-> Release( );
}


Paint event example for C++ Builder

This example uses some Windows API functions to demonstrate the following:

Paint event

Click event

Enabled property

Window property

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add these variables for MyRect and MyPoint to Unit1.h private section:

RECT MyRect;

3. | Add a button to your form and name it as follows:
 | Name | Caption
 | Toggle | Toggle.
4. | Add an Edit box to the top of your form, and name it as follows:
 | Name | Text
 | Directions | Use the Toggle button to turn on or turn off Click-Splat.
5. | Code the Toggle button's Click procedure as the following, This code uses the Enabled property to toggle the LEAD RasterView control's ability to respond to click events.

void __fastcall TForm1::ToggleClick(TObject *Sender)
{
if (LEADRasterView1->Enabled
 == false)
{
LEADRasterView1->Enabled= true;
Directions->Text= "Click on the image for a splat";
Toggle->Caption= "Disable";
}
else
{
LEADRasterView1->Enabled = false;
Directions->Text= "Click does nothing";
Toggle->Caption= "Enable";
}
}

6.

Code the LEADRasterView1 Click procedure as the following. When the Enabled property is true, this code uses a Windows API call to generate a paint event.

void __fastcall TForm1::LEADRasterView1Click(TObject
 *Sender)
{
HWND hCtl;
RasterScaleModeConstants SavedMode;

// Use pixels for API calls
SavedMode = (RasterScaleModeConstants)LEADRasterView1->ScaleMode;
LEADRasterView1->ScaleMode
 = 3; //Pixels
// Use InvalidateRect to generate a paint message
MyRect.left = 0;
MyRect.top = 0;
MyRect.bottom = LEADRasterView1->ScaleHeight;
MyRect.right = LEADRasterView1->ScaleWidth;
hCtl = (HWND)LEADRasterView1->Window_;
InvalidateRect (hCtl, &MyRect, True);
// Set the ScaleMode back to the default
LEADRasterView1->ScaleMode = SavedMode;
}

7.

Code the LEADRasterView1 Paint procedure as the following. It uses Windows GDI functions to draw random lines on the control whenever there is a paint event.

void __fastcall TForm1::LEADRasterView1Paint(TObject
 *Sender, long hDC)
{
HDC LeadClientDC;
int xStart;
int yStart;
int xDelta;
int yDelta;
int xEnd;
int yEnd;
short i;

srand((unsigned) time(NULL));

// Create a device context for the control that the GDI functions can access
LeadClientDC = (HDC)LEADRasterView1->GetClientDC
 ();
// Draw random lines on the control. This overlay does not affect the bitmap.

xStart = (int)((rand() * (int)LEADRasterView1->ScaleWidth
 / RAND_MAX) + 1);
yStart = (int)((rand() * (int)LEADRasterView1->ScaleHeight
 / RAND_MAX) + 1);
MoveToEx(LeadClientDC, xStart, yStart, NULL);
for (i = 1; i <=50; i ++)
{
xDelta = (int)(81L * rand()/ RAND_MAX) - 40;
yDelta = (int)(81L * rand()/ RAND_MAX) - 40;
xEnd = xStart + xDelta;
yEnd = yStart + yDelta;
LineTo(LeadClientDC, xEnd, yEnd);
MoveToEx(LeadClientDC, xStart, yStart, NULL);
}
// Remove the lock from the device control
LEADRasterView1->ReleaseClientDC
 ();
}

8.

Run your program to test it.


PaintContrast example for C++ Builder

This example increases the contrast for painting images.

LEADRasterView1->PaintContrast = (short)(LEADRasterView1->PaintContrast + 100);
LEADRasterView1->ForceRepaint ();


PaintDither example for C++ Builder

This example turns on error diffusion and redisplays the bitmap.

LEADRasterView1->PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1->ForceRepaint ();


PaintEffect example for C++ Builder

The following modules use the KeyDown and KeyUp events to repaint the image with effects.

#include "L_ComEfx.h"

void __fastcall TForm1::LEADRasterView1KeyDown(TObject *Sender,
short KeyCode, short Shift)
{
if (KeyCode == 116) //Code for F5
{
LEADRasterView1->AutoRepaint = False;
LEADRasterView1->BackErase = True;
LEADRasterView1->EffectGrain = 20;
LEADRasterView1->EffectDelay = 50;
LEADRasterView1->WandSize = 5;
LEADRasterView1->WandColor = (TColor)RGB(255,255,0); //Yellow Wand
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_L_TO_R;
LEADRasterView1->ForceRepaint ();
}
}

void __fastcall TForm1::LEADRasterView1KeyUp(TObject *Sender, short KeyCode,
short Shift)
{
if (KeyCode == 116) //Code for F5
{
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_R_TO_L;
LEADRasterView1->ForceRepaint();
LEADRasterView1->PaintEffect = EFX_EFFECT_NONE;
}
}


PaintEffectMaxPasses example for C++ Builder

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->AutoRepaint = False;
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
LEADRasterView1->PaintEffectMaxPasses = 5; //5 total passes
LEADRasterView1->PaintEffectPass = 1; //Start with pass number 1
LEADRasterView1->PaintNotificationDelay = 200; //Delay 200 milliseconds between passes
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\240bit.bmp"), 0, 0, 1);//Load the image
LEADRasterView1->AutoRepaint= True;

pRasterIO-> Release( );

void __fastcall TForm1::LEADRasterView1PaintNotification(TObject *Sender,
short uPass, short uType)
{
//If the first pass is complete
if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0))
{
//Toggle the effect from left_to_right to right_to_left
if (LEADRasterView1->PaintEffect == EFX_EFFECT_WIPE_RECTANGLE_IN)
LEADRasterView1->PaintEffect= EFX_EFFECT_WIPE_RECTANGLE_OUT;
else
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN;
}
}


PaintGamma example for C++ Builder

This example increases the gamma correction for painting images.

LEADRasterView1->PaintGamma = (short)(LEADRasterView1->PaintGamma + 100);
LEADRasterView1->ForceRepaint ();


PaintIntensity example for C++ Builder

This example increases the intensity for painting images.

LEADRasterView1->PaintIntensity = (short)(LEADRasterView1->PaintIntensity+ 100);
LEADRasterView1->ForceRepaint ();


PaintPalette example for C++ Builder

This example sets the paint palette to the palette of each Lead control. It then loads two images and dithers them to 8 bits per pixel with optimized palettes, and displays them side by side. In 8-bit display mode, you can see the palette problems that result when you do not use a fixed palette.

float HeightFactor1;
float WidthFactor1;
float HeightFactor2;
float WidthFactor2;
float HeightAllowed;
float WidthAllowed;
LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

LEADRasterView1->PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView2->PaintPalette = PAINTPALETTE_AUTO;
//Disable automatic repainting of the image->
LEADRasterView1->AutoRepaint = False;
LEADRasterView2->AutoRepaint = False;
//Turn off scroll bars to make sure we use the full client area->
LEADRasterView1->AutoScroll = False;
LEADRasterView2->AutoScroll = False;
//Clear the bitmaps from memory
LEADRasterView1->Raster->Bitmap = 0;
LEADRasterView2->Raster->Bitmap = 0;
Cursor= crHourGlass;
//Load the bitmaps-> These hard-coded path names may be different on your system->
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\24bit.bmp"), 0, 0, 1);
pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("v:\\images\\24bit2.bmp"), 0, 0, 1);
//Change the bitmaps to 8 BPS with optimized palettes
pRasterProc->ColorRes (LEADRasterView1->Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
pRasterProc->ColorRes (LEADRasterView2->Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
//Make the controls visible so that we can size and position them->
//They will not really appear until we load an image and paint it->
LEADRasterView1->Visible = True;
LEADRasterView2->Visible = True;
//Set the variables used for preserving the aspect ratio->
HeightFactor1 = LEADRasterView1->Raster->BitmapHeight;
WidthFactor1 = LEADRasterView1->Raster->BitmapWidth;
HeightFactor2 = LEADRasterView2->Raster->BitmapHeight;
WidthFactor2 = LEADRasterView2->Raster->BitmapWidth;
HeightAllowed = Height * 0.8;
WidthAllowed = Width * 0.45;
//Center each LEAD control on half of the form, preserving the aspect ratio->
//Check to see if using the maximum width will make the image too tall->
//Set the dimensions based on the result->
if ((WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed)
{
LEADRasterView1->Left = (Width / 4) - (WidthAllowed / 2);
LEADRasterView1->Width= WidthAllowed;
LEADRasterView1->Height = (LEADRasterView1->Width * HeightFactor1) / WidthFactor1;
LEADRasterView1->Top = (Height - LEADRasterView1->Height) / 2;
}
else
{
LEADRasterView1->Top = (Height - HeightAllowed) / 2;
LEADRasterView1->Height = HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor1) / HeightFactor1;
LEADRasterView1->Left = (Width / 4) - (LEADRasterView1->Width / 2);
}
if ((WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed)
{
LEADRasterView2->Left = (Width * 3 / 4) - (WidthAllowed / 2);
LEADRasterView2->Width = WidthAllowed;
LEADRasterView2->Height = (LEADRasterView2->Width * HeightFactor2) / WidthFactor2;
LEADRasterView2->Top = (Height - LEADRasterView2->Height) / 2;
}
else
{
LEADRasterView2->Top = (Height - HeightAllowed) / 2;
LEADRasterView2->Height = HeightAllowed;
LEADRasterView2->Width = (LEADRasterView2->Height * WidthFactor2) / HeightFactor2;
LEADRasterView2->Left = (Width * 3 / 4) - (LEADRasterView2->Width / 2);
}
//Set the image display sizes to match the LEAD controls
LEADRasterView1->SetDstRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight);
LEADRasterView2->SetDstRect (0, 0, LEADRasterView2->ScaleWidth, LEADRasterView2->ScaleHeight);
LEADRasterView2->SetDstClipRect (0, 0, LEADRasterView2->ScaleWidth, LEADRasterView2->ScaleHeight);
//Display the images
LEADRasterView1->ForceRepaint ();
LEADRasterView2->ForceRepaint();
pRasterProc-> Release( );
pRasterIO-> Release( );

Cursor = crDefault;


PaintROP3 example for C++ Builder

This example demonstrates the PaintROP3 property.

//Add this WIN32 constant to the Declarations module
/*SRCINVERT = 6684742 */
//Use this code to paint an inverted image.
LEADRasterView1->PaintROP3 = SRCINVERT;
LEADRasterView1->ForceRepaint ();


PaintScaling Example for C++ Builder

//This example sets the display to use bilinear interpolation
LEADRasterView1->PaintScaling = PAINTSCALING_RESAMPLE;


PaintSizeMode Example for C++ Builder

This example shows how to set the PaintSizeMode property so that the control uses only a vertical scroll bar.

LEADRasterView1->AutoScroll = True;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FITSIDES;
LEADRasterView1->ForceRepaint ();


PaintSizeUseDPI example for C++ Builder

This example toggles the PaintSizeUseDPI property.

LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_NORMAL;
LEADRasterView1->PaintSizeUseDPI= !LEADRasterView1->PaintSizeUseDPI;


PaintTransitionMaxPasses example for C++ Builder

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

LEADRasterView1->AutoRepaint = False;
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
LEADRasterView1->EffectDelay = 100;
LEADRasterView1->PaintTransitionMaxPasses = 5; //5 total passes
LEADRasterView1->PaintTransitionPass = 1; //Start with pass number 1
LEADRasterView1->PaintNotificationDelay = 200 ;//Delay 200 milliseconds between passes
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\240bit.bmp"), 0, 0, 1 );//Load the image
LEADRasterView1->AutoRepaint = True;

pRasterIO-> Release( );
void __fastcall TForm1::LEADRasterView1PaintNotification(TObject *Sender,
short uPass, short uType)
{
//If the first pass is complete
if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0))
{
//Toggle the effect from left_to_right to right_to_left
if (LEADRasterView1->TransitionEffect == EFX_EFFECT_WIPE_RECTANGLE_IN)
LEADRasterView1->TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_OUT;
else
LEADRasterView1->TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_IN;
}
}


PaintWhileLoad example for C++ Builder

This example causes the LEAD RasterView control to paint the image as it loads.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

LEADRasterView1->AutoRepaint = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
LEADRasterView1->PaintWhileLoad = True;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1);
pRasterIO-> Release();


PaintZoomFactor Example for C++ Builder

This example shows how to set the PaintZoomFactor property so that image is scaled 200 percent for display.

LEADRasterView1->AutoScroll = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_ZOOM;
LEADRasterView1->PaintZoomFactor = 200;
LEADRasterView1->ForceRepaint ();


PatternStyle (ILEADRasterFXD) example for C++ Builder

LEADRasterFXD* pRasterFxd= NULL;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);

LEADRasterView1->AutoRepaint = False;
//Load an image for the main control
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Image1.cmp"), 0, 0, 1);
//Shape background
pRasterFxd->ShapeBackgroundStyle = FXD_BACKSTYLE_OPAQUE;
pRasterFxd->PatternStyle = FXD_PATTERN_CROSS;
pRasterFxd->PatternBackColor = RGB(255, 0, 0);//red
pRasterFxd->PatternForeColor = RGB(0, 0, 255); //blue
//Shape location
pRasterFxd->ShapeTop = 50;
pRasterFxd->ShapeLeft = 50;
pRasterFxd->ShapeWidth = LEADRasterView1->DstWidth - 50;
pRasterFxd->ShapeHeight = LEADRasterView1->DstHeight - 50;
//Make the shape a permanent part of the bitmap
pRasterFxd->DrawPersistence = True;
pRasterFxd->DstLeft = 0;
pRasterFxd->DstTop = 0;
pRasterFxd->DstRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->DstBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->SrcLeft = 0;
pRasterFxd->SrcTop = 0;
pRasterFxd->SrcRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->SrcBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->ScaleMode = 3;
pRasterFxd->ClientSizeX = 5;
pRasterFxd->ClientSizeY = 5;
//Draw the shape
pRasterFxd->DrawShape (LEADRasterView1->Raster, 0, FXD_SHAPE_RECTANGLE, 0);
//Repaint
LEADRasterView1->AutoRepaint = True;
pRasterFxd-> Release( );
pRasterIO-> Release( );


PatternStyle example for C++ Builder

This example paints a transition with a diagonal cross pattern.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->AutoRepaint = False;
LEADRasterView1->TransitionDelay = 50;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1);
pRasterIO-> Release( );
LEADRasterView1->TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT;
LEADRasterView1->TransitionStyle = EFX_TRANSITION_PATTERN;
LEADRasterView1->PatternStyle = EFX_PATTERN_DIAG_CROSS;
LEADRasterView1->PatternBackColor = (TColor)RGB(255, 0, 0);
LEADRasterView1->PatternForeColor = (TColor)RGB(0, 0, 255);
LEADRasterView1->AutoRepaint = True;


PCDRes example for C++ Builder

This example checks for a high-resolution image and loads it if possible.

AnsiString Msg;
AnsiString myfile;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

myfile= "v:\\images\\pcd\\_aiwanit.pcd"; //No PCD sample image is included with LEADTOOLS
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR(myfile.c_str()), 0, 0 ) ;
if (pRasterIO->get_InfoPCDRes (PCDRES_4BASE))
{
pRasterIO->PCDRes = PCDRES_4BASE;
Msg= "Loading 1024 x 1536 resolution";
}
else
{
pRasterIO->PCDRes= PCDRES_BASE;
Msg= "Loading 512 x 768 resolution";
}

ShowMessage(Msg);
Cursor= crHourGlass;
//Turn on the automatic display rectangles and the scroll bars->
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->AutoScroll = True;
//Load the file->
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR(myfile.c_str()), 0, 0, 1);
LEADRasterView1->ForceRepaint ();
pRasterIO-> Release( );
Cursor= crDefault;


PDFSaveUseDPI Example for C++ Builder

LEADRasterIO * pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
//Use image DPI when saving as PDF
pRasterIO->PDFSaveUseDPI = TRUE;
//Save image as Raster PDF with CCITT G4 compression
pRasterIO->Save (LEADRasterView1->Raster,
AnsiToOLESTR("c:\\temp\\tmp.pdf"),
FILE_RAS_PDF_G4, 1,
(QFactorConstants)1, SAVE_OVERWRITE);
pRasterIO->Release();


PDFXResolution example for C++ Builder

//This example does the following:
// 1- Changes the horizontal and vertical PDF resolutions to 150 dpi .
// 2- Sets the pixel depth to 8.
// 3- Disables both font and graphics anti-aliasing.
// 4- Forces the PDF module to use it's own installed fonts.
// 5- Loads a PDF file using the new settings.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//Unlock PDF support, you will need the actual key
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_PDF, AnsiToOLESTR("h3tHyr"));

//Set horizontal resolution
pRasterIO->PDFXResolution = 150;
//Set vertial resolution
pRasterIO->PDFYResolution = 150;
//Set Display depth
pRasterIO->PDFDisplayDepth = 8;
//No font anti-aliasing
pRasterIO->PDFTextAlpha = 1;
//No graphics anti-aliasing
pRasterIO->PDFGraphicsAlpha = 1;
//Use fonts installed by the PDF module
pRasterIO->PDFUseLibFonts = True;
//Load the PDF file
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\Test.pdf"), 0, 0, -1);
pRasterIO-> Release( );


Picturize example for C++ Builder

// replace the current image in the main control with an image created
// from all the images present in c:\images. Resize all images present in that directory
// to 8x8 pixels and load them all in memory before proceeding

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

LEADRasterView1->ScaleMode = 3;
pRasterProc->Picturize ( LEADRasterView1->Raster, AnsiToOLESTR("d:\\erase\\images"),
(PicturizeConstants)(PICTURIZE_LOADALL | PICTURIZE_RESIZE),
8,
8);

pRasterProc->Release();


Pixel example for C++ Builder

This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

long xycolor;
float xfraction;
float yfraction;
long xPixel;
long yPixel;

//Translate mouse coordinates to fractions of the destination width and height.
LEADRasterView1->BackErase = False;
xfraction= (x - LEADRasterView1->DstLeft) / LEADRasterView1->DstWidth;
yfraction= (y - LEADRasterView1->DstTop) / LEADRasterView1->DstHeight;
//convert fractions to bitmap pixel coordinates.
xPixel= (LEADRasterView1->SrcWidth * xfraction) + LEADRasterView1->SrcLeft;
yPixel= (LEADRasterView1->SrcHeight * yfraction) + LEADRasterView1->SrcTop;
//Make the whole line the same color as the pixel.
xycolor= LEADRasterView1->Raster ->get_Pixel(xPixel, yPixel);
for (xPixel= 0; xPixel < LEADRasterView1->Raster->BitmapWidth; xPixel ++)
LEADRasterView1->Raster->set_Pixel (xPixel, yPixel, xycolor);
LEADRasterView1->ForceRepaint ();


Posterize example for C++ Builder

This example applies a six-color poster effect and redisplays the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Posterize (LEADRasterView1->Raster, 6);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


PreferredLoadFormat Example for C++ Builder

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->PreferredLoadFormat = FILE_CMP;
//....... load a file

pRasterIO-> Release( );


PreLoadFilters Example for C++ Builder

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//preload the BMP, PCX, FAX, and TIFF filters,
//and allow 1 filter to be cached, while always
//keeping 3 loaded.
pRasterIO->PreLoadFilters (3, 1, AnsiToOLESTR("BMP,PCX,FAX,TIF"));
//..... load an image

pRasterIO-> Release( );


PrinterScaleHeight Example for C++ Builder

long h_dc;
ShowMessage("Width: " + IntToStr((int)LEADRasterView1->PrinterScaleWidth)
+ " Height: " + IntToStr((int)LEADRasterView1->PrinterScaleHeight));
h_dc= LEADRasterView1->PrintStart ();
//print 1/4 of the printable region
LEADRasterView1->Render (h_dc, 0, 0,
LEADRasterView1->PrinterScaleWidth / 4,
LEADRasterView1->PrinterScaleHeight / 4);
LEADRasterView1->PrintEnd (h_dc);


PrintNewPage Example for C++ Builder

float HeightFactor, WidthFactor, HeightAllowed, WidthAllowed;
float ControlWidth, ControlHeight;
long MyPrinter;
LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//change this to a file on your system
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\babe.cmp"), 0, 1, 1);

//note, there will be no samples for other platforms, this function is not necessary in other languages):
//Set the variables used for preserving the aspect ratio->
HeightFactor= LEADRasterView1->Raster->BitmapHeight;
WidthFactor= LEADRasterView1->Raster->BitmapWidth;
//Allow a maximum of 3x3 inches on a 300dpi printer
HeightAllowed= 900;
WidthAllowed= 900;
//Print the LEAD control, preserving the aspect ratio->
//Check to see if was using the maximum width will make the image too tall->
//Set the dimensions based on the result->
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed )
{
ControlWidth= WidthAllowed;
ControlHeight= (ControlWidth * HeightFactor) / WidthFactor;
}
else
{
ControlHeight= HeightAllowed;
ControlWidth= (ControlHeight * WidthFactor) / HeightFactor;
}
//start the print job
MyPrinter= LEADRasterView1->PrintStart ();
LEADRasterView1->Render (MyPrinter, 0, 0, ControlWidth, ControlHeight);
//flip the image
pRasterProc->Flip (LEADRasterView1->Raster);
//start a new page
LEADRasterView1->PrintNewPage (MyPrinter);
//print the flipped image
LEADRasterView1->Render (MyPrinter, 0, 0, ControlWidth, ControlHeight);
//end the print job
LEADRasterView1->PrintEnd (MyPrinter);
pRasterProc-> Release( );
pRasterIO-> Release( );


ProgressivePasses Example for C++ Builder

This example shows how to save and load a progressive file.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//Save the current image as a progressive JPEG file.
pRasterIO->ProgressivePasses = 8;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\TMP.jpg"),
FILE_JFIF, 24,
(QFactorConstants)200, SAVE_OVERWRITE);
//Set properties to show progressive paints when we load->
LEADRasterView1->PaintWhileLoad = True;
//Load the file we just saved->
pRasterIO->ProgressivePasses= PROGRESSIVEPASSES_WHEN_MEANINGFUL;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\TMP.jpg"), 0, 0, 1);

pRasterIO-> Release();


RasterizeViewMode Example for C++ Builder

// This example will set current viewport mode to L2D_USE_WIDTH_AND_HEIGHT,
// sets the current viewport size to 400*400 pixels and then loads a DXF file
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->Raster->UnlockSupport ( L_SUPPORT_VECTOR_DXF, AnsiToOLESTR("TestKey") ) ;

//Set viewport mode to L2D_USE_WIDTH_HEIGHT
pRasterIO->RasterizeViewMode = L2D_USE_WIDTH_HEIGHT;
//Set viewport size to 400*400 pixels
pRasterIO->RasterizeViewportWidth = 400;
pRasterIO->RasterizeViewportHeight = 400;
//Load a DXF file
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Test.dxf"), 0, 0, 1);
pRasterIO-> Release();


RawLoad Example for C++ Builder

/*This example loads RAW data into a LEAD control
Raw data parameters are set in the LoadInfo event, which gets called
when the file format is FILE_RAW, or any unrecognized file format
The LoadInfo event obtains information through global variables*/

LEADRasterIO* pRasterIO;
//Global variables used in the LoadInfo event
int nWidth; //width of image
int nHeight; //height of image
int nBitsPerPixel; // bits per pixel of image--if palettized, a gray palette is generated
int nViewPerspective; //view perspective of raw data (TOP_LEFT, BOTTOM_LEFT, etc)
int bOrderBGR; //TRUE if order BGR, FALSE if order RGB
int nOffset; //offset into file where raw data begins
bool bPadding; //TRUE if each line of data is padded to four bytes
bool bReverseBits; //TRUE if the bits of each byte are reversed

void TForm1::LoadRawData(AnsiString szFileName)
{
int nRet;

//Fill in the values of the global variables
//The global variables will get access in the LoadInfo event
nWidth= 294;
nHeight= 415;
nBitsPerPixel = 24;
nViewPerspective = BOTTOM_LEFT;
bOrderBGR = True;
nOffset = 100;
bPadding = True;
bReverseBits = True;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADEventSink1->Connect (pRasterIO, DIID__LEADRasterIOEvents);
nRet = pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR(szFileName.c_str()), (short)nBitsPerPixel, 0, 1);
if (nRet == 0)
ShowMessage ("SUCCESS file load: " + szFileName);
else
ShowMessage ("FAILED--file load: " + szFileName);
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterIO)
pRasterIO->Release();
}

void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{

switch (DispID)
{
case LEADRASTERIOEVENTS_LOADINFO:
{
int nColors;
int i;
int nGray;

pRasterIO->LoadInfoFormat = FILE_RAW;
pRasterIO->LoadInfoWidth = nWidth;
pRasterIO->LoadInfoHeight = nHeight;
pRasterIO->LoadInfoBits = (short)nBitsPerPixel;
pRasterIO->LoadInfoXRes = 150;
pRasterIO->LoadInfoYRes = 150;
pRasterIO->LoadInfoOffset = nOffset;
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)0;

if (bPadding)
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_PAD4);

if (bOrderBGR == False)
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_ORDERRGB);

if (bReverseBits)
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_LSB);

switch (nViewPerspective)
{
case TOP_LEFT:
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_TOPLEFT);
break;

case BOTTOM_LEFT:
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_REVERSE);
break;

case TOP_RIGHT: //BOTTOM_LEFT180
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_BOTTOMLEFT180);
break;

case BOTTOM_RIGHT: //TOP_LEFT180
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_TOPLEFT180);
break;

case RIGHT_TOP: //TOP_LEFT90
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_TOPLEFT90);
break;

case LEFT_BOTTOM: //TOP_LEFT270
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_TOPLEFT270);
break;

case LEFT_TOP: //BOTTOM_LEFT90
pRasterIO->LoadInfoFlags =(LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_BOTTOMLEFT90);
break;

case RIGHT_BOTTOM: //BOTTOM_LEFT270
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_BOTTOMLEFT270);
break;
}

//if image is palettized create a grayscale palette
if (nBitsPerPixel <= 8)
{
nColors = pow(2, nBitsPerPixel);
pRasterIO->LoadInfoFlags = (LoadInfoFlagConstants)(pRasterIO->LoadInfoFlags + LOADINFO_PALETTE);

for (i = 0; i < nColors; i ++)
{
nGray = (i * 256) / nColors;
pRasterIO->set_IOPalette ((short)i, (TColor)RGB(nGray, nGray, nGray));
}
}
}
}
}


RawSave Example for C++ Builder

//This example saves a LEAD bitmap as RAW data starting at offset uOffset
//The data is padded so that each line of bytes is evenly divides 4
//The bits in each byte are reversed before saving
//The Bits per pixel of the raw data is the same as the bits per pixel of pBitmap
//If pBitmap is a palettized image, the palette is not saved--only the raw data

// This example considers that you added this methos to the Form’s private section.

void TForm1::SaveRawData (AnsiString szFileName, long uOffset)
{
int nRet;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->SaveLSB = True;
pRasterIO->SavePad4 = True;
nRet= pRasterIO->SaveOffset (LEADRasterView1->Raster, AnsiToOLESTR(szFileName.c_str()), uOffset, (RasterFileConstants)FILE_RAW, 0, (QFactorConstants)0, 0);
if (nRet == 0)
ShowMessage ("SUCCESS file save: " + szFileName + " Size Written: " + IntToStr((int)pRasterIO->FileSizeWritten));
else
ShowMessage ("FAILED--file save: " + szFileName);
pRasterIO-> Release( );
}


ReadLoadResolutions Example for C++ Builder

This example shows how to use the methods and properties for FlashPix files.

AnsiString TempStr, InfoStr; //For composing message strings
short i; //Loop counter
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//Initialize the display
LEADRasterView1->AutoScroll = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
pRasterIO->GetFileInfo ( LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image5.fpx"), 0, 0 ) ;
//Update information about the available resolutions.
pRasterIO->ReadLoadResolutions ( AnsiToOLESTR("v:\\images\\image5.fpx") ) ;
//Display a message box that shows the available sizes.
InfoStr = "Available dimensions:\n";
for (i = 0; i < pRasterIO->LoadResolutionCount; i ++)
{
TempStr= IntToStr((int)pRasterIO->get_LoadResolutionWidth(i)) + " X " +
IntToStr((int)pRasterIO->get_LoadResolutionWidth (i)) + "\n";
InfoStr= InfoStr + TempStr;
}
ShowMessage (InfoStr);
// Set the size to load, the smallest size in this case
pRasterIO->SetLoadResolution (LEADRasterView1->Raster,
pRasterIO->InfoFormat,
pRasterIO->get_LoadResolutionWidth(0),
pRasterIO->get_LoadResolutionHeight (0));
//Get the dimensions that we just set and display them
pRasterIO->GetLoadResolution (pRasterIO->InfoFormat);
InfoStr = "Size that will be loaded:\n\n" ;
TempStr = IntToStr((int)pRasterIO->get_LoadResolutionWidth(0)) +
" X " + IntToStr ((int)pRasterIO->get_LoadResolutionWidth(0)) + "\n";
InfoStr = InfoStr + TempStr;
ShowMessage (InfoStr);
//Load the bitmap, keeping the bits per pixel of the file->
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image5.fpx"), 0, 0, 1);
pRasterIO-> Release( );


ReadyState Example for C++ Builder

This example shows how to use the ReadyState property to test whether an asynchronous load is in progress.

if (pRasterIO->ReadyState == RASTER_READYSTATE_LOADING)
ShowMessage ("Still loading the image");


RefBitmap example for C++ Builder

//This example demonstrates the RefBitmap property
LEADRaster * pRaster= NULL;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);

//Load an image into pRaster object
pRasterIO->Load (pRaster, AnsiToOLESTR("v:\\images\\Test.bmp"), 0, 0, 1);
ShowMessage ("pRaster->Bitmap should be non-zero: " + IntToStr((int)pRaster->Bitmap));

//Have the LEADRasterView1 control "steal" the pRaster bitmap
LEADRasterView1->Raster->RefBitmap = True;
LEADRasterView1->Raster->Bitmap= pRaster->Bitmap;

//The pRaster Bitmap has been invalidated
ShowMessage ("pRaster->Bitmap should be zero: " + IntToStr((int)pRaster->Bitmap));

pRaster-> Release( );
pRasterIO-> Release( );


RefBitmapList example for C++ Builder

//Tell LEADRasterView2 to "steal" the bitmap list from LEADRasterView1
LEADRasterView2->Raster->RefBitmap List= True;
//move the bitmap list from LEADRasterView1 to LEADRasterView2
LEADRasterView2->Raster->BitmapList = LEADRasterView1->Raster->BitmapList;
//restore the default value for RefBitmapList
LEADRasterView2->Raster->RefBitmapList = False;
//for safety, let LEADrasterview1 know that its list has been emptied
LEADRasterView1->Raster->BitmapList= 0;


RemapHue example for C++ Builder

// This example changes all green hues (and hues near green) to the hue of crNewColor
short Increment (short x)
{
return ((short)((x + 1) % 256));
}

short Decrement(short x)
{
return ((short)((x + 255) % 256));
}

short Add(short x, short y)
{
return ((short)((x + y) % 256));
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
short i;
short nHueGreen;
short nHueNewColor;
short nHueChange;
::OLE_COLOR crNewColor;
short iCount;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

for (i= 0; i < 256; i++)
{
pRasterProc->set_MaskTable (i, 0);
pRasterProc->set_HTable (i, i);
}

//Get the hue for green
nHueGreen= pRasterProc->HSV_HfromRGB (RGB(0, 255, 0));

//Obtain new hue (crNewColor can be any color)
crNewColor= RGB(255, 255, 0);
nHueNewColor= pRasterProc->HSV_HfromRGB(crNewColor);
nHueChange= (short)(nHueNewColor - nHueGreen);

if (nHueChange < 0)
nHueChange= (short)(nHueChange + 256);

//Set values in uHueTable, uMaskTable
pRasterProc->set_HTable (nHueGreen, Add(pRasterProc->get_HTable(nHueGreen), nHueChange));
pRasterProc->set_MaskTable(nHueGreen, 1);

//set the hues near green (+/- 10)
iCount= 0;
i= Increment(nHueGreen);
while (iCount < 10)
{
pRasterProc->set_HTable(i, Add(pRasterProc->get_HTable(i), nHueChange));
pRasterProc->set_MaskTable (i, 1);
i= Increment(i);
iCount= (short)(iCount + 1);
}

iCount= 0;
i= Decrement(nHueGreen);
while (iCount < 10)
{
pRasterProc->set_HTable (i, Add(pRasterProc->get_HTable(i), nHueChange));
pRasterProc->set_MaskTable(i, 1);
i= Decrement(i);
iCount= (short)(iCount + 1);
}

pRasterProc->RemapHue (LEADRasterView1->Raster, True, True, False, False);
pRasterProc-> Release( );

}


Resize event example for C++ Builder

This example demonstates the Resize event.

//Before using this example you must add a text box to your form.
//Then, you can exercise this example by coding a command button that
//changes the width and height of the LEADRasterView1 control
Edit1->Text= "Control size: " + IntToStr(LEADRasterView1->Width)
+ " x " + IntToStr(LEADRasterView1->Height);
Edit1->Refresh( ) ;


RGBfromHSV example for C++ Builder

//Takes an HSV, displays the HSV components, and displays the RGB components
void HSVtoRGB(short nH, short nS, short nV)
{
::OLE_COLOR cr;
Byte red;
Byte green;
Byte blue;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
cr= pRasterProc->RGBfromHSV (nH, nS, nV);
red= GetRValue(cr);
green=GetGValue(cr);
blue= GetBValue(cr);
ShowMessage ("HSV (" + IntToStr(nH) + "," + IntToStr(nS) + "," + IntToStr(nV) + ") is RGB(" + IntToStr(red) + "," + IntToStr(green) + "," + IntToStr(blue) + ")");
}


RgnChange example for C++ Builder

The following code for the RasterView RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

void __fastcall TForm1::LEADRasterView1RgnChange (TObject *Sender)
{
AnsiString MyText;

MyText= "Number of pixels in region: ";
MyText= MyText + IntToStr((int)LEADRasterView1->Raster->GetRgnArea ());
ShowMessage (MyText);
}


RgnFrameColor example for C++ Builder

LEADRasterView1->RgnFrameColor = (TColor)RGB(0, 0, 255);
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
LEADRasterView1->Raster->SetRgnRect (10, 10, 200, 200, L_RGN_SET);


Rotate example for C++ Builder

This example rotates the bitmap 45 degrees and redisplays the image. It resizes the bitmap to accommodate the rotation and uses blue as the fill color.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->Rotate (LEADRasterView1->Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 255));
LEADRasterView1->AutoSetRects = True ;//Make sure the display rectangles are adjusted
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );


Saturation example for C++ Builder

This example increases the saturation of colors in the bitmap and redisplays the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Saturation (LEADRasterView1->Raster, 1000);
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );


Save example for C++ Builder

This example saves the image as a BMP file, loads the new file, and redisplays the bitmap.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

Screen->Cursor= crHourGlass;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\tmp.bmp"),
FILE_BMP, 8, (QFactorConstants)1, SAVE_OVERWRITE);
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\tmp.bmp"), 0, 0, 1);
LEADRasterView1->ForceRepaint ();
Screen->Cursor= crDefault;
pRasterIO-> Release( );


SaveArray example for C++ Builder

long lSize;
HFILE hFile;
void HUGEP* pData=NULL;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant* pRasterVar= NULL;
AnsiString cs;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVar);

pRasterIO->Load(LEADRasterView1->Raster,
AnsiToOLESTR("c:\\chess.bmp"), 0, 1, 1);
pRasterVar= pRasterIO->SaveArray(LEADRasterView1->Raster,
FILE_BMP, 0, (QFactorConstants)0);
_lcreat("c:\\test.bmp", 0);
hFile = _lopen("c:\\temp\\test.bmp", OF_READWRITE);
lSize = pRasterVar->ItemCount;
pData= (char*)GlobalAlloc(GHND, lSize);
_lwrite(hFile, (LPCSTR)pData, lSize);
_lclose(hFile);

//get some info on the memory array
pRasterIO->GetArrayInfo(LEADRasterView1->Raster, pRasterVar, 1, lSize);

cs = "Format =" + IntToStr(pRasterIO->InfoFormat);
ShowMessage(cs);
if ( pRasterIO )
pRasterIO->Release();
if ( pRasterVar )
pRasterVar->Release();
if ( pData )
GlobalFree(pData);


SaveIFD example for C++ Builder

// This example will add 100 pages to a file faster by continuously using the IFD of the last page
int Page;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

// Save page 1, to make sure the file exists
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\test.tif"), FILE_TIF, 1, (QFactorConstants)0, SAVE_APPEND);
for (Page= 2; Page <= 100; Page ++)
{
//get the IFD of the last page
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\test.tif"), 100000, 0);
pRasterIO->SaveIFD = pRasterIO->InfoIFD;
pRasterIO->Save (LEADRasterView1->Raster,
AnsiToOLESTR("c:\\temp\\test.tif"), FILE_TIF,
1, (QFactorConstants)0, SAVE_APPEND);
}
// reset the SaveIFD property so the other Save calls will work properly
pRasterIO->SaveIFD = 0;
pRasterIO-> Release( );


SaveInterlaced example for C++ Builder

//This example saves the current image as an interlaced GIF file, then loads the saved //image with a paint-while-load effect that shows the interlaced behavior.

AnsiString szFile;
LEADRasterIO* pMyRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pMyRasterIO);

szFile= "c:\\temp\\test.gif";

//Save the current image as an interlaced GIF file.
pMyRasterIO->SaveInterlaced = True;
pMyRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR(szFile.c_str()), FILE_GIF, 8, (QFactorConstants)1, SAVE_OVERWRITE);

//Clear the bitmap so that we can see the paint-while-load effect.
LEADRasterView1->Raster->Bitmap = 0;

//Paint the image while loading, showing that it is interlaced.
LEADRasterView1->PaintWhileLoad = True;
pMyRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR(szFile.c_str()), 0, 0, 1);

pMyRasterIO-> Release( );


SaveLSB example for C++ Builder

LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

//This example saves a bitmap compatible with the requirements
//of the TIFF Class F format
//make sure we are using pixels
LEADRasterView1->ScaleMode = 3;
pRasterIO->SaveLSB = True;
pRasterIO->SavePageNumberTag = True;
LEADRasterView1->Raster->BitmapXRes = 204;
LEADRasterView1->Raster->BitmapYRes = 196;
//scale the bitmap (preserving the aspect ratio) to have a width of 1728 pixels
pRasterProc->Size (LEADRasterView1->Raster, 1728,
LEADRasterView1->Raster->BitmapHeight * 1728 /
LEADRasterView1->Raster->BitmapWidth, (ResizeConstants)0);
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\lsb.tif"),
FILE_CCITT_GROUP3_1DIM, 1, (QFactorConstants)0, SAVE_OVERWRITE);

pRasterIO-> Release( );
pRasterProc-> Release( );


SaveMemory example for C++ Builder

This example uses SaveMemory to save a bitmap to a memory-resident file, uses GetMemoryInfo to examine the file size; then uses WIN32 API calls to save the file to disk and free the memory.

long hf;
long hMem;
long iSize;
void * lpMem;
AnsiString cMsg;

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

hMem= 0;
iSize= 0;

if (pRasterIO->SaveMemory (LEADRasterView1->Raster, &hMem, FILE_CMP, 24, (QFactorConstants)-1,
SAVE_OVERWRITE, &iSize ))
{
ShowMessage("Error calling SaveMemory");
return;
}
if (pRasterIO->GetMemoryInfo (LEADRasterView1->Raster, hMem, 0, iSize))
{
GlobalFree ((HGLOBAL)hMem);
return;
}
//Ask for a confirmation to save this file
cMsg= "File info:\n" ;
cMsg= cMsg + IntToStr((int)pRasterIO->InfoWidth) + " x " + IntToStr((int)pRasterIO->InfoHeight);
cMsg= cMsg + " x " + IntToStr(pRasterIO->InfoBits) + " BPP\n" ;
cMsg= cMsg + "Size in memory: " + IntToStr((int)pRasterIO->InfoSizeMem) + "\n";
cMsg= cMsg + "Size on disk : " + IntToStr((int)pRasterIO->InfoSizeDisk);
if (MessageBox(Handle, cMsg.c_str(),"Write this file on disk ", MB_YESNO) == IDNO )
{
GlobalFree ((HGLOBAL)hMem);
return;
}
if( (lpMem = (LPSTR)GlobalLock((HGLOBAL)hMem)) == NULL )
{
GlobalFree ((HGLOBAL)hMem);
ShowMessage("Error calling GlobalLock");
return;
}
hf = FileCreate("d:\\pictures\\savemem.cmp");
if (hf == -1)
{
GlobalUnlock ((HGLOBAL)hMem);
GlobalFree ((HGLOBAL)hMem);
ShowMessage ("Error calling OpenFile");
return;
}
if (FileWrite(hf, lpMem, iSize) != iSize )
MessageDlg ("Error calling FileWrite", mtError, TMsgDlgButtons() << mbOK, 0);
else
MessageDlg ("The file was saved successfully on disk.", mtInformation, TMsgDlgButtons() << mbOK, 0);

pRasterIO-> Release( );
FileClose (hf);
GlobalUnlock ((HGLOBAL)hMem);
GlobalFree ((HGLOBAL)hMem);


SavePage example for C++ Builder

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//replace page 1 from TEST.TIF
pRasterIO->SavePage = 1;
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\TEST.TIF"),
FILE_TIF, 8, (QFactorConstants)0, SAVE_REPLACE);
pRasterIO-> Release( );


SaveResolutionCount example for C++ Builder

short i;
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//assume that our bitmap is 800 x 600
//save 3 resolutions
pRasterIO->SaveResolutionCount = 3;
pRasterIO->set_SaveResolutionWidth (0, 800);
pRasterIO->set_SaveResolutionHeight (0, 600);
pRasterIO->set_SaveResolutionWidth(1, 400);
pRasterIO->set_SaveResolutionHeight(1, 300);
pRasterIO->set_SaveResolutionWidth(2, 200);
pRasterIO->set_SaveResolutionHeight(2, 150);

//get the SaveResolution info
ShowMessage ("SaveResolutionCount = " + IntToStr(pRasterIO->SaveResolutionCount));

for (i= 0; i < pRasterIO->SaveResolutionCount; i ++)
{
ShowMessage( "SaveResolution(" + IntToStr(i) + ") = " +
IntToStr((int)pRasterIO->get_SaveResolutionWidth(i)) + " x " +
IntToStr((int)pRasterIO->get_SaveResolutionHeight(i)));
}
pRasterIO-> Release( );


SaveWithStamp example for C++ Builder

This example saves the image in a JPEG file that includes a thumbnail (stamp) image. It then loads the thumbnail from the new file.

LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

LEADRasterView1->ScaleMode = 3; // Use pixels for sizing the thumbnail
pRasterIO->SaveWithStamp (LEADRasterView1->Raster, AnsiToOLESTR("d:\\Pictures\\stamp.jpg"),
FILE_JFIF, 24, (QFactorConstants)30, 150, 100, 24);
pRasterIO->LoadStamp (LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\stamp.jpg"));
LEADRasterView1->ForceRepaint ();
pRasterIO-> Release( );


Scroll event example for C++ Builder

This example demonstrates the Scroll event.

void __fastcall TForm1::LEADRasterView1Scroll (TObject *Sender)
{
//Add a TextBox control to your form and use it for this test
Edit1->Text = "Image origin: " + IntToStr((int)LEADRasterView1->DstLeft)
+ ", " + IntToStr((int)LEADRasterView1->DstTop);
Edit1->Refresh( ) ;

}


SetRgn... example for C++ Builder

This example demonstrates the SetRgnEllipse, SetRgnRect, SetRgnRoundRect, and SetRgnPolygon methods by simulating client area coordinates. Normally, you would get the coordinates interactively from mouse events and would use Windows GDI functions to outline the shape of each region before it is created.

To create the polygonal region, this example uses the PolygonSize, PolygonX, and PolygonY properties.

Also, to demonstrate the SetRgnColor method, it uses the Fill method to fill the region with a solid color, and then uses the fill color to create a new region.

//Arrays for polygon points
int xPoint[8]={0, -1, 2, 1, 1, 2, -1, -2};
int yPoint[8]={0, -1, -1, 1, -1, 1, 1, 1};

void __fastcall TForm1::Button1Click(TObject *Sender)
{
float ZoomFactorX;//Used for translating positioning information
float ZoomFactorY;//Used for translating positioning information
float OffsetX, OffsetY, CurrentX, CurrentY;//To simulate mouse coordinates
float SimLeft, SimTop, SimWidth, SimHeight;//To simulate mouse coordinates
float LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, eW, eH;//For bitmap coordinates
short i; //Loop counter
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
//Initialize the variables that we will manipulate to simulate mouse coordinates.
LEADRasterView1->ScaleMode = 3;
OffsetX = LEADRasterView1->Raster->ScaleWidth / 15;
OffsetY = LEADRasterView1->Raster->ScaleHeight / 15;
CurrentX = OffsetX;
CurrentY = OffsetY;
//Set the zoom factors->
ZoomFactorX = LEADRasterView1->DstWidth / LEADRasterView1->SrcWidth;
ZoomFactorY = LEADRasterView1->DstHeight / LEADRasterView1->SrcHeight;
//Start by simulating the drawing of a rectangle->
SimLeft = CurrentX;
SimTop = CurrentY;
SimWidth = OffsetX * 2;
SimHeight = OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates->
LBRgnLeft = (SimLeft / ZoomFactorX) -
(LEADRasterView1->DstLeft / ZoomFactorX)
+ LEADRasterView1->SrcLeft;
LBRgnTop = (SimTop / ZoomFactorY) -
(LEADRasterView1->DstTop / ZoomFactorY)
+ LEADRasterView1->SrcTop;
LBRgnWidth = SimWidth / ZoomFactorX;
LBRgnHeight = SimHeight / ZoomFactorY;
//Create the rectangular region, outline it, and display a message so that we can see what happened->
LEADRasterView1->Raster->SetRgnRect (LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_SET);
LEADRasterView1->RgnFrameType = RGNFRAME_STATIC;
ShowMessage ("Here is the rectangular region");
//Move the current mouse position so that we overlap the existing region->
CurrentX = CurrentX + OffsetX;
CurrentY = CurrentY + OffsetY;
//Next, simulate the drawing of an ellipse->
SimLeft = CurrentX;
SimTop = CurrentY;
SimWidth = OffsetX * 3;
SimHeight = OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates->
LBRgnLeft = (SimLeft / ZoomFactorX) -
(LEADRasterView1->DstLeft / ZoomFactorX)
+ LEADRasterView1->SrcLeft;
LBRgnTop = (SimTop / ZoomFactorY) -
(LEADRasterView1->DstTop / ZoomFactorY)
+ LEADRasterView1->SrcTop;
LBRgnWidth = SimWidth / ZoomFactorX;
LBRgnHeight = SimHeight / ZoomFactorY;
//Add the elliptical region, using a Boolean OR,
//and display a message so that we can see what happened.
LEADRasterView1->Raster->SetRgnEllipse (LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_OR);
LEADRasterView1->RgnFrameType = RGNFRAME_STATIC;
ShowMessage ("Here is the added ellipse, with a Boolean OR");
//Move the current mouse position so that we overlap the existing region.
CurrentX= CurrentX + OffsetX;
CurrentY= CurrentY + OffsetY;
//Next, simulate the drawing of a rounded rectangle.
SimLeft= CurrentX;
SimTop= CurrentY;
SimWidth= OffsetX * 3;
SimHeight= OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft= (SimLeft / ZoomFactorX)
- (LEADRasterView1->DstLeft / ZoomFactorX)
+ LEADRasterView1->SrcLeft;
LBRgnTop= (SimTop / ZoomFactorY)
- (LEADRasterView1->DstTop / ZoomFactorY)
+ LEADRasterView1->SrcTop;
LBRgnWidth= SimWidth / ZoomFactorX;
LBRgnHeight= SimHeight / ZoomFactorY;
//Define an ellipse to use for the corners.
eW = LBRgnWidth / 4;
eH = LBRgnHeight / 4;
//Add the rounded rectangular region, using a Boolean exclusive OR,
//and display a message so that we can see what happened.
LEADRasterView1->Raster->SetRgnRoundRect (LBRgnLeft, LBRgnTop, LBRgnWidth,
LBRgnHeight, eW, eH, L_RGN_XOR);
ShowMessage ("Here is the rounded rectangle, with a Boolean XOR");
//Move the current mouse position so that we overlap the existing region.
CurrentX= CurrentX + (2 * OffsetX);
CurrentY= CurrentY + (2 * OffsetY);
//Initialize the polygon size using an arbitrary number.
//This number will be increased dynamically.
LEADRasterView1->Raster->PolygonSize = 5;
//Fill in the array for the polygon. This simulates a user"s mouse clicks.
for (i= 0; i< 7; i++)
{
CurrentX= CurrentX + (xPoint[i+1] * OffsetX);
CurrentY= CurrentY + (yPoint[i+1] * OffsetY);
LEADRasterView1->Raster->set_PolygonX (i, (CurrentX / ZoomFactorX)
- (LEADRasterView1->DstLeft / ZoomFactorX)
+ LEADRasterView1->SrcLeft);
LEADRasterView1->Raster->set_PolygonY (i, (CurrentY / ZoomFactorY)
- (LEADRasterView1->DstTop / ZoomFactorY)
+ LEADRasterView1->SrcTop);
if (i + 1 == LEADRasterView1->Raster->PolygonSize)
LEADRasterView1->Raster->PolygonSize= (short)(LEADRasterView1->Raster->PolygonSize + 5);
}
//Adjust the polygon size to the actual number of points.
LEADRasterView1->Raster->PolygonSize = 7;
//Add the polygonal region, using a Boolean OR,
//and display a message so that we can see what happened.
LEADRasterView1->Raster->SetRgnPolygon (L_POLY_WINDING, L_RGN_OR);
ShowMessage ("Here is the added polygon, with a Boolean OR");
//Fill the resulting polygon with red, and display a message.
pRasterProc->Fill (LEADRasterView1->Raster, RGB(255, 0, 0));
LEADRasterView1->RgnFrameType = RGNFRAME_NONE;
LEADRasterView1->ForceRepaint ();
ShowMessage ("Using SetRgnColor and L_RGN_SETNOT, all else will become blue.");
//Clean up memory
LEADRasterView1->Raster->FreeRgn ();
//Do the final region.
LEADRasterView1->Raster->SetRgnColor (RGB(255, 0, 0), L_RGN_SETNOT);
pRasterProc->Fill (LEADRasterView1->Raster, RGB(0, 0, 255));
LEADRasterView1->ForceRepaint();
//Clean up memory
LEADRasterView1->Raster->FreeRgn();
LEADRasterView1->Raster->PolygonSize = 0;

pRasterProc-> Release( );
}


SetRgnColorHSVRange example for C++ Builder

//This example sets a region corresponding to all pure green (Hue = 85)
//and colors near green (+/- 10)
//where Saturation is at least 40 and Value is at least 40
short H0;
short S0;
short V0;
short H1;
short S1;
short V1;

H0 = 75;
S0 = 40;
V0 = 40;

H1 = 95;
S1 = 255;
V1 = 255;
LEADRasterView1->Raster->SetRgnColorHSVRange (H0, S0, V0, H1, S1, V1, L_RGN_SET);
LEADRasterView1->RgnFrameType = RGNFRAME_ANIMATED;


SetRgnColorRGBRange example for C++ Builder

//This example sets a region corresponding to all colors that
//have an rgb that includes red but no green and no blue
::OLE_COLOR rgbLo;
::OLE_COLOR rgbHi;

rgbLo= RGB(1, 0, 0);
rgbHi= RGB(255, 0, 0);
LEADRasterView1->Raster->SetRgnColorRGBRange(rgbLo, rgbHi, L_RGN_SET);
LEADRasterView1->RgnFrameType = RGNFRAME_ANIMATED;


SetRgnMagicWand example for C++ Builder

void __fastcall TForm1::LEADRasterView1MouseUp (TObject *Sender,
short Button, short Shift, float x, float y)
{
LEADRasterView1->Raster->SetRgnMagicWand (x, y, 10, L_RGN_SET);
LEADRasterView1->RgnFrameType = RGNFRAME_ANIMATED;
}


SetSrcClipRect example for C++ Builder

This example crops the image by reducing the source clipping area and repaints the image.

float NewLeft, NewTop, NewWidth, NewHeight;
NewLeft = LEADRasterView1->SrcClipLeft + (LEADRasterView1->SrcClipWidth * 0.1);
NewTop = LEADRasterView1->SrcClipTop + (LEADRasterView1->SrcClipHeight * 0.1);
NewWidth = LEADRasterView1->SrcClipWidth * 0.8;
NewHeight = LEADRasterView1->SrcClipHeight * 0.8;
if ((NewWidth > 1) && (NewHeight >1))
LEADRasterView1->SetSrcClipRect (NewLeft, NewTop, NewWidth, NewHeight);
LEADRasterView1->ForceRepaint ();


SetSrcRect example for C++ Builder

This example zooms in on the image by reducing the source rectangle and repaints the image.

float NewLeft, NewTop, NewWidth, NewHeight;

NewLeft= LEADRasterView1->SrcLeft + (LEADRasterView1->SrcWidth * 0.1);
NewTop= LEADRasterView1->SrcTop + (LEADRasterView1->SrcHeight * 0.1);
NewWidth = LEADRasterView1->SrcWidth * 0.8;
NewHeight = LEADRasterView1->SrcHeight* 0.8;
if ((NewWidth > 1) && (NewHeight >1))
LEADRasterView1->SetSrcRect (NewLeft, NewTop, NewWidth, NewHeight);
LEADRasterView1->ForceRepaint ();


SetTag example for C++ Builder

LEADRasterIO * pRasterIO;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterIO)
pRasterIO-> Release( );
}

void __fastcall TForm1::SetAndReadClick(TObject *Sender)
{
long *pData;
ILEADRasterVariant * pRasterVar= NULL;
CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVar);
// create a variant containing 4 elements. Note that this
// is needed only if we use the TAG_LONG tags...

pRasterVar->ItemCount = 4;
pRasterVar->set_Type(VALUE_LONG);
pRasterVar->set_LongItemValue(0, 1);
pRasterVar->set_LongItemValue(1, 2);
pRasterVar->set_LongItemValue(2, 3);
pRasterVar->set_LongItemValue(3, 127);

pRasterIO->SetTag(32768, TAG_LONG, 4, pRasterVar);

// Write the tag. This file must already exist
pRasterIO->WriteTag(AnsiToOLESTR("c:\\Test.tif"), 1);
ReadTagClick(this);
if (pRasterVar )
pRasterVar->Release();
}

void __fastcall TForm1::ReadTagClick(TObject *Sender)
{
// read the tag back
pRasterIO->ReadTag (AnsiToOLESTR("c:\\ Test.tif"), 1, 32768L);
GetAndDisplayTag(0);
}

//This function will get a certain tag and display it according to the tag type.
void GetAndDisplayTag (long lTag)
{
int uTagType = pRasterIO->GetTagType (lTag);
long lTagCount = pRasterIO->GetTagCount (lTag);
AnsiString MsgString, Str1;
ILEADRasterVariant* pRasterVar= NULL;

pRasterVar= pRasterIO->GetTagData(lTag);

MsgString = "Type = " + IntToStr(uTagType);

Str1= "\r\nCount = " + IntToStr((int)lTagCount);
MsgString += Str1;

if(uTagType == TAG_ASCII)
{
MsgString += "\r\nData = ";
MsgString += pRasterVar->StringValue;
}
else if(uTagType == TAG_RATIONAL || uTagType == TAG_SRATIONAL)
{
long *pData;
pData= (long*)GlobalAlloc(GHND, pRasterVar->ItemCount);

for (int i= 0; i < pRasterVar->ItemCount; i ++ )
pData[i]= pRasterVar->get_ShortItemValue(i);

for(long i = 0; i < lTagCount; i++)
{
Str1= "\r\nData("+IntToStr((int)i)+")=" + IntToStr((int)pData[i*2]) + IntToStr((int)pData[i*2+1]);
MsgString += Str1;
}

GlobalFree(pData);
}
else
{
int* pData;
pData= (int*)GlobalAlloc(GHND, pRasterVar->ItemCount );
for (int i= 0; i < pRasterVar->ItemCount; i ++ )
pData[i]= pRasterVar->get_ShortItemValue(i);

for(int i = 0; i < lTagCount; i++)
{
switch(uTagType)
{
case TAG_LONG:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((unsigned long*)pData)[i]);
break;
case TAG_SLONG:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((signed long*)pData)[i]);
break;
case TAG_SHORT:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((unsigned short*)pData)[i]);
break;
case TAG_SSHORT:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((signed short*)pData)[i]);
break;
case TAG_BYTE:
case TAG_UNDEFINED:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((unsigned char*)pData)[i]);
break;
case TAG_SBYTE:
Str1= "\r\nData(" + IntToStr(i) +") = " + IntToStr((int)((signed char*)pData)[i]);
break;
case TAG_FLOAT:
Str1= "\r\nData(" + IntToStr(i) +") = " + FloatToStr((double)((float*)pData)[i]);
break;
case TAG_DOUBLE:
Str1= "\r\nData(" + IntToStr(i) +") = " + FloatToStr(((double*)pData)[i]);
break;
}
MsgString += Str1;
}
GlobalFree(pData);
}
ShowMessage (MsgString);
}


Sharpen example for C++ Builder

This example increases the sharpness of the bitmap and redisplays the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Sharpen (LEADRasterView1->Raster, 100);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Shear example for C++ Builder

This example shears the bitmap 5 degrees horizontally and redisplays the image. It uses blue as the fill color.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Shear (LEADRasterView1->Raster, 500, True, RGB(0, 0, 255));
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Smooth example for C++ Builder

LEADRasterProcess * pRasterProc= NULL;

//Create the RasterProcess object and UnlockSupport
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//.....
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));
LEADEventSink1->Connect (pRasterProc, DIID__LEADRasterProcessEvents);
//.....
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(pRasterProc)
pRasterProc->Release();
}

/*This example smooths all nicks and bumps up to 2 pixels in length
Long bumps/nicks are treated before short bumps/nicks
A LEAD region is updated to show all the changes
The Smooth Event is used to display information about bump or nick*/

void __fastcall TForm1::Button2Click(TObject *Sender)
{
int nRet;

pRasterProc->EnableDocCleanEvents = True;
pRasterProc->DocCleanSuccess = SUCCESS_REMOVE;
nRet= pRasterProc->Smooth (LEADRasterView1->Raster, 2, (SmoothFlags)(SMOOTH_SINGLE_REGION + SMOOTH_LEAD_REGION + SMOOTH_FAVOR_LONG));
if (nRet == 0)
LEADRasterView1->RgnFrameType = RGNFRAME_COLOR;
}
void __fastcall TForm1:: LEADEventSink1Invoke(TObject *Sender, int DispID,
const TGUID &IID, int LocaleID, WORD Flags, tagDISPPARAMS &Params,
Pointer varResult, Pointer ExcepInfo, Pointer ArgErr)
{
switch (DispID)
{
case LEADRASTERPROCESSEVENTS_SMOOTH:
{
int nBumpOrNick;
float fStartRow;
float fStartCol;
float fLength;
int uHorV;
char * szType;
char * szHorV;
char szTemp[256];

nBumpOrNick= OleVariant(Params.rgvarg[4]);
fStartRow= OleVariant(Params.rgvarg[3]);
fStartCol= OleVariant(Params.rgvarg[2]);
fLength= OleVariant(Params.rgvarg[1]);
uHorV= OleVariant(Params.rgvarg[0]);;
if (nBumpOrNick == SMOOTH_BUMP)
szType = "Bump";
else
szType= "Nick";

if (uHorV == SMOOTH_HORIZONTAL_ELEMENT)
szHorV = "Horz.";

else
szHorV= "Vert.";

sprintf(szTemp,"Fount %s at %f,%f Length %f - %s",
szType,fStartRow,fStartCol,fLength,szHorV);

OutputDebugString(szTemp);

}
break;
}
}


Solarize example for C++ Builder

This example applies a solarize effect and repaints the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Solarize (LEADRasterView1->Raster, 100);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


SpatialFilter example for C++ Builder

This example applies Laplacian line detection and redisplays the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->SpatialFilter (LEADRasterView1->Raster, FLT_LAPLACE_1);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Src... example for C++ Builder

This example uses the source rectangle properties to zoom in on the image.

//Calculate the values to zoom in by 10 percent and center the image.
if ((LEADRasterView1->SrcWidth > 1) && (LEADRasterView1->SrcHeight > 1))
{
LEADRasterView1->SrcWidth= LEADRasterView1->SrcWidth * 0.9;
LEADRasterView1->SrcHeight= LEADRasterView1->SrcHeight * 0.9;
LEADRasterView1->SrcTop = (LEADRasterView1->Raster->BitmapHeight - LEADRasterView1->SrcHeight) / 2;
LEADRasterView1->SrcLeft = (LEADRasterView1->Raster->BitmapWidth - LEADRasterView1->SrcWidth) / 2;
}
//Set the clipping area to the same as the source rectangle
LEADRasterView1->SrcClipWidth = LEADRasterView1->SrcWidth;
LEADRasterView1->SrcClipHeight = LEADRasterView1->SrcHeight;
LEADRasterView1->SrcClipTop = LEADRasterView1->SrcTop;
LEADRasterView1->SrcClipLeft = LEADRasterView1->SrcLeft;
//Redisplay the image
LEADRasterView1->ForceRepaint ();


STable example for C++ Builder

//This example remaps the saturation of each color to one half its original
short i;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

for (i= 0; i<= 255; i ++)
pRasterProc->set_STable (i, i / 2);

pRasterProc->RemapHue ( LEADRasterView1->Raster, False, False, True, False);
pRasterProc-> Release( );


StopMagGlass example for C++ Builder

LEADRasterView1->ScaleMode = 3;
//Set MagGlass flags
//In this case the masked colors from the Magnifying Glass area will be all the colors
//except those colors which will be set using the MagGlassMask property
LEADRasterView1->MagGlassFlags = MAGGLASS_MASK_INVERT;
//set the color mask to mask out all colors except a few shades of black
LEADRasterView1->MagGlassMaskCount = 3;
LEADRasterView1->MagGlassMask [0]= RGB(0, 0, 0);
LEADRasterView1->MagGlassMask[1]= RGB(1, 1, 1);
LEADRasterView1->MagGlassMask[2]= RGB(2, 2, 2);
LEADRasterView1->RgnFrameType = 0;
LEADRasterView1->StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), true, 1, false, CROSSHAIR_FINE, true, true);
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
LEADRasterView1->StopMagGlass ();


StretchIntensity example for C++ Builder

This example stretches the intensity and redisplays the image.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->StretchIntensity (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


TextWordWrap example for C++ Builder

This example wraps text inside the rectangle that is specified for the text object.

LEADRasterFXD* pLeadRasterFxd1= NULL;

CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pLeadRasterFxd1);

//Text location
pLeadRasterFxd1->TextTop = 10;
pLeadRasterFxd1->TextLeft = 10;
pLeadRasterFxd1->TextWidth = 150;
pLeadRasterFxd1->TextHeight = 150;
//Text alignment and angle
pLeadRasterFxd1->TextAlign = FXD_TEXTALIGN_LEFT_VCENTER;
pLeadRasterFxd1->TextAngle = 0;
//Enable word wrap
pLeadRasterFxd1->TextWordWrap = True;
pLeadRasterFxd1->DrawPersistence = True;
pLeadRasterFxd1->DrawText ( LEADRasterView1->Raster, 0, AnsiToOLESTR("LEADTOOLS 14.5 Supports WordWrap when drawing text."), 0);
LEADRasterView1->ForceRepaint ();

pLeadRasterFxd1-> Release( );


Tool example for C++ Builder

//This sample displays the current tool, and then changes it to ANN_TOOL_RECT
void __fastcall TForm1::ToolClick(TObject *Sender)
{
AnsiString strTool;

strTool = pRasterAnnToolbar->Tool;

switch (pRasterAnnToolbar->Tool)
{
case ANN_TOOL_SELECT:
strTool = "Select";
break;

case ANN_TOOL_LINE:
strTool = "Line";
break;

case ANN_TOOL_RECT:
strTool = "Rect";
break;

case ANN_TOOL_ELLIPSE:
strTool = "Ellipse";
break;

case ANN_TOOL_POLYLINE:
strTool = "Polyline";
break;

case ANN_TOOL_POLYGON:
strTool = "Polygon";
break;

case ANN_TOOL_POINTER:
strTool = "Pointer";
break;

case ANN_TOOL_FREEHAND:
strTool = "Freehand";
break;

case ANN_TOOL_HILITE:
strTool = "hilite";
break;

//...other tools
}
ShowMessage ("Current tool: " + strTool);
ShowMessage ("Changing to ANN_TOOL_RECT");
pRasterAnnToolbar->Tool = ANN_TOOL_RECT;
}


TransitionEffect example for C++ Builder

This example paints a transition with a 255-step grayscale gradient.

ILEADRasterIO * pRasterIO;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

LEADRasterView1->AutoRepaint = False;
LEADRasterView1->TransitionDelay = 50;
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Image1.cmp"), 0, 0, 1);
LEADRasterView1->TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT;
LEADRasterView1->TransitionStyle = EFX_TRANSITION_GRADIENT;
LEADRasterView1->GradientStyle = EFX_GRADIENT_ANGLE_TO_LT;
LEADRasterView1->GradientEndColor = (TColor)RGB(0, 0, 0);
LEADRasterView1->GradientStartColor = (TColor)RGB(255, 255, 255);
LEADRasterView1->GradientSteps = 255;
LEADRasterView1->AutoRepaint= True;


Transparent example for C++ Builder

int x, y;

//set the backcolor of the control to BLUE
LEADRasterView1->BackColor = (TColor)RGB(0, 0, 255);
ShowMessage ("Pause");
//create a 100x100 image
LEADRasterView1->Raster->CreateBitmap (100, 100, 24);
//fill some of the image with RED, the rest with black
LEADRasterView1->AutoRepaint = False;
for (y = 0; y <= 99; y ++)
{
for (x= 0; x<= 24; x ++)
LEADRasterView1->Raster->set_Pixel (x, y, RGB (255, 0, 0 ));
for (x= 25; x <= 74; x++)
LEADRasterView1->Raster->set_Pixel(x, y, RGB (0, 255, 0 ));
for (x= 75; x <= 99; x ++)
LEADRasterView1->Raster->set_Pixel(x, y, RGB (0, 0, 255 ));
}
LEADRasterView1->AutoRepaint = True;
ShowMessage ("Pause");
//now, set Red as the transparent color
LEADRasterView1->Raster->BitmapTransparentColor = RGB(255, 0, 0);
LEADRasterView1->Raster->BitmapEnableTransparency = True;
ShowMessage ("Pause");
//now set the control transparent
LEADRasterView1->Transparent = True;


Trim example for C++ Builder

This example trims one-tenth from the bitmap and repaints the image.

float NewLeft, NewTop, NewWidth, NewHeight, ViewWidth, ViewHeight;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

NewLeft= LEADRasterView1->Raster->BitmapWidth * 0.1;
NewTop= LEADRasterView1->Raster->BitmapHeight * 0.1;
NewWidth = LEADRasterView1->Raster->BitmapWidth * 0.8;
NewHeight= LEADRasterView1->Raster->BitmapHeight * 0.8;
pRasterProc->Trim ( LEADRasterView1->Raster, NewLeft, NewTop, NewWidth, NewHeight );
//Set variables for the position and size of the display rectangle.
ViewWidth= LEADRasterView1->ScaleWidth;
ViewHeight= LEADRasterView1->ScaleHeight;
//Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect (0, 0, ViewWidth, ViewHeight);
LEADRasterView1->SetDstClipRect (0, 0, ViewWidth, ViewHeight);
LEADRasterView1->ForceRepaint ();
pRasterProc-> Release( );


Underlay example for C++ Builder

This example loads a bitmap into LEADRasterView2 and uses it as a tiled underlay for LEADRasterView1.

LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterIO->Load (LEADRasterView2->Raster, AnsiToOLESTR("v:\\images\\ulay2.bmp"), 0, 0, 1);
pRasterProc->Underlay (LEADRasterView1->Raster, LEADRasterView2->Raster, UNDERLAY_TILE);
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );
pRasterIO-> Release( );


UpdateMagGlassShape example for C++ Builder

HRGN h_Rgn= NULL;

LEADRasterView1->ScaleMode = 3;
LEADRasterView1->RgnFrameType = 0;
LEADRasterView1->StartMagGlass (100, 100, 400, RGB(255, 0, 0),
RGB(128,128, 128), true, 1, false,
CROSSHAIR_FINE, true, true);
h_Rgn= CreateRoundRectRgn(0, 0, 100, 100, 25, 25);
LEADRasterView1->UpdateMagGlassShape (MAGGLASS_SHAPE_HRGN, (long)h_Rgn);
DeleteObject (h_Rgn);
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
LEADRasterView1->StopMagGlass ();


UserPalette and BitmapPalette example for C++ Builder

This example demonstrates the UserPalette and BitmapPalette properties.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//Specify a blue and white user palette
pRasterProc->set_UserPalette (0, RGB(0, 0, 255));
pRasterProc->set_UserPalette(1, RGB(255, 255, 255));
//Implement the user palette
pRasterProc->ColorRes (LEADRasterView1->Raster, 1, CRP_USERPALETTE, CRD_ORDEREDDITHERING, 2);
//Display the blue and white image
LEADRasterView1->ForceRepaint ();
ShowMessage ("This is the user palette. Click OK to change the bitmap palette.");
//Change the bitmap palette to red and white
LEADRasterView1->Raster->set_BitmapPalette (0, RGB(255, 0, 0));
LEADRasterView1->Raster->set_BitmapPalette(1, RGB(255, 255, 255));
//Display the red and white image
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );


VTable example for C++ Builder

//This example remaps the "value" of each color to one half its original
short i;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

for (i= 0; i <= 255; i ++)
pRasterProc->set_VTable (i, (short)(i / 2));
pRasterProc->RemapHue (LEADRasterView1->Raster, False, False, False, True );
pRasterProc-> Release( );


WindowLevel example for C++ Builder

These 3 examples convert a bitmap to 12-bit grayscale and then perform window leveling on the four most significant bits of the image.

Ex1.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//WindowLevel for Display
pRasterProc->Grayscale (LEADRasterView1->Raster, 12); //Grayscale image to 12-bit
pRasterProc-> Release( );
LEADRasterView1->Raster->LevelLowBit = 8 ;//use 4 most significant bits
LEADRasterView1->Raster->LevelHighBit = 11;
LEADRasterView1->WindowLevel ();

Ex2.

LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//WindowLevel image processing
pRasterProc->Grayscale ( LEADRasterView1->Raster, 12 ); //Grayscale image to 12-bit
LEADRasterView1->Raster->LevelLowBit= 8 ;// use 4 most significant bits
LEADRasterView1->Raster->LevelHighBit= 11 ;
pRasterProc->WindowLevel ( LEADRasterView1->Raster ) ;

pRasterProc-> Release( );

Ex3.

//This example loads a 16-bit grayscale, fills the window level lookup table,
// and window levels the bitmap for display only
int i;
LEADRasterIO* pRasterIO= NULL;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

//Load a 16-bit grayscale image
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image5.dic"), 0, 0, 1);
LEADRasterView1->AutoRepaint = False;

//Use all bits
LEADRasterView1->Raster->LevelLowBit = 0;
LEADRasterView1->Raster->LevelHighBit =(short)(LEADRasterView1->Raster->BitmapBits - 1);

LEADRasterView1->Raster->GetMinMaxBits ( ) ;
LEADRasterView1->Raster->GetMinMaxVal ( ) ;

//Set LUT so the range is from pure blue to pure red
for (i = LEADRasterView1->Raster->MinVal; i <= LEADRasterView1->Raster->MaxVal; i ++)
LEADRasterView1->Raster->set_LevelLUT (i, RGB((i % 256), 0, 256 - (i % 256)));

//Window level for display only--leave the bitmap data unchanged
LEADRasterView1->WindowLevel ();
LEADRasterView1->ForceRepaint ();

pRasterProc-> Release( );
pRasterIO-> Release( );


WindowLevelFillLUT example for C++ Builder

long nHigh;
long nLow;
LEADRasterProcess* pRasterProc= NULL;

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

pRasterProc->Grayscale (LEADRasterView1->Raster, 16);

LEADRasterView1->Raster->GetMinMaxBits () ;
LEADRasterView1->Raster->GetMinMaxVal () ;

LEADRasterView1->Raster->LevelLowBit = 0;
LEADRasterView1->Raster->LevelHighBit = (short)(LEADRasterView1->Raster->BitmapBits - 1);

nLow = LEADRasterView1->Raster->MinBit;
nHigh = 1<<(LEADRasterView1->Raster->MaxBit - LEADRasterView1->Raster->MinBit + 1);

//allocate the LUT
LEADRasterView1->Raster->set_LevelLUT (nHigh - 1, 0);

//fill the entire LUT with gradient from RED to BLUE
LEADRasterView1->Raster->WindowLevelFillLUT (RGB (255, 0, 0), RGB (0, 0, 255),
nLow, nHigh,
LEADRasterView1->Raster->MinBit,
LEADRasterView1->Raster->MaxBit,
LEADRasterView1->Raster->MinVal,
LEADRasterView1->Raster->MaxVal,
True);

//now use it
pRasterProc->WindowLevel (LEADRasterView1->Raster);
pRasterProc-> Release( );


WMFResolution example for C++ Builder

//This example displays the default resolution stored in a WMF,
//changes the resolution to 150 dpi, and then loads the image
//Display resolution stored in WMF
//Note that InfoXRes and InfoYRes will return the same value
LEADRasterIO* pRasterIO= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

pRasterIO->GetFileInfo (LEADRasterView1->Raster,
AnsiToOLESTR("v:\\images\\Test.wmf"),0, 0 ) ;
ShowMessage ("InfoXRes: " + IntToStr ((int)pRasterIO->InfoXRes) + " InfoYRes: " +
IntToStr ((int)pRasterIO->InfoYRes)) ;
//Set resolution so WMF is loaded at 150 dpi
pRasterIO->WMFResolution = 150;
pRasterIO->Load (LEADRasterView1->Raster,
AnsiToOLESTR("v:\\images\\Test.wmf"),
0, 0, 1);
pRasterIO-> Release( );


WriteComment example for C++ Builder

LEADRasterIO* pRasterIO= NULL;
ILEADRasterVariant* pRasterVarStr= NULL;

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pRasterVarStr);

pRasterVarStr->set_Type( VALUE_STRING );
pRasterVarStr->StringValue= AnsiToOLESTR("Me");

//set the comment
pRasterIO->set_Comment(CMNT_SZARTIST, pRasterVarStr);
//write the comment into page 1 of TEST->TIF
pRasterIO->WriteComment( AnsiToOLESTR("c:\\TEST.TIF"), 1 ) ;
//read the comment and display it
pRasterVarStr= pRasterIO->ReadComment(LEADRasterView1->Raster,
AnsiToOLESTR("c:\\TEST.TIF"), 1, CMNT_SZARTIST);
ShowMessage ( pRasterVarStr->StringValue) ;
if ( pRasterIO )
pRasterIO->Release( );

if ( pRasterVarStr )
pRasterVarStr->Release();


ZoomIn example for C++ Builder

This example calls ZoomIn () method to zoom in on a captured image.

LEADRasterView1->ZoomIn ();


ZoomInDone example for C++ Builder

This example triggers the ZoomInDone event and displays a message that the ZoomIn image has been captured.

void __fastcall TForm1::LEADRasterView1ZoomInDone (TObject *Sender, long x,
long y)
{
ShowMessage ( "ZoomIn Captured: " + IntToStr ((int)x) + "," + IntToStr((int)y));
}


Tutorial for C++ Builder 6.0 Programmers

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

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Using a PanWindow

Using the Magnifying Glass

Print a Real Image Size in Inches

Combining Images with Regions


Loading and Displaying an Image (C++ Builder 6.0)

Take the following steps to start a project and to add some code that displays an image on the main form:

1. | Start C++ Builder 6.0.
2. | If you didn’t install LEAD Raster View Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press Install.
3. | Select LEAD Raster View control and add it to your main form. Size and position the control, as you want it to appear at run time.
4. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster IO object library (14.5). Then press OK.
5. | Select LEAD Raster IO, from the ActiveX tab and add it to your form.
6. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnLoadImage | Load Image
7. | Code the Main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1->Appearance = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle = 1;
LEADRasterView1->BackColor = ( TColor ) RGB(255, 255, 125);
LEADRasterView1->PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint = true;
LEADRasterView1->AutoSize = false;
LEADRasterView1->AutoSetRects = true;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
LEADRasterView1->EnableFireMouse2Event= true;
}

8.

Code the btnLoadImage button's click procedure as follows:

void __fastcall TForm1::btnLoadImageClick(TObject *Sender)
{
LEADRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("c:\\Image1.cmp"), 0, 0, 1 ) ;
}

9.

At the beginning of the Unit1.cpp file, include this file:

#include "LTRASTERLib_TLB.h"

10. | Run your program to test it.
11. | Save the project to be used as a starting point for other tasks in this tutorial.


Zooming Out and Zooming In (C++ Builder 6.0)

Take the following steps to add code that can reduce or enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD Raster View control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add two buttons to your form and name them as follows:
 | Name | Caption
 | btnZoomIn | Zoom In
 | btnZoomOut | Zoom Out
3. | Code the btnZoomIn button's click procedure as follows:

void __fastcall TForm1::btnZoomInClick(TObject *Sender)
{
LEADRasterView1->AutoSetRects = true;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_ZOOM;
LEADRasterView1->PaintZoomFactor = LEADRasterView1->PaintZoomFactor + 10;
}

4.

Code the btnZoomOut button's click procedure as follows:

void __fastcall TForm1::btnZoomOutClick(TObject *Sender)
{
LEADRasterView1->AutoSetRects = true;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_ZOOM;
if ( LEADRasterView1->PaintZoomFactor > 10 )
LEADRasterView1->PaintZoomFactor = LEADRasterView1->PaintZoomFactor - 10;
}

5.

Run your program to test it.


Dynamically Positioning the Control (C++ Builder 6.0)

Take the following steps to dynamically scale and position the LEAD Raster View control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the btnLoadImage button's click procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying an Image.

void __fastcall TForm1::btnLoadImageClick(TObject *Sender)
{
int HeightFactor;
int WidthFactor;
int HeightAllowed;
int WidthAllowed;

// Get file information
LEADRasterIO1->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0);
// Set the variables used for preserving the aspect ratio.
// Allow for a border of 1/8 of the form size.
// The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterIO1->InfoHeight;
WidthFactor = LEADRasterIO1->InfoWidth;
HeightAllowed = ClientHeight * 3.0f / 4;
WidthAllowed = ClientWidth * 3.0f / 4;
// Center the LEAD control on the form, preserving the aspect ratio.
// Check to see if using the maximum width will make the image too tall.
// Set the dimensions based on the result.
if(((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1->Left = ClientWidth / 8.0f;
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (Width * HeightFactor) / WidthFactor;
LEADRasterView1->Top = (ClientHeight - Height) / 2;
}
else
{
LEADRasterView1->Top = ClientHeight / 8.0f;
LEADRasterView1->Height = HeightAllowed;
LEADRasterView1->Width = (Height * WidthFactor) / HeightFactor;
LEADRasterView1->Left = (ClientWidth - Width) / 2;
}
// Set up for handling our own display rectangles.
LEADRasterView1->AutoScroll = false;
LEADRasterView1->AutoRepaint = true;
// Load the bitmap
LEADRasterIO1->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\image1.cmp"), 0, 0, 1);
// Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect (0.0f, 0.0f,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
LEADRasterView1->SetDstClipRect (0.0f, 0.0f,
LEADRasterView1->ScaleWidth,
LEADRasterView1->ScaleHeight);
}

3.

Run your program to test it.


Zooming In on a Selection (C++ Builder 6.0)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

void __fastcall TForm1::LEADRasterView1MouseDown2(TObject *Sender, short Button, short Shift, long x, long y)
{
//Enable AutoRubberBand
LEADRasterView1->AutoRubberBand = true;
LEADRasterView1->MousePointer = 2;
}

3.

Handle the LEADRasterView1 OnRubberBand event, and code LEADRasterView1RubberBand procedure, as follows:

void __fastcall TForm1::LEADRasterView1RubberBand(TObject *Sender)
{
int zoomleft;
int zoomtop;
int zoomwidth;
int zoomheight;

LEADRasterView1->MousePointer = 0;
//Zoom in on the selection
zoomleft = LEADRasterView1->RubberBandLeft;
zoomtop = LEADRasterView1->RubberBandTop;
zoomwidth = LEADRasterView1->RubberBandWidth;
zoomheight = LEADRasterView1->RubberBandHeight;
//Zoom in on the rectangle defined by the rubberband
LEADRasterView1->ZoomToRect (zoomleft, zoomtop, zoomwidth, zoomheight);
LEADRasterView1->Refresh () ;
}

4.

Run your program to test it.


Outlining, Dragging, and Pasting a Region (C++ Builder 6.0)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a second LEAD Raster View control, and set its Visible property to False.
3. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Process object library (14.5). Press OK.
4. | Select the LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Declare the following variables in the private section of “Unit1.h”. In online help, you can use the Edit pull-down menu to copy the block of code.

bool ReadyToDrag; //The state after marking the region but before dragging
bool Dragging; //The state when the mouse is used for dragging the floater
float StartX; //Starting X position in screen twips
float StartY; //Starting Y position in screen twips
float FloaterX; //Floater X position in screen twips
float FloaterY; //Floater Y position in screen twips
float ZoomFactorX; //Used for translating positioning information
float ZoomFactorY; //Used for translating positioning information

6. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | btnSelRgn | Select Region
 | btnPasteFloater | Paste Floater
7. | Code btnSelRgn control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnSelRgnClick(TObject *Sender)
{
LEADRasterView1->RgnFrameType = RGNFRAME_ANIMATED;
LEADRasterView1->Raster->RefBitmap = false ;
LEADRasterView1->RgnMarkingMode = RGNMARK_FREEHAND;
ShowMessage ( "Draw a freehand region" ) ;
}

8.

Code btnPasteFloater control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnPasteFloaterClick(TObject *Sender)
{
float LCRgnX;
float LCRgnY;
float LCRgnWidth;
float LCRgnHeight;
float LBRgnX;
float LBRgnY;
float LBRgnWidth;
float LBRgnHeight;
CombineConstants MyOp ;
//Do nothing if there is no floater
if (LEADRasterView1->Floater == 0 )
return;
//Get the floater into another bitmap
LEADRasterView2->Raster->RefBitmap = false;
LEADRasterView2->ScaleMode = LEADRasterView1->ScaleMode;
LEADRasterView2->Raster->Bitmap = LEADRasterView1->Floater;
//Get the floater's client coordinates into local variables
LCRgnX = LEADRasterView1->FloaterDstLeft;
LCRgnY = LEADRasterView1->FloaterDstTop;
LCRgnWidth = LEADRasterView1->FloaterDstWidth;
LCRgnHeight = LEADRasterView1->FloaterDstHeight;
//Delete the floater->
LEADRasterView1->FloaterVisible = false;
LEADRasterView1->Floater = 0;
//Translate the client coordinates to bitmap coordinates
LBRgnX = ((LCRgnX - LEADRasterView1->DstLeft) / ZoomFactorX) + LEADRasterView1->SrcLeft;
LBRgnY = ((LCRgnY - LEADRasterView1->DstTop) / ZoomFactorY) + LEADRasterView1->SrcTop;
LBRgnWidth = LCRgnWidth / ZoomFactorX;
LBRgnHeight = LCRgnHeight / ZoomFactorY;
//Reposition the region to use as a mask for the Combine method
LEADRasterView1->Raster->OffsetRgn ( LBRgnX - LEADRasterView1->Raster->Rgnleft, LBRgnY - LEADRasterView1->Raster->RgnTop ) ;
//Use the Combine method to paste the Lead2 bitmap into the Lead1 bitmap
MyOp = (CombineConstants)(CB_OP_ADD + CB_DST_0) ; //Operation flags for a simple paste
LEADRasterProcess1->Combine ( LEADRasterView1->Raster, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2->
Raster, 0, 0, MyOp ) ;
//Repaint the part of the client area that has changed
LEADRasterView1->RepaintRect (LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, false);
//Free the region
LEADRasterView1->Raster->FreeRgn ( ) ;
}

9.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

void __fastcall TForm1::LEADRasterView1MouseDown2(TObject *Sender, short Button, short Shift, long x, long y)
{
float BitmapX;
float BitmapY;
float NewX;
float NewY;
float NewWidth;
float NewHeight;

//Do nothing if we are drawing a region.
if (LEADRasterView1->RgnMarkingMode != RGNMARK_NONE)
return;
//Save the starting position, in case we need it.
StartY= y;
StartX= x;
//If we are ready to drag the selection, get a floater.
if (ReadyToDrag)
{
//Translate the current mouse coordinates.
//These coordinates account for the zoom factor and offset.
ZoomFactorX = LEADRasterView1->DstWidth / LEADRasterView1->SrcWidth;
ZoomFactorY = LEADRasterView1->DstHeight / LEADRasterView1->SrcHeight;
BitmapX = (x / ZoomFactorX) - (LEADRasterView1->DstLeft / ZoomFactorX) + LEADRasterView1->SrcLeft;
BitmapY = (y / ZoomFactorY) - (LEADRasterView1->DstTop / ZoomFactorY) + LEADRasterView1->SrcTop;
//Continue to create the floater if the mouse is pointing to the region we marked

if ( LEADRasterView1->Raster->IsPtInRgn (BitmapX, BitmapY) )
{
//Hide the region frame->
LEADRasterView1->RgnFrameType = RGNFRAME_NONE;
//Create the floater bitmap, which will be the part of the main bitmap that is
//in the region's bounding rectangle
LEADRasterView1->Floater = LEADRasterView1->Raster->Bitmap;
//Translate the bitmap region coordinates to client area coordinates
NewY = ((LEADRasterView1->Raster->RgnTop - LEADRasterView1->SrcTop) * ZoomFactorY) + LEADRasterView1->DstTop;
NewX = ((LEADRasterView1->Raster->Rgnleft - LEADRasterView1->SrcLeft) * ZoomFactorX) + LEADRasterView1->DstLeft;
NewWidth = LEADRasterView1->Raster->RgnWidth * ZoomFactorX;
NewHeight = LEADRasterView1->Raster->RgnHeight * ZoomFactorY;
//Set the initial display position of the floater
LEADRasterView1->SetFloaterDstRect ( NewX, NewY, NewWidth, NewHeight);
//Set form-level variables
FloaterY = LEADRasterView1->FloaterDstTop;
FloaterX = LEADRasterView1->FloaterDstLeft;
LEADRasterView1->FloaterVisible = True;
Dragging = True;
ReadyToDrag = False;
}
}
}

10.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

void __fastcall TForm1::LEADRasterView1MouseMove2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
float xDelta;
float yDelta;
float NewX;
float NewY;
float NewWidth;
float NewHeight;

//Do nothing if we are drawing a region.
if (LEADRasterView1->RgnMarkingMode !=RGNMARK_NONE)
return;
//Reposition the floater if we are dragging it.
if ((Dragging) && (Button == 1) && (LEADRasterView1->Floater != 0))
{
if ( LEADRasterView1->IsPtInFloater (x, y))
{
//Update the position variables->
xDelta = x - StartX;
yDelta = y - StartY;
NewX = FloaterX + xDelta;
NewY = FloaterY + yDelta;
NewWidth = LEADRasterView1->FloaterDstWidth ;
NewHeight = LEADRasterView1->FloaterDstHeight;
//Reposition the floater
LEADRasterView1->SetFloaterDstRect (NewX, NewY, NewWidth, NewHeight) ;
//Save the form-level position variables->
FloaterY = NewY;
FloaterX = NewX;
StartY = y;
StartX = x;
}
}
}

11.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

void __fastcall TForm1::LEADRasterView1MouseUp2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//if we were drawing a region, set up for the next operation.
if ( LEADRasterView1->RgnMarkingMode != RGNMARK_NONE )
{
LEADRasterView1->RgnMarkingMode = RGNMARK_NONE;
LEADRasterView1->RgnFrameType = RGNFRAME_STATIC;
ReadyToDrag = True;
ShowMessage ( "Now, drag the selection to another place." ) ;
}
}

12.

Run your program to test it.


Creating and Using Annotations (C++ Builder 6.0)

Note:

This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Annotation Library (14.5 Press OK.
3. | Select LEAD Raster Annotation, from ActiveX tab and add it to your form.
4. | Declare the following variable in the private section of “Unit1.h”.

int NewTag;

5.

Add the following code to the btnLoadImage click’s procedure.

//Unlock annotation support LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR("TestKey"));

//Connect the raster annotation object to the RasterView control
LEADRasterAnnotation1->set_AnnParentRasterView ( LEADRasterView1->Raster );

//Enable left button drawing of annotations
LEADRasterAnnotation1->set_AnnAutoDrawEnable ( true );

//Enable right-click to display annotation menus
LEADRasterAnnotation1->set_AnnAutoMenuEnable ( true );

6. | At the top of your main form, add four buttons and name them as follows:
 | Name | Caption
 | btnAnnToggle | Start
 | btnIOToggle | Save
 | btnClipboardToggle | Copy
 | btnRealize | Realize
7. | Code the btnAnnToggle control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnAnnToggleClick(TObject *Sender)
{
//Use the button to toggle between design mode and run mode
if (btnAnnToggle->Caption == "Start")
{
LEADRasterAnnotation1->set_AnnUserMode ( ANN_USERMODE_DESIGN );
LEADRasterAnnotation1->set_AnnTool ( ANN_TOOL_BUTTON ) ;
//Make run mode the next thing.
btnAnnToggle->Caption= "Run Mode";
ShowMessage ("In design mode now. Draw a button object.");
}
else
{
if (btnAnnToggle->Caption == "Design Mode")
{
LEADRasterAnnotation1->set_AnnUserMode ( ANN_USERMODE_DESIGN );
LEADRasterAnnotation1->set_AnnTool ( ANN_TOOL_BUTTON );
//Make run mode the next thing.
btnAnnToggle->Caption= "Run Mode";
}
else //The button takes us to run mode
{
LEADRasterAnnotation1->set_AnnUserMode ( ANN_USERMODE_RUN );
ShowMessage ("Click on your new button");
btnAnnToggle->Caption= "Design Mode";
}
}
}

8.

Code the btnIOToggle control's Click procedure as follows:

void __fastcall TForm1::btnIOToggleClick(TObject *Sender)
{
int nRet;

//Disable errors so that we can trap our own.
LEADRasterAnnotation1->set_EnableMethodErrors (false);
//Use the button to toggle between saving and loading annotations
if (btnIOToggle->Caption == "Save")
{
//Do nothing if there are no annotations.
if (LEADRasterAnnotation1->AnnContainer == 0)
return;
//Save the all annotations.
nRet = LEADRasterAnnotation1->AnnSave (AnsiToOLESTR("c:\\temp\\tmp.ann"), ANN_FMT_NATIVE, false, SAVE_OVERWRITE, 1);
if (nRet == 0)
{
btnIOToggle->Caption = "Load";
ShowMessage ("Use the right mouse button to delete any annotations, then click Load");
}
else
ShowMessage ("Error code: " + IntToStr(nRet));
}
else
{
//We are loading annotations
//Make sure we are in design mode
LEADRasterAnnotation1->set_AnnUserMode ( ANN_USERMODE_DESIGN );
//Load the annotations.
nRet = LEADRasterAnnotation1->AnnLoad (AnsiToOLESTR("c:\\temp\\tmp.ann"), 1);
if (nRet == 0)
btnIOToggle->Caption = "Save";
else
ShowMessage ("No annotations to load");
}
}

9.

Code the btnClipboardToggle control's Click procedure as follows. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)

void __fastcall TForm1::btnClipboardToggleClick(TObject *Sender)
{
int nRet;

//Disable errors so that we can trap our own.
LEADRasterAnnotation1->set_EnableMethodErrors ( false ) ;
//Use the button to toggle between copying and pasting annotations
if (btnClipboardToggle->Caption == "Copy")
{
//Do nothing if there are no annotations.
if (LEADRasterAnnotation1->AnnContainer == 0)
return;
//Copy all annotations to the clipboard.
nRet = LEADRasterAnnotation1->AnnCopy (ANN_FMT_NATIVE, false, true);
if (nRet == 0)
{
//Make pasting the next thing.
btnClipboardToggle->Caption = "Paste";
ShowMessage ("Use the right mouse button to delete any annotations, then click Paste");
}
else
ShowMessage ("Error code: " + IntToStr(nRet));
}
else //We are pasting annotations
{
//Make sure we are in design mode
LEADRasterAnnotation1->set_AnnUserMode ( ANN_USERMODE_DESIGN );
//Paste the annotations
if (LEADRasterAnnotation1->AnnPasteReady)
{
LEADRasterAnnotation1->AnnPaste ();
btnClipboardToggle->Caption = "Copy";
}
else
ShowMessage ("No annotations to paste");
}
}

10.

Code the Realize control's Click procedure (which renders the annotation objects to the bitmap) as follows:

void __fastcall TForm1::btnRealizeClick(TObject *Sender)
{
LEADRasterAnnotation1->AnnRealize (false);
LEADRasterView1->ForceRepaint ();
ShowMessage ("Annotations are now rendered to the bitmap");
}

11.

Handle the LEADRasterAnnotation1 OnAnnCreate event, and code LEADRasterAnnotation1AnnCreate procedure as follows:

void __fastcall TForm1::LEADRasterAnnotation1AnnCreate(TObject *Sender,
long hAnnObject)
{
AnnObjectType ObjectType;

//Update the tag if we need one.
LEADRasterAnnotation1->AnnGetType (hAnnObject);

ObjectType = LEADRasterAnnotation1->AnnType;
if ((ObjectType == ANN_OBJECT_BUTTON) || (ObjectType == ANN_OBJECT_HOTSPOT))
{
NewTag++;
LEADRasterAnnotation1->AnnSetTag (hAnnObject, NewTag);
}
}

12.

Handle the LEADRasterAnnotation1 OnAnnDestroy event, and code the LEADRasterAnnotation1AnnDestroy procedure as follows:

void __fastcall TForm1::LEADRasterAnnotation1AnnDestroy(TObject *Sender,
long hAnnObject)
{
long lTag;

LEADRasterAnnotation1->AnnGetTag (hAnnObject);
lTag= LEADRasterAnnotation1->AnnTag;
ShowMessage ("The object tagged " + IntToStr(lTag) + " is deleted.");
}

13.

Handle the LEADRasterAnnotation1 OnAnnClicked event, and code the LEADRasterAnnotation1AnnClicked procedure as follows:

void __fastcall TForm1::LEADRasterAnnotation1AnnClicked(TObject *Sender,
long hAnnObject)
{
long lTag;

LEADRasterAnnotation1->AnnGetTag (hAnnObject);
lTag= LEADRasterAnnotation1->AnnTag;
ShowMessage ("This is what we do for the button tagged " + IntToStr(lTag));
}

14.

Handle the LEADRasterAnnotation1 OnAnnDrawn event, and code the LEADRasterAnnotation1AnnDrawn procedure as follows:

void __fastcall TForm1::LEADRasterAnnotation1AnnDrawn(TObject *Sender,
long hAnnObject)
{
LEADRasterAnnotation1->set_AnnTool ( ANN_TOOL_SELECT );
ShowMessage ("Use the right mouse button to modify this object; then click on Run Mode to test it.");
}

15.

Run your program to test it.


Printing Multiple Images (C++ Builder 6.0)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnPrint | Print Twice on One Page
3. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Process object library (14.5). Press OK.
4. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Add the following code to the btnPrint control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnPrintClick(TObject *Sender)
{
TPrinter * Prntr = Printer();

//Declare the variable for printed text
AnsiString Msg;
//Declare the variables for pixel measurements
int TextHeightInPixels;
int UsableWidth;
int UsableHeight;
int MaxImageHeight;
//Declare the variables for sizing and positioning the image
long int PrintLeft;
long int PrintTop;
long int PrintHeight;
long int PrintWidth;
//Declare variables used for preserving aspect ratios
int WidthFactor;
int HeightFactor;

//Set the variables used for preserving the aspect ratio
HeightFactor = LEADRasterView1->Raster->BitmapHeight;
WidthFactor= LEADRasterView1->Raster->BitmapWidth;

//Set the pointer to an hourglass
Screen->Cursor = crHourGlass;
//Get the page width and height in pixels (dots)
UsableWidth = Prntr->PageWidth ;
UsableHeight = Prntr->PageHeight ;
//Print a title at the top of the page
Msg= "This is a print example using LEADTOOLS ActiveX->";
Prntr->BeginDoc ( );
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y, Msg);
//Get the maximum height of one image,
//assuming two equal-size images and space for 12 lines of text
TextHeightInPixels = Prntr->Canvas->TextHeight (Msg);
MaxImageHeight = (UsableHeight - (12 * TextHeightInPixels)) / 2;
//Size and position the first image, preserving the aspect ratio
//Check to see if using the maximum width will make the image too tall
//Set the dimensions based on the result
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1;
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y;
PrintWidth = UsableWidth;
PrintHeight = PrintWidth * HeightFactor / WidthFactor;
}
else
{
PrintLeft = 1;
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the first image
LEADRasterView1->Render ((long)Prntr->Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight);
//Update the current printing position
Prntr->Canvas->MoveTo ( 1, Prntr->Canvas->PenPos.y + PrintHeight + TextHeightInPixels );
//Print a blank line, then print a caption for the next picture
Msg = " " ;
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y, Msg ) ;
Msg = "This is the second picture, which is modified before printing:";
Prntr->Canvas->TextOut ( Prntr->Canvas->PenPos.x, Prntr->Canvas->PenPos.y + TextHeightInPixels, Msg ) ;
//Stretch the intensity of the bitmap for the second printing
//to show the difference between the second picture and the first
LEADRasterProcess1->StretchIntensity ( LEADRasterView1->Raster ) ;
//Size and position the second image, preserving the aspect ratio
//The coding is the same as for the first image
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1; //This is for flush left-> Use 0 for centering
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintWidth = UsableWidth ;
PrintHeight = (PrintWidth * HeightFactor) / WidthFactor;
}
else
{
PrintLeft = 1 ;//This is for flush left-> Use 0 for centering
PrintTop = TextHeightInPixels + Prntr->Canvas->PenPos.y ;
PrintHeight = MaxImageHeight;
PrintWidth = (PrintHeight * WidthFactor) / HeightFactor;
}
//Print the second image
LEADRasterView1->Render ((long)Prntr->Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight);
//Finish the page and finish the print job
Prntr->NewPage ( ) ;
Prntr->EndDoc ( ) ;
//Set the mouse pointer back to the default
Screen->Cursor = crDefault;
}

6.

Run your program to test it.


Writing and Reading Multi-Page Files (C++ Builder 6.0)

Take the following steps to create a multi-page file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support Multi-Page files.

1. | Start C++ Builder.
2. | If you didn’t install the LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press Install.
3 | Add 2 LEAD Raster View controls to your main form. The size and position does not matter.
4. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster IO object library (14.5). Press OK.
5. | Add 2 LEAD Raster IO controls from the ActiveX tab to your form.
6. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnLoad | Load Multi-Page File
7. | Code the btnLoad Click’s procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code. This code loads two bitmaps, saves them both into a single multi-page TIFF file, loads them again from the TIFF file, and displays them side-by-side.

void __fastcall TForm1::btnLoadClick(TObject *Sender)
{
int HeightFactor1, WidthFactor1;
int HeightFactor2, WidthFactor2;
int HeightAllowed, WidthAllowed;
int ImageWidth1, ImageHeight1;
int ImageWidth2, ImageHeight2;

//Disable automatic repainting of the image.
LEADRasterView1->AutoRepaint = False;
LEADRasterView2->AutoRepaint = False;
//Turn off scroll bars to make sure we use the full client area
LEADRasterView1->AutoScroll = False;
LEADRasterView2->AutoScroll = False;
//Position and size the main form so that it takes up most of the screen
Width = Screen->Width * 0.9 ;
Height= Screen->Height* 0.8 ;
Left = (Screen->Width- Width) / 2;
Top = (Screen->Height- Height)/ 2;
//Display the form and set the mouse pointer to an hourglass

Screen->Cursor = crHourGlass;
//Load the bitmaps-> These hard-coded path names may be different on your system
LEADRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("c:\\image1.cmp"),0, 0, 1 ) ;
LEADRasterIO2->Load ( LEADRasterView2->Raster, AnsiToOLESTR("c:\\image2.cmp"),0, 0, 1 ) ;

//Save the bitmaps to a single multipage TIFF file
LEADRasterIO1->Save ( LEADRasterView1->Raster, AnsiToOLESTR("c:\\combined.mpt"), FILE_TIF, 24,(QFactorConstants)0, SAVE_OVERWRITE);
LEADRasterIO2->Save ( LEADRasterView2->Raster, AnsiToOLESTR("c:\\combined.mpt"), FILE_TIF, 24,(QFactorConstants)0, SAVE_APPEND);
//Get information about the images so that we can size the controls
LEADRasterIO1->GetFileInfo ( LEADRasterView1->Raster, WideString("c:\\combined.mpt"), 1, 0 ) ;
LEADRasterIO2->GetFileInfo ( LEADRasterView2->Raster, WideString("c:\\combined.mpt"), 2, 0 );
//Clear the bitmaps from memory
LEADRasterView1->Raster->Bitmap = 0;
LEADRasterView2->Raster->Bitmap = 0;
//Make the controls visible so that we can size and position them
//They will not really appear until we load an image and paint it
LEADRasterView1->Visible = True;
LEADRasterView2->Visible = True;
//Set the variables used for preserving the aspect ratio
HeightFactor1 = LEADRasterIO1->InfoHeight;
WidthFactor1 = LEADRasterIO1->InfoWidth;
HeightFactor2 = LEADRasterIO2->InfoHeight;
WidthFactor2 = LEADRasterIO2->InfoWidth;
HeightAllowed = Height * 0.8;
WidthAllowed = Width * 0.45;
//Center each LEAD control on half of the form, preserving the aspect ratio
//Check to see if using the maximum width will make the image too tall
//Set the dimensions based on the result
if ((WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed)
{
LEADRasterView1->Left = (Width / 4) - (WidthAllowed / 2);
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (LEADRasterView1->Width * HeightFactor1) / WidthFactor1;
LEADRasterView1->Top = (Height - LEADRasterView1->Height) / 2;
}
else
{
LEADRasterView1->Top = (Height - HeightAllowed) / 2;
LEADRasterView1->Height = HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor1) / HeightFactor1;
LEADRasterView1->Left = (Width / 4) - (LEADRasterView1->Width / 2);
}
if ((WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed)
{
LEADRasterView2->Left = (Width * 3 / 4) - (WidthAllowed / 2);
LEADRasterView2->Width = WidthAllowed;
LEADRasterView2->Height = (LEADRasterView2->Width * HeightFactor2) / WidthFactor2;
LEADRasterView2->Top = (Height - LEADRasterView2->Height) / 2;
}
else
{
LEADRasterView2->Top = (Height - HeightAllowed) / 2;
LEADRasterView2->Height = HeightAllowed;
LEADRasterView2->Width = (LEADRasterView2->Height * WidthFactor2) / HeightFactor2;
LEADRasterView2->Left = (Width * 3 / 4) - (LEADRasterView2->Width / 2);
}
//Load the bitmaps from the multipage TIFF file
LEADRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("c:\\combined.mpt"), 24, 1, 1);
LEADRasterIO2->Load ( LEADRasterView2->Raster, AnsiToOLESTR("c:\\combined.mpt"), 24, 2, 1);
//Set the image display sizes to match the LEAD controls
ImageWidth1 = LEADRasterView1->ScaleWidth;
ImageHeight1 = LEADRasterView1->ScaleHeight;
LEADRasterView1->SetDstRect ( 0, 0, ImageWidth1, ImageHeight1);
LEADRasterView1->SetDstClipRect ( 0, 0, ImageWidth1, ImageHeight1);
//Set the image display sizes to match the LEAD controls
ImageWidth2 = LEADRasterView2->ScaleWidth;
ImageHeight2 = LEADRasterView2->ScaleHeight;
LEADRasterView2->SetDstRect ( 0, 0, ImageWidth2, ImageHeight2);
LEADRasterView2->SetDstClipRect (0, 0, ImageWidth2, ImageHeight2);

//Display the images
LEADRasterView1->ForceRepaint () ;
LEADRasterView2->ForceRepaint () ;
//Set the mouse pointer back to the default
Screen->Cursor= crDefault;
}

8.

Run your program to test it.


Drawing Simple Lines and Shapes (C++ Builder 6.0)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and install the LEAD 3D DrawEffect Object Library (14.5). Press OK.
3. | Select LEAD Raster FXD, from the ActiveX tab and add it to your form.
4. | Add the following variables to the Main Form’s private declarations section:

int DrawObject; //the object we are drawing
float StartX;//Starting X position
float StartY;//Starting Y position
float EndX;//Ending X position
float EndY;//Ending Y position

5.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows. This code selects a different drawing object each time the event occurs.

void __fastcall TForm1::LEADRasterView1MouseDown2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Use the same scale mode as the mouse.
LEADRasterView1->ScaleMode = 1;
//Save the starting position.
StartX = x;
StartY = y;
EndX = x;
EndY = y;
//Cycle through the types of drawing objects.
switch(DrawObject)
{

case 0:
DrawObject = 1 ;//Line
break;
case 1:
DrawObject = 2 ;//Rectangle
break;

case 2:
DrawObject = 0 ;//Ellipse
break;
default:
DrawObject = 0;
}
LEADRasterFXD1->set_DstLeft ( 0 );
LEADRasterFXD1->set_DstTop ( 0 );
LEADRasterFXD1->set_DstRight ( LEADRasterView1->Raster->BitmapWidth );
LEADRasterFXD1->set_DstBottom ( LEADRasterView1->Raster->BitmapHeight );
LEADRasterFXD1->set_SrcLeft ( 0 );
LEADRasterFXD1->set_SrcTop ( 0 );
LEADRasterFXD1->set_SrcRight ( LEADRasterView1->Raster->BitmapWidth );
LEADRasterFXD1->set_SrcBottom ( LEADRasterView1->Raster->BitmapHeight );
LEADRasterFXD1->set_ScaleMode ( 3 );
}

6.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows: This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one.

void __fastcall TForm1::LEADRasterView1MouseMove2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Declare local variables
float OldEndX, OldEndY;
float OldDrawX, OldDrawY, OldWidth, OldHeight;
float DrawX, DrawY, NewWidth, NewHeight;
HDC h_DC;

if (Button == 1)
{
//Set the drawing styles
LEADRasterFXD1->set_DrawPenStyle ( DRAWPENSTYLE_SOLID );
LEADRasterFXD1->set_DrawMode ( DRAWMODE_INVERT );
LEADRasterFXD1->set_DrawFillStyle ( DRAWFILLSTYLE_TRANSPARENT );
LEADRasterFXD1->set_DrawPersistence ( false ); // On the window, not the bitmap
//Save the previous ending mouse position
OldEndX = EndX;
OldEndY = EndY;
//Get the current mouse position->
EndX = x;
EndY = y;
//Calculate the origin of the current object
if (EndX > StartX)
DrawX = StartX;
else
DrawX = EndX;

if (EndY > StartY)
DrawY = StartY;
else
DrawY = EndY;

//Calculate the origin of the previous object
if (OldEndX > StartX)
OldDrawX = StartX;
else
OldDrawX = OldEndX;

if (OldEndY > StartY)
OldDrawY = StartY;
else
OldDrawY = OldEndY;

//Calculate the height and width of the current object
NewHeight = abs(StartY - EndY);
NewWidth = abs(StartX - EndX);
//Calculate the height and width of the previous object
OldHeight = abs(StartY - OldEndY);
OldWidth = abs(StartX - OldEndX);
//Erase the old object and draw the new one
h_DC = (HDC)LEADRasterView1->GetClientDC ();
switch (DrawObject)
{
case 0: //Ellipse
{
LEADRasterFXD1->DrawEllipse (NULL, (long)h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
LEADRasterFXD1->DrawEllipse (NULL, (long)h_DC, DrawX, DrawY, NewWidth, NewHeight);
}
break;
case 1: //Line
{
LEADRasterFXD1->DrawLine (NULL, (long)h_DC, StartX, StartY, OldEndX, OldEndY);
LEADRasterFXD1->DrawLine (NULL, (long)h_DC, StartX, StartY, EndX, EndY);
}
break;
case 2: //Rectangle
{
LEADRasterFXD1->DrawRectangle (NULL, (long)h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
LEADRasterFXD1->DrawRectangle (NULL, (long)h_DC, DrawX, DrawY, NewWidth, NewHeight);
}
break;

default:
break;
}
LEADRasterView1->ReleaseClientDC ();
}
}

7.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows. This code sets the drawing style and draws the object on the bitmap.

void __fastcall TForm1::LEADRasterView1MouseUp2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Declare local variables.
float DrawX, DrawY, NewWidth, NewHeight;

//Set the drawing style.
LEADRasterFXD1->set_DrawPenStyle ( DRAWPENSTYLE_SOLID );
LEADRasterFXD1->set_DrawPenWidth ( 2 );
LEADRasterFXD1->set_DrawPenColor ( RGB(255, 0, 0) );//Red
LEADRasterFXD1->set_DrawMode ( DRAWMODE_COPY_PEN );
LEADRasterFXD1->set_DrawFillColor ( RGB(0, 255, 0) ); //Green;
LEADRasterFXD1->set_DrawFillStyle ( DRAWFILLSTYLE_HORIZONTAL_LINE );
LEADRasterFXD1->set_DrawPersistence ( true );//On the bitmap
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the object
if (EndX > StartX)
DrawX = StartX;
else
DrawX = EndX;

if (EndY > StartY)
DrawY = StartY;
else
DrawY = EndY;
//Determine the height and width of the object
NewHeight = abs(StartY - EndY);
NewWidth = abs(StartX - EndX);
//Draw the object
switch(DrawObject)
{
case 0: //Ellipse
LEADRasterFXD1->DrawEllipse (LEADRasterView1->Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
case 1: //Line
LEADRasterFXD1->DrawLine (LEADRasterView1->Raster, 0, StartX, StartY, EndX, EndY);
break;
case 2: //Rectangle
LEADRasterFXD1->DrawRectangle (LEADRasterView1->Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
}
LEADRasterView1->ForceRepaint ();
}

8.

Run your program to test it.


Cropping a Bitmap (C++ Builder 6.0)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Process object library (14.5). Press OK.
3. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
4. | Add the following variables to the Private section in your main form:

bool Cropping; //the state when the mouse is used for cropping
int StartX; //Starting X position in screen pixels
int StartY; //Starting Y position in screen pixels
int EndX; //Ending X position in screen pixels
int EndY; //Ending Y position in screen pixels

5. | Add a button to your form and name it as follows:
 | Put it at the top of the form to keep it away from the image.
 | Name | Caption
 | btnCropping | Cropping
6. | Code the btnCropping click’s procedure as the following, in online help; you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnCroppingClick(TObject *Sender)
{
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1->ScaleMode = 1;
//Initialize cropping so that you can do it more than once
if (Cropping)
{
//Set the clipping area to match the image->
LEADRasterView1->SetDstClipRect (LEADRasterView1->DstLeft,
LEADRasterView1->DstTop,
LEADRasterView1->DstWidth,
LEADRasterView1->DstHeight);
//Display the image
LEADRasterView1->ForceRepaint ();
}
//Set a global variable to let other events know that you are cropping
Cropping = true;
//Set the pointer to a crosshair
LEADRasterView1->MousePointer = 2;
}

7.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows.

void __fastcall TForm1::LEADRasterView1MouseDown2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
//Save the starting position
StartX= x;
StartY= y;
//Make the rubberband invisible until the mouse moves
LEADRasterView1->RubberBandVisible = False;
}

8.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

void __fastcall TForm1::LEADRasterView1MouseMove2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
float rbX, rbY, rbWidth, rbHeight;

if ((Cropping) && (Button == 1))
{
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the rubberband rectangle, regardless of which way the mouse moves
if (EndX > StartX)
rbX = StartX;
else
rbX = EndX;

if (EndY > StartY)
rbY = StartY;
else
rbY = EndY;
//Determine the height and width of the rubberband rectangle
rbHeight = abs(StartY - EndY);
rbWidth = abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1->SetRubberBandRect (rbX, rbY, rbWidth, rbHeight);
//Alternatively, you could use the following properties to set the
//rubberband rectangle->
LEADRasterView1->RubberBandHeight = rbHeight;
LEADRasterView1->RubberBandLeft = rbX;
LEADRasterView1->RubberBandTop = rbY;
LEADRasterView1->RubberBandWidth = rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1->RubberBandVisible = true;
}
}

9.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

void __fastcall TForm1::LEADRasterView1MouseUp2 (TObject *Sender,
short Button, short Shift, long x, long y)
{
float CropLeft, CropTop, CropWidth, CropHeight;
if (Cropping)
{
//Get the current mouse position
EndX= x;
EndY= y;
//Get the origin of the clipping rectangle->
//Allow for different mouse drag directions
if (StartX < EndX)
CropLeft = StartX;
else
CropLeft = EndX;

if (StartY < EndY)
CropTop = StartY;
else
CropTop = EndY;
//Get the height and width of the cropped area
CropWidth = abs(EndX - StartX);
CropHeight = abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1->SetDstClipRect (CropLeft, CropTop, CropWidth, CropHeight);
LEADRasterView1->ForceRepaint () ;
LEADRasterView1->RubberBandVisible = false;
LEADRasterView1->MousePointer = crDefault;
}
}

10. | Add a button to your form. It will be used to trim the bitmap in memory and redisplay the bitmap. Put it at the top of the form to keep it away from the image, name it as follows:
 | Name | Caption
 | btnTrim | Trim
11. | Code the btnTrim click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnTrimClick(TObject *Sender)

{

float XFactor, YFactor;
float NewLeft, NewTop, NewWidth, NewHeight;
float HeightFactor, WidthFactor;
float HeightAllowed, WidthAllowed;

Screen->Cursor = crHourGlass;
//Use the clipping rectangle's percentage offsets in the image rectangle
//to determine the trimmed rectangle in the bitmap.
//Using percentages allows for the possibility that the image is zoomed.
XFactor = LEADRasterView1->Raster->BitmapWidth / LEADRasterView1->DstWidth;
YFactor = LEADRasterView1->Raster->BitmapHeight / LEADRasterView1->DstHeight;
NewTop = (LEADRasterView1->DstClipTop - LEADRasterView1->DstTop) * YFactor;
NewLeft = (LEADRasterView1->DstClipLeft - LEADRasterView1->DstLeft) * XFactor;
NewWidth = LEADRasterView1->DstClipWidth * XFactor;
NewHeight = LEADRasterView1->DstClipHeight * YFactor;
//Make sure display rectangles are automatically adjusted.
LEADRasterView1->AutoSetRects = True;
//Trim the bitmap.
LEADRasterProcess1->Trim ( LEADRasterView1->Raster, NewLeft, NewTop, NewWidth, NewHeight);

//Size and redisplay the control, using the new bitmap size.
//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1->Raster->BitmapHeight;
WidthFactor = LEADRasterView1->Raster->BitmapWidth;
HeightAllowed = Height - (Height / 4);
WidthAllowed = Width - (Width / 4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.

//Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1->Left = Width / 8;
LEADRasterView1->Width = WidthAllowed;
LEADRasterView1->Height = (LEADRasterView1->Width * HeightFactor) / WidthFactor;
LEADRasterView1->Top = (Height - LEADRasterView1->Height) / 2;
}
else
{
LEADRasterView1->Top = Height / 8;
LEADRasterView1->Height= HeightAllowed;
LEADRasterView1->Width = (LEADRasterView1->Height * WidthFactor) / HeightFactor;
LEADRasterView1->Left = (Width - LEADRasterView1->Width) / 2;
}
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1->AutoScroll = False;
//Set the image display size to match the LEAD control
LEADRasterView1->SetDstRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight );
LEADRasterView1->SetDstClipRect (0, 0, LEADRasterView1->ScaleWidth, LEADRasterView1->ScaleHeight ) ;
//Display the image
LEADRasterView1->ForceRepaint ();
Screen->Cursor = crDefault;
}

12.

Run your program to test it.


Creating, Viewing, and Merging Color Separations (C++ Builder 6.0)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Put it at the top of the form to keep it away from the image.
 | Name | Caption
 | btnDoSeparations | Do Separations
3. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Process object library (14.5). Press OK.
4. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Add the following variables to “Unit1.h” file private declarations section.

//Count the button clicks and take the next step with each click
int ClickCount;

6.

Add the following code to the end of the form's Create procedure.

ClickCount:= 0 ;

7.

Code the btnDoSeparations click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::btnDoSeparationsClick(TObject *Sender)
{
AnsiString Msg;

Cursor = crHourGlass;
//Turn off the automatic display rectangles.
LEADRasterView1->AutoSetRects = False;
LEADRasterView1->Raster->RefBitmap = False;
switch (ClickCount)
{
case 0:
{
LEADRasterProcess1->ColorSeparate ( LEADRasterView1->Raster, COLORSEP_CMYK ) ;
//Just for fun, add contrast to the K plane
LEADRasterView1->Raster->Bitmap = LEADRasterProcess1->get_ColorPlanes(3) ;//Copy the K plane
LEADRasterProcess1->Contrast(LEADRasterView1->Raster, 300) ;//Increase the contrast
LEADRasterProcess1->set_ColorPlanes (3, LEADRasterView1->Raster->Bitmap) ;//Update the K plane
Msg = "Separated. Keep clicking to see separations, then merge";
ShowMessage (Msg) ;
}
break;
case 1:
{
LEADRasterView1->Raster->Bitmap = LEADRasterProcess1->get_ColorPlanes(0); //Cyan
LEADRasterView1->ForceRepaint ( );
}
break;
case 2:
{
LEADRasterView1->Raster->Bitmap = LEADRasterProcess1->get_ColorPlanes(1); //Magenta
LEADRasterView1->ForceRepaint ( ) ;
}
break;
case 3:
{
LEADRasterView1->Raster->Bitmap = LEADRasterProcess1->get_ColorPlanes (2); //Yellow
LEADRasterView1->ForceRepaint ( );
}
break;

case 4:
{
LEADRasterView1->Raster->Bitmap = LEADRasterProcess1->get_ColorPlanes(3); // K
LEADRasterView1->ForceRepaint ( );
}
break;

case 5:
{
LEADRasterProcess1->ColorMerge ( LEADRasterView1->Raster, COLORSEP_CMYK ) ;
LEADRasterView1->ForceRepaint ( );
LEADRasterProcess1->set_ColorPlanes(0, 0);
LEADRasterProcess1->set_ColorPlanes(1, 0);
LEADRasterProcess1->set_ColorPlanes(2, 0);
LEADRasterProcess1->set_ColorPlanes (3, 0);
Msg = "Merged, with more contrast in the K plane";
ShowMessage (Msg);
}
break;

default:
{
ClickCount = -1;
Msg = "Cycle is finished";
ShowMessage ( Msg ) ;
}
}
ClickCount++;
Cursor= crDefault;
}

8.

Run your program to test it. Notice that you can click the button several times to create the separations, view each of them, and merge them to recreate the original bitmap.


Updating a Gauge and Detecting a User Interrupt (C++ Builder 6.0)

Updating a Gauge and Detecting a User Interrupt (C++ Builder)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add 2 Button controls to your main form. Put them at the top of the form to keep them away from the image. Name them as follows:
 | Name | Caption
 | btnMedian | Do Median
 | btnQuit | Quit
3. | Add a TrackBar control to your main Form, and change the Max property of it to 100.
4. | On the Project pull-down menu, use the Import Type library… and install the LEAD Raster Process object library (14.5). Press OK.
5. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
6. | Add the following variables to the Private section of “Unit1.h” file:

bool fEscape; //Use to indicate the user interrupt
bool fInProc; //Use to avoid closing the form during processing

7.

Code the btnMedian Click’s procedure as follows:

void __fastcall TForm1::btnMedianClick(TObject *Sender)
{
//Enable the ProgressStatus event
LEADRasterProcess1->set_EnableProgressEvent ( true );
//Initialize the indicators
fEscape = false; //The user does not want to quit
fInProc = true; //Processing is taking place
//Perform a relatively slow median filter
LEADRasterProcess1->Median (LEADRasterView1->Raster, 4);
//Clean up
fInProc = False; //Processing is no longer taking place
LEADRasterView1->ForceRepaint ();
}

8.

Handle the LEADRasterProcess1’s OnProgressStatus and code LEADRasterProcess1ProgressStatus as follows:

void __fastcall TForm1::LEADRasterProcess1ProgressStatus(TObject *Sender,
short iPercent)
{
Application->ProcessMessages (); //Detect Windows events
if (!fEscape) // Look for the Click on the Quit button
{
TrackBar1->Position= iPercent;
}
else
LEADRasterProcess1->set_EnableProgressEvent ( false ); //Cancel the task
}

9.

Code the btnQuit click’s procedure as follows:

void __fastcall TForm1::btnQuitClick(TObject *Sender)
{
fEscape= True; //The user wants to quit
TrackBar1->Position= 0 ;
}

10.

Handle the Form1 OnCloseQuery event, and code FormCloseQuery procedure as follows:

void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose)
{
if (fInProc) //If processing is taking place
CanClose= false; //Do not let the user close the form
}

11.

Run your program to test it.


Using a PanWindow (C++ Builder 6.0)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Replace FormCreate Procedure to be as the following.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
//Set defaults for displaying the image
//These are all persistent properties that can be set in the properties box->
LEADRasterView1->Appearance = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle = 1;
LEADRasterView1->BackColor = (TColor)RGB(255, 255, 125);
LEADRasterView1->PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint = True;
LEADRasterView1->AutoSize = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_NORMAL;
}

3. | Add a Check Box control to your form and name it as follows:
 | Name | Caption
 | chkPanWin | Pan Window
4. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnPanWindow | Show Pan Window
5. | Code the btnPanWindow click’s procedure as the following:

void __fastcall TForm1::btnPanWindowClick(TObject *Sender)
{
LEADRasterView1->BackErase = False;
//set the location of the PanWindow
LEADRasterView1->PanWinX = 100;
LEADRasterView1->PanWinY = 100;
//set the size of the PanWindow
//requested width
LEADRasterView1->PanWinWidth = 150;
//requested height
LEADRasterView1->PanWinHeight = 200;

LEADRasterView1->PanWinPointer = 12;
LEADRasterView1->PanWinTitle = "PanWindow";
LEADRasterView1->PanWinRectColor = (TColor)RGB(0, 0, 255);
LEADRasterView1->PanWinSysMenu = True;
//use the settings for LEADRasterView1.
LEADRasterView1->PanWinPaintPalette = LEADRasterView1->PaintPalette;
LEADRasterView1->PanWinBitonalScaling = LEADRasterView1->BitonalScaling;
LEADRasterView1->PanWinPaintScaling = LEADRasterView1->PaintScaling;
LEADRasterView1->PanWinPaintDither = LEADRasterView1->PaintDither;
//show the Pan Window
LEADRasterView1->ShowPanWin (true);
chkPanWin->Checked= true;

}

6.

Code the LEADRasterView1 OnPanWin event procedure as follows:

void __fastcall TForm1::LEADRasterView1PanWin(TObject *Sender,
long hPanWin, short iFlag)
{
if (iFlag == PANWIN_DESTROYED)
chkPanWin->Checked= false ;//indicate no more Pan Window
}

7.

Run your program to test it.


Using the Magnifying Glass (C++ Builder 6.0)

Using the Magnifying Glass (C++ Builder)

Take the following steps to enable the generation of the MagGlassExt event and updating the zoomed image using the Internet COM object toolkit.

1. | Start C++ Builder.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press install.
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Internet Object Library (14.5).
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5).
5. | Select the LEAD RasterView control; and add the control to your main form. Size and position the control, as you want it to appear at run time.
6. | From the ActiveX controls tab, add the LEAD Raster Inet, and LEAD Raster IO controls to your form.
7. | Add seven command buttons to your main form and name them as follows:
 | Name | Caption
 | btnStartUpServer | Start Up Server.
 | btnShutDownServer | Shut Server Down.
 | btnConnectToRemoteServer | Connect To Remote Server.
 | btnDisconnectFromRemoteServer | Disconnect From Remote Server.
 | btnLoadRemoteImage | Load Remote Image.
 | btnStartMagnifyingGlass | Start Magnifying Glass.
 | btnStopMagnifyingGlass | Stop Magnifying Glass.
8. | Add an Edit box to your main form and name it as follows:
 | Name
 | edtRemoteComputer.
9. | Set the Text property to the name of the computer you will use as a server.
10. | Declare the following in the Private section of “Unit1.h”.

short hServer; //handle to server
long gnCommandID;
bool bMagGlass;

11.

Handle the Form1 OnCreate event, and code FormCreate procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
// Initialize some variables
hServer = 0;
gnCommandID = 0;
bMagGlass = False;

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.
LEADRasterView1->Appearance = RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1->BorderStyle = 1;
LEADRasterView1->BackColor = (TColor)RGB(255, 255, 125);
LEADRasterView1->PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1->PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView1->AutoRepaint = True;
LEADRasterView1->AutoSize = False;
LEADRasterView1->AutoSetRects = True;
LEADRasterView1->PaintSizeMode = PAINTSIZEMODE_FIT;
// Unlock support for the Inet object.
// Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
// RasterIO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1->EnableMethodErrors = False;
LEADRasterIO1->set_EnableMethodErrors ( false );
LEADRasterInet1->set_EnableMethodErrors ( 0 );
}

12.

Handle the Form1 OnDestroy event, and code FormDestroy procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

void __fastcall TForm1::FormDestroy(TObject *Sender)
{
short i;
//Disconnect all connections
for (i = 0; i < LEADRasterInet1->ConnectListNum ; i ++)
LEADRasterInet1->InetDisconnect
  (LEADRasterInet1->get_ConnectList  (i));

if (bMagGlass)
LEADRasterView1->StopMagGlass ();
}

13.

Code the btnStartUpServer button's click procedure as follows:

void __fastcall TForm1::btnStartUpServerClick(TObject *Sender)
{
int nRet;
//Initialize server on port 1000
nRet= LEADRasterInet1->InetServerInit
  (1000);
hServer= LEADRasterInet1->InetServerHandle
 ;
if (nRet != 0)
ShowMessage ("Error initializing server: " + IntToStr(nRet));
}

14.

Code the btnShutDownServer button's click procedure as follows:

void __fastcall TForm1::btnShutDownServerClick(TObject *Sender)
{
int nRet;
if (hServer != 0)
{
nRet= LEADRasterInet1->InetServerClose (hServer);

if (nRet != 0)
ShowMessage ("Error Shutting Down server: " + IntToStr(nRet));
else
hServer= 0;
}
}

15.

Code the btnConnectToRemoteServer button's click procedure as follows:

void __fastcall TForm1::btnConnectToRemoteServerClick(TObject *Sender)
{
int nRet;
//Connect to remote computer on port 1000 nRet= LEADRasterInet1->InetConnect (AnsiToOLESTR(edtRemoteComputer->Text.c_str()), 1000);

if (nRet != 0)
ShowMessage ("Error connecting to " + edtRemoteComputer->Text + ": " + IntToStr(nRet));
}

16.

Code the btnDisconnectFromRemoteServer button's click procedure as follows:

void __fastcall TForm1::btnDisconnectFromRemoteServerClick(TObject *Sender)
{
int nRet;
/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList*/
nRet= LEADRasterInet1->InetDisconnect
  (LEADRasterInet1->get_SendList  (0));
if (nRet != 0)
ShowMessage ("Error disconnecting from remote: " + IntToStr(nRet));
}

17.

Code the btnLoadRemoteImage button's click procedure as follows:

void __fastcall TForm1::btnLoadRemoteImageClick(TObject *Sender)
{
int nRet;

nRet= LEADRasterInet1->InetSendLoadCmd
  (999, AnsiToOLESTR("v:\\images\\Eagle.cmp"), 0, 1);

if ((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
ShowMessage ("ERROR " + IntToStr(nRet) + " calling InetSendLoadCmd.");
}

18.

Code the btnStartMagnifyingGlass button's click procedure as follows:

void __fastcall TForm1::btnStartMagnifyingGlassClick(TObject *Sender)
{
int nRet;

if ((LEADRasterView1->Raster->Bitmap != 0) && (hServer == 0))
{
//Enable MagGlassExt event.
if (LEADRasterView1->EnableMagGlassEvent == False)
LEADRasterView1->EnableMagGlassEvent = True;

LEADRasterView1->RgnFrameType = 0;

//Start the Magnifying Glass
nRet= LEADRasterView1->StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True);

if (nRet == 0)
bMagGlass= True;
}
}

19.

Code the btnStopMagnifyingGlass button's click procedure as follows:

void __fastcall TForm1::btnStopMagnifyingGlassClick(TObject *Sender)
{
int nRet;

if ((LEADRasterView1->Raster->Bitmap != 0) && (hServer == 0))
{
nRet= LEADRasterView1->StopMagGlass ();

if (nRet == 0)
bMagGlass= false;
}
}

20.

Handle the LEADRasterInet1 OnInetAccept event, and code LEADRasterInet1InetAccept as follows:

void __fastcall TForm1::LEADRasterInet1InetAccept
  (TObject *Sender,
short iServer)
{
int nRet;
short iComputer;
BSTR   bstrHostName;
AnsiString szHostName;

nRet= LEADRasterInet1->InetAcceptConnect
  (hServer);
iComputer= LEADRasterInet1->InetConnectedComputer
 ;
if (nRet != 0)
{
ShowMessage ("Error accepting connection: " + IntToStr(nRet));
return;
}

LEADRasterInet1->InetGetHostName
 (iComputer, HOST_NAME_DESCRP);
bstrHostName= LEADRasterInet1-> InetHostName
 ;
//Add to our list
LEADRasterInet1->set_SendList (LEADRasterInet1->SendListNum , iComputer );
szHostName=bstrHostName;
ShowMessage ("Connection accepted from: " + szHostName);
}

21.

Handle the LEADRasterInet1 OnInetConnected event, and code LEADRasterInet1InetConnected as follows:

void __fastcall TForm1::LEADRasterInet1InetConnected
  (TObject *Sender,
short iComputer )
{
BSTR  bstrHostName;
AnsiString szHostName;

//Get remote host name
LEADRasterInet1->InetGetHostName
  (iComputer, HOST_NAME_DESCRP);
bstrHostName= LEADRasterInet1-> InetHostName
 ;
//Add this connection to our SendList
LEADRasterInet1->set_SendList (LEADRasterInet1->SendListNum, iComputer );
szHostName= bstrHostName;
ShowMessage ("Successfully connected to remote computer: " + szHostName );
}

22.

Handle the LEADRasterInet1 OnInetDisconnected event, and code LEADRasterInet1InetDisconnected as follows:

void __fastcall TForm1::LEADRasterInet1InetDisconnected
 (TObject *Sender,
short iComputer)
{
if (hServer == 0)
ShowMessage ("Disconnect from remote server");
else
ShowMessage ("Connection to remote computer closed");
}

23.

Handle the LEADRasterInet1 OnInetReceiveCmd event, and code LEADRasterInet1InetReceiveCmd as follows:

void __fastcall TForm1::LEADRasterInet1InetReceiveCmd
 (TObject *Sender,
short iComputer, short InetCommand, long nCommandID, short nError,
ILEADRasterInetPacket *Params, long nExtraDataSize,
ILEADRasterVariant *pExtraData)
{
BSTR bstrName;
ILEADRasterVariant* pColorBuffer= NULL;
ILEADRasterVariant* pString= NULL;

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pColorBuffer);

CoCreateInstance( CLSID_LEADRasterVariant,
NULL,
CLSCTX_ALL,
IID_ILEADRasterVariant,
(void**)&pString);
int nStatus= ERROR_FEATURE_NOT_SUPPORTED;

if (nError != 0)
nStatus= ERROR_TRANSFER_ABORTED;
else
{
switch (InetCommand)
{
case INETCMD_LOAD:
{
//check the validity of the parameters
if ((Params->ParamCount == 4) &&
(Params->get_ParamType(0) == PARAM_TYPE_STRING) &&
(Params->get_ParamType(1) == PARAM_TYPE_INT32) &&
(Params->get_ParamType(2) == PARAM_TYPE_INT32) &&
(Params->get_ParamType(3) == PARAM_TYPE_UINT32))
{
nStatus= LEADRasterIO1->Load(LEADRasterView1->Raster,
Params->get_ParamValue(0)->StringValue,
Params->get_ParamValue(1)->LongValue,
1,
1);

if (nStatus != 0)
ShowMessage ("Load Bitmap failed with error code: " + IntToStr(nStatus));
else
{
nStatus= LEADRasterInet1->InetSendBitmap (LEADRasterView1->Raster, FILE_CMP, 0, QFACTOR_PQ2);

if (nStatus != 0)
ShowMessage ("SendBitmap failed with error code: " + IntToStr(nStatus));
}
}
else
nStatus= ERROR_INV_PARAMETER;    //Invalid parameters

LEADRasterInet1->InetSendLoadRsp (nCommandID, 0, 0, NULL, (short)nStatus);
return;
}

case INETCMD_GET_MAGGLASS_DATA:
{
//check the validity of the parameters
if ((Params->ParamCount == 5) && (Params->get_ParamType(0) == PARAM_TYPE_UINT32)
&& (Params->get_ParamType(1) == PARAM_TYPE_UINT32) && (Params->get_ParamType(2) == PARAM_TYPE_USTRING)
&& (Params->get_ParamType(3) == PARAM_TYPE_INT32) && (Params->get_ParamType(4) == PARAM_TYPE_INT32))
{
if (LEADRasterView1->Raster->Bitmap != 0)
{
pString->Type = VALUE_STRING;
pString->set_StringValue ( Params->get_ParamValue(2)->StringValue );
nStatus= LEADRasterInet1->InetGetMagGlassData (LEADRasterView1->Raster,
pColorBuffer,
pString,
Params->get_ParamValue(3)->LongValue,
Params->get_ParamValue(4)->LongValue);
if (nStatus != 0)
ShowMessage ("InetGetMagGlassData failed with error code: " + IntToStr(nStatus));
}
else
nStatus= ERROR_INV_PARAMETER;   //Invalid parameter
}
else
nStatus= ERROR_INV_PARAMETER;    //Invalid parameters
pString->Type = VALUE_STRING;
pString->set_StringValue ( Params->get_ParamValue(2)->StringValue );
LEADRasterInet1->InetSendGetMagGlassDataRsp (nCommandID,
pColorBuffer,
pString,
Params->get_ParamValue(3)->LongValue,
Params->get_ParamValue(4)->LongValue,
0,
NULL,
(short)nStatus);
return;
}
}
}

if ( pColorBuffer )
pColorBuffer->Release ( );

if ( pString )
pString->Release ( );

LEADRasterInet1->InetSendRsp
 ((InetCmdType)InetCommand, nCommandID, NULL, 0, NULL, (short)nStatus);
}

24.

Handle the LEADRasterInet1 OnInetReceiveRsp event, and code LEADRasterInet1InetReceiveRsp as follows:

void __fastcall TForm1::LEADRasterInet1InetReceiveRsp
  (TObject *Sender,
short iComputer, short InetCommand, long nCommandID, short nError,
short nStatus, ILEADRasterInetPacket *Params, long nExtraDataSize,
Variant ExtraData)
{
int nRet;

if (nError != 0)
return;

switch (InetCommand)
{
case INETCMD_LOAD:
{
if (nStatus != 0)
ShowMessage ("Load failed with error code: " + IntToStr(nStatus));
}
break;

case INETCMD_GET_MAGGLASS_DATA:
{
if (nStatus == 0)
{
if ((Params->ParamCount == 6) &&
(Params->get_ParamType(0) == PARAM_TYPE_UINT32) &&
(Params->get_ParamType(1) == PARAM_TYPE_USTRING) &&
(Params->get_ParamType(2)== PARAM_TYPE_UINT32) &&
(Params->get_ParamType(3) == PARAM_TYPE_USTRING) &&
(Params->get_ParamType(4)== PARAM_TYPE_INT32) &&
(Params->get_ParamType(5) == PARAM_TYPE_INT32))
{
nRet= LEADRasterView1->UpdateMagGlass (Params->get_ParamValue(1), Params->get_ParamValue(3), Params->get_ParamValue(4).lVal, Params->get_ParamValue(5).lVal, true);

if (nRet != 0)
ShowMessage ("UpdateMagGlass failed with error code: " + IntToStr(nRet));
}
else
ShowMessage ("Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response");
}
else
ShowMessage ("Get MagGlass Data from server with error code " + IntToStr(nStatus));
}
break;
}
}

25.

Code the LEADRasterView1’s OnMagGlassExt event as follows:

void __fastcall TForm1::LEADRasterView1MagGlassExt(TObject *Sender,
long nMaskPlaneStart, long nMaskPlaneEnd, ILEADRasterVariant* pvMaskPlane)
{
int nRet;

gnCommandID++;

nRet= LEADRasterInet1->InetSendGetMagGlassDataCmd (gnCommandID, 0, pvMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if ((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
ShowMessage ("ERROR " + IntToStr(nRet) + " calling InetSendGetMagGlassDataCmd.");

}

26.

At the beginning of the Unit1.h file, include this file:

#include "E:\LEAD14\Dist\include\L_OcxErr.h" /* change the path to be compatible with the file in your PC*/

27. | Run the exe file two times to execute two applications.
28. | In the first application press the Start Up Server button.
29. | In the second application fill the edit box with the IP Address of the Remote computer on which you ran the first application as Server, then press the Connect To Remote Server button to connect to the specified address.
30. | After that, press the Load Remote Image button of application number two to load an image on the Server. Then press the Start Magnifying Glass button to start the magnifying glass with Internet support. Press the left key and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Print a Real Image Size in Inches (C++ Builder 6.0)

Take the following steps to start a project and to add some code that prints an image:

1. | Start C++ Builder 6.
2. | If you didn’t install LEAD RasterView Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5). Press Install, and then compile and install the package dclusr40.bpk.
3. | Select the LEAD RasterView control and add it to your form. Size and position the control, as you want it to appear at run time.
4. | If you didn’t import LEAD Raster IO before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5). Press install, and then compile and install the package dclusr.bpk.
5. | From the ActiveX controls tab, add the LEAD Raster IO to your form.
6. | Add a button control to your form and name it as follows:
 | Name | Caption
 | btnPrint | Print
7. | Declare the following variables in the private section of “Unit1.h”.

float fRealWidth; //Image real width in inches
float fRealHeight;// Image real height in inches
int XRes; // Number of pixels per logical inch along the screen width.
int YRes; // Number of pixels per logical inch along the screen Height.

8.

Handle the btnPrint button's click procedure and code the btnPrintClick procedure as follows. This code loads an image.

void __fastcall TForm1::btnPrintClick(TObject *Sender)
{
LEADRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR ("c:\\image1.cmp"), 0, 0, 1 );
}

9.

You should now calculate the real width and height of the bitmap in inches. Add the following code to btnPrintClick procedure:

fRealWidth= LEADRasterView1->Raster->BitmapWidth / LEADRasterView1->Raster->BitmapXRes;
fRealHeight= LEADRasterView1->Raster->BitmapHeight / LEADRasterView1->Raster->BitmapYRes;

10.

Now you are ready to print the image with real size in inches. Add the following code to btnPrintClick procedure:

LEADRasterView1->Render ((int)Printer()->Canvas->Handle,
1,
1,
(int)(XRes * fRealWidth),
(int)(YRes * fRealHeight) ) ;
Printer()->EndDoc ( );

11.

Include the following file in “Unit1.h”

#include <printers.hpp>

12.

Run your program to test it.


Combining Images with Regions (C++ Builder 6.0)

1. | Start C++ Builder 6.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press install, and then compile and install the package dclusr.bpk.
3. | Add 2 of the LEAD Raster View controls to your form. Size and position the controls, as you want them to appear at run time.
4. | If you didn’t import LEAD Raster IO before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5). Press install, and then compile and install the package dclusr.bpk.
5. | If you didn’t import LEAD Raster Process before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process Object Library (14.5). Press Install, and then compile and install the package dclusr.bpk.
6. | From the ActiveX controls tab, add 2 of the LEAD Raster IO controls and 1 LEAD Raster Process control to your form.
7. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnLoad | Load Images
 | btnCombine | Combine
8. | Handle the btnLoad button's OnClick event, and code the btnLoadClick procedure as follows:

void __fastcall TForm1::btnLoadClick(TObject *Sender)
{
LEADRasterIO1->Load ( LEADRasterView1->Raster, AnsiToOLESTR("r:\\images\\image1.cmp"), 0, 1, 1 ) ;
LEADRasterIO2->Load ( LEADRasterView2->Raster, AnsiToOLESTR("r:\\images\\image2.cmp"), 0, 1, 1 ) ;
}

9.

Handle the btnCombine button's OnClick event, and code the btnCombineClick procedure as follows:

void __fastcall TForm1::btnCombineClick(TObject *Sender)
{
int nDstLeft;
int nDstTop;
int nSrcLeft;
int nSrcTop;
int nDstWidth;
int nDstHeight;
TRect rClientArea;

::GetClientRect ( LEADRasterView1->Handle, &rClientArea );
LEADRasterView1->Raster->SetRgnRect( (int)(rClientArea.right/8),
(int)(rClientArea.bottom/8),
(int)(rClientArea.right/2),
(int)(rClientArea.bottom/2),
L_RGN_SET);

nDstLeft = (int)(LEADRasterView1->Raster->BitmapWidth /8 );
nDstTop = (int)(LEADRasterView1->Raster->BitmapHeight /8 );
nDstWidth = (int)(LEADRasterView1->Raster->BitmapWidth );
nDstHeight= (int)(LEADRasterView1->Raster->BitmapHeight );
nSrcLeft = 0;
nSrcTop = 0;

LEADRasterProcess1->Combine( LEADRasterView1->Raster, nDstLeft, nDstTop, nDstWidth, nDstHeight, LEADRasterView2->Raster, nSrcLeft, nSrcTop, CB_OP_ADD + CB_DST_0);
}

10.

Run your program to test it.


Tutorial for Delphi Programmers

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

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Using ODBC to Access Image Data

Implementing a Database with the MS ADO Data Control

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap (Delphi 4.0)

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Using the Magnifying Glass

Using a PanWindow

Mosaic example for Delphi


Loading and Displaying an Image (Delphi 4.0)

Take the following steps to start a project and to add some code that displays an image on the main form:

1. | Start Delphi 4.0.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control, as you want it to appear at run time.
4. | Add a button to your form and name it as follows:
 | Name | Caption
 | LoadLead | Load Image
5. | Code the main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormCreate(Sender: TObject);
begin
//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance := RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette:= PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;
LEADRasterView1.EnableFireMouse2Event:= true;
end;

6.

Code the LoadLead button's click procedure as follows:

procedure TForm1.LoadLeadClick(Sender: TObject);
var
RasterIO: ILEADRasterIO;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
RasterIO.Load ( LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1 ) ;
end;

7. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14), and Press Ok.
8. | At the beginning of the Unit1 file, add ComObj, LTRASTERLib_TLB, and LTRASTERIOLib_TLB to the uses section to handle Com objects, use the constants in Delphi, and handle the Raster IO object library. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComObj, LTRASTERLib_TLB, LTRASTERIOLib_TLB;

9. | Run your program to test it.
10. | Save the project to use as a starting point for other tasks in this tutorial.


Zooming Out and Zooming In (Delphi 4.0)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD RasterView control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add two buttons to your form and name them as follows:
 | Name | Caption
 | ZoomIn | Zoom In
 | ZoomOut | Zoom Out
3. | Code the ZoomIn button's click procedure as follows:

procedure TForm1.ZoomInClick(Sender: TObject);
begin
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_ZOOM;
LEADRasterView1.PaintZoomFactor := LEADRasterView1.PaintZoomFactor + 10;
end;

4.

Code the ZoomOut button's click procedure as follows:

procedure TForm1.ZoomOutClick(Sender: TObject);
begin
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_ZOOM;
if ( LEADRasterView1.PaintZoomFactor > 10 ) then
LEADRasterView1.PaintZoomFactor:= LEADRasterView1.PaintZoomFactor - 10;
end;

5.

Run your program to test it.


Dynamically Positioning the Control (Delphi 4.0)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the LeadLoad button's click procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying anImage.

procedure TForm1.LoadLeadClick(Sender: TObject);
var
RasterIO: ILEADRasterIO;
HeightFactor: longint;
WidthFactor: longint;
HeightAllowed: longint;
WidthAllowed: longint;
Ret: smallint;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
//Position and size the main form so that it takes up most of the screen.
Width := Trunc ( Screen.Width * 0.9 ) ;
Height := Trunc ( Screen.Height* 0.8);
Left := Trunc ( (Screen.Width - Width) / 2);
TOP := Trunc ( (Screen.Height - Height) / 2);
//Turn off automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.AutoScroll := False;
LEADRasterView1.BackErase := False;
//Load the bitmap. This hard-coded path name may be different on your system.
RasterIO.Load ( LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1 ) ;

//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor := Trunc ( LEADRasterView1.Raster.BitmapHeight);
WidthFactor := Trunc ( LEADRasterView1.Raster.BitmapWidth);
HeightAllowed := trunc ( Height * 3/4);
WidthAllowed := trunc ( Width * 3/4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
begin
LEADRasterView1.Left := Trunc ( Width / 8);
LEADRasterView1.Width := WidthAllowed;
LEADRasterView1.Height := Trunc ( (LEADRasterView1.Width * HeightFactor) / WidthFactor);
LEADRasterView1.TOP := TRunc((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.TOP := Trunc ( Height / 8 ) ;
LEADRasterView1.Height := HeightAllowed;
LEADRasterView1.Width := Trunc ( (LEADRasterView1.Height * WidthFactor) / HeightFactor);
LEADRasterView1.Left := Trunc((Width - LEADRasterView1.Width) / 2);
end;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect ( 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, Ret);
LEADRasterView1.SetDstClipRect ( 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, Ret);
LEADRasterView1.SetSrcRect ( 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, Ret);
LEADRasterView1.SetSrcClipRect ( 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, Ret);
//Turn on automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoScroll := True;

end;

3.

Run your program to test it.


Zooming In on a Selection (Delphi 4.0)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows. This code selects a different drawing object each time the event occurs.

procedure TForm1.LEADRasterView1MouseDown2(Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Enable AutoRubberBand
LEADRasterView1.AutoRubberBand := True;
LEADRasterView1.MousePointer := 2;
end;

3.

Code the LEADRasterView1 control's Rubberband procedure, as the following:

procedure TForm1.LEADRasterView1RubberBand(Sender: TObject);
var
zoomleft: Integer;
zoomtop: Integer;
zoomwidth: Integer;
zoomheight: Integer;
Ret: Smallint;
begin
LEADRasterView1.MousePointer := 0;
//Zoom in on the selection.
zoomleft := Trunc (LEADRasterView1.RubberBandLeft);
zoomtop := Trunc (LEADRasterView1.RubberBandTop);
zoomwidth := Trunc (LEADRasterView1.RubberBandWidth);
zoomheight := Trunc (LEADRasterView1.RubberBandHeight);
//Zoom in on the rectangle defined by the rubberband
LEADRasterView1.ZoomToRect ( zoomleft, zoomtop, zoomwidth, zoomheight, Ret);
LEADRasterView1.Refresh() ;
end;

4.

Run your program to test it.


Outlining, Dragging, and Pasting a Region (Delphi 4.0)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a second LEAD RasterView control, name it LEADRasterView2, and set its Visible property to False.
 | Note: for simplicity, this example uses 2 controls. In order to save memory, your application could use a dynamically created ILEADRaster object instead of the 2nd LEAD Raster View control.
3. | Add the following form-level variables to the Main Form’s private declarations section. In online help, you can use the Edit pull-down menu to copy the block of code.

{ Private declarations }
ReadyToDrag: boolean ; //The state after marking the region but before dragging
Dragging: boolean; //The state when the mouse is used for dragging the floater
StartX: Single; //Starting X position in screen twips
StartY: Single; //Starting Y position in screen twips
FloaterX: Single; //Floater X position in screen twips
FloaterY: Single; //Floater Y position in screen twips
ZoomFactorX: Single; //Used for translating positioning information
ZoomFactorY: Single; //Used for translating positioning information

4. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | SelRgnBtn | Select Region
 | PasteFloaterBtn | Paste Floater
5. | Code SelRgnBtn control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.SelRgnBtnClick(Sender: TObject);
begin
LEADRasterView1.RgnFrameType := RGNFRAME_ANIMATED;
LEADRasterView1.Raster.RefBitmap:= False ;
LEADRasterView1.RgnMarkingMode:= RGNMARK_FREEHAND;
ShowMessage ( 'Draw a freehand region' ) ;
end;

6.

Code the PasteFloaterBtn control's Click procedure:

procedure TForm1.PasteFloaterBtnClick(Sender: TObject);
var
RasterProc: ILEADRasterProcess;
LCRgnX:Single;
LCRgnY:Single;
LCRgnWidth: Single;
LCRgnHeight: Single;
LBRgnX: Single;
LBRgnY: Single;
LBRgnWidth: Single;
LBRgnHeight:Single;
MyOp: CombineConstants;
Ret : Smallint;
begin
//Do nothing if there is no floater.
if (LEADRasterView1.Floater = 0 ) then
Exit;
RasterProc := CreateComObject ( CLASS_LEADRasterProcess ) as ILEADRasterProcess;
//Get the floater into another bitmap
LEADRasterView2.Raster.RefBitmap:= False;
LEADRasterView2.ScaleMode:= LEADRasterView1.ScaleMode;
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Floater;
//Get the floater's client coordinates into local variables.
LCRgnX := LEADRasterView1.FloaterDstLeft;
LCRgnY := LEADRasterView1.FloaterDstTop;
LCRgnWidth := LEADRasterView1.FloaterDstWidth;
LCRgnHeight := LEADRasterView1.FloaterDstHeight;
//Delete the floater.
LEADRasterView1.FloaterVisible := False;
LEADRasterView1.Floater := 0;
//Translate the client coordinates to bitmap coordinates.
LBRgnX := ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft;
LBRgnY := ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop;
LBRgnWidth := LCRgnWidth / ZoomFactorX;
LBRgnHeight := LCRgnHeight / ZoomFactorY;
//Reposition the region to use as a mask for the Combine method.
LEADRasterView1.Raster.OffsetRgn ( LBRgnX - LEADRasterView1.Raster.Rgnleft, LBRgnY - LEADRasterView1.Raster.Rgntop ) ;
//Use the Combine method to paste the Lead2 bitmap into the Lead1 bitmap.
MyOp := CB_OP_ADD + CB_DST_0 ; //Operation flags for a simple paste.
RasterProc.Combine ( LEADRasterView1.Raster, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2.Raster, 0, 0, MyOp ) ;
//Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect ( LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False, Ret ) ;
//Free the region.
LEADRasterView1.Raster.FreeRgn ( ) ;
end;

7.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows. This code selects a different drawing object each time the event occurs.

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
BitmapX: Single;
BitmapY: Single;
NewX: Single;
NewY:Single;
NewWidth: Single;
NewHeight: Single;
Ret: Smallint ;

begin
//Do nothing if we are drawing a region.
if LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE then
Exit;
//Save the starting position, in case we need it.
StartY := y;
StartX := x;
//If we are ready to drag the selection, get a floater.
if ( ReadyToDrag = True ) then
begin
//Translate the current mouse coordinates.
//These coordinates account for the zoom factor and offset.
ZoomFactorX := LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth;
ZoomFactorY := LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight;
BitmapX := (x / ZoomFactorX) - (LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
BitmapY := (y / ZoomFactorY) - (LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
//Continue to create the floater if the mouse is pointing to the region we marked.

if ( LEADRasterView1.Raster.IsPtInRgn (BitmapX, BitmapY) )then
begin
//Hide the region frame.
LEADRasterView1.RgnFrameType := RGNFRAME_NONE;
//Create the floater bitmap, which will be the part of the main bitmap that is
//in the region's bounding rectangle.
LEADRasterView1.Floater := LEADRasterView1.Raster.Bitmap;
//Translate the bitmap region coordinates to client area coordinates.
NewY := ((LEADRasterView1.Raster.Rgntop - LEADRasterView1.SrcTop) * ZoomFactorY)
+ LEADRasterView1.DstTop;
NewX := ((LEADRasterView1.Raster.Rgnleft - LEADRasterView1.SrcLeft) * ZoomFactorX)
+ LEADRasterView1.DstLeft;
NewWidth := LEADRasterView1.Raster.RgnWidth * ZoomFactorX;
NewHeight := LEADRasterView1.Raster.RgnHeight * ZoomFactorY;
//Set the initial display position of the floater.
LEADRasterView1.SetFloaterDstRect ( NewX, NewY, NewWidth, NewHeight, Ret ) ;
//Set form-level variables.
FloaterY := LEADRasterView1.FloaterDstTop;
FloaterX := LEADRasterView1.FloaterDstLeft;
LEADRasterView1.FloaterVisible := True;
Dragging := True;
ReadyToDrag := False;
end;
end;
end;

8.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

procedure TForm1.LEADRasterView1MouseMove2(Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
xDelta: Single;
yDelta: Single;
NewX: Single;
NewY: Single;
NewWidth: Single;
NewHeight: Single;
sRet: smallint;
bRet: WordBool ;
begin
//Do nothing if we are drawing a region.
if LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE then
Exit ;
//Reposition the floater if we are dragging it.
if ((Dragging = True) And (Button = 1) And (LEADRasterView1.Floater <> 0)) then
begin
if ( LEADRasterView1.IsPtInFloater ( x, y, bRet)) then
begin
//Update the position variables.
xDelta := x - StartX;
yDelta := y - StartY;
NewX := FloaterX + xDelta;
NewY := FloaterY + yDelta;
NewWidth := LEADRasterView1.FloaterDstWidth ;
NewHeight := LEADRasterView1.FloaterDstHeight;
//Reposition the floater.
LEADRasterView1.SetFloaterDstRect ( NewX, NewY, NewWidth, NewHeight, sRet ) ;
//Save the form-level position variables.
FloaterY := NewY;
FloaterX := NewX;
StartY := y;
StartX := x;
end;
end;
end;

9.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

procedure TForm1.LEADRasterView1MouseUp2(Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//if we were drawing a region, set up for the next operation.
if ( LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE ) then
begin
LEADRasterView1.RgnMarkingMode := RGNMARK_NONE;
LEADRasterView1.RgnFrameType := RGNFRAME_STATIC;
ReadyToDrag := True;
ShowMessage ( 'Now, drag the selection to another place.' ) ;
end;
end;

10 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
11. | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB;

12.

Run your program to test it.


Creating and Using Annotations (Delphi 4.0)

Note:

This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Annotation Library (14.5), and Press Ok.
3. | If you didn’t install LEADEventSink install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
4. | From the ActiveX controls, Add the LEvntSnk control to your form.
5. | Add the following variable’s declaration to the Form1 Private section.

RasterAnn: LEADRasterAnnotation;
RasAnnToolbar: LEADRasterAnnToolBar;
NewTag: Integer;

6.

Add the following code to the LoadLead click’s procedure.

RasterAnn:= CoLEADRasterAnnotation.Create();
RasAnnToolbar:= CoLEADRasterAnnToolBar.Create();
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
//Unlock annotation support
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, WideString('TestKey'));

//Connect the raster annotation object to the RasterView control
RasterAnn.AnnParentRasterView:= LEADRasterView1.Raster;

//Enable left button drawing of annotations
RasterAnn.AnnAutoDrawEnable:= True;

//Enable right-click to display annotation menus
RasterAnn.AnnAutoMenuEnable:= True;

7.

At the beginning of the Unit1 file, add LTANNLib_TLB, ActiveX to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTANNLib_TLB;

8. | At the top of your main form, add four buttons and name them as follows:
 | Name | Caption
 | AnnToggle | Start
 | IOToggle | Save
 | ClipboardToggle | Copy
 | Realize | Realize
9. | Code the AnnToggle control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.AnnToggleClick(Sender: TObject);
begin
//Use the button to toggle between design mode and run mode
if (AnnToggle.Caption = 'Start') then
begin
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
RasterAnn.AnnTool:= ANN_TOOL_BUTTON;
//Make run mode the next thing.
AnnToggle.Caption:= 'Run Mode';
ShowMessage ('In design mode now. Draw a button object.');
end
else
begin
if (AnnToggle.Caption = 'Design Mode') then
begin
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
RasterAnn.AnnTool:= ANN_TOOL_BUTTON;
//Make run mode the next thing.
AnnToggle.Caption:= 'Run Mode';
end
else //The button takes us to run mode
begin
RasterAnn.AnnUserMode:= ANN_USERMODE_RUN;
ShowMessage ('Click on your new button');
AnnToggle.Caption:= 'Design Mode';
end;
end;
end;

10.

Code the IOToggle control's Click procedure as follows:

procedure TForm1.IOToggleClick(Sender: TObject);
var
nRet: Integer;
begin
//Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors := False;
//Use the button to toggle between saving and loading annotations
if (IOToggle.Caption = 'Save') then
begin
//Do nothing if there are no annotations.
If (RasterAnn.AnnContainer = 0) then
Exit;
//Save the all annotations.
nRet := RasterAnn.AnnSave ('c:\temp\tmp.ann', ANN_FMT_NATIVE, False, SAVE_OVERWRITE, 1);

if (nRet = 0) then
begin
IOToggle.Caption := 'Load';
ShowMessage ('Use the right mouse button to delete any annotations, then click Load');
end
else
ShowMessage ('Error code: ' + IntToStr(nRet));
end
else
begin
//We are loading annotations
//Make sure we are in design mode
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;
//Load the annotations.
nRet := RasterAnn.AnnLoad ('c:\temp\tmp.ann', 1);
if (nRet = 0) then
IOToggle.Caption := 'Save'
else
ShowMessage ('No annotations to load');
end;
end;

11.

Code the ClipboardToggle control's Click procedure as follows. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)

procedure TForm1.ClipboardToggleClick(Sender: TObject);
var
nRet: Integer;
begin
//Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors := False;
//Use the button to toggle between copying and pasting annotations
if (ClipboardToggle.Caption = 'Copy') then
begin
//Do nothing if there are no annotations.
If (RasterAnn.AnnContainer = 0) then
Exit;
//Copy all annotations to the clipboard.
nRet := RasterAnn.AnnCopy (ANN_FMT_NATIVE, False, True);
if (nRet = 0) then
begin
//Make pasting the next thing.
ClipboardToggle.Caption := 'Paste';
ShowMessage ('Use the right mouse button to delete any annotations, then click Paste');
end
else
ShowMessage ('Error code: ' + IntToStr(nRet));
end
else //We are pasting annotations
begin
//Make sure we are in design mode
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;
//Paste the annotations
if RasterAnn.AnnPasteReady then
begin
RasterAnn.AnnPaste;
ClipboardToggle.Caption := 'Copy';
end
else
ShowMessage ('No annotations to paste');
end;
end;

12.

Code the Realize control's Click procedure (which renders the annotation objects to the bitmap) as follows:

procedure TForm1.RealizeClick(Sender: TObject);
var
sRet: Smallint;
begin
RasterAnn.AnnRealize (False);
LEADRasterView1.ForceRepaint (sRet);
ShowMessage ('Annotations are now rendered to the bitmap');
end;

13.

Code the LEADEventSink1 OnInvoke event as follows:

procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
lTag: Longint;
hObject: Integer;
ObjectType: AnnObjectType;
begin
hObject:= OleVariant(Params.rgvarg^[0]);
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNCREATE:
begin
//Update the tag if we need one.
RasterAnn.AnnGetType (hObject);
ObjectType:= RasterAnn.AnnType;
if ((ObjectType = ANN_OBJECT_BUTTON) Or (ObjectType = ANN_OBJECT_HOTSPOT)) then
begin
NewTag:= NewTag + 1;
RasterAnn.AnnSetTag (hObject, NewTag);
end;
end;
LEADRASTERANNOTATIONEVENTS_ANNDESTROY:
begin
RasterAnn.AnnGetTag (hObject);
lTag:= RasterAnn.AnnTag;
ShowMessage ('The object tagged ' + IntToStr(lTag) + ' is deleted.');
end;

LEADRASTERANNOTATIONEVENTS_ANNCLICKED:
begin
RasterAnn.AnnGetTag (hObject);
lTag:= RasterAnn.AnnTag;
ShowMessage ('This is what we do for the button tagged ' + IntToStr(lTag));
end;

LEADRASTERANNOTATIONEVENTS_ANNDRAWN:
begin
RasterAnn.AnnTool := ANNTOOL_SELECT;
ShowMessage ('Use the right mouse button to modify this object; then click on Run Mode to test it.');
end;
end;
end;

14.

Run your program to test it.


Using ODBC to Access Image Data (Delphi 4)

This lesson describes how to use the LEADTOOLS ODBC features to maintain images in a table with other data. In this lesson, you accomplish the following:

Create a database with one table containing images and names for the images.

Create an ODBC data source that references the table.

Use a data control to manage the table and to access the names.

Use the LEADTOOLS methods to access the images through the ODBC data source.

Use SQL SELECT statements to maintain a sorted view of the records.

Synchronize the record pointers so that the two views of the same table are always correct.

Note: | In Delphi, a simpler alternative is to use the LEAD control as a data-aware control.
Note: | The LEADTOOLS ActiveX requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is http://www.leadtools.com/odbc32.htm. The file to download is ODBC32.ZIP.

1. | Start Visual Basic.
2. | On the Add Ins menu, select the Data Manager option (Visual Data Manager in VB5).
3. | Create a new database.
 | On the File menu, select New Database, and specify Microsoft Access 7.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | Add a table.
 | Use the right mouse button, and select the New Table menu option.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary (or Binary). Size: N/A.
7. | Close the Database Manager.
8. | Add a data control to the bottom of your form and change its properties as follows:
 | a. | Set the DatabaseName property to leadpic.mdb. (Use the browser to get the full path name.)
 | b. | Set the RecordSource property to the following:
 |  | SELECT who FROM people ORDER BY who
 | c. | Set the Name property to Dpeople.
9. | On the Tools pull-down menu, use the Custom Controls option to add the LEAD OLE Custom Control module to your project.
10. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
11. | In the Properties box for the LEADRasterView control, make the following changes:
 | a. | Set the BorderStyle property to 1. This adds a 1-pixel border to the control.
 | b. | Set the Name property to LeadRasterView1.
12. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
13. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
14. | Add the LEAD Raster ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14.5).
15. | Add the LEAD Raster Annotation ODBC Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Annotation Object Library (14.5).
16. | Add the following code to the general declarations section of your project.

Public RasterIO As LEADRasterIO
Public RasterProc As LEADRasterProcess
Public WithEvents As LeadRasODBC As LEADRasterODBC
Public RasAnn As LEADRasterAnnotation

17.

Add the following code to the end of the Form_Load event handler.

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO.145 ")
'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess.145 ")
'Create the RasterODBC Object
Set LeadRasODBC = CreateObject("LEADRasterODBC.LEADRasterODBC.145 ")

'Create the RasAnn Object
Set RasAnn = CreateObject("LEADRasterAnnotation. LEADRasterAnnotation.145")

18. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the DataField property to who.
 | c. | Set the Name property to Cwho.
19. | From the Windows Control Panel, create the ODBC data source as follows:
 | a. | Open the ODBC administrator and click the Add button.
 | b. | Select Microsoft Access driver and click the OK button.
 | c. | Enter the name LEADODBC.
 | d. | Click the Select directory button and select the path to the database that you created.
 | e. | Click the OK button; click the next OK button; then click the Close button.
20. | In Visual Basic, add the following code to your form's general declarations. In online help, you can use the Edit pull-down menu to copy the block of code.

' The Windows Sleep function lets us synchronize requeries on adds and deletes
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
' These are variables for implementing the dbMove method
Public OldPosition, NewPosition As Long
' This variable lets us make the dbMove method conditional
Public NormalMove As Boolean

21.

Add the following code to the form's Load procedure.

LeadRasODBC.EnableMethodErrors = FALSE
On Error GoTo ERRORHANDLER
' Turn off automatic scrolling and repainting
LeadRasterView1.AutoScroll = False
LeadRasterView1.AutoRepaint = False
' Open the database.
' Use the same SELECT statement that is used for the data control.
' Note that the image field must be listed first in the SELECT statement.
DString = "ODBC;DSN=LEADODBC"
SelString = "SELECT photo,* FROM people ORDER BY who"
LeadRasODBC.dbOpen DString, SelString, "photo", DB_OPENOPTIONS_NONE
' Set the LEAD control's database properties
LeadRasODBC.dbLoadBits = 24
LeadRasODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
' Enable use of the dbMove method in the data control's Reposition event
If (LeadRasODBC.dbIsBOF And LeadRasODBC.dbIsEOF) = False Then
NormalMove = True
End If
Exit Sub
ERRORHANDLER:
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

22.

Add the following code to the form's Unload procedure.

LeadRasODBC.dbClose

23. | Add a CommonDialog control to your form.
24. | Add a CommandButton control to your form, change its Caption property to Add Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Get an image file
' This filter list is complete, except for GIF.
CommonDialog1.Filter = "Grapics|*.cmp; *.jpg; *.jff; *.jtf; *.bmp; *.tif; *.tga; *.pcx; *.cal; *.mac; *.mac; *.img; *.msp; *.wpg; *.wpg; *.ras; *.pct; *.pcd; *.eps; *.wmf"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DialogTitle = "Open File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
Myfile = CommonDialog1.filename
' Suspend use of the dbMove method in the data control's Reposition event
NormalMove = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Hide the LEAD control to avoid unnecessary repaints
LeadRasterView1.Visible = False
' Add and update the record, without inserting the image
Dpeople.Recordset.AddNew
Cwho = Myfile
Dpeople.Recordset.Update
' Wait for the update to take effect
Call Sleep(5000)
' Requery the data control's recordset
Dpeople.Recordset.Requery
' Requery the LEAD RasterODBC object's recordset and make sure it is
' synchronized with the data control.
LeadRasODBC.dbRequery
NormalMove = True ' Do normal record synchronization
Dpeople.Recordset.MoveLast
If LeadRasODBC.dbCurrentRecord <> Dpeople.Recordset.AbsolutePosition Then
MsgBox "Synchronization error!" + Chr(13) + "Delete the record and exit"
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
Screen.MousePointer = 0
Exit Sub
End If
' Go to the new record, and show the LEAD control
Dpeople.Recordset.FindFirst "who = " + "'" + Myfile + "'"
LeadRasterView1.Visible = True
' Load the image file and update the recordset
LeadRasODBC.dbEdit
RasterIO.Load LeadRasterView1.Raster, Myfile, 0, 0, 1
LeadRasODBC.Raster = LeadRasterView1.Raster
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscales
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

25.

Add another CommandButton control to your form, change its Caption property to Delete Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Disable the normal record synchronization and hide the LEAD ODBC control.
NormalMove = False
LeadRasterView1.Visible = False
'Set the pointer to an hourglass
Screen.MousePointer = 11
' Save the current position
RecMarker = Dpeople.Recordset.AbsolutePosition
' Delete the record and wait for the deletion to take effect
Dpeople.Recordset.Delete
Call Sleep(5000)
' Requery the recordsets, move to the last record,
' and initialize the NewPosition global variable.
Dpeople.Recordset.Requery
LeadRasODBC.dbRequery
Dpeople.Recordset.MoveLast
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition
' Make sure the LEADODBC control is on the last record.
LeadRasODBC.dbMoveNext
If LeadRasODBC.dbIsEOF Then
LeadRasODBC.dbMovePrev
Else
MsgBox "Synchronization error!" + Chr(13) + "Restart the application"
Exit Sub
End If
' Return to the old record position, if possible.
NormalMove = True
LeadRasterView1.Visible = True
RelativePosition = RecMarker - NewPosition
If RelativePosition < 0 Then
Dpeople.Recordset.Move RelativePosition
End If
'Set the mouse pointer back to the default
Screen.MousePointer = 0
Exit Sub
ERRORHANDLER:
'Set the mouse pointer back to the default
Screen.MousePointer = 0
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

26.

Add another CommandButton control to your form, change its Caption property to Flip Photo, and add the following code to its Click event:

On Error GoTo ERRORHANDLER
' Flip the image and update the record
RasterProc.Flip LeadRasterView1.Raster
LeadRasODBC.dbEdit
' Update the recordset using the appropriate format
If LeadRasterView1.Raster.BitmapBits = 1 Then
LeadRasODBC.dbUpdate FILE_LEAD1BIT, 1, 0
ElseIf LeadRasterView1.Raster.BitmapBits = 4 Then
LeadRasODBC.dbUpdate FILE_PCX, 4, 0
ElseIf LeadRasterView1.Raster.IsGrayscale = GRAY_NO Then
LeadRasODBC.dbUpdate FILE_CMP, 24, QFACTOR_QMS
Else 'save as grayscale
LeadRasODBC.dbUpdate FILE_CMP, 8, QFACTOR_QMS
End If
Exit Sub
ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditInProgress Then
Dpeople.Recordset.CancelUpdate
End If
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description

27.

Add the following code to the LEADRasterODBC control's ODBCChange event:

' Avoid processing events that occur before the bitmap is fully loaded
If LeadRasterView1.Raster.Bitmap = 0 Then
LeadRasterView1.ForceRepaint
Exit Sub
End If
RasAnn.LEADRaster = LeadRasODBC.Raster
LeadRasODBC.AnnContainer = 0
LeadRasODBC.AnnContainer = RasAnn.AnnContainer
' Calculate the display rectangle to fit the image inside the control
HeightAllowed = LeadRasterView1.ScaleHeight
WidthAllowed = LeadRasterView1.ScaleWidth
If (HeightAllowed * LeadRasterView1.Raster.BitmapWidth / LeadRasterView1.Raster.BitmapHeight) <= WidthAllowed Then
DisplayTop = 0
DisplayHeight = HeightAllowed
DisplayWidth = DisplayHeight * LeadRasterView1.Raster.BitmapWidth / LeadRasterView1.Raster.BitmapHeight
DisplayLeft = (LeadRasterView1.ScaleWidth - DisplayWidth) / 2
Else
DisplayLeft = 0
DisplayWidth = WidthAllowed
DisplayHeight = DisplayWidth * LeadRasterView1.Raster.BitmapHeight / LeadRasterView1.Raster.BitmapWidth
DisplayTop = (LeadRasterView1.ScaleHeight - DisplayHeight) / 2
End If
'Set the image display size
LeadRasterView1.SetDstRect DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight
LeadRasterView1.SetDstClipRect DisplayLeft, DisplayTop, DisplayWidth, DisplayHeight
LeadRasterView1.ForceRepaint

28.

Add the following code to the Dpeople control's Validate event:

' Set the OldPosition, which is used in a calculation in the Reposition event
OldPosition = Dpeople.Recordset.AbsolutePosition

29.

Add the following code to the Dpeople control's Reposition event:

' Use the dbMove method to move the LEAD control to the current record
If NormalMove Then
' The current position is the NewPosition
' The OldPosition is set in the Validate event
NewPosition = Dpeople.Recordset.AbsolutePosition
LeadRasODBC.dbMove NewPosition - OldPosition
End If

30.

Run your program to test it.


Implementing a Database with the MS ADO Data Control (Delphi 4.0)

In Visual Basic, the LEADTOOLS OLEDB control is a OLEDB data bound control. This means you can associate the LEADTOOLS OLEDB control with an ADO data control so that the LEADTOOLS OLEDB control's bitmap is bound to a specified field in the data control's recordset.

Take the following steps to start a project and to add some code that associates the LEADTOOLS OLEDB control with an ADO data control:

1. | Start Delphi.
2. | On the Add-Ins menu, select the Visual Data Manager option.
3. | On the Data Manager window's Select File menu, select the New Database option.
4. | Specify a file name of leadpic.mdb and click the Save button.
5. | In the Database Manager window, click the New button.
6. | In the Add Table window, specify a table named: people, with the following two fields:
 | a. | Field name: who. Data Type: text. Size: 255
 | b. | Field name: photo. Data Type: Long Binary. Size: N/A.
7. | Close the Database Manager
8. | Add the LEAD RasterProcess Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14.5).
9. | Add the LEAD RasterIO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.5).
10. | Add the following code to the general declarations section of your project.

Public RasterIO As LEADRasterIO
Public RasterProc As LEADRasterProcess

11.

Add the following code to the end of the Form_Load event handler.

'Create the RasterIO Object
Set RasterIO = CreateObject("LEADRasterIO.LEADRasterIO.145 ")
'Create the RasterProcess Object
Set RasterProc = CreateObject("LEADRasterProcess.LEADRasterProcess.145 ")

12. | On the Project pull-down menu, use the Components option to add the MS ADO data control to your project. Then add an ADO control to the bottom of your form and change its properties as follows:
 | a. | Set the ConnectionString property to connect to leadpic.mdb. (Use the browser to properly build the connection string using the OLEDB ODBC Provider.)
 | b. | Set the RecordSource by setting the CommandType to adCommandTable and the table to the "people" table.
 | c. | Set the Name property to Dpeople.
13. | On the Project pull-down menu, use the Components option to add the LEADRasterView Control module to your project.
14. | Select the LEADRasterView control; then add the control to your main form. Stretch and position the control as you want it to appear at run time.
15. | On the Project pull-down menu, use the Components option to add the LEADTOOLS Raster OLE DB Custom Control module to your project. Select the LEADTOOLS Raster OLE DB control; then add the control to your main form.
16. | In the Properties box for the LEADTOOLS Raster OLE DB control, make the following changes:
 | a. | Set the DataSource property to Dpeople.
 | b. | Leave the DataMember property empty, in order to use the default for this data source.
17. | Add a TextBox control to your form and change its properties as follows:
 | a. | Set the DataSource property to Dpeople.
 | b. | Set the Name property to Cwho.
18. | Add three command buttons to your form and name them as follows:
 | Name | Caption
 | AddPhoto | Add Photo
 | DeletePhoto | Delete Photo
 | FlipPhoto | Flip Photo
19. | On the Project pull-down menu, use the Components option to add the Microsoft Common Dialog Control module to your project.
20. | Add a Microsoft CommonDialog Control to your form.
21. | Add the following code to the form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

'These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = APPEARANCE_FLAT
LEADRasterView1.BorderStyle = 1
LEADRasterView1.BackColor = RGB(255, 255, 125)
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSize = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT

'databind performed at design-time except for datafield
LEADRasterOLEDB1.DataField = "photo"
Cwho.DataField = "who"

' Set the data properties on the LEAD Raster OLE DB control
LEADRasterOLEDB1.DataLoadBits = 0
LEADRasterOLEDB1.DataSaveBits = 24
LEADRasterOLEDB1.DataSaveFormat = FILE_LEAD
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
LEADRasterOLEDB1.EnableMethodErrors = True

22.

Code the AddPhoto button's Click event as follows:

On Error GoTo ERRORHANDLER
'release any reference
LEADRasterOLEDB1.Raster.Bitmap = 0
CommonDialog1.Filter = "Grapics|*.cmp;*.jpg;*.jff;*.jtf;*.bmp;*.tif;*.tga;*.pcx;*.cal;*.mac;*.mac;*.img;*.msp;*.wpg;*.wpg;*.ras;*.pct;*.pcd;*.eps;*.wmf"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.DialogTitle = "Open File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
Myfile = CommonDialog1.FileName
If Myfile = "" Then Exit Sub

Dpeople.Recordset.AddNew
RasterIO.Load LEADRasterView1.Raster, Myfile, 0, 1, 1
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True
Cwho = Myfile

' Specify the appropriate properties for saving the image in the database
If LEADRasterView1.Raster.BitmapBits = 1 Then
LEADRasterOLEDB1.DataSaveBits = 1
LEADRasterOLEDB1.DataSaveFormat = FILE_LEAD1BIT
ElseIf LEADRasterView1.Raster.BitmapBits = 4 Then
LEADRasterOLEDB1.DataSaveBits = 4
LEADRasterOLEDB1.DataSaveFormat = FILE_PCX
ElseIf LEADRasterView1.Raster.IsGrayscale = GRAY_NO Then
LEADRasterOLEDB1.DataSaveBits = 24
LEADRasterOLEDB1.DataSaveFormat = FILE_CMP
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
Else 'save as grayscale
LEADRasterOLEDB1.DataSaveBits = 8
LEADRasterOLEDB1.DataSaveFormat = FILE_CMP
LEADRasterOLEDB1.DataSaveQuality = QFACTOR_QMS
End If

Dpeople.Recordset.Update

' Requery the data control's recordset
Dpeople.Recordset.Requery
Exit Sub

ERRORHANDLER:
If Dpeople.Recordset.EditMode = dbEditAdd Then
Dpeople.Recordset.CancelUpdate
End If
If (Err.Number <> ERROR_DLG_CANCELED) Then
MsgBox Err.Source + " " + CStr(Err.Number) + Chr(13) + Err.Description
End If

23.

Code the DeletePhoto button's Click event as follows:

Dpeople.Recordset.Delete
Dpeople.Recordset.MoveFirst

24.

Code the FlipPhoto button's Click event as follows:

RasterProc.Flip LeadRasterView1.Raster
LEADRasterOLEDB1.Raster.Bitmap = 0
LEADRasterOLEDB1.Raster = LEADRasterView1.Raster
LEADRasterOLEDB1.DataDirty = True

25.

Add the following code to the LEAD Raster OLEDB control's DataLoaded event:

If (nStatus = 0) Then
LEADRasterView1.Raster.RefBitmap = True 'don't make a copy
LEADRasterView1.Raster.Bitmap = LEADRasterOLEDB1.Raster.Bitmap 'send the image to the LEADRasterView
LEADRasterView1.Raster.RefBitmap = False 'reset
ElseIf (nStatus = ERROR_FILENOTFOUND) Then 'if it's an empty record
LEADRasterView1.Raster.Bitmap = 0
ElseIf (nStatus <> ERROR_FILENOTFOUND) Then 'if it's not an empty record
LEADRasterView1.Raster.Bitmap = 0
MsgBox "Error loading from database!"
End If
LEADRasterView1.ForceRepaint
LEADRasterOLEDB1.DataDirty = False

26.

Add the following code to the LEAD Raster OLEDB control's DataSaved event:

LEADRasterOLEDB1.Raster.Bitmap = 0 'free the current reference
LEADRasterView1.Raster.Bitmap = 0 'free the current bitmap
If (nStatus <> 0) Then
LEADRasterView1.ForceRepaint
MsgBox "Error saving to database!"
End If

27.

Run your program to test it.


Printing Multiple Images (Delphi 4)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Select a Button control; and add it to your main form. Put it at the top of the form to keep it away from the image.
3. | Change the Button control's Caption to Print Twice on One Page.
4. | Add the following code to the Button control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.Button1Click(Sender: TObject);
var
RasterProc: LEADRasterProcess;
//Declare the variable for printed text
Msg: String;
//Declare the variables for pixel measurements
TextHeightInPixels: Integer;
UsableWidth: Integer;
UsableHeight: Integer;
MaxImageHeight: Integer;
//Declare the variables for sizing and positioning the image
PrintLeft: longint;
PrintTop: longint;
PrintHeight: longint;
PrintWidth: longint;
//Declare variables used for preserving aspect ratios
WidthFactor: Integer;
HeightFactor: Integer;
Ret: Smallint;
begin
RasterProc := CreateComObject ( CLASS_LEADRasterProcess ) as LEADRasterProcess;
//Set the variables used for preserving the aspect ratio
HeightFactor := Trunc (LEADRasterView1.Raster.BitmapHeight);
WidthFactor:= Trunc (LEADRasterView1.Raster.BitmapWidth);

//Set the pointer to an hourglass
Screen.Cursor := crHourGlass;
//Get the page width and height in pixels (dots)
UsableWidth := Printer.PageWidth ;
UsableHeight := Printer.PageHeight ;
//Print a title at the top of the page
Msg:= 'This is a print example using LEADTOOLS ActiveX.';
Printer.BeginDoc ( );
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y, Msg ) ;
//Get the maximum height of one image,
//assuming two equal-size images and space for 12 lines of text
TextHeightInPixels := Printer.Canvas.TextHeight (Msg);
MaxImageHeight := Trunc ( (UsableHeight - (12 * TextHeightInPixels)) / 2);
//Size and position the first image, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight) then
begin
PrintLeft := 1;
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y;
PrintWidth := UsableWidth;
PrintHeight := Trunc ((PrintWidth * HeightFactor) / WidthFactor);
end
else
begin
PrintLeft := 1;
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintHeight := MaxImageHeight;
PrintWidth := Trunc ( (PrintHeight * WidthFactor) / HeightFactor);
end;
//Print the first image
LEADRasterView1.Render ( Printer.Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight, Ret ) ;
//Update the current printing position
Printer.Canvas.MoveTo ( 1, Printer.Canvas.PenPos.y + PrintHeight + TextHeightInPixels );
//Print a blank line, then print a caption for the next picture
Msg := ' ' ;
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y, Msg ) ;
Msg := 'This is the second picture, which is modified before printing:';
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y + TextHeightInPixels, Msg ) ;
//Stretch the intensity of the bitmap for the second printing
//to show the difference between the second picture and the first
RasterProc.StretchIntensity ( LEADRasterView1.Raster ) ;
//Size and position the second image, preserving the aspect ratio.
//The coding is the same as for the first image.
if ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight Then
begin
PrintLeft := 1; //This is for flush left. Use 0 for centering.
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintWidth := UsableWidth ;
PrintHeight := Trunc((PrintWidth * HeightFactor) / WidthFactor);
end
else
begin
PrintLeft := 1 ;//This is for flush left. Use 0 for centering.
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintHeight := MaxImageHeight;
PrintWidth := Trunc((PrintHeight * WidthFactor) / HeightFactor);
end;
//Print the second image
LEADRasterView1.Render ( Printer.Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight, Ret ) ;
//Finish the page and finish the print job
Printer.NewPage ( ) ;
Printer.EndDoc ( ) ;
//Set the mouse pointer back to the default
Screen.Cursor := crDefault;
end;

5. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
 | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB, Printers to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB, Printers;

6.

Run your program to test it.


Writing and Reading Multi-Page Files (Delphi 4)

Take the following steps to create a Multi-Page file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support Multi-Page files.

1. | Start Delphi.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | Select the LEAD RasterView control; then add two controls to your main form. The size and position does not matter.
4. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Load Multi-Page File
5. | Code the Button1 Click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code. This code loads two bitmaps, saves them both into a single Multi-Page TIFF file, loads them again from the TIFF file, and displays them side-by-side.

procedure TForm1.Button1Click(Sender: TObject);
var
RasterIO1: LEADRasterIO;
RasterIO2: LEADRasterIO;
HeightFactor1, WidthFactor1,
HeightFactor2, WidthFactor2,
HeightAllowed, WidthAllowed: Integer;
ImageWidth1, ImageHeight1: Integer;
ImageWidth2, ImageHeight2: integer;
Ret: Smallint;
begin

RasterIO1:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO2:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;

//Disable automatic repainting of the image.
LEADRasterView1.AutoRepaint := False;
LEADRasterView2.AutoRepaint := False;
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll := False;
LEADRasterView2.AutoScroll := False;
//Position and size the main form so that it takes up most of the screen.
Width := Trunc(Screen.Width * 0.9) ;
Height:= Trunc(Screen.Height* 0.8) ;
Left := Trunc ((Screen.Width- Width) / 2);
Top := Trunc ((Screen.Height- Height)/ 2);
//Display the form and set the mouse pointer to an hourglass.

Screen.Cursor := crhourGlass;
//Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load ( LEADRasterView1.Raster, WideString('v:\images\image1.cmp'), 0, 0, 1 ) ;
RasterIO2.Load ( LEADRasterView2.Raster, WideString('v:\images\image2.cmp'), 0, 0, 1 ) ;

//Save the bitmaps to a single multipage TIFF file
RasterIO1.Save ( LEADRasterView1.Raster, WideString('v:\images\combined.mpt'), FILE_TIF, 24, 0, SAVE_OVERWRITE ) ;
RasterIO2.Save ( LEADRasterView2.Raster, WideString('v:\images\combined.mpt'), FILE_TIF, 24, 0, SAVE_APPEND );
//Get information about the images so that we can size the controls.
RasterIO1.GetFileInfo ( LEADRasterView1.Raster, WideString('v:\images\combined.mpt'), 1, 0 ) ;
RasterIO2.GetFileInfo ( LEADRasterView2.Raster, WideString('v:\images\combined.mpt'), 2, 0 );
//Clear the bitmaps from memory
LEADRasterView1.Raster.Bitmap := 0;
LEADRasterView2.Raster.Bitmap := 0;
//Make the controls visible so that we can size and position them.
//They will not really appear until we load an image and paint it.
LEADRasterView1.Visible := True;
LEADRasterView2.Visible := True;
//Set the variables used for preserving the aspect ratio.
HeightFactor1 := Trunc (RasterIO1.InfoHeight);
WidthFactor1 := Trunc (RasterIO1.InfoWidth);
HeightFactor2 := Trunc (RasterIO2.InfoHeight);
WidthFactor2 := Trunc (RasterIO2.InfoWidth);
HeightAllowed := Trunc (Height * 0.8);
WidthAllowed := Trunc (Width * 0.45);
//Center each LEAD control on half of the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed then
begin
LEADRasterView1.Left := Trunc ((Width / 4) - (WidthAllowed / 2));
LEADRasterView1.Width := WidthAllowed;
LEADRasterView1.Height := Trunc ((LEADRasterView1.Width * HeightFactor1) / WidthFactor1);
LEADRasterView1.Top := Trunc ((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top := Trunc ((Height - HeightAllowed) / 2);
LEADRasterView1.Height := HeightAllowed;
LEADRasterView1.Width := Trunc ((LEADRasterView1.Height * WidthFactor1) / HeightFactor1);
LEADRasterView1.Left := Trunc ((Width / 4) - (LEADRasterView1.Width / 2));
end;
if (WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed then
begin
LEADRasterView2.Left := Trunc ((Width * 3 / 4) - (WidthAllowed / 2));
LEADRasterView2.Width := WidthAllowed;
LEADRasterView2.Height := Trunc ((LEADRasterView2.Width * HeightFactor2) / WidthFactor2);
LEADRasterView2.Top := Trunc ((Height - LEADRasterView2.Height) / 2);
end
else
begin
LEADRasterView2.Top := Trunc ((Height - HeightAllowed) / 2);
LEADRasterView2.Height := HeightAllowed;
LEADRasterView2.Width := Trunc ((LEADRasterView2.Height * WidthFactor2) / HeightFactor2);
LEADRasterView2.Left := Trunc ((Width * 3 / 4) - (LEADRasterView2.Width / 2));
end;
//Load the bitmaps from the multipage TIFF file
RasterIO1.Load ( LEADRasterView1.Raster, 'v:\images\combined.mpt', 24, 1, 1);
RasterIO2.Load ( LEADRasterView2.Raster, 'v:\images\combined.mpt', 24, 2, 1);
//Set the image display sizes to match the LEAD controls
ImageWidth1 := Trunc (LEADRasterView1.ScaleWidth);
ImageHeight1 := Trunc (LEADRasterView1.ScaleHeight);
LEADRasterView1.SetDstRect ( 0, 0, ImageWidth1, ImageHeight1, Ret ) ;
LEADRasterView1.SetDstClipRect ( 0, 0, ImageWidth1, ImageHeight1, Ret ) ;
//Set the image display sizes to match the LEAD controls
ImageWidth2 := Trunc (LEADRasterView2.ScaleWidth);
ImageHeight2 := Trunc (LEADRasterView2.ScaleHeight);
LEADRasterView2.SetDstRect ( 0, 0, ImageWidth2, ImageHeight2, Ret ) ;
LEADRasterView2.SetDstClipRect (0, 0, ImageWidth2, ImageHeight2, Ret ) ;

//Display the images
LEADRasterView1.ForceRepaint (Ret) ;
LEADRasterView2.ForceRepaint(Ret) ;
//Set the mouse pointer back to the default
Screen.Cursor:= crDefault;
end;

6. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14.5).
7. | At the beginning of the Unit1 file, add ComObj, LTRASTERIOLib_TLB to the uses section. In order to deal with the Com objects, and deal with Raster IO object library, you must add the ComObj, LTRASTERIOLib_TLB units to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComObj, LTRASTERIOLib_TLB;

8.

Run your program to test it.


Drawing Simple Lines and Shapes (Delphi 4)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD 3D DrawEffect Object Library (14.5), and Press Ok.
3. | Add the following variable to the Main Form’s private declarations section.

RasterFxd: LEADRasterFXD;

4.

Add the following code to the end of the form's Create procedure.

//Create the RasterFxd Object
RasterFxd := CreateComObject ( CLASS_LEADRasterFXD) as LEADRasterFXD;

5.

Add the following variables to the Main Form’s private declarations section:

DrawObject: Integer; //the object we are drawing
StartX: Single ;//Starting X position
StartY: Single ;//Starting Y position
EndX: Single ;//Ending X position
EndY: Single ;//Ending Y position

6.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows. This code selects a different drawing object each time the event occurs.

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Use the same scale mode as the mouse.
LEADRasterView1.ScaleMode := 1;
//Save the starting position.
StartX := X;
StartY := Y;
EndX := X;
EndY := Y;
//Cycle through the types of drawing objects.
Case DrawObject of

0: DrawObject := 1 ;//Line
1: DrawObject := 2 ;//Rectangle
2: DrawObject := 0 ;//Ellipse
else
DrawObject := 0;
end;
RasterFxd.DstLeft := 0;
RasterFxd.DstTop := 0;
RasterFxd.DstRight := Trunc (LEADRasterView1.Raster.BitmapWidth);
RasterFxd.DstBottom := Trunc (LEADRasterView1.Raster.BitmapHeight);
RasterFxd.SrcLeft := 0;
RasterFxd.SrcTop := 0;
RasterFxd.SrcRight := Trunc (LEADRasterView1.Raster.BitmapWidth);
RasterFxd.SrcBottom := Trunc (LEADRasterView1.Raster.BitmapHeight);
RasterFxd.ScaleMode := 3;
end;

7.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows. This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one.

procedure TForm1.LEADRasterView1MouseMove2(Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
//Declare local variables.
OldEndX, OldEndY: Single;
OldDrawX, OldDrawY, OldWidth, OldHeight: Single;
DrawX, DrawY, NewWidth, NewHeight: Single;
h_DC: HDC;
iRet: Integer;
sRet: smallint;

begin
if Button = 1 then
begin
//Set the drawing styles.
RasterFxd.DrawPenStyle := DRAWPENSTYLE_SOLID;
RasterFxd.DrawMode := DRAWMODE_INVERT;
RasterFxd.DrawFillStyle := DRAWFILLSTYLE_TRANSPARENT;
RasterFxd.DrawPersistence := False; // On the window, not the bitmap
//Save the previous ending mouse position.
OldEndX := EndX;
OldEndY := EndY;
//Get the current mouse position.
EndX := x;
EndY := y;
//Calculate the origin of the current object.
if (EndX > StartX) then
DrawX := StartX
else
DrawX := EndX;

if EndY > StartY Then
DrawY := StartY
else
DrawY := EndY;

//Calculate the origin of the previous object.
if OldEndX > StartX Then
OldDrawX := StartX
else
OldDrawX := OldEndX;

if OldEndY > StartY Then
OldDrawY := StartY
else
OldDrawY := OldEndY;

//Calculate the height and width of the current object.
NewHeight := Abs(StartY - EndY);
NewWidth := Abs(StartX - EndX);
//Calculate the height and width of the previous object.
OldHeight := Abs(StartY - OldEndY);
OldWidth := Abs(StartX - OldEndX);
//Erase the old object and draw the new one.
h_DC := LEADRasterView1.GetClientDC (iRet);
Case DrawObject of
0: //Ellipse
begin
RasterFxd.DrawEllipse (Nil, h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
RasterFxd.DrawEllipse (Nil, h_DC, DrawX, DrawY, NewWidth, NewHeight);
end;
1: //Line
begin
RasterFxd.DrawLine (Nil, h_DC, StartX, StartY, OldEndX, OldEndY);
RasterFxd.DrawLine (Nil, h_DC, StartX, StartY, EndX, EndY);
end;
2: //Rectangle
begin
RasterFxd.DrawRectangle (Nil, h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
RasterFxd.DrawRectangle (Nil, h_DC, DrawX, DrawY, NewWidth, NewHeight);
end;
else
end;
LEADRasterView1.ReleaseClientDC (sRet);
end;
end;

8.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows. This code sets the drawing style and draws the object on the bitmap.

procedure TForm1.LEADRasterView1MouseUp2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
//Declare local variables.
DrawX, DrawY, NewWidth, NewHeight: Single;
sRet: Smallint;
begin

//Set the drawing style.
RasterFxd.DrawPenStyle := DRAWPENSTYLE_SOLID;
RasterFxd.DrawPenWidth := 2;
RasterFxd.DrawPenColor := RGB(255, 0, 0) ;//Red
RasterFxd.DrawMode := DRAWMODE_COPY_PEN;
RasterFxd.DrawFillColor := RGB(0, 255, 0); //Green;
RasterFxd.DrawFillStyle := DRAWFILLSTYLE_HORIZONTAL_LINE;
RasterFxd.DrawPersistence := True ;//On the bitmap
//Get the current mouse position
EndX := x;
EndY := y;
//Determine the origin of the object.
if (EndX > StartX) then
DrawX := StartX
else
DrawX := EndX;

if (EndY > StartY) then
DrawY := StartY
else
DrawY := EndY;

//Determine the height and width of the object.
NewHeight := Abs(StartY - EndY);
NewWidth := Abs(StartX - EndX);
//Draw the object
Case DrawObject of
0: //Ellipse
RasterFxd.DrawEllipse (LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
1: //Line
RasterFxd.DrawLine (LEADRasterView1.Raster, 0, StartX, StartY, EndX, EndY);
2: //Rectangle
RasterFxd.DrawRectangle (LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
end;
LEADRasterView1.ForceRepaint (sRet);
end;

9.

At the beginning of the Unit1 file, add LTRASTERFXDLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERFXDLib_TLB;

10.

Run your program to test it.


Cropping a Bitmap (Delphi 4.0)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following variables to the Private section in your main form:

Cropping: Boolean; //the state when the mouse is used for cropping
StartX: Integer; //Starting X position in screen pixels
StartY: Integer; //Starting Y position in screen pixels
EndX: Integer; //Ending X position in screen pixels
EndY: Integer; //Ending Y position in screen pixels

3. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Button1
 | Put it control at the top of the form to keep it away from the image.
4. | Code the Button1 click’s Procedure as the follwing, in online help; you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.Button1Click(Sender: TObject);
var
sRet: Smallint;
begin
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1.ScaleMode := 1;
//Initialize cropping so that you can do it more than once
if (Cropping = True) then
begin
//Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect ( LEADRasterView1.DstLeft,
LEADRasterView1.DstTop,
LEADRasterView1.DstWidth,
LEADRasterView1.DstHeight,
sRet ) ;
//Display the image
LEADRasterView1.ForceRepaint (sRet);
end;
//Set a global variable to let other events know that you are cropping
Cropping := True;
//Set the pointer to a crosshair
LEADRasterView1.MousePointer := 2;
end;

5.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Save the starting position
StartX := Trunc(x);
StartY := Trunc(y);
//Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible := False;
end;

6.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

procedure TForm1.LEADRasterView1MouseMove2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
rbX, rbY, rbWidth, rbHeight: Single;
sRet: smallint;
begin
if ((Cropping = True) And (Button = 1)) then
begin
//Get the current mouse position
EndX := Trunc(x);
EndY := Trunc(y);
//Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
if (EndX > StartX) then
rbX := StartX
else
rbX := EndX;

if (EndY > StartY) then
rbY := StartY
else
rbY := EndY;
//Determine the height and width of the rubberband rectangle
rbHeight := Abs(StartY - EndY);
rbWidth := Abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect (rbX, rbY, rbWidth, rbHeight, sRet);
//Alternatively, you could use the following properties to set the
//rubberband rectangle.
LEADRasterView1.RubberBandHeight:= rbHeight;
LEADRasterView1.RubberBandLeft:= rbX;
LEADRasterView1.RubberBandTop:= rbY;
LEADRasterView1.RubberBandWidth:= rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible:= True;
end;
end;

7.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

procedure TForm1.LEADRasterView1MouseUp2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
CropLeft, CropTop, CropWidth, CropHeight: Single;
sRet: smallint;
begin
if (Cropping = True) then
begin
//Get the current mouse position
EndX := Trunc(x);
EndY := Trunc(y);
//Get the origin of the clipping rectangle.
//Allow for different mouse drag directions
if (StartX < EndX) then
CropLeft := StartX
else
CropLeft := EndX;

if (StartY < EndY) then
CropTop := StartY
else
CropTop := EndY;
//Get the height and width of the cropped area
CropWidth := Abs(EndX - StartX);
CropHeight := Abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1.SetDstClipRect (CropLeft, CropTop, CropWidth, CropHeight, sRet);
LEADRasterView1.ForceRepaint ( sRet ) ;
LEADRasterView1.RubberBandVisible := False;
LEADRasterView1.MousePointer := 0 ;//Default
end;
end;

8. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button2 | Trim
 | This button will be used to trim the bitmap in memory and redisplay the bitmap.
 | Put it at the top of the form to keep it away from the image.
9. | Code the Button2 click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.Button2Click(Sender: TObject);
var
XFactor, YFactor: single;
NewLeft, NewTop, NewWidth, NewHeight: single;
HeightFactor, WidthFactor: single;
HeightAllowed, WidthAllowed: single;
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
Screen.Cursor := crHourGlass;
//Use the clipping rectangle's percentage offsets in the image rectangle
//to determine the trimmed rectangle in the bitmap.
//Using percentages allows for the possibility that the image is zoomed.
XFactor := LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.DstWidth;
YFactor := LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.DstHeight;
NewTop := (LEADRasterView1.DstClipTop - LEADRasterView1.DstTop) * YFactor;
NewLeft := (LEADRasterView1.DstClipLeft - LEADRasterView1.DstLeft) * XFactor;
NewWidth := LEADRasterView1.DstClipWidth * XFactor;
NewHeight := LEADRasterView1.DstClipHeight * YFactor;
//Make sure display rectangles are automatically adjusted.
LEADRasterView1.AutoSetRects := True;
//Trim the bitmap.
RasterProc.Trim ( LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight);
//Size and redisplay the control, using the new bitmap size.
//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor := LEADRasterView1.Raster.BitmapHeight;
WidthFactor := LEADRasterView1.Raster.BitmapWidth;
HeightAllowed := Height - (Height / 4);
WidthAllowed := Width - (Width / 4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed then
begin
LEADRasterView1.Left := Trunc(Width / 8);
LEADRasterView1.Width := Trunc(WidthAllowed);
LEADRasterView1.Height := Trunc((LEADRasterView1.Width * HeightFactor) / WidthFactor);
LEADRasterView1.Top := Trunc((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top := Trunc(Height / 8);
LEADRasterView1.Height:= Trunc(HeightAllowed);
LEADRasterView1.Width := Trunc((LEADRasterView1.Height * WidthFactor) / HeightFactor);
LEADRasterView1.Left := Trunc((Width - LEADRasterView1.Width) / 2);
end;
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll := False;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet );
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet ) ;
//Display the image
LEADRasterView1.ForceRepaint (sRet);
Screen.Cursor := crDefault;
end;

10. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
11. | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB;

12.

Run your program to test it.


Creating, Viewing, and Merging Color Separations (Delphi 4)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Do Separations
 | Put it at the top of the form to keep it away from the image.
3. | Add the following variables to the Main Form’s private declarations section.

RasterProc: LEADRasterProcess;
//Count the button clicks and take the next step with each click
ClickCount: Integer;

4.

Add the following code to the end of the form's Create procedure.

//Create the RasterProcess Object
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
ClickCount:= 0 ;

5.

Code the Buuton1 click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.Button1Click(Sender: TObject);
var
Msg: String;
sRet: smallint;
begin
Cursor := crHourGlass;
//Turn off the automatic display rectangles.
LEADRasterView1.AutoSetRects := False;
LEADRasterView1.Raster.RefBitmap := False;
Case ClickCount of
0:
begin
RasterProc.ColorSeparate ( LEADRasterView1.Raster, COLORSEP_CMYK ) ;
//Just for fun, add contrast to the K plane
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes [3] ;//Copy the K plane
RasterProc.Contrast (LEADRasterView1.Raster, 300) ;//Increase the contrast
RasterProc.ColorPlanes[3] := LEADRasterView1.Raster.Bitmap ;//Update the K plane
Msg := 'Separated. Keep clicking to see separations, then merge';
ShowMessage ( Msg ) ;
end;
1:
begin
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes [0]; //Cyan
LEADRasterView1.ForceRepaint ( sRet ) ;
end;
2:
begin
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes[1]; //Magenta
LEADRasterView1.ForceRepaint ( sRet ) ;
end;
3:
begin
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes[2]; //Yellow
LEADRasterView1.ForceRepaint (sRet);
end;
4:
begin
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes[3]; // K
LEADRasterView1.ForceRepaint (sRet);
end;
5:
begin
RasterProc.ColorMerge ( LEADRasterView1.Raster, COLORSEP_CMYK ) ;
LEADRasterView1.ForceRepaint (sRet);
RasterProc.ColorPlanes[0] := 0;
RasterProc.ColorPlanes[1] := 0;
RasterProc.ColorPlanes[2] := 0;
RasterProc.ColorPlanes [3] := 0;
msg := 'Merged, with more contrast in the K plane';
ShowMessage (Msg);
end;
else
begin
ClickCount := -1;
msg := 'Cycle is finished';
ShowMessage ( Msg ) ;
end;
end;
ClickCount:= ClickCount + 1;
Cursor:= crDefault;

end;

6. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
7. | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB;

8.

Run your program to test it. Notice that you can click the button several times to create the separations, view each of them, and merge them to recreate the original bitmap.


Updating a Gauge and Detecting a User Interrupt (Delphi 4.0)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add 2 Button controls to your main form. Put them at the top of the form to keep it away from the image, name them as follows:
 | Name | Caption
 | Button1 | Do Median
 | Button2 | Quit
3. | Add a TrackBar control to your main Form, and change the Max property of it to 100.
4. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
5. | From the ActiveX controls, Add the LEvntSnk control to your form.
6. | Add the Variables to the Private section of Form1:

fEscape: Boolean; //Use to indicate the user interrupt
fInProc: Boolean; //Use to avoid closing the form during processing
RasterProc: LEADRasterProcess;

7.

Now, add the following to the Form's Create event to create the ILEADRasterProcess object

// Create the Rasterproc object.
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);

8.

Code the Button1 Click’s procedure as follows:

procedure TForm1.Button1Click(Sender: TObject);
var
sRet: Smallint;
begin
//Enable the ProgressStatus event
RasterProc.EnableProgressEvent:= True;
//Initialize the indicators
fEscape := False; //The user does not want to quit
fInProc := True; //Processing is taking place
//Perform a relatively slow median filter
RasterProc.Median (LEADRasterView1.Raster, 4);
//Clean up
fInProc := False; //Processing is no longer taking place
LEADRasterView1.ForceRepaint (sRet);
end;

9.

Code the LEADEventSink1 OnInvoke event as follows:

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
iPrecent: OleVariant;
begin
iPrecent:= OleVariant(Params.rgvarg^[0]);
case (DispID) of
LEADRASTERPROCESSEVENTS_PROGRESSSTATUS:
begin
Application.ProcessMessages (); //Detect Windows events
if (not fEscape) then // Look for the Click on the Quit button
begin
TrackBar1.Position := iPrecent;
end
else
RasterProc.EnableProgressEvent:= False; //Cancel the task
end;
end;
end;

10.

Code the Button2 click’s procedure as follows:

procedure TForm1.Button2Click(Sender: TObject);
begin
fEscape:= True; //The user wants to quit
Trackbar1.Position := 0 ;
end;

11.

Code the Form1 CloseQuery procedure as follows:

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if (fInProc) then //If processing is taking place
CanClose:= False; //Do not let the user close the form
end;

12. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
13. | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB;

14.

Run your program to test it.


Using the Magnifying Glass (Delphi 4.0)

Take the following steps to enable the generation of the MagGlassExt event and updating the zoomed image using the Internet COM object toolkit.

1. | Start Delphi.
2. | If you didn’t install LEAD RasterView Control, install it.
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5), and Press install.
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Internet Object Library (14.5).
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Object Library (14.5)
5. | Select the LEAD RasterView control; then add the control to your main form. Size and position the control as you want it to appear at run time.
6. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
7. | From the ActiveX controls, Add the LEvntSnk control to your form.
8. | Add seven command buttons to your main form and name them as follows:
 | Name | Caption
 | StartUpServer | Start Up Server
 | ShutDownServer | Shut Server Down
 | ConnectToRemoteServer | Connect To Remote Server
 | DisconnectFromRemoteServer | Disconnect From Remote Server
 | LoadRemoteImage | Load Remote Image
 | StartMagnifyingGlass | Start Magnifying Glass
 | StopMagnifyingGlass | Stop Magnifying Glass
9. | Add an Edit box to your main form and name it as follows:
 | Name
 | RemoteComputer.
10. | Set the Text property to the name of the computer you will use as a server.
11. | Declare the following in the Private section of Unit1.

hServer: Integer; //handle to server
gnCommandID: Longint;
bMagGlass: Boolean;
RasterIO: LEADRasterIO;
LEADNet1: LEADRasterInet;

12.

Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormCreate(Sender: TObject);
var
LEADRas: LEADRaster;
begin

// Initialize some variables
hServer := 0;
gnCommandID := 0;
bMagGlass := False;

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance := RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette := PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;

// Create the Raster IO and Raster Inet objects
RasterIO := CoLEADRasterIO.Create ();
LEADNet1 := CoLEADRasterInet.Create ();
// Create a temp LEADRaster object and use it
// to unlock support for the Inet object
LEADRas := CreateComObject (CLASS_LEADRaster) as LEADRaster;

// Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
// RasterIO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1.EnableMethodErrors := False;
RasterIO.EnableMethodErrors := False;
LEADNet1.EnableMethodErrors
  := 0;
end;

13.

Code the main form's Destroy procedure as follows:

procedure TForm1.FormDestroy(Sender: TObject);
var
sRet: Smallint;
i: Integer;
begin
//Disconnect all connections
LEADNet1.ConnectListNum
 ;
for i := 0 to LEADNet1.ConnectListNum - 1 do
LEADNet1.InetDisconnect
  (LEADNet1.ConnectList  [i]);

if (bMagGlass) then
LEADRasterView1.StopMagGlass (sRet);
end;

14.

Code the StartUpServer button's click procedure as follows:

procedure TForm1.StartUpServerClick(Sender: TObject);
var
nRet: Integer;
begin
//Initialize server on port 1000
nRet:= LEADNet1.InetServerInit
  (1000);
hServer:= LEADNet1.InetServerHandle
 ;
if (nRet <> 0) then
ShowMessage ('Error Initializing server: ' + IntToStr(nRet));
end;

15.

Code the ShutDownServer button's click procedure as follows:

procedure TForm1.ShutDownServerClick(Sender: TObject);
var
nRet: Integer;
begin
if (hServer <> 0) then
begin
nRet:= LEADNet1.InetServerClose
  (hServer);

if (nRet <> 0) then
ShowMessage ('Error Shutting Down server: ' + IntToStr(nRet))
else
hServer:= 0;
end;
end;

16.

Code the LEADEventSink1 OnInvoke event as follows:

procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
hComputer: Smallint;
hName: WideString;
nRet: Integer;
iComputer: Smallint;
sRemote: WideString;
nStatus: Integer;
vColorBuffer: LEADRasterVariant;
vString: LEADRasterVariant;
InetCommand: Integer;
nCommandID: longint;
nError: Integer;
nParams : LEADRasterInetPacket;
sRet: Smallint;
begin
vColorBuffer:= coLEADRasterVariant.Create ( );
vString:= coLEADRasterVariant.Create ( );
case (DispID) of

LEADRASTERINETEVENTS_INETACCEPT:
begin
nRet:= LEADNet1.InetAcceptConnect (hServer);
hComputer:= LEADNet1.InetConnectedComputer ;
if (nRet <> 0) then
begin
ShowMessage ('Error accepting connection: ' + IntToStr(nRet));
Exit;
end;

LEADNet1.InetGetHostName (hComputer, HOST_NAME_DESCRP);
hName:= LEADNet1.InetHostName ;
//Add to our list
LEADNet1.SendList [LEADNet1.SendListNum ]:= hComputer;
ShowMessage ('Connection accepted from: ' + hName);
end;

LEADRASTERINETEVENTS_INETCONNECTED:
begin

iComputer:= OleVariant(Params.rgvarg^[0]);
//Get remote host name
LEADNet1.InetGetHostName (iComputer, HOST_NAME_DESCRP);
sRemote:= LEADNet1.InetHostName;
//Add this connection to our SendList
LEADNet1.SendList [LEADNet1.SendListNum]:= iComputer;
ShowMessage ('Successfully connected to remote computer: ' + sRemote);
end;

LEADRASTERINETEVENTS_INETDISCONNECTED:
begin
if (hServer = 0) then
ShowMessage ('Disconnect from remote server')
else
ShowMessage ('Connection to remote computer closed');
end;

LEADRASTERINETEVENTS_INETRECEIVECMD:
begin

InetCommand:= OleVariant(Params.rgvarg^[5]);
nCommandID:= OleVariant(Params.rgvarg^[4]);
nError:= OleVariant(Params.rgvarg^[3]);
nParams := LEADRasterInetPacket(Params.rgvarg[2].dispVal);

nStatus:= ERROR_FEATURE_NOT_SUPPORTED;

if (nError <> 0) then
nStatus:= ERROR_TRANSFER_ABORTED
else
begin
Case (InetCommand) of
INETCMD_LOAD:
begin
//check the validity of the parameters
if ((nParams.ParamCount = 4) And
(nParams.ParamType[0] = PARAM_TYPE_STRING) And
(nParams.ParamType[1] = PARAM_TYPE_INT32) And
(nParams.ParamType[2] = PARAM_TYPE_INT32) And
(nParams.ParamType[3] = PARAM_TYPE_UINT32)) then
begin

nStatus:= RasterIO.Load( LEADRasterView1.Raster,
nParams.ParamValue[0].StringValue,
nParams.ParamValue[1].LongValue,
1,
1 );

if (nStatus <> 0) then
ShowMessage ('Load Bitmap failed with error code: ' + IntToStr(nStatus))
else
begin
nStatus:= LEADNet1.InetSendBitmap (LEADRasterView1.Raster, FILE_CMP, 0, TOleEnum(QFACTOR_PQ2));

if (nStatus <> 0) then
ShowMessage ('SendBitmap failed with error code: ' + IntToStr(nStatus));
end;
end
else
nStatus:= ERROR_INV_PARAMETER; //Invalid parameters

LEADNet1.InetSendLoadRsp (nCommandID, 0, 0, Nil, nStatus);
Exit;
end;

INETCMD_GET_MAGGLASS_DATA:
begin
//check the validity of the parameters
if ((nParams.ParamCount = 5) And (nParams.ParamType[0] = PARAM_TYPE_UINT32)
And (nParams.ParamType[1] = PARAM_TYPE_UINT32) And (nParams.ParamType[2] = PARAM_TYPE_USTRING)
And (nParams.ParamType[3] = PARAM_TYPE_INT32) And (nParams.ParamType[4] = PARAM_TYPE_INT32)) Then
begin
if LEADRasterView1.Raster.Bitmap <> 0 Then
begin
vString.Type_:= VALUE_STRING;
vString.StringValue:= nParams.ParamValue[2].StringValue;
nStatus:= LEADNet1.InetGetMagGlassData ( LEADRasterView1.Raster,
vColorBuffer,
vString,
nParams.ParamValue[3].LongValue,
nParams.ParamValue[4].LongValue );
if (nStatus <> 0) then
ShowMessage ('InetGetMagGlassData failed with error code: ' + IntToStr(nStatus))
end
else
nStatus:= ERROR_INV_PARAMETER //Invalid parameter
end
else
nStatus:= ERROR_INV_PARAMETER; //Invalid parameters
vString.Type_:= VALUE_STRING;
vString.StringValue:= nParams.ParamValue[2].StringValue;
LEADNet1.InetSendGetMagGlassDataRsp ( nCommandID,
vColorBuffer,
vString,
nParams.ParamValue[3].LongValue,
nParams.ParamValue[4].LongValue,
0,
Nil,
nStatus );
Exit;
end;
end;
end;
LEADNet1.InetSendRsp (InetCommand, nCommandID, Nil, 0, Nil, nStatus);
end;

LEADRASTERINETEVENTS_INETRECEIVEBITMAP:
begin
LEADRasterView1.Raster.Bitmap:= OleVariant(Params.rgvarg^[0]);
end;
LEADRASTERINETEVENTS_INETRECEIVERSP:
begin
InetCommand:= OleVariant(Params.rgvarg^[6]);
nError:= OleVariant(Params.rgvarg^[4]);
nStatus:= OleVariant(Params.rgvarg^[3]);
nParams := LEADRasterInetPacket(Params.rgvarg[2].dispVal);

if (nError <> 0) then
Exit;

Case (InetCommand) of
INETCMD_LOAD:
begin
if (nStatus <> 0) then
ShowMessage ('Load failed with error code: ' + IntToStr(nStatus));
end;

INETCMD_GET_MAGGLASS_DATA:
begin
if (nStatus = 0) then
begin
if ((nParams.ParamCount = 6) And (nParams.ParamType[0] = PARAM_TYPE_UINT32)
And (nParams.ParamType[1] = PARAM_TYPE_USTRING) And (nParams.ParamType[2] = PARAM_TYPE_UINT32)
And (nParams.ParamType[3] = PARAM_TYPE_USTRING) And (nParams.ParamType[4] = PARAM_TYPE_INT32))
And (nParams.ParamType[5] = PARAM_TYPE_INT32) then
begin
nRet:= LEADRasterView1.UpdateMagGlass ( nParams.ParamValue[1],
nParams.ParamValue[3],
nParams.ParamValue[4].LongValue,
nParams.ParamValue[5].LongValue,
True,
sRet );

if (nRet <> 0) then
ShowMessage ('UpdateMagGlass failed with error code: ' + IntToStr(nRet))
end
else
ShowMessage ('Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response');
end
else
ShowMessage ('Get MagGlass Data from server with error code ' + IntToStr(nStatus));
end;
end;
end;
end;
end;

17.

Code the ConnectToRemoteServer button's click procedure as follows:

procedure TForm1.ConnectToRemoteServerClick(Sender: TObject);
var
nRet: Integer;
begin
//Connect to remote computer on port 1000
nRet:= LEADNet1.InetConnect
  (RemoteComputer.Text, 1000);

if (nRet <> 0) then
ShowMessage ('Error connecting to ' + RemoteComputer.Text + ': ' + IntToStr(nRet));
end;

18.

Code the DisconnectFromRemoteServer button's click procedure as follows:

procedure TForm1.DisconnectFromRemoteServerClick(Sender: TObject);
var
nRet: Integer;
begin
{ We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList}
nRet:= LEADNet1.InetDisconnect
  (LEADNet1.SendList  [0]);
if (nRet <> 0) then
ShowMessage ('Error disconnecting from remote: ' + IntToStr(nRet));
end;

19.

Code the LoadRemoteImage button's click procedure as follows:

procedure TForm1.LoadRemoteImageClick(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADNet1.InetSendLoadCmd (999, 'v:\images\Eagle.cmp', 0, 1);

if ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) then
ShowMessage ('ERROR ' + IntToStr(nRet) + ' calling InetSendLoadCmd.');
end;

20.

Code the StartMagnifyingGlass button's click procedure as follows:

procedure TForm1.StartMagnifyingGlassClick(Sender: TObject);
var
sRet: Smallint;
nRet: Integer;
begin

if ((LEADRasterView1.Raster.Bitmap <> 0) And (hServer = 0)) then
begin
//Enable MagGlassExt event.
if LEADRasterView1.EnableMagGlassEvent = False Then
LEADRasterView1.EnableMagGlassEvent:= True;

LEADRasterView1.RgnFrameType:= 0;

//Start the Magnifying Glass
nRet:= LEADRasterView1.StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True, sRet);

if (nRet = 0) then
bMagGlass:= True;
end;
end;

21.

Code the StopMagnifyingGlass button's click procedure as follows:

procedure TForm1.StopMagnifyingGlassClick(Sender: TObject);
var
sRet: Smallint;
nRet: Integer;
begin
if ((LEADRasterView1.Raster.Bitmap <> 0) And (hServer = 0)) then
begin
nRet:= LEADRasterView1.StopMagGlass (sRet);

if (nRet = 0) then
bMagGlass:= False
end;
end;

22.

Code the LEADRasterView1’s MagGlassExt event as follows:

procedure TForm1.LEADRasterView1MagGlassExt (Sender: TObject;
nMaskPlaneStart, nMaskPlaneEnd: Integer; const pvMaskPlane: ILEADRasterVariant);
var
nRet: Integer;
begin

gnCommandID:= gnCommandID + 1;

nRet:= LEADNet1.InetSendGetMagGlassDataCmd
  (gnCommandID, 0, pvMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) then
ShowMessage ('ERROR ' + IntToStr(nRet) + ' calling InetSendGetMagGlassDataCmd.');
end;

23. | At the beginning of the Unit1 file, add LEADRasterInetLib_TLB, LTRASTERIOLib_TLB, LTRASTERLib_TLB, LTDLLDef, ComObj, ActiveX, to the Uses section.
24. | Run the exe file two times to execute two applications.
25. | In the first application press Start Up Server button.
26. | In the second application fill the edit box with the IP Address of the Remote computer on which you run the first application as Server then press Connect To Remote Server button to connect to the specified address.
27. | After that press the Load Remote Image button of application number two to load an image on Server then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support, then start press the left key and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Using a PanWindow (Delphi 4.0)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Replace the Main Form Create Procedure to the follwing.

procedure TForm1.FormCreate(Sender: TObject);
begin
//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance:= RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette := PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_NORMAL;
end;

3. | Add a RadioButton to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | Check1 | Pan Window
4. | Add a Button to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | PanWindow | Show Pan Window
5. | Code the PanWindow click’s procedure as the following:

procedure TForm1.PanWindowClick(Sender: TObject);
var
sRet: smallint;
begin
With LEADRasterView1 do
begin
BackErase := False;
//set the location of the PanWindow
PanWinX := 100;
PanWinY := 100;
//set the size of the PanWindow
//requested width
PanWinWidth:= 150;
//requested height
PanWinHeight := 200;

LEADRasterView1.PanWinPointer:= 12;
PanWinTitle := 'PanWindow';
PanWinRectColor := RGB(0, 0, 255);
PanWinSysMenu := True;
//use the settings for LEADRasterView1.
PanWinPaintPalette := PaintPalette;
PanWinBitonalScaling := BitonalScaling;
PanWinPaintScaling := PaintScaling;
PanWinPaintDither := PaintDither;
//show the Pan Window
ShowPanWin (True, sRet);
end;
Check1.Checked := True;
end;

6.

Code the LEADRasterView1 PanWin event procedure as follows:

procedure TForm1.LEADRasterView1PanWin (Sender: TObject; hPanWin: Integer;
iFlag: Smallint);
begin
if (iFlag = PANWIN_DESTROYED) then
Check1.Checked := False ;//indicate no more Pan Window
end;

7.

Run your program to test it.


Miscellaneous Examples (Delphi 4.0)

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test any of the following examples by adding a button to one of the previous lessons in the tutorial, and pasting the sample code in the Click procedure.

In most cases, you can add the button after the first lesson Loading and Displaying an Image. In cases where you need to zoom in or zoom out, you must first finish Zooming Out and Zooming In.

AboutBox example for Delphi

AddNoise example for Delphi

Animate Example for Delphi

AnimationEnable Example for Delphi

AnnAddUndoNode Example for Delphi

AnnAutoDialogFontSize Example for Delphi

AnnAutoDrawEnable Example for Delphi

AnnAutomation Example for Delphi

AnnAutoMenuEnable Example for Delphi

AnnChange example for Delphi

AnnContainer Example for Delphi

AnnDataPath example for Delphi

AnnDestroy example for Delphi

AnnEnumerate example for Delphi

AnnEnumerate method example for Delphi

AnnGetAutoMenuItemEnable example for Delphi

AnnGetGrouping example for Delphi

AnnGetHyperlinkParam example for Delphi

AnnGetHyperlinkString example for Delphi

AnnGetHyperlinkType example for Delphi

AnnGetObjectFromTag example for Delphi

AnnGetPoint... example for Delphi

AnnGetSelectList example for Delphi

AnnGetVisible example for Delphi

AnnGroup example for Delphi

AnnHyperlink example for Delphi

AnnHyperlinkMenu example for Delphi

AnnHyperlinkMenuEnable example for Delphi

AnnInsert example for Delphi

AnnLoadArray example for Delphi

AnnLock example for Delphi

AnnLocked example for Delphi

AnnMenu example for Delphi

AnnMouseDown example for Delphi

AnnMove example for Delphi

AnnParentRasterView example for Delphi

AnnRectLeft example for Delphi

AnnRotate example for Delphi

AnnSaveArray example for Delphi

AnnSaveMemory example for Delphi

AnnSaveTag example for Delphi

AnnSelect example for Delphi

AnnSetAutoMenuItemEnable Example for Delphi

AnnSetAutoText Example for Delphi

AnnSetUser Example for Delphi

AnnShowLockedIcon Example for Delphi

AnnToolChecked Example for Delphi

AnnToolDestroy Example for Delphi

AnnUndo Example for Delphi

AnnUndoEnable Example for Delphi

AnnUngroup Example for Delphi

AnnUnlock Example for Delphi

AnnUnlocked Example for Delphi

AnnUnrealize Example for Delphi

Appearance Example for Delphi

AutoAnimate Example for Delphi

AutoPan Example for Delphi

AutoSize Example for Delphi

AutoTrim example for Delphi

Average example for Delphi

BackColor example for Delphi

BackErase example for Delphi

BinaryFilter example for Delphi

BitmapAlpha example for Delphi

BitmapDataPath Example for Delphi

BitmapToClient example for Delphi

BitmapXres and BitmapYres example for Delphi

BitonalScaling example for Delphi

BorderRemove example for Delphi

BorderStyle example for Delphi

ButtonColumns example for Delphi

ButtonMenuTool example for Delphi

ButtonRows example for Delphi

ButtonVisible example for Delphi

Capture example for Delphi

Change example for Delphi

Click example for Delphi

ClientToBitmap example for Delphi

ColorRes example for Delphi

ColorResList Example for Delphi

Combine example for Delphi

Comment example for Delphi

ContourFilter example for Delphi

Contrast example for Delphi

Create example for Delphi

Create Bitmap, Size, and Combine example for Delphi

dbCan... example for Delphi

DblClick example for Delphi

DDB example for Delphi

DeleteBitmapListItems example for Delphi

DeletePage example for Delphi

Deskew example for Delphi

Despeckle example for Delphi

DIB example for Delphi

DocCleanSuccess example for Delphi

DrawShape example for Delphi

DrawText example for Delphi

Dst... example for Delphi

Emboss example for Delphi

EnableMethodErrors example for Delphi

EnablePaint example for Delphi

EnableZoomInRect example for Delphi

Exif example for Delphi

FastRotate example for Delphi

FeedLoad example for Delphi

FilePage Event Example for Delphi

Fill example for Delphi

Flip example for Delphi

FloaterDstClip... example for Delphi

Font example for Delphi

Frame... example for Delphi

GammaCorrect example for Delphi

GetBitmapDC example for Delphi

GetColorCount Example for Delphi

GetDIB2 Example for Delphi

GetFileInfo example for Delphi

GetFloaterHandle example for Delphi

GetHistogram example for Delphi

GetHistogramGray example for Delphi

GetMinMaxBits Example for Delphi

GetMinMaxVal Example for Delphi

GetRgnHandle example for Delphi

Grayscale example for Delphi

Halftone example for Delphi

hDocCleanRgn example for Delphi

HistoContrast example for Delphi

HistoEqualize example for Delphi

HSV_HfromRGB example for Delphi

Hue example for Delphi

IgnoreFilters example for Delphi

InfoHasAlpha example for Delphi

InfoViewPerspective Example for Delphi

InsertBitmapListItem Example for Delphi

Intensity example for Delphi

IntensityDetect example for Delphi

Invert example for Delphi

InvertedText example for Delphi

IsGrayscale example for Delphi

J2KCompressionControl Example for Delphi

J2KCompressionRatio Example for Delphi

J2KSetDefaults Example for Delphi

J2KTargetFileSize Example for Delphi

KeyPress example for Delphi

LevelLowBit example for Delphi

LevelHighBit example for Delphi

LevelLUT example for Delphi

LevelLUTLength example for Delphi

LineRemove example for Delphi

LoadArray example for Delphi

LoadCompressed example for Delphi

LoadIFD example for Delphi

LoadInfo... example for Delphi

LoadMemory example for Delphi

LoadUseViewPerspective example for Delphi

MaxFilter example for Delphi

Median example for Delphi

MinFilter example for Delphi

MinVal example for Delphi

Mosaic example for Delphi

ODBC Example for Delphi

Oilify example for Delphi

OLEDropAllowed example for Delphi

OLEDropFile example for Delphi

Paint event example for Delphi

PaintContrast example for Delphi

PaintDither example for Delphi

PaintEffect example for Delphi

PaintEffectMaxPasses example for Delphi

PaintGamma example for Delphi

PaintIntensity example for Delphi

PaintPalette example for Delphi

PaintROP3 example for Delphi

PaintScaling Example for Delphi

PaintSizeMode Example for Delphi

PaintSizeUseDPI example for Delphi

PaintTransitionMaxPasses example for Delphi

PaintWhileLoad example for Delphi

PaintZoomFactor Example for Delphi

PatternStyle example for Delphi

PatternStyle (ILEADRasterFXD) example for Delphi

PCDRes example for Delphi

PDFSaveUseDPI Example for Delphi

PDFXResolution example for Delphi

Picturize example for Delphi

Pixel example for Delphi

Posterize example for Delphi

PreferredLoadFormat Example for Delphi

PreLoadFilters Example for Delphi

PrintNewPage Example for Delphi

PrinterScaleHeight Example for Delphi

ProgressivePasses Example for Delphi

RasterizeViewMode Example for Delphi

RawLoad Example for Delphi

RawSave Example for Delphi

ReadLoadResolutions Example for Delphi

ReadyState Example for Delphi

RefBitmap Example for Delphi

RefBitmapList Example for Delphi

RemapHue example for Delphi

Resize event example for Delphi

RGBfromHSV example for Delphi

RgnChange example for Delphi

RgnFrameColor example for Delphi

Rotate example for Delphi

Saturation example for Delphi

Save example for Delphi

SaveArray example for Delphi

SaveIFD example for Delphi

SaveInterlaced example for Delphi

SaveLSB example for Delphi

SaveMemory example for Delphi

SavePage example for Delphi

SaveResolutionCount example for Delphi

SaveWithStamp example for Delphi

Scroll event example for Delphi

SetRgn... example for Delphi

SetRgnColorHSVRange example for Delphi

SetRgnColorRGBRange example for Delphi

SetRgnMagicWand example for Delphi

SetSrcClipRect example for Delphi

SetSrcRect example for Delphi

SetTag example for Delphi

Sharpen example for Delphi

Shear example for Delphi

Smooth example for Delphi

Solarize example for Delphi

SpatialFilter example for Delphi

Src... example for Delphi

Stable example for Delphi

StopMagGlass example for Delphi

StretchIntensity example for Delphi

TextWordWrap example for Delphi

Tool example for Delphi

TransitionEffect example for Delphi

Transparent example for Delphi

Trim example for Delphi

UpdateMagGlassShape example for Delphi

Underlay example for Delphi

UserPalette and BitmapPalette example for Delphi

Vtable example for Delphi

WindowLevel example for Delphi

WindowLevelFillLUT example for Delphi

WMFResolution example for Delphi

WriteComment example for Delphi

ZoomIn example for Delphi

ZoomInDone example for Delphi


AboutBox example for Delphi

//This example displays the LEADTOOLS COM RasterView Control information.
LEADRasterView1.AboutBox ();


AddNoise example for Delphi

//This example adds red noise and redisplays the bitmap.
var
Rasterproc:LEADRasterProcess;
sRet: smallint ;
begin
Rasterproc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.AddNoise ( LEADRasterView1.Raster, 500, CHANNEL_RED ) ;
LEADRasterView1.ForceRepaint (sRet) ;

end;


Animate Example for Delphi

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

procedure TForm1.Button1Click(Sender: TObject);
begin
if (LEADRasterView1.AnimationEnable = True) then
LEADRasterView1.AnimationEnable := False
else
LEADRasterView1.AnimationEnable := True;
end;

procedure TForm1.LEADRasterView1Animate (Sender: TObject;
bEnable: WordBool);
begin
if bEnable = True Then
Button1.Caption:= '&Stop Animation'
else
Button1.Caption := '&Start animation';
end;


AnimationEnable Example for Delphi

This example loads and plays an animated file. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

var
RasterIO: LEADRasterIO;
sRet: SmallInt;
begin

RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;

//Load all pages of a GIF file.
RasterIO.Load ( LEADRasterView1.Raster, 'd:\pictures\eye.gif', 0, 1, -1 ) ;
//Set properties for a scaled animation.
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSetRects := False;
//Set the image display size to match the LEAD control.
LEADRasterView1.SetDstRect ( 0, 0,
LEADRasterView1.ScaleWidth,
LEADRasterView1.ScaleHeight,
sRet );
LEADRasterView1.SetDstClipRect ( 0, 0,
LEADRasterView1.ScaleWidth,
LEADRasterView1.ScaleHeight,
sRet ) ;
//Allow a continuous loop.
LEADRasterView1.AnimationLoop := True;
//Start the animation.
LEADRasterView1.AnimationEnable := True;
end;


AnnAddUndoNode Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN ;
end;

//This example creates two annotation notes as a single undo operation
procedure TForm1.Button2Click(Sender: TObject);
var
hObject1: Longint;
hObject2: Longint;
begin
//Call the AddUndoNode method to add an undo node to the container.
RasterAnn.AnnAddUndoNode ();

//Disable the undo feature
RasterAnn.AnnUndoEnable := False;

//Perform the operations to be combined into one undo.
RasterAnn.AnnCreate (ANN_OBJECT_NOTE, True, True);
hObject1:= RasterAnn.AnnObject;
RasterAnn.AnnRectLeft [hObject1] := 0;
RasterAnn.AnnRectTop [hObject1] := 0;
RasterAnn.AnnRectWidth [hObject1] := 100;
RasterAnn.AnnRectHeight [hObject1] := 100;

RasterAnn.AnnCreate (ANN_OBJECT_NOTE, True, True);
hObject2:= RasterAnn.AnnObject;
RasterAnn.AnnRectLeft [hObject2] := 0;
RasterAnn.AnnRectTop[hObject2] := 100;
RasterAnn.AnnRectWidth[hObject2] := 100;
RasterAnn.AnnRectHeight[hObject2] := 100;

//Re-enable the undo feature
RasterAnn.AnnUndoEnable := True;
end;


AnnAutoDialogFontSize Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN ;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnSetAutoText (ANN_AUTOTEXT_DIALOG_FONT, 'Courier New');
RasterAnn.AnnAutoDialogFontSize:= 15;
end;


AnnAutoDrawEnable Example for Delphi

Note:

This topic is for Document/Medical only.

This example toggles the AnnAutoDrawEnable property.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN ;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if (RasterAnn.AnnAutoDrawEnable = True) then
RasterAnn.AnnAutoDrawEnable= False
else
RasterAnn.AnnAutoDrawEnable:= True;
end;


AnnAutomation Property Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;
end;

//This example shows how you can use the AnnAutomation property
//to access the automation object through API functions.
procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
IsBold: Longint; //Is the object's text bold
hAnnObject: Longint;
begin
hAnnObject:= RasterAnn.AnnAutomation;

//Toggle the default font bold property
L_AnnGetFontBold
  (hAnnObject, @IsBold);
if (IsBold <> 0) then
ShowMessage ('Removing bold')
else
ShowMessage ('Making bold');
nRet:= L_AnnSetFontBold
  (hAnnObject, Not IsBold, 0);
if (nRet <> SUCCESS) then
ShowMessage ('L_AnnSetFontBold failed: ' + IntToStr(nRet));
end;


AnnAutoMenuEnable Example for Delphi

Note:

This topic is for Document/Medical only.

This example toggles the AnnAutoMenuEnable property.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN ;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if (RasterAnn.AnnAutoMenuEnable) then
RasterAnn.AnnAutoMenuEnable:= False
else
RasterAnn.AnnAutoMenuEnable:= True;
end;


AnnChange example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN ;
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
Buffer: String;
nTag: Longint;
hAnnObject: OleVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNCHANGE:
begin
hAnnObject:= OleVariant(Params.rgvarg^[0]);
RasterAnn.AnnGetTag (hAnnObject);
nTag:= RasterAnn.AnnTag;
Buffer:= ' This is a change for the button tagged ' + IntToStr(nTag);
ShowMessage (Buffer);
end;
end;
end;


AnnContainer example for Delphi

procedure TForm1.LEADRasterOLEDB1DataLoaded(Sender: TObject;
nStatus: Smallint);
var
sRet: Smallint ;
begin
if (nStatus = 0) then
begin
RasterAnn.AnnContainer := 0;
RasterAnn.AnnContainer := LEADRasterOLEDB1.AnnContainer;
end
else
begin
if (nStatus <> ERROR_FILENOTFOUND) Then //if it's not an empty record
ShowMessage ( 'Error loading from database!') ;
end;
LEADRasterView1.ForceRepaint (sRet);
end;


AnnDataPath example for Delphi

Note:

This topic is for Document/Medical only.

This example shows how to load an annotation file from the Internet.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_RUN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnDataPath (WideString('http://www.leadtools.com/images/test.ann'));
end;


AnnDestroy example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnDestroy (RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED);
end;


AnnEnumerate example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//This example causes the AnnEnumerate event to get fired for all annotations in the container.
RasterAnn.AnnEnumerate (RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, '');
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
hAnnObject: OleVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNENUMERATE:
begin
hAnnObject:= OleVariant(Params.rgvarg^[0]);
ShowMessage ('Annotation Handle: ' + IntToHex(hAnnObject, 6));
end;
end;
end;


AnnEnumerate method example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//This example enumerates through all objects in the AnnContainer
//For each object, the AnnEnumerate event is fired
RasterAnn.AnnEnumerate (RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_NOTTHIS, '');
end;


AnnGetAutoMenuItemEnable example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
hGlobalAnn: Integer;

//Note that hGlobalAnn should be a valid value before clicking Button2.

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
iEnable: AnnMenuConstants;
begin
//This example disables the "delete" menu item from the annotation hGlobalAnn.
RasterAnn.AnnSetAutoMenuItemEnable (hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, '');
RasterAnn.AnnGetAutoMenuItemEnable (hGlobalAnn, ANN_OBJECT_CONTAINER, ANN_AUTOTEXT_MENU_DELETE);
iEnable:= RasterAnn.AnnAutoMenuItemEnable;
Case (iEnable) of
ANN_MENU_ENABLED:
ShowMessage ('ANN_MENU_ENABLED');
ANN_MENU_DISABLED:
ShowMessage ('ANN_MENU_DISABLED');
ANN_MENU_DEFAULT:
ShowMessage ('ANN_MENU_DEFAULT');
end;
end;


AnnGetGrouping example for Delphi

//This example toggles the 'group' state of all objects in the main container
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
bGroup: Boolean;
begin
//Get current group state
bGroup:= RasterAnn.AnnGetGrouping (RasterAnn.AnnContainer);

//Toggle the group state
RasterAnn.AnnSetGrouping (RasterAnn.AnnContainer, Not bGroup, 0);

//Display the group state
if (RasterAnn.AnnGetGrouping(RasterAnn.AnnContainer)) then
ShowMessage ('Objects in AnnContainer are grouped')
else
ShowMessage ('Objects in AnnContainer are not grouped');
end;


AnnGetHyperlinkParam example for Delphi

Note:

This topic is for Document/Medical only.

//This example retrieves parameters using AnnGetHyperlinkParam.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
hGlobalAnn: Integer;
//Note that hGlobalAnn should be a valid value before clicking Button2.

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
nParam0: Integer;
nParam1: Integer;
nParam2: Integer;
nParam3: Integer;
nParam4: Integer;
begin
RasterAnn.AnnSetHyperlinkMsg (hGlobalAnn, ANN_LINK_ANNEVENT5, 1, 2, 3, 4, 5);
RasterAnn.AnnGetHyperlinkParam (hGlobalAnn, 0);
nParam0:= RasterAnn.AnnHyperlinkParam;
RasterAnn.AnnGetHyperlinkParam (hGlobalAnn, 1);
nParam1:= RasterAnn.AnnHyperlinkParam;
RasterAnn.AnnGetHyperlinkParam (hGlobalAnn, 2);
nParam2:= RasterAnn.AnnHyperlinkParam;
RasterAnn.AnnGetHyperlinkParam (hGlobalAnn, 3);
nParam3:= RasterAnn.AnnHyperlinkParam;
RasterAnn.AnnGetHyperlinkParam (hGlobalAnn, 4);
nParam4:= RasterAnn.AnnHyperlinkParam;
ShowMessage ('HyperlinkParams: ' + IntToStr(nParam0) + ',' + IntToStr(nParam1) + ',' + IntToStr(nParam2) + ',' + IntToStr(nParam3) + ',' + IntToStr(nParam4));
end;


AnnGetHyperlinkString example for Delphi

Note:

This topic is for Document/Medical only.

//This example assumes that hGlobalAnn is a handle to a button annotation.
//A hyperlink string is set and retrieved
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
hGlobalAnn: Integer;
//Note that hGlobalAnn should be a valid value before clicking Button2.

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
szString: WideString;
begin
RasterAnn.AnnSetHyperlinkString (hGlobalAnn, ANN_LINK_WEBPAGE, 'http://www.leadtools.com');
RasterAnn.AnnGetHyperlinkString (hGlobalAnn);
szString:= RasterAnn.AnnHyperlinkString;
ShowMessage (szString);
end;


AnnGetHyperlinkType example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This examples determines the type of the hyperlink and then displays the
//params if the type is ANN_LINK_ANNEVENT or ANN_LINK_ANNEVENT5

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
msgStr: String;
nType: Smallint;
hObject: Integer;
iParamCount: Integer;
lParam1: Longint;
lParam2: Longint;
lParam3: Longint;
lParam4: Longint;
lParam5: Longint;

begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNHYPERLINK:
begin
lParam5:= OleVariant(Params.rgvarg^[0]);
lParam4:= OleVariant(Params.rgvarg^[1]);
lParam3:= OleVariant(Params.rgvarg^[2]);
lParam2:= OleVariant(Params.rgvarg^[3]);
lParam1:= OleVariant(Params.rgvarg^[4]);
iParamCount:= OleVariant(Params.rgvarg^[5]);
hObject:= OleVariant(Params.rgvarg^[6]);

RasterAnn.AnnGetHyperlinkType (hObject);
nType:= RasterAnn.AnnHyperlinkType;
if ((nType = ANN_LINK_ANNEVENT5) Or (nType = ANN_LINK_ANNEVENT)) then
begin
if iParamCount >= 0 then
msgStr:= IntToStr(iParamCount) + ' params are valid' + Chr(13);
if iParamCount >= 1 then
msgStr := msgStr + 'Param1: ' + IntToStr(lParam1) + Chr(13);

if iParamCount >= 2 then
msgStr := msgStr + 'Param2: ' + IntToStr(lParam2) + Chr(13);

if iParamCount >= 3 then
msgStr := msgStr + 'Param3: ' + IntToStr(lParam3) + Chr(13);

if iParamCount >= 4 then
msgStr := msgStr + 'Param4: ' + IntToStr(lParam4) + Chr(13);

if iParamCount = 5 then
msgStr := msgStr + 'Param5: ' + IntToStr(lParam5) + Chr(13);

end
else
msgStr := 'Invalid Type';
ShowMessage (msgStr);
end;
end;
end;


AnnGetObjectFromTag example for Delphi

//This example retrieves the annotation handle for tag no. 1
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
hTagObject: Integer;
lTag: Longint;
begin
ShowMessage ('I Will Looking For an Object With Tag = 1');
RasterAnn.AnnGetObjectFromTag (RasterAnn.AnnContainer, 1, False);
hTagObject:= RasterAnn.AnnTagObject;
RasterAnn.AnnGetTag (hTagObject);
lTag:= RasterAnn.AnnTag;
if (lTag= 1) then
ShowMessage ('Annotation Found with tag 1: ' + IntToHex(hTagObject, 6))
else
ShowMessage ('Annotation NOT found with tag 1 ');
end;


AnnGetPoint... example for Delphi

Note:

This topic is for Document/Medical only.

//In the AnnDrawn event, this example checks to see if the annotation object is a polygon.
//If it is a polygon, the example gets the number of points that define the object;
//then it gets the arrays of X and Y coordinates and displays the points in a message box.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);

LEADEventSink1
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

/*In the AnnDrawn event, this example checks to see if the annotation object is a polygon.
If it is a polygon, the example gets the number of points that define the object;
then it gets the arrays of X and Y coordinates and displays the points in a message box.*/
procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
nType: TOleEnum;
a: Integer;
hAnnObject: OleVariant;
RasterVarX: LEADRasterVariant; //array for the X coordinates
RasterVarY: LEADRasterVariant; //array for the Y coordinates
nPoints: Longint; //number of points in the object
msgStr: String;
begin
RasterVarX:= CoLEADRasterVariant.Create ( );
RasterVarY:= CoLEADRasterVariant.Create ( );
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNDRAWN:
begin
hAnnObject:= OleVariant(Params.rgvarg^[0]);
RasterAnn.AnnGetType(hAnnObject);
nType:= RasterAnn.AnnType;
if (nType = ANN_OBJECT_POLYGON) then //Is the object a polygon?
begin
RasterVarX:= CoLEADRasterVariant.Create ( );
RasterVarY:= CoLEADRasterVariant.Create ( );
ShowMessage ('Object is a Polygon');
RasterAnn.AnnGetPointCount (hAnnObject); //get the number of points
nPoints:= RasterAnn.AnnPointCount;
RasterAnn.AnnGetPointX(hAnnObject, RasterVarX); //get the X coordinates
RasterAnn. AnnGetPointY (hAnnObject, RasterVarY); //get the Y coordinates
msgStr:= '(';
for a:= 1 to nPoints do
msgStr:= msgStr + '{' + IntToStr(RasterVarX.LongItemValue[a - 1]) + ',' + IntToStr(RasterVarY.LongItemValue[a - 1]) + '}';
msgStr:= msgStr + ')';
ShowMessage ( 'The Polygon`s ' + IntToStr(nPoints) + ' points are:' + Chr(13) + msgStr ) ;

end;
end;
end;
end;


AnnGetSelectList example for Delphi

Note:

This topic is for Document/Medical only.

This example gets the number of selected annotation objects; then it gets an array of the selected object handles and checks to see if any of the objects in the array are polygons.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
lType: TOleEnum;
a: Integer;
bSelected: Boolean;
nCount: Integer;
RasterVar: LEADRasterVariant; //array for the selected object handles
Begin
RasterVar:= CoLEADRasterVariant.Create ( );
bSelected:= False;
RasterAnn.AnnGetSelectCount();
nCount:= RasterAnn.AnnSelectCount;//get number of selected objects
RasterAnn.AnnGetSelectList (RasterVar); //get the handles of the selected objects
ShowMessage (IntToStr(nCount) + ' objects were selected');
for a:= 1 to nCount do
begin
RasterAnn.AnnGetType ( RasterVar.LongItemValue[a - 1] );
lType:= RasterAnn.AnnType;
if (lType = ANN_OBJECT_POLYGON) then //Is the object a polygon?
bSelected:= True;
end;
if (bSelected <> True) then
ShowMessage ('No Polygon Objects were selected');
end;


AnnGetVisible example for Delphi

//This example toggles the visible state of the annotation container.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
bVisible: WordBool ;
begin
RasterAnn.AnnGetVisible (RasterAnn.AnnContainer);
bVisible:= RasterAnn.AnnVisible;
RasterAnn.AnnSetVisible (RasterAnn.AnnContainer, Not bVisible, ANN_FLAG_RECURSE, '');
RasterAnn.AnnGetVisible (RasterAnn.AnnContainer);
bVisible:= RasterAnn.AnnVisible;
if ( bVisible ) then
ShowMessage ('AnnGetVisible: True')
else
ShowMessage ('AnnGetVisible: False');
end;


AnnGroup example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnGroup (RasterAnn.AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, '');
end;


AnnHyperlink example for Delphi

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
msgStr: String;
nType: Smallint;
hObject: Integer;
iParamCount: Integer;
lParam1: Longint;
lParam2: Longint;
lParam3: Longint;
lParam4: Longint;
lParam5: Longint;

begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNHYPERLINK:
begin
lParam5:= OleVariant(Params.rgvarg^[0]);
lParam4:= OleVariant(Params.rgvarg^[1]);
lParam3:= OleVariant(Params.rgvarg^[2]);
lParam2:= OleVariant(Params.rgvarg^[3]);
lParam1:= OleVariant(Params.rgvarg^[4]);
iParamCount:= OleVariant(Params.rgvarg^[5]);
hObject:= OleVariant(Params.rgvarg^[6]);

RasterAnn.AnnGetHyperlinkType (hObject);
nType:= RasterAnn.AnnHyperlinkType;
if ((nType = ANN_LINK_ANNEVENT5) Or (nType = ANN_LINK_ANNEVENT)) then
begin
if iParamCount >= 0 then
msgStr:= IntToStr(iParamCount) + ' params are valid' + Chr(13);
if iParamCount >= 1 then
msgStr := msgStr + 'Param1: ' + IntToStr(lParam1) + Chr(13);

if iParamCount >= 2 then
msgStr := msgStr + 'Param2: ' + IntToStr(lParam2) + Chr(13);

if iParamCount >= 3 then
msgStr := msgStr + 'Param3: ' + IntToStr(lParam3) + Chr(13);

if iParamCount >= 4 then
msgStr := msgStr + 'Param4: ' + IntToStr(lParam4) + Chr(13);

if iParamCount = 5 then
msgStr := msgStr + 'Param5: ' + IntToStr(lParam5) + Chr(13);

end
else
msgStr := 'Invalid Type';
ShowMessage (msgStr);
end;
end;
end;


AnnHyperlinkMenu example for Delphi

//The AnnHyperLinkMenu event occurs whenever the user clicks on the Hyperlink menu //item provided for automated annotations.
//The menu item is enabled and disabled using AnnHyperlinkMenuEnable property.
//The following is an example of AnnHyperlinkMenu event code, which includes a call to //AnnSetHyperlinkMsg.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
x: Integer;
nCount: OleVariant;
RasterVarObjects: LEADRasterVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNHYPERLINKMENU:
begin
nCount:= OleVariant(Params.rgvarg^[0]);
RasterVarObjects:= LEADRasterVariant(Params.rgvarg^[1].dispVal);

//set HyperLink to type ANNLINK_ANNEVENT5
//and set theC 5 params to some values.
for x:= 0 to nCount - 1 do
RasterAnn.AnnSetHyperlinkMsg(RasterVarObjects.LongItemValue[x],
ANN_LINK_ANNEVENT5,
5,
4,
3,
2,
1);
end;
end;
end;


AnnHyperlinkMenuEnable example for Delphi

Note:

This topic is for Document/Medical only.

This example toggles the AnnHyperlinkMenuEnable property.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//toggle AnnHyperLinkMenu item and event
RasterAnn.AnnHyperlinkMenuEnable:= Not RasterAnn.AnnHyperlinkMenuEnable;
if (RasterAnn.AnnHyperlinkMenuEnable) then
ShowMessage ('AnnHyperlinkMenuEnable: True')
else
ShowMessage ('AnnHyperlinkMenuEnable: False');
end;


AnnInsert example for Delphi

Note:

This topic is for Document/Medical only.

//This example
//1.creates an ellipse annotation object
//2.sizes the ellipse
//3.inserts the ellipse into the annotation container
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
hEllipseObject: longint ;
begin

RasterAnn.AnnCreate ( ANN_OBJECT_ELLIPSE, False, True);
hEllipseObject:= RasterAnn.AnnObject;

RasterAnn.AnnRectLeft [hEllipseObject] := 0;
RasterAnn.AnnRectTop [hEllipseObject] := 0;
RasterAnn.AnnRectWidth [hEllipseObject] := 100;
RasterAnn.AnnRectHeight [hEllipseObject]:= 100;
RasterAnn.AnnInsert ( RasterAnn.AnnContainer, hEllipseObject, False ) ;
end;


AnnLoadArray example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.AnnLoadArrayClick(Sender: TObject);
var
i: Smallint;
Buffer: Variant;
MyBufferPtr: Pointer;
BytesRead: Longint;
FileHandle: integer;
RasterVarBuffer: LEADRasterVariant;
begin
Buffer:= VarArrayCreate([0, 4000-1], varByte);
MyBufferPtr:= AllocMem(4000);
FileHandle:= FileOpen('c:\test.ann', fmOpenRead );
if (FileHandle > 0) then
begin
BytesRead:= FileRead(FileHandle, MyBufferPtr^, 4000 ); // read from the file
for i:= 0 to BytesRead-1 do
Buffer[i]:= Byte((Pchar(MyBufferPtr)+i)^);
RasterVarBuffer.StringValue:= Buffer;
RasterAnn.AnnLoadArray ( RasterVarBuffer, BytesRead, 1 );
end;
FreeMem(MyBufferPtr);
FileClose( FileHandle );
end;


AnnLock example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
//This example locks objects of type ANN_OBJECT_ELLIPSE using the key ‘LEADTOOLS‘.
procedure TForm1.Button2Click(Sender: TObject);
var
lType: TOleEnum;
a: Integer;
bSelected: Boolean;
nCount: Cardinal;
RasterVarObjects: LEADRasterVariant; //array for the selected object handles
begin
//lock only the ellipse objects that are selected
bSelected := False;
RasterAnn.AnnGetSelectCount ( ); //get number of selected objects
nCount:= RasterAnn.AnnPointCount;
RasterVarObjects:= CoLEADRasterVariant.Create ( );
RasterAnn.AnnGetSelectList ( RasterVarObjects ); //get the handles of the selected objects
for a := 0 to nCount-1 do
begin
RasterAnn.AnnGetType (RasterVarObjects.LongItemValue[a]);
lType:= RasterAnn.AnnType;
if (lType = ANN_OBJECT_ELLIPSE) then //Is the object an ellipse?
begin
bSelected := True;
RasterAnn.AnnLock (RasterVarObjects.LongItemValue[a], 'LEADTOOLS', False);
end;
end;
if (bSelected <> True) then
ShowMessage ('No Ellipse Objects were selected');
end;


AnnLocked example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
hAnnObject:OleVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNLOCKED:
begin
hAnnObject:= OleVariant(Params.rgvarg^[0]);
ShowMessage ('AnnObject: ' + IntToStr(hAnnObject) + ' was locked!');
end;
end;
end;


AnnMenu example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
szout: String;
nID: Integer;
hMenu: OleVariant;
RasAnnMenu: LEADRasterAnnMenu;
AnnPopupMenu: LEADRasterAnnMenu;
x: Integer;

begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNMENU:
begin
hMenu:= OleVariant(Params.rgvarg^[0]);
RasAnnMenu:= CreateComObject(CLASS_LEADRasterAnnMenu)as LEADRasterAnnMenu;
RasAnnMenu.SetAnnMenu (hMenu);
RasAnnMenu.EnableMethodErrors:= False;
szout:= 'There are ' + IntToStr(RasAnnMenu.Count) + ' Items';
ShowMessage (szout);
szout:= 'Original Text for item#2: ';
szout:= szout + RasAnnMenu.ItemString [1];
ShowMessage (szout);
//set new string
RasAnnMenu.ItemString[1]:= 'TestText';
szout := 'Custom Text for item#2: ';
szout := szout + RasAnnMenu.ItemString[1];
ShowMessage (szout);

//make 3rd and 4th menu items have the same command id
nID := RasAnnMenu.ItemID [3];
RasAnnMenu.ItemID[2]:= nID;

//check all unchecked menu items that are not popup submenus
//disable all enabled menu items that are not popup submenus
for x := 0 to RasAnnMenu.Count do
begin
if (RasAnnMenu.ItemType [x]= ANN_MENUITEMTYPE_NORMAL) then
begin
if (RasAnnMenu.ItemChecked [x]) then
RasAnnMenu.ItemChecked[x]:= True;
if (RasAnnMenu.ItemEnabled [x]) then
RasAnnMenu.ItemEnabled[x]:= False;
end;
end;

//insert 2 user-defined menu items
RasAnnMenu.AddItem ('Test&1', ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 0, RasAnnMenu.Count - 1);
RasAnnMenu.AddItem ('Test&2', ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 1, RasAnnMenu.Count - 1);

//delete the last menu item
RasAnnMenu.DeleteItem (RasAnnMenu.Count - 1);

//delete the first menu item
RasAnnMenu.DeleteItem (0);

//insert a popup menu
RasAnnMenu.AddItem ('Popup', ANN_MENUITEMTYPE_SUBMENU, 0, RasAnnMenu.Count);

//get the new item, and add some items to it
RasAnnMenu.GetSubMenu (RasAnnMenu.Count - 1, AnnPopupMenu);

AnnPopupMenu.AddItem ('Popup&1', ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 2, AnnPopupMenu.Count);
AnnPopupMenu.AddItem ('Popup&2', ANN_MENUITEMTYPE_NORMAL, ANN_EVENT_MENUFIRST + 3, AnnPopupMenu.Count);
end;

LEADRASTERANNOTATIONEVENTS_ANNUSERMENU:
begin
nID:= OleVariant(Params.rgvarg^[0]);
if (nID = ANN_EVENT_MENUFIRST) then
RasterAnn.AnnFlip (False, 0, True)
else
ShowMessage ('nID = ANN_EVENT_MENUFIRST + ' + IntToStr(nID - ANN_EVENT_MENUFIRST));
end;
end;
end;


AnnMouseDown example for Delphi

//This example shows
//1.
//How to create a custom annotation (circle inside a square)
//Set the AnnTool property to ANN_TOOL_USER_FIRST to see how this works

//2.
//How to restrict the rectangle annotation to be a square
//Set AnnTool property to ANN_TOOL_RECTANGLE to see how this works

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
hRectObject: Longint;
hEllipseObject: Longint;
x0: Longint;
y0: Longint;

Procedure AdjustMousePos(Shift: Integer; x: Longint; y: Longint);
var
dx: Integer;
dy: Integer;
begin
if (Shift = 1) then
begin
// if shift key is down, force the creation of squares
dx:= Abs(x - x0);
dy:= Abs(y - y0);
if (dx > dy) then
begin
// adjust y to be as far from y0 as x is from x0
if (y > y0) then
y:= y0 + dx
else
y:= y0 - dx;
end
else
begin
// adjust x to be as far from x0 as y is from y0
if (x > x0) then
x:= x0 + dy
else
x:= x0 - dy;
end;
// set the mouse cursor and update its position
RasterAnn.SetMousePos (x, y, False);
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
Button: Integer;
Shift: Integer;
x: longint;
y: longint;

begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNMOUSEDOWN:
begin
x:= OleVariant(Params.rgvarg^[1]);
y:= OleVariant(Params.rgvarg^[0]);

x0:= x;
y0:= y;
Case (RasterAnn.AnnTool) of
ANN_TOOL_USER_FIRST:
begin
//create the objects
RasterAnn.AnnSetSelected (RasterAnn.AnnContainer, False, True);
//Add an undo node to undo the creation of these objects.
RasterAnn.AnnAddUndoNode ();

RasterAnn.AnnCreate (ANN_OBJECT_RECT, True, True);
hRectObject:= RasterAnn.AnnObject;
RasterAnn.AnnCreate (ANN_OBJECT_ELLIPSE, True, True);
hEllipseObject:= RasterAnn.AnnObject;
//set the automation defaults to the objects newly created
RasterAnn.AnnSetAutoDefaults (hRectObject, 0);
RasterAnn.AnnSetAutoDefaults (hEllipseObject, 0);
//start defining them from the x, y coordinate
RasterAnn.AnnDefine (hRectObject, x, y, ANN_DEFINE_BEGINSET);
RasterAnn.AnnDefine (hEllipseObject, x, y, ANN_DEFINE_BEGINSET);
end;
end;
end;

LEADRASTERANNOTATIONEVENTS_ANNMOUSEMOVE:
begin
Button:= OleVariant(Params.rgvarg^[3]);
Shift:= OleVariant(Params.rgvarg^[2]);
x:= OleVariant(Params.rgvarg^[1]);
y:= OleVariant(Params.rgvarg^[0]);
if (Button = 1) then
begin
Case (RasterAnn.AnnTool) of
ANN_TOOL_USER_FIRST:
begin
// update the objects from the x, y coordinate
RasterAnn.AnnDefine (hRectObject, x, y, ANN_DEFINE_UPDATE);
RasterAnn.AnnDefine (hEllipseObject, x, y, ANN_DEFINE_UPDATE);
end;
ANN_TOOL_RECT:
AdjustMousePos (Shift, x, y);
end;
end;
end;
LEADRASTERANNOTATIONEVENTS_ANNMOUSEUP:
begin
Shift:= OleVariant(Params.rgvarg^[2]);
x:= OleVariant(Params.rgvarg^[1]);
y:= OleVariant(Params.rgvarg^[0]);

Case (RasterAnn.AnnTool) of
ANN_TOOL_USER_FIRST:
begin
RasterAnn.AnnDefine (hRectObject, x, y, ANN_DEFINE_END);
RasterAnn.AnnDefine (hEllipseObject, x, y, ANN_DEFINE_END);
RasterAnn.AnnSetSelected (hRectObject, True, False);
RasterAnn.AnnSetSelected (hEllipseObject, True, False);
RasterAnn.AnnGroup (RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, '');
hEllipseObject:= 0;
hRectObject:= 0;
end;
ANN_TOOL_RECT:
AdjustMousePos (Shift, x, y);
end;
end;
end;
end;


AnnMove example for Delphi

Note:

This topic is for Document/Medical only.

//This example moves one or more selected annotation objects.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
DeltaX: Integer;
DeltaY: Integer;
begin
//Use pixels
LEADRasterView1.ScaleMode:= 3;

//Specify arbitrary delta values.
DeltaX:= 20;
DeltaY:= -20;

//Move the selected annotations.
RasterAnn.AnnMove (DeltaX, DeltaY, True);
end;


AnnParentRasterView example for Delphi

//This sample shows the minimal code to use the LEAD Annotation COM object
//LEADRasterView1 is a LEAD Raster View control

var
RasterAnn: LEADRasterAnnotation;
procedure TForm1.AnnParentRasterViewClick(Sender: TObject);
begin
//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Attach the annotation object to the raster view control
RasterAnn.AnnParentRasterView:= LEADRasterView1.Raster;

//Automatically update annotations with raster changes
RasterAnn.AnnAutoUpdate:= True;

//...
//... the rest of the program
//...
end;


AnnRectLeft example for Delphi

Note:

This topic is for Document/Medical only.

//This example creates two annotation notes as a single undo operation
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
hObject1: Longint;
hObject2: Longint;
begin
//Call the AddUndoNode method to add an undo node to the container.
RasterAnn.AnnAddUndoNode ();

//Disable the undo feature
RasterAnn.AnnUndoEnable := False;

//Perform the operations to be combined into one undo.
RasterAnn.AnnCreate (ANN_OBJECT_NOTE, True, True);
hObject1:= RasterAnn.AnnObject;
RasterAnn.AnnRectLeft [hObject1] := 0;
RasterAnn.AnnRectTop [hObject1] := 0;
RasterAnn.AnnRectWidth [hObject1] := 100;
RasterAnn.AnnRectHeight [hObject1] := 100;

RasterAnn.AnnCreate (ANN_OBJECT_NOTE, True, True);
hObject2:= RasterAnn.AnnObject;
RasterAnn.AnnRectLeft[hObject2] := 0;
RasterAnn.AnnRectTop[hObject2] := 100;
RasterAnn.AnnRectWidth[hObject2] := 100;
RasterAnn.AnnRectHeight[hObject2] := 100;

//Re-enable the undo feature
RasterAnn.AnnUndoEnable := True;
RasterAnn.AnnHyperlinkMenuEnable := True;
end;


AnnRotate example for Delphi

Note:

This topic is for Document/Medical only.

//This example uses the AnnFlip, AnnReverse, and AnnRotate methods. To code this //example, add a button named Test to the example you created in Loading and //Displaying an Image. For best results when you run the example, draw two objects in //opposite corners, and use the right mouse button to select all annotation objects. The
// button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate
//methods.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.AnnRotateClick(Sender: TObject);
var
MyCaption: String;
begin
MyCaption := AnnRotate.Caption;
if (MyCaption= 'Flip') then
begin
//Flip using the center of the bitmap as the axis.
RasterAnn.AnnFlip (True, LEADRasterView1.Raster.BitmapHeight / 2, True);
AnnRotate.Caption := 'Reverse';
end
else
begin
if (MyCaption= 'Reverse')then
begin
//Reverse using the center of the bitmap as the axis.
RasterAnn.AnnReverse (True, LEADRasterView1.Raster.BitmapWidth / 2, True);
AnnRotate.Caption := 'Rotate';
end
else
begin
if (MyCaption= 'Rotate')then
begin
//Rotate 90 degrees using the center of the bitmap as the axis.
RasterAnn.AnnRotate (True, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 90, True);
AnnRotate.Caption := 'Flip';
end
else
begin
AnnRotate.Caption := 'Flip';
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;
RasterAnn.AnnTool := ANN_TOOL_REDACT;
ShowMessage ('Draw two objects, use the right mouse button to select all, then click the command button');
end;
end
end;
end;


AnnSaveArray example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

var
RasterVarBuffer: LEADRasterVariant;
RasterIO: LEADRasterIO;
lSize: longint;
MyBufferPtr: Pointer;
FileHandle: L_HANDLE;
uWrite: cardinal;
begin
RasterIO:= CoLEADRasterIO.Create ();
RasterVarBuffer:= coLEADRasterVariant.Create ( );

RasterAnn.AnnSaveArray ( ANN_FMT_NATIVE, True, RasterVarBuffer, SAVE_OVERWRITE, 0 );
FileHandle:= CreateFile ( 'c:\test.ann',
GENERIC_WRITE,
0,
Nil,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0 );
if (FileHandle > 0 ) then
begin
lSize:= RasterIO.ArraySize (RasterVarBuffer);
MyBufferPtr := AllocMem(lSize);
StrLCopy ( MyBufferPtr, PChar(RasterVarBuffer.StringValue), lSize );
writeFile ( FileHandle, MyBufferPtr^, lSize, uWrite, Nil );
FreeMem(MyBufferPtr);
end;
FileClose (FileHandle);
end;


AnnSaveMemory example for Delphi

Note:

This topic is for Document/Medical only.

This example lets you save the current annotations to a file in memory, and lets you load the annotations that were saved.

1. | Start with the project that you created in Creating and Using Annotations.
2. | Declare the following in the private section of your main form:

hMemGlobal: longint;
iSizeGlobal: longint;

3.

Add the following code to the main form's Load procedure

RasterAnn:= CoLEADRasterAnnotation.Create ();

4. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | AnnSaveMem | Save In Memory
 | AnnLoadMem | Load From Memory
5. | Code the AnnSaveMem button's Click procedure as follows:

procedure TForm1.AnnSaveMemClick(Sender: TObject);
begin
if (RasterAnn.AnnSaveMemory (hMemGlobal, ANN_FMT_NATIVE, False, iSizeGlobal) <> 0) then
ShowMessage ('Error calling AnnSaveMemory');
end;

6.

Code the AnnLoadMem button's Click procedure as follows:

//Load the annotations from the memory-resident file.
procedure TForm1.AnnLoadMemClick(Sender: TObject);
begin
if RasterAnn.AnnLoadMemory (hMemGlobal, iSizeGlobal) <> 0 Then
ShowMessage ('Error calling AnnLoadMemory')
else
ShowMessage ('AnnLoadMemory succeeded');
GlobalFree (hMemGlobal);
end;

7.

Run your program to test it.


AnnSaveTag example for Delphi

Note:

This topic is for Document/Medical only.

//This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterAnn.AnnSaveTag (RasterIO, True, False);
RasterIO.Save (LEADRasterView1.Raster, 'c:\testwang.tif', FILE_CCITT_GROUP4, 1, 2, SAVE_OVERWRITE);

//clear the LEAD raster view control
LEADRasterView1.Raster.Bitmap := 0;

//Reload the image with the wang-compatible annotations
RasterIO.Load (LEADRasterView1.Raster, 'c:\testwang.tif', 0, 0, 1);
RasterAnn.AnnLoad ('c:\testwang.tif', 1);
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;
end;


AnnSelect example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This example for the AnnSelect event displays a message box showing the number of //selected procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
nType: AnnObjectType;
x: Integer;
nPolyCount: Integer;
nCount: Integer;
RasterVarObjects: LEADRasterVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNSELECT:
begin
nCount:= OleVariant(Params.rgvarg^[0]);
RasterVarObjects:= LEADRasterVariant(Params.rgvarg^[1].dispVal);
nPolyCount:= 0;
for x:= 0 to nCount-1 do
begin
RasterAnn.AnnGetType (RasterVarObjects.LongItemValue[x]);
nType:= RasterAnn.AnnType;
if nType = ANN_OBJECT_POLYGON then
nPolyCount:= nPolyCount + 1;
end;
ShowMessage (IntToStr(nCount) + ' objects were selected. ' + IntToStr(nPolyCount) + ' Polygon Objects were selected');
end;
end;
end;


AnnSetAutoMenuItemEnable Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
// disable the Delete menu item from all the selected objects
RasterAnn.AnnSetAutoMenuItemEnable (RasterAnn.AnnContainer, 0, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, '');
// disable the Delete menu item from all the ellipse objects
RasterAnn.AnnSetAutoMenuItemEnable (RasterAnn.AnnAutomation, ANN_OBJECT_ELLIPSE, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, 0, '');
end;


AnnSetAutoText Example for Delphi

Note:

This topic is for Document/Medical only.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
TestText: WideString;
begin
RasterAnn.AnnGetAutoText (ANN_AUTOTEXT_MENU_UNDO);
TestText:= RasterAnn.AnnAutoText;
TestText:= TestText + ' - New';
RasterAnn.AnnSetAutoText (ANN_AUTOTEXT_MENU_UNDO, TestText);
end;


AnnSetUser Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//hide the selected objects
RasterAnn.AnnSetVisible (RasterAnn.AnnContainer, False, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, '');
//set the selected objects to belong to user XXX
RasterAnn.AnnSetUser (RasterAnn.AnnContainer, '', 'xxx', True);
end;


AnnShowLockedIcon Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This example toggles the AnnShowLockedIcon property.
procedure TForm1.Button2Click(Sender: TObject);
begin

RasterAnn.AnnShowLockedIcon:= Not RasterAnn.AnnShowLockedIcon;
if (RasterAnn.AnnShowLockedIcon) then
ShowMessage ('AnnShowLockedIcon: True')
else
ShowMessage ('AnnShowLockedIcon: False');
end;


AnnToolChecked Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
iTool: OleVariant;
TestString: String;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNTOOLCHECKED:
begin
iTool:= OleVariant (Params.rgvarg^[0]);
Case iTool of
ANN_TOOL_SELECT:
TestString:= 'Selection pointer tool';
ANN_TOOL_LINE:
TestString:= 'Line tool';
ANN_TOOL_RECT:
TestString:= 'Rectangle tool';
ANN_TOOL_ELLIPSE:
TestString:= 'Ellipse tool';
//...
//...
//...
else
TestString:= 'User defined tool';
end;

ShowMessage (TestString);
end;
end;
end;


AnnToolDestroy Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNTOOLDESTROY:
begin
ShowMessage ('You have closed the toolbar.');
end;
end;
end;


AnnUndo Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;

LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This example does an "undo" on the last annotation change
//Note that AnnUndoEnable must be set to TRUE
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnUndo ();
end;


AnnUndoEnable Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//This example sets the annotation undo depth to 10 and
//enables the annotation undo capability
RasterAnn.AnnUndoEnable:= True;
RasterAnn.AnnUndoDepth:= 10;

end;


AnnUngroup Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This examples ungroups all annotation objects that are grouped and selected.
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnUngroup (RasterAnn.AnnContainer, ANN_FLAG_SELECTED + ANN_FLAG_RECURSE, '');
end;


AnnUnlock Example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This is also the example for AnnGetLocked method.
//If an object is found to be locked, using AnnGetLocked method, the object is unlocked, //by AnnUnlock, using the key ‘abcd’.
//hGlobalAnn is a global handle to an annotation object
procedure TForm1.Button2Click(Sender: TObject);
var
bLocked: WordBool;
begin
RasterAnn.AnnGetLocked (hGlobalAnn);
blocked:= RasterAnn.AnnLocked;
if (bLocked) then
RasterAnn.AnnUnlock (hGlobalAnn, 'abcd');
end;


AnnUnlocked Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
hAnnObject: Integer;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNUNLOCKED:
begin
hAnnObject:= OleVariant(Params.rgvarg^[0]);
ShowMessage ('AnnObject: ' + IntToStr(hAnnObject) + ' was unlocked!');
end;
end;
end;


AnnUnrealize Example for Delphi

Note:

This topic is for Document/Medical only.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This example Unrealizes all redact objects in the container
procedure TForm1.Button2Click(Sender: TObject);
begin
RasterAnn.AnnUnrealize (RasterAnn.AnnContainer, True);
end;


Appearance Example for Delphi

This example toggles the Appearance property.

if (LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_FLAT )then
LEADRasterView1.Appearance:= RASTERVIEW_APPEARANCE_THREED
else
LEADRasterView1.Appearance:= RASTERVIEW_APPEARANCE_FLAT;


AutoAnimate Example for Delphi

This example gets information about an animated file, uses the information to position the LEAD control, and plays the animation as it loads the file.

var
RasterIO: LEADRasterIO ;
rcClient: TRect;
// Declare variables for positioning the control.
DisplayWidth, DisplayHeight, DisplayLeft, DisplayTop: Integer;
begin

RasterIO:= CoLEADRasterIO.Create ();

// Force continued looping after the file loads.
LEADRasterView1.AutoAnimationLoop:= AUTOANIMATIONLOOP_INFINITE;
// Get information about the file we will load.
RasterIO.GetFileInfo (LEADRasterView1.Raster, 'E:\lead14\dist\images\eye.gif', 0, 0);
// Exit if this is not an animated file.
if (RasterIO.InfoAnimation = false) then
ShowMessage ('Not an animated file')
else
begin
// Calculate information for centering the LEAD control.
Windows.GetClientRect (Handle, rcClient);
DisplayWidth:= Trunc (RasterIO.InfoAnimationWidth);
DisplayHeight:= Trunc (RasterIO.InfoAnimationHeight);
DisplayLeft:= Trunc((rcClient.right - DisplayWidth) / 2);
DisplayTop:= Trunc((rcClient.bottom - DisplayHeight) / 2);
// Center the LEAD control.
MoveWindow (LEADRasterView1.Handle, DisplayLeft, DisplayTop, DisplayLeft + DisplayWidth, DisplayTop + DisplayHeight, False);
// Set properties for playing the animation as is loads.
LEADRasterView1.AutoAnimate := True;
LEADRasterView1.AutoRepaint := True;
//Load the animated file.
RasterIO.Load (LEADRasterView1.Raster, 'E:\lead14\dist\images\eye.gif', 0, 0, -1);
end;
end;


AutoPan Example for Delphi

//toggle AutoPan
LEADRasterView1.AutoPan := Not LEADRasterView1.AutoPan;


AutoSize Example for Delphi

This example shows how the AutoSize property works when loading and when rotating an image.

var
RasterProc: LEADRasterProcess;
RasterIO: LEADRasterIO;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterIO:= CreateComObject (CLASS_LEADRasterIO ) as LEADRasterIO;
LEADRasterView1.AutoSize := True;
RasterIO.Load ( LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1 ) ;
ShowMessage ( 'Control is sized to fit the loaded bitmap' ) ;
RasterProc.Rotate ( LEADRasterView1.Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 0)) ;
ShowMessage ( 'Control is sized to fit the rotated bitmap' ) ;
end;


AutoTrim example for Delphi

This example trims the bitmap with threshold of 10.

procedure TForm1.Button1Click(Sender: TObject);
var
sRet: Smallint;
RasterProc: ILEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as ILEADRasterProcess;

RasterProc.AutoTrim (LEADRasterView1.Raster, 10);
LEADRasterView1.ForceRepaint (sRet);
end;


Average example for Delphi

This example applies an average filter with a 3x3 neighborhood and redisplays the bitmap.

var
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Average (LEADRasterView1.Raster, 3);
LEADRasterView1.ForceRepaint (sRet);
end;


BackColor example for Delphi

This example sets the background color to red. You can zoom out to see the background color.

LEADRasterView1.BackColor:= RGB(255,0,0);


BackErase example for Delphi

This example turns off repainting of the background, and then zooms out to show the effect when repainting.

var
sRet: smallint;
begin
LEADRasterView1.BackErase := False;
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.AutoScroll := False;
//Calculate the values to zoom out by 10 percent and center the image.
LEADRasterView1.DstWidth := LEADRasterView1.DstWidth * 0.9;
LEADRasterView1.DstHeight := LEADRasterView1.DstHeight * 0.9;
LEADRasterView1.DstTop := (LEADRasterView1.ScaleHeight - LEADRasterView1.DstHeight) / 2;
LEADRasterView1.DstLeft := (LEADRasterView1.ScaleWidth - LEADRasterView1.DstWidth) / 2;
//Set the clipping area to the same as the destination rectangle
LEADRasterView1.DstClipWidth := LEADRasterView1.DstWidth;
LEADRasterView1.DstClipHeight := LEADRasterView1.DstHeight;
LEADRasterView1.DstClipTop := LEADRasterView1.DstTop;
LEADRasterView1.DstClipLeft := LEADRasterView1.DstLeft;
//Redisplay the image
LEADRasterView1.ForceRepaint (sRet);
end;


BinaryFilter example for Delphi

This example does omni-directional erosion of black objects and repaints the image.

Var
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
RasterProc.BinaryFilter (LEADRasterView1.Raster, BFLT_EROSION_OMNI);
LEADRasterView1.ForceRepaint (sRet);
end;


BitmapAlpha example for Delphi

This example shows how to use the BitmapAlpha property to save a region in a file's alpha channel. It also shows how to use the region as a mask for transparency.

var
sRet: smallint;
rgntop: Single;
rgnleft: Single;
rgnwidth: Single;
rgnheight: Single;
hRGN: Longint;
RasterIO:LEADRasterIO;
RasterProc:LEADRasterProcess;

begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) As LEADRasterIO;
RasterProc:= CreateComObject ( CLASS_LEADRasterProcess) As LEADRasterProcess;

LEADRasterView1.ScaleMode := 3;
RasterIO.Load ( LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1 ) ;
LEADRasterView1.AutoRepaint := False;

//Get an alpha channel bitmap, and fill it with white
LEADRasterView2.Raster.Bitmap:= LEADRasterView1.Raster.BitmapAlpha;
RasterProc.Fill ( LEADRasterView2.Raster, RGB(255, 255, 255)) ;
rgntop := 0;
rgnleft := 0;
rgnwidth := LEADRasterView1.Raster.BitmapWidth;
rgnheight := LEADRasterView1.Raster.BitmapHeight;
//Create an elliptical region in the AlphaBitmap
LEADRasterView2.Raster.SetRgnEllipse ( rgntop, rgnleft, rgnwidth, rgnheight, L_RGN_SET ) ;
//Fill the region with black
RasterProc.Fill ( LEADRasterView2.Raster, RGB(0, 0, 0)) ;
//Free the region
LEADRasterView2.Raster.FreeRgn ( ) ;
//Update the alpha channel in the main bitmap
LEADRasterView1.Raster.BitmapAlpha := LEADRasterView2.Raster.Bitmap;
//Save the bitmap as 32-bit TGA
RasterIO.Save ( LEADRasterView1.Raster, 'd:\pictures\test.tga', FILE_TGA, 32, 0, SAVE_OVERWRITE ) ;
//Free the bitmaps
LEADRasterView1.Raster.Bitmap := 0;
LEADRasterView2.Raster.Bitmap := 0;
//Load the bitmap we just saved and get the alpha channel
RasterIO.Load ( LEADRasterView1.Raster, 'd:\pictures\test.tga', 0, 0, 1 ) ;
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Raster.BitmapAlpha;
//Create a region in the AlphaBitmap that includes all of the black pixels
LEADRasterView2.Raster.SetRgnColor ( RGB(0, 0, 0), L_RGN_SET ) ;
//Get the region from the AlphaBitmap and set it into the main bitmap
hRGN := LEADRasterView2.Raster.GetRgnHandle ( ) ;
LEADRasterView1.Raster.SetRgnHandle ( hRGN, 0, 0, L_RGN_SET ) ;
LEADRasterView2.Raster.DeleteRgnHandle ( hRGN ) ;
LEADRasterView1.PaintRgnOnly := True;
LEADRasterView1.ForceRepaint ( sRet ) ;
end;


BitmapDataPath Example for Delphi

This example shows how to load an image from the Internet. It uses the BitmapDataPath property to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.

//declare the RasterIO object.
var
RasterIO: LEADRasterIO;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
LEADEventSink1.Connect (RasterIO, _LEADRasterIOEvents);
//Start the asynchronous load.
RasterIO.BitmapDataPath (LEADRasterView1.Raster, WideString('http://www.leadtools.com/images/tiger2.cmp'));
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
sRet: Smallint;
ReadyState: Integer;
begin
case (DispID) of
LEADRASTERIOEVENTS_READYSTATECHANGE:
begin
ReadyState:= OleVariant(Params.rgvarg^[0]);
//Paint the image when loading is complete.
if (ReadyState = RASTER_READYSTATE_COMPLETE) then
begin
LEADRasterView1.AutoSetRects:= True;
LEADRasterView1.PaintSizeMode:= PAINTSIZEMODE_FIT;
LEADRasterView1.ForceRepaint (sRet);
end;
end;
end;
end;


BitmapToClient example for Delphi

var
sRet: Smallint;
szOut: String;
begin

//Test a bitmap location for its screen location
LEADRasterView1.ScaleMode:= 3; //pixels b/c I'm passing pixels
LEADRasterView1.BitmapToClient (50, 50, sRet);
szOut:= '';
szOut:= szOut + 'ClientX = ' + IntToStr(Trunc(LEADRasterView1.ConvertX)) + Chr(10) + Chr(13);
szOut:= szOut + 'ClientY = ' + IntToStr(Trunc(LEADRasterView1.ConvertY)) + Chr(10) + Chr(13);
ShowMessage (szOut);
end;


BitmapXRes and BitmapYRes example for Delphi

This example sets the bitmap's resolution to 300 x 600 DPI.

LEADRasterView1.Raster.BitmapXRes:= 300;
LEADRasterView1.Raster.BitmapYRes:= 600;


BitonalScaling example for Delphi

This example sets the display to use scale-to-gray and repaints the image. This affects only 1-bit images.

var
sRet: Smallint;
begin
if (LEADRasterView1.Raster.IsSupportLocked (L_SUPPORT_DOCUMENT)) then
ShowMessage ('No scale to gray - You need to unlock Document/Medical capabilities')
else
begin
LEADRasterView1.BitonalScaling:= BITONALSCALING_SCALETOGRAY;
LEADRasterView1.ForceRepaint (sRet);
end;
end;


BorderRemove example for Delphi

hRgnAll: longint;

//Create the RasterProcess object and UnlockSupport
procedure TForm1.Button1Click(Sender: TObject);
begin
//...
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
//...
end;

procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
begin
//Border Remove
//This example returns a region corresponding to the borders of a bitmap
//For the example, windows regions are returned in the BorderRemove Event and combined.
//In practice it would be easier and faster to just return a LEAD region representing the changes
//The border is removed from the image

//Enable the doc clean event
RasterProc.EnableDocCleanEvents:= True;
//Create a Nil region
hRgnAll:= CreateRectRgn(0, 0, 0, 0);
nRet:= RasterProc.BorderRemove (LEADRasterView1.Raster,
BORDER_CALLBACK_REGION + BORDER_USE_VARIANCE,
BORDER_ALL, 20, 9, 3);
if (nRet = 0) then
begin
LEADRasterView1.Raster.FreeRgn ();
LEADRasterView1.Raster.SetRgnHandle (hRgnAll, 0, 0, L_RGN_SET);
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR
end;
//delete the Windows Rgn
DeleteObject (hRgnAll);
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
hRgn: Longint;
uBorderToRemove: Longint;
fBoundingRectLeft: Single;
fBoundingRectTop: Single;
fBoundingRectWidth: Single;
fBoundingRectHeight: Single;
sBorder : String;
crOut : String;
szTemp: array[0..255] of Char;

begin
case (DispID) of
LEADRASTERPROCESSEVENTS_BORDERREMOVE:
begin
hRgn:= OleVariant(Params.rgvarg^[5]);
uBorderToRemove:= OleVariant(Params.rgvarg^[4]);
fBoundingRectLeft:= OleVariant(Params.rgvarg^[3]);
fBoundingRectTop:= OleVariant(Params.rgvarg^[2]);
fBoundingRectWidth:= OleVariant(Params.rgvarg^[1]);
fBoundingRectHeight:= OleVariant(Params.rgvarg^[0]);

CombineRgn (hRgnAll, hRgnAll, hRgn, RGN_OR);
Case (uBorderToRemove) of
BORDER_TOP:
sBorder:= 'Top';
BORDER_LEFT:
sBorder:= 'Left';
BORDER_RIGHT:
sBorder:= 'Right';
BORDER_BOTTOM:
sBorder:= 'Bottom';
end;
crOut := Format('Border - %s Bounds:%d,%d,%d,%d',
[sBorder,
fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight]);
OutputDebugString(StrPCopy(szTemp,crOut));
RasterProc.DocCleanSuccess:= SUCCESS_REMOVE;
end;
end;
end;


BorderStyle example for Delphi

This example toggles the border style and repaints the image.

var
sRet: Smallint;
begin
if (LEADRasterView1.BorderStyle = 1) then
LEADRasterView1.BorderStyle:= 0
else
LEADRasterView1.BorderStyle:= 1;
LEADRasterView1.ForceRepaint (sRet);
end;


ButtonColumns example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

Procedure IncrementButtonColumns(AnnToolBar: LEADRasterAnnToolBar);
begin
if (AnnToolBar.ToolBarhWnd <> 0) then
AnnToolBar.ButtonColumns:= AnnToolBar.ButtonColumns + 1;
end;


ButtonMenuTool example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//Makes the first rubber stamp tool draw a rectangle
Procedure SetToolToRect(AnnToolBar: LEADRasterAnnToolBar);
var
I: Integer;
begin
for I:= 0 to AnnToolBar.ButtonCount do
begin
//is this the button with the rubber stamps ?
if (AnnToolBar.ButtonToolCount [I] > 1) then
AnnToolBar.ButtonMenuTool [I, 0]:= ANN_TOOL_RECT
end;
end;


ButtonRows example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

Procedure IncrementButtonRows(AnnToolBar: LEADRasterAnnToolBar);
var
I: Integer;
begin
if (AnnToolBar.ToolBarhWnd = 0) then
Exit;
AnnToolBar.ButtonRows:= AnnToolBar.ButtonRows + 1
end;


ButtonVisible example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

Procedure ToggleVisibleState(AnnToolBar: LEADRasterAnnToolBar; iButtonIndex: Integer);
begin
AnnToolBar.ButtonVisible [iButtonIndex]:= Not AnnToolBar.ButtonVisible[iButtonIndex];
if(AnnToolBar.ButtonVisible[iButtonIndex]) then
ShowMessage ('Button Index ' + IntToStr(iButtonIndex) + ' visible state is True' )
else
ShowMessage ('Button Index ' + IntToStr(iButtonIndex) + ' visible state is False' )
end;


Capture example for Delphi

This example captures the current form and displays the captured image with scroll bars.

Dim OldMode
var
sRet: Smallint;
OldMode: Integer;
begin
//Turn on the automatic display rectangles.
LEADRasterView1.AutoSetRects := True;
//Set the scale mode to twips temporarily
OldMode := LEADRasterView1.ScaleMode;
LEADRasterView1.ScaleMode := 1;
LEADRasterView1.Raster.Capture (0, Left, Top, Width, Height);
LEADRasterView1.AutoScroll := True;
LEADRasterView1.ForceRepaint (sRet);
//Set the scale mode to the previous mode
LEADRasterView1.ScaleMode := OldMode;
end;


Change example for Delphi

Typically, you would use this event to flag changed image data and prompt the user to save the changes before closing a window or exiting an application. That use of the event cannot be tested properly without writing a complete application; so this example just shows you a simple test of the event.

This example is for an ILEADRaster Object created at run-time.

var
MyRaster: LEADRaster;

procedure TForm1.Button2Click(Sender: TObject);
begin
//Create the object
MyRaster:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
LEADEventSink1.Connect (MyRaster, _LEADRasterEvents);
//create a new bitmap
MyRaster.ScaleMode:= 3;
MyRaster.CreateBitmap (100, 100, 24); //this will fire the Change event
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
nChange: Longint;
begin
case (DispID) of
LEADRASTEREVENTS_CHANGE:
begin
nChange:= OleVariant(Params.rgvarg^[2]);
ShowMessage ('Image data changed: ' + IntToStr(nChange));
end;
end;
end;


Click and MouseIcon example for Delphi

Click example for Delphi

This example demonstrates the Click event.

procedure TForm1.LEADRasterView1Click (Sender: TObject);
begin
//This example, on a click event, toggles between the default
//mouse pointer.
if (LEADRasterView1.MousePointer = 0) then
begin
LEADRasterView1.MousePointer:= 12;
end
else
LEADRasterView1.MousePointer:= 0;
end;


ClientToBitmap example for Delphi

procedure TForm1.LEADRasterView1MouseDown (Sender: TObject; Button,
Shift: Smallint; x, y: Single);
var
sRet: Smallint;
BitmapX: Single;
BitmapY: Single;

begin
BitmapX:= x;
BitmapY:= y;
LEADRasterView1.ClientToBitmap (BitmapX, BitmapY, sRet);
//Change that pixel to White
LEADRasterView1.Raster.Pixel [LEADRasterView1.ConvertX, LEADRasterView1.ConvertY]:= RGB(255, 255, 255);
end;


ColorRes example for Delphi

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
If LEADRasterView1.Raster.BitmapBits <> 8 Then
begin
Cursor:= crHourglass;
RasterProc.ColorRes (LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
LEADRasterView1.ForceRepaint (sRet);
Cursor:= crDefault;
end;
end;


ColorResList Example for Delphi

This example changes the hue of bitmaps in a list, and then plays the list as an animation. When changing the hue, it preserves the transparent color.

var
i: integer; // Loop counter
uCount: Cardinal; // Number of bitmaps in the list
TransparentColor: Longint; // Color used for transparency
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
// Save the current transparent color.
TransparentColor := LEADRasterView1.Raster.BitmapTransparentColor;
// Avoid repaints while we modify the bitmaps.
LEADRasterView1.AutoRepaint := False;
// Change the hue of each bitmap in the list,
// and restore the transparent color as the last color in the palette.
uCount := LEADRasterView1.Raster.BitmapListCount;
for i := 0 to uCount - 1 do
begin
LEADRasterView1.Raster.BitmapListIndex:= i;
RasterProc.Hue (LEADRasterView1.Raster, i * 10);
LEADRasterView1.Raster.BitmapPalette [255]:= TransparentColor;
end;
// Get an optimized palette for the whole list.
RasterProc.ColorResList (LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_NODITHERING, 0);
// Update the palette that is used for playback.
for i := 0 to 255 do
LEADRasterView1.AnimationPalette [i] := LEADRasterView1.Raster.BitmapPalette[i];
// Start the animation.
LEADRasterView1.AutoRepaint:= True;
LEADRasterView1.AnimationEnable := True;
end;


Combine example for Delphi

This example copies the LEADRasterView1 bitmap to LEADRasterView2, trims and filters the copied image, and combines the filtered image with the original LEADRasterView1 bitmap image. Trimming LEADRasterView2 lets you see the difference between filtered and nonfiltered regions.

var
sRet: Smallint;
SrcLeft: Single;
SrcTop : Single;
DstLeft: Single;
DstTop: Single;
DstWidth: Single;
DstHeight: Single;
fTrimLeft: Single;
fTrimTop:Single;
fTrimWidth:Single;
fTrimHeight:Single;

RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

Cursor:= crHourglass;
LEADRasterView2.Raster.RefBitmap := False;
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Raster.Bitmap;
fTrimLeft:= (LEADRasterView2.Raster.BitmapWidth * 0.2);
fTrimTop := (LEADRasterView2.Raster.BitmapHeight * 0.2);
fTrimWidth := (LEADRasterView2.Raster.BitmapWidth * 0.6);
fTrimHeight := (LEADRasterView2.Raster.BitmapHeight * 0.6);
RasterProc.Trim (LEADRasterView2.Raster, fTrimLeft, fTrimTop, fTrimWidth, fTrimHeight);
RasterProc.SpatialFilter (LEADRasterView2.Raster, FLT_LINESEG_LTOR);
DstLeft := fTrimLeft;
DstTop := fTrimTop;
DstWidth := fTrimWidth;
DstHeight := fTrimHeight;
SrcLeft:= 0;
SrcTop := 0;
RasterProc.Combine (LEADRasterView1.Raster, DstLeft, DstTop,
DstWidth, DstHeight,
LEADRasterView2.Raster,
SrcLeft, SrcTop, CB_OP_ADD);
LEADRasterView1.ForceRepaint (sRet);
Cursor:= crDefault;
end;


Comment example for Delphi

This example does the following:

1. | Loads an image from a TIFF file.
2. | Updates the current comment array by reading comments from the file.
3. | Modifies one of the comments.
4. | Modifies and saves the file.
5. | Reads the comment that was saved, and displays it in a message box.

This example handles only string comments. For more complex comments, refer to Exif Examples.

var
MyCommentText: String; //String for CMNT_SZDESC
FilePath: String; //File to be updated
i: Longint; //Loop counter and array index
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;
RasterVarEmpty: LEADRasterVariant;
RasterVar: LEADRasterVariant;

begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterVarEmpty:= coLEADRasterVariant.Create ( );
RasterVar:= coLEADRasterVariant.Create ( );

//Specify the file that we will update.
FilePath := 'c:\temp\Test.tif';
//Get all of the current comments from the file.
//Temporarily disable method errors so that we do not fail when comments are missing.
RasterIO.EnableMethodErrors := False;
for i := 0 to CMNT_LAST do
begin
RasterIO.Comment[i]:= RasterVarEmpty;
RasterIO.Comment[i]:= RasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, i);
end;
//Load and modify the image.
RasterIO.EnableMethodErrors := False;
RasterIO.Load (LEADRasterView1.Raster, FilePath, 0, 0, 1);
RasterProc.Reverse (LEADRasterView1.Raster);
//Update the CMNT_SZDESC comment.
MyCommentText := Chr(13) + 'This image has been reversed.';
RasterVar.Type_:= VALUE_STRING;
RasterVar:= RasterIO.Comment[CMNT_SZDESC];
RasterVar.StringValue:= RasterVar.StringValue + MyCommentText;

RasterIO.Comment[CMNT_SZDESC]:= RasterVar;
//Save the file and read the comment that we saved.
RasterIO.Save (LEADRasterView1.Raster, FilePath, FILE_TIF, LEADRasterView1.Raster.BitmapBits, 0, SAVE_OVERWRITE);
RasterVar:= RasterIO.ReadComment (LEADRasterView1.Raster, FilePath, 1, CMNT_SZDESC);
//Display the message
ShowMessage (RasterVar.StringValue);
//Clear the comments from memory
for i := 0 to CMNT_LAST do
RasterIO.Comment [i]:= RasterVarEmpty;
end;


ContourFilter example for Delphi

var
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.ContourFilter (LEADRasterView1.Raster,
20, 35, 5, CONTOUR_APPROX_COLOR);
end;


Contrast example for Delphi

This example increases the contrast and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;

begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Contrast (LEADRasterView1.Raster, 50);
LEADRasterView1.ForceRepaint (sRet);
end;


Create Bitmap, Size, and Combine example for Delphi

This example creates a bitmap for Raster2 (same size and BPS as LEADRasterView1.Raster) and fills it with green. It resizes the LEADRasterView1.Raster bitmap, and then uses a loop to do multiple combines with the Raster2 bitmap. It then copies the Raster2 bitmap to LEADRasterView1 and redisplays LEADRasterView1.

var
sRet: Smallint;
DstT: Single;
DstL: Single;
SrcL: Single;
SrcT: Single;
DstW: Single;
DstH: Single;
MyWidth:Single;
MyHeight: Single;
MyBPS: Integer;
ImageWidth: Integer;
ImageHeight: Integer;
TestWidth: Integer;
TestHeight: Integer;
VFactor: Integer;
VSpacing: Integer;
HFactor: Integer;
HSpacing: Integer;
Raster2: LEADRaster;
MyOP: CombineConstants;
RasterProc: LEADRasterProcess;

begin

Cursor:= crHourglass;
Raster2:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
// Create the Raster2 bitmap.
MyWidth := LEADRasterView1.Raster.BitmapWidth;
MyHeight := LEADRasterView1.Raster.BitmapHeight;
MyBPS := LEADRasterView1.Raster.BitmapBits;
Raster2.CreateBitmap (MyWidth, MyHeight, MyBPS);
RasterProc.Fill (Raster2, RGB(0, 255, 0)); // fill with green
// Resize the LEADRasterView1 bitmap
ImageWidth := Trunc(MyWidth * 0.3);
ImageHeight := Trunc(MyHeight * 0.3);
RasterProc.Size (LEADRasterView1.Raster, ImageWidth, ImageHeight, RESIZE_RESAMPLE);
// Initialize the variables used for multiple combines.
TestWidth := Trunc(MyWidth); // Used for horizontal positioning
TestHeight := Trunc(MyHeight); // Used for vertical positioning
VFactor := Trunc(MyHeight / ImageHeight) + 1; // Number spaces between images
VSpacing := Trunc((Trunc(MyHeight) Mod ImageHeight) / VFactor); // Pixels between images
HFactor := Trunc(MyWidth / ImageWidth) + 1; // Number spaces between images
HSpacing := Trunc((Trunc(MyWidth) Mod ImageWidth) / HFactor); // Pixels between images
SrcL := 0; // Left coordinate of the source rectangle
SrcT := 0; // Top coordinate of the source rectangle
DstW := ImageWidth; // Width of the destination rectangle
DstH := ImageHeight; // Height of the destination rectangle
MyOP := CB_OP_ADD + CB_DST_0; // Operation flags used when combining images
// Do the loop that does the multiple combines
while (TestHeight > ImageHeight) do // Vertical loop
begin
DstT := MyHeight - TestHeight + VSpacing;
TestHeight := TestHeight - ImageHeight - VSpacing;
while (TestWidth > ImageWidth) do //Horizontal loop
begin
DstL := MyWidth - TestWidth + HSpacing;
TestWidth := TestWidth - ImageWidth - HSpacing;
RasterProc.Combine (Raster2, DstL, DstT, DstW, DstH, LEADRasterView1.Raster, SrcL, SrcT, MyOP);
end;
TestWidth := Trunc(MyWidth);
end;
// Copy the Raster2 bitmap to LEADRasterView1
LEADRasterView1.Raster.Bitmap := Raster2.Bitmap ;
//Set the image display size to match the LEADRasterView control
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView1.ForceRepaint (sRet); // Repaint the image
Cursor:= crDefault;
end;


Create example for Delphi

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

//This example creates an annotation toolbar and adds a button to the toolbar.
//The button displays different images when selected/deselected
//The button has two tools associated with (line and button tool)
procedure TForm1.CreateToolBarClick(Sender: TObject);
var
RasterIO: LEADRasterIO;

begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterAnnToolbar.AnnParentRasterView:= LEADRasterView1.Raster;
RasterAnnToolbar.Visible:= True;

RasterAnnToolbar.Create (0, 0, ANN_TOOLALIGN_TOP);
if (RasterAnnToolbar.ToolBarhWnd <>0) then
begin
RasterAnnToolbar.ButtonTool [RasterAnnToolbar.ButtonCount]:= ANN_TOOL_USER_FIRST;
RasterIO.Load (LEADRasterView2.Raster, 'e:\lead14\dist\images\Ulay1.bmp', 0, 0, 1);
RasterAnnToolbar.ButtonBitmapUp [RasterAnnToolbar.ButtonCount] := LEADRasterView2.Raster.Bitmap;
RasterIO.Load (LEADRasterView2.Raster, 'e:\lead14\dist\images\Ulay2.bmp', 0, 0, 1);
RasterAnnToolbar.ButtonBitmapDown [RasterAnnToolbar.ButtonCount] := LEADRasterView2.Raster.Bitmap;
RasterAnnToolbar.ButtonToolTipTextID [RasterAnnToolbar.ButtonCount] := -1;
RasterAnnToolbar.ButtonToolTipText [RasterAnnToolbar.ButtonCount] := 'User defined tool';
ShowMessage ('AnnToolTipText: ' + RasterAnnToolbar.ButtonToolTipText[RasterAnnToolbar.ButtonCount]);

RasterAnnToolbar.ButtonToolCount [RasterAnnToolbar.ButtonCount] := 2;

RasterAnnToolbar.ButtonMenuTool [RasterAnnToolbar.ButtonCount, 0] := ANN_TOOL_LINE;
RasterAnnToolbar.ButtonMenuTextID [RasterAnnToolbar.ButtonCount, 0] := -1;
RasterAnnToolbar.ButtonMenuText[RasterAnnToolbar.ButtonCount, 0] := 'User defined tool';

RasterAnnToolbar.ButtonMenuTool[RasterAnnToolbar.ButtonCount, 1] := ANN_TOOL_BUTTON;
RasterAnnToolbar.ButtonMenuTextID[RasterAnnToolbar.ButtonCount, 1] := -1;
RasterAnnToolbar.ButtonMenuText [RasterAnnToolbar.ButtonCount, 1] := 'Button';

RasterAnnToolbar.ButtonCount := RasterAnnToolbar.ButtonCount + 1;
RasterAnn.AnnUserMode := ANN_USERMODE_DESIGN;

RasterAnn.AutoSetTool := True;
end;
end;


DBC Example for Visual Basic

ODBC Example for Delphi

Take the following steps to create and use a simple ODBC database, containing only images. (For a more sophisticated approach, refer to Using ODBC to Access Image Data.)

Note:

The LEADTOOLS COM requires ODBC drivers that can properly handle long binary fields. Examples have been tested and will work with version 3.0 of the Microsoft ODBC Desktop Driver Pack. (This driver pack ships with Access 95 and works on 32-bit systems.) You can download drivers from the LEAD BBS, the CompuServe forum, or the Worldwide Web home page. The CompuServe forum is at GO LEADTECH. The web page is ftp://ftp.leadtools.com/pub/utils/ODBC32.zip. The file to download is ODBC32.ZIP.

1. | Make a copy of the project that you created in Loading and Displaying an Image; then load the copied project.
2. | In the Add-Ins menu, select the Data Manager...
3. | In the Data Manager Window's File menu, select New, and create an Access database named c:\lead\lead.mdb.
4. | Click the New button, and create a table with one field as follows:
 | Name: | ltvbpic
 | Field Name: | photo
 | Data Type: | long binary
5. | Add the following LEAD Raster objects to your project,
 | a. LEADRasterODBC Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster ODBC Object Library (14).
 | b. LEADRasterProcess Object Library.
 |  | For VB4: On the Tools pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14).
 |  | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterProcess Object Library (14).
6. | Add the following statment to your public section:

Public RasterODBC As New LEADRasterODBC

7. | Exit the Data Manager.
8. | Open the ODBC administrator and click the Add button.
9. | Select Microsoft Access driver and click the OK button.
10. | Enter the name LEADACCESS.
11. | Click the Select directory button and select the LEAD directory.
12. | Click the OK button; click the next OK button; then click the Close button.
13. | In Delphi, replace the code in the main form's init procedure as follows:

'Position and size the main form so that it takes up most of the screen.
Width = Screen.Width * 0.9
Height = Screen.Height * 0.8
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
' Set the position and size of the LEAD control.
' Allow for a border of 1/8 of the form size.
' The units of measure do not matter, since we are calculating proportions.
HeightAllowed = ScaleHeight * 3 / 4
WidthAllowed = ScaleWidth * 3 / 4
LEADRasterView1.Left = (ScaleWidth - WidthAllowed) / 2
LEADRasterView1.Top = (ScaleHeight - HeightAllowed) / 2
LEADRasterView1.Width = WidthAllowed
LEADRasterView1.Height = HeightAllowed
'Turn off automatic repainting and turn on scroll bars.
LEADRasterView1.AutoRepaint = False
LEADRasterView1.AutoScroll = True
'Set the image display size to match the LEADRasterView control
LEADRasterView1.SetDstRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight
' Open the database.
RasterODBC.Raster = LEADRasterView1.Raster
DString = "ODBC;DSN=LEADACCESS"
RasterODBC.dbOpen DString, "ltvbpic", "photo", DB_OPENOPTIONS_NONE
RasterODBC.dbLoadBits = 24
RasterODBC.dbLockingMode = DB_LOCKINGMODE_OPTIMISTIC
LEADRasterView1.ForceRepaint
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
End If

14. | Add a common dialog control to your main form and name it Commdlg.
15. | At the top of your main form, add seven command buttons and name them as follows: Add, Update, Delete, FirstRec, NextRec, PrevRec, and LastRec.
16. | For the Add button, add the following code to the click procedure:

Dim RasterIO As New LEADRasterIO
If RasterODBC.dbCanAppend = False Then
msg = "You cannot add to this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbAddNew
CommDlg.Filter = "All Files|*.*"
CommDlg.Flags = cdlOFNFileMustExist
CommDlg.DialogTitle = "Open File"
CommDlg.CancelError = True
CommDlg.ShowOpen
filename = CommDlg.filename
RasterIO.Load LEADRasterView1.Raster, filename, 0, 0, 1
RasterODBC.Raster = LEADRasterView1.Raster
nret = RasterODBC.dbUpdate(FILE_CMP, 0, QFACTOR_QMS)
If nret <> 0 Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbMoveLast
LEADRasterView1.ForceRepaint
msg = "Image added to the database."
answer = MsgBox(msg, 0, "LEAD")
NextRec.Enabled = True
PrevRec.Enabled = True
If RasterODBC.dbIsBOF = True Then
PrevRec.Enabled = False
Else
PrevRec.Enabled = True
End If
If RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
Else
NextRec.Enabled = True
End If
End If
End If

17.

For the Update button, add the following code to the click procedure:

Dim RasterProc As New LEADRasterProcess
If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
If RasterODBC.dbEditMode = DB_EDITMODE_NONE Then
RasterODBC.dbEdit
RasterProc.Flip LEADRasterView1.Raster
LEADRasterView1.ForceRepaint
End If
RasterODBC.dbUpdate FILE_CMP, 0, QFACTOR_QMS
End If

18.

For the Delete button, add the following code to the click procedure:

If RasterODBC.dbCanUpdate = False Then
msg = "You cannot update this database."
answer = MsgBox(msg, 0, "Error")
ElseIf RasterODBC.dbIsBOF = True Or RasterODBC.dbIsEOF = True Then
msg = "There is no current record."
answer = MsgBox(msg, 0, "Error")
Else
RasterODBC.dbDelete
RasterODBC.dbRequery
RasterODBC.dbMoveFirst
If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
PrevRec.Enabled = False
End If
LEADRasterView1.ForceRepaint
End If

19.

For the First button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveFirst
PrevRec.Enabled = False
NextRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

20.

For the Next button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMoveNext
If RasterODBC.dbIsEOF = True Then
NextRec.Enabled = False
RasterODBC.dbMovePrev
msg = "Already at last record."
answer = MsgBox(msg, 0, "Notice")
Else
PrevRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

21.

For the Prev button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
PrevRec.Enabled = False
NextRec.Enabled = False
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
Else
RasterODBC.dbMovePrev
If RasterODBC.dbIsBOF = True Then
PrevRec.Enabled = False
RasterODBC.dbMoveNext
msg = "Already at first record."
answer = MsgBox(msg, 0, "Notice")
Else
NextRec.Enabled = True
End If
LEADRasterView1.ForceRepaint
End If

22.

For the Last button, add the following code to the click procedure:

If RasterODBC.dbIsBOF = True And RasterODBC.dbIsEOF = True Then
msg = "The database is empty."
answer = MsgBox(msg, 0, "Notice")
NextRec.Enabled = False
PrevRec.Enabled = False
Else
RasterODBC.dbMoveLast
NextRec.Enabled = False
PrevRec.Enabled = True
LEADRasterView1.ForceRepaint
End If

23.

Update the main form's unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
RasterODBC.dbClose
End Sub

25.

Run your program to test it.


dbCan... example for Delphi

This example displays property values in a message box. You can implement this example by adding a button, with this code, to the project described in ODBC Example for Delphi.

procedure TForm1.Button1Click(Sender: TObject);
var
TempStr, InfoStr: String;
RastODBC: LEADRasterODBC;

begin

RastODBC:= CoLEADRasterODBC.Create ();

if(RastODBC.dbCanAppend) then
InfoStr:= 'dbCanAppend= True' + Chr(13)
else
InfoStr:= 'dbCanAppend= False'+ Chr(13);

if (RastODBC.dbCanRestart) then
TempStr:= 'dbCanRestart= True'+ Chr(13)
else
TempStr:= 'dbCanRestart= False'+ Chr(13);

InfoStr:= InfoStr + TempStr;

if (RastODBC.dbCanScroll) then
TempStr:= 'dbCanScroll= True'+ Chr(13)
else
TempStr:= 'dbCanScroll= False'+ Chr(13);

InfoStr:= InfoStr + TempStr;
if (RastODBC.dbCanUpdate) then
TempStr:= 'dbCanUpdate= True'+ Chr(13)
else
TempStr:= 'dbCanUpdate= False'+ Chr(13);

InfoStr:= InfoStr + TempStr;
TempStr:= 'dbEditMode= '+ IntToStr(RastODBC.dbEditMode) + Chr(13);
InfoStr:= InfoStr + TempStr;
if (RastODBC.dbIsBOF) then
TempStr:= 'dbIsBOF= True'+ Chr(13)
else
TempStr:= 'dbIsBOF= False'+ Chr(13);

InfoStr:= InfoStr + TempStr;

if (RastODBC.dbIsEOF) then
TempStr:= 'dbIsEOF= True'+ Chr(13)
else
TempStr:= 'dbIsEOF= False'+ Chr(13);
InfoStr:= InfoStr + TempStr;
if (RastODBC.dbIsDeleted) then
TempStr:= 'dbIsDeleted = True'+ Chr(13)
else
TempStr:= 'dbIsDeleted = False'+ Chr(13);

InfoStr:= InfoStr + TempStr;

if (RastODBC.dbIsOpen) then
TempStr:= 'dbIsOpen = True'+ Chr(13)
else
TempStr:= 'dbIsOpen = False'+ Chr(13);
InfoStr:= InfoStr + TempStr;

TempStr:= 'dbLoadBits= '+ IntToStr(RastODBC.dbLoadBits ) + Chr(13);
InfoStr:= InfoStr + TempStr;
TempStr:= 'dbLockingMode= '+ IntToStr(RastODBC.dbLockingMode) + Chr(13);
InfoStr:= InfoStr + TempStr;
TempStr:= 'dbRecordCount= '+ IntToStr(RastODBC.dbRecordCount) + Chr(13);
InfoStr:= InfoStr + TempStr;
TempStr:= 'dbCurrentRecord= (0 based)'+ IntToStr(RastODBC.dbCurrentRecord)+Chr(13);
InfoStr:= InfoStr + TempStr;
ShowMessage(InfoStr);
end;


DblClick example for Delphi

This example demonstrates the DblClick event.

Procedure TForm1.LEADRasterView1DblClick (Sender: TObject);
var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;

RasterProc.Flip (LEADRasterView1.Raster); //Just test the event
LEADRasterView1.ForceRepaint (sRet);
end;


DDB example for Delphi

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DDB. It pastes the DDB into LEADRasterView2.Raster and reverses the image. It then gets a DDB from LEADRasterView2, sets the same DDB to LEADRasterView, and repaints.

var
MyDC: HDC;
sRet: Smallint;
nRet: Integer;
MyDDB: Longint;
MyPalette: Longint;
MyFlags: RasterCopyConstants;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

Cursor:= crHourglass;
MyFlags:= COPY_EMPTY + COPY_DDB + COPY_PALETTE;
LEADRasterView1.Raster.Copy (MyFlags);
if (LEADRasterView2.Raster.Paste (PASTE_ISREADY) = 0) then
ShowMessage ('Invalid data on the clipboard')
else
LEADRasterView2.Raster.Paste (0);

RasterProc.Reverse (LEADRasterView2.Raster);
MyDC:= LEADRasterView2.GetClientDC (nRet);
MyDDB:= LEADRasterView2.Raster.GetDDB (MyDC);
MyPalette:= LEADRasterView2.GetPalette (MyDC, nRet);
LEADRasterView1.Raster.SetDDB (MyDC, MyDDB, MyPalette);
LEADRasterView1.ForceRepaint (sRet);
LEADRasterView2.ReleaseClientDC (sRet);
Cursor:= crDefault;
end;


DeleteBitmapListItems example for Delphi

This example deletes the first five bitmaps from the control's bitmap list. Then, it plays the animation to show that the bitmaps are missing.

//Delete the first five bitmaps.
LEADRasterView1.Raster.DeleteBitmapListItems (1, 5);
//Play the animation without looping.
LEADRasterView1.AnimationLoop:= False;
LEADRasterView1.AnimationEnable:= True;


DeletePage example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
//delete page 1 from TEST.TIF
RasterIO.DeletePage ('c:\temp\test.tif', 1);
end;


Deskew example for Delphi

This example automatically straightens the bitmap and repaints the image. The image to be straightened should be mainly text.

var
lAngle: Longint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Deskew (LEADRasterView1.Raster, RGB(255, 0, 0), 0);
lAngle:= RasterProc.DeskewAngle;
ShowMessage ('Rotation: ' + IntToStr(lAngle) + ' hundredths of degrees');
end;


Despeckle example for Delphi

This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Despeckle (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;


DIB example for Delphi

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

var
sRet: Smallint;
MyDib: Longint;
MyFlags:RasterCopyConstants;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

Cursor:= crHourglass;
MyFlags:= COPY_EMPTY + COPY_DIB + COPY_PALETTE;
LEADRasterView1.Raster.Copy (MyFlags);
if (LEADRasterView2.Raster.Paste (PASTE_ISREADY) = 0) then
ShowMessage ('Invalid data on the clipboard')
else
LEADRasterView2.Raster.Paste (0);

RasterProc.Reverse (LEADRasterView2.Raster);
MyDib:= LEADRasterView2.Raster.GetDIB;
LEADRasterView1.Raster.SetDIB (MyDib);
LEADRasterView1.ForceRepaint (sRet);
Cursor:= crDefault;
end;


DocCleanSuccess example for Delphi

var
RasterProc: LEADRasterProcess;

//Create the RasterProcess object and UnlockSupport
procedure TForm1.Button1Click(Sender: TObject);
begin
//.....
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, ‘TestKey’);
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
//.....

end;

//This example updates a region with all 1x1 to 3x3 specks that are solid black
//If a speck has any white pixels, it is NOT part of the updated region
//The call is configured to update a single LEAD region with all changes
//The image itself is unchanged
//The DotRemove Event is used to display information about each speck that is removed

procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
begin

RasterProc.EnableDocCleanEvents:= True;
nRet:= RasterProc.DotRemove (LEADRasterView1.Raster, DOT_USE_SIZE Or DOT_SINGLE_REGION Or DOT_LEAD_REGION Or DOT_IMAGE_UNCHANGED, 1, 1, 3, 3);
if (nRet = 0) then
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR;
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
fBoundingRectLeft: Single;
fBoundingRectTop: Single;
fBoundingRectWidth: Single;
fBoundingRectHeight: Single;
iWhiteCount: Longint;
iBlackCount: Longint;
nRet : LongInt;
sOutput : String;
szTemp : array[0..255] of Char;

begin
case (DispID) of
LEADRASTERPROCESSEVENTS_DOTREMOVE:
begin
fBoundingRectLeft:= OleVariant(Params.rgvarg^[5]);
fBoundingRectTop:= OleVariant(Params.rgvarg^[4]);
fBoundingRectWidth:= OleVariant(Params.rgvarg^[3]);
fBoundingRectHeight:= OleVariant(Params.rgvarg^[2]);
iWhiteCount:= OleVariant(Params.rgvarg^[1]);
iBlackCount:= OleVariant(Params.rgvarg^[0]);
sOutput := Format('Dot Found at [Left,Top,Width,Height] %f,%f,%f,%f WhiteCount= %d BlackCount= %d',
[fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iWhiteCount,
iBlackCount]);

OutputDebugString(StrPCopy(szTemp,sOutput));
//Do not remove the speck if it contains any white pixels
if (iWhiteCount > 0) Then
nRet:= SUCCESS_NOREMOVE
else
nRet:= SUCCESS_REMOVE;
RasterProc.DocCleanSuccess:= nRet;
end;
end;
end;


DrawShape example for Delphi

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

var
RasterIO: LEADRasterIO;
RasterFxd: LEADRasterFXD;
RasterProc: LEADRasterProcess;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterFxd:= CreateComObject (CLASS_LEADRasterFXD) as LEADRasterFXD;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

LEADRasterView1.AutoRepaint := False;
//Load an image for the main control
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1);
//Load an image for the background of the shape
RasterIO.Load (LEADRasterView2.Raster, 'c:\temp\ulay1.bmp', 0, 0, 1);
//Shape background
RasterFxd.ShapeBackgroundStyle := FXD_BACKSTYLE_TILED_IMAGE;
RasterFxd.BackgroundImageTop := 0;
RasterFxd.BackgroundImageLeft := 0;
RasterFxd.BackgroundImageWidth := LEADRasterView2.Raster.BitmapWidth;
RasterFxd.BackgroundImageHeight := LEADRasterView2.Raster.BitmapHeight;
//Shape location
RasterFxd.ShapeTop := 50;
RasterFxd.ShapeLeft := 50;
RasterFxd.ShapeWidth := LEADRasterView1.DstWidth - 50;
RasterFxd.ShapeHeight := LEADRasterView1.DstHeight - 50;
//Shape border
RasterFxd.ShapeBorderColor := RGB(255, 0, 0);
RasterFxd.ShapeBorderStyle := FXD_BORDERSTYLE_SOLID;
RasterFxd.ShapeBorderThickness := 10;
RasterFxd.ShapeInnerBandHiliteColor := RGB(255, 255, 255);
RasterFxd.ShapeInnerBandShadowColor := 0;
RasterFxd.ShapeInnerBandStyle := FXD_INNERSTYLE_RAISED;
RasterFxd.ShapeInnerBandThickness := 2;
RasterFxd.ShapeOuterBandHiliteColor := RGB(0, 255, 0);
RasterFxd.ShapeOuterBandShadowColor := RGB(128, 128, 128);
RasterFxd.ShapeOuterBandStyle := FXD_OUTERSTYLE_RAISED;
RasterFxd.ShapeOuterBandThickness:= 2;
//Make the shape a permanent part of the bitmap
RasterFxd.DrawPersistence := True;
RasterFxd.DstLeft := 0;
RasterFxd.DstTop := 0;
RasterFxd.DstRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.DstBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.SrcLeft := 0;
RasterFxd.SrcTop := 0;
RasterFxd.SrcRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.SrcBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.ScaleMode:= 3;
RasterFxd.ClientSizeX := 5;
RasterFxd.ClientSizeY := 5;
//Draw the shape
RasterFxd.DrawShape (LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, LEADRasterView2.Raster.Bitmap);
//Repaint
LEADRasterView1.AutoRepaint := True;
end;


DrawText example for Delphi

This example demonstrates most of the properties of a three-dimensional text object as it draws rotated text on the current bitmap.

var
sRet: Smallint;
RasterIO: LEADRasterIO;
RasterFxd: LEADRasterFXD;
RasterProc: LEADRasterProcess;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterFxd:= CreateComObject (CLASS_LEADRasterFXD) as LEADRasterFXD;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

LEADRasterView1.AutoRepaint := False;
LEADRasterView1.ScaleMode := 3;
//Load an image for the main control
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_NORMAL;
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\golf.jpg', 0, 0, 1);
//Load an image for the foreground of the text
RasterIO.Load (LEADRasterView2.Raster, 'c:\temp\ulay1.bmp', 0, 0, 1);
//Text location
RasterFxd.TextTop := 50;
RasterFxd.TextLeft := 50;
RasterFxd.TextWidth := LEADRasterView1.DstWidth - 50;
RasterFxd.TextHeight := LEADRasterView1.DstHeight - 50;
//The foreground image needs to be the correct size.
RasterProc.Size (LEADRasterView2.Raster, RasterFxd.TextWidth, RasterFxd.TextHeight, 0);
//Text alignment and angle
RasterFxd.TextAlign := FXD_TEXTALIGN_HCENTER_VCENTER;
RasterFxd.TextAngle := 450; //45 degrees
//Text highlight color and style
RasterFxd.TextHiliteColor := RGB(255, 255, 255);
RasterFxd.TextHiliteColor:= FXD_TEXTSTYLE_DROPSHADOW;
//Text drop shadow
RasterFxd.ShadowColor := RGB(0, 0, 0);
RasterFxd.ShadowXDepth := 5;
RasterFxd.ShadowYDepth := 5;
//Make the text a permanent part of the bitmap
RasterFxd.DrawPersistence := True;
RasterFxd.DstLeft := 0;
RasterFxd.DstTop := 0;
RasterFxd.DstRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.DstBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.SrcLeft := 0;
RasterFxd.SrcTop := 0;
RasterFxd.SrcRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.SrcBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.ScaleMode:= 3;
//Draw the text
RasterFxd.DrawText (LEADRasterView1.Raster, 0, 'LEADTOOLS', LEADRasterView1.Raster.Bitmap);
LEADRasterView1.ForceRepaint (sRet);
end;


Dst... example for Delphi

var
// Declare local variables
ClHeight, ClWidth: single;
sRet: smallint;
begin
// Set variables for the client area of the control.
ClHeight := LEADRasterView1.ScaleHeight;
ClWidth := LEADRasterView1.ScaleWidth;
//Calculate the values to zoom in by 10 percent and center the image.
LEADRasterView1.PaintSizeUseDPI := False;
LEADRasterView1.DstWidth := LEADRasterView1.DstWidth * 1.1;
LEADRasterView1.DstHeight := LEADRasterView1.DstHeight * 1.1;
LEADRasterView1.DstTop := (ClHeight - LEADRasterView1.DstHeight) / 2;
LEADRasterView1.DstLeft:= (ClWidth - LEADRasterView1.DstWidth) / 2;
//Set the clipping area to the same as the destination rectangle
LEADRasterView1.DstClipWidth := LEADRasterView1.DstWidth;
LEADRasterView1.DstClipHeight := LEADRasterView1.DstHeight;
LEADRasterView1.DstClipTop := LEADRasterView1.DstTop;
LEADRasterView1.DstClipLeft := LEADRasterView1.DstLeft;
//Redisplay the image
LEADRasterView1.ForceRepaint (sRet);
end;


Emboss example for Delphi

This example applies an emboss effect and repaints the image.

var
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Emboss ( LEADRasterView1.Raster, EMBOSS_NE, 500 ) ;
LEADRasterView1.ForceRepaint ( sRet ) ;
end;


EnableMethodErrors example for Delphi

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle using ILEADRasterProcess in this case).

var
//Declare local variables.
ShearAngle, nRet: Integer;
cMsg: String;
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
ShearAngle:= 9000 ;// This would be the user's input * 100
RasterProc.EnableMethodErrors := False;
nRet:= RasterProc.Shear (LEADRasterView1.Raster, ShearAngle, True, RGB(0, 0, 255));
if (nRet = 20013) then
begin
cMsg:= 'The angle cannot be more than 45 degrees';
MessageBox ( Handle, PChar(cMsg), 'Error', MB_OK );
end
else
begin
if (nRet = 0) then
LEADRasterView1.ForceRepaint ( sRet )
else
ShowMessage ( 'Error: ' + IntToStr (nRet)) ;
end;
end;


EnablePaint example for Delphi

var
RasterProc: LEADRasterProcess;
sRet: smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
//disable the paint
LEADRasterView1.EnablePaint := False;
//do whatever changes you want. The control will not repaint
RasterProc.Size ( LEADRasterView1.Raster, LEADRasterView1.Raster.BitmapWidth * 2,
LEADRasterView1.Raster.BitmapHeight * 2, RESIZE_BICUBIC ) ;
// re-enable the paint
LEADRasterView1.EnablePaint := True;
// call ForceRepaint because the control will not automatically repaint
LEADRasterView1.ForceRepaint ( sRet ) ;
end;


EnableZoomInRect example for Delphi

This example toggles the EnableZoomInRect property.

//Toggle the ZoomInRect setting
LEADRasterView1.EnableZoomInRect:= Not LEADRasterView1.EnableZoomInRect;


Exif example for Delphi

This example does the following:

1. | Read all of the comments in an existing Exif file, updating the CommentCommentProperty array.
2. | Loads and modifies the file's image.
3. | Updates some of the comments in the comment array.
4. | Saves the file.
5. | Reads and displays the updated comments.

Note: Comments for GIF, TIFF, and DICOM files are simpler than the ones in this Exif example. With those file types, all of the comments are strings that you can get and set with simple assignments.

procedure TForm1.Button1Click(Sender: TObject);
var
MyCommentText: string; { String for CMNT_USERCOMMENT }
MyCommentSize: Integer; { Size of the comment array }
NewCommentText: string; { String for CMNT_USERCOMMENT that}
MyRasterIO: LEADRasterIO;
MyRasterProcess: LEADRasterProcess;
TmpString: string; { For parsing the comment string into bytes }
FilePath, DistanceString, ThisDate, MyMsg: string; {Miscellaneous }
ArraySize: Integer; { Array measurements }
i: Integer; { Counter }
RasterVarEmpty: LEADRasterVariant;
RasterVar1: LEADRasterVariant;
RasterVar2: LEADRasterVariant;
RasterVar3: LEADRasterVariant;
begin
MyRasterIO:= CreateComObject (CLASS_LEADRasterIO ) as LEADRasterIO;
MyRasterProcess:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterVarEmpty:= coLEADRasterVariant.Create ( );
RasterVar1:= coLEADRasterVariant.Create ( );
RasterVar2:= coLEADRasterVariant.Create ( );
RasterVar3:= coLEADRasterVariant.Create ( );

//Specify the file that we will update.
FilePath:= 'c:\exif1.tif';
//Get all of the current comments from an Exif file.
//Temporarily disable method errors so that we do not fail when comments are missing.
MyRasterIO.EnableMethodErrors:= False;
For i:= 0 to CMNT_LAST do
begin
MyRasterIO.Comment [i]:= RasterVarEmpty;
MyRasterIO.Comment[i]:= MyRasterIO.ReadComment (LEADRasterView1.Raster, FilePath, 0, i)
end;
MyRasterIO.EnableMethodErrors:= True;
//Load and modify the image.
MyRasterIO.Load (LEADRasterView1.Raster, FilePath, 0, 0, 1);
MyRasterProcess.Reverse (LEADRasterView1.Raster);

{ Update the date when the file is generated. }
ThisDate:= FormatDateTime('yyyy:mm:dd hh:nn:ss', Now);
RasterVar1.Type_:= VALUE_STRING;
RasterVar1.StringValue:= ThisDate;

MyRasterIO.Comment[CMNT_SZDATETIMEDIGITIZED]:= RasterVar1;
MyRasterIO.Comment[CMNT_SZSUBSECTIMEDIGITIZED]:= RasterVarEmpty;
//Change the subject distance to 4 1/3 meters.
RasterVar2.Type_:= VALUE_ARRAY_LONG;
RasterVar2.ItemCount:= 2;
RasterVar2.LongItemValue[0]:= 13;
RasterVar2.LongItemValue[1]:= 3;
MyRasterIO.Comment [CMNT_SUBJECTDISTANCE]:= RasterVar2;
//Specify the user comment string.
MyCommentText:= 'This is my new comment.';
MyCommentSize:= 8 + StrLen(PChar(MyCommentText));

//Define the array for the user comment.
RasterVar3.Type_:= VALUE_ARRAY_BYTE;
RasterVar3.ItemCount:= MyCommentSize;

//Fill in the ASCII prefix.
RasterVar3.ShortItemValue[0]:= Byte('A');
RasterVar3.ShortItemValue[1]:= Byte('S');
RasterVar3.ShortItemValue[2]:= Byte('C');
RasterVar3.ShortItemValue[3]:= Byte('I');
RasterVar3.ShortItemValue[4]:= Byte('I');
RasterVar3.ShortItemValue[5]:= Byte(0);
RasterVar3.ShortItemValue[6]:= Byte(0);
RasterVar3.ShortItemValue[7]:= Byte(0);
//Fill in the rest of the comment, starting at the end.
for i:= 8 to (MyCommentSize - 1) do
begin
TmpString:= Copy(MyCommentText, i-7, 1);
RasterVar3.ShortItemValue[i]:= Byte (TmpString[1]);
end;
RasterVar3.ShortItemValue[MyCommentSize]:= Byte (0);

//Update the user comment.
MyRasterIO.Comment[CMNT_USERCOMMENT]:= RasterVarEmpty;
MyRasterIO.Comment [CMNT_USERCOMMENT]:= RasterVar3;
//Save the file and read the comments that we saved.
MyRasterIO.Save(LEADRasterView1.Raster, FilePath, FILE_EXIF, 24, 0, SAVE_OVERWRITE);
RasterVar1:= MyRasterIO.ReadComment (LEADRasterView1.Raster, FilePath, 1, CMNT_SZDATETIMEDIGITIZED);
RasterVar2:= MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_SUBJECTDISTANCE);
RasterVar3:= MyRasterIO.ReadComment(LEADRasterView1.Raster, FilePath, 1, CMNT_USERCOMMENT);

//Interpret the Subject-Distance RATIONAL.
DistanceString:= FloatToStr(RasterVar2.LongItemValue[0] / RasterVar2.LongItemValue[1]);

//Initialize the string for the message box.
MyMsg:= 'Subject Distance:= ' + DistanceString + Chr(13) + 'Date/Time:= ' + RasterVar1.StringValue;
//Add the ASCII comment if it is there
if (RasterVar3.ShortItemValue[0] = Byte ('A')) then
begin
ArraySize:= RasterVar3.ItemCount;
for i:= 8 to ArraySize do
begin
NewCommentText:= NewCommentText + Chr(Integer(RasterVar3.ShortItemValue[i]));
end;
MyMsg:= MyMsg + Chr(13) + Chr(13) + NewCommentText;
end;

//Display the message.
Application.MessageBox(PChar(MyMsg), 'File Comments', mb_OK);
//Clear the comments from memory
for i:= 0 to CMNT_LAST do
MyRasterIO.Comment [i]:= RasterVarEmpty;
end;


FastRotate example for Delphi

This example uses fast rotation to rotate an image 90 degres:

var
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) As LEADRasterProcess;
RasterProc.FastRotate ( LEADRasterView1.Raster, 90 ) ;
end;


FeedLoad example for Delphi

This example uses StartFeedLoad, FeedLoad, and StopFeedLoad and loads a file through a buffer to simulate receiving a transmitted image.

procedure TForm1.Button1Click(Sender: TObject);
Const BUFFERSIZE = 1000;
var
Buffer: Variant;
RasterVarBuffer: LEADRasterVariant;
MyBufferPtr: Pointer;
BytesRead: Longint;
FileHandle: integer;
RasterIO: LEADRasterIO;
i: Integer;
label quit_function;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterVarBuffer:= CoLEADRasterVariant.Create ( );
RasterVarBuffer.Type_:= VALUE_STRING;
Buffer:= VarArrayCreate([0, BUFFERSIZE-1], varByte);

{ Declare a buffer that you will use to feed the file-load process.}
MyBufferPtr := AllocMem(BUFFERSIZE);
{ Declare other local variables.}
{ Open an image file and get its length.}
FileHandle := FileOpen('v:\images\image1.cmp', fmOpenRead );
{ Set PaintWhileLoad so that we can watch the progress.}
LEADRasterView1.PaintWhileLoad := True;
{ Initialize the file-load process.}
{ Specify the default bits per pixel and first page}
if RasterIO.StartFeedLoad(LEADRasterView1.Raster,0, 0, 1) <> 0 Then
begin
MessageDlg ('Error in StartFeedLoad !', mtError, [mbOK], 0);
GoTo quit_function
end;
{ Use FeedLoad in a loop to load the file into the bitmap.}
repeat
BytesRead := FileRead(FileHandle, MyBufferPtr^, BUFFERSIZE ); { read from the file}
for i:= 0 to BytesRead-1 do
Buffer[i] := Byte((Pchar(MyBufferPtr)+i)^);
RasterVarBuffer.StringValue:= Buffer;
if RasterIO.FeedLoad(RasterVarBuffer, BytesRead) <> 0 Then
begin
MessageDlg ('Error in FeedLoad !', mtError, [mbOK], 0);
GoTo quit_function
end;
Until BytesRead <= 0;
{ Finish the file-load process.}
if RasterIO.StopFeedLoad() <> 0 Then
MessageDlg ('Error in StopFeedLoad !', mtError, [mbOK], 0);
quit_function:
{ Close the file.}
FreeMem(MyBufferPtr);
FileClose( FileHandle );
end;


FilePage Event Example for Delphi

This example shows how the FilePage event can be used to size and position a RasterView Control when an image is loaded.

//Use Load to load an image
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIo;
LEADEventSink1.Connect (RasterIO, _LEADRasterIOEvents);
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\24bit.bmp', 0, 1, 1);
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
HeightFactor, WidthFactor: Single; // Factors for aspect ratio
HeightAllowed, WidthAllowed: Single; // Maximum width and height

begin
case (DispID) of
LEADRASTERIOEVENTS_FILEPAGE:
begin
// Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor:= RasterIO.InfoHeight;
WidthFactor:= RasterIO.InfoWidth;
HeightAllowed:= ClientHeight * 3 / 4;
WidthAllowed:= ClientWidth * 3 / 4;
//Center the LEAD RasterView control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed) then
begin
LEADRasterView1.Left:= Trunc(ClientWidth / 8);
LEADRasterView1.Width:= Trunc(WidthAllowed);
LEADRasterView1.Height:= Trunc((LEADRasterView1.Width * HeightFactor) / WidthFactor);
LEADRasterView1.Top:= Trunc((ClientHeight - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top:= Trunc(ClientHeight / 8);
LEADRasterView1.Height:= Trunc(HeightAllowed);
LEADRasterView1.Width := Trunc((LEADRasterView1.Height * WidthFactor) / HeightFactor);
LEADRasterView1.Left := Trunc((ClientWidth - LEADRasterView1.Width) / 2);
end;
// Set the image display size to match the LEAD RasterView control.
LEADRasterView1.AutoScroll := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;
end;
end;
end;


Fill example for Delphi

This example fills the bitmap with blue and repaints the image.

var
RasterProc: LEADRasterProcess;
sRet: Smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Fill (LEADRasterView1.Raster, RGB(0, 0, 255));
LEADRasterView1.ForceRepaint (sRet);
end;


Flip example for Delphi

This example flips the bitmap and repaints the image.

var
RasterProc: LEADRasterProcess;
sRet: Smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Flip (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;


FloaterDstClip... example for Delphi

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

var
AdjustX, AdjustY,
NewLeft, NewTop,
NewWidth, NewHeight: Single;
sRet: Smallint;
begin
//Set variables to use for adjustment increments.
AdjustX := LEADRasterView1.ScaleWidth / 20;
AdjustY := LEADRasterView1.ScaleHeight / 20;
//Determine new values, based on adjustments of current values.
NewLeft := LEADRasterView1.FloaterDstClipLeft + AdjustX;
NewTop := LEADRasterView1.FloaterDstClipTop + AdjustY;
NewWidth := LEADRasterView1.FloaterDstClipWidth - (2 * NewLeft);
NewHeight := LEADRasterView1.FloaterDstClipHeight - (2 * NewTop);
//Set the clipping rectangle to the new values.
LEADRasterView1.SetFloaterDstClipRect (NewLeft, NewTop, NewWidth, NewHeight, sRet);
end;


Font example for Delphi

This example, in a MouseUp event, determines the size of a rectangle for a string in the specified font. It then draws the rectangle and draws the text on top of the rectangle.

var

TestText: String;
TextWidth: Single;
TextHeight: Single;
RasterFxd: LEADRasterFXD;
hDC: Longint;
nRet: Integer;
sRet: Smallint;
TempFont: TFont;

begin

RasterFxd:= CreateComObject ( CLASS_LEADRasterFxd) as LEADRasterFxd;
hDC := LEADRasterView1.GetClientDC(nRet);
//Specify the text, font, and styles
TestText := 'This is my text.';
TempFont:= TFont.Create ( ) ;
SetOleFont ( TempFont, RasterFxd.Font ) ;
TempFont.Name := 'Times New Roman';
TempFont.Size := 16;
RasterFxd.DrawFontColor := RGB(0, 0, 255); //Blue
RasterFxd.TextStyle := FXD_TEXTSTYLE_NORMAL;
RasterFxd.TextAlign := FXD_TEXTALIGN_HCENTER_VCENTER;
//Get the width and height of the text to be drawn.
TextWidth := RasterFxd.DrawTextWidth (hDC, TestText);
TextHeight := RasterFxd.DrawTextHeight (hDC, TestText);
//set the location for the text
RasterFxd.TextTop := y;
RasterFxd.TextLeft := x;
RasterFxd.TextWidth := TextWidth;
RasterFxd.TextHeight := TextHeight;
//Set the properties for drawing a rectangle behind the text.
RasterFxd.DrawPenStyle := DRAWPENSTYLE_SOLID;
RasterFxd.DrawMode := DRAWMODE_COPY_PEN;
RasterFxd.DrawFillColor := RGB(0, 255, 0); //Green
//Draw on the screen, not on the bitmap.
RasterFxd.DrawPersistence := False;
//Draw the rectangle, then draw the text.
RasterFxd.DrawRectangle (Nil, hDC, x, y, TextWidth, TextHeight);
RasterFxd.DrawText (Nil, hDC, TestText, 0);
TempFont.Free ( ) ;
LEADRasterView1.ReleaseClientDC(sRet);

end;


Frame... example for Delphi

This example sets the control's frame properties. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

LEADRasterView1.AutoRepaint := False;
LEADRasterView1.FrameThickness := 2;
LEADRasterView1.FrameColor := RGB(0, 0, 0);
LEADRasterView1.FrameInnerStyle := EFX_INNERSTYLE_INSET;
LEADRasterView1.FrameOuterStyle := EFX_OUTERSTYLE_INSET;
LEADRasterView1.FrameInnerHiliteColor := RGB(255, 255, 0); //Yellow
LEADRasterView1.FrameInnerShadowColor := RGB(128, 128, 128); //Dark Gray
LEADRasterView1.FrameOuterHiliteColor := RGB(255, 0, 0); //Red
LEADRasterView1.FrameOuterShadowColor := RGB(192, 192, 192); //Light Gray
LEADRasterView1.FrameInnerThickness := 3;
LEADRasterView1.FrameOuterThickness := 3;
LEADRasterView1.AutoRepaint := True;


GammaCorrect example for Delphi

This example applies a 2.2 gamma correction and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.GammaCorrect (LEADRasterView1.Raster, 220);
LEADRasterView1.ForceRepaint (sRet);
end;


GetBitmapDC example for Delphi

Take the following steps to demonstrate how GDI functions can be used to print text on the bitmap and on the control. The text printed on the bitmap is a permanent part of the bitmap and becomes permanent if the bitmap is saved, whereas the text on the control is superficial and does not affect the bitmap.

Note:

For an easier way of drawing text, refer to the DrawText example.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | GDI for Text
3. | Code the Button1 control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.
 | Notice that the code prints in two different places: the bitmap and the control. You can see the difference when you run the program.

procedure TForm1.Button1Click(Sender: TObject);
var
LeadDC: HDC;
LeadClientDC: HDC;
hfnt: longint;
hOldFont: Longint;
sRet: Smallint;
nRet: Integer;
mystring: String;

begin
//Ensure that the Lead control is visible
LEADRasterView1.Visible := True;
//First, print text on the bitmap.
//Create a device context for the bitmap that the GDI functions can access
LeadDC := LEADRasterView1.Raster.GetBitmapDC ();
//Get the system font and select it. The old font is saved.
//Using other fonts is more complex. Refer to the Windows API documentation.
hfnt := GetStockObject(SYSTEM_FONT);
hOldFont := SelectObject(LeadDC, hfnt);
//Make the background transparent, so that the text will overlay the image
SetBkMode(LeadDC, TRANSPARENT);
//Assign the string value
mystring := 'Text on the bitmap';
//Print the text on the bitmap. This is a permanent change in the bitmap
TextOut(LeadDC, 20, 40, PChar(mystring), StrLen(PChar(mystring)));
//Restore the previous font
SelectObject(LeadDC, hOldFont);
//Remove the lock from the device control
LEADRasterView1.Raster.ReleaseBitmapDC ();
//Repaint the part of the image that has changed
LEADRasterView1.BackErase := False;
LEADRasterView1.ForceRepaint (sRet);
//Allow full repainting again
LEADRasterView1.BackErase := True;
//Next, print text on the control.
//Create a device context for the control that the GDI functions can access
LeadClientDC := LEADRasterView1.GetClientDC (nRet);
//Get the system font and select it. The old font is saved.
//Using other fonts is more complex. Refer to the Windows API documentation.
hfnt := GetStockObject(SYSTEM_FONT);
hOldFont := SelectObject(LeadDC, hfnt);
//Make the background transparent, so that the text will overlay the image
SetBkMode(LeadClientDC, TRANSPARENT);
//Assign the string value
mystring := 'Text on the LEAD control';
//Print the text on the control.
//This is an overlay that does not affect the bitmap.
TextOut(LeadClientDC, 20, 80, PChar(mystring), StrLen(PChar(mystring)));
//Restore the previous font
SelectObject(LeadClientDC, hOldFont);
//Remove the lock from the device control
LEADRasterView1.ReleaseClientDC (sRet);

end;

4.

Run your program to test it. Notice that the text printed on the bitmap is scaled as part of the bitmap. If you zoom in, it becomes larger, and if you zoom out, it becomes smaller. The text printed on the control is the normal size for the system font and is not affected by zooming.


GetColorCount Example for Delphi

This example displays a message box showing the number of unique colors in the control's current bitmap.

var
RasterProc: LEADRasterProcess;
szMessage: String; //Buffer for the MessageBox string
NumberOfColors: Longint; //Number of colors in the bitmap
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
//Get the number of colors in the bitmap.
NumberOfColors:= RasterProc.GetColorCount (LEADRasterView1.Raster);
//Display the result in a message.
szMessage:= 'The bitmap has ' + IntToStr(NumberOfColors) + ' colors';
MessageBox (Handle, Pchar(szMessage), 'Notice', MB_OK ) ;
end;


GetDIB2 example for Delphi

//This example gets the image from LEADRasterView1 as a V5 DIB
//and then loads the DIB into LEADRasterView2
var
MyDIB: longint;
begin
//LEADRasterView1 has an image at this point
MyDIB:= LEADRasterView1.Raster.GetDIB2 (DIB_BITMAPV5HEADER);
LEADrasterView2.Raster.SetDIB (MyDIB);
//Free the DIB using the Windows API
GlobalFree (MyDIB);
end;


GetFileInfo example for Delphi

This example gets information about the specified file.

var
// Declare local variables
cMsg, cmp, cFmt, fname: String;
pg, fmt: Integer;
LeadWidth, LeadHeight:Single;
bps, xres, yres, sizd, sizm: Integer;
RasterIO: LEADRasterIO;
begin
// Initialize variables
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
fname := 'c:\temp\test.tif';
pg := 0;
xres:= RasterIO.InfoXRes;
yres:= RasterIO.InfoYRes;

// Update the variables
RasterIO.GetFileInfo (LEADRasterView1.Raster, fname, pg, FILEINFO_TOTALPAGES);
// Read the updated properties
fmt := RasterIO.InfoFormat;
LeadWidth := RasterIO.InfoWidth;
LeadHeight := RasterIO.InfoHeight;
bps := RasterIO.InfoBits;
pg := RasterIO.InfoPage;
sizd := RasterIO.InfoSizeDisk;
sizm := RasterIO.InfoSizeMem;
cmp := RasterIO.InfoCompress;
// Translate the meaning of the format constant
Case fmt of
FILE_PCX:
cFmt := 'ZSoft PCX';
FILE_GIF:
cFmt := 'CompuServe GIF';
FILE_TGA:
cFmt := 'TARGA';
FILE_PNG:
cFmt := 'Portable Network Graphics';
FILE_PSD:
cFmt := 'Adobe Photoshop 3.0';
FILE_BMP:
cFmt := 'Windows BMP';
FILE_OS2:
cFmt := 'OS/2 BMP version 1.x';
FILE_OS2_2:
cFmt := 'OS/2 BMP version 2.x';
FILE_WMF:
cFmt := 'Windows Meta File';
FILE_EPS:
cFmt := 'Encapsulated PostScript';
FILE_MAC:
cFmt := 'MacPaint';
FILE_PCT:
cFmt := 'Macintosh Pict';
FILE_MSP:
cFmt := 'Microsoft Paint';
FILE_IMG:
cFmt := 'GEM Image';
FILE_PCD:
cFmt := 'Kodak PhotoCD';
FILE_EPSTIFF:
cFmt := 'Encapsulated PostScript with an embedded TIFF file'
else
cFmt := 'Unknown format'
end;
// Create the message string
cMsg := fname + Chr(13) + 'Page := ' + IntToStr(pg) + ' of ' + IntToStr(RasterIO.InfoTotalPages) + Chr(13) + 'Format := ' + cFmt + Chr(13);
cMsg := cMsg + 'Width := ' + IntToStr(Trunc(LeadWidth)) + Chr(13) + 'Height := ' + IntToStr(Trunc(LeadHeight)) + Chr(13);
cMsg := cMsg + 'Size in memory := ' + IntToStr(sizm) + Chr(13) + 'Size on disk := ' + IntToStr(sizd) + Chr(13);
cMsg := cMsg + 'Bits per pixel := ' + IntToStr(bps) + Chr(13);
cMsg := cMsg + 'X resolution := ' + IntToStr(xres) + Chr(13) + 'Y resolution := ' + IntToStr(yres);
//Display the message box
MessageBox (Handle, PChar(cMsg), 'File Info', MB_OK);
end;


GetFloaterHandle example for Delphi

This example uses the GetFloaterHandle and SetRgnHandle methods to specify the mask for the paste. It also shows how to use the HasRgn, FloaterWidth, and FloaterHeight properties.

//Note that ZoomFactorX, ZoomFactorY must be declared as a global variables, and //have a correct data when you use this code.
var
nRet: integer;
sRet: Smallint;
//Declare the variable for the Combine operation.
MyOp :Longint;
//Declare the variable for the saved region.
SavedRgn :Longint;
//Declare the variables for the client area coordinates.
LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight: Single;
//Declare the variables for the bitmap coordinates.
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight: Single;
//Declare the RasterProcess object
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
//Exit this routine if there is no region.
if (LEADRasterView1.Raster.HasRgn = False) then
Exit;
//Save the region that is in the floater.
SavedRgn := LEADRasterView1.GetFloaterHandle (nRet);
//Get the floater into another bitmap
LEADRasterView2.ScaleMode := LEADRasterView1.ScaleMode;
LEADRasterView2.Raster.RefBitmap := False;
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Floater;
//Get the floater//s client coordinates into local variables.
LCRgnX := LEADRasterView1.FloaterDstLeft;
LCRgnY := LEADRasterView1.FloaterDstTop;
LCRgnWidth := LEADRasterView1.FloaterDstWidth;
LCRgnHeight := LEADRasterView1.FloaterDstHeight;
//Translate the client coordinates to bitmap coordinates.
LBRgnX := ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft;
LBRgnY := ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop;
LBRgnWidth := LEADRasterView1.FloaterWidth;
LBRgnHeight := LEADRasterView1.FloaterHeight;
//Delete the floater.
LEADRasterView1.FloaterVisible := False;
LEADRasterView1.Floater:= 0;
//Set the saved region to use as a mask for the Combine method.
LEADRasterView1.Raster.SetRgnHandle (SavedRgn, LBRgnX, LBRgnY, L_RGN_SET);
//Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp := CB_OP_ADD + CB_DST_0; //Operation flags for a simple paste.
RasterProc.Combine (LEADRasterView1.Raster,
LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight,
LEADRasterView2.Raster,
0, 0, MyOp);
//Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect (LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False, sRet);
//Free the region.
LEADRasterView1.Raster.FreeRgn ();
//Delete the region handle.
LEADRasterView1.Raster.DeleteRgnHandle (SavedRgn);
end;


GetHistogram example for Delphi

The following code does a CMYK separation and uses a histogram to find the brightest and darkest intensities in the K plane of the bitmap. It then remaps the intensities to use the full range and merges the color planes to recreate the bitmap:

var
sRet: Smallint;
MyIndex :Longint;
Brightest :Longint;
Darkest :Longint;
CurrentRange :Longint;
Offset :Longint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
Cursor:= crHourGlass;
//Do a CMYK color separation and copy the K plane to the bitmap
RasterProc.ColorSeparate (LEADRasterView1.Raster, COLORSEP_CMYK);
LEADRasterView1.Raster.Bitmap := 0; //Free the bitmap
LEADRasterView1.Raster.Bitmap := RasterProc.ColorPlanes [3]; //Copy the K plane
//Load the histogram
RasterProc.GetHistogram (LEADRasterView1.Raster, CHANNEL_MASTER);
//Find the brightest and darkest intensities in the image
MyIndex := 0;
Brightest := 0;
Darkest := -1;
while (MyIndex < 256) do
begin
if RasterProc.HistogramTable [MyIndex] > 0 then
begin
Brightest := MyIndex;
if (Darkest = -1) then
Darkest := MyIndex;
end;
MyIndex := MyIndex + 1
end;
//Remap the intensities to use the full range
MyIndex := Darkest;
CurrentRange:= Brightest - Darkest;
if (CurrentRange > 0) then
begin
while (MyIndex <= Brightest) do
begin
Offset := MyIndex - Darkest;
RasterProc.RemapTable [MyIndex] := Trunc((255 * Offset) / CurrentRange);
MyIndex := MyIndex + 1;
end;
RasterProc.RemapIntensity (LEADRasterView1.Raster, CHANNEL_MASTER);
end;
//Merge the color planes and free them from memory
RasterProc.ColorPlanes [3] := LEADRasterView1.Raster.Bitmap; //Update the K plane
RasterProc.ColorMerge (LEADRasterView1.Raster, COLORSEP_CMYK);
RasterProc.ColorPlanes[0]:= 0;
RasterProc.ColorPlanes[1]:= 0;
RasterProc.ColorPlanes[2]:= 0;
RasterProc.ColorPlanes[3]:= 0;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView1.ForceRepaint (sRet);
Cursor:= crDefault;
end;


GetHistogramGray example for Delphi

//This example gets a histogram for a 12-bit or 16-bit grayscale image and then
//displays the number of occurrences of the brightest and darkest intensities
var
nRet: Integer;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
ShowMessage ('Table size before call to GetHistogramGray: ' + IntToStr(RasterProc.HistogramGrayTableSize));
nRet := RasterProc.GetHistogramGray (LEADRasterView1.Raster);
if (nRet= 0) then
begin
LEADRasterView1.Raster.GetMinMaxVal ();
ShowMessage ('Highest Intensity: 0x' + IntToHex(LEADRasterView1.Raster.MaxVal, 4) + ' Count: ' + IntToStr(RasterProc.HistogramGrayTable [LEADRasterView1.Raster.MaxVal])
+ Chr(13) + 'Lowest Intensity: 0x' + IntToHex(LEADRasterView1.Raster.MinVal, 4) + ' Count: ' + IntToStr(RasterProc.HistogramGrayTable[LEADRasterView1.Raster.MinVal]));
end;
ShowMessage ('Table size of current histogram: ' + IntToStr(RasterProc.HistogramGrayTableSize));
end;


GetMinMaxBits example for Delphi

The following example retrieves the values for MinBit and MaxBit using GetMinMaxBits and writes the results.

LEADRasterView1.Raster.GetMinMaxBits ();
Edit1.Text:= IntToStr(LEADRasterView1.Raster.MinBit);
Edit2.Text:= IntToStr(LEADRasterView1.Raster.MaxBit);


GetMinMaxVal example for Delphi

The following example retrieves the values for MinVal and MaxVal using GetMinMaxVal and writes the results.

// add 2 EditBox controls for testing
//must call GetMinMaxVal first
LEADRasterView1.Raster.GetMinMaxVal ();
Edit1.Text:= IntToStr(LEADRasterView1.Raster.MinVal);
Edit2.Text:= IntToStr(LEADRasterView1.Raster.MaxVal);


GetRgnHandle example for Delphi

The following code creates a region, saves its handle and adds the saved region beside the current region.

var
sRet: Smallint;
SavedRegion: Longint;
OffsetX, OffsetY: Single;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

//Initialize the variables that we will manipulate to simulate mouse coordinates.
OffsetX:= LEADRasterView1.Raster.BitmapWidth / 8;
OffsetY:= LEADRasterView1.Raster.BitmapHeight / 6;
//Create an elliptical region.
LEADRasterView1.Raster.SetRgnEllipse (OffsetX, OffsetY, OffsetX, OffsetY, L_RGN_SET);
//Save a copy of the region.
SavedRegion:= LEADRasterView1.Raster.GetRgnHandle;
//Add the saved region to the bitmap, offsetting it so that we can see it.
LEADRasterView1.Raster.SetRgnHandle (SavedRegion, OffsetX, OffsetY, L_RGN_OR);
//Delete the saved region.
LEADRasterView1.Raster.DeleteRgnHandle (SavedRegion);
//Fill the bitmap region with blue.
RasterProc.Fill (LEADRasterView1.Raster, RGB(0, 0, 255));
//Free the bitmap region.
LEADRasterView1.Raster.FreeRgn ();
//Repaint the image so that we can see how the image was updated.
LEADRasterView1.ForceRepaint (sRet);
end;


Grayscale example for Delphi

This example converts the bitmap to 12-bit grayscale.

var
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Grayscale (LEADRasterView1.Raster, 12); //Grayscale image to 12-bit
end;


Halftone example for Delphi

This example halftones the bitmap with a horizontal pattern and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Halftone (LEADRasterView1.Raster, HALFTONE_PRINT, 0);
LEADRasterView1.ForceRepaint (sRet);
end;


hDocCleanRgn example for Delphi

var
RasterProc: LEADRasterProcess;

//Create the RasterProcess object and UnlockSupport

procedure TForm1.Button1Click (Sender: TObject);
begin

//.....
RasterProc:= CoLEADRasterProcess.Create ();
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
//.....
end;
procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
begin
{HolePunch Remove
This example updates a windows region with all removed hole punches
For the example, a windows region is updated and then converted to a LEAD region
but in practice it would easier and faster to just update a LEAD region
The HOLEPUNCH_USE_DPI flag instructs the API to determine the size of the hole punches
based on the image DPI
The image is modified
The HolePunch Event is used to display information about each hole punch removed}

RasterProc.EnableDocCleanEvents:= True;
nRet:= RasterProc.HolePunchRemove (LEADRasterView1.Raster,
HOLEPUNCH_SINGLE_REGION Or HOLEPUNCH_USE_DPI Or HOLEPUNCH_USE_COUNT Or HOLEPUNCH_USE_LOCATION,
2, 4, 0, 0, 0, 0, HOLEPUNCH_LEFT);

If (nRet = 0) Then
begin
LEADRasterView1.Raster.FreeRgn ( ) ;
LEADRasterView1.Raster.SetRgnHandle ( RasterProc.hDocCleanRgn, 0, 0, L_RGN_SET); RasterProc.hDocCleanRgn:= 0; //no longer need rgn
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR;
end;
end;
procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
fBoundingRectLeft: single;
fBoundingRectTop: single;
fBoundingRectWidth: single;
fBoundingRectHeight: single;
iHoleIndex: integer;
iHoleTotalCount: Integer;
iWhiteCount: Integer;
iBlackCount: Integer;
sOutput : String;
szTemp : array[0..255] of Char;

begin
case (DispID) of
LEADRASTERPROCESSEVENTS_HOLEPUNCHREMOVE:
begin
fBoundingRectLeft:= OleVariant(Params.rgvarg[7]);
fBoundingRectTop:= OleVariant(Params.rgvarg[6]);
fBoundingRectWidth:= OleVariant(Params.rgvarg[5]);
fBoundingRectHeight:= OleVariant(Params.rgvarg[4]);
iHoleIndex:= OleVariant(Params.rgvarg[3]);
iHoleTotalCount:= OleVariant(Params.rgvarg[2]);
iWhiteCount:= OleVariant(Params.rgvarg[1]);
iBlackCount:= OleVariant(Params.rgvarg[0]);
sOutput := Format ('HolePunch at %f,%f,%f,%f HoleIndex= %d TotalCount= %d WhiteCount= %d BlackCount= %d',
[fBoundingRectLeft,
fBoundingRectTop,
fBoundingRectWidth,
fBoundingRectHeight,
iHoleIndex,
iHoleTotalCount,
iWhiteCount,
iBlackCount]);
OutputDebugString(StrPCopy(szTemp,sOutput));
end;
end;
end;


HistoContrast example for Delphi

This example applies a histogram contrast to the bitmap and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.HistoContrast (LEADRasterView1.Raster, 300);
LEADRasterView1.ForceRepaint (sRet);
end;


HistoEqualize example for Delphi

This example equalizes the bitmap's histogram and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.HistoEqualize (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;


HSV_HfromRGB example for Delphi

//Takes an RGB, displays the RGB components, and displays the HSV components
Procedure RGBtoHSV(cr: OLE_COLOR);
var
red : Integer;
green: Integer;
blue: Integer;
h: Integer;
s: Integer;
v: Integer;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
red := GetRvalue (cr);
green := GetGvalue(cr);
blue := GetBvalue(cr);

h := RasterProc.HSV_HfromRGB (cr);
s := RasterProc.HSV_SfromRGB (cr);
v := RasterProc.HSV_VfromRGB (cr);

ShowMessage( 'RGB (' + IntToStr(red) + ',' + IntToStr(green) + ',' + IntToStr(blue) + ') is HSV(' + IntToStr(h) + ',' + IntToStr(s) + ',' + IntToStr(v) + ')' );
end;


Hue example for Delphi

This example rotates the hue 180 degrees and repaints the image.

Var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

RasterProc.Hue (LEADRasterView1.Raster, 180);
LEADRasterView1.ForceRepaint (sRet);
end;


IgnoreFilters example for Delphi

This example shows how to ignore filters so that certain files are not loaded.

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
//First, make sure PreLoaded Filters does not
//contain CMP, and that 0 filters can be cached
RasterIO.PreLoadFilters (3, 0, 'BMP,FAX,TIF');
//now, ignore cmp filter (never load cmp files)
RasterIO.IgnoreFilters ('CMP');
end;


InfoHasAlpha example for Delphi

var
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

RasterIO.Load (LEADRasterView1.Raster, 'v:\images\1.jpg', 24, 1, 1); //load a 24-bit image
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Raster.Bitmap;
RasterProc.ColorRes (LEADRasterView1.Raster, 8, 0, 0, 0); //just make it 8-bit
//now set an alpha channel
LEADRasterView1.Raster.BitmapAlpha := LEADRasterView2.Raster.Bitmap;

//save and free
RasterIO.Save (LEADRasterView1.Raster, 'c:\temp\32.png', FILE_PNG, 32, 0, 0);
LEADRasterView1.Raster.Bitmap := 0;
LEADRasterView2.Raster.Bitmap := 0;

ShowMessage('Pause');

//re-load
RasterIO.GetFileInfo (LEADRasterView1.Raster, 'c:\temp\32.png', 0, 0);
if (RasterIO.InfoHasAlpha <> False) then
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\32.png', 0, 1, 1);

LEADRasterView2.Raster.Bitmap := LEADRasterView1.Raster.BitmapAlpha;
end;


InfoViewPerspective Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject ( CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.GetFileInfo (LEADRasterView1.Raster, 'v:\images\babe.cmp', 1, FILEINFO_TOTALPAGES);
ShowMessage (IntToStr(RasterIO.InfoViewPerspective));
end;


InsertBitmapListItem Example for Delphi

This example loads an ordinary file and uses it to create and play an animation. It assumes that the LEAD control has already been sized to the aspect ratio of the image.

Var
sRet: Smallint;
nMax: Double; // Maximum width or height for bitmaps in the list
BitmapWidth: Double; // Width of the bitmap
BitmapHeight: Double; // Height of the bitmap
I: Longint; // Loop Counter
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;
Raster2: LEADRaster;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
Raster2:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
nMax := 160;
RasterIO.Load (Raster2, 'v:\images\24bit.bmp', 0, 0, 1);
BitmapWidth := Raster2.BitmapWidth;
BitmapHeight := Raster2.BitmapHeight;
// Reduce memory requirements, if necessary. Only small bitmaps play smoothly.
if (BitmapWidth > nMax) then
RasterProc.Size (Raster2, nMax, (BitmapHeight * nMax) / BitmapWidth, RESIZE_RESAMPLE)
else
begin
if(BitmapHeight > nMax) then
RasterProc.Size (Raster2, (BitmapWidth * nMax) / BitmapHeight, nMax, RESIZE_RESAMPLE);
end;
// Dither to an optimized palette, leaving the last color blank to use
// for transparency.
RasterProc.ColorRes (Raster2, 8, CRP_IDENTITYPALETTE, CRD_FLOYDSTEINDITHERING, 255);
// Set an arbitrary transparent color in the last position of the bitmap palette.
Raster2.BitmapPalette [255] := RGB(212, 222, 202);
// Set the playback values that will apply to all bitmaps in the list.
Raster2.BitmapDelay := 10;
Raster2.BitmapTop := 0;
Raster2.BitmapLeft := 0;
Raster2.BitmapEnableTransparency := True;
Raster2.BitmapTransparentColor := 16777216 + 255; // Specified by palette index
Raster2.BitmapDisposalMethod:= ANIMATIONDISPOSAL_RESTOREBACKGROUND;
// Free the LEADRasterView1 control//s current bitmap list.
LEADRasterView1.Raster.BitmapList := 0;
// Populate the bitmap list in the LEADRasterView1 control.
LEADRasterView1.EnablePaint := False;
for I := 0 to 36 do
begin
LEADRasterView1.Raster.InsertBitmapListItem (I, Raster2.Bitmap);
// Rotate, using the transparent color as the fill color.
LEADRasterView1.Raster.BitmapListIndex := I;
RasterProc.Rotate (LEADRasterView1.Raster, 1000 * I, 0, 16777216 + 255);
end;
LEADRasterView1.EnablePaint := True;
// Set the animation playback properties
LEADRasterView1.AnimationBackColor := RGB(0, 0, 255);
LEADRasterView1.AnimationBitsPerPixel := 8;
LEADRasterView1.AnimationHeight := LEADRasterView1.ScaleHeight;
LEADRasterView1.AnimationWidth := LEADRasterView1.ScaleWidth;
LEADRasterView1.AnimationLoop := False;
for I := 0 to 255 do
LEADRasterView1.AnimationPalette [I] := LEADRasterView1.Raster.BitmapPalette [I];

// Set properties for a scaled animation.
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSetRects := False;
// Set the image display size to match the LEAD Raster View control.
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
// Start the animation.
LEADRasterView1.AnimationEnable := True;
// Free the Raster2 object//s bitmap list.
Raster2.BitmapList := 0
end;


Intensity example for Delphi

This example lightens the bitmap and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Intensity (LEADRasterView1.Raster, 150);
LEADRasterView1.ForceRepaint (sRet);
end;


IntensityDetect example for Delphi

This example filters the bitmap to get the lightest intensities and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.IntensityDetect (LEADRasterView1.Raster, 200, 255);
LEADRasterView1.ForceRepaint (sRet);
end;


Invert example for Delphi

This example inverts the bitmap's colors and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Invert (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;


InvertedText example for Delphi

var
RasterProc: LEADRasterProcess;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
begin

//InvertedText
//This example finds all inverted text regions greater than 5 inches in width and 1/2 inch in height
//and inverts the text so that it appears normal
//The InvertedText Event is used to display additional information about the inverted text regions
//A LEAD region is updated to show all of the changes
RasterProc.EnableDocCleanEvents:= True;
nRet:= RasterProc.InvertedText (LEADRasterView1.Raster, INVERTEDTEXT_SINGLE_REGION Or INVERTEDTEXT_LEAD_REGION Or INVERTEDTEXT_USE_DPI, 5000, 500, 70, 95);
if (nRet = 0) then
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR;
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
fBoundingRectLeft: Single;
fBoundingRectTop: Single;
fBoundingRectWidth: Single;
fBoundingRectHeight: Single;
iWhiteCount: Longint;
iBlackCount: Longint;

begin
case (DispID) of
LEADRASTERPROCESSEVENTS_INVERTEDTEXT:
begin
fBoundingRectLeft:= OleVariant(Params.rgvarg^[5]);
fBoundingRectTop:= OleVariant(Params.rgvarg^[4]);
fBoundingRectWidth:= OleVariant(Params.rgvarg^[3]);
fBoundingRectHeight:= OleVariant(Params.rgvarg^[2]);
iWhiteCount:= OleVariant(Params.rgvarg^[1]);
iBlackCount:= OleVariant(Params.rgvarg^[0]);

OutputDebugString(pChar('Inverted at [Left,Top,Width,Height]' + FloatToStr(fBoundingRectLeft) +','+
FloatToStr(fBoundingRectTop) + ',' + FloatToStr(fBoundingRectWidth) +','+
FloatToStr(fBoundingRectHeight) +' WhiteCount=' +
IntToStr(iWhiteCount) + ' BlackCount= ' +
IntToStr(iBlackCount)));
end;
end;
end;


IsGrayscale example for Delphi

This example tests to see if the bitmap is grayscale.

var
IsGray: GrayScaleTypes;
begin
IsGray:= LEADRasterView1.Raster.IsGrayscale;
if (IsGray = GRAY_NO) then
ShowMessage('Not Grayscale')
else
ShowMessage('Is Grayscale');
end;


J2KCompressionControl Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
//compress a lossless file
RasterIO.J2KSetDefaults ();
RasterIO.J2KCompressionControl:= J2K_COMP_LOSSLESS;
RasterIO.Save (LEADRasterView1.Raster, WideString ('c:\temp\lossless.j2k'), FILE_J2K, 0, 0, SAVE_OVERWRITE);
end;


J2KCompressionRatio Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
// Compress a JPEG2000 file using 100:1 comp ratio
RasterIO.J2KSetDefaults ();
RasterIO.J2KCompressionControl:= J2K_COMP_RATIO;
RasterIO.J2KCompressionRatio:= 100;
RasterIO.Save (LEADRasterView1.Raster, WideString ('c:\temp\100_to_1.j2k'), FILE_J2K, 0, 0, SAVE_OVERWRITE);
end;


J2KSetDefaults Example for Delphi

var
RasterIO: LEADRasterIO;
csmsg: String;
cstemp: String;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_J2K, L_KEY_J2K);

// Display all the default JPEG2000 advanced options
RasterIO.J2KSetDefaults ();
csmsg:= '';
if ( RasterIO.J2KUseColorTransform ) then
cstemp:= 'J2KUseColorTransform = True' + Chr(13)
else
cstemp:= 'J2KUseColorTransform = False' + Chr(13);

csmsg:= csmsg + cstemp;
if ( RasterIO.J2KDerivedQuantization ) then
cstemp:= 'J2KDerivedQuantization = True' + Chr(13)
else
cstemp:= 'J2KDerivedQuantization = False' + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KXOsiz = ' + IntToStr(RasterIO.J2KXOsiz) + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KYOsiz = ' + IntToStr(RasterIO.J2KYOsiz) + Chr(13);
csmsg:= csmsg + cstemp;
cstemp:= 'J2KXTsiz = '+ IntToStr(RasterIO.J2KXTsiz) + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KYTsiz = '+ IntToStr(RasterIO.J2KYTsiz)+ Chr(13);
csmsg:= csmsg + cstemp;
cstemp:= 'J2KXTOsiz = ' + IntToStr(RasterIO.J2KXTOsiz) + Chr(13);
csmsg:= csmsg + cstemp;
cstemp:= 'J2KYTOsiz = ' + IntToStr(RasterIO.J2KYTOsiz) + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KDecompLevel = '+ IntToStr(RasterIO.J2KDecompLevel)+ Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KProgressOrder = ' + IntToStr(RasterIO.J2KProgressOrder) + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KCodBlockWidth = ' + IntToStr(RasterIO.J2KCodBlockWidth) + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KCodBlockHeight = ' + IntToStr(RasterIO.J2KCodBlockHeight) + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_SelectiveACBypass ) then
cstemp:= 'J2KCBS_SelectiveACBypass = True' + Chr(13)
else
cstemp:= 'J2KCBS_SelectiveACBypass = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_ResetContextOnBoundaries ) then
cstemp:= 'J2KCBS_ResetContextOnBoundaries = True' + Chr(13)
else
cstemp:= 'J2KCBS_ResetContextOnBoundaries = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_TerminationOnEachPass ) then
cstemp:= 'J2KCBS_TerminationOnEachPass = True' + Chr(13)
else
cstemp:= 'J2KCBS_TerminationOnEachPass = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_VerticallyCausalContext ) then
cstemp:= 'J2KCBS_VerticallyCausalContext = True' + Chr(13)
else
cstemp:= 'J2KCBS_VerticallyCausalContext = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_PredictableTermination ) then
cstemp:= 'J2KCBS_PredictableTermination = True' + Chr(13)
else
cstemp:= 'J2KCBS_PredictableTermination = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KCBS_ErrorResilienceSymbol ) then
cstemp:= 'J2KCBS_ErrorResilienceSymbol = True' + Chr(13)
else
cstemp:= 'J2KCBS_ErrorResilienceSymbol = False' + Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KGuardBits = ' + IntToStr(RasterIO.J2KGuardBits)+ Chr(13);
csmsg:= csmsg + cstemp;

cstemp:= 'J2KDerivedBaseMantissa = ' + IntToStr(RasterIO.J2KDerivedBaseMantissa)+ Chr(13);
csmsg:= csmsg + cstemp;
cstemp:= 'J2KDerivedBaseExponent = ' + IntToStr(RasterIO.J2KDerivedBaseExponent)+ Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KUseSOPMarker ) then
cstemp:= 'J2KUseSOPMarker = True' + Chr(13)
else
cstemp:= 'J2KUseSOPMarker = False' + Chr(13);
csmsg:= csmsg + cstemp;

if ( RasterIO.J2KUseEPHMarker ) then
cstemp:= 'J2KUseEPHMarker = True' + Chr (13)
else
cstemp:= 'J2KUseEPHMarker = False' + Chr (13);
csmsg:= csmsg + cstemp;

ShowMessage (csmsg);
end;


J2KTargetFileSize Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO.J2KSetDefaults ();
RasterIO.J2KCompressionControl:= J2K_COMP_TARGETSIZE;
RasterIO.J2KTargetFileSize:= 30 * 1024;
RasterIO.Save (LEADRasterView1.Raster, 'WideString (c:\temp\30k.j2k', FILE_J2K, 0, 0, SAVE_OVERWRITE);
end;


KeyPress example for Delphi

This example demonstrates the KeyPress event.

procedure TForm1.LEADRasterView1KeyPress (Sender: TObject;
KeyAscii: Smallint);
if (KeyAscii = 67) then //Uppercase C
begin
//This example sets an custom scale mode and uses it to crop the
//display. Keep in mind that the actual height and width do not change.
//Only the unit of measure changes.
//Change the scale so that origin is moved one-third right and one-third down
LEADRasterView1.ScaleLeft := -1;
LEADRasterView1.ScaleTop := -1;
LEADRasterView1.ScaleWidth := 3;
LEADRasterView1.ScaleHeight := 3;
//Crop the display so that it takes up the middle third of the height and width
LEADRasterView1.DstClipLeft := 0;
LEADRasterView1.DstClipTop := 0;
LEADRasterView1.DstClipWidth := 1;
LEADRasterView1.DstClipHeight := 1;
LEADRasterView1.ForceRepaint (sRet);
end;
end;


LevelLowBit example for Delphi

This is also the example for LevelHighBit.

This example sets LevelLowBit and LevelHighBit to display the image using only the eight least significant bits.

LEADRasterView1.AutoRepaint:= False;
//use least significant 8 bits
LEADRasterView1.Raster.LevelLowBit:= 0;
LEADRasterView1.Raster.LevelHighBit:= 7;
LEADRasterView1.AutoRepaint:= True;


LevelLUT example for Delphi

This is also the example for MinVal property and MaxVal property.

The following example sets LevelLowBit and LevelHighBit to use all bits, gets the minimum and maximum bits and intensity values for the image, and then sets the LUT so that pixels with values in the minimum range are mapped to the color RED, while pixels with values in the maximum range are mapped to BLUE.

var
min: Longint;
max: Longint;
i: Longint;
begin
LEADRasterView1.AutoRepaint := False;
//use all bits
LEADRasterView1.Raster.LevelLowBit := 0;
LEADRasterView1.Raster.LevelHighBit:= LEADRasterView1.Raster.BitmapBits - 1;

LEADRasterView1.Raster.GetMinMaxBits ();
LEADRasterView1.Raster.GetMinMaxVal ();
max := LEADRasterView1.Raster.MaxVal;
min := LEADRasterView1.Raster.MinVal;

//set LUT so that min range maps to RED and max range maps to BLUE
for i := min to min + 100 do
LEADRasterView1.Raster.LevelLUT [i] := RGB(255, 0, 0);
for i := max - 100 to max do
LEADRasterView1.Raster.LevelLUT[i] := RGB(0, 0, 255);
LEADRasterView1.AutoRepaint := True;
end;


LevelLUTLength example for Delphi

This example writes out the number of entries in the LUT.

Edit1.Text:= IntToStr(LEADRasterView1.Raster.LevelLUTLength);


LineRemove example for Delphi

var
RasterProc: LEADRasterProcess;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//Line Remove
//This examples removes vertical lines that are at least 200 pixels in length
//and no more than 5 pixels in width
//The lines can have gaps up to two pixels in length
//The LineRemove Event is used to display information about each line removed
RasterProc.EnableDocCleanEvents:= True;
RasterProc.LineRemove (LEADRasterView1.Raster, LINE_USE_GAP, 200, 5, 7, 10, 2, 0, LINEREMOVE_HORIZONTAL);
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
fStartRow: Single;
fStartCol: Single;
fLength: Single;
begin
case (DispID) of
LEADRASTERPROCESSEVENTS_LINEREMOVE:
begin
fStartRow:= OleVariant(Params.rgvarg^[3]);
fStartCol:= OleVariant(Params.rgvarg^[2]);
fLength:= OleVariant(Params.rgvarg^[1]);

OutputDebugString(pChar('Line at [R,C]' + FloatToStr(fStartRow) + ',' + FloatToStr(fStartCol) + ' Length=' + FloatToStr(fLength)));
end;
end;
end;


LoadArray example for Delphi

procedure TForm1.LoadArrayClick(Sender: TObject);
var
i: Smallint;
Buffer: Variant;
MyBufferPtr: Pointer;
BytesRead: Longint;
FileHandle: integer;
RasterVarBuffer: LEADRasterVariant;
RasterIO: LEADRasterIO;

begin
RasterIO:= CoLEADRasterIO.Create ();
RasterVarBuffer:= CoLEADRasterVariant.Create ( );
Buffer:= VarArrayCreate([0, 40000-1], varByte);
MyBufferPtr := AllocMem(40000);
FileHandle := FileOpen('c:\babe.cmp', fmOpenRead );
if (FileHandle > 0) then
begin
BytesRead := FileRead(FileHandle, MyBufferPtr^, 40000); // read from the file
for i:= 0 to BytesRead-1 do
Buffer[i] := Byte((Pchar(MyBufferPtr)+i)^);
RasterVarBuffer.StringValue:= Buffer;
RasterIO.LoadArray(LEADRasterView1.Raster, RasterVarBuffer, 0, 1, 1, BytesRead);
end;
FreeMem(MyBufferPtr);
FileClose( FileHandle );
end;


LoadCompressed example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.LoadCompressed:= True;
//now the file will be loaded compressed
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\test.tif', 0, 0, 1);
end;


LoadIFD example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;

//All examples will assume that "test.tif" has over 1002 images
// This example will load pages 1000 and 1001 after getting the information for page 1000:
RasterIO.GetFileInfo (LEADRasterView1.Raster, 'v:\images\Test.tif', 1000, 0);
// Setting LoadIFD to InfoIFD indicates that 1000 is treated as page 1
RasterIO.LoadIFD := RasterIO.InfoIFD;
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\Test.tif', 0, 0, 2);
// Reset LoadIFD to 0 so other TIF files will be handled properly
RasterIO.LoadIFD := 0;
end;


LoadInfo... example for Delphi

Take the following steps to exercise the LoadInfo event and LoadInfo... properties. The example creates a raw FAX file, then loads the file it just created. (Getting format information from an unfamiliar file is beyond the scope of this example.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
3. | At the beginning of the Unit1 file, add LTRASTERPROCLib_TLB to the uses section. For example:

Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, LTRASTERPROCLib_TLB;

4. | If you didn’t install LEvntSnk, install it.
 | On the Component pull-down menu, use install component …, and browse to LEADXX\Include\LEvntSnk.pas, and press Ok.
5. | From the ActiveX controls, Add the LEvntSnk control to your form.
6. | Add the following variables to Unit1 Private declaration section:

MyInfoBits: Integer;
MyInfoFlags: Longint;
MyInfoFormat: Integer;
MyInfoHeight: Single;
MyInfoOffset: Longint;
MyInfoWidth: Single;
MyInfoXRes: Integer;
MyInfoYRes: Integer;
MyRasterIO: LEADRasterIO;

7.

Add the following to LoadLead Click’s Procedure:

MyRasterIO:= CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
LEADEventSink1.Connect (MyRasterIO, _LEADRasterIOEvents);

8. | Add a button to your form and name it as follows:
 | Name | Caption
 | Button1 | Button1
9. | Code the Button1 click’s procedure as follows:

procedure TForm1.Button1Click(Sender: TObject);
var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADRasterView1.ScaleMode := 3; //Pixels
//Make the image look OK as a 1-bit image.
RasterProc.Size (LEADRasterView1.Raster,
LEADRasterView1.ScaleWidth,
LEADRasterView1.ScaleHeight, RESIZE_RESAMPLE);
RasterProc.Halftone (LEADRasterView1.Raster, HALFTONE_VIEW, 45);
//Set the form-level variables to the values we will use when loading.
MyInfoBits := 1;
MyInfoFlags := LOADINFO_TOPLEFT;
MyInfoFormat := FILE_FAX_G3_2D;
MyInfoHeight := LEADRasterView1.Raster.BitmapHeight;
MyInfoOffset := 0;
MyInfoWidth := LEADRasterView1.Raster.BitmapWidth;
MyInfoXRes := LEADRasterView1.Raster.BitmapXRes;
MyInfoYRes := LEADRasterView1.Raster.BitmapYRes;
//Save the image as raw FAX; then load the saved file.
//Format information will be supplied in the LoadInfo event.
MyRasterIO.Save (LEADRasterView1.Raster, 'c:\temp\tmp.tif', FILE_FAX_G3_2D,
1, 1, SAVE_OVERWRITE);
MyRasterIO.Load (LEADRasterView1.Raster, 'c:\temp\tmp.tif', 0, 0, 1);
//Repaint the newly loaded image.
LEADRasterView1.ForceRepaint (sRet);
end;

10.

Code the MyRasterIO object's LoadInfo event as follows:

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
begin
case (DispID) of
LEADRASTERIOEVENTS_LOADINFO:
begin
MyRasterIO.LoadInfoBits := MyInfoBits;
MyRasterIO.LoadInfoFlags := MyInfoFlags;
MyRasterIO.LoadInfoFormat := MyInfoFormat;
MyRasterIO.LoadInfoHeight := MyInfoHeight;
MyRasterIO.LoadInfoOffset := MyInfoOffset;
MyRasterIO.LoadInfoWidth := MyInfoWidth;
MyRasterIO.LoadInfoXRes := MyInfoXRes;
MyRasterIO.LoadInfoYRes := MyInfoYRes;
end;
end;
end;

11.

Run your program to test it.


LoadMemory example for Delphi

This example uses WIN32 API calls to load a file into memory, and then uses the LoadMemory method to load the memory-resident file into a bitmap.

var
hf: Longint; // For WIN32 declare this as Long
hMem: HGLOBAL; // For WIN32 declare this as Long
lpMem: Pointer;
iSize: Longint;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;

{ Load the file into memory.}
hf := FileOpen('v:\images\image1.cmp', fmOpenRead);

if (hf <= 0 ) then
begin
MessageDlg ('Error opening file!', mtError, [mbOK], 0);
Exit;;
End;
iSize := FileSeek(hf,0,2);
FileSeek(hf, 0, 0);
hMem := GlobalAlloc(GMEM_MOVEABLE,iSize);

if (hMem = 0) then
begin
FileClose (hf);
MessageDlg ('Not enough memory to hold the file in memory!', mtError, [mbOK], 0);
Exit;
end;
lpMem:= GlobalLock(hMem);
if (lpMem = Nil) Then
begin
FileClose (hf);
GlobalFree(hMem);
MessageDlg ('Not enough memory to hold the file in memory!', mtError, [mbOK], 0);
Exit;
end;

if (FileRead(hf, lpMem^, iSize) < iSize) then
begin
FileClose (hf);
GlobalUnlock(hMem);
GlobalFree(hMem);
MessageDlg ('Error reading file!', mtError, [mbOK], 0);
Exit;
end;
GlobalUnlock (hMem);
FileClose (hf);

//Load the bitmap from the memory-resident file.
if (RasterIO.LoadMemory (LEADRasterView1.Raster, hMem, 0, 0, -1, iSize) <> 0) then
MessageDlg ('Error calling LoadMemory', mtError, [mbOK], 0)
else
MessageDlg ('LoadMemory succeeded', mtInformation, [mbOK], 0);
GlobalFree (hMem);
end;


LoadUseViewPerspective example for Delphi

Note:

This topic is for Document/Medical only.

This example times the loading of a bitmap with and without changing the internal view perspective.

var
StartTime, EndTime, DeltaTime: Double;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
//Do not include paints when measuring time.
LEADRasterView1.AutoRepaint:= False;
//Time the load using the bitmap//s view perspective.
RasterIO.LoadUseViewPerspective:= True;
StartTime:= Time();
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\bird.tif', 0, 0, 1);
EndTime:= Time();
DeltaTime:= EndTime - StartTime;
ShowMessage(IntToStr(Trunc(DeltaTime)) + ' seconds loaded as is');
//Time the load that converts the bitmap//s view perspective.
RasterIO.LoadUseViewPerspective:= False;
StartTime:= Time();
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\bird.tif', 0, 0, 1);
EndTime:= Time();
DeltaTime:= EndTime - StartTime;
ShowMessage (IntToStr(Trunc(DeltaTime)) + ' seconds converted on load');
end;


MaxFilter example for Delphi

This example erodes dark objects and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.MaxFilter (LEADRasterView1.Raster, 3);
LEADRasterView1.ForceRepaint (sRet);
end;


Median example for Delphi

This example applies a median filter with a 3x3 neighborhood and redisplays the bitmap.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Median (LEADRasterView1.Raster, 3);
LEADRasterView1.ForceRepaint (sRet);
end;


MinFilter example for Delphi

Note:

This topic is for Document/Medical only.

This example dilates dark objects and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.MinFilter (LEADRasterView1.Raster, 3);
LEADRasterView1.ForceRepaint (sRet);
end;


Mosaic example for Delphi

This example applies a mosaic effect with 8x8 tiles and redisplays the bitmap.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Mosaic (LEADRasterView1.Raster, 8);
LEADRasterView1.ForceRepaint (sRet);
end;


Oilify example for Delphi

This example applies an oil-painting effect and repaints the image. The progress event is enabled because this Oilify method with a neighborhood of 10 is slow.

var
RasterProc: LEADRasterProcess;

procedure TForm1.Button1Click(Sender: TObject);
var
sRet: Smallint;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess)as LEADRasterProcess;
//.....
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
RasterProc.EnableProgressEvent:= True;
RasterProc.Oilify (LEADRasterView1.Raster, 10);
LEADRasterView1.ForceRepaint (sRet);
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
iPercent: Integer;
begin
case (DispID) of
LEADRASTERPROCESSEVENTS_PROGRESSSTATUS:
begin
iPercent:= OleVariant(Params.rgvarg^[0]);
Caption:= IntToStr(iPercent);
end;
end;
end;


OLEDropAllowed example for Delphi

This example toggles the OLEDropAllowed property.

LEADRasterView1.OLEDropAllowed:= Not LEADRasterView1.OLEDropAllowed;


OLEDropFile example for Delphi

This example displays the name of the file that was dropped, and then loads it.

procedure TForm1.LEADRasterView1OleDropFile(Sender: TObject;
const pszName: WideString);
var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
//when a file is dropped, bring up a dialog box and ask the user
//whether to load the file or not
if (MessageBox (Handle, PChar(pszName), '', MB_YESNO) = IDYES) then
RasterIO.Load (LEADRasterView1.Raster, pszName, 0, 1, 1)
else
ShowMessage ('File Not Loaded!');
end;


Paint event example for Delphi

This example uses some Windows API functions to demonstrate the following:

Paint event

Click event

Enabled property

Window property

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add these variables for MyRect and MyPoint to the Main form’s private section:

MyRect: TRECT;
MyPoint: TPOINT;

3. | Add a button to your form and name it as follows:
 | Name | Caption
 | Toggle | Toggle
4. | Add an Edit box to the top of your form, and name it as follows:
 | Name | Text
 | Directions | Use the Toggle button to turn on or turn off Click-Splat.
5. | Code the Toggle button's Click procedure as the following, This code uses the Enabled property to toggle the LEAD RasterView control's ability to respond to click events.

procedure TForm1.ToggleClick(Sender: TObject);
begin
if (LEADRasterView1.Enabled = False) Then
begin
LEADRasterView1.Enabled:= True;
Directions.Text:= 'Click on the image for a splat';
Toggle.Caption:= 'Disable';
end
else
begin
LEADRasterView1.Enabled := False;
Directions.Text := 'Click does nothing';
Toggle.Caption := 'Enable';
end;
end;

6.

Code the LEADRasterView1 Click procedure as the following. When the Enabled property is true, this code uses a Windows API call to generate a paint event.

procedure TForm1.LEADRasterView1Click (Sender: TObject);
var
hCtl: HWND;
SavedMode: RasterScaleModeConstants;
begin
// Use pixels for API calls
SavedMode := LEADRasterView1.ScaleMode;
LEADRasterView1.ScaleMode := 3; //Pixels
// Use InvalidateRect to generate a paint message
MyRect.Left := 0;
MyRect.Top := 0;
MyRect.Bottom := Trunc(LEADRasterView1.ScaleHeight);
MyRect.Right := Trunc(LEADRasterView1.ScaleWidth);
hCtl := LEADRasterView1.Window _;
InvalidateRect (hCtl, @MyRect, True);
// Set the ScaleMode back to the default
LEADRasterView1.ScaleMode := SavedMode;
end;

8.

Code the LEADRasterView1 Paint procedure as the following. It uses Windows GDI functions to draw random lines on the control whenever there is a paint event.

procedure TForm1.LEADRasterView1Paint (Sender: TObject; hDC: Integer);
var
LeadClientDC: Longint;
xStart: longint;
yStart: longint;
xDelta: Longint;
yDelta: Longint;
xEnd: Longint;
yEnd: Longint;
nRet: Integer;
sRet: Smallint;
i: Longint;
begin
MyPoint.x := 0;
MyPoint.y := 0;
// Create a device context for the control that the GDI functions can access
LeadClientDC := LEADRasterView1.GetClientDC (nRet);
// Draw random lines on the control. This overlay does not affect the bitmap.
xStart := Longint(Trunc((LEADRasterView1.ScaleWidth)*Random+ 1));
yStart := Longint(Trunc((LEADRasterView1.ScaleHeight)*Random+ 1));
MoveToEx(LeadClientDC, xStart, yStart, @MyPoint);
for i := 1 to 50 do
begin
xDelta := Longint(Trunc((81 * Random) - 40));
yDelta := Longint(Trunc((81 * Random) - 40));
xEnd := xStart + xDelta;
yEnd := yStart + yDelta;
LineTo(LeadClientDC, xEnd, yEnd);
MoveToEx(LeadClientDC, xStart, yStart, @MyPoint);
end;
// Remove the lock from the device control
LEADRasterView1.ReleaseClientDC (sRet);
end;

9.

Run your program to test it.


PaintContrast example for Delphi

This example increases the contrast for painting images.

Var
sRet: Smallint;
begin
LEADRasterView1.PaintContrast:= LEADRasterView1.PaintContrast + 100;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintDither example for Delphi

This example turns on error diffusion and redisplays the bitmap.

var
sRet: Smallint;
begin
LEADRasterView1.PaintDither:= PAINTDITHER_DIFFUSION;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintEffect example for Delphi

The following modules use the KeyDown and KeyUp events to repaint the image with effects.

procedure TForm1.LEADRasterView1KeyDown (Sender: TObject; KeyCode,
Shift: Smallint);
var
sRet: Smallint;
begin
if (KeyCode = 116) then //Code for F5
begin
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.BackErase := True;
LEADRasterView1.EffectGrain := 20;
LEADRasterView1.EffectDelay := 50;
LEADRasterView1.WandSize := 5;
LEADRasterView1.WandColor := RGB(255,255,0); //Yellow Wand
LEADRasterView1.PaintEffect := EFX_EFFECT_WIPE_L_TO_R;
LEADRasterView1.ForceRepaint (sRet);
end;
end;

procedure TForm1.LEADRasterView1KeyUp (Sender: TObject; KeyCode,
Shift: Smallint);
var
sRet: Smallint;
begin
if (KeyCode = 116) then //Code for F5
begin
LEADRasterView1.PaintEffect := EFX_EFFECT_WIPE_R_TO_L;
LEADRasterView1.ForceRepaint(sRet);
LEADRasterView1.PaintEffect := EFX_EFFECT_NONE;
end;
end;


PaintEffectMaxPasses example for Delphi

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
LEADRasterView1.AutoRepaint:= False;
LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
LEADRasterView1.PaintEffectMaxPasses:= 5; //5 total passes
LEADRasterView1.PaintEffectPass:= 1; //Start with pass number 1
LEADRasterView1.PaintNotificationDelay:= 200; //Delay 200 milliseconds between passes
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\240bit.bmp', 0, 0, 1);//Load the image
LEADRasterView1.AutoRepaint:= True;
end;

procedure TForm1.LEADRasterView1PaintNotification (Sender: TObject; uPass,
uType: Smallint);
begin
//If the first pass is complete
if ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) then
begin
//Toggle the effect from left_to_right to right_to_left
if LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN then
LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_OUT
else
LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_IN
end;
end;


PaintGamma example for Delphi

This example increases the gamma correction for painting images.

var
sRet: Smallint;
begin
LEADRasterView1.PaintGamma:= LEADRasterView1.PaintGamma + 100;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintIntensity example for Delphi

This example increases the intensity for painting images.

var
sRet: Smallint;
begin
LEADRasterView1.PaintIntensity:= LEADRasterView1.PaintIntensity+ 100;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintPalette example for Delphi

This example sets the paint palette to the palette of each Lead control. It then loads two images and dithers them to 8 bits per pixel with optimized palettes, and displays them side by side. In 8-bit display mode, you can see the palette problems that result when you do not use a fixed palette.

var
sRet: Smallint;
HeightFactor1: Single;
WidthFactor1: Single;
HeightFactor2: Single;
WidthFactor2:Single;
HeightAllowed: Single;
WidthAllowed: single;
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;

begin

RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;

LEADRasterView1.PaintPalette := PAINTPALETTE_AUTO;
LEADRasterView2.PaintPalette := PAINTPALETTE_AUTO;
//Disable automatic repainting of the image.
LEADRasterView1.AutoRepaint := False;
LEADRasterView2.AutoRepaint := False;
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll := False;
LEADRasterView2.AutoScroll := False;
//Clear the bitmaps from memory
LEADRasterView1.Raster.Bitmap := 0;
LEADRasterView2.Raster.Bitmap := 0;
Screen.Cursor:= crHourglass;
//Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\24bit.bmp', 0, 0, 1);
RasterIO.Load (LEADRasterView2.Raster, 'v:\images\24bit2.bmp', 0, 0, 1);
//Change the bitmaps to 8 BPS with optimized palettes
RasterProc.ColorRes (LEADRasterView1.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
RasterProc.ColorRes (LEADRasterView2.Raster, 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
//Make the controls visible so that we can size and position them.
//They will not really appear until we load an image and paint it.
LEADRasterView1.Visible := True;
LEADRasterView2.Visible := True;
//Set the variables used for preserving the aspect ratio.
HeightFactor1 := LEADRasterView1.Raster.BitmapHeight;
WidthFactor1 := LEADRasterView1.Raster.BitmapWidth;
HeightFactor2 := LEADRasterView2.Raster.BitmapHeight;
WidthFactor2 := LEADRasterView2.Raster.BitmapWidth;
HeightAllowed := Height * 0.8;
WidthAllowed := Width * 0.45;
//Center each LEAD control on half of the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed Then
begin
LEADRasterView1.Left := Trunc((Width / 4) - (WidthAllowed / 2));
LEADRasterView1.Width:= Trunc(WidthAllowed);
LEADRasterView1.Height := Trunc((LEADRasterView1.Width * HeightFactor1) / WidthFactor1);
LEADRasterView1.Top := Trunc((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top := Trunc((Height - HeightAllowed) / 2);
LEADRasterView1.Height := Trunc(HeightAllowed);
LEADRasterView1.Width := Trunc((LEADRasterView1.Height * WidthFactor1) / HeightFactor1);
LEADRasterView1.Left := Trunc((Width / 4) - (LEADRasterView1.Width / 2));
end;
if ((WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed) then
begin
LEADRasterView2.Left := Trunc((Width * 3 / 4) - (WidthAllowed / 2));
LEADRasterView2.Width := Trunc(WidthAllowed);
LEADRasterView2.Height := Trunc((LEADRasterView2.Width * HeightFactor2) / WidthFactor2);
LEADRasterView2.Top := Trunc((Height - LEADRasterView2.Height) / 2);
end
else
begin
LEADRasterView2.Top := Trunc((Height - HeightAllowed) / 2);
LEADRasterView2.Height := Trunc(HeightAllowed);
LEADRasterView2.Width := Trunc((LEADRasterView2.Height * WidthFactor2) / HeightFactor2);
LEADRasterView2.Left := Trunc((Width * 3 / 4) - (LEADRasterView2.Width / 2));
end;
//Set the image display sizes to match the LEAD controls
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight,sRet);
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight, sRet);
LEADRasterView2.SetDstRect (0, 0, LEADRasterView2.ScaleWidth, LEADRasterView2.ScaleHeight,sRet);
LEADRasterView2.SetDstClipRect (0, 0, LEADRasterView2.ScaleWidth, LEADRasterView2.ScaleHeight, sRet);
//Display the images
LEADRasterView1.ForceRepaint (sRet);
LEADRasterView2.ForceRepaint(sRet);
Screen.Cursor := crDefault;
end;


PaintROP3 example for Delphi

This example demonstrates the PaintROP3 property.

//Add this WIN32 constant to the Declarations module
Const
SRCINVERT = 6684742;
var
sRet: Smallint;
begin
//Use this code to paint an inverted image.
LEADRasterView1.PaintROP3:= SRCINVERT;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintScaling Example for Delphi

//This example sets the display to use bilinear interpolation
LEADRasterView1.PaintScaling:= PAINTSCALING_RESAMPLE;


PaintSizeMode Example for Delphi

This example shows how to set the PaintSizeMode property so that the control uses only a vertical scroll bar.

var
sRet: Smallint;
begin
LEADRasterView1.AutoScroll := True;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FITSIDES;
LEADRasterView1.ForceRepaint (sRet);
end;


PaintSizeUseDPI example for Delphi

This example toggles the PaintSizeUseDPI property.

LEADRasterView1.PaintSizeMode:= PAINTSIZEMODE_NORMAL;
LEADRasterView1.PaintSizeUseDPI:= Not LEADRasterView1.PaintSizeUseDPI;


PaintTransitionMaxPasses example for Delphi

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

var
RasterIO:LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.PaintEffect := EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
LEADRasterView1.EffectDelay := 100;
LEADRasterView1.PaintTransitionMaxPasses := 5; //5 total passes
LEADRasterView1.PaintTransitionPass := 1; //Start with pass number 1
LEADRasterView1.PaintNotificationDelay := 200 ;//Delay 200 milliseconds between passes
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\240bit.bmp', 0, 0, 1 );//Load the image
LEADRasterView1.AutoRepaint := True;
end;

procedure TForm1.LEADRasterView1PaintNotification (Sender: TObject; uPass,
uType: Smallint);
begin
//If the first pass is complete
if ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) then
begin
//Toggle the effect from left_to_right to right_to_left
if LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_IN Then
LEADRasterView1.TransitionEffect:= EFX_EFFECT_WIPE_RECTANGLE_OUT
else
LEADRasterView1.TransitionEffect:= EFX_EFFECT_WIPE_RECTANGLE_IN
end;
end;


PaintWhileLoad example for Delphi

This example causes the LEAD RasterView control to paint the image as it loads.

var
RasterIO:LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;
LEADRasterView1.PaintWhileLoad := True;
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1);

end;


PaintZoomFactor Example for Delphi

This example shows how to set the PaintZoomFactor property so that image is scaled 200 percent for display.

var
sRet: Smallint;
begin
LEADRasterView1.AutoScroll:= False;
LEADRasterView1.AutoSetRects:= True;
LEADRasterView1.PaintSizeMode:= PAINTSIZEMODE_ZOOM;
LEADRasterView1.PaintZoomFactor:= 200;
LEADRasterView1.ForceRepaint (sRet);
end;


PatternStyle (ILEADRasterFXD) example for Delphi

var
RasterIO: LEADRasterIO;
RasterFxd: LEADRasterFXD;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
RasterFxd:= CreateComObject(CLASS_LEADRasterFXD) as LEADRasterFXD;
LEADRasterView1.AutoRepaint := False;
//Load an image for the main control
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1);
//Shape background
RasterFxd.ShapeBackgroundStyle := FXD_BACKSTYLE_OPAQUE;
RasterFxd.PatternStyle := FXD_PATTERN_CROSS;
RasterFxd.PatternBackColor := RGB(255, 0, 0);//red
RasterFxd.PatternForeColor := RGB(0, 0, 255); //blue
//Shape location
RasterFxd.ShapeTop := 50;
RasterFxd.ShapeLeft := 50;
RasterFxd.ShapeWidth := LEADRasterView1.DstWidth - 50;
RasterFxd.ShapeHeight := LEADRasterView1.DstHeight - 50;
//Make the shape a permanent part of the bitmap
RasterFxd.DrawPersistence := True;
RasterFxd.DstLeft := 0;
RasterFxd.DstTop := 0;
RasterFxd.DstRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.DstBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.SrcLeft := 0;
RasterFxd.SrcTop := 0;
RasterFxd.SrcRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.SrcBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.ScaleMode := 3;
RasterFxd.ClientSizeX := 5;
RasterFxd.ClientSizeY := 5;
//Draw the shape
RasterFxd.DrawShape (LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, 0);
//Repaint
LEADRasterView1.AutoRepaint := True
end;


PatternStyle example for Delphi

This example paints a transition with a diagonal cross pattern.

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.TransitionDelay := 50;
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1);
LEADRasterView1.TransitionEffect := EFX_EFFECT_WIPE_RECTANGLE_OUT;
LEADRasterView1.TransitionStyle := EFX_TRANSITION_PATTERN;
LEADRasterView1.PatternStyle := EFX_PATTERN_DIAG_CROSS;
LEADRasterView1.PatternBackColor := RGB(255, 0, 0);
LEADRasterView1.PatternForeColor := RGB(0, 0, 255);
LEADRasterView1.AutoRepaint := True;
end;


PCDRes example for Delphi

This example checks for a high-resolution image and loads it if possible.

var
Msg: string;
sRet: Smallint;
myfile: string;
RasterIO: LEADRasterIO;

begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
myfile:= 'v:\images\pcd\_aiwanit.pcd'; //No PCD sample image is included with LEADTOOLS
RasterIO.GetFileInfo (LEADRasterView1.Raster, myfile, 0, 0 ) ;
if (RasterIO.InfoPCDRes [PCDRES_4BASE] = True )then
begin
RasterIO.PCDRes:= PCDRES_4BASE;
Msg:= 'Loading 1024 x 1536 resolution';
end
else
begin
RasterIO.PCDRes:= PCDRES_BASE;
Msg:= 'Loading 512 x 768 resolution';
end;

ShowMessage(Msg);
Cursor:= crHourGlass;
//Turn on the automatic display rectangles and the scroll bars.
LEADRasterView1.AutoSetRects:= True;
LEADRasterView1.AutoScroll:= True;
//Load the file.
RasterIO.Load (LEADRasterView1.Raster, myfile, 0, 0, 1);
LEADRasterView1.ForceRepaint (sRet);
Cursor:= crDefault;
end;


PDFSaveUseDPI Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
//Use image DPI when saving as PDF
RasterIO.PDFSaveUseDPI:= True;
//Save image as Raster PDF with CCITT G4 compression
RasterIO.Save(LEADRasterView1.Raster,
WideString('c:\temp\tmp.pdf'),
FILE_RAS_PDF_G4, 1,
1, SAVE_OVERWRITE);
end;


PDFXResolution example for Delphi

//This example does the following:
// 1- Changes the horizontal and vertical PDF resolutions to 150 dpi .
// 2- Sets the pixel depth to 8.
// 3- Disables both font and graphics anti-aliasing.
// 4- Forces the PDF module to use it's own installed fonts.
// 5- Loads a PDF file using the new settings.
var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
//Unlock PDF support, you will need the actual key
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_PDF, 'TestKey');

//Set horizontal resolution
RasterIO.PDFXResolution:= 150;
//Set vertial resolution
RasterIO.PDFYResolution:= 150;
//Set Display depth
RasterIO.PDFDisplayDepth:= 8;
//No font anti-aliasing
RasterIO.PDFTextAlpha:= 1;
//No graphics anti-aliasing
RasterIO.PDFGraphicsAlpha:= 1;
//Use fonts installed by the PDF module
RasterIO.PDFUseLibFonts:= True;
//Load the PDF file
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\Test.pdf', 0, 0, -1);
end;


Picturize example for Delphi

// Replace the current image in the main control with an image created
// from all the images present in c:\images. Resize all images present in that directory
// to 16x16 pixels and load them all in memory before proceeding
var
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess)as LEADRasterProcess;
LEADRasterView1.ScaleMode:= 3;
RasterProc.Picturize (LEADRasterView1.Raster,
'd:\pictures',
PICTURIZE_LOADALL+PICTURIZE_RESIZE, 24, 24)
end;


Pixel example for Delphi

This example, using the MouseDown event, gets the value of the current pixel and sets all values in the line to that value. The example shows how to convert mouse coordinates to bitmap pixel coordinates, regardless of how the image is zoomed or scrolled.

procedure TForm1.LEADRasterView1MouseDown (Sender: TObject; Button,
Shift: Smallint; x, y: Single);
var
sRet: Smallint;
xycolor: longint;
xfraction: Single;
yfraction: Single;
xPixel: Longint;
yPixel: Longint;
begin
//Translate mouse coordinates to fractions of the destination width and height.
LEADRasterView1.BackErase:= False;
xfraction:= (x - LEADRasterView1.DstLeft) / LEADRasterView1.DstWidth;
yfraction:= (y - LEADRasterView1.DstTop) / LEADRasterView1.DstHeight;
//convert fractions to bitmap pixel coordinates.
xPixel:= Trunc((LEADRasterView1.SrcWidth * xfraction) + LEADRasterView1.SrcLeft);
yPixel:= Trunc((LEADRasterView1.SrcHeight * yfraction) + LEADRasterView1.SrcTop);
//Make the whole line the same color as the pixel.
xycolor:= Trunc((LEADRasterView1.Raster.Pixel [xPixel, yPixel]));
for xPixel:= 0 to Trunc(LEADRasterView1.Raster.BitmapWidth) - 1 do
LEADRasterView1.Raster.Pixel[xPixel, yPixel]:= xycolor;
LEADRasterView1.ForceRepaint (sRet);
end;


Posterize example for Delphi

This example applies a six-color poster effect and redisplays the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess)as LEADRasterProcess;
RasterProc.Posterize (LEADRasterView1.Raster, 6);
LEADRasterView1.ForceRepaint (sRet);
end;


PreferredLoadFormat Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
RasterIO.PreferredLoadFormat:= FILE_CMP;
//....... load a file
end;


PreLoadFilters Example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
//preload the BMP, PCX, FAX, and TIFF filters,
//and allow 1 filter to be cached, while always
//keeping 3 loaded.
RasterIO.PreLoadFilters (3, 1, 'BMP,PCX,FAX,TIF');
//..... load an image
end;


PrinterScaleHeight Example for Delphi

var
nRet: Integer;
sRet: smallint;
h_dc: HDC;
begin
ShowMessage('Width: ' + IntToStr(Trunc(LEADRasterView1.PrinterScaleWidth))
+ ' Height: ' + IntToStr(Trunc(LEADRasterView1.PrinterScaleHeight)));
h_dc:= LEADRasterView1.PrintStart (nRet);
//print 1/4 of the printable region
LEADRasterView1.Render (h_dc, 0, 0,
LEADRasterView1.PrinterScaleWidth / 4,
LEADRasterView1.PrinterScaleHeight / 4,
sRet);
LEADRasterView1.PrintEnd (h_dc);
end;


PrintNewPage Example for Delphi

var
HeightFactor, WidthFactor, HeightAllowed, WidthAllowed: Single;
ControlWidth, ControlHeight: Single;
MyPrinter: longint;
nRet: Integer;
sRet: Smallint;
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;
begin

RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;

//change this to a file on your system
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\babe.cmp', 0, 1, 1);

//note, there will be no samples for other platforms, this function is not necessary in other languages):
//Set the variables used for preserving the aspect ratio.
HeightFactor:= LEADRasterView1.Raster.BitmapHeight;
WidthFactor:= LEADRasterView1.Raster.BitmapWidth;
//Allow a maximum of 3x3 inches on a 300dpi printer
HeightAllowed:= 900;
WidthAllowed:= 900;
//Print the LEAD control, preserving the aspect ratio.
//Check to see if was using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed ) then
begin
ControlWidth:= WidthAllowed;
ControlHeight:= (ControlWidth * HeightFactor) / WidthFactor;
end
else
begin
ControlHeight:= HeightAllowed;
ControlWidth:= (ControlHeight * WidthFactor) / HeightFactor;
end;
//start the print job
MyPrinter:= LEADRasterView1.PrintStart (nRet);
LEADRasterView1.Render (MyPrinter, 0, 0, ControlWidth, ControlHeight, sRet);
//flip the image
RasterProc.Flip (LEADRasterView1.Raster);
//start a new page
LEADRasterView1.PrintNewPage (MyPrinter);
//print the flipped image
LEADRasterView1.Render (MyPrinter, 0, 0, ControlWidth, ControlHeight, sRet);
//end the print job
LEADRasterView1.PrintEnd (MyPrinter);
end;


ProgressivePasses Example for Delphi

This example shows how to save and load a progressive file.

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
//Save the current image as a progressive JPEG file.
RasterIO.ProgressivePasses:= 8;
RasterIO.Save (LEADRasterView1.Raster, 'c:\temp\TMP.jpg',
FILE_JFIF, 24,
200, SAVE_OVERWRITE);
//Set properties to show progressive paints when we load.
LEADRasterView1.PaintWhileLoad:= True;
//Load the file we just saved.
RasterIO.ProgressivePasses:= PROGRESSIVEPASSES_WHEN_MEANINGFUL;
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\TMP.jpg', 0, 0, 1);
end;


RasterizeViewMode Example for Delphi

// This example will set current viewport mode to L2D_USE_WIDTH_AND_HEIGHT,
// sets the current viewport size to 400*400 pixels and then loads a DXF file
var
RasterIO: LEADRasterIO;
begin
LEADRasterView1.Raster.UnlockSupport ( L_SUPPORT_VECTOR_DXF, 'TestKey' ) ;
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
//Set viewport mode to L2D_USE_WIDTH_HEIGHT
RasterIO.RasterizeViewMode:= L2D_USE_WIDTH_HEIGHT;
//Set viewport size to 400*400 pixels
RasterIO.RasterizeViewportWidth:= 400;
RasterIO.RasterizeViewportHeight:= 400;
//Load a DXF file
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\Test.dxf', 0, 0, 1);
end;


RawLoad Example for Delphi

//This example loads RAW data into a LEAD control
//Raw data parameters are set in the LoadInfo event, which gets called
//when the file format is FILE_RAW, or any unrecognized file format
//The LoadInfo event obtains information through global variables

var
RasterIO: LEADRasterIO;
//Global variables used in the LoadInfo event
nWidth: Integer; //width of image
nHeight: Integer; //height of image
nBitsPerPixel: Integer; // bits per pixel of image--if palettized, a gray palette is generated
nViewPerspective: Integer; //view perspective of raw data (TOP_LEFT, BOTTOM_LEFT, etc)
bOrderBGR: boolean; //TRUE if order BGR, FALSE if order RGB
nOffset: Longint; //offset into file where raw data begins
bPadding: Boolean; //TRUE if each line of data is padded to four bytes
bReverseBits: Boolean; //TRUE if the bits of each byte are reversed

Procedure TForm1.LoadRawData(szFileName: String);
var
nRet: Integer;
begin

//Fill in the values of the global variables
//The global variables will get access in the LoadInfo event
nWidth:= 294;
nHeight:= 415;
nBitsPerPixel := 24;
nViewPerspective := BOTTOM_LEFT;
bOrderBGR := True;
nOffset := 100;
bPadding := True;
bReverseBits := True;

RasterIO := CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
LEADEventSink1.Connect (RasterIO, _LEADRasterIOEvents);
nRet := RasterIO.Load (LEADRasterView1.Raster, szFileName, nBitsPerPixel, 0, 1);
if (nRet = 0) then
ShowMessage ('SUCCESS file load: ' + szFileName)
else
ShowMessage ('FAILED--file load: ' + szFileName);
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
nColors: Integer;
i: Longint;
nGray: Longint;
begin
case (DispID) of
LEADRASTERIOEVENTS_LOADINFO:
begin

RasterIO.LoadInfoFormat := FILE_RAW;
RasterIO.LoadInfoWidth := nWidth;
RasterIO.LoadInfoHeight := nHeight;
RasterIO.LoadInfoBits := nBitsPerPixel;
RasterIO.LoadInfoXRes := 150;
RasterIO.LoadInfoYRes := 150;
RasterIO.LoadInfoOffset := nOffset;
RasterIO.LoadInfoFlags := 0;

if (bPadding) then
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_PAD4;

if (bOrderBGR = False) then
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_ORDERRGB;

if (bReverseBits) then
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_LSB;

Case (nViewPerspective) of
TOP_LEFT:
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT;

BOTTOM_LEFT:
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_REVERSE;

TOP_RIGHT: //BOTTOM_LEFT180
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT180;

BOTTOM_RIGHT: //TOP_LEFT180
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT180;

RIGHT_TOP: //TOP_LEFT90
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT90;

LEFT_BOTTOM: //TOP_LEFT270
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_TOPLEFT270;

LEFT_TOP: //BOTTOM_LEFT90
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT90;

RIGHT_BOTTOM: //BOTTOM_LEFT270
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_BOTTOMLEFT270;
end;

//if image is palettized create a grayscale palette
if (nBitsPerPixel <= 8) then
begin
nColors := Trunc(Power(2, nBitsPerPixel));
RasterIO.LoadInfoFlags := RasterIO.LoadInfoFlags Or LOADINFO_PALETTE;

for i := 0 To nColors - 1 do
begin
nGray := Trunc((i * 256) / nColors);
RasterIO.IOPalette [i] := RGB(nGray, nGray, nGray)
end;
end;
end;
end;
end;


RawSave Example for Delphi

//This example saves a LEAD bitmap as RAW data starting at offset uOffset
//The data is padded so that each line of bytes is evenly divides 4
//The bits in each byte are reversed before saving
//The Bits per pixel of the raw data is the same as the bits per pixel of pBitmap
//If pBitmap is a palettized image, the palette is not saved--only the raw data

// This example considers that you added this methos to the Form’s private section.

Procedure TForm1.SaveRawData (szFileName: String; uOffset: Longint);
var
nRet: Integer;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.SaveLSB:= True;
RasterIO.SavePad4:= True;
nRet:= RasterIO.SaveOffset (LEADRasterView1.Raster, szFileName, uOffset, FILE_RAW, 0, 0, 0);
if (nRet = 0) then
ShowMessage ('SUCCESS file save: ' + szFileName + ' Size Written: ' + IntToStr(RasterIO.FileSizeWritten))
else
ShowMessage ('FAILED--file save: ' + szFileName);
end;


ReadLoadResolutions Example for Delphi

This example shows how to use the methods and properties for FlashPix files.

var
TempStr, InfoStr: String; //For composing message strings
i: Integer; //Loop counter
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) As LEADRasterIO;
//Initialize the display
LEADRasterView1.AutoScroll := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;
RasterIO.GetFileInfo ( LEADRasterView1.Raster, 'v:\images\image5.fpx', 0, 0 ) ;
//Update information about the available resolutions.
RasterIO.ReadLoadResolutions ( 'v:\images\image5.fpx' ) ;
//Display a message box that shows the available sizes.
InfoStr := 'Available dimensions:' + Chr(13);
for i := 0 to RasterIO.LoadResolutionCount - 1 do
begin
TempStr:= IntToStr(Trunc(RasterIO.LoadResolutionWidth [i])) + ' X ' +
IntToStr(Trunc(RasterIO.LoadResolutionWidth[i])) + Chr(13);
InfoStr:= InfoStr + TempStr;
end;
ShowMessage (InfoStr);
// Set the size to load, the smallest size in this case.
RasterIO.SetLoadResolution (LEADRasterView1.Raster,
RasterIO.InfoFormat,
RasterIO.LoadResolutionWidth [0],
RasterIO.LoadResolutionHeight [0]);
//Get the dimensions that we just set and display them.
RasterIO.GetLoadResolution (RasterIO.InfoFormat);
InfoStr := 'Size that will be loaded:' + Chr(13) + Chr(13);
TempStr := IntToStr(Trunc(RasterIO.LoadResolutionWidth[0])) +
' X ' + IntToStr (Trunc (RasterIO.LoadResolutionWidth [0])) + Chr (13);
InfoStr := InfoStr + TempStr;
ShowMessage (InfoStr);
//Load the bitmap, keeping the bits per pixel of the file.
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\image5.fpx', 0, 0, 1);
end;


ReadyState Example for Delphi

This example shows how to use the ReadyState property to test whether an asynchronous load is in progress.

Note:

This is not a complete example for handling events; some of the steps have been omitted. For a complete example of how to handle events, refer to the example Updating a Gauge and Detecting a User Interrupt.

if (RasterIO.ReadyState = RASTER_READYSTATE_LOADING) then
ShowMessage ('Still loading the image');


RefBitmap example for Delphi

//This example demonstrates the RefBitmap property
var
MyRaster: LEADRaster;
MyRasterIO: LEADRasterIO;
begin
MyRaster:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
MyRasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;

//Load an image into MyRaster object
MyRasterIO.Load (MyRaster, 'v:\images\Test.bmp', 0, 0, 1);
ShowMessage ('MyRaster.Bitmap should be non-zero: ' + IntToStr(MyRaster.Bitmap));

//Have the LEADRasterView1 control "steal" the MyRaster bitmap
LEADRasterView1.Raster.RefBitmap:= True;
LEADRasterView1.Raster.Bitmap:= MyRaster.Bitmap;

//The MyRaster Bitmap has been invalidated
ShowMessage ('MyRaster.Bitmap should be zero: ' + IntToStr(MyRaster.Bitmap));
end;


RefBitmapList example for Delphi

//tell LEADRasterView2 to "steal" the bitmap list from LEADRasterView1
LEADRasterView2.Raster.RefBitmap List:= True;
//move the bitmap list from LEADRasterView1 to LEADRasterView2
LEADRasterView2.Raster.BitmapList:= LEADRasterView1.Raster.BitmapList;
//restore the default value for RefBitmapList
LEADRasterView2.Raster.RefBitmapList:= False;
//for safety, let LEADrasterview1 know that its list has been emptied
LEADRasterView1.Raster.BitmapList:= 0;


RemapHue example for Delphi

// This example changes all green hues (and hues near green) to the hue of crNewColor
Function Increment (x: Integer): Integer;
begin
Result:= (x + 1) Mod 256;
End;

Function Decrement(x: Integer): Integer;
begin
Result:= (x + 255) Mod 256;
End;

Function Add(x: Integer; y: Integer): Integer;
begin
Result:= (x + y) Mod 256;
End;

var
i: Integer;
nHueGreen: Integer;
nHueNewColor: Integer;
nHueChange: Integer;
crNewColor: OLE_COLOR;
iCount: Integer;
RasterProc: LEADRasterProcess;

begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
for i:= 0 to 255 do
begin
RasterProc.MaskTable [i]:= 0;
RasterProc.HTable [i]:= I;
end;

//Get the hue for green
nHueGreen:= RasterProc.HSV_HfromRGB (RGB(0, 255, 0));

//Obtain new hue (crNewColor can be any color)
crNewColor:= RGB(255, 255, 0);
nHueNewColor:= RasterProc.HSV_HfromRGB(crNewColor);
nHueChange:= nHueNewColor - nHueGreen;

if (nHueChange < 0) then
nHueChange:= nHueChange + 256;

//Set values in uHueTable, uMaskTable
RasterProc.HTable [nHueGreen]:= Add(RasterProc.HTable[nHueGreen], nHueChange);
RasterProc.MaskTable[nHueGreen]:= 1;

//set the hues near green (+/- 10)
iCount:= 0;
i:= Increment(nHueGreen);
While iCount < 10 do
begin
RasterProc.HTable[i]:= Add(RasterProc.HTable[i], nHueChange);
RasterProc.MaskTable [i]:= 1;
i:= Increment(i);
iCount:= iCount + 1;
end;

iCount:= 0;
i:= Decrement(nHueGreen);
While iCount < 10 do
begin
RasterProc.HTable [i]:= Add(RasterProc.HTable[i], nHueChange);
RasterProc.MaskTable[i]:= 1;
i:= Decrement(i);
iCount:= iCount + 1;
end;

RasterProc.RemapHue (LEADRasterView1.Raster, True, True, False, False);
end;


Resize event example for Delphi

This example demonstates the Resize event.

procedure TForm1.LEADRasterView1Resize (Sender: TObject);
begin
//Before using this example you must add a text box to your form.
//Then, you can exercise this example by coding a command button that
//changes the width and height of the LEADRasterView1 control
Edit1.Text:= 'Control size: ' + IntToStr(LEADRasterView1.Width)
+ ' x ' + IntToStr(LEADRasterView1.Height);
Edit1.Refresh( ) ;
end;


RGBfromHSV example for Delphi

//Takes an HSV, displays the HSV components, and displays the RGB components
Procedure HSVtoRGB(nH: Smallint; nS: Smallint; nV: Smallint);
var
cr: OLE_COLOR;
red: Byte;
green: Byte;
blue: Byte;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
cr:= RasterProc.RGBfromHSV (nH, nS, nV);
red:= GetRValue(cr);
green:=GetGValue(cr);
blue:= GetBValue(cr);
ShowMessage ('HSV (' + IntToStr(nH) + ',' + IntToStr(nS) + ',' + IntToStr(nV) + ') is RGB(' + IntToStr(red) + ',' + IntToStr(green) + ',' + IntToStr(blue) + ')');
end;


RgnChange example for Delphi

The following code for the RasterView RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

procedure TForm1.LEADRasterView1RgnChange (Sender: TObject);
var
MyText: String;
begin
MyText:= 'Number of pixels in region: ';
MyText:= MyText + IntToStr(LEADRasterView1.Raster.GetRgnArea);
ShowMessage (MyText);
end;


RgnFrameColor example for Delphi

LEADRasterView1.RgnFrameColor:= RGB(0, 0, 255);
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR;
LEADRasterView1.Raster.SetRgnRect (10, 10, 200, 200, L_RGN_SET);


Rotate example for Delphi

This example rotates the bitmap 45 degrees and redisplays the image. It resizes the bitmap to accommodate the rotation and uses blue as the fill color.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Rotate (LEADRasterView1.Raster, 4500, ROTATE_RESIZE, RGB(0, 0, 255));
LEADRasterView1.AutoSetRects:= True ;//Make sure the display rectangles are adjusted
LEADRasterView1.ForceRepaint (sRet);
end;


Saturation example for Delphi

This example increases the saturation of colors in the bitmap and redisplays the image.

var
RasterProc: LEADRasterProcess;
sRet: Smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Saturation (LEADRasterView1.Raster, 1000);
LEADRasterView1.ForceRepaint (sRet);
end;


Save example for Delphi

This example saves the image as a BMP file, loads the new file, and redisplays the bitmap.

var
RasterIO: LEADRasterIO;
sRet: Smallint;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;

Screen.Cursor:= crHourglass;
RasterIO.Save (LEADRasterView1.Raster, 'c:\temp\tmp.bmp',
FILE_BMP, 8, 1, SAVE_OVERWRITE);
RasterIO.Load (LEADRasterView1.Raster, 'c:\temp\tmp.bmp', 0, 0, 1);
LEADRasterView1.ForceRepaint (sRet);
Screen.Cursor:= crDefault;
end;


SaveArray example for Delphi

var
RasterVarBuffer: LEADRasterVariant;
lSize: Longint;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.Load (LEADRasterView1.Raster, 'c:\windows\temp\saddam.bmp', 0, 1, 1 );

RasterVarBuffer:= RasterIO.SaveArray (LEADRasterView1.Raster, FILE_BMP, 0, 2);
lSize:= RasterIO.ArraySize (RasterVarBuffer);
//get some info on the memory array
RasterIO.GetArrayInfo (LEADRasterView1.Raster, RasterVarBuffer, 1, lSize);
ShowMessage ( 'Format = ' + IntToStr(RasterIO.InfoFormat));
end;


SaveIFD example for Delphi

// This example will add 100 pages to a file faster by continuously using the IFD of the last page
var
Page: Integer;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
// Save page 1, to make sure the file exists
RasterIO.Save (LEADRasterView1.Raster, 'c:\temp\test.tif', FILE_TIF, 1, 0, SAVE_APPEND);
for Page:= 2 to 100 do
begin
//get the IFD of the last page
RasterIO.GetFileInfo (LEADRasterView1.Raster, 'c:\temp\test.tif', 100000, 0);
RasterIO.SaveIFD:= RasterIO.InfoIFD;
RasterIO.Save (LEADRasterView1.Raster,
'c:\temp\test.tif', FILE_TIF,
1, 0, SAVE_APPEND);
end;
// reset the SaveIFD property so the other Save calls will work properly
RasterIO.SaveIFD := 0;
end;


SaveInterlaced example for Delphi

//This example saves the current image as an interlaced GIF file, then loads the saved //image with a paint-while-load effect that shows the interlaced behavior.
var
szFile: String;
MyRasterIO: LEADRasterIO;
begin
MyRasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;

szFile:= 'c:\temp\test.gif';

//Save the current image as an interlaced GIF file.
MyRasterIO.SaveInterlaced:= True;
MyRasterIO.Save (LEADRasterView1.Raster, szFile, FILE_GIF, 8, 1, SAVE_OVERWRITE);

//Clear the bitmap so that we can see the paint-while-load effect.
LEADRasterView1.Raster.Bitmap:= 0;

//Paint the image while loading, showing that it is interlaced.
LEADRasterView1.PaintWhileLoad:= True;
MyRasterIO.Load (LEADRasterView1.Raster, szFile, 0, 0, 1);
end;


SaveLSB example for Delphi

var
RasterIO: LEADRasterIO;
RasterProc: LEADRasterProcess;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
RasterProc:= CreateComObject(CLASS_LEADRasterProcess)as LEADRasterProcess;
//This example saves a bitmap compatible with the requirements
//of the TIFF Class F format
//make sure we are using pixels
LEADRasterView1.ScaleMode:= 3;
RasterIO.SaveLSB:= True;
RasterIO.SavePageNumberTag:= True;
LEADRasterView1.Raster.BitmapXRes:= 204;
LEADRasterView1.Raster.BitmapYRes:= 196;
//scale the bitmap (preserving the aspect ratio) to have a width of 1728 pixels
RasterProc.Size (LEADRasterView1.Raster, 1728,
LEADRasterView1.Raster.BitmapHeight * 1728 /
LEADRasterView1.Raster.BitmapWidth, 0);
RasterIO.Save (LEADRasterView1.Raster, 'd:\pictures\lsb.tif',
FILE_CCITT_GROUP3_1DIM, 1, 0, SAVE_OVERWRITE);
end;


SaveMemory example for Delphi

This example uses SaveMemory to save a bitmap to a memory-resident file, uses GetMemoryInfo to examine the file size; then uses WIN32 API calls to save the file to disk and free the memory.

var
RasterIO: LEADRasterIO;
hf: longint;
hMem: longint;
iSize: longint;
lpMem: Pointer;
cMsg: string;

begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
hMem:= 0;
iSize:= 0;

if (RasterIO.SaveMemory (LEADRasterView1.Raster, hMem, FILE_CMP, 24, 2, 0, iSize) <> 0) then
begin
ShowMessage('Error calling SaveMemory');
Exit;
end;
if (RasterIO.GetMemoryInfo (LEADRasterView1.Raster, hMem, 0, iSize) <> 0) then
begin
GlobalFree (hMem);
Exit;
end;
//Ask for a confirmation to save this file
cMsg:= 'File info:' + Chr(13);
cMsg:= cMsg + IntToStr(Trunc(RasterIO.InfoWidth)) + ' x ' + IntToStr(Trunc(RasterIO.InfoHeight));
cMsg:= cMsg + ' x ' + IntToStr(RasterIO.InfoBits) + ' BPP' + Chr(13);
cMsg:= cMsg + 'Size in memory: ' + IntToStr(RasterIO.InfoSizeMem) + Chr(13);
cMsg:= cMsg + 'Size on disk : ' + IntToStr(RasterIO.InfoSizeDisk);
if (MessageBox(Handle, PChar(cMsg),'Write this file on disk ', MB_YESNO) = IDNO ) then
begin
GlobalFree (hMem);
Exit;
end;
lpMem:= GlobalLock(hMem);
if (lpMem = Nil) then
begin
GlobalFree (hMem);
ShowMessage('Error calling GlobalLock');
Exit;
end;
hf := FileCreate('d:\pictures\savemem.cmp');
if (hf = -1) then
begin
GlobalUnlock (hMem);
GlobalFree (hMem);
ShowMessage ('Error calling OpenFile');
Exit;
end;
if FileWrite(hf, lpMem^, iSize) <> iSize Then
MessageDlg ('Error calling FileWrite', mtError, [mbOK], 0)
else
MessageDlg ('The file was saved successfully on disk.', mtInformation, [mbOK], 0);

FileClose (hf);
GlobalUnlock (hMem);
GlobalFree (hMem);
end;


SavePage example for Delphi

var
RasterIO: LEADRasterIO;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
//replace page 1 from TEST.TIF
RasterIO.SavePage:= 1;
RasterIO.Save (LEADRasterView1.Raster, 'd:\pictures\TEST.TIF',
FILE_TIF, 8, 0, SAVE_REPLACE);
end;


SaveResolutionCount example for Delphi

var
i: Integer;
RasterIO: LEADRasterIO;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
//assume that our bitmap is 800 x 600
//save 3 resolutions
RasterIO.SaveResolutionCount:= 3;

RasterIO.SaveResolutionWidth [0]:= 800;
RasterIO.SaveResolutionHeight [0]:= 600;
RasterIO.SaveResolutionWidth[1]:= 400;
RasterIO.SaveResolutionHeight[1]:= 300;
RasterIO.SaveResolutionWidth[2]:= 200;
RasterIO.SaveResolutionHeight[2]:= 150;

//get the SaveResolution info
ShowMessage ('SaveResolutionCount = ' + IntToStr(RasterIO.SaveResolutionCount));

for i:= 0 to RasterIO.SaveResolutionCount- 1 do
begin
ShowMessage( 'SaveResolution(' + IntToStr(i) + ') = ' +
IntToStr(Trunc(RasterIO.SaveResolutionWidth[i])) + ' x ' +
IntToStr(Trunc(RasterIO.SaveResolutionHeight[i])));
end;
end;


SaveWithStamp example for Delphi

This example saves the image in a JPEG file that includes a thumbnail (stamp) image. It then loads the thumbnail from the new file.

var
sRet: Smallint;
RasterIO: LEADRasterIO;
begin
RasterIO := CreateComObject (CLASS_LEADRasterIO) as ILEADRasterIO;
LEADRasterView1.ScaleMode:= 3; // Use pixels for sizing the thumbnail
RasterIO.SaveWithStamp (LEADRasterView1.Raster, 'd:\Pictures\stamp.jpg',
FILE_JFIF, 24, 30, 150, 100, 24);
RasterIO.LoadStamp (LEADRasterView1.Raster, 'd:\pictures\stamp.jpg');
LEADRasterView1.ForceRepaint (sRet);
end;


Scroll event example for Delphi

This example demonstrates the Scroll event.

procedure TForm1.LEADRasterView1Scroll (Sender: TObject);
begin
//Add a TextBox control to your form and use it for this test
Edit1.Text := 'Image origin: ' + IntToStr(Trunc(LEADRasterView1.DstLeft))
+ ', ' + IntToStr(Trunc(LEADRasterView1.DstTop));
Edit1.Refresh( ) ;

end;


SetRgn... example for Delphi

This example demonstrates the SetRgnEllipse, SetRgnRect, SetRgnRoundRect, and SetRgnPolygon methods by simulating client area coordinates. Normally, you would get the coordinates interactively from mouse events and would use Windows GDI functions to outline the shape of each region before it is created.

To create the polygonal region, this example uses the PolygonSize, PolygonX, and PolygonY properties.

Also, to demonstrate the SetRgnColor method, it uses the Fill method to fill the region with a solid color, and then uses the fill color to create a new region.

Const
//Arrays for polygon points
xPoint: Array[1..8]of integer = (0, -1, 2, 1, 1, 2, -1, -2);
yPoint: Array[1..8]of integer = (0, -1, -1, 1, -1, 1, 1, 1);
var
ZoomFactorX: Single ;//Used for translating positioning information
ZoomFactorY: Single ;//Used for translating positioning information
OffsetX, OffsetY, CurrentX, CurrentY: Single;//To simulate mouse coordinates
SimLeft, SimTop, SimWidth, SimHeight: Single;//To simulate mouse coordinates
LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, eW, eH: Single;//For bitmap coordinates
i: Integer; //Loop counter
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
//Initialize the variables that we will manipulate to simulate mouse coordinates.
LEADRasterView1.ScaleMode:= 3;
OffsetX := LEADRasterView1.Raster.ScaleWidth / 15;
OffsetY := LEADRasterView1.Raster.ScaleHeight / 15;
CurrentX := OffsetX;
CurrentY := OffsetY;
//Set the zoom factors.
ZoomFactorX := LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth;
ZoomFactorY := LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight;
//Start by simulating the drawing of a rectangle.
SimLeft := CurrentX;
SimTop := CurrentY;
SimWidth := OffsetX * 2;
SimHeight := OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft := (SimLeft / ZoomFactorX) -
(LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
LBRgnTop := (SimTop / ZoomFactorY) -
(LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
LBRgnWidth := SimWidth / ZoomFactorX;
LBRgnHeight := SimHeight / ZoomFactorY;
//Create the rectangular region, outline it, and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnRect (LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_SET);
LEADRasterView1.RgnFrameType := RGNFRAME_STATIC;
ShowMessage ('Here is the rectangular region');
//Move the current mouse position so that we overlap the existing region.
CurrentX := CurrentX + OffsetX;
CurrentY := CurrentY + OffsetY;
//Next, simulate the drawing of an ellipse.
SimLeft := CurrentX;
SimTop := CurrentY;
SimWidth := OffsetX * 3;
SimHeight := OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft := (SimLeft / ZoomFactorX) -
(LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
LBRgnTop := (SimTop / ZoomFactorY) -
(LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
LBRgnWidth := SimWidth / ZoomFactorX;
LBRgnHeight := SimHeight / ZoomFactorY;
//Add the elliptical region, using a Boolean OR,
//and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnEllipse (LBRgnLeft, LBRgnTop, LBRgnWidth, LBRgnHeight, L_RGN_OR);
LEADRasterView1.RgnFrameType := RGNFRAME_STATIC;
ShowMessage ('Here is the added ellipse, with a Boolean OR');
//Move the current mouse position so that we overlap the existing region.
CurrentX:= CurrentX + OffsetX;
CurrentY:= CurrentY + OffsetY;
//Next, simulate the drawing of a rounded rectangle.
SimLeft:= CurrentX;
SimTop:= CurrentY;
SimWidth:= OffsetX * 3;
SimHeight:= OffsetY * 2;
//Translate the simulated client coordinates to bitmap coordinates.
LBRgnLeft:= (SimLeft / ZoomFactorX)
- (LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
LBRgnTop:= (SimTop / ZoomFactorY)
- (LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
LBRgnWidth:= SimWidth / ZoomFactorX;
LBRgnHeight:= SimHeight / ZoomFactorY;
//Define an ellipse to use for the corners.
eW := LBRgnWidth / 4;
eH := LBRgnHeight / 4;
//Add the rounded rectangular region, using a Boolean exclusive OR,
//and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnRoundRect (LBRgnLeft, LBRgnTop, LBRgnWidth,
LBRgnHeight, eW, eH, L_RGN_XOR);
ShowMessage ('Here is the rounded rectangle, with a Boolean XOR');
//Move the current mouse position so that we overlap the existing region.
CurrentX:= CurrentX + (2 * OffsetX);
CurrentY:= CurrentY + (2 * OffsetY);
//Initialize the polygon size using an arbitrary number.
//This number will be increased dynamically.
LEADRasterView1.Raster.PolygonSize := 5;
//Fill in the array for the polygon. This simulates a user's mouse clicks.
for i:= 0 to 7 do
begin
CurrentX:= CurrentX + (xPoint[i+1] * OffsetX);
CurrentY:= CurrentY + (yPoint[i+1] * OffsetY);
LEADRasterView1.Raster.PolygonX [i]:= (CurrentX / ZoomFactorX)
- (LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
LEADRasterView1.Raster.PolygonY [i]:= (CurrentY / ZoomFactorY)
- (LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
if i + 1 = LEADRasterView1.Raster.PolygonSize then
LEADRasterView1.Raster.PolygonSize:= LEADRasterView1.Raster.PolygonSize + 5;
end;
//Adjust the polygon size to the actual number of points.
LEADRasterView1.Raster.PolygonSize := 8;
//Add the polygonal region, using a Boolean OR,
//and display a message so that we can see what happened.
LEADRasterView1.Raster.SetRgnPolygon (L_POLY_WINDING, L_RGN_OR);
ShowMessage ('Here is the added polygon, with a Boolean OR');
//Fill the resulting polygon with red, and display a message.
RasterProc.Fill (LEADRasterView1.Raster, RGB(255, 0, 0));
LEADRasterView1.RgnFrameType:= RGNFRAME_NONE;
LEADRasterView1.ForceRepaint (sRet);
ShowMessage ('Using SetRgnColor and L_RGN_SETNOT, all else will become blue.');
//Clean up memory
LEADRasterView1.Raster.FreeRgn ();
//Do the final region.
LEADRasterView1.Raster.SetRgnColor (RGB(255, 0, 0), L_RGN_SETNOT);
RasterProc.Fill (LEADRasterView1.Raster, RGB(0, 0, 255));
LEADRasterView1.ForceRepaint(sRet);
//Clean up memory
LEADRasterView1.Raster.FreeRgn();
LEADRasterView1.Raster.PolygonSize:= 0;
end;


SetRgnColorHSVRange example for Delphi

//This example sets a region corresponding to all pure green (Hue = 85)
//and colors near green (+/- 10)
//where Saturation is at least 40 and Value is at least 40
var
H0: Integer;
S0: Integer;
V0: Integer;
H1: Integer;
S1: Integer;
V1: Integer;
begin
H0 := 75;
S0 := 40;
V0 := 40;

H1 := 95;
S1 := 255;
V1 := 255;
LEADRasterView1.Raster.SetRgnColorHSVRange (H0, S0, V0, H1, S1, V1, L_RGN_SET);
LEADRasterView1.RgnFrameType := RGNFRAME_ANIMATED;
end;


SetRgnColorRGBRange example for Delphi

//This example sets a region corresponding to all colors that
//have an rgb that includes red but no green and no blue
var
rgbLo: OLE_COLOR;
rgbHi: OLE_COLOR;
begin
rgbLo:= RGB(1, 0, 0);
rgbHi:= RGB(255, 0, 0);
LEADRasterView1.Raster.SetRgnColorRGBRange (rgbLo, rgbHi, L_RGN_SET);
LEADRasterView1.RgnFrameType := RGNFRAME_ANIMATED;
end;


SetRgnMagicWand example for Delphi

procedure TForm1.LEADRasterView1MouseUp (Sender: TObject; Button,
Shift: Smallint; x, y: Single);
begin
LEADRasterView1.Raster.SetRgnMagicWand (x, y, 10, L_RGN_SET);
LEADRasterView1.RgnFrameType:= RGNFRAME_ANIMATED;
end;


SetSrcClipRect example for Delphi

This example crops the image by reducing the source clipping area and repaints the image.

var
sRet: Smallint;
NewLeft, NewTop, NewWidth, NewHeight: Single;
begin

NewLeft := LEADRasterView1.SrcClipLeft + (LEADRasterView1.SrcClipWidth * 0.1);
NewTop := LEADRasterView1.SrcClipTop + (LEADRasterView1.SrcClipHeight * 0.1);
NewWidth := LEADRasterView1.SrcClipWidth * 0.8;
NewHeight := LEADRasterView1.SrcClipHeight * 0.8;
if ((NewWidth > 1) AND (NewHeight >1)) then
LEADRasterView1.SetSrcClipRect (NewLeft, NewTop, NewWidth, NewHeight, sRet);
LEADRasterView1.ForceRepaint (sRet);
end;


SetSrcRect example for Delphi

This example zooms in on the image by reducing the source rectangle and repaints the image.

var
sRet: Smallint;
NewLeft, NewTop, NewWidth, NewHeight: Single;
begin

NewLeft:= LEADRasterView1.SrcLeft + (LEADRasterView1.SrcWidth * 0.1);
NewTop:= LEADRasterView1.SrcTop + (LEADRasterView1.SrcHeight * 0.1);
NewWidth := LEADRasterView1.SrcWidth * 0.8;
NewHeight := LEADRasterView1.SrcHeight * 0.8;
if (NewWidth > 1) AND (NewHeight >1) then
LEADRasterView1.SetSrcRect (NewLeft, NewTop, NewWidth, NewHeight, sRet);
LEADRasterView1.ForceRepaint (sRet);
end;


SetTag example for Delphi

var
RasterIO: LEADRasterIO;

procedure TForm1.Button1Click(Sender: TObject);
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
end;

procedure TForm1.SetAndReadClick(Sender: TObject);
var
RasterVar: LEADRasterVariant;
begin
RasterVar:= coLEADRasterVariant.Create ( );
// initialize the array
RasterVar.ItemCount:= 4;
RasterVar.Type_:= VALUE_LONG;
RasterVar.LongItemValue[2]:= 2;
RasterVar.LongItemValue[3]:= 3;
RasterVar.LongItemValue[4]:= 127;
RasterIO.SetTag (32768, TAG_LONG, 0, RasterVar);
// RasterVar.Type_:= VALUE_STRING;
// RasterVar.StringValue:= 'My text string';
// RasterIO.SetTag (32768, TAG_ASCII, 0, RasterVar);

// Write the tag
RasterIO.WriteTag ('c:\ test.tif', 1);
ReadTag.Click ();
end;

procedure TForm1.ReadTagClick(Sender: TObject);
begin
// read the tag back
RasterIO.ReadTag ('c:\ test.tif', 1, 32768);
GetAndDisplayTag(0);
end;

//This sub will get a certain tag and display it according to the tag type.
Procedure TForm1.GetAndDisplayTag (lTag: Longint);
var
RasterVar: LEADRasterVariant;
Msg: String;
i: Longint;
count: Longint;

begin
RasterVar:= coLEADRasterVariant.Create ( );

RasterVar:= RasterIO.GetTagData (lTag);
count:= RasterIO.GetTagCount (lTag);

Msg:= 'Type = ' + IntToStr(RasterIO.GetTagType (lTag));
Msg:= Msg + Chr(10) + Chr(13) + 'count = ' + IntToStr(count);
if (RasterIO.GetTagType(lTag) = TAG_ASCII) then
Msg:= Msg + Chr(10) + Chr(13) + 'Data = ' + RasterVar.StringValue
else
begin
if ((RasterIO.GetTagType(lTag) = TAG_RATIONAL) Or
(RasterIO.GetTagType(lTag) = TAG_SRATIONAL)) then
begin
for i:= 1 to count do
begin
Msg:= Msg + Chr(10) + Chr(13) + 'Data(' + IntToStr(i) + ') = ' +
IntToStr(RasterVar.ShortItemValue[i * 2]) + '/' + IntToStr(RasterVar.ShortItemValue[i * 2 + 1]);
end;
end
else
for i:= 0 to count - 1 do
begin
Msg:= Msg + Chr(10) + Chr(13) + 'Data(' + IntToStr(i) + ') = ' +
IntToStr(RasterVar.ShortItemValue[i]);
end;
end;
ShowMessage (Msg);
end;


Sharpen example for Delphi

This example increases the sharpness of the bitmap and redisplays the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Sharpen (LEADRasterView1.Raster, 100);
LEADRasterView1.ForceRepaint (sRet);
end;


Shear example for Delphi

This example shears the bitmap 5 degrees horizontally and redisplays the image. It uses blue as the fill color.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Shear (LEADRasterView1.Raster, 500, True, RGB(0, 0, 255));
LEADRasterView1.ForceRepaint (sRet);
end;


Smooth example for Delphi

var
RasterProc: LEADRasterProcess;

//Create the RasterProcess object and UnlockSupport
procedure TForm1.Button1Click(Sender: TObject);
begin
//.....
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, ‘TestKey’);
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
//.....

end;
//This example smooths all nicks and bumps up to 2 pixels in length
//Long bumps/nicks are treated before short bumps/nicks
//A LEAD region is updated to show all the changes
//The Smooth Event is used to display information about bump or nick

procedure TForm1.Button2Click(Sender: TObject);
var
nRet: Integer;
begin

RasterProc.EnableDocCleanEvents:= True;
RasterProc.DocCleanSuccess:= SUCCESS_REMOVE;
nRet:= RasterProc.Smooth (LEADRasterView1.Raster, 2, SMOOTH_SINGLE_REGION Or SMOOTH_LEAD_REGION Or SMOOTH_FAVOR_LONG);
if (nRet = 0) then
LEADRasterView1.RgnFrameType:= RGNFRAME_COLOR;
end;

procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
nBumpOrNick: Longint;
fStartRow: Single;
fStartCol: Single;
fLength: Single;
uHorV: Longint;
sOutput : String;
sType : String;
sHorV: String;
szTemp : array[0..255]of Char;
begin
case (DispID) of
LEADRASTERPROCESSEVENTS_SMOOTH:
begin
nBumpOrNick:= OleVariant(Params.rgvarg^[4]);
fStartRow:= OleVariant(Params.rgvarg^[3]);
fStartCol:= OleVariant(Params.rgvarg^[2]);
fLength:= OleVariant(Params.rgvarg^[1]);
uHorV:= OleVariant(Params.rgvarg^[0]);;
if (nBumpOrNick = SMOOTH_BUMP) then
sType:= 'Bump'
else
sType:= 'Nick';

if (uHorV = SMOOTH_HORIZONTAL_ELEMENT) Then
sHorV:= 'Horz.'
else
sHorV:= 'Vert.';

sOutput := Format('Fount %s at %f,%f Length %f - %s',
[sType,fStartRow,fStartCol,fLength,sHorV]);

OutputDebugString(StrPCopy(szTemp,sOutput));
end;
end;
end;


Solarize example for Delphi

This example applies a solarize effect and repaints the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.Solarize (LEADRasterView1.Raster, 100);
LEADRasterView1.ForceRepaint (sRet);
end;


SpatialFilter example for Delphi

This example applies Laplacian line detection and redisplays the image.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.SpatialFilter (LEADRasterView1.Raster, FLT_LAPLACE_1);
LEADRasterView1.ForceRepaint (sRet);
end;


Src... example for Delphi

This example uses the source rectangle properties to zoom in on the image.

var
sRet: Smallint;
begin
//Calculate the values to zoom in by 10 percent and center the image.
if ((LEADRasterView1.SrcWidth > 1) And (LEADRasterView1.SrcHeight > 1)) then
begin
LEADRasterView1.SrcWidth:= LEADRasterView1.SrcWidth * 0.9;
LEADRasterView1.SrcHeight:= LEADRasterView1.SrcHeight * 0.9;
LEADRasterView1.SrcTop:= (LEADRasterView1.Raster.BitmapHeight - LEADRasterView1.SrcHeight) / 2;
LEADRasterView1.SrcLeft:= (LEADRasterView1.Raster.BitmapWidth - LEADRasterView1.SrcWidth) / 2;
end;
//Set the clipping area to the same as the source rectangle
LEADRasterView1.SrcClipWidth:= LEADRasterView1.SrcWidth;
LEADRasterView1.SrcClipHeight:= LEADRasterView1.SrcHeight;
LEADRasterView1.SrcClipTop:= LEADRasterView1.SrcTop;
LEADRasterView1.SrcClipLeft:= LEADRasterView1.SrcLeft;
//Redisplay the image
LEADRasterView1.ForceRepaint (sRet);
end;


STable example for Delphi

//This example remaps the saturation of each color to one half its original
var
i: Integer;
RasterProc: LEADRasterProcess;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;

for i:= 0 to 255 do
RasterProc.STable [i]:= trunc(i / 2);

RasterProc.RemapHue ( LEADRasterView1.Raster, False, False, True, False);
end;


StopMagGlass example for Delphi

var
sRet: Smallint;
begin
LEADRASTERVIEW1.ScaleMode := 3;
//Set MagGlass flags
//In this case the masked colors from the Magnifying Glass area will be all the colors
//except those colors which will be set using the MagGlassMask property
LEADRASTERVIEW1.MagGlassFlags := MAGGLASS_MASK_INVERT;
//set the color mask to mask out all colors except a few shades of black
LEADRASTERVIEW1.MagGlassMaskCount := 3;
LEADRASTERVIEW1.MagGlassMask [0]:= RGB(0, 0, 0);
LEADRASTERVIEW1.MagGlassMask[1]:= RGB(1, 1, 1);
LEADRASTERVIEW1.MagGlassMask[2]:= RGB(2, 2, 2);
LEADRASTERVIEW1.RgnFrameType:= 0;
LEADRASTERVIEW1.StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True, sRet);
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
LEADRASTERVIEW1.StopMagGlass (sRet);
end;


StretchIntensity example for Delphi

This example stretches the intensity and redisplays the image.

var
RasterProc: LEADRasterProcess;
sRet: Smallint;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterProc.StretchIntensity (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;


TextWordWrap example for Delphi

This example wraps text inside the rectangle that is specified for the text object.

var
LeadRasterFxd1: LEADRasterFXD;
sRet: Smallint;
begin
LeadRasterFxd1:= CreateComObject (CLASS_LEADRasterFXD) as LEADRasterFXD;
//Text location
LeadRasterFxd1.TextTop:= 10;
LeadRasterFxd1.TextLeft:= 10;
LeadRasterFxd1.TextWidth:= 150;
LeadRasterFxd1.TextHeight:= 150;
//Text alignment and angle
LeadRasterFxd1.TextAlign:= FXD_TEXTALIGN_LEFT_VCENTER;
LeadRasterFxd1.TextAngle:= 0;
//Enable word wrap
LeadRasterFxd1.TextWordWrap:= True;
LeadRasterFxd1.DrawPersistence:= True;
LeadRasterFxd1.DrawText ( LEADRasterView1.Raster, 0, 'LEADTOOLS 14.5 Supports WordWrap when drawing text.', 0);
LEADRasterView1.ForceRepaint (sRet);
end;


Tool example for Delphi

//This sample displays the current tool, and then changes it to ANN_TOOL_RECT
procedure TForm1.ToolClick(Sender: TObject);
var
strTool: String;
begin

Case (RasterAnnToolbar.Tool) of
ANN_TOOL_SELECT:
strTool:= 'Select';
ANN_TOOL_LINE:
strTool := 'Line';
ANN_TOOL_RECT:
strTool := 'Rect';
ANN_TOOL_ELLIPSE:
strTool := 'Ellipse';
ANN_TOOL_POLYLINE:
strTool := 'Polyline';
ANN_TOOL_POLYGON:
strTool := 'Polygon';
ANN_TOOL_POINTER:
strTool := 'Pointer';
ANN_TOOL_FREEHAND:
strTool := 'Freehand';
ANN_TOOL_HILITE:
strTool := 'hilite';
//...other tools

end;
ShowMessage ('Current tool: ' + strTool);
ShowMessage ('Changing to ANN_TOOL_RECT');
RasterAnnToolbar.Tool:= ANN_TOOL_RECT;
end;


TransitionEffect example for Delphi

This example paints a transition with a 255-step grayscale gradient.

var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
LEADRasterView1.AutoRepaint:= False;
LEADRasterView1.TransitionDelay:= 50;
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1);
LEADRasterView1.TransitionEffect:= EFX_EFFECT_WIPE_RECTANGLE_OUT;
LEADRasterView1.TransitionStyle:= EFX_TRANSITION_GRADIENT;
LEADRasterView1.GradientStyle:= EFX_GRADIENT_ANGLE_TO_LT;
LEADRasterView1.GradientEndColor:= RGB(0, 0, 0);
LEADRasterView1.GradientStartColor:= RGB(255, 255, 255);
LEADRasterView1.GradientSteps:= 255;
LEADRasterView1.AutoRepaint:= True;
end;


Transparent example for Delphi

var
x, y: Integer;
begin
//set the backcolor of the control to BLUE
LEADRasterView1.BackColor:= RGB(0, 0, 255);
ShowMessage ('Pause');
//create a 100x100 image
LEADRasterView1.Raster.CreateBitmap (100, 100, 24);
//fill some of the image with RED, the rest with black
LEADRasterView1.AutoRepaint:= False;
for y := 0 to 99 do
begin
for x:= 0 to 24 do
LEADRasterView1.Raster.Pixel [x, y]:= RGB (255, 0, 0 );
for x:= 25 to 74 do
LEADRasterView1.Raster.Pixel[x, y]:= RGB (0, 255, 0 );
for x:= 75 to 99 do
LEADRasterView1.Raster.Pixel[x, y]:= RGB (0, 0, 255 );
end;
LEADRasterView1.AutoRepaint:= True;
ShowMessage ('Pause');
//now, set Red as the transparent color
LEADRasterView1.Raster.BitmapTransparentColor:= RGB(255, 0, 0);
LEADRasterView1.Raster.BitmapEnableTransparency:= True;
ShowMessage ('Pause');
//now set the control transparent
LEADRasterView1.Transparent:= True;
end;


Trim example for Delphi

This example trims one-tenth from the bitmap and repaints the image.

var
NewLeft, NewTop, NewWidth, NewHeight, ViewWidth, ViewHeight: Single;
RasterProc: LEADRasterProcess;
sRet: Smallint;
begin
RasterProc:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
NewLeft:= LEADRasterView1.Raster.BitmapWidth * 0.1;
NewTop:= LEADRasterView1.Raster.BitmapHeight * 0.1;
NewWidth := LEADRasterView1.Raster.BitmapWidth * 0.8;
NewHeight:= LEADRasterView1.Raster.BitmapHeight * 0.8;
RasterProc.Trim ( LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight );
//Set variables for the position and size of the display rectangle.
ViewWidth:= LEADRasterView1.ScaleWidth;
ViewHeight:= LEADRasterView1.ScaleHeight;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect (0, 0, ViewWidth, ViewHeight, sRet);
LEADRasterView1.SetDstClipRect (0, 0, ViewWidth, ViewHeight, sRet);
LEADRasterView1.ForceRepaint (sRet);
end;


Underlay example for Delphi

This example loads a bitmap into LEADRasterView2 and uses it as a tiled underlay for LEADRasterView1.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;
RasterIO:LEADRasterIO;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.Load (LEADRasterView2.Raster, 'v:\images\ulay2.bmp', 0, 0, 1);
RasterProc.Underlay (LEADRasterView1.Raster, LEADRasterView2.Raster, UNDERLAY_TILE);
LEADRasterView1.ForceRepaint (sRet);
end;


UpdateMagGlassShape example for Delphi

var
sRet: Smallint;
h_Rgn: Longint;
begin
LEADRasterView1.ScaleMode := 3;
LEADRasterView1.RgnFrameType := 0;
LEADRasterView1.StartMagGlass ( 100, 100, 400, RGB(255, 0, 0),
RGB(128,128, 128), True, 1, False,
CROSSHAIR_FINE, True, True, sRet ) ;

h_Rgn := CreateRoundRectRgn(0, 0, 100, 100, 25, 25);
LEADRasterView1.UpdateMagGlassShape (MAGGLASS_SHAPE_HRGN, h_Rgn, sRet);
DeleteObject ( h_Rgn ) ;
//.......some other work..............
//.......some other work..............
//Stop the MagGlass
LEADRasterView1.StopMagGlass (sRet);
end;


UserPalette and BitmapPalette example for Delphi

This example demonstrates the UserPalette and BitmapPalette properties.

var
sRet: Smallint;
RasterProc: LEADRasterProcess;

begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
//Specify a blue and white user palette
RasterProc.UserPalette [0] := RGB(0, 0, 255);
RasterProc.UserPalette[1] := RGB(255, 255, 255);
//Implement the user palette
RasterProc.ColorRes (LEADRasterView1.Raster, 1, CRP_USERPALETTE, CRD_ORDEREDDITHERING, 2);
//Display the blue and white image
LEADRasterView1.ForceRepaint (sRet);
ShowMessage ('This is the user palette. Click OK to change the bitmap palette.');
//Change the bitmap palette to red and white
LEADRasterView1.Raster.BitmapPalette [0] := RGB(255, 0, 0);
LEADRasterView1.Raster.BitmapPalette[1] := RGB(255, 255, 255);
//Display the red and white image
LEADRasterView1.ForceRepaint (sRet);
end;


VTable example for Delphi

//This example remaps the "value" of each color to one half its original
var
i: Integer;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
for i:= 0 to 255 do
RasterProc.VTable [i]:= Trunc(i / 2);
RasterProc.RemapHue ( LEADRasterView1.Raster, False, False, False, True );
end;


WindowLevel example for Delphi

These 3 examples convert a bitmap to 12-bit grayscale and then perform window leveling on the four most significant bits of the image.

Ex1.

var
RasterProc: LEADRasterProcess;
sRet: smallint;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
//WindowLevel for Display
RasterProc.Grayscale (LEADRasterView1.Raster, 12); //Grayscale image to 12-bit
LEADRasterView1.Raster.LevelLowBit:= 8 ;//use 4 most significant bits
LEADRasterView1.Raster.LevelHighBit:= 11;
LEADRasterView1.WindowLevel (sRet);
end;

Ex2.

Var
RasterProc: LEADRasterProcess;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
//WindowLevel image processing
RasterProc.Grayscale ( LEADRasterView1.Raster, 12 ); //Grayscale image to 12-bit
LEADRasterView1.Raster.LevelLowBit:= 8 ;// use 4 most significant bits
LEADRasterView1.Raster.LevelHighBit:= 11 ;
RasterProc.WindowLevel ( LEADRasterView1.Raster ) ;
end;

Ex3.

//This example loads a 16-bit grayscale, fills the window level lookup table,
// and window levels the bitmap for display only
var
i: Longint;
RasterProc: LEADRasterProcess;
RasterIO: LEADRasterIO;
sRet: smallint;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;

//Load a 16-bit grayscale image
RasterIO.Load ( LEADRasterView1.Raster, 'v:\images\image5.dic', 0, 0, 1) ;
LEADRasterView1.AutoRepaint := False;

//Use all bits
LEADRasterView1.Raster.LevelLowBit := 0;
LEADRasterView1.Raster.LevelHighBit := LEADRasterView1.Raster.BitmapBits - 1;

LEADRasterView1.Raster.GetMinMaxBits ( ) ;
LEADRasterView1.Raster.GetMinMaxVal ( ) ;

//Set LUT so the range is from pure blue to pure red
for i := LEADRasterView1.Raster.MinVal to LEADRasterView1.Raster.MaxVal do
LEADRasterView1.Raster.LevelLUT [i]:= RGB((i Mod 256), 0, 256 - (i Mod 256));

//Window level for display only--leave the bitmap data unchanged
LEADRasterView1.WindowLevel (sRet);
LEADRasterView1.ForceRepaint (sRet);
end;


WindowLevelFillLUT example for Delphi

var
RasterProc: LEADRasterProcess;
nHigh: Longint;
nLow: Longint;
begin

RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;

RasterProc.Grayscale (LEADRasterView1.Raster, 16);

LEADRasterView1.Raster.GetMinMaxBits () ;
LEADRasterView1.Raster.GetMinMaxVal () ;

LEADRasterView1.Raster.LevelLowBit := 0;
LEADRasterView1.Raster.LevelHighBit := LEADRasterView1.Raster.BitmapBits - 1;

nLow := LEADRasterView1.Raster.MinBit;
nHigh := Trunc(Power (2, (LEADRasterView1.Raster.MaxBit - LEADRasterView1.Raster.MinBit + 1)));

//allocate the LUT
LEADRasterView1.Raster.LevelLUT [nHigh - 1] := 0;

//fill the entire LUT with gradient from RED to BLUE
LEADRasterView1.Raster.WindowLevelFillLUT (RGB (255, 0, 0), RGB (0, 0, 255),
nLow, nHigh,
LEADRasterView1.Raster.MinBit,
LEADRasterView1.Raster.MaxBit,
LEADRasterView1.Raster.MinVal,
LEADRasterView1.Raster.MaxVal,
True);

//now use it
RasterProc.WindowLevel (LEADRasterView1.Raster);
end;


WMFResolution example for Delphi

//This example displays the default resolution stored in a WMF,
//changes the resolution to 150 dpi, and then loads the image
//Display resolution stored in WMF
//Note that InfoXRes and InfoYRes will return the same value
var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;

RasterIO.GetFileInfo (LEADRasterView1.Raster,
'v:\Images\Test.wmf', 0, 0 ) ;
ShowMessage ('InfoXRes: ' + IntToStr (RasterIO.InfoXRes) + ' InfoYRes: ' +
IntToStr (RasterIO.InfoYRes)) ;
//Set resolution so WMF is loaded at 150 dpi
RasterIO.WMFResolution:= 150;
RasterIO.Load (LEADRasterView1.Raster,
'v:\Images\Test.wmf',
0, 0, 1);
end;


WriteComment example for Delphi

var
RasterIO: LEADRasterIO;
RasterVarStr: LEADRasterVariant;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterVarStr:= CoLEADRasterVariant.Create ( );

RasterVarStr.Type_:= VALUE_STRING;
RasterVarStr.StringValue:= 'Me';
//set the comment

RasterIO.Comment [CMNT_SZARTIST]:= RasterVarStr;
//write the comment into page 1 of TEST.TIF
RasterIO.WriteComment ( 'd:\pictures\TEST.TIF', 1 ) ;
//read the comment and display it
RasterVarStr:= RasterIO.ReadComment (LEADRasterView1.Raster,
'd:\pictures\TEST.TIF', 1, CMNT_SZARTIST);
ShowMessage ( RasterVarStr.StringValue );
end;


ZoomIn example for Delphi

This example calls ZoomIn () method to zoom in on a captured image.

Var
sRet: smallint;
LEADRasterView1.ZoomIn (sRet);


ZoomInDone example for Delphi

This example triggers the ZoomInDone event and displays a message that the ZoomIn image has been captured.

procedure TForm1.LEADRasterView1ZoomInDone (Sender: TObject; x, y: Integer);
begin
ShowMessage ( 'ZoomIn Captured: ' + IntToStr (x) + ',' + IntToStr(y));
end;


Tutorial for Delphi 6.0 Programmers

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

LEADTOOLS COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Creating, Viewing, and Merging Color Separations

Updating a Gauge and Detecting a User Interrupt

Using a PanWindow

Using the Magnifying Glass

Print a Real Image Size in Inches

Combining Images with Regions


Loading and Displaying an Image (Delphi 6.0)

Take the following steps to start a project and to add some code that displays an image on the main form:

1. | Start Delphi 6.0.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press Install.
3. | Select LEAD Raster View control and add it to your main form. Size and position the control, as you want it to appear at run time.
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14.5). Press OK.
5. | Select LEAD Raster IO, from the ActiveX tab and add it to your form.
6. | At the beginning of the Unit1 file, add LTRASTERLib_TLB to the uses section.
7. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnLoadImage | Load Image
8. | Code the main form's Create procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormCreate(Sender: TObject);
begin

//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance := RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette:= PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;
LEADRasterView1.EnableFireMouse2Event:= True;
end;

9.

Code the btnLoadImage button's click procedure as follows:

procedure TForm1.btnLoadImageClick(Sender: TObject);
begin
LEADRasterIO1.Load ( LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1 ) ;
end;

10. | Run your program to test it.
11. | Save the project to use as a starting point for other tasks in this tutorial.


Zooming Out and Zooming In (Delphi 6.0)

Take the following steps to add code that can reduce and enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD Raster View control.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add two buttons to your form and name them as follows:
 | Name | Caption
 | btnZoomIn | Zoom In
 | btnZoomOut | Zoom Out
3. | Code the btnZoomIn button's click procedure as follows:

procedure TForm1.btnZoomInClick(Sender: TObject);
begin
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_ZOOM;
LEADRasterView1.PaintZoomFactor := LEADRasterView1.PaintZoomFactor + 10;
end;

4.

Code the btnZoomOut button's click procedure as follows:

procedure TForm1.btnZoomOutClick(Sender: TObject);
begin
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_ZOOM;
if ( LEADRasterView1.PaintZoomFactor > 10 ) then
LEADRasterView1.PaintZoomFactor:= LEADRasterView1.PaintZoomFactor - 10;
end;

5.

Run your program to test it.


Dynamically Positioning the Control (Delphi 6.0)

Take the following steps to dynamically scale and position the LEAD Raster View control when loading an image. This example scales the control to use most of the form's area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Modify the btnLoadImage button's click procedure so that it appears as follows. For a general explanation of how images are positioned and scaled, refer to Displaying an Image.

procedure TForm1.btnLoadImageClick(Sender: TObject);
var
HeightFactor: longint;
WidthFactor: longint;
HeightAllowed: longint;
WidthAllowed: longint;
begin
//Position and size the main form so that it takes up most of the screen.
Width := Trunc ( Screen.Width * 0.9 ) ;
Height := Trunc ( Screen.Height* 0.8);
Left := Trunc ( (Screen.Width - Width) / 2);
TOP := Trunc ( (Screen.Height - Height) / 2);
//Turn off automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.AutoScroll := False;
LEADRasterView1.BackErase := False;
//Load the bitmap. This hard-coded path name may be different on your system.
LEADRasterIO1.Load ( LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1 ) ;

//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor := Trunc ( LEADRasterView1.Raster.BitmapHeight);
WidthFactor := Trunc ( LEADRasterView1.Raster.BitmapWidth);
HeightAllowed := trunc ( Height * 3/4);
WidthAllowed := trunc ( Width * 3/4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then
begin
LEADRasterView1.Left := Trunc ( Width / 8);
LEADRasterView1.Width := WidthAllowed;
LEADRasterView1.Height := Trunc ( (LEADRasterView1.Width * HeightFactor) / WidthFactor);
LEADRasterView1.TOP := TRunc((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.TOP := Trunc ( Height / 8 ) ;
LEADRasterView1.Height := HeightAllowed;
LEADRasterView1.Width := Trunc ( (LEADRasterView1.Height * WidthFactor) / HeightFactor);
LEADRasterView1.Left := Trunc((Width - LEADRasterView1.Width) / 2);
end;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect ( 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight);
LEADRasterView1.SetDstClipRect ( 0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight);
LEADRasterView1.SetSrcRect ( 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight);
LEADRasterView1.SetSrcClipRect ( 0, 0, LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight);
//Turn on automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoScroll := True;
end;

3.

Run your program to test it.


Zooming In on a Selection (Delphi 6.0)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Enable AutoRubberBand
LEADRasterView1.AutoRubberBand := True;
LEADRasterView1.MousePointer := 2;
end;

3.

Handle the LEADRasterView1 OnRubberBand event, and code LEADRasterView1RubberBand procedure, as follows:

procedure TForm1.LEADRasterView1RubberBand(Sender: TObject);
var
zoomleft: Integer;
zoomtop: Integer;
zoomwidth: Integer;
zoomheight: Integer;
begin
LEADRasterView1.MousePointer := 0;
//Zoom in on the selection.
zoomleft := Trunc (LEADRasterView1.RubberBandLeft);
zoomtop := Trunc (LEADRasterView1.RubberBandTop);
zoomwidth := Trunc (LEADRasterView1.RubberBandWidth);
zoomheight := Trunc (LEADRasterView1.RubberBandHeight);
//Zoom in on the rectangle defined by the rubberband
LEADRasterView1.ZoomToRect (zoomleft, zoomtop, zoomwidth, zoomheight);
LEADRasterView1.Refresh() ;
end;

4.

Run your program to test it.


Outlining, Dragging, and Pasting a Region (Delphi 6.0)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a second LEAD Raster View control, and set its Visible property to False.
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
4. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Declare the following variables in the private section of your main form. In online help, you can use the Edit pull-down menu to copy the block of code.

ReadyToDrag: boolean ; //The state after marking the region but before dragging
Dragging: boolean; //The state when the mouse is used for dragging the floater
StartX: Single; //Starting X position in screen twips
StartY: Single; //Starting Y position in screen twips
FloaterX: Single; //Floater X position in screen twips
FloaterY: Single; //Floater Y position in screen twips
ZoomFactorX: Single; //Used for translating positioning information
ZoomFactorY: Single; //Used for translating positioning information

6. | At the top of your main form, add two command buttons and name them as follows:
 | Name | Caption
 | btnSelRgn | Select Region
 | btnPasteFloater | Paste Floater
7. | Code btnSelRgn control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnSelRgnClick(Sender: TObject);
begin
LEADRasterView1.RgnFrameType := RGNFRAME_ANIMATED;
LEADRasterView1.Raster.RefBitmap:= False ;
LEADRasterView1.RgnMarkingMode:= RGNMARK_FREEHAND;
ShowMessage ('Draw a freehand region');
end;

8.

Code btnPasteFloater control's Click procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnPasteFloaterClick(Sender: TObject);
var
LCRgnX:Single;
LCRgnY:Single;
LCRgnWidth: Single;
LCRgnHeight: Single;
LBRgnX: Single;
LBRgnY: Single;
LBRgnWidth: Single;
LBRgnHeight:Single;
MyOp: CombineConstants;
begin
//Do nothing if there is no floater.
if (LEADRasterView1.Floater = 0 ) then
Exit;

//Get the floater into another bitmap
LEADRasterView2.Raster.RefBitmap:= False;
LEADRasterView2.ScaleMode:= LEADRasterView1.ScaleMode;
LEADRasterView2.Raster.Bitmap := LEADRasterView1.Floater;
//Get the floater's client coordinates into local variables.
LCRgnX := LEADRasterView1.FloaterDstLeft;
LCRgnY := LEADRasterView1.FloaterDstTop;
LCRgnWidth := LEADRasterView1.FloaterDstWidth;
LCRgnHeight := LEADRasterView1.FloaterDstHeight;
//Delete the floater.
LEADRasterView1.FloaterVisible := False;
LEADRasterView1.Floater := 0;
//Translate the client coordinates to bitmap coordinates.
LBRgnX := ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft;
LBRgnY := ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop;
LBRgnWidth := LCRgnWidth / ZoomFactorX;
LBRgnHeight := LCRgnHeight / ZoomFactorY;
//Reposition the region to use as a mask for the Combine method.
LEADRasterView1.Raster.OffsetRgn ( LBRgnX - LEADRasterView1.Raster.Rgnleft,
LBRgnY - LEADRasterView1.Raster.Rgntop ) ;
//Use the Combine method to paste the Lead2 bitmap into the Lead1 bitmap.
MyOp := CB_OP_ADD + CB_DST_0 ; //Operation flags for a simple paste.
LEADRasterProcess1.Combine ( LEADRasterView1.Raster, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2.Raster, 0, 0, MyOp ) ;
//Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect ( LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, False ) ;
//Free the region.
LEADRasterView1.Raster.FreeRgn ( ) ;
end;

9.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
BitmapX: Single;
BitmapY: Single;
NewX: Single;
NewY:Single;
NewWidth: Single;
NewHeight: Single;

begin
//Do nothing if we are drawing a region.
if LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE then
Exit;
//Save the starting position, in case we need it.
StartY := y;
StartX := x;
//If we are ready to drag the selection, get a floater.
if ( ReadyToDrag = True ) then
begin
//Translate the current mouse coordinates.
//These coordinates account for the zoom factor and offset.
ZoomFactorX := LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth;
ZoomFactorY := LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight;
BitmapX := (x / ZoomFactorX) - (LEADRasterView1.DstLeft / ZoomFactorX)
+ LEADRasterView1.SrcLeft;
BitmapY := (y / ZoomFactorY) - (LEADRasterView1.DstTop / ZoomFactorY)
+ LEADRasterView1.SrcTop;
//Continue to create the floater if the mouse is pointing to the region we marked.

if ( LEADRasterView1.Raster.IsPtInRgn (BitmapX, BitmapY) )then
begin
//Hide the region frame.
LEADRasterView1.RgnFrameType := RGNFRAME_NONE;
//Create the floater bitmap, which will be the part of the main bitmap that is
//in the region's bounding rectangle.
LEADRasterView1.Floater := LEADRasterView1.Raster.Bitmap;
//Translate the bitmap region coordinates to client area coordinates.
NewY := ((LEADRasterView1.Raster.RgnTop - LEADRasterView1.SrcTop) * ZoomFactorY)
+ LEADRasterView1.DstTop;
NewX := ((LEADRasterView1.Raster.Rgnleft - LEADRasterView1.SrcLeft) * ZoomFactorX)
+ LEADRasterView1.DstLeft;
NewWidth := LEADRasterView1.Raster.RgnWidth * ZoomFactorX;
NewHeight := LEADRasterView1.Raster.RgnHeight * ZoomFactorY;
//Set the initial display position of the floater.
LEADRasterView1.SetFloaterDstRect ( NewX, NewY, NewWidth, NewHeight ) ;
//Set form-level variables.
FloaterY := LEADRasterView1.FloaterDstTop;
FloaterX := LEADRasterView1.FloaterDstLeft;
LEADRasterView1.FloaterVisible := True;
Dragging := True;
ReadyToDrag := False;
end;
end;
end;

10.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

procedure TForm1.LEADRasterView1MouseMove2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
xDelta: Single;
yDelta: Single;
NewX: Single;
NewY: Single;
NewWidth: Single;
NewHeight: Single;
begin
//Do nothing if we are drawing a region.
if LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE then
Exit ;
//Reposition the floater if we are dragging it.
if ((Dragging = True) And (Button = 1) And (LEADRasterView1.Floater <> 0)) then
begin
if ( LEADRasterView1.IsPtInFloater ( x, y )) then
begin
//Update the position variables.
xDelta := x - StartX;
yDelta := y - StartY;
NewX := FloaterX + xDelta;
NewY := FloaterY + yDelta;
NewWidth := LEADRasterView1.FloaterDstWidth ;
NewHeight := LEADRasterView1.FloaterDstHeight;
//Reposition the floater.
LEADRasterView1.SetFloaterDstRect ( NewX, NewY, NewWidth, NewHeight ) ;
//Save the form-level position variables.
FloaterY := NewY;
FloaterX := NewX;
StartY := y;
StartX := x;
end;
end;
end;

11.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

procedure TForm1.LEADRasterView1MouseUp2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//if we were drawing a region, set up for the next operation.
if ( LEADRasterView1.RgnMarkingMode <> RGNMARK_NONE ) then
begin
LEADRasterView1.RgnMarkingMode := RGNMARK_NONE;
LEADRasterView1.RgnFrameType := RGNFRAME_STATIC;
ReadyToDrag := True;
ShowMessage ( 'Now, drag the selection to another place.' ) ;
end;
end;

12.

Run your program to test it.


Creating and Using Annotations (Delphi 6.0)

Note:

This topic is for Document/Medical only.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects. This code also demonstrates the related events. Message boxes prompt for user actions that trigger events.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Annotation Library (14.5). Press OK.
3. | Select LEAD Raster Annotation, from the ActiveX tab and add it to your form.
4. | Declare the following variable in the private section of Unit1.

NewTag: Integer;

5.

Add the following code to the btnLoadImage click’s procedure.

//Unlock annotation support
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, WideString('TestKey'));

//Connect the raster annotation object to the RasterView control
LEADRasterAnnotation1.AnnParentRasterView:= LEADRasterView1.Raster;

//Enable left button drawing of annotations
LEADRasterAnnotation1.AnnAutoDrawEnable:= True;

//Enable right-click to display annotation menus
LEADRasterAnnotation1.AnnAutoMenuEnable:= True;

6. | At the top of your main form, add four buttons and name them as follows:
 | Name | Caption
 | btnAnnToggle | Start
 | btnIOToggle | Save
 | btnClipboardToggle | Copy
 | btnRealize | Realize
7. | Code the btnAnnToggle control's Click procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnAnnToggleClick(Sender: TObject);
begin
//Use the button to toggle between design mode and run mode
if (btnAnnToggle.Caption = 'Start') then
begin
LEADRasterAnnotation1.AnnUserMode:= ANN_USERMODE_DESIGN;
LEADRasterAnnotation1.AnnTool:= ANN_TOOL_BUTTON;
//Make run mode the next thing.
btnAnnToggle.Caption:= 'Run Mode';
ShowMessage ('In design mode now. Draw a button object.');
end
else
begin
if (btnAnnToggle.Caption = 'Design Mode') then
begin
LEADRasterAnnotation1.AnnUserMode:= ANN_USERMODE_DESIGN;
LEADRasterAnnotation1.AnnTool:= ANN_TOOL_BUTTON;
//Make run mode the next thing.
btnAnnToggle.Caption:= 'Run Mode';
end
else //The button takes us to run mode
begin
LEADRasterAnnotation1.AnnUserMode:= ANN_USERMODE_RUN;
ShowMessage ('Click on your new button');
btnAnnToggle.Caption:= 'Design Mode';
end;
end;
end;

8.

Code the btnIOToggle control's Click procedure as follows:

procedure TForm1.btnIOToggleClick(Sender: TObject);
var
nRet: Integer;
begin
//Disable errors so that we can trap our own.
LEADRasterAnnotation1.EnableMethodErrors := False;
//Use the button to toggle between saving and loading annotations
if (btnIOToggle.Caption = 'Save') then
begin
//Do nothing if there are no annotations.
If (LEADRasterAnnotation1.AnnContainer = 0) then
Exit;
//Save all annotations.
nRet := LEADRasterAnnotation1.AnnSave ('c:\temp\tmp.ann', ANN_FMT_NATIVE, False, SAVE_OVERWRITE, 1);
if (nRet = 0) then
begin
btnIOToggle.Caption := 'Load';
ShowMessage ('Use the right mouse button to delete any annotations, then click Load');
end
else
ShowMessage ('Error code: ' + IntToStr(nRet));
end
else
begin
//We are loading annotations
//Make sure we are in design mode
LEADRasterAnnotation1.AnnUserMode := ANN_USERMODE_DESIGN;
//Load the annotations.
nRet := LEADRasterAnnotation1.AnnLoad ('c:\temp\tmp.ann', 1);
if (nRet = 0) then
btnIOToggle.Caption := 'Save'
else
ShowMessage ('No annotations to load');
end;
end;

9.

Code the btnClipboardToggle control's Click procedure as follows. (Note that Copy, Cut, and Paste are available as automated popup menu options. This code is for tailoring your application.)

procedure TForm1.btnClipboardToggleClick(Sender: TObject);
var
nRet: Integer;
begin
//Disable errors so that we can trap our own.
LEADRasterAnnotation1.EnableMethodErrors := False;
//Use the button to toggle between copying and pasting annotations
if (btnClipboardToggle.Caption = 'Copy') then
begin
//Do nothing if there are no annotations.
If (LEADRasterAnnotation1.AnnContainer = 0) then
Exit;
//Copy all annotations to the clipboard.
nRet := LEADRasterAnnotation1.AnnCopy (ANN_FMT_NATIVE, False, True);
if (nRet = 0) then
begin
//Make pasting the next thing.
btnClipboardToggle.Caption := 'Paste';
ShowMessage ('Use the right mouse button to delete any annotations, then click Paste');
end
else
ShowMessage ('Error code: ' + IntToStr(nRet));
end
else //We are pasting annotations
begin
//Make sure we are in design mode
LEADRasterAnnotation1.AnnUserMode := ANN_USERMODE_DESIGN;
//Paste the annotations
if ( LEADRasterAnnotation1.AnnPasteReady ) then
begin
LEADRasterAnnotation1.AnnPaste;
btnClipboardToggle.Caption := 'Copy';
end
else
ShowMessage ('No annotations to paste');
end;
end;

10.

Code the Realize control's Click procedure (which renders the annotation objects to the bitmap) as follows:

procedure TForm1.btnRealizeClick(Sender: TObject);
begin
LEADRasterAnnotation1.AnnRealize (False);
LEADRasterView1.ForceRepaint ();
ShowMessage ('Annotations are now rendered to the bitmap');
end;

11.

Handle the LEADRasterAnnotation1 OnAnnCreate event, and code the LEADRasterAnnotation1AnnCreate procedure as follows:

procedure TForm1.LEADRasterAnnotation1AnnCreate (Sender: TObject;
hAnnObject: Integer);
var
ObjectType: AnnObjectType;
begin
//Update the tag if we need one.
LEADRasterAnnotation1.AnnGetType (hAnnObject);
ObjectType:= LEADRasterAnnotation1.AnnType;
if ((ObjectType = ANN_OBJECT_BUTTON) Or (ObjectType = ANN_OBJECT_HOTSPOT)) then
begin
NewTag:= NewTag + 1;
LEADRasterAnnotation1.AnnSetTag (hAnnObject, NewTag);
end;
end;

12.

Handle the LEADRasterAnnotation1 OnAnnDestroy event, and code the LEADRasterAnnotation1AnnDestroy procedure as follows:

procedure TForm1.LEADRasterAnnotation1AnnDestroy(Sender: TObject;
hAnnObject: Integer);
var
lTag: Integer;
begin
LEADRasterAnnotation1.AnnGetTag (hAnnObject);
lTag:= LEADRasterAnnotation1.AnnTag;
ShowMessage ('The object tagged ' + IntToStr(lTag) + ' is deleted.');
end;

13.

Handle the LEADRasterAnnotation1 OnAnnClicked event, and code the LEADRasterAnnotation1AnnClicked procedure as follows:

procedure TForm1.LEADRasterAnnotation1AnnClicked(Sender: TObject;
hAnnObject: Integer);
var
lTag: Integer;
begin
LEADRasterAnnotation1.AnnGetTag (hAnnObject);
lTag:= LEADRasterAnnotation1.AnnTag;
ShowMessage ('This is what we do for the button tagged ' + IntToStr(lTag));
end;

14.

Handle the LEADRasterAnnotation1 OnAnnDrawn event, and code the LEADRasterAnnotation1AnnDrawn procedure as follows:

procedure TForm1.LEADRasterAnnotation1AnnDrawn(Sender: TObject;
hAnnObject: Integer);
begin
LEADRasterAnnotation1.AnnTool := ANN_TOOL_SELECT;
ShowMessage ('Use the right mouse button to modify this object; then click on Run Mode to test it.');
end;

15.

Run your program to test it.


Printing Multiple Images (Delphi 6.0)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button control to your form and name it as follows:
 | Name | Caption
 | btnPrint | Print Twice on One Page
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
4. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Add the following code to the btnPrint control's Click procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnPrintClick(Sender: TObject);
var
//Declare the variable for printed text
Msg: String;
//Declare the variables for pixel measurements
TextHeightInPixels: Integer;
UsableWidth: Integer;
UsableHeight: Integer;
MaxImageHeight: Integer;
//Declare the variables for sizing and positioning the image
PrintLeft: longint;
PrintTop: longint;
PrintHeight: longint;
PrintWidth: longint;
//Declare variables used for preserving aspect ratios
WidthFactor: Integer;
HeightFactor: Integer;
begin
//Set the variables used for preserving the aspect ratio
HeightFactor := Trunc (LEADRasterView1.Raster.BitmapHeight);
WidthFactor:= Trunc (LEADRasterView1.Raster.BitmapWidth);

//Set the pointer to an hourglass
Screen.Cursor := crHourGlass;
//Get the page width and height in pixels (dots)
UsableWidth := Printer.PageWidth ;
UsableHeight := Printer.PageHeight ;
//Print a title at the top of the page
Msg:= 'This is a print example using LEADTOOLS ActiveX.';
Printer.BeginDoc ( );
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y, Msg ) ;
//Get the maximum height of one image,
//assuming two equal-size images and space for 12 lines of text
TextHeightInPixels := Printer.Canvas.TextHeight (Msg);
MaxImageHeight := Trunc ( (UsableHeight - (12 * TextHeightInPixels)) / 2);
//Size and position the first image, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight) then
begin
PrintLeft := 1;
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y;
PrintWidth := UsableWidth;
PrintHeight := Trunc ((PrintWidth * HeightFactor) / WidthFactor);
end
else
begin
PrintLeft := 1;
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintHeight := MaxImageHeight;
PrintWidth := Trunc ( (PrintHeight * WidthFactor) / HeightFactor);
end;
//Print the first image
LEADRasterView1.Render ( Printer.Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight) ;
//Update the current printing position
Printer.Canvas.MoveTo ( 1, Printer.Canvas.PenPos.y + PrintHeight + TextHeightInPixels );
//Print a blank line, then print a caption for the next picture
Msg := ' ' ;
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y, Msg ) ;
Msg := 'This is the second picture, which is modified before printing:';
Printer.Canvas.TextOut ( Printer.Canvas.PenPos.x, Printer.Canvas.PenPos.y + TextHeightInPixels, Msg ) ;
//Stretch the intensity of the bitmap for the second printing
//to show the difference between the second picture and the first
LEADRasterProcess1.StretchIntensity( LEADRasterView1.Raster ) ;
//Size and position the second image, preserving the aspect ratio.
//The coding is the same as for the first image.
if ((UsableWidth * HeightFactor) / WidthFactor) < MaxImageHeight Then
begin
PrintLeft := 1; //This is for flush left. Use 0 for centering.
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintWidth := UsableWidth ;
PrintHeight := Trunc((PrintWidth * HeightFactor) / WidthFactor);
end
else
begin
PrintLeft := 1 ;//This is for flush left. Use 0 for centering.
PrintTop := TextHeightInPixels + Printer.Canvas.PenPos.y ;
PrintHeight := MaxImageHeight;
PrintWidth := Trunc((PrintHeight * WidthFactor) / HeightFactor);
end;
//Print the second image
LEADRasterView1.Render ( Printer.Handle, PrintLeft, PrintTop, PrintWidth, PrintHeight ) ;
//Finish the page and finish the print job
Printer.NewPage ( ) ;
Printer.EndDoc ( ) ;
//Set the mouse pointer back to the default
Screen.Cursor := crDefault;
end;

6. | Add "Printers" unit to the uses section.
7. | Run your program to test it.


Writing and Reading Multi-Page Files (Delphi 6.0)

Take the following steps to create a Multi-Page file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support Multi-Page files.

1. | Start Delphi.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press Install.
3 | Add 2 LEAD Raster View controls to your main form. The size and position does not matter.
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO object library (14.5). Press OK.
5. | Add 2 LEAD Raster IO controls from the ActiveX tab to your form.
6. | Add a button to your form and name it as follows:
 | Name | Caption
 | btnLoad | Load Multi-Page File
7. | Code the btnLoad Click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code. This code loads two bitmaps, saves them both into a single Multi-Page TIFF file, loads them again from the TIFF file, and displays them side-by-side.

procedure TForm1.btnLoadClick(Sender: TObject);
var
HeightFactor1, WidthFactor1,
HeightFactor2, WidthFactor2,
HeightAllowed, WidthAllowed: Integer;
ImageWidth1, ImageHeight1: Integer;
ImageWidth2, ImageHeight2: integer;
begin
//Disable automatic repainting of the image.
LEADRasterView1.AutoRepaint := False;
LEADRasterView2.AutoRepaint := False;
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll := False;
LEADRasterView2.AutoScroll := False;
//Position and size the main form so that it takes up most of the screen.
Width := Trunc(Screen.Width * 0.9) ;
Height:= Trunc(Screen.Height* 0.8) ;
Left := Trunc ((Screen.Width- Width) / 2);
Top := Trunc ((Screen.Height- Height)/ 2);
//Display the form and set the mouse pointer to an hourglass.

Screen.Cursor := crhourGlass;
//Load the bitmaps. These hard-coded path names may be different on your system.
LEADRasterIO1.Load ( LEADRasterView1.Raster, WideString('c:\image1.cmp'), 0, 0, 1 ) ;
LEADRasterIO2.Load ( LEADRasterView2.Raster, WideString('c:\image2.cmp'), 0, 0, 1 ) ;

//Save the bitmaps to a single multipage TIFF file
LEADRasterIO1.Save ( LEADRasterView1.Raster, WideString('c:\combined.mpt'), FILE_TIF, 24, 0, SAVE_OVERWRITE ) ;
LEADRasterIO2.Save ( LEADRasterView2.Raster, WideString('c:\combined.mpt'), FILE_TIF, 24, 0, SAVE_APPEND );
//Get information about the images so that we can size the controls.
LEADRasterIO1.GetFileInfo ( LEADRasterView1.Raster, WideString('c:\combined.mpt'), 1, 0 ) ;
LEADRasterIO2.GetFileInfo ( LEADRasterView2.Raster, WideString('c:\combined.mpt'), 2, 0 );
//Clear the bitmaps from memory
LEADRasterView1.Raster.Bitmap := 0;
LEADRasterView2.Raster.Bitmap := 0;
//Make the controls visible so that we can size and position them.
//They will not really appear until we load an image and paint it.
LEADRasterView1.Visible := True;
LEADRasterView2.Visible := True;
//Set the variables used for preserving the aspect ratio.
HeightFactor1 := Trunc (LEADRasterIO1.InfoHeight);
WidthFactor1 := Trunc (LEADRasterIO1.InfoWidth);
HeightFactor2 := Trunc (LEADRasterIO2.InfoHeight);
WidthFactor2 := Trunc (LEADRasterIO2.InfoWidth);
HeightAllowed := Trunc (Height * 0.8);
WidthAllowed := Trunc (Width * 0.45);
//Center each LEAD control on half of the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if (WidthAllowed * HeightFactor1) / WidthFactor1 < HeightAllowed then
begin
LEADRasterView1.Left := Trunc ((Width / 4) - (WidthAllowed / 2));
LEADRasterView1.Width := WidthAllowed;
LEADRasterView1.Height := Trunc ((LEADRasterView1.Width * HeightFactor1) / WidthFactor1);
LEADRasterView1.Top := Trunc ((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top := Trunc ((Height - HeightAllowed) / 2);
LEADRasterView1.Height := HeightAllowed;
LEADRasterView1.Width := Trunc ((LEADRasterView1.Height * WidthFactor1) / HeightFactor1);
LEADRasterView1.Left := Trunc ((Width / 4) - (LEADRasterView1.Width / 2));
end;
if (WidthAllowed * HeightFactor2) / WidthFactor2 < HeightAllowed then
begin
LEADRasterView2.Left := Trunc ((Width * 3 / 4) - (WidthAllowed / 2));
LEADRasterView2.Width := WidthAllowed;
LEADRasterView2.Height := Trunc ((LEADRasterView2.Width * HeightFactor2) / WidthFactor2);
LEADRasterView2.Top := Trunc ((Height - LEADRasterView2.Height) / 2);
end
else
begin
LEADRasterView2.Top := Trunc ((Height - HeightAllowed) / 2);
LEADRasterView2.Height := HeightAllowed;
LEADRasterView2.Width := Trunc ((LEADRasterView2.Height * WidthFactor2) / HeightFactor2);
LEADRasterView2.Left := Trunc ((Width * 3 / 4) - (LEADRasterView2.Width / 2));
end;
//Load the bitmaps from the multipage TIFF file
LEADRasterIO1.Load ( LEADRasterView1.Raster, 'c:\combined.mpt', 24, 1, 1);
LEADRasterIO2.Load ( LEADRasterView2.Raster, 'c:\combined.mpt', 24, 2, 1);
//Set the image display sizes to match the LEAD controls
ImageWidth1 := Trunc (LEADRasterView1.ScaleWidth);
ImageHeight1 := Trunc (LEADRasterView1.ScaleHeight);
LEADRasterView1.SetDstRect ( 0, 0, ImageWidth1, ImageHeight1 ) ;
LEADRasterView1.SetDstClipRect ( 0, 0, ImageWidth1, ImageHeight1 ) ;
//Set the image display sizes to match the LEAD controls
ImageWidth2 := Trunc (LEADRasterView2.ScaleWidth);
ImageHeight2 := Trunc (LEADRasterView2.ScaleHeight);
LEADRasterView2.SetDstRect ( 0, 0, ImageWidth2, ImageHeight2 ) ;
LEADRasterView2.SetDstClipRect (0, 0, ImageWidth2, ImageHeight2 ) ;

//Display the images
LEADRasterView1.ForceRepaint () ;
LEADRasterView2.ForceRepaint () ;
//Set the mouse pointer back to the default
Screen.Cursor:= crDefault;
end;

8.

Run your program to test it.


Drawing Simple Lines and Shapes (Delphi 6.0)

Take the following steps to add code that lets you draw a line, rectangle and ellipse on the bitmap.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD 3D DrawEffect Object Library (14.5). Press OK.
3. | Select LEAD Raster FXD, from the ActiveX tab and add it to your form.
4. | Add the following variables to the Main Form’s private declarations section:

DrawObject: Integer; //the object we are drawing
StartX: Single ;//Starting X position
StartY: Single ;//Starting Y position
EndX: Single ;//Ending X position
EndY: Single ;//Ending Y position

5.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows:

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Use the same scale mode as the mouse.
LEADRasterView1.ScaleMode := 1;
//Save the starting position.
StartX := X;
StartY := Y;
EndX := X;
EndY := Y;
//Cycle through the types of drawing objects.
Case DrawObject of

0: DrawObject := 1 ;//Line
1: DrawObject := 2 ;//Rectangle
2: DrawObject := 0 ;//Ellipse
else
DrawObject := 0;
end;
LEADRasterFxd1.DstLeft := 0;
LEADRasterFxd1.DstTop := 0;
LEADRasterFxd1.DstRight := Trunc (LEADRasterView1.Raster.BitmapWidth);
LEADRasterFxd1.DstBottom := Trunc (LEADRasterView1.Raster.BitmapHeight);
LEADRasterFxd1.SrcLeft := 0;
LEADRasterFxd1.SrcTop := 0;
LEADRasterFxd1.SrcRight := Trunc (LEADRasterView1.Raster.BitmapWidth);
LEADRasterFxd1.SrcBottom := Trunc (LEADRasterView1.Raster.BitmapHeight);
LEADRasterFxd1.ScaleMode := 3;
end;

6.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows. This code uses DRAWMODE_INVERT for the DrawMode, which means that pixel colors are inverted. Thus, the drawing methods can erase the previous object and draw a new one.

procedure TForm1.LEADRasterView1MouseMove2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
//Declare local variables.
OldEndX, OldEndY: Single;
OldDrawX, OldDrawY, OldWidth, OldHeight: Single;
DrawX, DrawY, NewWidth, NewHeight: Single;
h_DC: HDC;
begin
if Button = 1 then
begin
//Set the drawing styles.
LEADRasterFxd1.DrawPenStyle := DRAWPENSTYLE_SOLID;
LEADRasterFxd1.DrawMode := DRAWMODE_INVERT;
LEADRasterFxd1.DrawFillStyle := DRAWFILLSTYLE_TRANSPARENT;
LEADRasterFxd1.DrawPersistence := False; // On the window, not the bitmap
//Save the previous ending mouse position.
OldEndX := EndX;
OldEndY := EndY;
//Get the current mouse position.
EndX := x;
EndY := y;
//Calculate the origin of the current object.
if (EndX > StartX) then
DrawX := StartX
else
DrawX := EndX;

if EndY > StartY Then
DrawY := StartY
else
DrawY := EndY;

//Calculate the origin of the previous object.
if OldEndX > StartX Then
OldDrawX := StartX
else
OldDrawX := OldEndX;

if OldEndY > StartY Then
OldDrawY := StartY
else
OldDrawY := OldEndY;

//Calculate the height and width of the current object.
NewHeight := Abs(StartY - EndY);
NewWidth := Abs(StartX - EndX);
//Calculate the height and width of the previous object.
OldHeight := Abs(StartY - OldEndY);
OldWidth := Abs(StartX - OldEndX);
//Erase the old object and draw the new one.
h_DC := LEADRasterView1.GetClientDC ();
Case DrawObject of
0: //Ellipse
begin
LEADRasterFxd1.DrawEllipse(Nil, h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
LEADRasterFxd1.DrawEllipse (Nil, h_DC, DrawX, DrawY, NewWidth, NewHeight);
end;
1: //Line
begin
LEADRasterFxd1.DrawLine(Nil, h_DC, StartX, StartY, OldEndX, OldEndY);
LEADRasterFxd1.DrawLine (Nil, h_DC, StartX, StartY, EndX, EndY);
end;
2: //Rectangle
begin
LEADRasterFxd1.DrawRectangle(Nil, h_DC, OldDrawX, OldDrawY, OldWidth, OldHeight);
LEADRasterFxd1.DrawRectangle (Nil, h_DC, DrawX, DrawY, NewWidth, NewHeight);
end;
else
end;
LEADRasterView1.ReleaseClientDC ();
end;
end;

7.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows: This code sets the drawing style and draws the object on the bitmap.

procedure TForm1.LEADRasterView1MouseUp2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
//Declare local variables.
DrawX, DrawY, NewWidth, NewHeight: Single;
begin

//Set the drawing style.
LEADRasterFxd1.DrawPenStyle := DRAWPENSTYLE_SOLID;
LEADRasterFxd1.DrawPenWidth := 2;
LEADRasterFxd1.DrawPenColor := RGB(255, 0, 0) ;//Red
LEADRasterFxd1.DrawMode := DRAWMODE_COPY_PEN;
LEADRasterFxd1.DrawFillColor := RGB(0, 255, 0); //Green;
LEADRasterFxd1.DrawFillStyle := DRAWFILLSTYLE_HORIZONTAL_LINE;
LEADRasterFxd1.DrawPersistence := True ;//On the bitmap
//Get the current mouse position
EndX := x;
EndY := y;
//Determine the origin of the object.
if (EndX > StartX) then
DrawX := StartX
else
DrawX := EndX;

if (EndY > StartY) then
DrawY := StartY
else
DrawY := EndY;

//Determine the height and width of the object.
NewHeight := Abs(StartY - EndY);
NewWidth := Abs(StartX - EndX);
//Draw the object
Case DrawObject of
0: //Ellipse
LEADRasterFxd1.DrawEllipse (LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
1: //Line
LEADRasterFxd1.DrawLine (LEADRasterView1.Raster, 0, StartX, StartY, EndX, EndY);
2: //Rectangle
LEADRasterFxd1.DrawRectangle (LEADRasterView1.Raster, 0, DrawX, DrawY, NewWidth, NewHeight);
end;
LEADRasterView1.ForceRepaint ();
end;

8.

Run your program to test it.


Cropping a Bitmap (Delphi 6.0)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
3. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
4. | Add the following variables to the Private section in your main form:

Cropping: Boolean; //the state when the mouse is used for cropping
StartX: Integer; //Starting X position in screen pixels
StartY: Integer; //Starting Y position in screen pixels
EndX: Integer; //Ending X position in screen pixels
EndY: Integer; //Ending Y position in screen pixels

5. | Add a button to your form and name it as follows:
 | Put it at the top of the form to keep it away from the image.
 | Name | Caption
 | btnCropping | Cropping
6. | Code the btnCropping click’s Procedure as follows. In online help you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnCroppingClick(Sender: TObject);
begin
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1.ScaleMode := 1;
//Initialize cropping so that you can do it more than once
if (Cropping = True) then
begin
//Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect ( LEADRasterView1.DstLeft,
LEADRasterView1.DstTop,
LEADRasterView1.DstWidth,
LEADRasterView1.DstHeight) ;
//Display the image
LEADRasterView1.ForceRepaint ();
end;
//Set a global variable to let other events know that you are cropping
Cropping := True;
//Set the pointer to a crosshair
LEADRasterView1.MousePointer := 2;
end;

7.

Handle the LEADRasterView1 control's OnMouseDown2 event, and code LEADRasterView1MouseDown2 as follows.

procedure TForm1.LEADRasterView1MouseDown2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
begin
//Save the starting position
StartX := Trunc(x);
StartY := Trunc(y);
//Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible := False;
end;

8.

Handle the LEADRasterView1 control's OnMouseMove2 event, and code LEADRasterView1MouseMove2 as follows:

procedure TForm1.LEADRasterView1MouseMove2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
rbX, rbY, rbWidth, rbHeight: Single;
begin
if ((Cropping = True) And (Button = 1)) then
begin
//Get the current mouse position
EndX := Trunc(x);
EndY := Trunc(y);
//Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
if (EndX > StartX) then
rbX := StartX
else
rbX := EndX;

if (EndY > StartY) then
rbY := StartY
else
rbY := EndY;
//Determine the height and width of the rubberband rectangle
rbHeight := Abs(StartY - EndY);
rbWidth := Abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect(rbX, rbY, rbWidth, rbHeight);
//Alternatively, you could use the following properties to set the
//rubberband rectangle.
LEADRasterView1.RubberBandHeight:= rbHeight;
LEADRasterView1.RubberBandLeft:= rbX;
LEADRasterView1.RubberBandTop:= rbY;
LEADRasterView1.RubberBandWidth:= rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible:= True;
end;
end;

9.

Handle the LEADRasterView1 control's OnMouseUp2 event, and code LEADRasterView1MouseUp2 as follows:

procedure TForm1.LEADRasterView1MouseUp2 (Sender: TObject; Button,
Shift: Smallint; x, y: Integer);
var
CropLeft, CropTop, CropWidth, CropHeight: Single;
begin
if (Cropping = True) then
begin
//Get the current mouse position
EndX := Trunc(x);
EndY := Trunc(y);
//Get the origin of the clipping rectangle.
//Allow for different mouse drag directions
if (StartX < EndX) then
CropLeft := StartX
else
CropLeft := EndX;

if (StartY < EndY) then
CropTop := StartY
else
CropTop := EndY;
//Get the height and width of the cropped area
CropWidth := Abs(EndX - StartX);
CropHeight := Abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1.SetDstClipRect (CropLeft, CropTop, CropWidth, CropHeight);
LEADRasterView1.ForceRepaint ( ) ;
LEADRasterView1.RubberBandVisible := False;
LEADRasterView1.MousePointer := 0 ;//Default
end;
end;

10. | Add a button to your form and name it as follows:
 | This button will be used to trim the bitmap in memory and redisplay the bitmap. Put it at the top of the form to keep it away from the image.
 | Name | Caption
 | btnTrim | Trim
11. | Code the btnTrim click’s procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnTrimClick(Sender: TObject);
var
XFactor, YFactor: single;
NewLeft, NewTop, NewWidth, NewHeight: single;
HeightFactor, WidthFactor: single;
HeightAllowed, WidthAllowed: single;
begin

Screen.Cursor := crHourGlass;
//Use the clipping rectangle's percentage offsets in the image rectangle
//to determine the trimmed rectangle in the bitmap.
//Using percentages allows for the possibility that the image is zoomed.
XFactor := LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.DstWidth;
YFactor := LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.DstHeight;
NewTop := (LEADRasterView1.DstClipTop - LEADRasterView1.DstTop) * YFactor;
NewLeft := (LEADRasterView1.DstClipLeft - LEADRasterView1.DstLeft) * XFactor;
NewWidth := LEADRasterView1.DstClipWidth * XFactor;
NewHeight := LEADRasterView1.DstClipHeight * YFactor;
//Make sure display rectangles are automatically adjusted.
LEADRasterView1.AutoSetRects := True;
//Trim the bitmap.
LEADRasterProcess1.Trim ( LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight);
//Size and redisplay the control, using the new bitmap size.
//Set the variables used for preserving the aspect ratio.
//Allow for a border of 1/8 of the form size.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor := LEADRasterView1.Raster.BitmapHeight;
WidthFactor := LEADRasterView1.Raster.BitmapWidth;
HeightAllowed := Height - (Height / 4);
WidthAllowed := Width - (Width / 4);
//Center the LEAD control on the form, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed then
begin
LEADRasterView1.Left := Trunc(Width / 8);
LEADRasterView1.Width := Trunc(WidthAllowed);
LEADRasterView1.Height := Trunc((LEADRasterView1.Width * HeightFactor) / WidthFactor);
LEADRasterView1.Top := Trunc((Height - LEADRasterView1.Height) / 2);
end
else
begin
LEADRasterView1.Top := Trunc(Height / 8);
LEADRasterView1.Height:= Trunc(HeightAllowed);
LEADRasterView1.Width := Trunc((LEADRasterView1.Height * WidthFactor) / HeightFactor);
LEADRasterView1.Left := Trunc((Width - LEADRasterView1.Width) / 2);
end;
//Turn off scroll bars to make sure we use the full client area.
LEADRasterView1.AutoScroll := False;
//Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight );
LEADRasterView1.SetDstClipRect (0, 0, LEADRasterView1.ScaleWidth, LEADRasterView1.ScaleHeight ) ;
//Display the image
LEADRasterView1.ForceRepaint ( );
Screen.Cursor := crDefault;
end;

12.

Run your program to test it. This button will be used to trim the bitmap in memory and redisplay the bitmap. Put it at the top of the form to keep it away from the image.


Creating, Viewing, and Merging Color Separations (Delphi 6.0)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add a button to your form and name it as follows:
 | Put it at the top of the form to keep it away from the image.
 | Name | Caption
 | btnDoSeparations | Do Separations
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
4. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
5. | Add the following variables to the Main Form’s private declarations section.

//Count the button clicks and take the next step with each click
ClickCount: Integer;

6.

Add the following code to the end of the form's Create procedure.

ClickCount:= 0 ;

7.

Code the btnDoSeparations click’s procedure as the following. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.btnDoSeparationsClick(Sender: TObject);
var
Msg: String;
begin
Cursor := crHourGlass;
//Turn off the automatic display rectangles.
LEADRasterView1.AutoSetRects := False;
LEADRasterView1.Raster.RefBitmap := False;
Case ClickCount of
0:
begin
LEADRasterProcess1.ColorSeparate ( LEADRasterView1.Raster, COLORSEP_CMYK ) ;
//Just for fun, add contrast to the K plane
LEADRasterView1.Raster.Bitmap := LEADRasterProcess1.ColorPlanes [3] ;//Copy the K plane
LEADRasterProcess1.Contrast (LEADRasterView1.Raster, 300) ;//Increase the contrast
LEADRasterProcess1.ColorPlanes[3] := LEADRasterView1.Raster.Bitmap ;//Update the K plane
Msg := 'Separated. Keep clicking to see separations, then merge';
ShowMessage ( Msg ) ;
end;
1:
begin
LEADRasterView1.Raster.Bitmap := LEADRasterProcess1.ColorPlanes [0]; //Cyan
LEADRasterView1.ForceRepaint ( ) ;
end;
2:
begin
LEADRasterView1.Raster.Bitmap := LEADRasterProcess1.ColorPlanes[1]; //Magenta
LEADRasterView1.ForceRepaint ( ) ;
end;
3:
begin
LEADRasterView1.Raster.Bitmap := LEADRasterProcess1.ColorPlanes[2]; //Yellow
LEADRasterView1.ForceRepaint ( );
end;
4:
begin
LEADRasterView1.Raster.Bitmap := LEADRasterProcess1.ColorPlanes[3]; // K
LEADRasterView1.ForceRepaint ( );
end;
5:
begin
LEADRasterProcess1.ColorMerge ( LEADRasterView1.Raster, COLORSEP_CMYK ) ;
LEADRasterView1.ForceRepaint ( );
LEADRasterProcess1.ColorPlanes[0] := 0;
LEADRasterProcess1.ColorPlanes[1] := 0;
LEADRasterProcess1.ColorPlanes[2] := 0;
LEADRasterProcess1.ColorPlanes [3] := 0;
msg := 'Merged, with more contrast in the K plane';
ShowMessage (Msg);
end;
else
begin
ClickCount := -1;
msg := 'Cycle is finished';
ShowMessage ( Msg ) ;
end;
end;
ClickCount:= ClickCount + 1;
Cursor:= crDefault;

end;

8.

Run your program to test it. Notice that you can click the button several times to create the separations, view each of them, and merge them to recreate the original bitmap. Put it at the top of the form to keep it away from the image.


Updating a Gauge and Detecting a User Interrupt (Delphi 6.0)

Take the following steps to update a gauge during processing and detect a user interrupt:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add 2 Button controls to your main form. Put them at the top of the form to keep them away from the image, name them as follows:
 | Name | Caption
 | btnMedian | Do Median
 | btnQuit | Quit
3. | Add a TrackBar control to your main Form, and change the Max property of it to 100.
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process object library (14.5).
5. | Select LEAD Raster Process from the ActiveX tab and add it to your form.
6. | Add the Variables to the Private section of Unit1:

fEscape: Boolean; //Use to indicate the user interrupt
fInProc: Boolean; //Use to avoid closing the form during processing

7.

Code the btnMedian Click’s procedure as follows:

procedure TForm1.btnMedianClick(Sender: TObject);
begin
//Enable the ProgressStatus event
LEADRasterProcess1.EnableProgressEvent:= True;
//Initialize the indicators
fEscape := False; //The user does not want to quit
fInProc := True; //Processing is taking place
//Perform a relatively slow median filter
LEADRasterProcess1.Median (LEADRasterView1.Raster, 4);
//Clean up
fInProc := False; //Processing is no longer taking place
LEADRasterView1.ForceRepaint ( );
end;

8.

Handle the LEADRasterProcess1’s OnProgressStatus and code LEADRasterProcess1ProgressStatus as follows:

procedure TForm1.LEADRasterProcess1ProgressStatus(Sender: TObject;
iPercent: Smallint);
begin
Application.ProcessMessages (); //Detect Windows events
if (not fEscape) then // Look for the Click on the Quit button
begin
TrackBar1.Position := iPercent;
end
else
LEADRasterProcess1.EnableProgressEvent:= False; //Cancel the task
end;

9.

Code the btnQuit click’s procedure as follows:

procedure TForm1.btnQuitClick(Sender: TObject);
begin
fEscape:= True; //The user wants to quit
Trackbar1.Position := 0 ;
end;

10.

Handle the Form1 OnCloseQuery event, and code FormCloseQuery procedure as follows:

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if (fInProc) then //If processing is taking place
CanClose:= False; //Do not let the user close the form
end;

11.

Run your program to test it.


Using a PanWindow (Delphi 6.0)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Replace the FormCreate Procedure with the following:

procedure TForm1.FormCreate(Sender: TObject);
begin
//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance:= RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette := PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_NORMAL;
end;

3. | Add a Check Box control to your form and set the Name and Caption properties as follows:
 | Name | Caption
 | chkPanWin | Pan Window
4. | Add a Button to the form and set the Name and Caption properties as follows:
 | Name | Caption
 | btnPanWindow | Show Pan Window
5. | Code the btnPanWindow click’s procedure as the following:

procedure TForm1.btnPanWindowClick(Sender: TObject);
begin
With LEADRasterView1 do
begin
BackErase := False;
//set the location of the PanWindow
PanWinX := 100;
PanWinY := 100;
//set the size of the PanWindow
//requested width
PanWinWidth:= 150;
//requested height
PanWinHeight := 200;

LEADRasterView1.PanWinPointer:= 12;
PanWinTitle := 'PanWindow';
PanWinRectColor:= RGB(0, 0, 255);
PanWinSysMenu := True;
//use the settings for LEADRasterView1.
PanWinPaintPalette := PaintPalette;
PanWinBitonalScaling := BitonalScaling;
PanWinPaintScaling := PaintScaling;
PanWinPaintDither := PaintDither;
//show the Pan Window
ShowPanWin ( True );
end;
chkPanWin.Checked := True;
end;

6.

Code the LEADRasterView1 OnPanWin event procedure as follows:

procedure TForm1.LEADRasterView1PanWin(Sender: TObject; hPanWin: Integer;
iFlag: Smallint);
begin
if (iFlag = PANWIN_DESTROYED) then
chkPanWin.Checked := False ;//indicate no more Pan Window
end;

7.

Run your program to test it.


Using the Magnifying Glass (Delphi 6.0)

Take the following steps to enable the generation of the MagGlassExt event and updating the zoomed image using the Internet COM object toolkit.

1. | Start Delphi.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press install.
3. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Internet Object Library (14.5).
4. | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5).
5. | Select the LEAD RasterView control and add the control to your main form. Size and position the control, as you want it to appear at run time.
6. | From the ActiveX controls tab, add the LEAD Raster Inet, and LEAD Raster IO controls to your form.
7. | Add seven command buttons to your main form and name them as follows:
 | Name | Caption
 | btnStartUpServer | Start Up Server.
 | btnShutDownServer | Shut Server Down.
 | btnConnectToRemoteServer | Connect To Remote Server.
 | btnDisconnectFromRemoteServer | Disconnect From Remote Server.
 | btnLoadRemoteImage | Load Remote Image.
 | btnStartMagnifyingGlass | Start Magnifying Glass.
 | btnStopMagnifyingGlass | Stop Magnifying Glass.
8. | Add an Edit box to your main form and name it as follows:
 | Name |
 | edtRemoteComputer. |
9. | Set the Text property to the name of the computer you will use as a server.
10. | Declare the following in the Private section of Unit1.

hServer: SmallInt; //handle to server
gnCommandID: Longint;
bMagGlass: Boolean;

11.

Handle the Form1 OnCreate event, and code the FormCreate procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormCreate(Sender: TObject);
begin

// Initialize some variables
hServer := 0;
gnCommandID := 0;
bMagGlass := False;

// Set defaults for displaying the image.
// These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance := RASTERVIEW_APPEARANCE_FLAT;
LEADRasterView1.BorderStyle := 1;
LEADRasterView1.BackColor := RGB(255, 255, 125);
LEADRasterView1.PaintDither := PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette := PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint := True;
LEADRasterView1.AutoSize := False;
LEADRasterView1.AutoSetRects := True;
LEADRasterView1.PaintSizeMode := PAINTSIZEMODE_FIT;

// Unlock support for the Inet object.

// Stop generation of runtime exceptions for LEAD RasterView Control, LEAD
// LEAD Raster IO Object Library and LEAD Raster Internet Object Library.
LEADRasterView1.EnableMethodErrors := False;
LEADRasterIO1.EnableMethodErrors := False;
LEADRasterInet1.EnableMethodErrors
  := 0;
end;

12.

Handle the Form1 OnDestroy event, and code the FormDestroy procedure as follows. In online help, you can use the Edit pull-down menu to copy the block of code.

procedure TForm1.FormDestroy(Sender: TObject);
var
i: Integer;
begin
//Disconnect all connections
for i := 0 to LEADRasterInet1.ConnectListNum  - 1 do
LEADRasterInet1.InetDisconnect
  (LEADRasterInet1.ConnectList  [i]);

if (bMagGlass) then
LEADRasterView1.StopMagGlass (  );
end;

13.

Code the btnStartUpServer button's click procedure as follows:

procedure TForm1.btnStartUpServerClick(Sender: TObject);
var
nRet: Integer;
begin
//Initialize server on port 1000
nRet:= LEADRasterINet1.InetServerInit
  (1000);
hServer:= LEADRasterINet1.InetServerHandle
 ;
if (nRet <> 0) then
ShowMessage ('Error Initializing server: ' + IntToStr(nRet));
end;

14.

Code the btnShutDownServer button's click procedure as follows:

procedure TForm1.btnShutDownServerClick(Sender: TObject);
var
nRet: Integer;
begin
if (hServer <> 0) then
begin
nRet:= LEADRasterInet1.InetServerClose (hServer);

if (nRet <> 0) then
ShowMessage ('Error Shutting Down server: ' + IntToStr(nRet))
else
hServer:= 0;
end;
end;

15.

Code the btnConnectToRemoteServer button's click procedure as follows:

procedure TForm1.btnConnectToRemoteServerClick(Sender: TObject);
var
nRet: Integer;
begin
//Connect to remote computer on port 1000
nRet:= LEADRasterInet1.InetConnect
  (edtRemoteComputer.Text, 1000);

if (nRet <> 0) then
ShowMessage ('Error connecting to ' + edtRemoteComputer.Text + ': ' + IntToStr(nRet));
end;

16.

Code the btnDisconnectFromRemoteServer button's click procedure as follows:

procedure TForm1.btnDisconnectFromRemoteServerClick(Sender: TObject);
var
nRet: Integer;
begin
{ We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList}
nRet:= LEADRasterInet1.InetDisconnect
  (LEADRasterInet1.SendList  [0]);
if (nRet <> 0) then
ShowMessage ('Error disconnecting from remote: ' + IntToStr(nRet));
end;

17.

Code the btnLoadRemoteImage button's click procedure as follows:

procedure TForm1.btnLoadRemoteImageClick(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADRasterInet1.InetSendLoadCmd (999, 'v:\images\Eagle.cmp', 0, 1);

if ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) then
ShowMessage ('ERROR ' + IntToStr(nRet) + ' calling InetSendLoadCmd.');
end;

18.

Code the btnStartMagnifyingGlass button's click procedure as follows:

procedure TForm1.btnStartMagnifyingGlassClick(Sender: TObject);
var
nRet: Integer;
begin

if ((LEADRasterView1.Raster.Bitmap <> 0) And (hServer = 0)) then
begin
//Enable MagGlassExt event.
if LEADRasterView1.EnableMagGlassEvent = False Then
LEADRasterView1.EnableMagGlassEvent:= True;

LEADRasterView1.RgnFrameType:= 0;

//Start the Magnifying Glass
nRet:= LEADRasterView1.StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True);

if (nRet = 0) then
bMagGlass:= True;
end;
end;

19.

Code the btnStopMagnifyingGlass button's click procedure as follows:

procedure TForm1.btnStopMagnifyingGlassClick(Sender: TObject);
var
nRet: Integer;
begin
if ((LEADRasterView1.Raster.Bitmap <> 0) And (hServer = 0)) then
begin
nRet:= LEADRasterView1.StopMagGlass ( );

if (nRet = 0) then
bMagGlass:= False
end;
end;

20.

Handle the LEADRasterInet1 OnInetAccept event, and code LEADRasterInet1InetAccept as follows:

procedure TForm1.LEADRasterInet1InetAccept
  (Sender: TObject;
iServer: Smallint);
var
nRet: Integer;
iComputer: SmallInt;
szHostName: WideString;
begin
nRet:= LEADRasterInet1.InetAcceptConnect
  (hServer);
iComputer:= LEADRasterInet1.InetConnectedComputer
 ;
if (nRet <> 0) then
begin
ShowMessage ('Error accepting connection: ' + IntToStr(nRet));
Exit;
end;

LEADRasterInet1.InetGetHostName
  (iComputer, HOST_NAME_DESCRP);

szHostName:= LEADRasterInet1.InetHostName ;
//Add to our list
LEADRasterInet1.SendList [LEADRasterInet1.SendListNum ]:= iComputer;
ShowMessage ('Connection accepted from: ' + szHostName);
end;

21.

Handle the LEADRasterInet1 OnInetConnected event, and code LEADRasterInet1InetConnected as follows:

procedure TForm1.LEADRasterInet1InetConnected
  (Sender: TObject;
iComputer: Smallint);
var
szHostName: WideString;
begin
//Get remote host name
LEADRasterInet1.InetGetHostName
  (iComputer, HOST_NAME_DESCRP);
szHostName:= LEADRasterInet1.InetHostName
 ;
//Add this connection to our SendList
LEADRasterInet1.SendList [LEADRasterInet1.SendListNum ]:= iComputer;
ShowMessage ('Successfully connected to remote computer: ' + szHostName );
end;

22.

Handle the LEADRasterInet1 OnInetDisconnected event, and code LEADRasterInet1InetDisconnected as follows:

procedure TForm1.LEADRasterInet1InetDisconnected (Sender: Object;
iComputer: Smallint);
begin
if (hServer = 0) then
ShowMessage ('Disconnect from remote server')
else
ShowMessage ('Connection to remote computer closed');
end;

23.

Handle the LEADRasterInet1 OnInetReceiveCmd event, and code LEADRasterInet1InetReceiveCmd as follows:

procedure TForm1.LEADRasterInet1InetReceiveCmd (ASender: TObject; iComputer,
InetCommand: Smallint; nCommandID: Integer; nError: Smallint;
const Params: ILEADRasterInetPacket; nExtraDataSize: Integer;
const pExtraData: ILEADRasterVariant);
var
nStatus: SmallInt;
vColorBuffer: LEADRasterVariant;

begin
nStatus:= ERROR_FEATURE_NOT_SUPPORTED;
vColorBuffer:= coLEADRasterVariant.Create();
if (nError <> 0) then
nStatus:= ERROR_TRANSFER_ABORTED
else
begin
Case (InetCommand) of
INETCMD_LOAD:
begin
//check the validity of the parameters
if ((Params.ParamCount = 4) And
(Params.ParamType[0] = PARAM_TYPE_STRING) And
(Params.ParamType[1] = PARAM_TYPE_INT32) And
(Params.ParamType[2] = PARAM_TYPE_INT32) And
(Params.ParamType[3] = PARAM_TYPE_UINT32)) then
begin

nStatus:= LEADRasterIO1.Load (LEADRasterView1.Raster,
Params.ParamValue[0].StringValue,
Params.ParamValue[1].LongValue,
1,
1);

if (nStatus <> 0) then
ShowMessage ('Load Bitmap failed with error code: ' + IntToStr(nStatus))
else
begin
nStatus:= LEADRasterInet1.InetSendBitmap (LEADRasterView1.Raster,
FILE_CMP,
0,
TOleEnum(QFACTOR_PQ2));

if (nStatus <> 0) then
ShowMessage ('SendBitmap failed with error code: ' + IntToStr(nStatus));
end;

end
else
nStatus:= ERROR_INV_PARAMETER; //Invalid parameters

LEADRasterInet1.InetSendLoadRsp (nCommandID, 0, 0, pExtraData, nStatus);
Exit;
end;

INETCMD_GET_MAGGLASS_DATA:
begin
//check the validity of the parameters
if ((Params.ParamCount = 5) And (Params.ParamType[0] = PARAM_TYPE_UINT32)
And (Params.ParamType[1] = PARAM_TYPE_UINT32) And (Params.ParamType[2] = PARAM_TYPE_USTRING)
And (Params.ParamType[3] = PARAM_TYPE_INT32) And (Params.ParamType[4] = PARAM_TYPE_INT32)) Then
begin
if LEADRasterView1.Raster.Bitmap <> 0 Then
begin
nStatus:= LEADRasterInet1.InetGetMagGlassData (LEADRasterView1.Raster,
vColorBuffer,
Params.ParamValue[2],
Params.ParamValue[3].LongValue,
Params.ParamValue[4].LongValue);

if (nStatus <> 0) then
ShowMessage ('InetGetMagGlassData failed with error code: ' + IntToStr(nStatus))
end
else
nStatus:= ERROR_INV_PARAMETER //Invalid parameter
end
else
nStatus:= ERROR_INV_PARAMETER; //Invalid parameters
LEADRasterInet1.InetSendGetMagGlassDataRsp ( nCommandID,
vColorBuffer,
Params.ParamValue[2],
Params.ParamValue[3].LongValue,
Params.ParamValue[4].LongValue,
0,
pExtraData,
nStatus);
Exit;
end;
end;
end;
LEADRasterInet1.InetSendRsp (InetCommand, nCommandID, Nil, 0, pExtraData, nStatus);
end;

24.

Handle the LEADRasterInet1 OnInetReceiveRsp event, and code LEADRasterInet1InetReceiveRsp as follows:

procedure TForm1.LEADRasterInet1InetReceiveRsp (Sender: TObject; iComputer,
InetCommand: Smallint; nCommandID: Integer; nError, nStatus: Smallint;
var Params: OleVariant; nExtraDataSize: Integer; ExtraData: OleVariant);
var
nRet: Integer;
begin
if (nError <> 0) then
Exit;

Case (InetCommand) of
INETCMD_LOAD:
begin
if (nStatus <> 0) then
ShowMessage ('Load failed with error code: ' + IntToStr(nStatus));
end;

INETCMD_GET_MAGGLASS_DATA:
begin
if (nStatus = 0) then
begin
if ((Params.ParamCount = 6) And (Params.ParamType[0] = PARAM_TYPE_UINT32)
And (Params.ParamType[1] = PARAM_TYPE_USTRING) And (Params.ParamType[2] = PARAM_TYPE_UINT32)
And (Params.ParamType[3] = PARAM_TYPE_USTRING) And (Params.ParamType[4] = PARAM_TYPE_INT32))
And (Params.ParamType[5] = PARAM_TYPE_INT32) then
begin
nRet:= LEADRasterView1.UpdateMagGlass(Params.ParamValue[1], Params.ParamValue[3], Params.ParamValue[4], Params.ParamValue[5], True);

if (nRet <> 0) then
ShowMessage ('UpdateMagGlass failed with error code: ' + IntToStr(nRet))
end
else
ShowMessage ('Invalid parameter passed to INETCMD_GET_MAGGLASS_DATA response');
end
else
ShowMessage ('Get MagGlass Data from server with error code ' + IntToStr(nStatus));
end;
end;
end;

25.

Code the LEADRasterView1’s OnMagGlassExt event as follows:

procedure TForm1.LEADRasterView1MagGlassExt(Sender: TObject;
nMaskPlaneStart, nMaskPlaneEnd: Integer; const pvMaskPlane: ILEADRasterVariant);
var
nRet: Integer;
begin

gnCommandID:= gnCommandID + 1;

nRet:= LEADRasterInet1.InetSendGetMagGlassDataCmd
  (gnCommandID, 0, pMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) then
ShowMessage ('ERROR ' + IntToStr(nRet) + ' calling InetSendGetMagGlassDataCmd.');
end;

26. | At the beginning of the Unit1 file, add LTRASTERLib_TLB, LTDllDef, to the Uses section.
27. | Run the exe file two times to execute two applications.
28. | In the first application press the Start Up Server button.
29. | In the second application fill the edit box with the IP Address of the Remote computer on which you ran the first application as Server and then press the Connect To Remote Server button to connect to the specified address.
30. | After that press the Load Remote Image button of application number two to load an image on the Server. Then press the Start Magnifying Glass button to start the Magnifying Glass with Internet support. Press the left mouse button and move over the image to see the zoomed area using the Magnifying Glass with Internet support.


Print a Real Image Size in Inches (Delphi 6.0)

Take the following steps to start a project and to add some code that prints an image:

1. | Start Delphi 6.
2. | If you didn’t install LEAD RasterView Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD RasterView Control (14.5). Press Install, and then compile and install the package dclusr.dpk.
3. | Select the LEAD RasterView control and add it to your form. Size and position the control, as you want it to appear at run time.
4. | If you didn’t import LEAD Raster IO before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5). Press Install, and then compile and install the package dclusr.dpk.
5. | From the ActiveX controls tab, add the LEAD Raster IO control to your form.
6. | Add a button control to your form and name it as follows:
 | Name | Caption
 | btnPrint | Print
7. | Declare the following variables in the private section of Unit1.

fRealWidth: Single; //Image real width in inches
fRealHeight: Single;// Image real height in inches
XRes: Integer; // Number of pixels per logical inch along the screen width.
YRes: Integer; // Number of pixels per logical inch along the screen Height.

8.

Handle the btnPrint button's click procedure and code the btnPrintClick procedure as follows. This code loads an image.

procedure TForm1.btnPrintClick(Sender: TObject);
begin
LEADRasterIO1.Load ( LEADRasterView1.Raster, 'c:\image1.cmp', 0, 0, 1);
end;

9.

You should now calculate the real width and height of the bitmap in inches. Add the following code to btnPrintClick procedure:

fRealWidth:= LEADRasterView1.Raster.BitmapWidth / LEADRasterView1.Raster.BitmapXRes;
fRealHeight:= LEADRasterView1.Raster.BitmapHeight / LEADRasterView1.Raster.BitmapYRes;

10.

Now you are ready to print the image with real size in inches. Add the following code to btnPrintClick procedure:

//You should have the number of pixels per logical inch (XRes, YRes)
XRes:= GetDeviceCaps ( Printer.Canvas.Handle, LOGPIXELSX ) ;
YRes:= GetDeviceCaps ( Printer.Canvas.Handle, LOGPIXELSY ) ;

LEADRasterView1.Render ( Printer.Canvas.Handle,
1,
1,
Trunc(XRes * fRealWidth),
Trunc(YRes * fRealHeight) ) ;
Printer.EndDoc;

11. | Add "Printers" to the Uses section of the Uint1.
12. | Run your program to test it.


Combining Images with Regions (Delphi 6.0)

1. | Start Delphi 6.
2. | If you didn’t install LEAD Raster View Control, install it as follows:
 | On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Raster View Control (14.5). Press install, and then compile and install the package dclusr.dpk.
3. | Add 2 of the LEAD Raster View control to your form. Size and position the controls, as you want them to appear at run time.
4. | If you didn’t import LEAD Raster IO before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster IO Object Library (14.5). Press Install, and then compile and install the package dclusr.dpk.
5. | If you didn’t import LEAD Raster Process before, import it as follows:
 | On the Project pull-down menu, use the Import Type library… and select the LEAD Raster Process Object Library (14.5). Press install, and then compile and install the package dclusr.dpk.
6. | From the ActiveX controls tab, add 2 of the LEAD Raster IO controls and 1 LEAD Raster Process control to your form.
7. | Add 2 buttons to your form and name them as follows:
 | Name | Caption
 | btnLoad | Load Images
 | btnCombine | Combine
8. | Handle the btnLoad button's OnClick event, and code the btnLoadClick procedure as follows:

procedure TForm1.btnLoadClick(Sender: TObject);
begin
LEADRasterIO1.Load ( LEADRasterView1.Raster, 'r:\images\image1.cmp', 0, 1, 1 ) ;
LEADRasterIO2.Load ( LEADRasterView2.Raster, 'r:\images\image2.cmp', 0, 1, 1 ) ;
end;

9.

Handle the btnCombine button's OnClick event, and code the btnCombineClick procedure as follows:

procedure TForm1.btnCombineClick(Sender: TObject);
var
nDstLeft : Integer;
nDstTop : Integer;
nSrcLeft : Integer;
nSrcTop : Integer;
nDstWidth : Integer;
nDstHeight : Integer;
rClientArea : TRect;
begin

Windows.GetClientRect ( LEADRasterView1.Handle, rClientArea );
LEADRasterView1.Raster.SetRgnRect( Trunc(rClientArea.right/8),
Trunc(rClientArea.bottom/8),
Trunc(rClientArea.right/2),
Trunc(rClientArea.bottom/2),
L_RGN_SET);

nDstLeft := Trunc(LEADRasterView1.Raster.BitmapWidth /8 );
nDstTop := Trunc(LEADRasterView1.Raster.BitmapHeight /8 );
nDstWidth := Trunc(LEADRasterView1.Raster.BitmapWidth );
nDstHeight:= Trunc(LEADRasterView1.Raster.BitmapHeight );
nSrcLeft := 0;
nSrcTop := 0;

LEADRasterProcess1.Combine( LEADRasterView1.Raster, nDstLeft, nDstTop, nDstWidth, nDstHeight, LEADRasterView2.Raster, nSrcLeft, nSrcTop, CB_OP_ADD + CB_DST_0);
end;

10. | At the beginning of the Unit1 file, add "LTRASTERLib_TLB" to the uses section.
11. | Run your program to test it.


Tutorial for JavaScript Programmers

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

Note:

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

Loading and Displaying an Image

Zooming Out and Zooming In

Dynamically Positioning the Control

Zooming In on a Selection

Outlining, Dragging, and Pasting a Region

Creating and Using Annotations

Printing Multiple Images

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Cropping a Bitmap

Updating a Gauge and Detecting a User Interrupt

Using a PanWindow

Using Transparent Controls

Using Imaging Common Dialog

Creating, Viewing, and Merging Color Separations

Adding a Color Resolution Dialog

Cropping a Bitmap 2 (JavaScript)

Combining Images with Regions (JavaScript)


Loading and Displaying an Image (JavaScript)

This example dmonstrates how to load and display an image using the LEAD COM object in JavaScript. Just copy/paste this code into an HTML file and open it in Internet Explorer. If you wish to run this sample on a computer which does not have LEADTOOLS installed on it, you should create a CAB file for each COM object you use and an LPK file for the RasterView control. Copy them, along with the HTML file, to that computer and specify the correct paths to those files in the <OBJECT> tages. For information on creating CAB and LPK files please refer to Implementing Internet Features.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Window_OnLoad()
{

var RASTERVIEW_APPEARANCE_THREED = 1;
var PAINTDITHER_DIFFUSION = 1;
var PAINTPALETTE_AUTO = 0;
var PAINTSIZEMODE_FIT = 3;

//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_THREED;
LEADRasterView1.BorderStyle = 1;
LEADRasterView1.BackColor = 16711980; //Blue color
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint = true;
LEADRasterView1.AutoSize = false;
LEADRasterView1.AutoSetRects = true;
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT;
}

function LoadImage()
{
RasterIO1.Load(LEADRasterView1.Raster, "c:\\save.jpg", 0, 0, 1);
}
//-->
</SCRIPT>

<TITLE>LEADTOOLS JavaScript COM Example</TITLE>

</HEAD>

<BODY OnLoad = "Window_OnLoad()">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<OBJECT ID="RasterIO1" NAME="RasterIO1"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnLoad" VALUE="Load Image" LANGUAGE="JavaScript"
OnClick="LoadImage()">
</FORM>
</BODY>
</HTML>


Zooming Out and Zooming In (JavaScript)

Take the following steps to add code that can reduce or enlarge the displayed size of the image. This demonstrates the scaling properties that are normally used for zooming in and zooming out. It emphasizes the relationship of the displayed rectangle to the LEAD Raster View control:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to create two buttons: "btnZoomIn" and "btnZoomOut":

<INPUT TYPE="button" NAME="btnZoomIn" VALUE="Zoom In" LANGUAGE="JavaScript"
OnClick="ZoomIn()">

<INPUT TYPE="button" NAME="btnZoomOut" VALUE="Zoom Out" LANGUAGE="JavaScript"
OnClick="ZoomOut()">

3.

Add the following functions between the <SCRIPT> </SCRIPT> tags for the btnZoomIn and btnZoomOut buttons respectively:

function ZoomIn()
{
var PAINTSIZEMODE_ZOOM = 4;

LEADRasterView1.AutoSetRects = true;
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM;
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor + 10;
LEADRasterView1.ForceRepaint ();
}

function ZoomOut()
{
var PAINTSIZEMODE_ZOOM = 4;

LEADRasterView1.AutoSetRects = true;
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_ZOOM;
if (LEADRasterView1.PaintZoomFactor > 10)
{
LEADRasterView1.PaintZoomFactor = LEADRasterView1.PaintZoomFactor - 10;
}
LEADRasterView1.ForceRepaint ();
}

4.

Run the page to test it.


Dynamically Positioning the Control (JavaScript)

Take the following steps to dynamically scale and position the LEAD RasterView control when loading an image. This example scales the control to use most of the browser’s area while preserving the image's aspect ratio.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Delete the <FORM> </FORM> tags and what’s between them and the LoadImage subroutine, and replace the code in the Window_OnLoad() function with the following code:

var HeightFactor;
var WidthFactor;
var HeightAllowed;
var WidthAllowed;
var NewWidth;
var NewHeight;

//Modify the browser windows’s size and position so that it takes up most of the screen.
NewHeight = screen.height * 0.8;
NewWidth = screen.width * 0.9;
window.resizeTo(NewWidth, NewHeight);
window.moveTo((screen.Width - NewWidth) / 2, (screen.Height - NewHeight) / 2);
LEADRasterView1.ScaleMode = 3;

//Turn off automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = false;
LEADRasterView1.AutoScroll = false;
LEADRasterView1.BackErase = false;

//Load the bitmap. This hard-coded path name may be different on your system.
RasterIO1.Load(LEADRasterView1.Raster, "i:\\a\\pic\\20010327047.jpg", 0, 0, 1);
//Set the variables used for preserving the aspect ratio.
//The units of measure do not matter, since we are calculating proportions.
HeightFactor = LEADRasterView1.RasterUnk.BitmapHeight;
WidthFactor = LEADRasterView1.RasterUnk.BitmapWidth;
HeightAllowed = NewHeight * 3 / 4;
WidthAllowed = NewWidth * 3 / 4;
//Check to see if using the maximum width will make the image too tall. Set the dimensions based on the result.
if (((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{
LEADRasterView1.Width = WidthAllowed;
LEADRasterView1.Height = (LEADRasterView1.Width * HeightFactor) / WidthFactor;
}
else
{
LEADRasterView1.Height = HeightAllowed;
LEADRasterView1.Width = (LEADRasterView1.Height * WidthFactor) / HeightFactor;
}
//Set the image display size to match the LEAD control
var PAINTSIZEMODE_FIT = 3;
LEADRasterView1. PaintSizeMode = PAINTSIZEMODE_FIT;
//Turn on automated behavior while we load and manipulate the image.
LEADRasterView1.AutoRepaint = true;

3.

Run your page to test it.


Zooming In on a Selection (JavaScript)

Take the following steps to add code that lets you select an area with a mouse, and zoom in on the selected area:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Insert the following code between the <HEAD> </HEAD> tags to handle the MouseDown and RubberBand events respectively:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , X , Y)">
<!--
//Enable AutoRubberBand
LEADRasterView1.AutoRubberBand = true;
LEADRasterView1.MousePointer = 2;
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="RubberBand">
<!--
var zoomleft;
var zoomtop;
var zoomwidth;
var zoomheight;

LEADRasterView1.MousePointer = 0;

//Zoom in on the selection.
zoomleft = LEADRasterView1.RubberBandLeft;
zoomtop = LEADRasterView1.RubberBandTop;
zoomwidth = LEADRasterView1.RubberBandWidth;
zoomheight = LEADRasterView1.RubberBandHeight;

//Zoom in on the rectangle defined by the rubberband
LEADRasterView1.ZoomToRect (zoomleft, zoomtop, zoomwidth, zoomheight);
LEADRasterView1.ForceRepaint ();
//-->
</SCRIPT>

3.

Run the page to test it.


Outlining, Dragging, and Pasting a Region (JavaScript)

Take the following steps to add code that lets you outline an area with a mouse, drag a copy of the selected area, and paste the copy into another part of the bitmap:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add another LEAD Raster View control named LEADRasterView2:

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/ Ltrvw14n.CAB"
ALIGN="baseline"
BORDER="0"
WIDTH="50%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

4.

Add the following variables between the <SCRIPT> </SCRIPT> tags. In online help, you can use the Edit pull-down menu to copy the block of code:

var ReadyToDrag; //The state after marking the region but before dragging
var Dragging; //The state when the mouse is used for dragging the floater
var StartX; //Starting X position in screen twips
var StartY; //Starting Y position in screen twips
var FloaterX; //Floater X position in screen twips
var FloaterY; //Floater Y position in screen twips
var ZoomFactorX; //Used for translating positioning information
var ZoomFactorY; //Used for translating positioning information

5.

Add the following code between the <FORM> </FORM> tags to create two buttons: "btnSelRgn" and "btnPasteRgn":

<INPUT TYPE="button" NAME="btnSelRgn" VALUE="Select Region" LANGUAGE="JavaScript"
OnClick="SelectRgn()">

<INPUT TYPE="button" NAME="btnPasteRgn" VALUE="Paste Region" LANGUAGE="JavaScript"
OnClick="PasteRgn()">

6.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnSelRgn button:

function SelectRgn()
{
var RGNFRAME_ANIMATED = 2;
var RGNMARK_FREEHAND = 4;

LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED;
LEADRasterView1.RasterUnk.RefBitmap = false;
LEADRasterView1.RgnMarkingMode = RGNMARK_FREEHAND;
alert("Draw a freehand region");
}

7.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnPasteRgn button:

function PasteRgn()
{
var LCRgnX;
var LCRgnY;
var LCRgnWidth;
var LCRgnHeight;
var LBRgnX;
var LBRgnY;
var LBRgnWidth;
var LBRgnHeight;
var MyOp;
var CB_OP_ADD;
var CB_DST_0;

CB_OP_ADD = 768;
CB_DST_0 = 32;

//Do nothing if there is no floater.
if (LEADRasterView1.Floater == 0)
{
return;
}

//Get the floater into another bitmap
LEADRasterView2.RasterUnk.RefBitmap = false;
LEADRasterView2.ScaleMode = LEADRasterView1.ScaleMode;
LEADRasterView2.RasterUnk.Bitmap = LEADRasterView1.Floater;

//Get the floater's client coordinates into local variables.
LCRgnX = LEADRasterView1.FloaterDstLeft;
LCRgnY = LEADRasterView1.FloaterDstTop;
LCRgnWidth = LEADRasterView1.FloaterDstWidth;
LCRgnHeight = LEADRasterView1.FloaterDstHeight;

//Delete the floater.
LEADRasterView1.FloaterVisible = false;
LEADRasterView1.Floater = 0;

//Translate the client coordinates to bitmap coordinates.
LBRgnX = ((LCRgnX - LEADRasterView1.DstLeft) / ZoomFactorX) + LEADRasterView1.SrcLeft;
LBRgnY = ((LCRgnY - LEADRasterView1.DstTop) / ZoomFactorY) + LEADRasterView1.SrcTop;
LBRgnWidth = LCRgnWidth / ZoomFactorX;
LBRgnHeight = LCRgnHeight / ZoomFactorY;
//Reposition the region to use as a mask for the Combine method.
LEADRasterView1.RasterUnk.OffsetRgn(LBRgnX - LEADRasterView1.RasterUnk.RgnLeft, LBRgnY - LEADRasterView1.RasterUnk.RgnTop);
//Use the Combine method to paste the LEADRasterView2 bitmap into the LEADRasterView1 bitmap.
MyOp = CB_OP_ADD + CB_DST_0; //Operation flags for a simple paste.
RasterProc.Combine(LEADRasterView1.RasterUnk, LBRgnX, LBRgnY, LBRgnWidth, LBRgnHeight, LEADRasterView2.RasterUnk, 0, 0, MyOp);
//Repaint the part of the client area that has changed.
LEADRasterView1.RepaintRect(LCRgnX, LCRgnY, LCRgnWidth, LCRgnHeight, false);
//Free the region.
LEADRasterView1.RasterUnk.FreeRgn();
}

8.

Insert the following code between the <HEAD> </HEAD> tags to handle the MouseDown, MouseMove and MouseUp events respectively:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , x , y)">
<!--
var BitmapX;
var BitmapY;
var NewX;
var NewY;
var NewWidth;
var NewHeight;
var RGNMARK_NONE = 0;
var RGNFRAME_NONE = 0;

//Do nothing if we are drawing a region.
if (LEADRasterView1.RgnMarkingMode != RGNMARK_NONE)
{
return;
}

//Save the starting position, in case we need it.
StartY = y;
StartX = x;

//If we are ready to drag the selection, get a floater.
if (ReadyToDrag = true)
{
//Translate the current mouse coordinates.
//These coordinates account for the zoom factor and offset.
ZoomFactorX = LEADRasterView1.DstWidth / LEADRasterView1.SrcWidth;
ZoomFactorY = LEADRasterView1.DstHeight / LEADRasterView1.SrcHeight;
BitmapX = (x / ZoomFactorX) - (LEADRasterView1.DstLeft / ZoomFactorX) + LEADRasterView1.SrcLeft;
BitmapY = (y / ZoomFactorY) - (LEADRasterView1.DstTop / ZoomFactorY) + LEADRasterView1.SrcTop;

//Continue to create the floater if the mouse is pointing to the region we marked.
if (LEADRasterView1.RasterUnk.IsPtInRgn(BitmapX, BitmapY))
{
//Hide the region frame.
LEADRasterView1.RgnFrameType = RGNFRAME_NONE;
//Create the floater bitmap, which will be the part of the main bitmap that is
//in the region's bounding rectangle.
LEADRasterView1.Floater = LEADRasterView1.RasterUnk.Bitmap;
//Translate the bitmap region coordinates to client area coordinates.
NewY = ((LEADRasterView1.RasterUnk.RgnTop - LEADRasterView1.SrcTop) * ZoomFactorY) + LEADRasterView1.DstTop;
NewX = ((LEADRasterView1.RasterUnk.RgnLeft - LEADRasterView1.SrcLeft) * ZoomFactorX) + LEADRasterView1.DstLeft;
NewWidth = LEADRasterView1.RasterUnk.RgnWidth* ZoomFactorX;
NewHeight = LEADRasterView1.RasterUnk.RgnHeight * ZoomFactorY;
//Set the initial display position of the floater.
LEADRasterView1.SetFloaterDstRect(NewX, NewY, NewWidth, NewHeight);
//Set form-level variables.
FloaterY = LEADRasterView1.FloaterDstTop;
FloaterX = LEADRasterView1.FloaterDstLeft;
LEADRasterView1.FloaterVisible = true;
Dragging = true;
ReadyToDrag = false;
}
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseMove(Button, Shift, x, y)">
<!--
var xDelta;
var yDelta;
var NewX;
var NewY;
var NewWidth;
var NewHeight;
var RGNMARK_NONE;

RGNMARK_NONE = 0;
//Do nothing if we are drawing a region.
if (LEADRasterView1.RgnMarkingMode != RGNMARK_NONE)
{
return;
}

//Reposition the floater if we are dragging it.
if (Dragging == true && Button == 1 && LEADRasterView1.Floater != 0)
{
if (LEADRasterView1.IsPtInFloater(x, y))
{
//Update the position variables.
xDelta = x - StartX;
yDelta = y - StartY;
NewX = FloaterX + xDelta;
NewY = FloaterY + yDelta;
NewWidth = LEADRasterView1.RasterUnk.RgnWidth;
NewHeight = LEADRasterView1.RasterUnk.RgnHeight;
//Reposition the floater.
LEADRasterView1.SetFloaterDstRect(NewX, NewY, NewWidth, NewHeight);
//Save the form-level position variables.
FloaterY = NewY;
FloaterX = NewX;
StartY = y;
StartX = x;
}
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
var RGNMARK_NONE = 0;
var RGNFRAME_ANIMATED = 2;

//If we were drawing a region, set up for the next operation.
if (LEADRasterView1.RgnMarkingMode != RGNMARK_NONE)
{
LEADRasterView1.RgnMarkingMode = RGNMARK_NONE;
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED;
ReadyToDrag = true;
alert("Now, drag the selection to another place.");
}
//-->
</SCRIPT>

9.

Run your page to test it.


Creating, Viewing, and Merging Color Separations (JavaScript)

Take the following steps to add code that creates CMYK color separations, displays each of the color planes, merges the planes, and displays the result. The code increases the contrast of the K plane to demonstrate how you can manipulate the color separations:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add the button btnColorSeparate:

<INPUT TYPE="button" NAME="btnColorSeparate" VALUE="Color Separate" LANGUAGE="JavaScript"
OnClick="ColorSeparate()">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

var ClickCount = 0;

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnColorSeparate button:

function ColorSeparate()
{
var msg;
var COLORSEP_CMYK = 1;

//Turn off the automatic display rectangles.
LEADRasterView1.AutoSetRects = false;
LEADRasterView1.RasterUnk.RefBitmap = false;
switch(ClickCount)
{
case 0:
RasterProc.ColorSeparate(LEADRasterView1.RasterUnk, COLORSEP_CMYK);
//Just for fun, add contrast to the K plane
LEADRasterView1.RasterUnk.Bitmap = RasterProc.ColorPlanes(3); //Copy the K plane
RasterProc.Contrast(LEADRasterView1.RasterUnk, 300); //Increase the contrast
RasterProc.ColorPlanes(3) = LEADRasterView1.RasterUnk.Bitmap; //Update the K plane
msg = "Separated. Keep clicking to see separations, then merge";
alert(msg);
break;

case 1:
LEADRasterView1.RasterUnk.Bitmap = RasterProc.ColorPlanes(0); //Cyan
LEADRasterView1.ForceRepaint ();
break;

case 2:
LEADRasterView1.RasterUnk.Bitmap = RasterProc.ColorPlanes(1); //Magenta
LEADRasterView1.ForceRepaint ();
break;

case 3:
LEADRasterView1.RasterUnk.Bitmap = RasterProc.ColorPlanes(2); //Yellow
LEADRasterView1.ForceRepaint ();
break;

case 4:
LEADRasterView1.RasterUnk.Bitmap = RasterProc.ColorPlanes(3); //K
LEADRasterView1.ForceRepaint ();
break;

case 5:
RasterProc.ColorMerge(LEADRasterView1.RasterUnk, COLORSEP_CMYK);
LEADRasterView1.ForceRepaint ();
RasterProc.ColorPlanes(0) = 0;
RasterProc.ColorPlanes(1) = 0;
RasterProc.ColorPlanes(2) = 0;
RasterProc.ColorPlanes(3) = 0;
msg = "Merged, with more contrast in the K plane";
alert(msg);
break;

default:
ClickCount = -1;
msg = "Cycle is finished";
alert(msg);
}
ClickCount = ClickCount + 1;
}

6.

Run your page to test it.


Printing Multiple Images (JavaScript)

Take the following steps to add code that prints two images on one page. This code shows you how to control the size and position of images on the page.

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to create a command button named btnPrint:

<INPUT TYPE="button" NAME="btnPrint" VALUE="Print" LANGUAGE="VBScript" OnClick="Print()">

3.

Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

function Print()
{
//Declare the variables for pixel measurements
var UsableWidth;
var UsableHeight;
var MaxImageHeight;

//Declare the variables for sizing and positioning the image
var PrintLeft;
var PrintTop;
var PrintHeight;
var PrintWidth;
var CurrentY = 1;

//Declare variables used for preserving aspect ratios
var WidthFactor;
var HeightFactor;

LEADRasterView1.EnableMethodErrors = false;
LEADRasterView1.ScaleMode = 3;

//Set the variables used for preserving the aspect ratio
HeightFactor = LEADRasterView1.RasterUnk.BitmapHeight;
WidthFactor = LEADRasterView1.RasterUnk.BitmapWidth;
//Get the page width and height in pixels (dots)
UsableWidth = LEADRasterView1.PrinterScaleWidth;
UsableHeight = LEADRasterView1.PrinterScaleHeight;
//Get the maximum height of one image
MaxImageHeight = UsableHeight / 2;
//Size and position the first image, preserving the aspect ratio.
//Check to see if using the maximum width will make the image too tall.
//Set the dimensions based on the result.
if ((UsableWidth * HeightFactor / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1;
PrintTop = CurrentY;
PrintWidth = UsableWidth;
PrintHeight = PrintWidth * HeightFactor / WidthFactor;
}
else
{
PrintLeft = 1;
PrintTop = CurrentY;
PrintHeight = MaxImageHeight;
PrintWidth = PrintHeight * WidthFactor / HeightFactor;
}

//Print the first image
var hDC = LEADRasterView1.PrintStart();
LEADRasterView1.Render (hDC, PrintLeft, PrintTop, PrintWidth, PrintHeight);

//Update the current printing position
CurrentY = CurrentY + PrintHeight;

//Invert the bitmap for the second printing
//to show the difference between the second picture and the first
//RasterProc.Invert(LEADRasterView1.Raster);

//Size and position the second image, preserving the aspect ratio.
//The coding is the same as for the first image.
if ((UsableWidth * HeightFactor / WidthFactor) < MaxImageHeight)
{
PrintLeft = 1;
PrintTop = CurrentY;
PrintWidth = UsableWidth;
PrintHeight = PrintWidth * HeightFactor / WidthFactor;
}
else
{
PrintLeft = 1;
PrintTop = CurrentY;
PrintHeight = MaxImageHeight;
PrintWidth = PrintHeight * WidthFactor / HeightFactor;
}

//Print the second image
LEADRasterView1.Render (hDC, PrintLeft, PrintTop, PrintWidth, PrintHeight);

//Finish the page and finish the print job
LEADRasterView1.PrintEnd (hDC);
}

5.

Run your page to test it.


Writing and Reading Multipage Files (JavaScript)

Take the following steps to create a multipage file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add another Raster IO object and Raster View control:

<OBJECT ID="RasterIO2" NAME="RasterIO2"
CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrio14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="50%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Modify the LoadImage() function as follows:

var FILE_TIF = 3;
var SAVE_OVERWRITE = 0;
var SAVE_APPEND = 1;

//Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load(LEADRasterView1.Raster, "i:\\a\\pic\\20020816demo2.jpg", 0, 0, 1);
RasterIO2.Load(LEADRasterView2.Raster, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);

//Save the bitmaps to a single multipage TIFF file
RasterIO1.Save(LEADRasterView1.Raster, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE);
RasterIO2.Save(LEADRasterView2.Raster, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND);

//Load the bitmaps from the multipage TIFF file
RasterIO1.Load(LEADRasterView1.Raster, "c:\\combined.tif", 24, 1, 1);
RasterIO2.Load(LEADRasterView2.Raster, "c:\\combined.tif", 24, 2, 1);

4.

Run your page to test it.


Drawing Simple Lines and Shapes (JavaScript)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add the Raster 3D DrawEffect object:

<OBJECT ID="RasterFxd" NAME="RasterFxd"
CLASSID="CLSID:0014072B-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrfd14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <SCRIPT> </SCRIPT> tags:

var DrawObject;
var StartX;
var StartY;
var EndX;
var EndY;

4.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift , x , y)">
<!--
LEADRasterView1.ScaleMode = 3;
RasterFxd.ScaleMode = 3;
//Save the starting position.
StartX = x;
StartY = y;
EndX = x;
EndY = y;
//Cycle through the types of drawing objects.
switch(DrawObject)
{
case 0:
DrawObject = 1; //Line
break;
case 1:
DrawObject = 2; //Rectangle
break;
case 2:
DrawObject = 0; //Ellipse
break;
default:
DrawObject = 0;
}

RasterFxd.DstLeft = 0;
RasterFxd.DstTop = 0;
//RasterFxd.DstRight = LEADRasterView1.DstWidth;
RasterFxd.DstBottom = LEADRasterView1.DstHeight;
RasterFxd.SrcLeft = 0;
RasterFxd.SrcTop = 0;
RasterFxd.SrcRight = LEADRasterView1.Raster.BitmapWidth;
RasterFxd.SrcBottom = LEADRasterView1.Raster.BitmapHeight;
//alert("MouseDown");
//-->
</SCRIPT>

5.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
//Declare local variables.
var DrawX;
var DrawY;
var NewWidth;
var NewHeight;
var DRAWPENSTYLE_SOLID;
var DRAWMODE_COPY_PEN;
var DRAWFILLSTYLE_HORIZONTAL_LINE;

DRAWPENSTYLE_SOLID = 0;
DRAWMODE_COPY_PEN = 13;
DRAWFILLSTYLE_HORIZONTAL_LINE = 2;
//Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID;
RasterFxd.DrawPenWidth = 2;
RasterFxd.DrawPenColor = 255; //Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN;
RasterFxd.DrawFillColor = 65280; //Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE;
RasterFxd.DrawPersistence = true; //On the bitmap
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the object.
if (EndX > StartX)
DrawX = StartX;
else
DrawX = EndX;

if (EndY > StartY)
DrawY = StartY;
else
DrawY = EndY;

//Determine the height and width of the object.
NewHeight = Math.abs(StartY - EndY);
NewWidth = Math.abs(StartX - EndX);
//Draw the object
switch(DrawObject)
{
case 0: //Ellipse
RasterFxd.DrawEllipse(LEADRasterView1.RasterUnk, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
case 1: //Line
RasterFxd.DrawLine(LEADRasterView1.RasterUnk, 0, StartX, StartY, EndX, EndY);
break;
case 2: //Rectangle
RasterFxd.DrawRectangle(LEADRasterView1.RasterUnk, 0, DrawX, DrawY, NewWidth, NewHeight);
break;
}
LEADRasterView1.ForceRepaint ();
//-->
</SCRIPT>

6.

Run your page to test it.


Combining Images with Regions (JavaScript)

Copy the following code into an HTML file to combine two images with a region:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Window_OnLoad()
{

var RASTERVIEW_APPEARANCE_THREED = 1;
var PAINTDITHER_DIFFUSION = 1;
var PAINTPALETTE_AUTO = 0;
var PAINTSIZEMODE_FIT = 3;

//Set defaults for displaying the image.
//These are all persistent properties that can be set in the properties box.
LEADRasterView1.Appearance = RASTERVIEW_APPEARANCE_THREED;
LEADRasterView1.BorderStyle = 1;
LEADRasterView1.BackColor = 16711980; //Blue color
LEADRasterView1.PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView1.PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView1.AutoRepaint = true;
LEADRasterView1.AutoSize = false;
LEADRasterView1.AutoSetRects = true;
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT;

LEADRasterView2.Appearance = RASTERVIEW_APPEARANCE_THREED;
LEADRasterView2.BorderStyle = 1;
LEADRasterView2.BackColor = 16711980; //Blue color
LEADRasterView2.PaintDither = PAINTDITHER_DIFFUSION;
LEADRasterView2.PaintPalette = PAINTPALETTE_AUTO;
LEADRasterView2.AutoRepaint = true;
LEADRasterView2.AutoSize = false;
LEADRasterView2.AutoSetRects = true;
LEADRasterView2.PaintSizeMode = PAINTSIZEMODE_FIT;
}

function LoadImage()
{
var CB_OP_ADD = 768;
CB_DST_0 = 32;

RasterIO1.Load(LEADRasterView1.Raster, "c:\\save.jpg", 0, 0, 1);
RasterIO1.Load(LEADRasterView2.Raster, "c:\\sample2.cmp", 0, 0, 1);

LEADRasterView1.RasterUnk.SetRgnRect(100, 100, 300, 300, 0);
LEADRasterProc.Combine(LEADRasterView1.RasterUnk, 100, 100, 300, 300, LEADRasterView2.RasterUnk, 0, 0, CB_OP_ADD + CB_DST_0);
LEADRasterView1.RasterUnk.FreeRgn();
}
//-->
</SCRIPT>

<TITLE>LEADTOOLS JavaScript COM Example</TITLE>
</HEAD>
<BODY OnLoad = "Window_OnLoad()">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0" WIDTH="1" HEIGHT="1"> <PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk"> </OBJECT><BR>
<OBJECT ID="RasterIO1" NAME="RasterIO1" CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F" CODEBASE="path to CAB file/Ltrio14n.cab"> <P>This is not supported in web browser.</P> </OBJECT><BR>
<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="100%"
HEIGHT="90%">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnLoad" VALUE="Load Image" LANGUAGE="JavaScript"
OnClick="LoadImage()">
</FORM>
</BODY>
</HTML>


Cropping a Bitmap (JavaScript)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.):

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add Two buttons: btnCropp and btnTrim:

<INPUT TYPE="button" NAME="btnSelectRect" VALUE="Select Rectangle" LANGUAGE="JavaScript"
OnClick="SelectRect()">

<INPUT TYPE="button" NAME="btnTrim" VALUE="Trim Image" LANGUAGE="JavaScript"
OnClick="Trim()">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

var Cropping; //The state when the mouse is used for cropping
var StartX; //Starting X position in screen pixels
var StartY; //Starting Y position in screen pixels
var EndX; //Ending X position in screen pixels
var EndY; //Ending Y position in screen pixels

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnCrop and btnTrim buttons respectively:

function SelectRect()
{
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1.ScaleMode = 1;
//Initialize cropping so that you can do it more than once
if (Cropping == true)
{
//Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect (LEADRasterView1.DstLeft, LEADRasterView1.DstTop, LEADRasterView1.DstWidth, LEADRasterView1.DstHeight);
//Display the image
LEADRasterView1.ForceRepaint ();
}
//Set a global variable to let other events know that you are cropping
Cropping = true;
//Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2;
}

function Trim()
{
LEADRasterView1.ScaleMode = 3;
//Trim the bitmap.
RasterProc.Trim(LEADRasterView1.RasterUnk, 0, 0, 200, LEADRasterView1.Raster.BitmapHeight);
}

6.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseDown(Button, Shift, x, y)">
<!--
//Save the starting position
StartX = x;
StartY = y;
//Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = false;
//-->
</SCRIPT>

7.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseMove event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseMove(Button, Shift, x, y)">
<!--
var rbX;
var rbY;
var rbWidth;
var rbHeight;
if (Cropping == true && Button == 1)
{
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
if (EndX > StartX)
rbX = StartX;
else
rbX = EndX;

if (EndY > StartY)
rbY = StartY;
else
rbY = EndY;

//Determine the height and width of the rubberband rectangle
rbHeight = Math.abs(StartY - EndY);
rbWidth = Math.abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect(rbX, rbY, rbWidth, rbHeight);
//Alternatively, you could use the following properties to set the
//rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight;
LEADRasterView1.RubberBandLeft = rbX;
LEADRasterView1.RubberBandTop = rbY;
LEADRasterView1.RubberBandWidth = rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = true;
}
//-->
</SCRIPT>

8.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseUp(Button, Shift, x, y)">
<!--
var CropLeft
var CropTop
var CropWidth
var CropHeight
if (Cropping == true)
{
//Get the current mouse position
EndX = x;
EndY = y;
//Get the origin of the clipping rectangle.
//Allow for different mouse drag directions
if (StartX < EndX)
CropLeft = StartX;
else
CropLeft = EndX;

if (StartY < EndY)
CropTop = StartY;
else
CropTop = EndY;

//Get the height and width of the cropped area
CropWidth = Math.abs(EndX - StartX);
CropHeight = Math.abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1.SetDstClipRect (CropLeft, CropTop, CropWidth, CropHeight);
LEADRasterView1.ForceRepaint ();
LEADRasterView1.RubberBandVisible = false;
LEADRasterView1.MousePointer = 0; //Default
}
//-->
</SCRIPT>

9.

Run your page to test it.


Cropping a Bitmap 2 (JavaScript)

Take the following steps to add code that lets you select an area with a mouse, crop the display to show only that area, and trim the bitmap to match the selected area. (This example uses both cropping and trimming, so that you can see the difference.):

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add Two buttons: btnCropp and btnTrim:

<INPUT TYPE="button" NAME="btnSelectRect" VALUE="Select Rectangle" LANGUAGE="JavaScript"
OnClick="SelectRect()">
<INPUT TYPE="button" NAME="btnTrim" VALUE="Trim Image" LANGUAGE="JavaScript"
OnClick="Trim()">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

var Cropping; //The state when the mouse is used for cropping
var StartX; //Starting X position in screen pixels
var StartY; //Starting Y position in screen pixels
var EndX; //Ending X position in screen pixels
var EndY; //Ending Y position in screen pixels

5.

Add the following code between the <SCRIPT> </SCRIPT> tags for btnCrop and btnTrim buttons respectively:

function SelectRect()
{
LEADRasterView1.EnableFireMouse2Event = true;
//Set the scale mode to twips so that we do not have to
//translate mouse coordinates
LEADRasterView1.ScaleMode = 3;
//Initialize cropping so that you can do it more than once
if (Cropping == true)
{
//Set the clipping area to match the image.
LEADRasterView1.SetDstClipRect(LEADRasterView1.DstLeft, LEADRasterView1.DstTop, LEADRasterView1.DstWidth, LEADRasterView1.DstHeight);
//Display the image
LEADRasterView1.ForceRepaint();
}
//Set a global variable to let other events know that you are cropping
Cropping = true;
//Set the pointer to a crosshair
LEADRasterView1.MousePointer = 2;
}

function Trim()
{
LEADRasterView1.ScaleMode = 3;
//Trim the bitmap.
RasterProc.Trim(LEADRasterView1.RasterUnk, 0, 0, LEADRasterView1.RasterUnk.BitmapWidth / 2, LEADRasterView1.RasterUnk.BitmapHeight);
}

6.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseDown2 event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseDown2(Button, Shift, x, y)">
<!--
//Save the starting position
StartX = x;
StartY = y;
//Make the rubberband invisible until the mouse moves
LEADRasterView1.RubberBandVisible = false;
//-->
</SCRIPT>

7.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseMove2 event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseMove2(Button, Shift, x, y)">
<!--
var rbX;
var rbY;
var rbWidth;
var rbHeight;
if (Cropping == true && Button == 1)
{
//Get the current mouse position
EndX = x;
EndY = y;
//Determine the origin of the rubberband rectangle, regardless of which way the mouse moves.
if (EndX > StartX)
rbX = StartX;
else
rbX = EndX;

if (EndY > StartY)
rbY = StartY;
else
rbY = EndY;

//Determine the height and width of the rubberband rectangle
rbHeight = Math.abs(StartY - EndY);
rbWidth = Math.abs(StartX - EndX);
//Set the rubberband rectangle
LEADRasterView1.SetRubberBandRect(rbX, rbY, rbWidth, rbHeight);
//Alternatively, you could use the following properties to set the
//rubberband rectangle.
LEADRasterView1.RubberBandHeight = rbHeight;
LEADRasterView1.RubberBandLeft = rbX;
LEADRasterView1.RubberBandTop = rbY;
LEADRasterView1.RubberBandWidth = rbWidth;
//Make the rubberband rectangle visible
LEADRasterView1.RubberBandVisible = true;
}
//-->
</SCRIPT>

8.

Add the following code between the <HEAD> </HEAD> tags to handle the Main Control’s MouseUp2 event:

<SCRIPT LANGUAGE="JavaScript" FOR="LEADRasterView1" EVENT="MouseUp2(Button, Shift, x, y)">
<!--
var CropLeft
var CropTop
var CropWidth
var CropHeight
if (Cropping == true)
{
//Get the current mouse position
EndX = x;
EndY = y;
//Get the origin of the clipping rectangle.
//Allow for different mouse drag directions
if (StartX < EndX)
CropLeft = StartX;
else
CropLeft = EndX;

if (StartY < EndY)
CropTop = StartY;
else
CropTop = EndY;

//Get the height and width of the cropped area
CropWidth = Math.abs(EndX - StartX);
CropHeight = Math.abs(EndY - StartY);
//Crop and repaint the image
LEADRasterView1.SetDstClipRect(CropLeft, CropTop, CropWidth, CropHeight);
LEADRasterView1.ForceRepaint();
LEADRasterView1.RubberBandVisible = false;
LEADRasterView1.MousePointer = 0; //Default
}
//-->
</SCRIPT>

9.

Run your page to test it.


Updating a Gauge and Detecting a User Interrupt (JavaScript)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc:

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <BODY> </BODY> tags to add a Microsoft ProgressBar object named ProgressBar1:

<OBJECT id=ProgressBar1
style="WIDTH: 667px; HEIGHT: 31px; BACKGROUND-COLOR: white"
classid=clsid:0714E8D2-850A-101B-AFC0-4210102A8DA7 VIEWASTEXT>
</OBJECT>

4.

Add the following code between the <FORM> </FORM> tags to create a command button named btnMedian:

<INPUT TYPE="button" NAME="btnMedian" VALUE="Median" LANGUAGE="JavaScript" OnClick="Median()">

5.

Add the following code between the <SCRIPT> </SCRIPT> tags:

function Median()
{
RasterProc.EnableProgressEvent = true;
RasterProc.Median (LEADRasterView1.Raster, 4);
LEADRasterView1.ForceRepaint ();
}

6.

Add the following code between the <HEAD> </HEAD> tags to handle the ProgressStatus event:

<SCRIPT LANGUAGE="JavaScript" FOR="RasterProc" EVENT="ProgressStatus(iPercent)">
<!--
ProgressBar1.Value = iPercent;
//-->
</SCRIPT>

7.

Run your page to test it.


Using a PanWindow (JavaScript)

Take the following steps to add a Pan Window to your page:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code between the <FORM> </FORM> tags to add the button btnPanWnd:

<INPUT TYPE="button" NAME="btnPanWnd" VALUE="Pan Window" LANGUAGE="JavaScript"
OnClick="PanWnd()">

3.

Delete the following line from the Window_OnLoad function:

Lead1. PaintSizeMode = PAINTSIZEMODE_FIT;

4.

Add the following code between the <SCRIPT> </SCRIPT> tags for the btnPanWnd button:

function PanWnd()
{
LEADRasterView1.BackErase = false;
//set the location of the PanWindow
LEADRasterView1.PanWinX = 100;
LEADRasterView1.PanWinY = 100;
//set the size of the PanWindow
//requested width
LEADRasterView1.PanWinWidth = 150;
//requested height
LEADRasterView1.PanWinHeight = 200;
LEADRasterView1.PanWinTitle = "PanWindow";
LEADRasterView1.PanWinRectColor = 255; //Red
LEADRasterView1.PanWinSysMenu = true;
//use the settings for LEADRasterView1
LEADRasterView1.PanWinPaintPalette = LEADRasterView1.PaintPalette;
LEADRasterView1.PanWinBitonalScaling = LEADRasterView1.BitonalScaling;
LEADRasterView1.PanWinPaintScaling = LEADRasterView1.PaintScaling;
LEADRasterView1.PanWinPaintDither = LEADRasterView1.PaintDither;
//show the Pan Window
LEADRasterView1.ShowPanWin (true);
}

5.

Run your page to test it.


Using Transparent Controls (JavaScript)

The following example creates a web page with a bitmap as its background, then places a RasterView control on. You can then press the button at the bottom of the page to toggle the transparency of the control.

1.

Create an new HTML file and copy the following code to it ans save:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Window_OnLoad()
{
LEADRasterView1.RasterUnk.CreateBitmap(500, 150, 24);
RasterProc.Fill(LEADRasterView1.RasterUnk, 255);

RasterFxd.TextTop = 50;
RasterFxd.TextLeft = 0;
RasterFxd.TextWidth = LEADRasterView1.DstWidth;
RasterFxd.TextHeight = LEADRasterView1.DstHeight;
RasterFxd.DrawFontColor = 65353;
RasterFxd.Font.Size = 18;
RasterFxd.DrawPersistence = true;
RasterFxd.DrawText(LEADRasterView1.RasterUnk, 0, "Press the button below to toggle transparency", 0);
}

function ToggleTransparency()
{
if (LEADRasterView1.Transparent == true)
LEADRasterView1.Transparent = false;
else
LEADRasterView1.Transparent = true;
}
//-->
</SCRIPT>

<TITLE>LEADTOOLS JavaScript COM Example</TITLE>

</HEAD>

<BODY OnLoad = "Window_OnLoad()" BACKGROUND="c:\save.jpg">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>

<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="90%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterFxd" NAME="RasterFxd"
CLASSID="CLSID:0014072B-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrfd14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnToggleTransparency" VALUE="Toggle Transparency" LANGUAGE="JavaScript"
OnClick="ToggleTransparency()">
</FORM>
</BODY>
</HTML>

2.

Run your page to test it.


Using Imaging Common Dialog (JavaScript)

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following code to add the imaging common dialog COM object to your page:

<OBJECT ID="LEADRasterDlg1" NAME="LEADRasterDlg1"
CLASSID="CLSID:00140B79-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrdg14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Modify the LoadImage function as follows:

var nRet;
var DLG_FO_AUTOPROCESS = 1;
var DLG_FO_PROGRESSIVE = 2;
var DLG_FO_MULTIPAGE = 4;
var DLG_FO_LOADROTATED = 8;
var DLG_FO_LOADCOMPRESSED = 16;
var DLG_FO_FILEINFO = 32;
var DLG_FO_SHOWPREVIEW = 64;

LEADRasterDlg1.FileDlgFlags  = 0;
LEADRasterDlg1.DialogTitle  = "Open a File";
LEADRasterDlg1.Filter  = "All|*.*|CMP|*.cmp|JPEG|*.jpg";
LEADRasterDlg1.FilterIndex  = 2; //look for .cmp first
LEADRasterDlg1.InitialDir  = "s:\\temp\\images\\";
LEADRasterDlg1.LoadPasses  = 0;
LEADRasterDlg1.LoadRotated  = true;
LEADRasterDlg1.LoadCompressed  = false;
LEADRasterDlg1.Raster = LEADRasterView1.Raster;
LEADRasterDlg1.UIFlags  = DLG_FO_AUTOPROCESS | DLG_FO_PROGRESSIVE | DLG_FO_MULTIPAGE | DLG_FO_LOADROTATED | DLG_FO_LOADCOMPRESSED | DLG_FO_FILEINFO | DLG_FO_SHOWPREVIEW
nRet = LEADRasterDlg1.ShowOpenDlg
 (LEADRasterView1.Window);

if (nRet = 0)
LEADRasterView1.ForceRepaint ();

4.

Run you page to test it.


Creating and Using Annotations (JavaScript)

Note: | This topic is for Document/Medical only.
Note: | You’ll need to call the UnlockSupport method to unlock Document Imaging capability.

Take the following steps to add code that demonstrates the creation and deletion, saving and loading, and copying and pasting of annotation objects:

1. | Start with the project that you created in Loading and Displaying an Image.
2. | Add the following line between the <SCRIPT> and </SCRIPT> tags:

var NewTag;

3.

Add the following code between the <BODY> </BODY> tags to add the annotations COM object:

<OBJECT ID="RasterAnn" NAME="RasterAnn"
CLASSID="CLSID:00140723-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltran14n.CAB">
<P>This is not supported in web browser.</P>
</OBJECT><BR>

4.

Add the following code to the Window_OnLoad() function:

RasterAnn.AnnParentRasterView = LEADRasterView1;
//Enable left button drawing of annotations
RasterAnn.AnnAutoDrawEnable = true;

//Enable right-click to display annotation menus
RasterAnn.AnnAutoMenuEnable = true;
NewTag = 0;

5.

Add the following code between the <FORM> </FORM> tags to create four buttons:

<INPUT TYPE="button" NAME="btnStart" VALUE="Start" LANGUAGE="JavaScript"
OnClick="Start()">

<INPUT TYPE="button" NAME="btnSave" VALUE="Save" LANGUAGE="JavaScript"
OnClick="Save()">

<INPUT TYPE="button" NAME="btnCopy" VALUE="Copy" LANGUAGE="JavaScript"
OnClick="Copy()">

<INPUT TYPE="button" NAME="btnRealize" VALUE="Realize" LANGUAGE="JavaScript"
OnClick="Realize()">

6.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnStart button:

function Start()
{
var ANN_USERMODE_DESIGN = 1;
var ANN_TOOL_BUTTON = 13;
var ANN_USERMODE_RUN = 2;

//Use the button to toggle between design mode and run mode
if (LEADForm.btnStart.value == "Start")
{
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN;
RasterAnn.AnnTool = ANN_TOOL_BUTTON;
//Make run mode the next thing.
LEADForm.btnStart.value = "Run Mode";
alert("In design mode now. Draw a button object.");
}
else if (LEADForm.btnStart.value == "Design Mode")
{
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN;
RasterAnn.AnnTool = ANN_TOOL_BUTTON;
//Make run mode the next thing.
LEADForm.btnStart.value = "Run Mode";
}
else //The button takes us to run mode
{
RasterAnn.AnnUserMode = ANN_USERMODE_RUN;
alert("Click on your new button");
LEADForm.btnStart.value = "Design Mode";
}
}

7.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnSave button:

function Save()
{
var nRet;
var ANN_USERMODE_DESIGN = 1;
var ANN_FMT_NATIVE = 0;
var SAVE_OVERWRITE = 0;

//Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = false;
//Use the button to toggle between saving and loading annotations
if (LEADForm.btnSave.value == "Save")
{
//Do nothing if there are no annotations.
if (RasterAnn.AnnContainer == 0)
return;
//Save the all annotations.
nRet = RasterAnn.AnnSave("c:\\tmp.ann", ANN_FMT_NATIVE, false, SAVE_OVERWRITE, 0);
if (nRet == 0)
{
LEADForm.btnSave.value = "Load";
alert("Use the right mouse button to delete any annotations, then click Load");
}
else
alert("Error code: " & CStr(nRet));
}
else //We are loading annotations
{
//Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN;
//Load the annotations.
nRet = RasterAnn.AnnLoad("c:\\tmp.ann", 1);
if (nRet == 0)
LEADForm.btnSave.value = "Save";
else
alert("No annotations to load");
}
}

8.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnCopy button:

function Copy()
{
var nRet;
var ANN_USERMODE_DESIGN = 1;
var ANN_FMT_NATIVE = 0;

//Disable errors so that we can trap our own.
RasterAnn.EnableMethodErrors = false;
//Use the button to toggle between copying and pasting annotations
if (LEADForm.btnCopy.value == "Copy")
{
//Do nothing if there are no annotations.
if (RasterAnn.AnnContainer == 0)
return;

//Copy all annotations to the clipboard.
nRet = RasterAnn.AnnCopy(ANN_FMT_NATIVE, false, true);
if (nRet == 0)
{
//Make pasting the next thing.
LEADForm.btnCopy.value = "Paste";
alert("Use the right mouse button to delete any annotations, then click Paste");
}
else
alert("Error code: " & nRet);
}
else //We are pasting annotations
{
//Make sure we are in design mode
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN;
//Paste the annotations
if (RasterAnn.AnnPasteReady)
{
nRet = RasterAnn.AnnPaste();
LEADForm.btnCopy.value = "Copy";
}
else
alert("No annotations to paste");
}
}

9.

Add the following code between the <SCRIPT> </SCRIPT> tags to for the btnRealize button:

function Realize()
{
RasterAnn.AnnRealize(false);
LEADRasterView1.ForceRepaint ();
alert("Annotations are now rendered to the bitmap");
}

10.

Add the following code between the <HEAD> </HEAD> tags to for handling the AnnCreate, AnnDrawn, AnnClicked and AnnDestroy events respectively:

<SCRIPT LANGUAGE="JavaScript" FOR="RasterAnn" EVENT="OnAnnCreate(hAnnObject)">
<!--
RasterAnn.AnnSetForeColor(hAnnObject, 65535, false);
var ANN_OBJECT_BUTTON = 3;
var ANN_OBJECT_HOTSPOT = 7;

RasterAnn.AnnGetType(hAnnObject);
if (RasterAnn.AnnType == ANN_OBJECT_BUTTON || RasterAnn.AnnType == ANN_OBJECT_HOTSPOT)
{
NewTag = NewTag + 1;
RasterAnn.AnnSetTag(hAnnObject, NewTag);
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="RasterAnn" EVENT="OnAnnDrawn(hAnnObject)">
<!--
var ANN_TOOL_SELECT = 0;

RasterAnn.AnnTool = ANN_TOOL_SELECT;
alert("Use the right mouse button to modify this object; then click on Run Mode to test it.");
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="RasterAnn" EVENT="OnAnnClicked(hAnnObject)">
<!--
RasterAnn.AnnGetTag(hAnnObject);
var lTag = RasterAnn.AnnTag;
alert("This is what we do for the button tagged " + lTag);
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="RasterAnn" EVENT="OnAnnDestroy(hAnnObject)">
<!--
RasterAnn.AnnGetTag(hAnnObject);
var lTag = RasterAnn.AnnTag;
alert("The object tagged " + lTag + " is deleted.");
//-->
</SCRIPT>

11.

Run your page to test it.


Adding a Color Resolution Dialog (JavaScript)

1. | Start with the project you created in Using Imaging Common Dialog
2. | Add the following code to add the imaging color common dialog COM object to your page:

<OBJECT ID="LEADRasterDlg2" NAME="LEADRasterDlg2"
CLASSID="CLSID: 00140B4F-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrdg14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Add the following code between the <FORM> </FORM> tags to add a new command button:

<INPUT TYPE="button" NAME="btnColorRes" VALUE="Color Resolution" LANGUAGE="JavaScript"
OnClick="ColorRes()">

4.

Add the following code between the <SCRIPT> </SCRIPT> tags:

function ColorRes()
{
var DLG_CR_BITALL = 16383;
var DLG_CR_PAL_ALL = 1065353216;
var DLG_CR_DITHER_ALL = 8372224;
var DLG_CR_SHOWPREVIEW = 1;
var DLG_CR_AUTOPROCESS = 2;
var DLG_CR_ORDER = 32;

LEADRasterDlg1.BitsPerPixel
  = 0;
LEADRasterDlg1.PaletteFlags
  = 0;
LEADRasterDlg1.DitherFlags  = 0;
LEADRasterDlg1.Raster = LEADRasterView1.Raster; //assign the bitmap for processing
LEADRasterDlg1.ColorResFlags  = DLG_CR_BITALL | DLG_CR_PAL_ALL | DLG_CR_DITHER_ALL;
LEADRasterDlg1.UIFlags
  = DLG_CR_SHOWPREVIEW | DLG_CR_AUTOPROCESS | DLG_CR_ORDER;
LEADRasterDlg1.ShowColorResDlg
 (LEADRasterView1.Window);
LEADRasterView1.ForceRepaint ();
}

5.

Run your page to test it.


Tutorial for ASP - JavaScript Programmers

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

Note:

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

Loading, Saving and Displaying an Image

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Creating, Viewing, and Merging Color Separations

Creating and Pasting a Region

Combining Images with Regions (ASP - JavaScript)


Loading, Saving and Displaying an Image (ASP -JavaScript)

This example demonstrates how to load and display an image using the LEAD COM objects in ASP. The image is loaded from the server and saved on the server with a different name, then displayed in the browser using the <IMG> HTML tag. Just copy/paste this code into a text file, save it as .asp and open it in an Internet browser.

<%@ Language=JavaScript %>
<%
var RasterObj = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var FILE_JFIF = 10;

RasterIO.Load(RasterObj, "c:\\save.jpg", 0, 0, 1);
RasterIO.Save(RasterObj, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0);

Response.Write("<IMG SRC='c:\\asp.jpg'>");

%>


Creating, Viewing, and Merging Color Separations (ASP - JavaScript)

The following example creates CMYK color separations, saves each of the color planes in a multipage TIFF file, merges the planes, and displays the result. The code inverts the K plane to demonstrate how you can manipulate the color separations:

<%@ Language=JavaScript %>
<%
var COLORSEP_CMYK = 1;
var SAVE_OVERWRITE = 0;
var SAVE_APPEND = 1;
var FILE_JFIF = 10;
var FILE_TIF = 3;

var RasterObj = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess");

RasterIO.Load(RasterObj, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);

RasterProc.ColorSeparate(RasterObj, COLORSEP_CMYK);

//Just for fun, invert the K plane
RasterObj.Bitmap = RasterProc.ColorPlanes(3); //Copy the K plane
RasterProc.Invert(RasterObj); //Invert the K plane
RasterProc.ColorPlanes(3) = RasterObj.Bitmap; //Update the K plane

//Save the color planes into a multipage TIFF file
RasterObj.Bitmap = RasterProc.ColorPlanes(0); //Cyan
RasterIO.Save(RasterObj, "c:\\Planes.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE);

RasterObj.Bitmap = RasterProc.ColorPlanes(1); //Magenta
RasterIO.Save(RasterObj, "c:\\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND);

RasterObj.Bitmap = RasterProc.ColorPlanes(2); //Yellow
RasterIO.SaSaMethodve(RasterObj, "c:\\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND);

RasterObj.Bitmap = RasterProc.ColorPlanes(3); //K
RasterIO.Save(RasterObj, "c:\\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND);

//Merge the color planes
RasterProc.ColorMerge(RasterObj, COLORSEP_CMYK);

RasterProc.ColorPlanes(0) = 0;
RasterProc.ColorPlanes(1) = 0;
RasterProc.ColorPlanes(2) = 0;
RasterProc.ColorPlanes(3) = 0;

RasterIO.Save(RasterObj, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0);
Response.Write("<IMG SRC='c:\\asp.jpg'>");
%>


Writing and Reading Multipage Files (ASP - JavaScript)

This example demonstrates how to create a multipage file on the server, then load and display the images from that file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:

<%@ Language=JavaScript %>
<%
var FILE_TIF = 3;
var FILE_JFIF = 10;
var SAVE_OVERWRITE = 0;
var SAVE_APPEND = 1;

var RasterObj1 = Server.CreateObject("LEADRaster.LEADRaster");
var RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO1 = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterIO2 = Server.CreateObject("LEADRasterIO.LEADRasterIO");

//Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load(RasterObj1, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);
RasterIO2.Load(RasterObj2, "i:\\a\\pic\\20020816demo2.jpg", 0, 0, 1);

//Save the bitmaps to a single multipage TIFF file
RasterIO1.Save(RasterObj1, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE);
RasterIO2.Save(RasterObj2, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND);

//Load the bitmaps from the multipage TIFF file
RasterIO1.Load(RasterObj1, "c:\\combined.tif", 24, 1, 1);
RasterIO2.Load(RasterObj2, "c:\\combined.tif", 24, 2, 1);

//Save the bitmaps to separate JPEG files to display them in the browser window.
RasterIO1.Save(RasterObj1, "c:\\temp1.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE);
RasterIO2.Save(RasterObj2, "c:\\temp2.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE);

Response.Write("<IMG SRC='c:\\temp1.jpg'>");
Response.Write("<IMG SRC='c:\\temp2.jpg'>");
%>


Drawing Simple Lines and Shapes (ASP - JavaScript)

The following example demonstrates how to draw lines and shapes on the bitmap:

<%@ Language=JavaScript %>
<%
var DRAWPENSTYLE_SOLID = 0;
var DRAWMODE_COPY_PEN = 13;
var DRAWFILLSTYLE_HORIZONTAL_LINE = 2;
var FILE_JFIF = 10;

var RasterObj = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterFxd = Server.CreateObject("LEADRasterFxd.LEADRasterFxd");

RasterIO.Load(RasterObj, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);

//Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID;
RasterFxd.DrawPenWidth = 2;
RasterFxd.DrawPenColor = 255; //Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN;
RasterFxd.DrawFillColor = 65280; //Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE;
RasterFxd.DrawPersistence = true;

//Draw a few shapes on the bitmap
RasterFxd.DrawEllipse(RasterObj, 0, 0, 0, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3);
RasterFxd.DrawLine(RasterObj, 0, 0, RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, 2 * RasterObj.BitmapHeight / 3);
RasterFxd.DrawRectangle(RasterObj, 0, 0, 2 * RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3);

RasterIO.Save(RasterObj, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0);
Response.Write("<IMG SRC='c:\\asp.jpg'>");
%>


Creating and Pasting a Region (ASP - JavaScript)

The following example demonstrates the creation of regions in LEADTOOLS. It uses two LEADRaster objects. It loads an image in the first one and creates an elliptical region in it. It then pastes this region onto the second LEADRaster object and displays the pasted region.

<%@ Language=JavaScript %>
<%
var SAVE_OVERWRITE = 0;
var FILE_JFIF = 10;
var L_RGN_SET = 1;
var CB_DST_0 = 32;
var CB_OP_ADD = 768;

var RasterObj = Server.CreateObject("LEADRaster.LEADRaster");
var RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess");

RasterIO.Load(RasterObj, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);

//Create the region
RasterObj.SetRgnEllipse(0, 0, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 2, L_RGN_SET);

//Create a blank bitmap so that we can "paste" the region onto it
RasterObj2.CreateBitmap(RasterObj.RgnWidth, RasterObj.RgnHeight, RasterObj.BitmapBits);
RasterProc.Fill(RasterObj2, 65535);

//Paste the region
RasterProc.Combine(RasterObj2, 0, 0, RasterObj.RgnWidth, RasterObj.RgnHeight, RasterObj, RasterObj.RgnLeft, RasterObj.RgnTop, CB_DST_0 + CB_OP_ADD);

RasterIO.Save(RasterObj2, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0);
Response.Write("<IMG SRC='c:\\asp.jpg'>");
%>


Combining Images with Regions (ASP - JavaScript)

Copy the following code into an ASP file to combine two images with a region:

<%@ Language=JavaScript %>
<%
var RasterObj = Server.CreateObject("LEADRaster.LEADRaster.145");
var RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster.145");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO.145");
var RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess.140");
var FILE_JFIF = 10;

RasterIO.Load(RasterObj, "d:\\customers\\script.jpg", 0, 0, 1);

var CB_OP_ADD = 768;
var CB_DST_0 = 32;

RasterIO.Load(RasterObj, "d:\\customers\\temp1.jpg", 0, 0, 1);
RasterIO.Load(RasterObj2, "d:\\customers\\script.jpg", 0, 0, 1);

RasterObj.SetRgnRect(100, 100, 300, 300, 0);
RasterProc.Combine(RasterObj, 100, 100, 300, 300,
RasterObj2, 0, 0, CB_OP_ADD + CB_DST_0);
RasterObj.FreeRgn();
RasterIO.Save(RasterObj, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0);
RasterIO.Save(RasterObj2, "c:\\asp2.jpg", FILE_JFIF, 0, 2, 0);

Response.Write("<IMG SRC='c:\\asp.jpg'>");
Response.Write("<IMG SRC='c:\\asp2.jpg'>");

%>


Tutorial for ASP - VBScript Programmers

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

Note:

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

Loading, Saving and Displaying an Image

Writing and Reading Multipage Files

Drawing Simple Lines and Shapes

Creating, Viewing, and Merging Color Separations

Creating and Pasting a Region

Combining Images with Regions (ASP - VBScript)


Loading, Saving and Displaying an Image (ASP -VBScript)

This example dmonstrates how to load and display an image using the LEAD COM objects in ASP. The image is loaded from the server and saved on the server with a different name, then displayed in the browser using the <IMG> HTML tag. Just copy/paste this code into a text file, save it as .asp and open it in an Internet browser.

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj
Dim RasterIO
Dim FILE_JFIF

Set RasterObj = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO")
FILE_JFIF = 10

RasterIO.Load RasterObj, "c:\save.jpg", 0, 0, 1
RasterIO.Save RasterObj, "c:\asp.jpg", FILE_JFIF, 0, 2, 0

Response.Write "<IMG SRC='c:\asp.jpg'>"
%>


Creating, Viewing, and Merging Color Separations (ASP - VBScript)

The following example creates CMYK color separations, saves each of the color planes in a multipage TIFF file, merges the planes, and displays the result. The code inverts the K plane to demonstrate how you can manipulate the color separations:

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj
Dim RasterIO
Dim RasterProc
Dim FILE_JFIF
Dim FILE_TIF
Dim COLORSEP_CMYK
Dim SAVE_OVERWRITE
Dim SAVE_APPEND

COLORSEP_CMYK = 1
SAVE_OVERWRITE = 0
SAVE_APPEND = 1
FILE_JFIF = 10
FILE_TIF = 3

Set RasterObj = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess")

RasterIO.Load RasterObj, "i:\a\pic\20020816demo3.jpg", 0, 0, 1

RasterProc.ColorSeparate RasterObj, COLORSEP_CMYK

'Just for fun, invert the K plane
RasterObj.Bitmap = RasterProc.ColorPlanes(3) 'Copy the K plane
RasterProc.Invert RasterObj 'Invert the K plane
RasterProc.ColorPlanes(3) = RasterObj.Bitmap 'Update the K plane

'Save the color planes into a multipage TIFF file
RasterObj.Bitmap = RasterProc.ColorPlanes(0) 'Cyan
RasterIO.Save RasterObj, "c:\Planes.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE

RasterObj.Bitmap = RasterProc.ColorPlanes(1) 'Magenta
RasterIO.Save RasterObj, "c:\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND

RasterObj.Bitmap = RasterProc.ColorPlanes(2) 'Yellow
RasterIO.Save RasterObj, "c:\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND

RasterObj.Bitmap = RasterProc.ColorPlanes(3) 'K
RasterIO.Save RasterObj, "c:\Planes.tif", FILE_TIF, 24, 0, SAVE_APPEND

'Merge the color planes
RasterProc.ColorMerge RasterObj, COLORSEP_CMYK

RasterProc.ColorPlanes(0) = 0
RasterProc.ColorPlanes(1) = 0
RasterProc.ColorPlanes(2) = 0
RasterProc.ColorPlanes(3) = 0

RasterIO.Save RasterObj, "c:\asp.jpg", FILE_JFIF, 0, 2, 0
Response.Write "<IMG SRC='c:\asp.jpg'>"
%>


Writing and Reading Multipage Files (ASP - VBScript)

This example demonstrates how to create a multipage file on the server, then load and display the images from that file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj1
Dim RasterObj2
Dim RasterIO1
Dim RasterIO2
Dim FILE_TIF
Dim FILE_JFIF
Dim SAVE_OVERWRITE
Dim SAVE_APPEND

Set RasterObj1 = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO1 = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterIO2 = Server.CreateObject("LEADRasterIO.LEADRasterIO")

FILE_TIF = 3
FILE_JFIF = 10
SAVE_OVERWRITE = 0
SAVE_APPEND = 1

'Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load RasterObj1, "i:\a\pic\20020816demo3.jpg", 0, 0, 1
RasterIO2.Load RasterObj2, "i:\a\pic\20020816demo2.jpg", 0, 0, 1

'Save the bitmaps to a single multipage TIFF file
RasterIO1.Save RasterObj1, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE
RasterIO2.Save RasterObj2, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND

'Load the bitmaps from the multipage TIFF file
RasterIO1.Load RasterObj1, "c:\combined.tif", 24, 1, 1
RasterIO2.Load RasterObj2, "c:\combined.tif", 24, 2, 1

'Save the bitmaps to separate JPEG files to display them in the browser window.
RasterIO1.Save RasterObj1, "c:\temp1.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE
RasterIO2.Save RasterObj2, "c:\temp2.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE

Response.Write "<IMG SRC='c:\temp1.jpg'>"
Response.Write "<IMG SRC='c:\temp2.jpg'>"
%>


Drawing Simple Lines and Shapes (ASP - VBScript)

The following example demonstrates how to draw lines and shapes on the bitmap:

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj
Dim RasterIO
Dim RasterFxd
Dim FILE_JFIF
Dim DRAWPENSTYLE_SOLID
Dim DRAWMODE_COPY_PEN
Dim DRAWFILLSTYLE_HORIZONTAL_LINE

DRAWPENSTYLE_SOLID = 0
DRAWMODE_COPY_PEN = 13
DRAWFILLSTYLE_HORIZONTAL_LINE = 2

Set RasterObj = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterFxd = Server.CreateObject("LEADRasterFxd.LEADRasterFxd")
FILE_JFIF = 10

RasterIO.Load RasterObj, "i:\a\pic\20020816demo3.jpg", 0, 0, 1

'Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawPenWidth = 2
RasterFxd.DrawPenColor = RGB(255, 0, 0) 'Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN
RasterFxd.DrawFillColor = RGB(0, 255, 0) 'Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE
RasterFxd.DrawPersistence = True

'Draw a few shapes on the bitmap
RasterFxd.DrawEllipse RasterObj, 0, 0, 0, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3
RasterFxd.DrawLine RasterObj, 0, 0, RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, 2 * RasterObj.BitmapHeight / 3
RasterFxd.DrawRectangle RasterObj, 0, 0, 2 * RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3

RasterIO.Save RasterObj, "c:\asp.jpg", FILE_JFIF, 0, 2, 0
Response.Write "<IMG SRC='c:\asp.jpg'>"
%>


Creating and Pasting a Region (ASP - VBScript)

The following example demonstrates the creation of regions in LEADTOOLS. It uses two LEADRaster objects. It loads an image in the first one and creates an elliptical region in it. It then pastes this region onto the second LEADRaster object and displayes the pasted region.

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj
Dim RasterObj2
Dim RasterIO
Dim RasterProc

Dim FILE_JFIF
Dim SAVE_OVERWRITE
Dim L_RGN_SET
Dim CB_DST_0
Dim CB_OP_ADD

SAVE_OVERWRITE = 0
FILE_JFIF = 10
L_RGN_SET = 1
CB_DST_0 = 32
CB_OP_ADD = 768

Set RasterObj = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess")

RasterIO.Load RasterObj, "i:\a\pic\20020816demo3.jpg", 0, 0, 1

'Create the region
RasterObj.SetRgnEllipse 0, 0, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 2, L_RGN_SET

'Create a blank bitmap so that we can "paste" the region onto it
RasterObj2.CreateBitmap RasterObj.RgnWidth, RasterObj.RgnHeight, RasterObj.BitmapBits
RasterProc.Fill RasterObj2, RGB(0, 255, 255)

'Paste the region
RasterProc.Combine RasterObj2, 0, 0, RasterObj.RgnWidth, RasterObj.RgnHeight, RasterObj, RasterObj.RgnLeft, RasterObj.RgnTop, CB_DST_0 + CB_OP_ADD

RasterIO.Save RasterObj2, "c:\asp.jpg", FILE_JFIF, 0, 2, 0
Response.Write "<IMG SRC='c:\asp.jpg'>"
%>


Combining Images with Regions (ASP - VBScript)

Copy the following code into an ASP file to combine two images with a region:

<%@ Language=VBScript %>
<%
Dim RasterObj
Dim RasterObj2
Dim RasterIO
Dim RasterProc

Set RasterObj = Server.CreateObject ("LEADRaster.LEADRaster.145")
Set RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster.145")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO.145")
Set RasterProc = Server.CreateObject("LEADRasterProcess.LEADRasterProcess.145")

Dim FILE_JFIF
FILE_JFIF = 10

RasterIO.Load RasterObj, "d:\customers\script.jpg", 0, 0, 1

Dim CB_OP_ADD
Dim CB_DST_0

CB_OP_ADD = 768
CB_DST_0 = 32

RasterIO.Load RasterObj, "d:\\customers\\script.jpg", 0, 0, 1
RasterIO.Load RasterObj2, "d:\\customers\\temp1.jpg", 0, 0, 1

RasterObj.SetRgnRect 100, 100, 300, 300, 0
RasterProc.Combine RasterObj, 100, 100, 300, 300, RasterObj2, 0, 0, CB_OP_ADD + CB_DST_0
RasterObj.FreeRgn
RasterIO.Save RasterObj, "c:\\asp.jpg", FILE_JFIF, 0, 2, 0
RasterIO.Save RasterObj2, "c:\\asp2.jpg", FILE_JFIF, 0, 2, 0

Response.Write "<IMG SRC='c:\\asp.jpg'>"
Response.Write "<IMG SRC='c:\\asp2.jpg'>"

%>


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
Online Support / FAQs | http://www.leadtools.com (click on Customers Only)
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

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

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


Properties, Methods, and Events

Working with the Control

General Behavior

Client Area Usage

Raster Images

Input and Output

Creation, Deletion, and Copying

Palettes

Displaying and Printing

Image Processing

Region Processing

MRC Bitmap

Fourier Transform Functions

Analysis

Working with Geo Keys

Drawing Effects

3D Drawing Special Effects

Annotations (Document/Medical only)

Input and Output

Automation

Annotation Events

Annotation Security

Annotation Hyperlinks

Displaying Annotations

Using the Clipboard

Object Manipulation

Bitmap

Annotation Object Bitmap

Creating and Deleting Annotations

Getting and Setting Color Properties

Creating Custom Annotations

Databases

Databases: Using ODBC

Databases: ILEADRasterOLEDB

Support

Version and License Information

Creating Instances of Licensed COM Objects

Using a Variant Object

Optimizer

Optimization Methods

PDF Compressor

Creating a File


Drawing Effects: 3D Drawing Special Effects

Specifying the bitmap as the drawing surface:

DrawPersistence property

Drawing simple objects:

DrawLine method

DrawEllipse method

DrawRectangle method

DrawFillColor property

DrawFillStyle property

DrawMode property

DrawPenColor property

DrawPenStyle property

DrawPenWidth property

Drawing three-dimensional shapes:

DrawShape method

ShapeLeft property

ShapeTop property

ShapeWidth property

ShapeHeight property

ShapeBackgroundStyle property

BackgroundImageHeight property

BackgroundImageLeft property

BackgroundImageTop property

BackgroundImageWidth property

PatternStyle property

PatternBackColor property

PatternForeColor property

ShapeBorderColor property

ShapeBorderStyle property

ShapeBorderThickness property

ShapeInnerBandHiliteColor property

ShapeInnerBandShadowColor property

ShapeInnerBandStyle property

ShapeInnerBandThickness property

ShapeOuterBandHiliteColor property

ShapeOuterBandShadowColor property

ShapeOuterBandStyle property

ShapeOuterBandThickness property

ShadowColor property

ShadowXDepth property

ShadowYDepth property

Drawing three-dimensional text objects:

DrawText method

TextLeft property

TextTop property

TextWidth property

TextHeight property

TextAlign property

Font property

DrawFontColor property

TextStyle property

TextWordWrap property

TextAngle property

TextHiliteColor property

ShadowColor property

ShadowXDepth property

ShadowYDepth property

DrawTextHeight method

DrawTextWidth method

Source and destination rectangle properties:

DstLeft property

DstTop property

DstRight property

DstBottom property

SrcLeft property

SrcTop property

SrcRight property

SrcBottom property

ScaleMode property

ClientSizeX property

ClientSizeY property


Working with the Control: General Behavior

Working with the Control:
General Behavior

Control usage:

Enabled property

EnableMethodErrors property

EnableProgressEvent property

MouseIcon property

MousePointer property

OLEDropAllowed property

OLEDropFile event

ProgressStatus event

Window property

Appearance:

Appearance property

BackColor property

Transparent property

BorderStyle property

FrameThickness property

FrameColor property

FrameInnerStyle property

FrameInnerThickness property

FrameInnerHiliteColor property

FrameInnerShadowColor property

FrameOuterStyle property

FrameOuterThickness property

FrameOuterHiliteColor property

FrameOuterShadowColor property

Keyboard events:

KeyDown event

KeyUp event

KeyPress event

Mouse events:

Click event

DblClick event

EnableFireMouse2Event property

EnableMouseWheel property

MouseDown event

MouseDown2 event

MouseMove event

MouseMove2 event

MouseUp event

MouseUp2 event

MouseWheel event

Input/Output File Format Filters:

IgnoreFilters method

PreLoadFilters method


Working with the Control: Client Area Usage

Working with the Control:
Client Area Usage

Mouse events:

Click event

DblClick event

EnableFireMouse2Event property

EnableMouseWheel property

MouseDown event

MouseDown2 event

MouseMove event

MouseMove2 event

MouseUp event

MouseUp2 event

MouseWheel event

Display events:

Scroll event

Paint event

RubberBand event

Selecting a rectangular area:

AutoRubberBand property

MousePointer property

MouseIcon property

RubberBandHeight property

RubberBandLeft property

RubberBandTop property

RubberBandVisible property

RubberBandWidth property

SetRubberBandRect method

Getting the device context:

GetClientDC method

ReleaseClientDC method

Getting client-area measurements:

ScaleMode property

ScaleHeight property

ScaleLeft property

ScaleTop property

ScaleWidth property

Converting Between Bitmap and Client Coordinates

BitmapToClient method

ClientToBitmap method

ConvertX property

ConvertY property

Specifying gradient colors or patterns:

GradientStyle property

GradientStartColor property

GradientEndColor property

GradientSteps property

PatternStyle property

PatternBackColor property

PatternForeColor property


Raster Images: Input and Output

Raster Images:
Input and Output

Loading Files

Saving Files

Getting and Setting File Information

Loading and Saving Large TIFF Images

Loading and Saving Stamp Images

Capturing a Screen Image

Exchanging Images with Other Objects

Using the Thumbnail Browser

Scanning Images using ISIS

MarkersRaster

Maintaining TIFF Tags

Maintaining File Comments

Compression Functionality


Raster Images: Capturing a Screen Image

Raster Images:
Input and Output
Capturing a Screen Image

Capture method

EnableZoomInRect property

ZoomIn method

ZoomInDone event


Raster Images: Compression Functionality

Raster Images:
Input and Output
 Compression Functionality

ABIC Compression:

EncodeABIC method

DecodeABIC method


Raster Images: Exchanging Images with Other Objects

Raster Images:
Input and Output
Exchanging Images with Other Objects

Picture object:

GetPicture method

SetPicture method

LEAD OLE Server:

SetServerBitmap method

GetServerBitmap method

DIB:

GetDIB method

GetDIB2 method

SetDIB method

DDB:

GetDDB method

SetDDB method

Windows Clipboard:

Copy method

Paste method


Raster Images: Input/Output File Filters

Raster Images:
Input and Output
Input/Output File Filters

IgnoreFilterList property

IgnoreFilters method

PreLoadFilterCachedCount property

PreLoadFilterFixedCount property

PreLoadFilterList property

PreLoadFilters method


Raster Images: Using Thumbnail Browser

Raster Images:
Input and Output
Using the Thumbnail Browser

BrowseDir method

ContinueBrowse property

CreateThumbnailFromFile method

DitherFlags property

EnableMethodErrors property

ExpandMultipage property

Filter property

ForceSize property

IncludeSubDirectories property

InfoBits property

InfoCompression property

InfoFormat property

InfoIFD property

InfoHeight property

InfoPage property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoWidth property

InfoXRes property

InfoYRes property

LoadStamp property

MaintainAspect property

MaxSizeDisk property

MaxSizeMem property

PaletteFlags property

Resample property

SkipFile property

StopOnError property

ThumbnailBackgroundColor property

ThumbnailBitsPerPixel property

ThumbnailEvent event

ThumbnailHeight property

ThumbnailWidth property


Raster Images: Scanning Images using ISIS

Raster Images:
Input and Output
Scanning Images using ISIS

Before scanning:

DriverName property

EnableISISEvent property

EnableMethodErrors property

ISISGetTag method

IsISISAvailable property

ISISLoadDriver method

ISISSelect method

ISISSetScanOptions method

ISISSetTag method

Scanning:

ISISAcquire method

ISISAcquireMulti method

ISISPage event

After Scanning:

ISISUnloadDriver method

PagesDiscarded property


Raster Images: Markers

Raster Images:
Input and Output
Markers

CopyMarkers method

Count property

CreateMarkers method

DeleteMarker method

DeleteMarkerAt method

Element property

ElementCount property

EnumerateMarkers event

EnumMarkers method

GetMarker method

GetMarkers method

InsertMarker method

Load method

SetMarkers method

Type property

WriteMetaData method


Raster Images: Getting and Setting File Information

Raster Images:
Input and Output
Getting and Setting File Information

Getting information:

Directory property

EnumTags event

EnumFileTags method

ExtractMessage method

FileName property

GetFileInfo method

GetMemoryInfo method

GetTagCount method

GetTagData method

GetTagType method

InfoBits property

InfoCompress property

InfoFormat property

InfoHasAlpha property

InfoHeight property

InfoIFD property

InfoLayers property

InfoPage property

InfoPCDRes property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoViewPerspective property

InfoWidth property

InfoXRes property

InfoYRes property

IsSigned property

LoadResolutionCount property

LoadResolutionHeight property

LoadResolutionWidth property

Message property

Password property

ReadComment method

ReadFileCommentOffset method

ReadLoadResolutions method

ReadTag method

ReadTagMemory method

StartX property

StartY property

Setting information:

AddMessage method

AnimationBackColor property

AnimationBitsPerPixel property

AnimationHeight property

AnimationPalette property

AnimationWidth property

Comment property

Directory property

FileName property

Message property

Password property

ProgressivePasses property

SavePage property

SaveResolutionCount property

SaveResolutionHeight property

SaveResolutionWidth property

SetTag method

StartX property

StartY property

WriteComment method

WriteTag method

Deleting information:

DeleteTag method


Raster Images: Loading and Saving Large TIFF Files

Raster Images:
Loading and Saving Large TIFF Files

CompactFile method

IgnoreViewPerspective property

InfoIFD property

LoadIFD property

Save IFD property


Raster Images: Loading and Saving Stamp Images

Raster Images:
Input and Output
Loading and Saving Stamp Images

LoadStamp method

SaveWithStamp method


Raster Images: Loading Files

Raster Images:
Input and Output
Loading Files

Getting information before loading:

ColorSpace property

GetFileInfo method

GetMemoryInfo method

InfoBits property

InfoCompress property

InfoFormat property

InfoHasAlpha property

InfoHeight property

InfoLayers property

InfoPage property

InfoPCDRes property

InfoSizeDisk property

InfoSizeMem property

InfoXRes property

InfoYRes property

InfoIFD property

InfoViewPerspective property

InfoWidth property

ReadLoadResolutions method

LoadResolutionCount property

LoadResolutionHeight property

LoadResolutionWidth property

Optional settings before loading:

DJVResolution property

GetLoadResolution method

LoadCompressed property

LoadInfo event

LoadInfoBits property

LoadInfoFlags property

LoadInfoFormat property

LoadInfoHeight property

LoadInfoOffset property

LoadIFD property

LoadInfoWidth property

LoadInfoXRes property

LoadInfoYRes property

LoadSigned property

LoadUseViewPerspective property

PaintWhileLoad property

PCDRes property

PDFDisplayDepth property

PDFGraphicsAlpha property

PDFTextAlpha property

PDFUseLibFonts property

PDFXResolution property

PDFYResolution property

PDFInitDir property

PLTPenColor property

PLTPenWidth property

PTKResolution property

ProgressivePasses property

RasterizeViewMode property

RasterizeViewportHeight property

RasterizeViewportWidth property

RTFTopMarg property

RTFBottomMarg property

RTFRightMarg property

RTFLeftMarg property

RTFPaperWidth property

RTFPaperHeight property

SetLoadResolution method

TXTBold property

TXTBottomMarg property

TXTEnabled property

TXTFaceName property

TXTFontColor property

TXTFontSize property

TXTHighlight property

TXTItalic property

TXTLeftMarg property

TXTPaperHeight property

TXTPaperWidth property

TXTRightMarg property

TXTStrikeThrough property

TXTTopMarg property

TXTUnderLine property

UseFastConversion property

WMFResolution property

FastLoad property

EnableLoadInfoEvent property

Alternatives to load from a file on a disk:

Load method

LoadLayer method

LoadResize method

LoadStamp method

OLEDropAllowed property

OLEDropFile event

CMYKRaster property

CMYKRasterCount property

LoadFileCMYKArray method

RasterIO property

Loading from the Internet or from a file on a disk:

BitmapDataPath method

ReadyState property

ReadyStateChange event

Loading from a file in memory:

LoadArray method

LoadBuffer method

LoadMemory method

Loading from a specific location within a file:

LoadOffset method

Loading Embedded ICC Profiles

LoadICCProfile method

LoadICCProfile2 method

Where you supply the image data to load:

StartFeedLoad method

FeedLoad method

StopFeedLoad method

Events during a load:

FilePage event

Change event

Loading Corrupted Files

LoadStatus property


Raster Images: Saving Files

Raster Images:
Input and Output
Saving Files

Optional settings before saving:

Comment property

ProgressivePasses property

SaveInterlaced property

AnimationBackColor property

AnimationBitsPerPixel property

AnimationPalette property

AnimationWidth property

AnimationHeight property

JBIG2GBATX1 property

JBIG2GBATY1 property

JBIG2GBATX2 property

JBIG2GBATY2 property

JBIG2GBATX3 property

JBIG2GBATY3 property

JBIG2GBATX4 property

JBIG2GBATY4 property

JBIG2TemplateType property

JBIG2SaveFlags property

LayerLeft property

LayerTop property

LZWAutoClear property

PDFSaveLowMemory property

PDFSaveUseDPI property

SaveLayers property

SaveLSB property

SavePad4 property

SavePage property

SaveResolutionCount property

SaveResolutionHeight property

SaveResolutionWidth property

Alternatives to save a file on disk:

Save method

SaveOffset Method

SaveWithStamp method

CMYKRaster property

CMYKRasterCount property

SaveFileCMYKArray method

RasterIO property

Saving a file in memory:

EnableSaveBufferEvent property

SaveArray method

SaveBuffer event

SaveBuffer method

SaveBufferAddress property

SaveBufferSize property

SaveMemory method

SaveMemory2 method

SaveMemory2Handle property

SaveMemory2Size property

Information available after saving:

FileSizeWritten Property

Installing Filters from the Internet:

InstallFilter method

SetFilterUrl method

Optional settings for saving PDF files:

EnablePDF128bit property

PDFEncryptFlags property

PDFOwnerPassword property

PDFSaveLowMemory property

PDFSaveUseDPI property

PDFUserPassword property

Optional settings for saving JPEG 2000 files:

J2KCBS_ErrorResilienceSymbol property

J2KCBS_PredictableTermination property

J2KCBS_ResetContextOnBoundaries property

J2KCBS_SelectiveACBypass property

J2KCBS_TerminationOnEachPass property

J2KCBS_VerticallyCausalContext property

J2KCodBlockHeight property

J2KCodBlockWidth property

J2KCompressionControl property

J2KCompressionRatio property

J2KDecompLevel property

J2KDerivedBaseExponent property

J2KDerivedBaseMantissa property

J2KDerivedQuantization property

J2KGuardBits property

J2KProgressOrder property

J2KROIControl property

J2KROIHeight property

J2KROILeft property

J2KROITop property

J2KROIWidth property

J2KSetDefaults method

J2KTargetFileSize property

J2KUseColorTransform property

J2KUseEPHMarker property

J2KUseROI property

J2KUseSOPMarker property

J2KXOsiz property

J2KXTOsiz property

J2KXTsiz property

J2KYOsiz property

J2KYTOsiz property

J2KYTsiz property

Optional settings for saving TIF files:

SaveTileHeight property

SaveTileWidth property

Saving ICC Profiles

SaveICCProfile method

SaveICCProfile2 method


Raster Images: Maintaining File Comments

Raster Images:
Input and Output
Maintaining File Comments

Comment property

ReadComment method

ReadFileCommentOffset method

WriteComment method


Raster Images: Maintaining TIFF Tags

Raster Images:
Input and Output
Maintaining TIFF Tags

DeleteTag method

EnumTags event

EnumFileTags method

GetTagCount method

GetTagData method

GetTagType method

ReadTag method

SetTag method

StopFireEnumTags property

WriteTag method


Raster Images: Analysis

Raster Images:
Analysis

Object or Region Analysis


Raster Images: Fourier Transform Functions

Raster Images:
Fourier Transform Functions

InitFourierTransformation method

DiscreteFourierTransformation method

FastFourierTransformation method

FreeFourierTransformation method

DisplayFourierTransformation method

FrequencyFilterMask method


Raster Images: Object or Region Analysis

Raster Images:
Analysis
Object or Region Analysis

GetBitmapStatisticsInfo method

BitmapStandardDeviation property

BitmapMean property

BitmapMedian property

BitmapMaxValue property

BitmapMinValue property

BitmapPixelsCount property

BitmapTotalPixelCount property

BitmapSelectedPixelPercent property

GetFeretsDiameter method

GetObjectInfo method

GetRgnContourPoints method

GetRgnPerimeterLength method


Raster Images: MRC Bitmap

Raster Images (Document/Medical only)::
MRC Bitmap

Automatic Segmentation

Loading a Page

Manipulating Segments

Manual Segmentation

Saving a Page

General Segmentation

Auxiliary Elements


Raster Images: Automatic Segmentation

Raster Images (Document/Medical only)::
MRC Bitmap
Automatic Segmentation

AutoSegment method

CombineFactor property

CombineFlags property

ImageType property

SegmentExt method

Sensitivity property

StartSegmentation method

StopSegmentation method


Raster Images: Loading a Page

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

GetPagesCount method

Load methodILEADRasterMRCLoadmethod


Raster Images: Manipulating Segments

Raster Images (Document/Medical only)::
MRC Bitmap
Manipulating Segments

CombineFactor property

CombineFlags property

CombineSegments method

CopySegmentationHandle method

DeleteSegment method

EnumSegments method

EnumSegments event

LoadSegmentation method

SaveSegmentation method

SetSegmentData method

StartSegmentation method

StopSegmentation method


Raster Images: Manual Segmentation

Raster Images (Document/Medical only)::
MRC Bitmap
Manual Segmentation

CombineFactor property

CombineFlags property

CombineSegments method

CopySegmentationHandle method

CreateNewSegment method

DeleteSegment method

EnumSegments event

EnumSegments method

SaveSegmentation method

SetSegmentData method

StartSegmentation method

StopSegmentation method


Raster Images: Manual Segmentation

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

Save method

SaveList method

SaveT44 method

Grayscale2BitCoder property

Grayscale8BitCoder property

Grayscale8BitQFactor property

MaskCoder property

PictureCoder property

PictureQFactor property

Text2BitCoder property


Raster Images: General Segmentation

Raster Images (Document/Medical only)::
MRC Bitmap
General Segmentation

BaseBackColor property

BaseForeColor property

CombineFlags property

CombineFactor property

CombineSegments method

CopySegmentationHandle method

CreateNewSegment method

DeleteSegment method

EnumSegments event

EnumSegments method

ImageType property

SaveSegmentation method

Sensitivity property

SetSegmentData method

StartSegmentation method

StopSegmentation method


Raster Images: Auxiliary Elements

Raster Images (Document/Medical only)::
MRC Bitmap
Auxiliary Elements

EnableMethodErrors property


Raster Images: Creation, Deletion, and Copying

Raster Images:
Creation, Deletion, and Copying

Creating and Deleting Images

Creating and Maintaining Lists of Images

Using the Clipboard

Copying Images


Raster Images: Copying Images

Raster Images:
Creation, Deletion, and Copying
Copying Images

Copying whole bitmaps:

Bitmap property

BitmapList property

Raster property

Copying part of one bitmap to another bitmap:

Combine method

CombineBitmapWarp method

CombineExt method

Raster property

Creating and using a floater (Document/Medical only):

Floater property

FloaterVisible property

IsPtInFloater method

SetFloaterDstRect method

SetFloaterDstClipRect method

FloaterDstHeight property

FloaterDstLeft property

FloaterDstTop property

FloaterDstWidth property

FloaterDstClipHeight property

FloaterDstClipLeft property

FloaterDstClipTop property

FloaterDstClipWidth property

FloaterHeight property

FloaterWidth property

OLE Drag and Drop

EnableOLEDragMethod property

EnableOLEDragMethod property (ILEADRasterImgList)

EnableUseDefaultCursor property

EnableUseDefaultCursor property (ImageList Control)

OLECompleteDrag event

OLECompleteDrag event (ILEADRasterImgList)

OLEDragCursor property

OLEDragCursor property (ILEADRasterImgList)

OLEDragOver event

OLEDragOver event (ILEADRasterImgList)

OLEGiveFeedback event

OLEGiveFeedback event (ILEADRasterImgList)

OLEStartDrag event

OLEStartDrag event (ILEADRasterImgList)


Raster Images: Creating and Deleting Images

Raster Images:
Creation, Deletion, and Copying
Creating and Deleting Images

Creating an image:

CreateBitmap method

CreateUserBitmap method

Fill method

GetBitmapDC method

GetMemoryInfo method

GetMemoryThresholds method

MaxConventionalSize property

MemoryConventionalBuffers property

MemoryConventionalTile property

MemoryFlags property

MemoryInfoConventionalTiles property

MemoryInfoFlags property

MemoryInfoMaxTileViews property

MemoryInfoTileSize property

MemoryInfoTileViews property

MemoryInfoTotalTiles property

MemoryInfoType property

MemoryTiledThreshold property

ReleaseBitmapDC method

Raster property

SetBitmapDataPointer method

SetMemoryInfo method

SetMemoryThresholds method

TempDirectory property

TiledBitmapsSize property

Deleting images:

Bitmap property

DeleteBitmapListItems method

DeletePage method

Raster property


Raster Images: Creating and Maintaining Lists of Images

Raster Images:
Creation, Deletion, and Copying
Creating and Maintaining Lists of Images

Creating, saving, and deleting lists:

Load method

Save method

BitmapList property

Slice method

OnSliceBitmap Event

SliceDeskewAngle property

ContinueSlicing property

Maintaining list items:

InsertBitmapListItem method

DeleteBitmapListItems method

Accessing bitmaps in a list:

BitmapListIndex property

BitmapListCount property

Bitmap property

Assigning bitmap lists from one control to another:

RefBitmapList property


Raster Images: Using the Clipboard

Raster Images:
Creation, Deletion, and Copying
Using the Clipboard

Copy method

Paste method


Raster Images: Palettes

Raster Images:
Palettes

Manipulating palettes:

BitmapPalette property

GetLinearVOILUT method

GetPalette method

IOPalette property

LUTColorsCount property

LUTColorsFirstIndex property

UseLUT property

UserPalette property

UserWindowCenter property

UserWindowWidth property

Implementing palettes:

ColorRes method

ColorResList method

PaintPalette property

Implementing window leveling:

Note: This topic is for Document/Medical edition only.

Document/Medical Toolkits

WindowLevel method

WindowLevel method

GetMinMaxBits method

GetMinMaxVal method

LevelLowBit property

LevelHighBit property

LevelLUT property

LevelLUTLength property

MaxBit property

MaxVal property

MinBit property

MinVal property

SetMinMaxBits method


Raster Images: Displaying and Printing

Raster Images:
Displaying and Printing

Cleaning - up 1-Bit Images

Displaying Images

Implementing Special Effects

Playing Animated Images

Printing Images


Raster Images: Cleaning - up 1-Bit Images

Raster Images:
Displaying and Printing
Cleaning - up 1-Bit Images

(Document/Medical only)

BorderRemove event

BorderRemove method

DocCleanSuccess property

DotRemove event

DotRemove method

EnableDocCleanEvents property

hDocCleanRgn property

HolePunchRemove event

HolePunchRemove method

InvertedText event

InvertedText method

LineRemove event

LineRemove method

Smooth event

Smooth method


Raster Images: Displaying Images

Raster Images:
Displaying and Printing
Displaying Images

Setting the control's appearance:

Appearance property

BackColor property

BorderStyle property

FrameThickness property

FrameColor property

FrameInnerStyle property

FrameInnerThickness property

FrameInnerHiliteColor property

FrameInnerShadowColor property

FrameOuterStyle property

FrameOuterThickness property

FrameOuterHiliteColor property

FrameOuterShadowColor property

Transparent property

Automated display options:

AutoRepaint property

AutoScroll property

AutoSetRects property

AutoSize property

CenterImage property

PaintSizeMode property

PaintSizeUseDPI property

PaintZoomFactor property

ZoomToRect method

Displaying CMYK Files:

CMYKRaster property

CMYKRasterCount property

EnablePaintCMYKArray property

LoadFileCMYKArray method

RasterIO property

Painting options:

PaintRgnOnly property

BackErase property

BitonalScaling property (Document/Medical only)

DoubleBuffer property

EffectCycles property

EffectSpeed property

ForePalette property

PaintDither property

PaintEffect property

PaintPalette property

PaintROP3 property

PaintGamma property

PaintIntensity property

PaintContrast property

EnablePaint property

PaintScaling property

Forced painting:

ForceRepaint method

RepaintRect method

Getting client-area measurements:

ScaleMode property

ScaleHeight property

ScaleLeft property

ScaleTop property

ScaleWidth property

Converting between client and bitmap coordinates

BitmapToClient method

ClientToBitmap method

ConvertX property

ConvertY property

Painting OCR Data in the ILEADRasterView Control

EnableOCRDrawing property

RasterDocument property

SelectedZoneIndex property

Setting source and destination rectangles:

SetDstClipRect method

SetDstRect method

SetSrcClipRect method

SetSrcRect method

Source and destination rectangle properties:

SrcHeight property

SrcLeft property

SrcTop property

SrcWidth property

SrcClipHeight property

SrcClipLeft property

SrcClipTop property

SrcClipWidth property

DstHeight property

DstLeft property

DstTop property

DstWidth property

DstClipHeight property

DstClipLeft property

DstClipTop property

DstClipWidth property

Scrolling an Image

AutoScroll property

HScrollInfo property

Scroll event

VScrollInfo property

Using a PanWindow:

PanWin event

PanWinBitonalScaling property

PanWinCursor property

PanWinHeight property

PanWinIcon property

PanWinPaintDither property

PanWinPaintPalette property

PanWinPaintScaling property

PanWinPointer property

PanWinRectColor property

PanWinSysMenu property

PanWinTitle property

PanWinWidth property

PanWinX property

PanWinY property

ShowPanWin method

Using the Magnifying Glass

AnnEnableMagGlass property

AnnMagGlass method

EnableMagGlassDraw property

EnableMagGlassEvent property

HasMagGlass property

MagGlassCursor event

MagGlassExt event

MagGlassFlags property

MagGlassMask property

MagGlassMaskCount property

MagGlassOwnerDraw event

MagGlassPaintContrast property

MagGlassPaintGamma property

MagGlassPaintIntensity property

SetMagGlassPos method

ShowMagGlass method

StartMagGlass method

StopMagGlass method

UpdateMagGlassShape method

UpdateMagGlass method

UpdateMagGlassFromHandle method

Using the Zoom View (Document/Medical only)

ILEADRasterZoomView

AnnContainer property (ILEADRasterZoomView)

BorderColor property (ILEADRasterZoomView)

BorderStyle property (ILEADRasterZoomView)

CalloutColor property (ILEADRasterZoomView)

CalloutPenStyle property (ILEADRasterZoomView)

DstHeight property (ILEADRasterZoomView)

DstLeft property (ILEADRasterZoomView)

DstTop property (ILEADRasterZoomView)

DstWidth property (ILEADRasterZoomView)

EnableCallouts property (ILEADRasterZoomView)

Enabled property (ILEADRasterZoomView)

ForceDst property (ILEADRasterZoomView)

Index property (ILEADRasterZoomView)

PenStyle property (ILEADRasterZoomView)

SrcBorderColor property (ILEADRasterZoomView)

SrcBorderStyle property (ILEADRasterZoomView)

SrcHeight property (ILEADRasterZoomView)

SrcLeft property (ILEADRasterZoomView)

SrcPenStyle property (ILEADRasterZoomView)

SrcTop property (ILEADRasterZoomView)

SrcWidth property (ILEADRasterZoomView)

ZoomFactor property (ILEADRasterZoomView)

ILEADRasterView

HasZoomView property

ZoomViewsCount property

CreateZoomView method

DestroyZoomView method

GetZoomView method

UpdateZoomView method

AnnEnableZoomView property

Using the Image List Control

AllowSelection property (ILEADRasterImgList)

Appearance property (ILEADRasterImgList)

BackColor property (ILEADRasterImgList)

BitonalScaling property (ILEADRasterImgList)

BorderColor property (ILEADRasterImgList)

BorderStyle property (ILEADRasterImgList)

Clear method (ILEADRasterImgList)

Click event (ILEADRasterImgList)

ColumnCount property (ILEADRasterImgList)

ControlWindow property (ImageList Control)

Count property (ILEADRasterImgList)

CurrentPage property (ILEADRasterImgList)

DblClick event (ILEADRasterImgList)

DisplayItemText property (ILEADRasterImgList)

EnableKeyboard property (ILEADRasterImgList)

EnableMethodErrors property (ILEADRasterImgList)

EnsureVisible method (ILEADRasterImgList)

ExportBitmapList method (ILEADRasterImgList)

ExportedBitmapList property (ILEADRasterImgList)

FirstVisibleItem property(ImageList Control)

Font property (ILEADRasterImgList)

ForeColor property (ILEADRasterImgList)

HitTest method (ILEADRasterImgList)

ImportBitmapList method (ILEADRasterImgList)

Insert method (ILEADRasterImgList)

InsertAt method (ILEADRasterImgList)

InsertFromBitmapList method (ILEADRasterImgList)

Item property (ILEADRasterImgList)

ItemBackgroundColor property (ILEADRasterImgList)

ItemHeight property (ILEADRasterImgList)

ItemHorizontalSpacing property (ILEADRasterImgList)

ItemSelected event (ILEADRasterImgList)

ItemUnSelected event (ILEADRasterImgList)

ItemVerticalSpacing property (ILEADRasterImgList)

ItemWidth property (ILEADRasterImgList)

KeyDown event (ILEADRasterImgList)

KeyPress event (ILEADRasterImgList)

KeyUp event (ILEADRasterImgList)

LoadDatabase method (ILEADRasterImgList)

LoadFromFile method (ILEADRasterImgList)

MouseDown event (ILEADRasterImgList)

MouseIcon property (ILEADRasterImgList)

MouseMove event (ILEADRasterImgList)

MousePointer property (ILEADRasterImgList)

MouseUp event (ILEADRasterImgList)

OwnerDrawItem event (ImageList Control)

OwnerDrawItems property (ImageList Control)

PageCount property (ILEADRasterImgList)

PaintDither property (ILEADRasterImgList)

PaintScaling property (ILEADRasterImgList)

Remove method (ILEADRasterImgList)

Resize event (ILEADRasterImgList)

RowCount property (ILEADRasterImgList)

SaveDatabase method (ILEADRasterImgList)

SaveToFile method (ILEADRasterImgList)

ScaleHeight property (ILEADRasterImgList)

ScaleLeft property (ILEADRasterImgList)

ScaleMode property (ILEADRasterImgList)

ScaleTop property (ILEADRasterImgList)

ScaleWidth property (ILEADRasterImgList)

Scroll event (ILEADRasterImgList)

ScrollItems method (ILEADRasterImgList)

ScrollStyle property (ILEADRasterImgList)

SelectAll method (ILEADRasterImgList)

SelectedCount property (ImageList Control)

SelectedItems property (ImageList Control)

SelectionColor property (ILEADRasterImgList)

SelectionStyle property (ILEADRasterImgList)

SetSelectionBitmap method (ILEADRasterImgList)

Sort method (ILEADRasterImgList)

SortExt method (ILEADRasterImgList)

ViewSize property (ILEADRasterImgList)

Window property (ILEADRasterImgList)


Raster Images: Implementing Special Effects

Raster Images:
Displaying and Printing
Implementing Special Effects

Specifying effects and transitions:

PaintEffect property

TransitionStyle property

TransitionEffect property

Controlling speed and granularity:

EffectDelay property

EffectGrain property

TransitionDelay property

Controlling multiple passes:

PaintEffectPass property

PaintNotificationDelay property

PaintNotification event

PaintEffectMaxPasses property

PaintTransitionMaxPasses property

PaintTransitionPass property

Using a transparent color:

Transparent property

BitmapEnableTransparency property

BitmapTransparentColor property

Using a wand:

WandColor property

WandSize property

Specifying transition colors or patterns:

GradientStyle property

GradientStartColor property

GradientEndColor property

GradientSteps property

PatternStyle property

PatternBackColor property

PatternForeColor property


Raster Images: Playing Animated Images

Raster Images:
Displaying and Printing
Playing Animated Images

Starting and stopping a playback:

AutoAnimate property

AutoAnimationLoop property

AnimationLoop property

AnimationEnable property

Animate event

Information in an animated file:

GetFileInfo method

InfoAnimation property

InfoAnimationHeight property

InfoAnimationWidth property

Bitmap behavior during playback:

BitmapDelay property

BitmapDisposalMethod property

BitmapEnableTransparency property

BitmapTransparentColor property

Bitmap positioning during playback:

BitmapLeft property

BitmapTop property

Playback target properties:

AnimationBackColor property

AnimationBitsPerPixel property

AnimationPalette property

AnimationWidth property

AnimationHeight property


Raster Images: Printing Images

Raster Images:
Displaying and Printing
Printing Images

Render method

PrintEnd method

PrintStart method

PrintNewPage method

PrinterScaleHeight property

PrinterScaleWidth property


Raster Images: Image Processing

Raster Images:
Image Processing

Getting Current Information

Doing Color Space Conversions

Doing Color Expansion or Reduction

Doing Geometric Transformations

Modifying Individual Pixels

Modifying Intensity Values

Filtering Images

Using Histograms

Using the Alpha Channel

Combining Images

Drawing on a Bitmap

Artistic Effects

Comparing Images

Document Imaging


Raster Images: Combining Images

Raster Images:
Image Processing
Combining Images

General

AddWeightedBitmaps method

AddWeightedBitmaps method

AlphaBlend method

BumpMap method

Canvas method

Combine method

CombineBitmapWarp method

CombineExt method

CorrelationList method

CorrelationListCount property

CorrelationListIndex property

CorrelationListMaxPoints property

CorrelationListX property

CorrelationListY property

CreateFadedMask method

Factor property

FactorCount property

FeatherAlphaBlend method

Fragment method

Multiply method

Picturize method

PicturizeBitmapList method

PicturizeSingle method

TextureAlphaBlend method

Underlay method

Vignette method

DICOM Overlays

ActivationLayer property

BitPosition property

BitsAllocated property

Color property

Columns property

Description property

Flags property

ImageFrameOrigin property

Label property

NumberFramesInOverlay property

OriginX property

OriginY property

OverlayAttributes property (ILEADRasterProcess)

ROIArea property

ROIMean property

ROIStandardDeviation property

Rows property

Subtype property

Type property


Raster Images: Doing Color Expansion or Reduction

Raster Images:
Image Processing
Doing Color Expansion or Reduction

Automated color reduction:

PaintDither property

General color expansion or reduction:

ColorHalfTone method

ColorRes method

ColorResList method

ConvertSignedToUnsigned method

HalfTonePattern method

Pointillist method

Support for dithering to a custom palette:

UserPalette property

Specialized color expansion or reduction:

AutoBinary method

ChannelMix method

ColorizeGray method

ConvertToColoredGray method

Desaturate method

DynamicBinary method

GrayColorBlue property

GrayColorCount property

GrayColorGreen property

GrayColorRed property

GrayColorThreshold property

Grayscale method

GrayscaleExt method

GrayScaleToDuotone method

GrayScaleToMultitone method

Halftone method

IsGrayscale property

SampleTarget method

Segment method

SelectData method

ShiftData method


Raster Images: Doing Color Space Conversions

Raster Images:
Image Processing
Doing Color Space Conversions

ColorMerge method

ColorPlanes property

ColorSeparate method

ColorThreshold method

ColorThreshold method

ComponentFlags property

ComponentFlags property

ComponentMaxRange property

ComponentMaxRange property

ComponentMinRange property

ComponentMinRange property

HSV_HfromRGB method

HSV_SfromRGB method

HSV_VfromRGB method

RGBfromHSV method


Raster Images: Doing Geometric Transformations

Raster Images:
Image Processing
Doing Geometric Transformations

Resizing a bitmap:

Size method

Resize event

Other transformations:

AutoTrim method

Bending method

Cylindrical method

Deskew method (Document/Medical only)

DeskewExt method

DeskewExtAngle property

DisplaceMap method

FastRotate method (Document/Medical only)

Flip method

FreeHandShear method

FreeHandWave method

FreePlaneBend method

FreeRadBend method

Impressionist method

MosaicTiles method

Offset method

Perspective method

PerspectivePointsX property

PerspectivePointsY property

Plane method

PlaneBend method

Polar method

Punch method

RadialBlur method

RadWave method

Reverse method

Ripple method

RomanMosaic method

Rotate method

Shear method

Spherize method

Swirl method

TransformFile method

TransformMarker event

Trim method

Tunnel method

Wave method

Wind method

WriteMarker method

WriteMarkerAction property

ZigZag method

ZoomBlur method

ZoomWave method


Raster Images: Drawing on a Bitmap

Raster Images:
Image Processing
Drawing on a Bitmap

Using Windows GDI functions:

GetBitmapDC method

ReleaseBitmapDC method

Specifying gradient colors or patterns:

GradientStyle property

GradientStartColor property

GradientEndColor property

GradientSteps property

PatternStyle property

PatternBackColor property

PatternForeColor property


Raster Images: Filtering Images

Raster Images:
Image Processing
Filtering Images

General Filters

BinaryFilter method (Document/Medical only)

BricksTexture method

ColoredPencil method

DeskewExt method

DeskewExtAngle property

DiffuseGlow method

HalfTonePattern method

HighPassFilter method

MaskConvolution method

Perlin method

Perspective method

PerspectivePointsX property

PerspectivePointsY property

PlasmaFilter method

Pointillist method

SpatialFilter method

Specialized Filters

AddNoise method

AddShadow method

AntiAlias method

AutoBinary method

Average method

ContourFilter method

Despeckle method

EdgeDetectStatistical method

DynamicBinary method

EdgeDetectEffect method

EdgeDetector method

EdgeDetectorExt method

Emboss method

GaussianFilter method

IntensityDetect method

MaxFilter method (Document/Medical only)

Median method

MinFilter method (Document/Medical only)

Mosaic method

MotionBlur method

Oilify method

Posterize method

Sharpen method

Skeleton method

SmoothEdges method

Solarize method

UnsharpMask method

UserFilter method

UserFilterData property

UserFilterDivisor property

UserFilterFlags property

UserFilterHeight property

UserFilterOffset property

UserFilterWidth property

UserFilterXCenter property

UserFilterYCenter property


Raster Images: Getting Current Information

Raster Images:
Image Processing
Getting Current Information

BitmapMaxValue property

BitmapBits property

BitmapBytesPerLine property

BitmapCompression property

BitmapHeight property

BitmapMean property

BitmapMedian property

BitmapMinValue property

BitmapPixelsCount property

BitmapSelectedPixelPercent property

BitmapSize property

BitmapStandardDeviation property

BitmapTotalPixelCount property

BitmapWidth property

BitmapXRes property

BitmapYRes property

GetBitmapStatisticsInfo method

GetColorCount method

LineProfile method

LineProfileBlue property

LineProfileGreen property

LineProfileRed property

LineProfileSize property

Pixel property

PixelData property


Raster Images: Modifying Individual Pixels

Raster Images:
Image Processing
Modifying Individual Pixels

Pixel property


Raster Images: Modifying Intensity Values

Raster Images:
Image Processing
Modifying Intensity Values

Overall brightness and contrast:

AdaptiveContrast method

AddBitmaps method

AddBitmaps method

AddWeightedBitmaps method

AddWeightedBitmaps method

AutoColorLevel method

BlueGamma property

BlueMaxInput property

BlueMaxOutput property

BlueMinInput property

BlueMinOutput property

ColorLevel method

Contrast method

Contrast method

Factor property

FactorCount property

GammaCorrect method

GammaCorrect method

GreenGamma property

GreenMaxInput property

GreenMaxOutput property

GreenMinInput property

GreenMinOutput property

HistoContrast method

HistoEqualize method

Intensity method

Light method

LightAvr property

LightControl method

LightLowerAvr property

LightUpperAvr property

LocalHistoEqualize method

MasterGamma property

MasterMaxInput property

MasterMaxOutput property

MasterMinInput property

MasterMinOutput property

Multiply method

RedGamma property

RedMaxInput property

RedMaxOutput property

RedMinInput property

RedMinOutput property

StretchIntensity method

SubtractBackground method

Color changes:

Aging method

ApplyMathLogic method

BalanceColors method

ChannelMix method

ColorizeGray method

ColorMerge method

ColorReplace method

ColorReplace method

ColorSeparate method

ColorThreshold method

ColorThreshold method

ComponentFlags property

ComponentFlags property

ComponentMaxRange property

ComponentMaxRange property

ComponentMinRange property

ComponentMinRange property

ContrastBrightIntensity method

Desaturate method

DigitalSubtract method

FunctionalLight method

GrayColorBlue property

GrayColorCount property

GrayColorGreen property

GrayColorRed property

GrayColorThreshold property

HSIHue property

HSIInnerHigh property

HSIInnerLow property

HSIIntensity property

HSIOuterHigh property

HSIOuterLow property

HSISaturation property

Hue method

HueSaturationIntensity method

Invert method

MathFunction method

MultiScaleEnhancement method

RemapHue method

RemapHueTablesSize property

RemoveRedeye method

ReplaceColorFuzziness property

ReplaceColorFuzziness property

ReplaceColorsCount property

ReplaceColorsCount property

ReplaceColorValue property

ReplaceColorValue property

SampleTarget method

Saturation method

Segment method

SelectData method

SelectiveColor method

SelectiveColorBlack property

SelectiveColorCyan property

SelectiveColorMagenta property

SelectiveColorYellow property

ShiftData method

SwapColors method

Filtering intensity values:

DynamicBinary method

IntensityDetect method

Segment method

UserFilter method

UserFilterData property

UserFilterDivisor property

UserFilterFlags property

UserFilterHeight property

UserFilterOffset property

UserFilterWidth property

UserFilterXCenter property

UserFilterYCenter property

Low-level manipulation:

Deinterlace method

HTable property

MaskTable property

RemapHue method

RemapHue method

RemapIntensity method

RemapIntensity method

RemapTable property

STable property

VTable property

Changing the Data Format

ConvertSignedToUnsigned method

ConvertUnsignedToSigned method

ShiftAmount property

ShiftMinimumToZero method

ShiftZeroToNegative method

ShiftZeroToNegative method

Special Effects:

AdjustTint method

ColoredPencil method

GammaCorrectExt method

LensFlare method


Raster Images: Using Histograms

Raster Images:
Image Processing
Using Histograms

HistoContrast method

HistoEqualize method

GetHistogram method

GetHistogramGray method

HistogramGrayTable property

HistogramGrayTableSize property

HistogramTable property


Raster Images: Using the Alpha Channel

Raster Images:
Image Processing
Using the Alpha Channel

Getting and setting alpha channel data:

BitmapAlpha property

Using the alpha channel for transparency:

SetRgnColor method

GetRgnHandle method

SetRgnHandle method

PaintRgnOnly property


Raster Images: Artistic Effects

Raster Images:
Image Processing
Artistic Effects

AddShadow method

Aging method

Amplitudes property

BricksTexture method

BumpMap method

Canvas method

Clouds method

ColoredBall property

ColoredBallsCount property

ColoredBalls method

Cubism method

DiceEffect method

DiffuseGlow method

DrawStar method

Dry method

Fragment method

FunctionalLight method

GlassEffect method

LensFlare method

Light method

LightAngle property

LightBlueAmplitude property

LightFlags property

LightFrequency property

LightGreenAmplitude property

LightPhase property

LightRedAmplitude property

LightXOrigin property

LightYOrigin property

Ocean method

Offset method

Plane method

PlaneBend method

Pointillist method

PuzzleEffect method

RevEffect method

RingEffect method

Segment method

Tunnel method

UserShape property

UserShapeCount property

Vignette method

ZigZag method


Raster Images: Comparing Images

Raster Images:
Image Processing
Comparing Images

Correlation method


Raster Images: Document Imaging

Raster Images:
Image Processing
Document Imaging

Registration Marks

Bottom property

DetectedMarkCount property

DetectedMarkPointX property

DetectedMarkPointY property

GetMarksCenterMass method

GetTransformationParameters method

Height property

IsRegistrationMark method

Left property

Mark property

MarkCMPointX property

MarkCMPointY property

MarkPointX property

MarkPointY property

MarksCount property

MaxScale property

MinScale property

NumberOfExpectedMarks property

ReferencePointsX property

ReferencePointsY property

Right property

SearchRegMarks method

Top property

TransformationAngle property

TransformedPointsX property

TransformedPointsY property

Type property

Width property

XTranslation property

XScale property

YTranslation property

YScale property


Raster Images: Region Processing

Raster Images:
Region Processing

Creating and Using a Region

Where the Region Preempts the Bitmap

Methods That Transform the Region and the Bitmap


Raster Images: Creating and Using a Region (Pro-Document/Medical only)

Raster Images:
Region Processing
Creating and Using a Region

Automatic creation of a region:

RgnMarkingMode property

RgnChange event

RgnFrameType property

Creating and using a floater:

Floater property

FloaterVisible property

IsPtInFloater method

SetFloaterDstRect method

SetFloaterDstClipRect method

FloaterDstHeight property

FloaterDstLeft property

FloaterDstTop property

FloaterDstWidth property

FloaterDstClipHeight property

FloaterDstClipLeft property

FloaterDstClipTop property

FloaterDstClipWidth property

FloaterHeight property

FloaterWidth property

Storing, retrieving, and deleting regions:

GetFloaterHandle method

GetRgnHandle method

DeleteRgnHandle method

FreeRgn method

SetRgnHandle method

Getting region information:

GetBitmapClipSegments method

HasRgn property

IsPtInRgn method

GetRgnArea method

RgnHeight property

RgnLeft property

RgnTop property

RgnWidth property

Low-level methods for creating regions:

BezierSize property

BezierX property

BezierY property

CurveClose property

CurveSize property

CurveTension property

CurveToBezier method

CurveType property

CurveX property

CurveY property

SetRgnBorder method

SetRgnCurve method

SetRgnEllipse method

SetRgnRect method

SetRgnRoundRect method

SetRgnColor method

SetRgnColorHSVRange method

SetRgnColorRGBRange method

SetRgnMagicWand method

PolygonSize property

PolygonX property

PolygonY property

SetRgnPolygon method

Slice method

For working with the current region:

ContoursCount property

ContourY property

ContourX property

FeretsDiameterLength property

FeretsFirstIndex property

FeretsSecondIndex property

GetFeretsDiameter method

GetRgnContourPoints method

GetRgnPerimeterLength method

HolesRemovalBitmapRgn method

OffsetRgn method

PaintRgnOnly property

RepaintRect method

ResizeRgn method

RgnFrameColor property

Regions and Masks

CreateMaskFromRgn method

SetRgnFromMask method

MaskBitmap property


Raster Images: Methods That Transform the Region and the Bitmap (Pro-Document/Medical only)

Raster Images:
Region Processing
Methods That Transform the Region and the Bitmap

Flip method

Reverse method

Rotate method

Shear method

Size method

Trim method

ContourFilter method (Medical Imaging only)

FastRotate method

Related topics:

Saving a Region


Raster Images: Where the Region Preempts the Bitmap (Pro-Document/Medical only)

Raster Images:
Region Processing
Where the Region Preempts the Bitmap

AddNoise method

AutoBinary method

AutoColorLevel method

Average method

Bending method

BinaryFilter method

ChannelMix method

ColorizeGray method

ColorLevel method

Combine method

CombineBitmapWarp method

CombineExt method

Contrast method

ContrastBrightIntensity method

Cylindrical method

Despeckle method

DiceEffect method

DrawStar method

Dry method

Emboss method

Fill method

FreeHandWave method

FreePlaneBend method

FreeRadBend method

GammaCorrect method

GetHistogram method

GetHistogramGray method

GlassEffect method

HistoContrast method

HistoEqualize method

HolesRemovalBitmapRgn method

Hue method

Intensity method

IntensityDetect method

Invert method

Light method

Median method

Mosaic method

MultiScaleEnhancement method

Ocean method

Pixelate method

Plane method

PlaneBend method

Polar method

Posterize method

Punch method

PuzzleEffect method

RadialBlur method

RadWave method

RemapIntensity method

RingEffect method

Ripple method

Saturation method

SelectData method

SelectiveColor method

Sharpen method

ShiftData method

Skeleton method

SpatialFilter method

Spherize method

StretchIntensity method

Swirl method

Wave method

ZoomBlur method

ZoomWave

Related topics:

Saving a Region


Raster Images: Working with Geo Keys

Raster Images:
Working with Geo Keys

SetGeoKey method (ILEADRasterIO)

GetGeoKey method (ILEADRasterIO)

GeoKeyType property (ILEADRasterIO)

GeoKeyCount property (ILEADRasterIO)

GeoKeyData property (ILEADRasterIO)

WriteFileGeoKey method (ILEADRasterIO)

ReadFileGeoKey method (ILEADRasterIO)

EnumFileGeoKeys method (ILEADRasterIO)

EnumGeoKeys event (ILEADRasterIO)

StopFireEnumGeoKeys property


Annotations (Document/Medical only): Annotation Events

AnnChange event

AnnClicked event

AnnCreate event

AnnDestroy event

AnnDrawn event

AnnEnumerate event

AnnHyperlink event

AnnHyperlinkMenu event

AnnLocked event

AnnMenu event

AnnMouseDown event

AnnMouseMove event

AnnMouseUp event

AnnSelect event

AnnUnlocked event


Annotations (Document/Medical only): Annotation Hyperlink

Annotations (Document/Medical only): Annotation Hyperlinks

AnnHyperlink event

AnnHyperlinkMenu event

AnnHyperlinkMenuEnable property

AnnSetHyperlinkString method

AnnSetHyperlinkMsg method

AnnGetHyperlinkType method

AnnGetHyperlinkString method

AnnGetHyperlinkParam method


Annotations (Document/Medical only): Annotation Object Bitmap

AnnGetBitmap method

AnnGetMetafile method

AnnGetPredefinedMetafile method

AnnGetSecondaryBitmap method

AnnGetSecondaryMetafile method

AnnPredefinedRaster property

AnnSetBitmap method

AnnSetMeatfile method

AnnSetPredefinedMetafile method

AnnSetSecondaryBitmap method


Annotations (Document/Medical only): Annotation Security

AnnGetLocked method

AnnLock method

AnnLocked event

AnnSetUser method

AnnShowLockedIcon property

AnnUnlock method

AnnUnlocked event


Annotations (Document/Medical only): Automation

Controlling automation:

AnnAutoDrawEnable property

AnnAutoHilightPen property

AnnAutoMenuEnable property

AnnGetAutoBackColor method

AnnGetAutoMenuItemEnable method

AnnSetAutoBackColor method

AnnSetAutoMenuItemEnable method

AnnUserMode property

AnnAutoSnapCursor property

AnnSetOptions method

AnnGetOptions method

Selecting object types:

AnnTool property

AnnGetType method

Modifying automated text strings:

AnnAutoDialogFontSize property

AnnGetAutoText method

AnnSetAutoText method

Modifying automation cursors:

AnnAutoCursor property

AnnAutoSnapCursor property

AnnSetOptions method

AnnGetOptions method

Setting user interface and other annotation options

AnnSetOptions method

AnnGetOptions method

Modifying the automation highlight color:

AnnAutoHilightPen property

Undoing automation operations/changes

AnnAddUndoNode method

AnnSetOptions method

AnnGetOptions method

AnnUndo method

AnnUndoDepth property

AnnUndoEnable property

DLL support:

AnnAutomation property

AnnBringToFront method

AnnCalibrateRuler method

AnnContainer property

AnnGetContainer method

AnnGetOffsetX method

AnnGetOffsetY method

AnnGetPointCount method

AnnGetPointX method

AnnGetPointY method

AnnGetScalarX method

AnnGetScalarY method

AnnGetSelectCount method

AnnGetSelectList method

AnnGetTopContainer method

AnnGetWnd method

AnnHitTest method

AnnSelect event

AnnSelectPoint method

AnnSelectRect method

AnnSelectRectHeight property

AnnSelectRectLeft property

AnnSelectRectTop property

AnnSelectRectWidth property

AnnSendToBack method

AnnSetOffsetX method

AnnSetOffsetY method

AnnSetScalarX method

AnnSetScalarY method

AnnSetWnd method

Manipulating the toolbar

AnnSetOptions method

AnnGetOptions method

AnnToolChecked event

AnnToolDestroy event

ButtonBitmapDown property

ButtonBitmapUp property

ButtonColumns property

ButtonCount property

ButtonMenuText property

ButtonMenuTextID property

ButtonMenuTool property

ButtonRows property

ButtonTool property

ButtonToolCount property

ButtonToolTipText property

ButtonToolTipTextID property

ButtonVisible property

Create method

Tool property

Visible property

Working with the annotation automation menu

AddItem method

AnnMenu event

AnnUserMenu event

Count property

DeleteItem method

GetSubMenu method

ItemChecked property

ItemEnabled property

ItemID property

ItemString property

ItemType property

SetAnnMenu method

General Annotation

AnnAutoUpdate property

AnnDataPath method


Annotations (Document/Medical only): Creating and Deleting Annotations

Annotations (Document/Medical only):
Creating and Deleting Annotations

Creation, insertion, and removal:

AnnCreate method

AnnInsert method

AnnRemove method

Cut:

AnnCut method

Deletion:

AnnDestroy method


Annotations (Document/Medical only): Creating Custom Annotations

Annotations (Document/Medical only):
Creating Custom Annotations

The following functions are used when creating custom annotations:

AnnAddUserHandle method

AnnAdjustPoint method

AnnChangeUserHandle method

AnnConvert method

AnnCreate method

AnnCreateItem method

AnnDefine2 method

AnnDefine method

AnnDeleteUserHandle method

AnnEnumerateHandle method

AnnGetRestrictToContainer method

AnnGetUserHandle method

AnnGetUserHandles method

AnnHitTest method

AnnHitTestExt method

AnnRestrictCursor method

EnableRestrictToContainer method


Annotations (Document/Medical only): Getting and Setting Color Properties

Annotations (Document/Medical only):
Getting and Setting Color Properties

AnnAlpha property

AnnAutoHilightPen

AnnAutoSnapCursor property

AnnFillMode property

AnnGetAutoBackColor

AnnGetBackColor

AnnGetFillModeExt method

AnnGetForeColor

AnnGetOptions method

AnnGetROP2

AnnGetTextOptions method

AnnGetTransparent

AnnGetTransparentColor

AnnSetAutoBackColor

AnnSetBackColor

AnnSetFillModeExt method

AnnSetForeColor

AnnSetOptions method

AnnSetROP2

AnnSetTextOptions method

AnnSetTransparent

AnnSetTransparentColor

AnnShowBorder property

AnnShowText property

AnnTextColor property


Annotations (Document/Medical only): Input and Output

Files on disk:

AnnLoad method

AnnSave method

Files across the Internet:

AnnDataPath method

Files in memory:

AnnLoadArray method

AnnLoadMemory method

AnnSaveArray method

AnnSaveTag method

Deleting Pages from an Annotation File:

AnnDeletePage method

AnnDeletePageArray method

AnnDeletePageMemory method

Getting Annotation File Information:

AnnFileInfo method

AnnFileInfoArray method

AnnFileInfoMemory method

AnnInfoFormat property

AnnInfoTotalPages property

AnnInfoVersion property


Annotations (Document/Medical only): Object Manipulation

Transforming annotations:

AnnBoundingRectHeight property

AnnBoundingRectLeft property

AnnBoundingRectTop property

AnnBoundingRectWidth property

AnnFlip method

AnnGetRotateOptions method

AnnReverse method

AnnRotate method

AnnSetRotateOptions method

AnnShowRotateHandles property

AnnMove method

AnnRectHeight property

AnnRectLeft property

AnnRectTop property

AnnRectWidth property

Identifying annotations:

AnnGetObjectFromTag method

AnnGetTag method

AnnGetUserData method

AnnSetTag method

AnnSetUserData method

Realizing annotations to a bitmap:

AnnRealize method

AnnUnrealize method

Enumerating Objects

AnnEnumerate event

AnnEnumerate method

Creating an object

AnnCreate method

AnnCreateItem method

AnnDefine method

Object characteristics

AnnAlpha property

AnnAutoCursor property

AnnAutoHilightPen property

AnnAutoSnapCursor property

AnnCalibrateRuler method

AnnFillMode property

AnnGetBackColor method

AnnGetFillMode method

AnnGetFillModeExt method

AnnGetFillPattern method

AnnGetLineStyle method

AnnGetLineWidth method

AnnGetMetafile method

AnnGetNameOptions method

AnnGetNodes method

AnnGetPredefinedMetafile method

AnnGetRotateOptions method

AnnGetSelected method

AnnGetText method

AnnGetTextOptions method

AnnGetUnit method

AnnGetVisible method

AnnInsert method

AnnSetAutoDefaults method

AnnSetBackColor method

AnnSetFillMode method

AnnSetFillModeExt method

AnnSetFillPattern method

AnnSetLineStyle method

AnnSetLineWidth method

AnnSetMetafile method

AnnSetNameOptions method

AnnSetNodes method

AnnSetOptions method

AnnSetPoints method

AnnSetPredefinedMetafile method

AnnSetRotateOptions method

AnnSetSelected method

AnnSetText method

AnnSetTextOptions method

AnnSetUnit method

AnnSetVisible method

AnnShowBorder property

AnnShowRotateHandles property

AnnShowText property

AnnTextColor property

AnnTextEdit method

Grouping and ungrouping objects

AnnGetGrouping method

AnnGroup method

AnnSetGrouping method

AnnUngroup method

Destroying an object

AnnDestroy method

AnnRemove method

Polygon

AnnGetPolyFillMode method

AnnSetPolyFillMode method

Protractor

AnnGetAngle method

AnnGetProtractorOptions method

AnnGetShowFlags method

AnnSetProtractorOptions method

AnnSetShowFlags method

Working with Ruler object

AnnCalibrateRuler method

AnnGetDistance method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY method

AnnGetGaugeLength method

AnnSetGaugeLength method

Creating a Region

AnnGetArea method

AnnGetRgnHandle method

Using ROP2

AnnGetROP2 method

AnnSetROP2 method

Font and Color for an Object

AnnAutoSnapCursor property

AnnGetFontBold method

AnnGetFontItalic method

AnnGetFontName method

AnnGetFontSize method

AnnGetFontStrikeThrough method

AnnGetFontUnderline method

AnnGetForeColor method

AnnGetOptions method

AnnGetTextOptions method

AnnSetFontBold method

AnnSetFontItalic method

AnnSetFontName method

AnnSetFontSize method

AnnSetFontStrikeThrough method

AnnSetFontUnderline method

AnnSetForeColor method

AnnSetOptions method

AnnSetTextOptions method

AnnShowBorder property

AnnShowText property

AnnTextColor property

Moving the Name of an Annotation

AnnGetNameOffsetX method

AnnGetNameOffsetY method

AnnGetNameRestrict method

AnnNameBoundingRectHeight property

AnnNameBoundingRectLeft property

AnnNameBoundingRectTop property

AnnNameBoundingRectWidth property

AnnNameRectHeight property

AnnNameRectLeft property

AnnNameRectTop property

AnnNameRectWidth property

AnnSetNameOffsetX method

AnnSetNameOffsetY method

AnnAutoCursor property

AnnSetNameRestrict method


Annotations (Document/Medical only): Displaying Annotations

Annotations (Document/Medical only):
Displaying Annotations

Using the Magnifying Glass:

AnnEnableMagGlass property

AnnMagGlass method

EnableMagGlassDraw property

MagGlassOwnerDraw event

Modifying the Annotation display settings

AnnAlpha property

AnnAutoCursor property

AnnAutoHilightPen property

AnnAutoSnapCursor property

AnnCalibrateRuler method

AnnFillMode property

AnnGetFillModeExt method

AnnGetOptions method

AnnGetRotateOptions method

AnnGetTextOptions method

AnnSetFillModeExt method

AnnSetOptions method

AnnSetRotateOptions method

AnnSetTextOptions method

AnnShowBorder property

AnnShowRotateHandles property

AnnShowText property

AnnTextColor property

AnnTextEdit method

AnnBringToFront method

AnnGetBackColor method

AnnGetBitmapDpiX method

AnnGetBitmapDpiY method

AnnGetFillMode method

AnnGetFillPattern method

AnnGetFontBold method

AnnGetFontItalic method

AnnGetFontName method

AnnGetFontSize method

AnnGetFontStrikeThrough method

AnnGetFontUnderline method

AnnGetForeColor method

AnnGetLineStyle method

AnnGetLineWidth method

AnnGetPolyFillMode method

AnnGetPredefinedMetafile method

AnnGetProtractoroptions method

AnnGetROP2 method

AnnGetScalarX method

AnnGetScalarY method

AnnGetShowFlags method

AnnGetTransparent method

AnnGetTransparentColor method

AnnGetUnit method

AnnGetVisible method

AnnRestrictCursor method

AnnSendToBack method

AnnSetBackColor method

AnnSetBitmapDpiX method

AnnSetBitmapDpiY method

AnnSetFillMode method

AnnSetFillPattern method

AnnSetFontBold method

AnnSetFontItalic method

AnnSetFontName method

AnnSetFontSize method

AnnSetFontStrikeThrough method

AnnSetFontUnderline method

AnnSetForeColor method

AnnSetPolyFillMode method

AnnSetProtractorOptions method

AnnSetROP2 method

AnnSetScalarX method

AnnSetScalarY method

AnnSetShowFlags method

AnnSetTransparent method

AnnSetTransparentColor method

AnnSetUnit method

AnnSetVisible method

Getting and Setting ROP2 Properties

AnnSetROP2 method

AnnGetROP2 method

Getting and Setting the Object Bitmap Property

AnnGetBitmap method

AnnPredefinedRaster property

AnnGetSecondaryBitmap method

AnnSetBitmap method

AnnSetBitmap method

AnnSetPredefinedMetafile method

AnnSetSecondaryBitmap method

Getting and Setting the Object Metafile Property

AnnGetMetafile method

AnnGetPredefinedMetafile method

AnnGetSecondaryMetafile method

AnnSetMetafile method

AnnSetPredefinedMetafile method

Getting and Setting the Transparency Property

AnnGetTransparent method

AnnGetTransparentColor method

AnnSetTransparent method

AnnSetTransparentColor method

Getting and Setting the Fixed Property

AnnFixed property

AnnPushFixedState method

AnnPopFixedState method

AnnIsFixedRect property


Annotations (Document/Medical only): Using the Clipboard

AnnCopy method

AnnCut method

AnnPasteReady property

AnnPaste method


Annotations (Document/Medical only): Bitmap

Annotations (Document/Medical only):
Bitmap

AnnGetBitmap method

AnnGetTransparentColor method

AnnSetBitmap method

AnnSetBitmapDpiX method

AnnSetBitmapDpiY method

AnnSetTransparentColor method

Bitmap Stamp

AnnGetTransparent method

AnnSetTransparent method

Secondary Bitmap

AnnGetSecondaryBitmap method

AnnSetSecondaryBitmap method


Databases: ILEADRasterOLEDB

Databases:
Using OLE DB

Specifying the data control and field to which the ILEADRasterOLEDB is bound:

DataField property

DataMember property

DataSource property

Specifying how images are stored:

DataSaveBits property

DataSaveFormat property

DataSaveQuality property

Specifying the bits per pixel of the bitmap in memory:

DataLoadBits property

Updating the database field:

DataDirty property

Copying data between the ILEADRasterView object, the ILEADRasterOLEDB object and the ILEADRasterAnnotation:

AnnContainer property

Raster property

Raster property

Notification events:

DataLoaded event

DataSaved event

Generating system error events:

EnableMethodErrors property


Databases: Using ODBC

Databases:
Using ODBC

Accessing data:

dbOpen method

dbClose method

dbRequery method

dbLoadBits property

Updating data:

dbAddNew method

dbEdit method

dbUpdate method

dbDelete method

dbLockingMode property

Navigation:

dbMove method

dbMoveFirst method

dbMoveLast method

dbMoveNext method

dbMovePrev method

Getting status information:

dbCanAppend property

dbCanRestart property

dbCanScroll property

dbCanUpdate property

dbCurrentRecord property

dbEditMode property

dbIsBOF property

dbIsDeleted property

dbIsEOF property

dbIsOpen property

dbRecordCount property

Copying data between the ILEADRasterView Control and the ILEADRasterODBC Control:

Raster property (ILEADRasterODBC)

Raster property (ILEADRasterView)

Generating error exceptions:

EnableMethodErrors property

Copying data between the ILEADRasterAnnotation and the ILEADRasterODBC Objects:

AnnContainer property

ODBC events:

ODBCChanged event


Support: Version and License Information

Support:
Version and License Information

UnlockSupport method

IsSupportLocked method

AboutBox method


Support: Creating Instances of Licensed COM Objects

Support:
Creating Instances of Licensed COM Objects

CreateObject2 method

CreateObject method


Support: Using a Variant Object

Support:
Using a Variant Object

BooleanItemValue property (ILEADRasterVariant)

BooleanValue property (ILEADRasterVariant)

DispatchValue property (ILEADRasterVariant)

DoubleItemValue property (ILEADRasterVariant)

DoubleValue property (ILEADRasterVariant)

EnableMethodErrors property (ILEADRasterVariant)

Error property (ILEADRasterVariant)

FloatItemValue property (ILEADRasterVariant)

FloatValue property (ILEADRasterVariant)

ItemCount property (ILEADRasterVariant)

LongItemValue property (ILEADRasterVariant)

LongValue property (ILEADRasterVariant)

ShortItemValue property (ILEADRasterVariant)

ShortValue property (ILEADRasterVariant)

StringItemValue property (ILEADRasterVariant)

StringValue property (ILEADRasterVariant)

Type property (ILEADRasterVariant)

vType property (ILEADRasterVariant)


Optimizer: Optimization Methods

Optimizer:
Optimization Methods

DefaultOptions method

DirectoryInfo property

Distance property

EnableMethodErrors property

FilePercent property

JPEGColorSpace property

JPEGQFactor property

OnOptimize event

OnOptimizeDir event

OptimizeBuffer method

OptimizeDir method

OptimizedFileName property

OptimizeOptions property

OptimizingError property

OrginalFileName property

Percent property

PickSamePalette property

PNGQFactor property

StatusCode property

TotalFolderFilesCount property

TotalPercent property


PDF Compressor Functions: Creating a File

PDF Compressor:
Creating a File

BackGroundThreshold Property

CleanSize Property

ColorThreshold Property

CombineThreshold Property

EnableAddSegment property

EnableMethodErrors property

Flags Property

ImageQuality Property

MRCSegmentInfo property

OutputQuality Property

PDFCompInit method

PDFCompFree method

PDFCompWrite method

PDFCompInsertMRC method

PDFCompInsertNormal method

PDFCompSetCompression method

PDFCompInsertSegments method

PDFCompEvent Event

SegmentBottom Property

SegmentColors property

SegmentColorsCount property

SegmentLeft property

SegmentRight property

SegmentTop property

SegmentQuality Property

SegmentType property

UserSegmentInfo Property

UserSegmentInfoCount Property


Return Codes

The following are the possible return values for LEADTOOLS functions. These are the values in the L_ERROR.H file. The first table lists SUCCESS and FAILURE codes used by various LEADTOOLS functions and the second table lists ERROR codes used by various LEADTOOLS functions.

Error Codes

LEADTOOLS provides defined error constants. The following are the possible return values for LEADTOOLS functions.

Error | No. | Description
SUCCESS_ABORT | 2 | Function successful. You can quit now.
SUCCESS | 0 | Function successful
FAILURE | 20000 | Function not successful

Note:

The following are the errors that you can test for with an On Error statement.

Error | No. | Description
ERROR_NO_MEMORY | 20001 | Not enough memory available.
ERROR_NO_BITMAP | 20002 | Invalid bitmap.
ERROR_MEMORY_TOO_LOW | 20003 | Not enough memory available.
ERROR_FILE_LSEEK | 20004 | Error seeking to position.
ERROR_FILE_WRITE | 20005 | Error writing file.
ERROR_FILE_GONE | 20006 | File not present - abort.
ERROR_FILE_READ | 20007 | Error reading file.
ERROR_INV_FILENAME | 20008 | Invalid filename specified.
ERROR_FILE_FORMAT | 20009 | Invalid file format.
ERROR_FILENOTFOUND | 20010 | File not found.
ERROR_INV_RANGE | 20011 | Invalid width/height.
ERROR_IMAGE_TYPE | 20012 | Image format recognized, but sub-type not supported.
ERROR_INV_PARAMETER | 20013 | Invalid parameter passed.
ERROR_FILE_OPEN | 20014 | Not able to open file.
ERROR_UNKNOWN_COMP | 20015 | Unknown compression format.
ERROR_FEATURE_NOT_SUPPORTED | 20016 | Feature not supported.
ERROR_NOT_256_COLOR | 20017 | VGA card only supports 256 colors (8 bit).
ERROR_PRINTER | 20018 | Printer error.
ERROR_CRC_CHECK | 20019 | Data CRC check error.
ERROR_QFACTOR | 20021 | Invalid QFactor specified.
ERROR_TARGAINSTALL | 20022 | TARGA not installed.
ERROR_OUTPUTTYPE | 20023 | Invalid compression format.
ERROR_XORIGIN | 20024 | X origin specified invalid.
ERROR_YORIGIN | 20025 | Y origin specified invalid.
ERROR_VIDEOTYPE | 20026 | Invalid video mode.
ERROR_BITPERPIXEL | 20027 | Invalid bits/pixel.
ERROR_WINDOWSIZE | 20028 | Invalid window size.
ERROR_NORMAL_ABORT | 20029 | Escape key pressed - or user aborted operation.
ERROR_NOT_INITIALIZED | 20030 | Internal error - call LEAD.
ERROR_CU_BUSY | 20031 | Internal error - call LEAD.
ERROR_INVALID_TABLE_TYPE | 20032 | Internal error - call LEAD.
ERROR_UNEQUAL_TABLES | 20033 | Internal error - call LEAD.
ERROR_INVALID_BUFFER | 20034 | Internal error - call LEAD.
ERROR_MISSING_TILE_DATA | 20035 | Internal error - call LEAD.
ERROR_INVALID_QVALUE | 20036 | Internal error - call LEAD.
ERROR_INVALIDDATA | 20037 | Internal error - call LEAD.
ERROR_INVALID_COMPRESSED_TYPE | 20038 | Internal error - call LEAD.
ERROR_INVALID_COMPONENT_NUM | 20039 | Internal error - call LEAD.
ERROR_INVALID_PIXEL_TYPE | 20040 | Internal error - call LEAD.
ERROR_INVALID_PIXEL_SAMPLING | 20041 | Internal error - call LEAD.
ERROR_INVALID_SOURCE_FILE | 20042 | Internal error - call LEAD.
ERROR_INVALID_TARGET_FILE | 20043 | Internal error - call LEAD.
ERROR_INVALID_IMAGE_DIMS | 20044 | Internal error - call LEAD.
ERROR_INVALID_TILE_DIMS | 20045 | Internal error - call LEAD.
ERROR_INVALID_PIX_BUFF_DIMS | 20046 | Internal error - call LEAD.
ERROR_SEGMENT_OVERFLOW | 20047 | Internal error - call LEAD.
ERROR_INVALID_SUBSAMPLING | 20048 | Internal error - call LEAD.
ERROR_INVALID_Q_VIS_TABLE | 20049 | Internal error - call LEAD.
ERROR_INVALID_DC_CODE_TABLE | 20050 | Internal error - call LEAD.
ERROR_INVALID_AC_CODE_TABLE | 20051 | Internal error - call LEAD.
ERROR_INSUFFICIENT_DATA | 20052 | Internal error - call LEAD.
ERROR_MISSING_FUNC_POINTER | 20053 | Internal error - call LEAD.
ERROR_TOO_MANY_DC_CODE_TABLES | 20054 | Internal error - call LEAD.
ERROR_TOO_MANY_AC_CODE_TABLES | 20055 | Internal error - call LEAD.
ERROR_INVALID_SUBIMAGE | 20056 | Internal error - call LEAD.
ERROR_INVALID_ABORTION | 20057 | Internal error - call LEAD.
ERROR_CU_NO_SUPPORT | 20058 | Internal error - call LEAD.
ERROR_CU_FAILURE | 20059 | Internal error - call LEAD.
ERROR_BAD_POINTER | 20060 | Internal error - call LEAD.
ERROR_HEADER_DATA_FAILUR | 20061 | Internal error - call LEAD.
ERROR_COMPRESSED_DATA_FAILURE | 20062 | Internal error - call LEAD.
ERROR_FIXEDPAL_DATA | 20063 | Fixed palette data not found.
ERROR_LOADFONT_DATA | 20064 | Fixed palette data not found.
ERROR_NO_STAMP | 20065 | Stamp not found.
ERROR_G3CODE_INVALID | 20070 | Invalid group 3 dat.
ERROR_G3CODE_EOF | 20071 | Group3 code end of file.
ERROR_G3CODE_EOL | 20072 | Group3 code end of code.
ERROR_PREMATURE_EOF | 20073 | Premature EOF at scanline.
ERROR_PREMATURE_EOL | 20074 | Premature end-of-line code.
ERROR_UNCOMP_EOF | 20075 | Premature end-of-line code.
ERROR_ACT_INCOMP | 20076 | Premature end-of-line code.
ERROR_BAD_DECODE_STATE | 20077 | Premature end-of-line code.
ERROR_VERSION_NUMBER | 20078 | Bad version number.
ERROR_TWAIN_NODSM | 20079 | Source manager not found.
ERROR_TWAIN_BUMMER | 20080 | Failure due to unknown causes.
ERROR_TWAIN_LOWMEMORY | 20081 | Not enough memory to perform operation.
ERROR_TWAIN_NODS | 20082 | No Data Source.
ERROR_TWAIN_MAXCONNECTIONS | 20083 | DS is connected to max possible apps.
ERROR_TWAIN_OPERATIONERROR | 20084 | DS or DSM reported error, app shouldn't (no need for your app to report the error).
ERROR_TWAIN_BADCAP | 20085 | Unknown capability.
ERROR_TWAIN_BADPROTOCOL | 20086 | Unrecognized MSG DG DAT combination.
ERROR_TWAIN_BADVALUE | 20087 | Data parameter out of range.
ERROR_TWAIN_SEQERROR | 20088 | DG DAT MSG out of expected sequence.
ERROR_TWAIN_BADDEST | 20089 | Unknown destination App/Src in DSM_Entry.
ERROR_TWAIN_CANCEL | 20090 | Operation was cancelled.
ERROR_PANWINDOW_NOT_CREATED | 20091 | PanWindow creation failed.
ERROR_NOT_ENOUGH_IMAGES | 20092 | Not enough images - more input images are required.
ERROR_TWAIN_CAPUNSUPPORTED | 20093 | Twain capability unsupported.
ERROR_TWAIN_FILEXFER_UNSUPPORTED | 20094 | Twain File Transfer unsupported.
ERROR_USER_ABORT | 20100 | User has aborted operation
ERROR_FPX_INVALID_FORMAT_ERROR | 20101 | Invalid FlashPix format
ERROR_FPX_FILE_WRITE_ERROR | 20102 | Error writing file
ERROR_FPX_FILE_READ_ERROR | 20103 | Error reading file
ERROR_FPX_FILE_NOT_FOUND | 20104 | File not found
ERROR_FPX_COLOR_CONVERSION_ERROR | 20105 | Color conversion error
ERROR_FPX_SEVER_INIT_ERROR | 20106 | Server initialize error
ERROR_FPX_LOW_MEMORY_ERROR | 20107 | Not enough memory available
ERROR_FPX_IMAGE_TOO_BIG_ERROR | 20108 | Image too big
ERROR_FPX_INVALID_COMPRESSION_ERROR | 20109 | Invalid compression
ERROR_FPX_INVALID_RESOLUTION | 20110 | Invalid resolution
ERROR_FPX_INVALID_FPX_HANDLE | 20111 | Invalid handle
ERROR_FPX_TOO_MANY_LINES | 20112 | Too many lines
ERROR_FPX_BAD_COORDINATES | 20113 | Invalid coordinates
ERROR_FPX_FILE_SYSTEM_FULL | 20114 | File system full
ERROR_FPX_MISSING_TABLE | 20115 | The table is missing
ERROR_FPX_RETURN_PARAMETER_TOO_LARGE | 20116 | Parameter too large
ERROR_FPX_NOT_A_VIEW | 20117 | Error view
ERROR_FPX_VIEW_IS_TRANFORMLESS | 20118 | The view is tranformless
ERROR_FPX_ERROR | 20119 | General error
ERROR_FPX_UNIMPLEMENTED_FUNCTION | 20120 | Unimplemented function
ERROR_FPX_INVALID_IMAGE_DESC | 20121 | Invalid image description
ERROR_FPX_INVALID_JPEG_TABLE | 20122 | Invalid jpeg table
ERROR_FPX_ILLEGAL_JPEG_ID | 20123 | Illegal jpeg identifier
ERROR_FPX_MEMORY_ALLOCATION_FAILED | 20124 | Memory allocation failed
ERROR_FPX_NO_MEMORY_MANAGEMENT | 20125 | No memory management
ERROR_FPX_OBJECT_CREATION_FAILED | 20126 | Object creation failed
ERROR_FPX_EXTENSION_FAILED | 20127 | Extension failed
ERROR_FPX_FREE_NULL_PTR | 20128 | Free null pointer
ERROR_FPX_INVALID_TILE | 20129 | Invalid tile
ERROR_FPX_FILE_IN_USE | 20130 | File in use
ERROR_FPX_FILE_CREATE_ERROR | 20131 | Error creating file
ERROR_FPX_FILE_NOT_OPEN_ERROR | 20132 | File not open
ERROR_FPX_USER_ABORT | 20133 | User abort
ERROR_FPX_OLE_FILE_ERROR | 20134 | OLE file I/O error
ERROR_BAD_TAG | 20140 | Bad TIFF tag
ERROR_INVALID_STAMP_SIZE | 20141 | Stamp size is too big or invalid bits/pixel, etc
ERROR_BAD_STAMP | 20142 | Stamp is present but data is corrupted
ERROR_DOCUMENT_NOT_ENABLED | 20143 | Document capability is required to use this function
ERROR_IMAGE_EMPTY | 20144 | Image is empty
ERROR_NO_CHANGE | 20145 | The image hasn't changed
ERROR_LZW_LOCKED | 20146 | The LZW capabilities are locked
ERROR_FPXEXTENSIONS_LOCKED | 20147 | The FlashPix extension capabilities are locked
ERROR_ANN_LOCKED | 20148 | One or more annotation objects are still locked
ERROR_EXCEPTION | 20149 | An unspecified exception occurred - could be memory access violations
ERROR_DLG_FAILED | 20150 | An error occurred during the creation of the common dialog.
ERROR_DLG_ALREADYINITIATED | 20151 | The dialogs are already initialized.
ERROR_DLG_NOTINITIATED | 20152 | The dialogs have not been initialized.
ERROR_DLG_COLORNOTINITIALIZED | 20153 | The dialogs were not initialized with DLG_INIT_COLOR.
ERROR_DLG_COLORDLL_UNABLETOLOAD | 20154 | The dialogs could not load the LTCLR dll.
ERROR_ISIS_NOCURSCANNER | 20160 | ISIS No Scanner selected
ERROR_ISIS_SCANDRIVER_NOT_LOADED | 20161 | ISIS Scanner driver failed to load
ERROR_ISIS_CANCEL | 20162 | ISIS Operation canceled
ERROR_ISIS_BAD_TAG_OR_VALUE | 20163 | ISIS Bad Tag or Bad Tag Value
ERROR_ISIS_NOT_READY | 20164 | ISIS Scanner not ready
ERROR_ISIS_NO_PAGE | 20165 | ISIS No page in the Scanner
ERROR_ISIS_JAM | 20166 | ISIS Scanner Jam error
ERROR_ISIS_SCANNER_ERROR | 20167 | ISIS Scanner driver error
ERROR_ISIS_BUSY | 20168 | ISIS Scanner is busy
ERROR_ISIS_FILE_ERROR | 20169 | ISIS File driver error
ERROR_ISIS_NETWORK_ERROR | 20170 | ISIS Network error
ERROR_ISIS_NOT_INSTALLED | 20171 | ISIS is not installed
ERROR_ISIS_NO_PIXDFLT | 20172 | ISIS is not installed
ERROR_ISIS_PIXVERSION | 20173 | ISIS version is incorrect
ERROR_ISIS_PERM_NOACCESS | 20174 | ISIS No permission/access
ERROR_RECORDING | 20250 | Wave device is currently recording
ERROR_COMPRESSOR | 20251 | Invalid compressor
ERROR_SOUND_DEVICE | 20252 | Problem with sound card
ERROR_DEVICE_INUSE | 20253 | The sound card is currently in use
ERROR_INV_TRACKTYPE | 20254 | Invalid track for operation
ERROR_NO_SOUNDCARD | 20255 | No sound card is present
ERROR_NOT_RECORDING | 20256 | Not currently recording
ERROR_INV_MODE | 20257 | Invalid open mode for operation
ERROR_NO_VIDEO_MODULE | 20258 | No video module present on machine
ERROR_QUEUE_FULL | 20259 | The buffer queue is full
ERROR_CONFIGURE_RESTART | 20260 | Configuration was successful, but you need to restart Windows
ERROR_INV_HANDLE | 20261 | Invalid handle
ERROR_HOST_RESOLVE | 20270 | Can't resolve hostname
ERROR_CANT_INITIALIZE | 20271 | Can't initialize network
ERROR_NO_CONNECTION | 20272 | No open network connections
ERROR_HOST_NOT_FOUND | 20273 | Hostname not found
ERROR_NOT_SERVER | 20274 | Computer is not a server
ERROR_NO_CONNECTIONS | 20275 | No connection requests waiting
ERROR_CONNECT_REFUSED | 20276 | Connection was refused
ERROR_IS_CONNECTED | 20277 | Computer is already connected
ERROR_NET_UNREACH | 20278 | Network is unreachable from host
ERROR_TIME_OUT | 20279 | Connect attempt time out without connecting
ERROR_NET_DOWN | 20280 | Network subsystem is down
ERROR_NO_BUFFERS | 20281 | No buffer space is available, too many connections
ERROR_NO_FILE_DESCR | 20282 | No more file handle available
ERROR_DATA_QUEUED | 20283 | Data has been queued to send later
ERROR_UNKNOWN | 20284 | Unknown network error has occurred
ERROR_CONNECT_RESET | 20285 | Connection was reset - socket might be unusable
ERROR_TRANSFER_ABORTED | 20286 | Transfer was aborted
ERROR_DSHOW_FAILURE | 20287 | DirectShow isn't installed correctly
ERROR_REGISTRY_READ | 20288 | Error reading from the registry
ERROR_WAVE_FORMAT | 20289 | The wave format is not supported
ERROR_BUFFER_TOO_SMALL | 20290 | The buffer size is too small
ERROR_WAVE_CONVERT | 20291 | Error converting the wave format
ERROR_MULTIMEDIA_NOT_ENABLED | 20292 | Video capability is required to use this function
ERROR_CAP_CONNECT | 20293 | Error connecting to capture device
ERROR_CAP_DISCONNECT | 20294 | Error disconnecting capture device
ERROR_DISK_ISFULL | 20295 | Not enough disk space
ERROR_CAP_OVERLAY | 20296 | Error setting capture overlay
ERROR_CAP_PREVIEW | 20297 | Error setting capture preview
ERROR_CAP_COPY | 20298 | Error copying to clipboard
ERROR_CAP_WINDOW | 20299 | Error with capture window
ERROR_CAP_ISCAPTURING | 20300 | Operation invalid during capture
ERROR_NO_STREAMS | 20301 | No streams to play
ERROR_CREATE_STREAM | 20302 | Error creating streams
ERROR_FRAME_DELETE | 20303 | Error deleting frames
ERROR_DXF_FILTER_MISSING | 20309 | The DXF filter is needed to use this function
ERROR_PAGE_NOT_FOUND | 20310 | Page not found
ERROR_DELETE_LAST_PAGE | 20311 | You cannot delete a page from a file containing only one page
ERROR_NO_HOTKEY | 20312 | There is no hotkey
ERROR_CANNOT_CREATE_HOTKEY_WINDOW | 20313 | Error creating the hotkey window
ERROR_MEDICAL_NOT_ENABLED | 20314 | Medical Express capability is required to use this function
ERROR_JBIG_NOT_ENABLED | 20315 | JBIG capability is required to use this function
ERROR_UNDO_STACK_EMPTY | 20316 | Undo stack is empty - too many undos
ERROR_NO_TOOLBAR | 20317 | ActiveX error - the toolbar window was not created
ERROR_MEDICAL_NET_NOT_ENABLED | 20318 | Medical Network Express capability is required to use this function
ERROR_JBIG_FILTER_MISSING | 20319 | The JBIG filter is needed to use this function
ERROR_CAPTURE_STILL_IN_PROCESS | 20320 | Capture is still in progress
ERROR_INVALID_DELAY | 20321 | Invalid delay specified
ERROR_INVALID_COUNT | 20322 | Invalid capture count specified
ERROR_INVALID_INTERVAL | 20323 | Invalid interval specified
ERROR_HOTKEY_CONFILCTS_WITH_CANCELKEY | 20324 | Hotkey Conflicts With Cancelkey
ERROR_CAPTURE_INVALID_AREA_TYPE | 20325 | Invalid Area Type specified
ERROR_CAPTURE_NO_OPTION_STRUCTURE | 20326 | Invalid or missing options structure
ERROR_CAPTURE_INVALID_FILL_PATTERN | 20327 | Invalid fill pattern
ERROR_CAPTURE_INVALID_LINE_STYLE | 20328 | Invalid line style
ERROR_CAPTURE_INVALID_INFOWND_POS | 20329 | Invalid info window position
ERROR_CAPTURE_INVALID_INFOWND_SIZE | 20330 | Invalid info window size
ERROR_CAPTURE_ZERO_AREA_SIZE | 20331 | Zero Area Size for capture
ERROR_CAPTURE_FILE_ACCESS_FAILED | 20332 | The specified filename could not be read
ERROR_CAPTURE_INVALID_32BIT_EXE_OR_DLL | 20333 | The specified filename is not a valid 32bit EXE/DLL
ERROR_CAPTURE_INVALID_RESOURCE_TYPE | 20334 | The specified resource type is not supported
ERROR_CAPTURE_INVALID_RESOURCE_INDEX | 20335 | The index resource is out of range
ERROR_CAPTURE_NO_ACTIVE_WINDOW | 20336 | No active window for capture
ERROR_CAPTURE_CANNOT_CAPTURE_WINDOW | 20337 | Could not capture the window
ERROR_CAPTURE_STRING_ID_NOT_DEFINED | 20338 | String ID Not Defined
ERROR_CAPTURE_DELAY_LESS_THAN_ZERO | 20339 | Delay value cannot be less than zero
ERROR_CAPTURE_NO_MENU | 20340 | No menu to capture
ERROR_WMF_FILTER_MISSING | 20349 | WMF filter is needed to use this function
ERROR_BROWSE_FAILED | 20350 | Directory browsing failed
ERROR_NOTHING_TO_DO | 20351 | There is nothing to do! - i.e. no files were found
ERROR_INTERNET_NOT_ENABLED | 20352 | Internet capability is required to use this function
ERROR_LVKRN_MISSING | 20353 | The LVKRN DLL is needed to use this function
ERROR_CMW_LOCKED | 20354 | The CMW support is locked
ERROR_CMW_FILTER_MISSING | 20355 | CMW filter is needed to use this function
ERROR_CMP_FILTER_MISSING | 20356 | CMP filter is needed to use this function
ERROR_FAX_FILTER_MISSING | 20357 | FAX filter is needed to use this function
ERROR_PDF_FILTER_MISSING | 20358 | PDF filter is needed to use this function
ERROR_TIF_FILTER_MISSING | 20359 | TIF filter is needed to use this function
ERROR_INV_HORZSIZE | 20360 | The horizontal size is outside the specification
ERROR_INV_VERTSIZE | 20361 | The vertical size is outside the specification
ERROR_ASPECTRATIO | 20362 | Invalid pel aspect ratio
ERROR_BITRATE | 20363 | Invalid bitrate
ERROR_VBV_BUFFER | 20364 | VBV Buffer Size is isn't valid
ERROR_CHROMA_FORMAT | 20365 | Invalid chroma format
ERROR_VIDEO_FORMAT | 20366 | Invalid video format
ERROR_COLOR_PRIMARY | 20367 | Invalid number of color primaries
ERROR_TRANSFER_CHAR | 20368 | Invalid number of transfer characteristics
ERROR_MATRIX_COEFF | 20369 | Invalid number of matrix coefficients
ERROR_DISPLAY_HORZSIZE | 20370 | Invalid horizontal display size
ERROR_DISPLAY_VERTSIZE | 20371 | Invalid vertical display size
ERROR_INTRA_DCPREC | 20372 | Invalid Intra DC Precision
ERROR_FCODE | 20373 | Invalid f code
ERROR_SRCH_WINDOW | 20374 | Invalid motion data search window
ERROR_PROFILEID | 20375 | Invalid profile id
ERROR_LEVELID | 20376 | Invalid level id
ERROR_PROFILEID_NS | 20377 | Encoder doesn't support scalable bitstreams
ERROR_INV_COMBINATION | 20378 | Undefined Profile & Level id combination
ERROR_BPIC_NOTALLOWED | 20379 | B Pictures not allowed
ERROR_RPTFIRST_MUSTBEZERO | 20380 | Repeat first must be zero
ERROR_FRAME_RATE | 20381 | Invalid frame rate
ERROR_VECTOR_NOT_ENABLED | 20400 | Vector capability is required to use this function
ERROR_VECTOR_DXF_NOT_ENABLED | 20401 | Vector DXF capability is required to use this function
ERROR_VECTOR_DWG_NOT_ENABLED | 20402 | Vector DWG capability is required to use this function
ERROR_VECTOR_MISC_NOT_ENABLED | 20403 | Vector Misc capability is required to use this function
ERROR_TAG_MISSING | 20404 | Tag not found
ERROR_VECTOR_DWF_NOT_ENABLED | 20405 | Vector DWF capability is required to use this function
ERROR_NO_UNDO_STACK | 20406 | There is no undo stack
ERROR_UNDO_DISABLED | 20407 | The undo is disabled
ERROR_PDF_NOT_ENABLED | 20408 | PDF capability is required to use this function
ERROR_ENTENSIONS_MISSING | 20409 | EXIF extensions are missing
ERROR_BARCODE_DIGIT_CHECK | 20410 | Invalid error check digit
ERROR_BARCODE_INVALID_TYPE | 20411 | Invalid bar code type
ERROR_BARCODE_TEXTOUT | 20412 | Invalid bar code text out option
ERROR_BARCODE_WIDTH | 20413 | Invalid bar code width
ERROR_BARCODE_HEIGHT | 20414 | Invalid bar code height
ERROR_BARCODE_TOSMALL | 20415 | Bar code string is too small
ERROR_BARCODE_STRING | 20416 | Invalid bar code string for a specified bar code type
ERROR_BARCODE_NOTFOUND | 20417 | No bar code recognition
ERROR_BARCODE_UNITS | 20418 | Invalid bar code measurement unit
ERROR_BARCODE_MULTIPLEMAXCOUNT | 20419 | Invalid multiple max count
ERROR_BARCODE_GROUP | 20420 | Invalid bar code group
ERROR_BARCODE_NO_DATA | 20421 | Invalid BARCODEDATA structure
ERROR_BARCODE_NOTFOUND_DUPLICATED | 20422 | No duplicated bar code
ERROR_BARCODE_LAST_DUPLICATED | 20423 | Reached the last duplicated bar code
ERROR_BARCODE_STRING_LENGTH | 20424 | Invalid bar code data string length
ERROR_BARCODE_LOCATION | 20425 | Invalid bar code area location
ERROR_BARCODE_1D_LOCK | 20426 | Bar Code 1D is locked
ERROR_BARCODE_2D_READ_LOCKED | 20427 | Bar Code Read 2D (CodeOne) is locked
ERROR_BARCODE_2D_WRITE_LOCKED | 20428 | Bar Code Write 2D (CodeOne) is locked
ERROR_BARCODE_PDF_READ_LOCKED | 20429 | Bar Code Read PDF is locked
ERROR_BARCODE_PDF_WRITE_LOCKED | 20430 | Bar Code Write PDF is locked
ERROR_BARCODE_FOUNDCORRUPT | 20431 | Barcode PDF417 symbol is found but cannot be read successfully
ERROR_BARCODE_DATAMATRIX_READ_LOCKED | 20432 | Bar Code Read DataMatrix is locked.
ERROR_BARCODE_DATAMATRIX_WRITE_LOCKED | 20433 | Bar Code Write DataMatrix is locked.
ERROR_BARCODE_QR_READ_LOCKED | 21380 | Bar Code Read QR is locked
ERROR_BARCODE_QR_WRITE_LOCKED | 21381 | Bar Code Write QR is locked
ERROR_NET_OUT_OF_HANDLES | 20435 | No more handles could be generated at this time
ERROR_NET_TIMEOUT | 20436 | The request has timed out
ERROR_NET_EXTENDED_ERROR | 20437 | An extended error has occurred
ERROR_NET_INTERNAL_ERROR | 20438 | An internal WinInet error
ERROR_NET_INVALID_URL | 20439 | The URL is invalid
ERROR_NET_UNRECOGNIZED_SCHEME | 20440 | The URL scheme could not be recognized or is not supported
ERROR_NET_NAME_NOT_RESOLVED | 20441 | The server name could not be resolved
ERROR_NET_PROTOCOL_NOT_FOUND | 20442 | The requested protocol could not be located
ERROR_NET_INVALID_OPTION | 20443 | Invalid option specified
ERROR_NET_BAD_OPTION_LENGTH | 20444 | The length of option is incorrect
ERROR_NET_OPTION_NOT_SETTABLE | 20445 | The option can not be set
ERROR_NET_SHUTDOWN | 20446 | The Win32 Internet function support is being shut down or unload
ERROR_NET_LOGIN_FAILURE | 20449 | User could not connect to site
ERROR_NET_INVALID_OPERATION | 20450 | The requested operation is invalid
ERROR_NET_OPERATION_CANCELLED | 20451 | The operation was cancelled
ERROR_NET_INCORRECT_HANDLE_TYPE | 20452 | The type of handle supplied is incorrect for the operation
ERROR_NET_INCORRECT_HANDLE_STATE | 20453 | Handle is not in the correct state
ERROR_NET_NOT_PROXY_REQUEST | 20454 | The request cannot be made via a proxy
ERROR_NET_REGISTRY_VALUE_NOT_FOUND | 20455 | The registry value could not be found
ERROR_NET_BAD_REGISTRY_PARAMETER | 20456 | Incorrect registry value
ERROR_NET_NO_DIRECT_ACCESS | 20457 | Direct network access cannot be made at this time
ERROR_NET_NO_CONTEXT | 20458 | An asynchronous request could not be made because a zero context value was supplied
ERROR_NET_NO_CALLBACK | 20459 | A callback function has not been defined
ERROR_NET_REQUEST_PENDING | 20460 | Operation could not be completed because one or more operations are pending
ERROR_NET_INCORRECT_FORMAT | 20461 | The format of the request is invalid
ERROR_NET_ITEM_NOT_FOUND | 20462 | The requested item could not be located
ERROR_NET_CANNOT_CONNECT | 20463 | The attempt to connect to the server failed
ERROR_NET_CONNECTION_ABORTED | 20464 | The connection with the server has been terminated
ERROR_NET_CONNECTION_RESET | 20465 | The connection with the server has been reset
ERROR_NET_FORCE_RETRY | 20466 | Calls for the Win32 Internet function to redo the request
ERROR_NET_INVALID_PROXY_REQUEST | 20467 | The proxy request is invalid
ERROR_NET_HANDLE_EXISTS | 20469 | The request failed because the handle already exits
ERROR_NET_SEC_CERT_DATE_INVALID | 20470 | SSL certificate date that was received from the server is bad
ERROR_NET_SEC_CERT_CN_INVALID | 20471 | SSL certificate common name is incorrect
ERROR_NET_HTTP_TO_HTTPS_ON_REDIR | 20472 | Moving from a non-SSL to an SSL connection because of a redirect
ERROR_NET_HTTPS_TO_HTTP_ON_REDIR | 20473 | Moving from an SSL to a no-SSL connection because of a redirect
ERROR_NET_MIXED_SECURITY | 20474 | Indicates that the content is not entirely secure. Some of the content being viewed may have come from unsecured servers
ERROR_NET_CHG_POST_IS_NON_SECURE | 20475 | Changing the post is not secure.
ERROR_NET_POST_IS_NON_SECURE | 20476 | Current posts is not secure.
ERROR_NET_CLIENT_AUTH_CERT_NEEDED | 20477 | Client need certificate authority.
ERROR_NET_INVALID_CA | 20478 | Invalid certificate authority
ERROR_NET_CLIENT_AUTH_NOT_SETUP | 20479 | Client authorization wasn't setup yet.
ERROR_NET_REDIRECT_SCHEME_CHANGE | 20481 | Redirect scheme change.
ERROR_NET_HTTPS_HTTP_SUBMIT_REDIR | 20484 | HTTP submitting redir.
ERROR_NET_INSERT_CDROM | 20485 | Please insert CD Rom into the CD drive.
ERROR_NET_HTTP_HEADER_NOT_FOUND | 20486 | The requested header could not be located
ERROR_NET_HTTP_DOWNLEVEL_SERVER | 20487 | The server did not return any headers
ERROR_NET_HTTP_INVALID_SERVER_RESPONSE | 20488 | The server response could not be parsed
ERROR_NET_HTTP_INVALID_HEADER | 20489 | The supplied header is invalid
ERROR_NET_HTTP_INVALID_QUERY_REQUEST | 20490 | The request made to HttpQueryInfo is invalid
ERROR_NET_HTTP_HEADER_ALREADY_EXISTS | 20491 | The header could not be added because it already exists
ERROR_NET_HTTP_REDIRECT_FAILED | 20492 | An HTTP redirection failed
ERROR_NET_HTTP_NOT_REDIRECTED | 20493 | The HTTP redirection did not occur
ERROR_NET_HTTP_COOKIE_NEEDS_CONFIRMATION | 20494 | Before a cookie is set there needs to be confirmation
ERROR_NET_HTTP_COOKIE_DECLINED | 20495 | Trying to assign a cookie was declined
ERROR_NET_HTTP_REDIRECT_NEEDS_CONFIRMATION | 20496 | The HTTP redirection needs to be confirmed
ERROR_NET_NO_OPEN_REQUEST | 20497 | Operation cannot be completed because there are no open requests
ERROR_VECTOR_IS_LOCKED | 20500 | Vector handle is locked
ERROR_VECTOR_IS_EMPTY | 20501 | Vector is empty
ERROR_VECTOR_LAYER_NOT_FOUND | 20502 | Layer is not found
ERROR_VECTOR_LAYER_IS_LOCKED | 20503 | Layer is locked
ERROR_VECTOR_LAYER_ALREADY_EXISTS | 20504 | Layer already exists
ERROR_VECTOR_OBJECT_NOT_FOUND | 20505 | Object is not found
ERROR_VECTOR_INVALID_OBJECT_TYPE | 20506 | Invalid object type
ERROR_VECTOR_PEN_NOT_FOUND | 20507 | Pen is not found
ERROR_VECTOR_BRUSH_NOT_FOUND | 20508 | Brush is not found
ERROR_VECTOR_FONT_NOT_FOUND | 20509 | Font is not found
ERROR_VECTOR_BITMAP_NOT_FOUND | 20510 | Bitmap is not found
ERROR_VECTOR_POINT_NOT_FOUND | 20511 | Point is not found
ERROR_VECTOR_ENGINE_NOT_FOUND | 20512 | Vector engine not found
ERROR_VECTOR_INVALID_ENGINE | 20513 | Invalid vector engine
ERROR_VECTOR_CLIPBOARD | 20514 | Clipboard error
ERROR_VECTOR_CLIPBOARD_IS_EMPTY | 20515 | Clipboard is empty
ERROR_VECTOR_CANT_ADD_TEXT | 20516 | Cannot add text
ERROR_VECTOR_CANT_READ_WMF | 20517 | Cannot read WMF
ERROR_VECTOR_GROUP_NOT_FOUND | 20518 | Group is not found
ERROR_VECTOR_GROUP_ALREADY_EXISTS | 20519 | Group already exists
ERROR_JP2_FAILURE | 20530 | Error in JP2 Box values
ERROR_JP2_SIGNATURE | 20531 | The header does not match the JP2 signature - not a JP2 file
ERROR_JP2_UNSUPPORTED | 20532 | JP2 file has a feature that is unsupported
ERROR_J2K_FAILURE | 20533 | Invalid save options were specified to the encoder
ERROR_J2K_NO_SOC | 20534 | File header does not contain SOC marker
ERROR_J2K_NO_SOT | 20535 | File contains complete header but no compressed image data
ERROR_J2K_INFORMATION_SET | 20536 | Invalid save options were specified or file includes invalid encoded values
ERROR_J2K_LOW_TARGET_SIZE | 20537 | Compression ratio, target file size, or tile size was too small for encoder
ERROR_J2K_DECOMPOSITION_LEVEL | 20538 | Specified Wavelet decomposition level was too high
ERROR_J2K_MARKER_VALUE | 20539 | Decoder could not translate J2K marker - file is corrupt or invalid
ERROR_J2K_UNSUPPORTED | 20540 | J2K file has image with more than 30 bits per component
ERROR_J2K_FILTER_MISSING | 20541 | J2K filter is needed to use this function
ERROR_J2K_LOCKED | 20542 | J2K support is locked
ERROR_TWAIN_NO_LIBRARY | 20560 | TWAIN libraries not found.
ERROR_TWAIN_NOT_AVAILABLE | 20560 | At least one of the TWAIN DLLs is missing
ERROR_TWAIN_INVALID_DLL | 20561 | Invalid DLL.
ERROR_TWAIN_NOT_INITIALIZED | 20562 | TWAIN source not initialized.
ERROR_TWAIN_CANCELED | 20563 | Cancel operation done.
ERROR_TWAIN_CHECK_STATUS | 20564 | An error in the status of the TWAIN source.
ERROR_TWAIN_END_OF_LIST | 20565 | End of the enumeration list.
ERROR_TWAIN_CAP_NOT_SUPPORTED | 20566 | Required capability not supported.
ERROR_TWAIN_SOURCE_NOT_OPEN | 20567 | TWAIN source not being open.
ERROR_TWAIN_BAD_VALUE | 20568 | Invalid capability value
ERROR_TWAIN_INVALID_STATE | 20569 | TWAIN source state is not valid for the required operation.
ERROR_TWAIN_CAPS_NEG_NOT_ENDED | 20570 | Capability negotiation ended before the current operation.
ERROR_TWAIN_OPEN_FILE | 20571 | Can't open required file.
ERROR_TWAIN_INV_HANDLE | 20572 | Invalid handle was passed.
ERROR_TWAIN_WRITE_TO_FILE | 20573 | Error trying write to a file.
ERROR_TWAIN_INV_VERSION_NUM | 20574 | Invalid version number.
ERROR_TWAIN_READ_FROM_FILE | 20575 | Error reading from file.
ERROR_TWAIN_NOT_VALID_FILE | 20576 | Invalid file
ERROR_TWAIN_INV_ACCESS_RIGHT | 20577 | Invalid access right to file
ERROR_TWAIN_CUSTOMBASE | 20578 | Custom return code base
ERROR_TWAIN_DENIED | 20579 | Operation denied (device not ready)
ERROR_TWAIN_FILEEXISTS | 20580 | Specified output file name already exists
ERROR_TWAIN_FILENOTFOUND | 20581 | Input file name not found or output file name invalid
ERROR_TWAIN_NOTEMPTY | 20582 | Directory is not empty & can not be deleted
ERROR_TWAIN_PAPERJAM | 20583 | Transfer failed because of a feeder error
ERROR_TWAIN_PAPERDOUBLEFEED | 20584 | Transfer failed because of a feeder error
ERROR_TWAIN_FILEWRITEERROR | 20585 | Error writing to the specified file
ERROR_TWAIN_CHECKDEVICEONLINE | 20586 | The device has been powered off
ERROR_TWAIN_STOP_SCAN | 20587 | The feeder is stopped by the user.
ERROR_TWAIN_STOP_ENUMERATION | 2 | Function successful with an abort request.
ERROR_PAINT_INTERNAL | 20600 | Internal error (Call LEAD)
ERROR_PAINT_INV_DATA | 20601 | Internal error (Call LEAD)
ERROR_PAINT_NO_RESOURCES | 20602 | Internal error (Call LEAD)
ERROR_PAINT_NOT_ENABLED | 20603 | DigitalPaint capability is required to use this function
ERROR_INV_SEG_HANDLE | 20700 | Invalid segmentation handle
ERROR_INV_SEG_DATA | 20701 | Invalid segmentation data
ERROR_INV_LAYER_DATA | 20702 | Invalid layer data
ERROR_MRC_NOT_ALLOCATED | 20703 | Segmentation handle not initialized
ERROR_INV_MIN_SEGMENT | 20704 | Invalid minimum segment width or height
ERROR_SEGMENTATION_FAILURE | 20705 | Segmentation process Failure
ERROR_MRC_INV_PAGE | 20706 | Invalid MRC file's page number
ERROR_PDF_FILE_ENCRYPTED | 20721 | The PDF file is encrypted and the szPassword member of the FILEPDFOPTIONS is not set. (No password.)
ERROR_PDF_INVALID_PASSWORD | 20722 | Invalid password specified
ERROR_PDF_FAX_NOT_ENABLED | 20723 | LFFAX is required for this function
ERROR_PDF_JPEG_NOT_ENABLED | 20724 | LFCMP is required for this function
ERROR_PDF_INV_DOC_STRUCTURING_COMMENTS | 20725 | Invalid Document Structuring Comments (PS and EPS)
ERROR_PDF_FONTS_DIRECTORY_NOT_FOUND | 20726 | Could not find the Fonts directory.
ERROR_PDF_CANNOT_EDIT_FILE | 20727 | Cannot insert, delete, append or replace pages.
ERROR_PDF_BAD_CONTENT | 20728 | File is corrupted.
ERROR_PDF_BAD_INITIALIZATION_FILES | 20729 | The files required for initializing the PDF engine were not found, or they were found, but are not correct.
ERROR_SVG_FILE_SIZE_READ | 20770 | SVG - Invalid File Size Read
ERROR_SVG_ROOT_NOT_SVG | 20771 | SVG - ROOT is Not SVG
ERROR_SVG_NOFOUND_ROOT_ELEMENT | 20772 | SVG - Root Element Not Found
ERROR_SVG_INV_ELEMENT | 20773 | SVG - Invalid Element
ERROR_SVG_DUPLICATED_ATTRIBUTE | 20774 | SVG - Duplicated Attribute
ERROR_SVG_INV_ATTRIBUTE | 20775 | SVG - Invalid Attribute
ERROR_SVG_INV_ATTRIBUTE_VALUE | 20776 | SVG - Invalid Attribute Value
ERROR_SVG_BAD_CSS_PROPERTY | 20777 | SVG - Bad CSS Property
ERROR_SVG_MISSING_REQUIRED_ATTRIBUTE | 20778 | SVG - Missing Required Attribute
ERROR_SVG_DUPLICATED_ID | 20779 | SVG - Duplicated ID
ERROR_SVG_INV_COORDINATES_NUMBER | 20780 | SVG - Invalid Coordinates Number
ERROR_SVG_INV_STRING_COMMA | 20781 | SVG - Invalid String Comma
ERROR_INVALID_FORMAT | 20785 | Invalid format.
ERROR_UNSUPPORTED_METHOD | 20786 | Unsupported method.
ERROR_OPENING_PROFILE | 20787 | Opening profile.
ERROR_INVALID_COLOR_PROFILE | 20788 | Invalid color profile.
ERROR_INVALID_STRUCT_SIZE | 20789 | Invalid structure size.
ERROR_U_V_NOT_MULTIPLES | 20791 | Vertical subsampling period of U must be must be multiple of vertical subsampling period of V, or vice versa. Also horizontal subsampling period of U must be multiple of horizontal subsampling period of V, or vice versa. Otherwise the error is triggered.
ERROR_NO_NONPLANAR_VERTICAL_SUBSAMPLING_SUPPORTED | 20792 | Non-planar vertical sub-sampling is not supported.
ERROR_PLANAR_ALIGNMENT_NOT_SUPPORTED | 20793 | Planar alignment is not supported.
ERROR_UNSUPPORTED_CONVERSION | 20794 | Unsupported conversion.
ERROR_TRUNCATE_HEIGHT | 20795 | Height was truncated.
ERROR_TRUNCATE_WIDTH | 20796 | Width was truncated.
ERROR_TRUNCATE_WIDTH_AND_HEIGHT | 20797 | Height and width were truncated.
ERROR_LAYER_MISSING | 20800 | The PSD layer is missing.
ERROR_BAD_MARKER | 20801 | Bad JPEG marker.
ERROR_AUDIO_MISSING | 20802 | The audio data is not present.
ERROR_DICOM_NOT_ENABLED | 20803 | DICOM support is required to use this function
ERROR_EXTGRAY_NOT_ENABLED | 20804 | Extended grayscale support is required to use this function
ERROR_FILE_READONLY | 20805 | File is read-only. Cannot open file with write access
ERROR_BAD_RESYNC_MARKER | 20806 | Bad JPEG Resync marker
ERROR_LTCLR_MISSING | 20807 | LTCLR DLL is missing
ERROR_MARKER_SIZE_TOO_BIG | 20808 | The size of the JPEG marker cannot exceed 64K
ERROR_MARKER_MISSING | 20809 | The required JPEG marker is missing
ERROR_EXTENSIONS_MISSING | 20810 | This file does not contain Exif extensions
ERROR_MARKER_INDEX | 20811 | The marker index is invalid (too big)
ERROR_NO_PROFILE | 20812 | The ICC profile was not found
ERROR_DECODING_PROFILE | 20813 | An error has occured while decoding the profile
ERROR_NULL_PTR | 20814 | A NULL pointer was passed
ERROR_NO_OVERLAY | 20815 | The overlay does not exist
ERROR_OVERLAY_INDEX | 20816 | Something is wrong with the overlay index
ERROR_CORRUPT_PROFILE | 20817 | The ICC profile was invalid
ERROR_LTSGM_MISSING | 20818 | LTSGM DLL is missing
ERROR_DCR_FILTER_MISSING | 20819 | LFDCR filter is needed to use this function
ERROR_KDC_FILTER_MISSING | 20820 | LFKDC filter is needed to use this function
ERROR_DCS_FILTER_MISSING | 20821 | LFDCS filter is needed to use this function
ERROR_LMC_FILTER_MISSING | 20822 | LFLMC filter is needed to use this function
ERROR_ABC_FILTER_MISSING | 20823 | LFABC (ABIC) filter is needed to use this function
ERROR_JB2_FILTER_MISSING | 20824 | LFJB2 (JBIG2) filter is needed to use this function
ERROR_LTCLR_DLL_NOTLOADED | 20900 | The LTCLR DLL is not loaded
ERROR_LTDLGRES_DLL_NOTLOADED | 20901 | The LDLGRES DLL is not loaded
ERROR_LTDLG_COLOR_NOTINITIALIZE | 20902 | You must initialize LTDLG using L_DlgInit
ERROR_IMAGE_SIZE | 20910 | Image size not sufficient
ERROR_NO_MESSAGE | 20911 | There is no message
ERROR_INV_PASSWORD | 20912 | Invalid password
ERROR_TIFF_COMMAND_NOT_ALLOWED | 20913 | The specified TIFF command is not allowed
ERROR_BAD_TIFF_TAG_VALUE | 20914 | Bad TIFF Tag value
ERROR_NOT_MULTIPAGE_TIFF_FILE | 20915 | Not Multi-Page TIFF file
ERROR_DELETE_TIFF_FILE_NOT_ALLOWED | 20916 | Not allowed to delete the TIFF file
ERROR_COMPACT_ABORTED | 20917 | The compact function was finished without copying all the pages.
ERROR_INV_COLORSPACE | 20918 | Invalid color-space
ERROR_LTPRO_NOT_ENABLED | 20930 | LEADTOOLS Pro Features are not enabled
ERROR_EPRINT_LOCKED | 21000 | ePrint is locked, Please execute a License Agreement
ERROR_OPT_ABORT | 21100 | Abort the optimization operation
ERROR_OPT_SKIPIMAGE | 21101 | Skip optimizing current image
ERROR_OPT_INVALID_INPUT_PATH | 21102 | Invalid input path
ERROR_OPT_INVALID_OUTPUT_PATH | 21103 | Invalid output path
ERROR_OPT_CANNOT_CREATE_OUTPUTPATH | 21104 | Cannot Create Output Directory
ERROR_ICC_UNKNOWN_TAG | 21150 | Unknown ICC profile Tag
ERROR_ICC_UNKNOWN_TYPE | 21151 | Unknown ICC profile Type
ERROR_ICC_UNKNOWN_TAG_AND_TYPE | 21152 | Unknown ICC profile Tag and Type
ERROR_INVALID_ICC_PROFILE | 21153 | Invalid ICC profile
ERROR_DOC_DLL_NOT_LOADED | 21200 | ScanSoft DLLs are not loaded
ERROR_DOC_INV_PAGE_INDEX | 21201 | Specified index is not corrected
ERROR_DOC_INV_FILLMETHOD | 21202 | Invalid fill method.
ERROR_DOC_INV_RECOG_MODULE | 21203 | Invalid recognition module
ERROR_DOC_INV_CHAR_FILTER | 21204 | Invalid character filter
ERROR_DOC_INV_ZONE_TYPE | 21205 | Invalid zone type
ERROR_DOC_INV_LANGID | 21206 | Invalid language Id
ERROR_DOC_INV_SPELL_LANGUAGE | 21207 | Invalid spell language
ERROR_DOC_INV_SECTION_ENUMERATION | 21208 | Invalid enumeration section
ERROR_DOC_INV_PAGE_COUNT | 21209 | Invalid page count
ERROR_DOC_ILLEGAL_CODE | 21210 | Illegal internal code as a parameter
ERROR_DOC_INV_PARAMETER | 21211 | Set parameter is not acceptable
ERROR_DOC_END_LIST_CODE_PAGES | 21212 | End of list of the available Code Pages
ERROR_DOC_LOAD_CODE_PAGE_FILE | 21213 | Error while loading the Code Page Definition file
ERROR_DOC_INV_BUFFER_SIZE | 21214 | The length of the exported code exceeds the buffer size
ERROR_DOC_INV_CHARACTER_CONVERSION | 21215 | Character conversion is not available for the given character
ERROR_DOC_INV_CHARACTER_LANGUAGE | 21216 | Conflict: The selected Code Page does not support some characters in the selected languages. There is no exact code in the Code Page for them
ERROR_DOC_INITIALIZE_CODE_PAGE | 21217 | Character Set and Code Pages module initialization error
ERROR_DOC_INITIALIZE_ENGINE | 21218 | OCR engine initialization error, or there is no appropriate license
ERROR_DOC_TERMINATE_ENGINE | 21219 | OCR engine termination error
ERROR_DOC_INITIALIZE_WARNING | 21220 | Module initialization warning
ERROR_DOC_PROCESS_USER_ABORT | 21221 | Application has aborted the current process
ERROR_DOC_FINISH_PROCESS | 21222 | Application has terminated the current recognition process without losing the recognized text
ERROR_DOC_MODULE_MISSING | 21223 | Module is not present
ERROR_DOC_MODULE_LOAD | 21224 | OS could not load a module
ERROR_DOC_MODULE_MISSING_ENTRY | 21225 | Missing entry in a module
ERROR_DOC_MODULE_INVALID | 21226 | Invalid module
ERROR_DOC_MODULE_INITIALIZE | 21227 | Module initialization error
ERROR_DOC_FEATURE_NOT_SUPPORTED | 21228 | The requested function is not available, or there is no appropriate license
ERROR_DOC_GENERAL | 21229 | General error in the engine
ERROR_DOC_GPF | 21230 | General Protection Fault in the engine
ERROR_DOC_NOT_SUPPORT_OS | 21231 | Not supported operational system
ERROR_DOC_INV_SETTING_FILE | 21232 | Syntax error in the specified engine Settings file
ERROR_DOC_INV_SETTING | 21233 | Invalid setting
ERROR_DOC_ENGINE_BUSY | 21234 | The engine is busy
ERROR_DOC_RECOGNITION_TIME_OUT | 21235 | Recognition process Time Out
ERROR_DOC_INV_IMAGE_MODULE_SETTING | 21236 | Internal error in image module
ERROR_DOC_NO_MEMORY | 21237 | Not enough memory during image processing
ERROR_DOC_INV_IMAGE_DIMENSIONS | 21238 | Invalid rectangle dimensions
ERROR_DOC_INV_IMAGE_RESOLUTION | 21239 | Non-supported resolution
ERROR_DOC_CANNOT_COMPRESS_IMAGE | 21240 | Cannot process compressed image
ERROR_DOC_BAD_BITMAP | 21241 | Invalid bitmap address
ERROR_DOC_NOT_SUPPORT_BPP | 21242 | Unsupported BitsPerPixel value
ERROR_DOC_INV_IMAGE_MODULE | 21243 | Internal error in image module
ERROR_DOC_INV_IMAGE_HANDLE | 21244 | Invalid image handle
ERROR_DOC_BUFFER_OVERFLOW | 21245 | Buffer overflow during processing the image
ERROR_DOC_ACCESS_DENIED | 21246 | Image operation denied
ERROR_DOC_NO_MORE_LINES | 21247 | No more lines in defined image area
ERROR_DOC_BAD_IMAGE_SIZE | 21248 | Non-supported image size
ERROR_DOC_BAD_ENGINE_MANAGER_MODULE | 21249 | Engine manager module error
ERROR_DOC_NO_RECOGNIZED_TEXT_AVAILABLE | 21250 | No recognized text available, either because the zone is empty or the required recognition module has not been initialized properly
ERROR_DOC_NO_SELECTED_RECOGNITION_MODULE | 21251 | There is no selected recognition module
ERROR_DOC_NO_ZONE | 21252 | There is no zone in the zone list
ERROR_DOC_INV_ZONE_INDEX | 21253 | Invalid zone index
ERROR_DOC_INV_ZONE_COORDINATES | 21254 | Invalid zone coordinates
ERROR_DOC_MOR_INITIALIZE_MODULE | 21255 | MOR recognition module initialization error
ERROR_DOC_MOR_BASE_FILE_NOT_FOUND | 21256 | MOR recognition module's knowledge base file not found
ERROR_DOC_MOR_BASE_FILE_CORRUPTED | 21257 | MOR recognition module's knowledge base file corrupted
ERROR_DOC_MOR_BASE_FILE_VERSION | 21258 | Incorrect knowledge base file version
ERROR_DOC_MOR_IMAGE_SIZE | 21259 | Size of image is too large
ERROR_DOC_MOR_FILE_CORRUPTED | 21260 | File is corrupted
ERROR_DOC_MOR_BAD_RECOG_MODULE | 21261 | Internal error in the MOR recognition module
ERROR_DOC_MOR_GPF_MODULE | 21262 | General Protection Fault in the MOR recognition module
ERROR_DOC_DOT_RECOGNITION | 21263 | Dot-matrix recognition error
ERROR_DOC_OMR_CHECKMARK_RECOGNITION | 21264 | Checkmark recognition error
ERROR_DOC_HNR_BASE_FILE__CORRUPTED | 21265 | HNR module's knowledge base file is corrupted
ERROR_DOC_HNR_PARAM_OUT_RANGE | 21266 | Parameter is out of valid range
ERROR_DOC_RER_MODULE | 21267 | Internal error in the RER module
ERROR_DOC_RER_BASE_FILE_NOT_FOUND | 21268 | RER module's knowledge base file not found
ERROR_DOC_RER_CHAR_SET_EMPTY | 21269 | Character Set is empty for the RER module
ERROR_DOC_RER_CHAR_SET_NOT_SUPPORTED | 21270 | The specified Character Set not fully supported by the RER recognition module
ERROR_DOC_RER_MODULE_NOT_FOUND | 21271 | RER specific file not found
ERROR_DOC_SPELL_NO_MEMORY | 21272 | Not enough memory for the SPL module
ERROR_DOC_SPELL_UNINITIALIZED | 21273 | Un-initialized spell object
ERROR_DOC_SPELL_FILE_OPEN | 21274 | Spell file open error
ERROR_DOC_SPELL_FILE_READ | 21275 | Spell file read error
ERROR_DOC_SPELL_USER_DICTIONARY_WRITE | 21276 | User dictionary write error
ERROR_DOC_SPELL_INV_FILE_FORMAT | 21277 | Invalid file format
ERROR_DOC_SPELL_INITIALIZE_MODULE | 21278 | Module initialization error
ERROR_DOC_SPELL_USER_DICTIONARY_CLOSE | 21279 | User dictionary close error
ERROR_DOC_SPELL_ILLEGAL_LANGUAGE_SETTING | 21280 | Illegal language setting
ERROR_DOC_SPELL_NO_MORE_ITEMS | 21281 | No more suggestions/items available
ERROR_DOC_SPELL_CHECK_ERROR | 21282 | Internal checking error
ERROR_DOC_SPELL_ITEM_ALREADY_EXIST | 21283 | Item already exists in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_EXIST | 21284 | Item doesn't exist in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_INSERTED | 21285 | Item wasn't inserted into the User dictionary
ERROR_DOC_SPELL_SECTION_NOT_EXIST | 21286 | Section does not exist in the User dictionary
ERROR_DOC_SPELL_BAD_SYNTEX | 21287 | Regular expression syntax error
ERROR_DOC_OUTPUT_NOT_INITIALIZED | 21288 | Output format conversion subsystem was not initialized
ERROR_DOC_OUTPUT_CONVERT_NOT_EXIST | 21289 | No more converters available
ERROR_DOC_OUTPUT_CONVERT_DLL_NOT_EXIST | 21290 | There is no converter DLL file
ERROR_DOC_OUTPUT_BAD_PARAMETER | 21291 | Wrong parameter or parameter not found
ERROR_DOC_OUTPUT_FILE_CORRUPTED | 21292 | TMP file is corrupted
ERROR_DOC_OUTPUT_FILE_NOT_FOUND | 21293 | TMP file not found
ERROR_DOC_OUTPUT_CREATE_FILE | 21294 | Cannot create TMP file
ERROR_DOC_OUTPUT_SEEK_FILE | 21295 | Cannot seek in TMP file
ERROR_DOC_OUTPUT_READ_FILE | 21296 | TMP file read error
ERROR_DOC_OUTPUT_WRITE_FILE | 21297 | TMP file write error
ERROR_DOC_OUTPUT_CLOSE_FILE | 21298 | Cannot close TMP file
ERROR_DOC_OUTPUT_LOAD_DLL | 21299 | Cannot load the DLL file
ERROR_DOC_OUTPUT_END_OF_FILE | 21300 | Internal error in ATMTXT module. (End-Of-File detected)
ERROR_DOC_OUTPUT_NO_MEMORY | 21301 | Not enough memory for ATMTXT/TMP module
ERROR_DOC_OUTPUT_IMAGE_NOT_AVAILABLE | 21302 | Image is not available for inserting into the output
ERROR_DOC_OUTPUT_NOT_REGISTER_INFO_ITEM | 21303 | Not enough memory to register an info item
ERROR_DOC_TXT_FILE_OPEN | 21304 | Output file open error
ERROR_DOC_TXT_FILE_READ | 21305 | Output file read error
ERROR_DOC_TXT_FILE_NOT_FOUND | 21306 | Output file not found
ERROR_DOC_TXT_FILE_WRITE | 21307 | Output file write error
ERROR_DOC_TXT_INV_COMMAND_SEQUENCE | 21308 | Invalid command sequence in the ICF file
ERROR_DOC_TXT_CREATE_FILE | 21309 | Cannot create the output file
ERROR_DOC_TXT_NO_MEMORY | 21310 | Not enough memory for ATMTXT/TXT module
ERROR_DOC_TXT_INV_DOCUMENT | 21311 | Invalid document type
ERROR_DOC_TXT_FILE_TOO_LARGE | 21312 | File too large
ERROR_DOC_TXT_WARNING_OUTPUT_FILE | 21313 | There was a WARNING during the output file conversion
ERROR_DOC_TXT_OPERATION_CANCELLED | 21314 | Operation cancelled.
ERROR_DOC_TXT_ILLEGAL_OPTION | 21315 | Illegal option specified
ERROR_DOC_TXT_ENCRYPTED_SOURCE | 21316 | Encrypted source
ERROR_DOC_TXT_SEEK_ERROR | 21317 | Output file seek error
ERROR_DOC_BRAILLE_BAD_INITIALIZATION | 21318 | Braille recognition module initialization error
ERROR_DOC_MATRIX_BAD_INITIALIZATION | 21319 | Matrix matching recognition module initialization error
ERROR_DOC_MTX_BAD_INITIALIZATION | 21320 | M/TEXT recognition module initialization error
ERROR_DOC_NON_IMPLEMENTED_FEATURE | 21321 | Non-implemented feature
ERROR_DOC_NOT_FOUND_ZONE | 21322 | couldn't find specific zone
ERROR_DOC_NO_SELECTED_ZONE | 21323 | No available selected zone
ERROR_DOC_EXPORT_PAGE | 21324 | can't export the specified page
ERROR_DOC_LOCK_PAGE | 21325 | can't lock the specified page
ERROR_DOC_ACTIVE_PAGE | 21326 | can't set the specified page to be activated.
ERROR_DOC_LOCKED | 21327 | The OCR document engine is locked
ERROR_DOC_OUTPUT_PDF_LOCKED | 21328 | Output PDF engine is locked.
ERROR_DOC_OMR_LOCKED | 21329 | OMR Options is locked
ERROR_DOC_ICR_LOCKED | 21330 | ICR Options is locked
ERROR_INV_VARIANT_TYPE | 21350 | Invalid Variant type
ERROR_INV_STRING | 21351 | Invalid string value
ERROR_INV_DISPATCH | 21352 | Invalid dispatch
ERROR_INV_FILTERNAME | 21353 | Invalid filter name
ERROR_SIGNED_DATA_NOT_SUPPORTED | 21360 | Signed image data not supported
ERROR_LMC_LOCKED | 21361 | LMC file format is locked
ERROR_JBIG2_LOCKED | 21362 | JBIG2 file format is locked


BitmapCompressionConstants enum

typedef [v1_enum] enum BitmapCompressionConstants{
COMP_NONE,
COMP_RLE,
COMP_SUPER,
} BitmapCompressionConstants;

The BitmapCompressionConstants enum indicates the compression used in storing the bitmap in memory. It is the data type of the BitmapCompression property.

Member | Description
COMP_NONE | No compression. This option can be used to decompress compressed or super compressed bitmaps.
COMP_RLE | 1-bit RLE compression. This compression is very fast and Lossless. For more information, refer to Speeding Up 1-Bit Documents.
COMP_SUPER | Super compression. This is available for 1-bit, 8-bit, and 24-bit bitmaps only. The 24-bit and 8-bit compression is lossy, while the 1-bit compression is lossless.


ILEADOverlayAttributes Interface

The ILEADOverlayAttributes dual interface defines properties for the attributes of overlays. This interface is implemented by the LOverlayAttributes non-creatable COM class.

Properties

ActivationLayer property

BitPosition property

BitsAllocated property

Color property

Columns property

Description property

Flags property

ImageFrameOrigin property

Label property

NumberFramesInOverlay property

OriginX property

OriginY property

ROIArea property

ROIMean property

ROIStandardDeviation property

Rows property

Subtype property

Type property


LoadCompressedConstants enum

typedef [v1_enum] enum LoadCompressedConstants{
LOAD_UNCOMPRESSED,
LOAD_COMPRESSED,
LOAD_SUPERCOMPRESSED
} LoadCompressedConstants;

The LoadCompressedConstants enum indicates how an image is loaded. It is the data type of the LoadCompressed property.

Member | Description
LOAD_UNCOMPRESSED | Load the image uncompressed.
LOAD_COMPRESSED | If possible, load this as a 1-bit RLE compressed image.
LOAD_SUPERCOMPRESSED | Load the image as supercompressed. (Compressed in memory.) This option is available for 1-bit, 8-bit grayscale, and 24-bit images only.


ValueType enum

typedef enum ValueType
{
VALUE_NONE = 0,

VALUE_CHAR,
VALUE_BYTE,
VALUE_SHORT,
VALUE_USHORT,
VALUE_LONG,
VALUE_ULONG,
VALUE_INT,
VALUE_UINT,
VALUE_FLOAT,
VALUE_DOUBLE,
VALUE_BOOLEAN,
VALUE_STRING,

VALUE_ARRAY_BYTE,
VALUE_ARRAY_SHORT,
VALUE_ARRAY_USHORT,
VALUE_ARRAY_LONG,
VALUE_ARRAY_ULONG,
VALUE_ARRAY_INT,
VALUE_ARRAY_UINT,
VALUE_ARRAY_FLOAT,
VALUE_ARRAY_DOUBLE,
VALUE_ARRAY_BOOLEAN,
VALUE_ARRAY_STRING,

VALUE_DISPATCH,
} ValueType;

The ValueType enum determines the value contained in the ILEADRasterVariant object.

Member | Description
VALUE_NONE | No value specified.
VALUE_CHAR | Character value specified using the ShortValue property.
VALUE_BYTE | Byte value specified using the ShortValue property.
VALUE_SHORT | Short value specified using the ShortValue property.
VALUE_USHORT | Unsigned short value specified using the LongValue property.
VALUE_LONG | Long value specified using the LongValue property.
VALUE_ULONG | Unsigned long value specified using the DoubleValue property.
VALUE_INT | Integer value specified using the LongValue property.
VALUE_UINT | Unsigned integer value specified using the DoubleValue property.
VALUE_FLOAT | Float value specified using the FloatValue property.
VALUE_DOUBLE | Double value specified using the DoubleValue property.
VALUE_BOOLEAN | Boolean value specified using the BooleanValue property.
VALUE_STRING | String value specified using the StringValue property.
VALUE_ARRAY_BYTE | Array of byte values specified using the ShortItemValue property.
VALUE_ARRAY_SHORT | Array of short values specified using the ShortItemValue property.
VALUE_ARRAY_USHORT | Array of unsigned short values specified using the LongItemValue property.
VALUE_ARRAY_LONG | Array of long values specified using the LongItemValue property.
VALUE_ARRAY_ULONG | Array of unsigned long values specified using the DoubleItemValue property.
VALUE_ARRAY_INT | Array of integer values specified using the LongItemValue property.
VALUE_ARRAY_UINT | Array of unsigned integer values specified using the DoubleItemValue property.
VALUE_ARRAY_FLOAT | Array of float values specified using the FloatItemValue property.
VALUE_ARRAY_DOUBLE | Array of double values specified using the DoubleItemValue property.
VALUE_ARRAY_BOOLEAN | Array of Boolean values specified using the BooleanItemValue property.
VALUE_ARRAY_STRING | Array of string values specified using the StringItemValue property.
VALUE_DISPATCH | Dispatch value specified using the DispatchValue property.


PDFCompFree method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Void PDFCompFree ()
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Frees all the memory allocated by the PDF compressor object.

For each call to the PDFCompInit method there must be a call to PDFCompFree. This method should be the last method to be called when working with the PDF compressor.

If this method is called before calling the PDFCompWrite method, then the PDF document file in the memory will be destroyed and the user will lose the data in that document.

See Also

Elements: | PDFCompInit method, PDFCompInsertMRC method
Topics: | PDF Compressor Functions: Creating a File


PDFCompInit method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompInit (VARIANT_BOOL bEnablePDFCompEvent);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Initializes the PDF compressor object and creates an empty PDF document file in the memory.

The PDFCompInit method must be called before calling any other PDFCompXXXX property, method or event.

This method also enables or disables firing the PDFCompEvent event, which is used anytime an MRC segmented bitmap is inserted by calling the PDFCompInsertMRC method or the PDFCompInsertNormal method.

When the PDF compressor object is no longer needed, the user must call PDFCompFree method. For every call to the PDFCompInit method there must be a call to PDFCompFree.

See Also

Elements: | PDFCompFree method, PDFCompInsertMRC method, PDFCompInsertNormal method, PDFCompEvent Event
Topics: | PDF Compressor Functions: Creating a File


PDFCompInsertNormal method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompInsertNormal (ILEADRaster * pRaster);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Compresses the specified image, without segmenting it, and inserts the image in the PDF file in memory.

To segment an image using MRC segmentation, compress it, and insert the image with MRC segmentation use PdfCompInsertMRC method.

This method will fire the PDFCompEvent event if the bEnablePDFCompEvent parameter of the PDFCompInit method is set to TRUE. This event allows the user to add or cancel adding a specific segment to PDF File.

See Also

Elements: | PDFCompInsertMRC method
Topics: | PDF Compressor Functions: Creating a File


PDFCompInsertMRC method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompInsertMRC (ILEADRaster * pRaster);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Segments the specified image using MRC segmentation, compresses it, and inserts the image in the PDF file in memory.

To insert the image without using MRC segmentation, use PdfCompInsertNormal method.

You must set the following properties before calling this method:

BackGroundThreshold property

CleanSize property

ColorThreshold property

CombineThreshold property

Flags property

ImageQuality property

OutputQuality property

SegmentQuality property

This method will fire the PDFCompEvent event if the bEnablePDFCompEvent parameter of the PDFCompInit method is set to TRUE. This event allows the user to add or cancel adding a specific segment to the PDF File.

See Also

Elements: | PDFCompInit method, PDFCompInsertNormal method, PDFCompEvent Event, ImageQuality Property, OutputQuality Property, Flags Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


PDFCompInsertSegments method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompInsertSegments (LPDISPATCH pRaster, OLE_COLOR rgbBackgroundColor, VARIANT_BOOL bIsThereBackground);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Inserts user-defined segments into the PDF file.

The properties UserSegmentInfoCount and UserSegmentInfo should be set before calling this method.

To insert a Raster Object with MRC segmentation, use the PDFCompInsertMRC method.

See Also

Elements: | PDFCompInsertMRC method, PDFCompInsertNormal method, UserSegmentInfoCount Property, UserSegmentInfo Property
Topics: | PDF Compressor Functions: Creating a File


PDFCompSetCompression method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompSetCompression (long nFlags, OneBitCompressionTypeConstants comp1Bit, TwoBitCompressionTypeConstants comp2Bit, PictureCompressionTypeConstants compPicture, long nQFactor);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Sets the compression type for image segments. The user can specify the type of compression to be used with each type of segment (1-bit, 2-bit and pictures).

This method must be called before inserting the compressed image into the PDF file by calling the PDFCompInsertMRC or PDFCompInsertNormal methods.

If the user does not call this method before using these methods, then the insertion process for the image into the PDF file will use the default compressions types.

See Also

Elements: | PDFCompInsertMRC method, PDFCompInsertNormal method, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


PDFCompWrite method (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PDFCompWrite (BSTR OutputFileName);
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Writes the file in memory to a file on disk, using the path provided in the OutputFileName parameter.

The PDF Compressor normally creates the compressed PDF document file in memory. It can add as many pages as required to the file. Once the PDF file in memory is complete, call this method to write the file to disk, before calling the PdfCompFree method.

See Also

Elements: | PDFCompInit method, PDFCompInsertMRC method
Topics: | PDF Compressor Functions: Creating a File


PDFCompEvent event (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Void PDFCompEvent (long nPage)
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) This event is fired every time a segment is added to the PDF Compressor object, if the bEnablePDcompEvent parameter of the PDFCompInit method is set to TRUE.

This event is fired by both the PDFCompInsertMRC method and the PDFCompInsertNormal method.

The user must set the EnableAddSegment property within this event to approve adding or cancel adding this segment to the PDF file.

Each time this event is fired, the MRCSegmentInfo property is updated.

The MRCSegmentInfo property is a pointer to an ILTSegmentInfo object, which updates the following properties:

SegmentBottom

SegmentColors

SegmentColorsCount

SegmentLeft

SegmentRight

SegmentTop

SegmentType

See Also

Elements: | PDFCompInsertMRC method, EnableAddSegment property, MRCSegmentInfo property, SegmentLeft property, SegmentTop property, SegmentRight property, SegmentBottom property, SegmentType property, SegmentColors property, SegmentColorsCount property
Topics: | PDF Compressor Functions: Creating a File


BackGroundThreshold property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long BackGroundThreshold
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a threshold value used to separate image objects from the background. The best values are from 5 to 35.

If the value of the ImageQuality property is not PDFCOMPIMAGEQUALITY_USER, then the PDF compressor will ignore the value of this property.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


CleanSize property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long CleanSize
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets the size of the area used to remove the noise inside the segmented image. Possible values range from 0 to 10, where 0 means skip the cleaning stage.

If the value of the ImageQuality property is not PDFCOMPIMAGEQUALITY_USER, then the PDF compressor will ignore the value of this property.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


ColorThreshold property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long ColorThreshold
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a threshold value used to merge segments. The best values are from 75 to 125.

If the value of the OutputQuality property is not PDFCOMPOUTPUTQUALITY_USER, then the PDF compressor will ignore the value of this property.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, CleanSize Property, SegmentQuality Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


CombineThreshold property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long CombineThreshold
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a threshold value used to combine colors. Colors that are closer together than this amount will be combined. The best value is 25. Values saturate at 443.

If the value of the ImageQuality property is not PDFCOMPIMAGEQUALITY_USER, then the PDF compressor will ignore the value of this property.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property
Topics: | PDF Compressor Functions: Creating a File


EnableAddSegment property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableAddSegment
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that indicates whether to add segments to the PDF compressor object. Possible values are:

Setting | Description
TRUE | Add segment.
FALSE | Cancel adding segment.

This property must be set within the PDFCompEvent event to approve or cancel the addition of a segment to the PDF file.

See Also

Elements: | PDFCompEvent Event
Topics: | PDF Compressor Functions: Creating a File


EnableMethodErrors property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentType property, SegmentColorsCount property
Topics: | PDF Compressor Functions: Creating a File


Flags property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets PDF options flags. Possible values are:

Value | Description
PDFCOMP_FAVOR_ONE_BIT | Favors the detection of 1-bit segments.
PDFCOMP_FAVOR_TWO_BIT | Favors the detection of 2-bit segments.
PDFCOMP_FORCE_ONE_BIT | Force all 2-bit segments to be 1-bit.
PDFCOMP_FORCE_TWO_BIT | Force all 1-bit segments to be 2-bit.
PDFCOMP_WITHBACKGROUND | Detect background segments.
PDFCOMP_WITHOUTBACKGROUND | Don’t detect background segments.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property
Topics: | PDF Compressor Functions: Creating a File


ImageQuality property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | IMAGEQUALITYCONSTANTS ImageQuality;
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets the input image quality profile before processing. Possible values are:

Value | Meaning
PDFCOMPIMAGEQUALITY_UNKNOWN | [0] Unknown image quality. Use default handling.
PDFCOMPIMAGEQUALITY_NOISY | [1] The source image is noisy.
PDFCOMPIMAGEQUALITY_SCANNED | [2] The source image a scanned image.
PDFCOMPIMAGEQUALITY_PRINTED | [3] The source image is a printed document.
PDFCOMPIMAGEQUALITY_COMPUTER_GENERATED | [4] The source image is a high quality computer-generated image.
PDFCOMPIMAGEQUALITY_PHOTO | [5] The source image is a high quality photo image; for example, from a digital camera .
PDFCOMPIMAGEQUALITY_USER | [6] The quality is set manually. This flag is for advanced users.

If the value of the ImageQuality property is PDFCOMPIMAGEQUALITY_USER then the following properties must be set:

CleanSize

BackGroundThreshold

CombineThreshold

See Also

Elements: | PDFCompInsertMRC method, OutputQuality Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


MRCSegmentInfo property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTSegmentInfo * MRCSegmentInfo
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets the MRC segment information to be inserted in the PDF file. This property is updated every time the PDFCompEvent event is fired.

The MRCSegmentInfo property is a pointer to an ILTSegmentInfo object, which accesses the following properties:

SegmentBottom property

SegmentColors property

SegmentColorsCount property

SegmentLeft property

SegmentRight property

SegmentTop property

SegmentType property

The EnableAddSegment property must be set within the PDFCompEvent event to approve or cancel the addition of the segment referenced by this property.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentType property
Topics: | PDF Compressor Functions: Creating a File


OutputQuality property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | OUTPUTQUALITYCONSTANTS OutputQuality;
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets the output image quality profile. Possible values are:

Value | Meaning
PDFCOMPOUTPUTQUALITY_AUTO | [0] Choose the quality of the output automatically.
PDFCOMPOUTPUTQUALITY_POOR | [1] Poor output quality with best compression.
PDFCOMPOUTPUTQUALITY_AVERAGE | [2] Average output quality with average compression.
PDFCOMPOUTPUTQUALITY_GOOD | [3] Good output quality with good compression.
PDFCOMPOUTPUTQUALITY_EXCELLENT | [4] Excellent output quality with poor compression.
PDFCOMPOUTPUTQUALITY_USER | [5] The user detects the output quality. This flag is for advanced users.

If the value of OutputQuality is PDFCOMPOUTPUTQUALITY_USER then the following properties must be set:

SegmentQuality property

ColorThreshold property

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, CleanSize Property, SegmentQuality Property, ColorThreshold Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


SegmentQuality property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentQuality
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a threshold value used to determine whether the segment is a picture segment. Possible values range from 0 to 100. Use 0 to set all possible picture segments to 2-bit without losing of a lot of information. Use 100 to set all picture segments to 2-bit only if they are very close to 2-bit.

If the value of the OutputQuality property is not PDFCOMPOUTPUTQUALITY_USER, then the PDF compressor will ignore the value of this property.

See Also

Elements: | PDFCompInsertMRC method, ImageQuality Property, OutputQuality Property, CleanSize Property, ColorThreshold Property, BackGroundThreshold Property, CombineThreshold Property
Topics: | PDF Compressor Functions: Creating a File


UserSegmentInfoCount property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserSegmentInfoCount
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets the number of user segments to be inserted to PDF files. This property must be set before setting the UserSegmentInfo property contents.

See Also

Elements: | PDFCompInsertSegments method, UserSegmentInfo Property, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentType property
Topics: | PDF Compressor Functions: Creating a File


UserSegmentInfo property (ILEADPDFCompressor)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILTSegmentInfo * UserSegmentInfo(long nIndex)
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets an array of pointers to ILTSegmentInfo objects. Each ILTSegmentInfo object contains user segment information to be inserted to a PDF file. The UserSegmentInfoCount must be set before setting this property.

UserSegmentInfo property contains a pointer to an ILTSegmentInfo object, which updates or sets the segment information through the following properties:

SegmentLeft

SegmentTop

SegmentRight

SegmentBottom

SegmentType

SegmentColors

SegmentColorsCount

Once all the user segment information has been set, the user-defined segment can be inserted to the PDF file by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompInsertSegments method, UserSegmentInfoCount Property, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentType property
Topics: | PDF Compressor Functions: Creating a File


CreateMarkers method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CreateMarkers()
Overview | Refer to Markers.

Remarks

Creates an empty marker collection. Markers can be added to this collection using the InsertMarker method.

See Also

Elements: | Count property, CopyMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


DeleteMarker method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DeleteMarker(long lType, short iCount)
Overview | Refer to Markers.

Remarks

Deletes the specified number of markers of type lType from the collection. You can delete all the occurrences of lType, or the first few occurrences.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


DeleteMarkerAt method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DeleteMarkerAt(short iIndex)
Overview | Refer to Markers.

Remarks

Deletes the marker at the specified index from the marker collection.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


GetMarker method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetMarker(long lIndex)
Overview | Refer to Markers.

Remarks

Gets information about the specified marker in the collection. This method lets you get access to each individual marker without the use of an event.

The lIndex should be less than the value of the Count property.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


GetMarkers method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetMarkers(long lFlags)
Overview | Refer to Markers.

Remarks

Gets a copy of the last markers set with SetMarkers.

Since you have a copy, anything you do with the object will not modify the markers, which will be saved if you call a SaveXXX method. If you want to modify the markers being saved, call SetMarkers.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, InsertMarker method, Save method, SaveBuffer method, SaveMemory method, SaveOffset method, SaveMemory method, SaveLayers method, SetMarkers method, TransformFile method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


InsertMarker method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InsertMarker(long lIndex)
Overview | Refer to Markers.

Remarks

Inserts a marker specified by the ElementCount property, the Element property, and the Type property into this object's marker collection.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


Load method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Load(BSTR Filename, long lFlags);
Overview | Refer to Markers.

Remarks

Loads metadata markers (COM and APPn) stored in the specified file.

This collection can then be used to save the metadata information. For Exif files, this metadata collection will contain all the Exif and GPS comments (stored in APP1). It will also contain the audio information stored in APP2.

The markers can also be retrieved by calling the TransformFile method. For each marker that the TransformFile method encounters within a file, the TransformMarker event is triggered. Within this event the user sets the WriteMarkerAction property to indicate what action to take with the marker. If the marker is to be written to the output file, the user calls the WriteMarker method.

To save the collection of metadata markers to a file, call the SetMarkers method.

Important Note:

The comments set by setting the Comment property and then calling the Save method, the SaveMemory method or the WriteComment method will override any comments contained in the metadata markers.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, SetMarkers method, TransformFile method, Type property, WriteMetaData method, LoadOffset method
Topics: | Raster Images: Markers


EnumerateMarkers event (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | void EnumerateMarkers(long lType, long ElementCount)
Overview | Refer to Markers.

Remarks

This event is fired for each marker in the marker collection enumerated by the EnumMarkers method.

Using this event, you can delete, insert, or replace markers.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


Count property (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Count
Overview | Refer to Markers.

Remarks

(Read only) Gets an integer that represents the number of markers contained in the collection.

See Also

Elements: | CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


Element property (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Element (short index)
Overview | Refer to Markers.

Remarks

Gets or sets the array of elements in the current marker.

When the GetMarker method is called, this property is updated with the actual elements in the retrieved marker.

When inserting a marker, set this property along with the ElementCount property and the Type property, before calling the InsertMarker method.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


ElementCount property (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ElementCount
Overview | Refer to Markers.

Remarks

Value that indicates the number of elements in the current marker.

When the GetMarker method is called, this property is updated with the number of elements in the retrieved marker.

When inserting a marker, set this property along with the Element property and the Type property, before calling the InsertMarker method.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


EnumMarkers method (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EnumMarkers()
Overview | Refer to Markers.

Remarks

Enumerates the markers in the marker collection.

This method actually updates this object's marker collection as changes (deletions, insertions, etc.) take place. Therefore, when this method returns, the contents of this object's marker collection may be different from the contents of the marker collection before calling this method.

This method can also be used to selectively delete markers from the marker collection.

The EnumerateMarkers event is triggered for each marker enumerated by this method. You can delete, insert, or replace markers using the event.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


Type property (ILEADMarkers)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Type
Overview | Refer to Markers.

Remarks

Gets or sets an integer that represents the ID of the current marker. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which marker types are allowed.

The default value is 0xE0 (or hE0 in Visual Basic).

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


Bottom property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Bottom
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the bottom boundary, in pixels, of the area in which to search for registration marks.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


DetectedMarkCount property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long DetectedMarkCount
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) (Read only) Gets the number of registration marks detected within the search area.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


DetectedMarkPointX property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long DetectedMarkPointX (long lIndex);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) (Read only) Gets an array of X coordinates that represent the location of the registration marks found in the search area.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkCount property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


DetectedMarkPointY property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long DetectedMarkPointY (long lIndex);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) (Read only) Gets an array of Y coordinates that represent the location of the registration marks found in the search area.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


Height property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Height
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the height, in pixels, of the registration marks for which to search.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Width property, Type property, MinScale property, MaxScale property, Top property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


Left property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Left
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the left boundary, in pixels, of the area in which to search for registration marks.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


NumberOfExpectedMarks property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long NumberOfExpectedMarks
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the number of registration marks expected inside the search area.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


MaxScale property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long MaxScale
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the maximum registration mark scale to be detected. This is a percentage. It must not be lower than the MinScale property value.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, Top property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


MinScale property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long MinScale
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the minimum registration mark scale to be detected. This is a percentage. It must not exceed the MaxScale property value.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MaxScale property, Top property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


Right property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Right
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the right boundary, in pixels, of the area in which to search for registration marks.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


Top property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Top
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the top boundary, in pixels, of the area in which to search for registration marks.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Left property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


Type property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | MarkTypeConstants Type
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the type of registration mark for which to search. Possible values area:

Value | Meaning
RGS_T | [0x0000] T-shaped registration marks.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Width, Height, MinScale, MaxScale, Top, Right, Bottom, NumberOfExpectedMarks, DetectedMarkCount, DetectedMarkPointX, DetectedMarkPointY, Mark, MarksCount, SearchRegMarks.
Topics: | Raster Images: Document Imaging


Width property (ILEADMarkInfo)

Visual Basic example

Visual C++ example

Syntax | long Width
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the width, in pixels, of the registration marks for which to search.

Set this property before calling the SearchRegMarks method.

See Also

Elements: | Height property, Type property, MinScale property, MaxScale property, Top property, Right property, Bottom property, NumberOfExpectedMarks property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


FilePercent property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | short FilePercent;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets the percentage of the original file that has been optimized, when the StatusCode is OPTIMIZE_DIR_OPTIMIZING_IMAGE.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method
Topics: | Optimizer: Optimization Methods


OrginalFileName property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | BSTR OrginalFileName;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets a character string that contains the original full file name.

See Also

Elements: | OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method
Topics: | Optimizer: Optimization Methods


OptimizeOptions property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | ILEADOptimizeOptions * OptimizeOptions;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets the optimization options to be used in the optimization operation. This property is valid only inside the OnOptimizeDir event. You can update the optimization options by updating the OptimizeOptions property only if the value returned by StatusCode is OPTIMIZE_DIR_PRE_OPTIMIZING_IMAGE.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


OptimizedFileName property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | BSTR OptimizedFileName;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets a character string that contains the optimized full file name.

See Also

Elements: | OrginalFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method
Topics: | Optimizer: Optimization Methods


StatusCode property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | long StatusCode;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets the current status.

If an error occurred during image optimization, this will be < OPTIMIZE_SUCCESS. Possible values are:

< OPTIMIZE_SUCCESS | An error occurred.
OPTIMIZE_SUCCESS | [1] Indicates that all selected and supported files in the directory(s) have been optimized successfully.
OPTIMIZE_DIR_PRE_OPTIMIZING_IMAGE | [2] Indicates that the image specified in the OrginalFileName property is about to be optimized. You can update the optimization options by updating the OptimizeOptions property.
OPTIMIZE_DIR_OPTIMIZING_IMAGE | [3] Indicates that the image specified in the OrginalFileName property is being optimized. Information on the percent of optimization that has been completed can be found in the FilePercent and TotalPercent properties.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method
Topics: | Optimizer: Optimization Methods


TotalFolderFilesCount property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | long TotalFolderFilesCount;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets the total number of files in the directory to be optimized.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method
Topics: | Optimizer: Optimization Methods


TotalPercent property (ILEADOptimizeDirInfo)

Visual Basic example

Visual C++ example

Syntax | short TotalPercent;
Overview | Refer to Image Optimization.

Remarks

(Read Only) Gets the percentage of all files that have been optimized, when StatusCode is equal to OPTIMIZE_DIR_OPTIMIZING_IMAGE.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


Distance property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | long Distance;
Overview | Refer to Image Optimization.

Remarks

Gets or sets the distance between the image's colors to be reduced in the image optimization operation. This value will be used if the original image format was one of the following:

PNG File (FILE_PNG).

GIF File (FILE_GIF).

One of the LEAD Supported BMP Formats with 1, 4, and 8 bits per pixel only.

The Distance value can be a value between 0 and 255, where:

Value | Meaning
0 | No additional reduction.
1 to 255 | Further reduction based on the color distance

The default value is 8.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, PickSamePalette property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


JPEGColorSpace property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | JpegColorSpaceConstants JPEGColorSpace;
Overview | Refer to Image Optimization.

Remarks

Gets or sets the value that represents the color space to be used in the image optimization operation, only if the original image format was one of the LEAD Supported JPEG Formats.

This property is used to specify which color space is used when optimizing a JPEG Image. Possible Values are:

Value | Meaning
JPEG_COLOR_SPACE_411 | Optimizing with YUV 4:1:1 color space.
JPEG_COLOR_SPACE_422 | Optimizing with YUV 4:2:2 color space.

The default value is JPEG_COLORSPACE_411.

See Also

Elements | JPEGQFactor property, PNGQFactor property, Percent property, Distance property, PickSamePalette property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


JPEGQFactor property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | long JPEGQFactor;
Overview | Refer to Image Optimization.

Remarks

Gets or sets a value that represents the quality factor used in the image optimization operation. The JPEGQFactor is a number that determines the degree of loss in the compression process. You can set a value from 2 to 255, where 2 represents the highest quality and 255 represents the most compression.

This value is used only if the original image format is one of the LEAD Supported JPEG Formats.

The default value is 35.

See Also

Elements | PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


Percent property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | short Percent;
Overview | Refer to Image Optimization.

Remarks

Gets or sets the percent of redundancy to be used in the image optimization operation. This value will be used if the original image format was one of the following:

PNG File (FILE_PNG).

GIF File (FILE_GIF).

One of LEAD Supported BMP Formats with 1, 4, and 8 bits per pixel only.

The Percent value can be a value between 1 and 100.

The default value is 10.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Distance property, PickSamePalette property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


PickSamePalette property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL PickSamePalette;
Overview | Refer to Image Optimization.

Remarks

Gets or sets a value that indicates whether to generate a unique global palette for all GIF frames or generate a separate palette for each frame. Possible values are:

Value | Meaning
VARIANT_TRUE | Generate a unique global palette for all GIF Frames.
VARIANT_FALSE | Generate an individual palette for each GIF Frame.

The default value is VARIANT_FALSE.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


PNGQFactor property (ILEADOptimizeOptions)

Visual Basic example

Visual C++ example

Syntax | long PNGQFactor;
Overview | Refer to Image Optimization.

Remarks

Gets or sets the value that represents the quality factor to be used in the image optimization operation.

The PNGQFactor can be a value between 0 and 9 where

0 = (default compression),
1 (fastest compression)
.
.
.
9 (highest compression ratio).

This value is used only if the original image format is FILE_PNG.

The Default value is 9.

See Also

Elements: | JPEGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


ActivationLayer property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | BSTR ActivationLayer
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets a string that identifies the layer in which the overlay shall be displayed. For more information, refer to the "Overlay/Curve Activation Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIStandardDeviation property, ROIArea property, ImageFrameOrigin property, NumberFramesInOverlay property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


BitPosition property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long BitPosition
Overview | Refer to Overlays Overview.

Remarks

Gets or sets a value that represents the corresponding bit plane associated with an overlay. This is valid only if OVERLAY_USEBITPLANE is set in the Flags property. For more information about the bit position, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginY property, OriginY property, Flags property, Color property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


BitsAllocated property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long BitsAllocated
Overview | Refer to Overlays Overview.

Remarks

Gets or sets the number of bits allocated in the overlay. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginY property, OriginY property, Flags property, Color property, Rows property, Columns property, Type property, BitPosition property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Color property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | OLE_COLOR Color
Overview | Refer to Overlays Overview.

Remarks

Gets or sets the color used to display those pixels in the overlay bitmap with a value of 1.

See Also

Elements: | OriginY property, OriginY property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images
 | Using Color Values in LEADTOOLS


Columns property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long Columns
Overview | Refer to Overlays Overview.

Remarks

Gets or sets the number of columns in the overlay. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Description property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | BSTR Description
Overview | Refer to Overlays Overview.

Remarks

Gets or sets a string that contains user-defined comments about the overlay. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Flags property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long Flags
Overview | Refer to Overlays Overview.

Remarks

Gets or sets values that indicate whether the overlay bitmap is automatically painted, or processed and whether the BitPosition property contains valid data. Possible values are:

Value | Meaning
OVERLAY_AUTOPAINT | [0x00000001] Paint the overlay automatically when the bitmap is painted.
OVERLAY_AUTOPROCESS | [0x00000002] Automatically adjust the overlay bitmap and position when the main bitmap is resized (zoomed in), scrolled, rotated, flipped, reversed, sheared, or trimmed.
OVERLAY_USEBITPLANE | [0x00000004] The overlay has a corresponding bitplane in the main bitmap. The BitPosition property specifies the index bitplane.

See Also

Elements: | OriginY property, OriginY property, Color property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


ImageFrameOrigin property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long ImageFrameOrigin
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the number of the frame of a multi-frame image to which this overlay applies. For more information, refer to the "Multi-frame Overlay Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIStandardDeviation property, ROIArea property, ActivationLayer property, NumberFramesInOverlay property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Label property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | BSTR Label
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets a string that contains user defined text, which may be used to label or name this overlay. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property perty, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


NumberFramesInOverlay property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long NumberFramesInOverlay
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the number of frames in the overlay. For more information, refer to the "Multi-frame Overlay Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIStandardDeviation property, ROIArea property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


OriginX property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long OriginX
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the x-coordinate of the origin (top left point), in pixels, of the overlay bitmap, relative to the top left point of the displayed main bitmap. This is independent of the main bitmap’s view perspective.

See Also

Elements: | OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


OriginY property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long OriginY
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the y-coordinate of the origin (top left point), in pixels, of the overlay bitmap, relative to the top left point of the displayed main bitmap. This is independent of the main bitmap’s view perspective.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


ROIArea property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long ROIArea
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the number of pixels in the Region Of Interest area. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


ROIMean property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long ROIMean
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the average value of the pixels in the Region Of Interest. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


ROIStandardDeviation property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | double ROIStandardDeviation
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the standard deviation of the pixel values in the Region Of Interest. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Rows property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | long Rows
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the number of rows in the overlay. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Subtype property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | BSTR Subtype
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets a string that contains a defined term that identifies the intended purpose of the overlay type. For more information on the possible values, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Type property (ILEADOverlayAttributes)

Visual Basic example

Visual C++ 6.0 example

Syntax | BSTR Type
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets a string that indicates whether this overlay represents a region of interest or other graphics. For more information, refer to the "Overlay Plane Module Attributes" in the DICOM Standard.

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Columns property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Capture method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Capture (long hDC, float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Capturing an Image from the Screen.

Remarks

Loads a bitmap from the specified rectangle within a device context.

Normally, this method is used for capturing images displayed on the screen. The resulting bitmap will have the same bits per pixel as the display device.

See Also

Elements: | ZoomIn method, ZoomInDone event, EnableZoomInRect property
Topics: | Raster images: Capturing a screen image


CreateUserBitmap method (Main Control)

CreateUserBitmap method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CreateUserBitmap (float fWidth, float fHeight, short iBitsPerPixel, ILEADRasterVariant * vData, long lDataSize);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

This method creates a user bitmap. The user is responsible for allocating and managing the bitmap data pointer. The bitmap data pointer can be specified when the bitmap is created or it can be set later using SetBitmapDataPointer . Freeing this type of bitmap will not free the data pointer set by the SetBitmapDataPointer method.

If the bitmap is 8 bits/pixel or less, the bitmap’s palette should be set with the BitmapPalette property.

The data is not copied. The user is responsible for making sure the bitmap data is valid. This method is designed for high-speed bitmap manipulation.

Note that in LEADTOOLS, the bitmap data is allocated so every row contains a multiple of 4 bytes. The data that you pass to this method should follow the same convention.

See Also

Elements: | CreateBitmap method, SetBitmapDataPointer method
Topics: | Raster Images: Creating and Deleting Images


Copy method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Copy (RasterCopyConstants Flags);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Copies the bitmap to the clipboard.

See Also

Topics: | Raster Images: Exchanging Images with Other Objects
 | Raster Images: Using the Clipboard


CreateBitmap method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short CreateBitmap (float fWidth, float fHeight, short iBitsPerPixel);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Initializes and allocates the bitmap, without loading any data.

If you specify 8 bits per pixel or less, the bitmap is created with LEAD's fixed palette. If you specify 0 bits per pixel, for grayscale, the bitmap is created as an 8-bit image with a grayscale palette. If you need to change the palette, refer to the ColorRes method.

Some image processing functions, such as the Rotate method and the ColorRes method need to re-allocate the image data. If you create a bitmap and pass it to these methods, they will change the bitmap to TYPE_CONV and re-allocate memory. So if you set your data using the SetBitmapDataPointer method it will no longer be used.

See Also

Topics | Raster Images: Creating and Deleting Images
 | Raster Images: Palettes


CreateMaskFromRgn method (ILEADRaster)

Visual Basic example

Visual C++ example

Syntax | short CreateMaskFromRgn ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates a 1-bit mask image from the region that is defined in the source bitmap, contained in the Bitmap property, and updates the MaskBitmap property with it.

A bitmap region is an area of interest within a bitmap. A bitmap can have only one region at a time, but the region can be complex, including, for example, multiple noncontiguous shapes.

See Also

Elements: | MaskBitmap property, SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, PolygonSize property, OffsetRgn method, SetRgnColor method.
Topics: | Raster Images: Creating and Using a Region
 | Saving a Region


CurveToBezier method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CurveToBezier();
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Converts a curve, defined by an array of points that the curve passes through, to an array of Bezier points. The resulting array can be used with the Windows API PolyBezier and PolyBezierTo procedures.

This method is used to convert a standard curve to an array of Bezier control points. A LEAD standard curve (CURVE_STANDARD) is defined by the array of points defined by the CurveX property, CurveY property and the CurveSize property. The standard curve passes through all of the points of the array, and is continuous at each point. This method can be used to draw this curve by converting it to an array of Bezier points.

At most, the resulting array holds (3n + 1) entries, where n is the number of points in the CURVE_STANDARD curve.

The curve to be converted is defined by the following properties:

CurveSize property

CurveX property

CurveY property

CurveType property

CurveTension property

CurveClose property

The resulting Bezier curve is defined by the following properties:

BezierSize property

BezierX property

BezierY property

Note:

BezierSize, BezierX and BezierY properties are read only and are updated by calling the CurveToBezier method.

See Also

Elements: | CurveX property, CurveY property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveType property, CurveClose property, CurveTension property, BezierSize property, BezierX property, BezierY property
Topics: | Raster Images: Creating and Using a Region


DeleteBitmapListItems method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DeleteBitmapListItems (short iIndex, short iCount);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Deletes the specified bitmaps from a bitmap list, and frees the bitmaps from memory.

You cannot use this method to update a bitmap list while it is being used in an animation playback.

See Also

Topics: | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Creating and Deleting Images


DeleteRgnHandle method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL DeleteRgnHandle (long hRgn);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Deletes a stored region and frees the memory that was required for it.

To store a region, use either of the following methods:

GetFloaterHandle method

GetRgnHandle method

Keep in mind that the region data contains only positioning information, not the bitmap's pixel values.

See Also

Elements: | GetFloaterHandle method, GetRgnHandle method, FreeRgn method, SetRgnHandle method
Topics: | Raster Images: Creating and Using a Region


FreeRgn method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short FreeRgn ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Removes the current bitmap region and frees the region data from memory.

Removing the region from the bitmap allows methods to act on the whole bitmap, rather than the region. For a list of affected methods, refer to Raster Images: Where the Region Preempts the Bitmap .

See Also

Elements: | GetFloaterHandle method, GetRgnHandle method, DeleteRgnHandle method, SetRgnHandle method
Topics: | Raster Images: Creating and Using a Region


GetBitmapClipSegments method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetBitmapClipSegments(float y, ILEADRasterVariant * pltVarSeg)
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Gets the segments contained in the region for a particular row.

Call this method only for those rows that are within the region. That is, only those rows from RgnTop to RgnTop + RgnHeight. For the rows not contained in the region, their clip segments will include the whole row.

The segments are returned as an array of pairs of horizontal offsets. The first point in the pair is the beginning of the segment (it is contained in the region). The last point in the pair is the end of the segment. To follow the Windows rules, the end of the segment is the first point NOT CONTAINED in the region.

In most regions, there will be one segment per row. However, some regions can have 0, 1, 2 or more segments.

For example, assume that for a particular row there are two segments. The VARIANT will be filled with 4 values. Let’s call them x0, x1, x2, x3. In this case:

portion from 0 to x0 – 1 is OUTSIDE the region

portion from x0 to x1 - 1 is INSIDE the region

portion from x1 to x2 – 1 is OUTSIDE the region

portion from x2 to x3 – 1 is INSIDE the region

portion from x3 to bitmap width – 1 is OUTSIDE the region

The position is unscaled relative to the LEAD bitmap in memory.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | RgnTop property, RgnHeight property
Topics: | Raster Images: Creating and Using a Region


GetBitmapDC method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetBitmapDC ();
Overview | Refer to Using the Windows API.

Remarks

Provides a powerful set of graphics features by creating a Microsoft Windows device context, using the bitmap as the display surface. If you call this method, you must call the ReleaseBitmapDC method before using other properties or methods that affect the bitmap.

This gives you many drawing capabilities such as paint, erase, color erase and brush, pen, spray gun, flood fill, color tube, text overlay, curve, line, rectangle, polygon, ellipse, freehand shapes, cut and paste, and more.

All Windows GDI functions can be used to draw to the bitmap using the returned HDC. You should use the ReleaseBitmapDC method when the bitmap no longer needs to be available for drawing functions.

If a region is defined for the bitmap, GDI functions act only on the region, not on the entire bitmap.

See Also

Topics: | Raster Images: Creating and Deleting Images
 | Raster Images: Drawing on a Bitmap
 | Examining and Altering Bitmaps


GetDDB method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetDDB (long hDC);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Converts a LEAD Technologies bitmap into a Windows device dependent bitmap (DDB). When this method is completed, there are two copies of the bitmap in memory: the DDB and the original LEAD bitmap. Freeing one will not affect the other.

Ordinarily, you would need a DDB only if you are using Windows API functions. Nevertheless, for simplicity, the examples in this documentation get and set a DDB without using the API.

See Also

Elements: | GetDIB method, SetDIB method, SetDDB method
Topics: | Raster Images: Exchanging Images with Other Objects


GetDIB method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetDIB ();
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Converts a LEAD Technologies bitmap into a Windows device independent bitmap (DIB). When this method is completed, there are two copies of the bitmap in memory: the DIB and the original LEAD bitmap. Freeing one will not affect the other.

Ordinarily, you would need a DIB only if you are using Windows API functions. Nevertheless, for simplicity, the examples in this documentation get and set a DIB without using the API.

See Also

Elements: | SetDIB method, GetDDB method, SetDDB method
Topics: | Raster Images: Exchanging Images with Other Objects


GetDIB2 method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetDIB2(DIBTypeConstants DIBType)
Overview | Refer to Copying and Creating Bitmaps

Remarks

Converts a LEAD Technologies bitmap into a Windows device independent bitmap (DIB). When this method is completed, there are two copies of the bitmap in memory: the DIB and the original LEAD bitmap. Freeing one will not affect the other.

This method is similar to GetDIB method (), but it allows you to specify the type of DIB

A DIB consists of one of the following:

BITMAPFILEHEADER

BITMAPV4HEADER (introduced in Windows 95 and Windows NT 4.0)

BITMAPV5HEADER (introduced in Windows 2000 and Windows 98)

followed by a color table and then the bitmap data. The resulting DIB type is determined by the value of the DIBType parameter.

Ordinarily, you would need a DIB only if you are using Windows API functions. Nevertheless, for simplicity, the examples in this documentation get and set a DIB without using the API.

See Also

Elements: | GetDIB method, SetDIB method, GetDDB method, SetDDB method
Topics: | Raster Images: Exchanging Images with Other Objects


GetMemoryInfo method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetMemoryInfo()
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets information about a bitmap’s memory allocation. The following properties will be updated automatically:

MemoryInfoType Property

MemoryInfoTileSize Property

MemoryInfoTotalTiles Property

MemoryInfoConventionalTiles Property

MemoryInfoMaxTileViews Property

MemoryInfoTileViews Property

This method will allow you to retrieve the values set with the SetMemoryInfo method.

This method is used for informational purposes. You can use the SetMemoryInfo method to change one of more of these parameters. For example, you might increase or decrease the maximum number of tile views at one time (to increase the access time for this bitmap).

Tiled bitmaps are allocated when there is not enough conventional memory to allocate the whole bitmap in conventional memory in one big contiguous chunk. This is often the case for huge bitmaps (500MB or above).

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, SetMemoryInfo Method, MemoryInfoFlags property
Topics: | Raster Images: Creating and Deleting Images


GetMemoryThresholds method (ILEADRaster)

GetMemoryThreshold method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetMemoryThresholds()
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets the current memory restrictions set using the SetMemoryThresholds method. The following properties will be updated:

MemoryTiledThreshold property

MaxConventionalSize property

TiledBitmapsSize property

MemoryConventionalTile property

MemoryFlags property

MemoryConventionalBuffers Property

See Also

Elements: | MaxConventionalSize property, MemoryTiledThreshold property, TiledBitmapsSize property, MemoryConventionalTile property, MemoryFlags property, SetMemoryThresholds method, MemoryConventionalBuffers Property
Topics: | Raster Images: Creating and Deleting Images


GetMinMaxBits method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetMinMaxBits()
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Imaging only) Gets the minimum and maximum bits of the pixels in a bitmap. These values are not affected by LevelLowBit property or LevelHighBit property.

There are two properties associated with this method. The MinBit property and MaxBit property are updated with the minimum and maximum values retrieved by this method.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | MinBit property, MaxBit property, WindowLevel method, GetMinMaxVal method
Topics: | Raster Images: Palettes


GetMinMaxVal method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetMinMaxVal()
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Imaging only) Gets the minimum and maximum intensity values of the pixels in a bitmap. These values are not affected by LevelLowBit property or LevelHighBit property.

There are two properties associated with this method. The MinVal property and MaxVal property are updated with the minimum and maximum values retrieved by this method.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | MinVal property, MaxVal property, WindowLevel method, GetMinMaxBits method
Topics: | Raster Images: Palettes


GetPicture method (ILEADRaster)

Visual Basic example

Other systems

Syntax | IPictureDisp* GetPicture ();
Overview | Refer to Copying and Creating Bitmaps.

Remarks

(Visual Basic only) Returns a Picture object that is a copy of the bitmap.

See Also

Elements: | SetPicture method
Topics: | Raster Images: Exchanging Imgages with Other Objects


GetRgnArea method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetRgnArea ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Returns the number of pixels in the bitmap region.

See Also

Elements: | HasRgn property, IsPtInRgn method, RgnHeight property, RgnLeft property, RgnTop property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


GetRgnHandle method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetRgnHandle ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Stores a copy of the bitmap's region and returns a Windows region handle that you can use to retrieve or delete the stored region.

Keep in mind that the region data contains only positioning information relative to the LEAD bitmap in memory, not the bitmap's pixel values.

To retrieve the stored region and add it to the bitmap, use the SetRgnHandle method. To delete the stored region, use the DeleteRgnHandle method.

See Also

Elements: | GetFloaterHandle method, DeleteRgnHandle method, FreeRgn method, SetRgnHandle method
Topics: | Raster Images: Creating and Using a Region


InsertBitmapListItem method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short InsertBitmapListItem (short iIndex, long hBitmap);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Inserts a bitmap into the control's bitmap list. You can get a bitmap to insert by referencing the Bitmap property of another ILEADRaster Object.

If you insert a bitmap into the middle of a list, the indexes of other items in the list are adjusted.

See Also

Topics:

Raster Images: Creating and Maintaining Lists of Images


IsPtInRgn method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL IsPtInRgn (float fx, float fy);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Determines whether the specified point is in the bitmap's region.

The coordinates of the point are relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

Value | Meaning
TRUE | The bitmap has a region.
FALSE | The bitmap does not have a region.

See Also

Elements: | HasRgn property, GetRgnArea method, RgnHeight property, RgnLeft property, RgnTop property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


IsSupportLocked method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL IsSupportLocked (RasterSupportLockConstants SupportType);
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

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

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

To unlock a feature, use the UnlockSupport method.

All LEADTOOLS COM Objects support this method.

See Also

Topics:

Support: Version and License Information


OffsetRgn method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short OffsetRgn (float fDx, float fDy);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Moves the bitmap region a specified distance. The move does not affect the pixels in the region.

The distances are relative to the LEAD bitmap in memory, not to the Main Control's client area. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, SetRgnColor method, PolygonSize property
Topics: | Raster Images: Creating and Using a Region


Paste method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Paste (RasterPasteConstants Flags);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Pastes image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB or DDB raster image.

Before attempting to paste the data, you can test to see if the clipboard contains valid image data by calling this method with the Flags parameter set to PASTE_ISREADY. If the method does not return 0, the data is valid. You can then paste the image data into the Main Control by calling this method with the Flags parameter set to 0.

The bitmap will contain the same width, height, and bits per pixel as the image on the clipboard.

See Also

Topics: | Raster Images: Exchanging Images with Other Objects
 | Raster Images: Using the Clipboard


ReleaseBitmapDC method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ReleaseBitmapDC ();
Overview | Refer to Using the Windows API.

Remarks

Reverses the action of the GetBitmapDC method.

You should use this method when the bitmap no longer needs to be available for drawing methods.

See Also

Topics: | Raster Images: Creating and Deleting Images
 | Raster Images: Drawing on a Bitmap


ResizeRgn method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ResizeRgn(short iDim, ResizeRgnConstants Flag, VARIANT_BOOL bAsFrame)
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Resizes the bitmap region by the specified number of pixels.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements: | Size method
Topics: | Raster Images: Creating and Using a Region


SetBitmapDataPointer method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetBitmapDataPointer (ILEADRasterVariant * vData, long lDataSize);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

This method can be called only for user bitmaps created with the CreateUserBitmap method.

If vData is empty, the method clears the bitmap data pointer by setting it to NULL.

This method makes the control use the data pointer from the ILEADRasterVariant object. The ILEADRasterVariant object must be a byte array, or this method will fail. Make sure that data pointer is cleared before the ILEADRasterVariant object is freed.

See Also

Elements: | CreateBitmap method, CreateUserBitmap method
Topics: | Raster Images: Creating and Deleting Images


SetBitmapDataPointer2 method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetBitmapDataPointer2 (VARIANT vData, long lDataSize);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

This method can be called only for user bitmaps created with the CreateUserBitmap2 method.

If vData is empty, the method clears the bitmap data pointer by setting it to NULL.

This method makes the control use the data pointer from the variant. The variant must be a byte array, or this method will fail. Make sure that data pointer is cleared before the variant is freed.

See Also

Elements: | CreateBitmap method, CreateUserBitmap2 method, SetBitmapDataPointer method
Topics: | Raster Images: Creating and Deleting Images


SetDDB method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetDDB (long hDC, long hBitmap, long hPalette);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Makes a copy of a device-dependent bitmap (DDB) and assigns the copy to the ILEADRaster object.

For the hPalette parameter, you can use the GetPalette method to get the palette handle.

Ordinarily, you would need a DDB only if you are using Windows API functions. Nevertheless, for simplicity, the examples in this documentation get and set a DDB without using the API.

See Also

Elements: | GetDIB method, SetDIB method, GetDDB method
Topics: | Raster Images: Exchanging Images with Other Objects


SetDIB method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetDIB (long hDIB);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Makes a copy of a device independent bitmap (DIB) and assigns the copy to the ILEADRaster object.

Ordinarily, you would need a DIB only if you are using Windows API functions. Nevertheless, for simplicity, the examples in this documentation get and set a DIB without using the API.

See Also

Elements: | GetDIB method, GetDDB method, SetDDB method
Topics: | Raster Images: Exchanging Images with Other Objects


SetMemoryInfo method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetMemoryInfo ();
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Sets the bitmap allocation values.

If the MemoryInfoType property contains valid data and is not MEMORY_TYPE_TILED, then the other MemoryInfoXXX properties are ignored. If the MemoryInfoType property does not contain valid data and the bitmap is not tiled, then the other MemoryInfoXXX properties are ignored. Either of these cases overrides the settings in the MemoryInfoFlags Property.

The properties that may be used when setting the bitmap allocation values are:

MemoryInfoTileSize Property

MemoryInfoTotalTiles Property

MemoryInfoConventionalTiles Property

MemoryInfoMaxTileViews Property

MemoryInfoTileViews Property

MemoryInfoType Property

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, MemoryInfoFlags property, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting Images


SetMemoryThresholds method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetMemoryThresholds ();
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Sets the memory restrictions for allocating bitmaps according to the following properties:

MemoryTiledThreshold property

MaxConventionalSize property

TiledBitmapsSize property

MemoryConventionalTile property

MemoryFlags property

MemoryConventionalBuffers Property

These are global settings and apply to the current thread. They will apply to bitmaps created in this thread after this method is called.

See Also

Elements: | MaxConventionalSize property, MemoryTiledThreshold property, TiledBitmapsSize property, MemoryConventionalTile property, MemoryFlags property, GetMemoryThresholds method, MemoryConventionalBuffers Property
Topics: | Raster Images: Creating and Deleting Images


SetMinMaxBits method (ILEADRaster)

Visual Basic example

Visual C++ example

Syntax | short SetMinMaxBits(short iMinBit, short iMaxBit)
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Toolkits Toolkits only) Sets the minimum and maximum bits of the pixels in a bitmap. These values are not affected by the LevelLowBit or LevelHighBit properties.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

You can call the GetMinMaxBits method to have LEADTOOLS calculate the minimum and maximum bits of the pixels in a bitmap. If you wish to override these values, call SetMinMaxBits.

This method supports signed data images.

See Also

Elements: | GetMinMaxVal method, MinBit property, MaxBit property, WindowLevel method
Topics: | Raster Images: Palettes


SetPicture method (ILEADRaster)

Visual Basic example

Other systems

Syntax | short SetPicture (IPictureDisp* pPicture);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Copies bitmap data from a picture object and assigns it to the ILEADRaster object.

See Also

Elements: | GetPicture method
Topics: | Raster Images: Exchanging Images with Other Objects


SetRgnBorder method (ILEADRaster)

Visual Basic example

Visual C++ example

Syntax | short SetRgnBorder (float x, float y, OLE_COLOR crBorderColor, OLE_COLOR crLowerTolerance, OLE_COLOR crUpperTolerance, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates a region of pixels with values that fall within a range defined by the value of a specific pixel and a lower and upper tolerance value but are not equal to crBorderColor.

For color bitmaps:

If the value of the pixel at (x, y) is (125, 125, 125) and crLowerTolerance is (20,30,15), then the lower stopping point is (105, 95, 110). If crUpperTolerance is (20,30,15), then the upper stopping point is (145,155,140). In this case, the pixels with values between (105,95,110) and (145,155,140) are non-border pixels and will be included in the region. Any pixel with a value outside this range or equal to crBorderColor is considered a border pixel.

For gray scale bitmaps:

The minimum channel tolerance value of crLowerTolerance will be used to set the lower stopping point, and the minimum channel tolerance value of crUpperTolerance will be used to set the upper stopping point. For example, if the value of the pixel at (x, y) is (125, 125, 125) and crLowerTolerance is (20,30,15), the smallest value of the triplet (15) will be used to create the lower stopping point of (110,110,110). If crUpperTolerance is (10,25,20), the smallest value of that triplet (10) will be used to create the upper stopping point of (135,135,135). In this case, the pixels with values between (110, 110, 110) and (135,135,135) are non-border pixels and will be included in the region. Any pixel with a value outside this range or equal to crBorderColor is considered a border pixel.

To update an existing region, you specify how the new region is to be combined with the existing one. For possible values, refer to Flags for Setting a Region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | SetRgnColor method, SetRgnMagicWand method
Topics: | Raster Images: Creating and Using a Region
 | Using Color Values in LEADTOOLS
 | Saving a Region


SetRgnColor method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnColor (OLE_COLOR crMatch, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds a region that consists of all pixels of a specified color.

You specify the color using a COLORREF value, which is a Windows-defined data type. You can also specify a palette index as explained in Using Palette Indexes As Color Values.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

You can use this method to simulate the use of a transparent color as follows:

Call this method, with the transparent color in the crMatch parameter and L_RGN_SETNOT in the CombineMode parameter.

Use the Floater property and the FloaterVisible property to display and manipulate the region, which consists of every part of the bitmap, except the area with the specified color.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, PolygonSize property, OffsetRgn method
Topics: | Raster Images: Creating and Using a Region
 | Using Color Values in LEADTOOLS


SetRgnColorHSVRange method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnColorHSVRange (short nH0, short nS0, short nV0, short nH1, short nS1, short nV1, short iCombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates or updates the bitmap region by adding a region that consists of all the pixels that fall in the range (nH0, nS0, nV0) ... (nH1, nS1, nV1), inclusively.

This method uses the HSV color model to set a region based on a color range.

nH0, nS0, and nV0 define a minimum (inclusive) H,S, and V. nH1, nS1, nV1 define a maximum (inclusive) H,S, and V. A pixel must have H,S, and V all greater than or equal to nH0, nS0, nV0 and less than or equal to nH1, nS1, nV1 to be included in the region.

It is useful for identifying all shades of a certain color. For example, SetRgnColorHSVRange could be used to set a region of all green colors including:

RGB(0,1,0) |  |  |
RGB(0,2,0) | RGB(1,2,1) |  |
RGB(0,3,0) | RGB(1,3,1) | RGB(2,3,2) |
... | ... | ... | ...
RGB(0,255,0) | RGB(1,255,1) | RGB(2,255,2) | ...

The diagram below shows how S and V affect the color green (H = 85)

As an example, you could set a region for all red (and colors near red) by specifying arguments as follows:

nH0 = 250 | nH1 = 5
nS0 = 1 | nS1 = 255
nV0 = 1 | nV1 = 255

Note that nH0 is 250 and nH1 is 5. For a hue to fall in this range, it must be either 250, 251, 252, 253, 254, 255, 1, 2, 3, 4, or 5. Also, note that the hue values wrap from 255 back around to 1.

To update an existing region, you specify how the new region is to be combined with the existing one. For possible values, specified in the iCombineMode parameter, refer to Flags for Setting a Region

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | SetRgnColorRGBRange method, SetRgnColor method
Topics | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnColorRGBRange method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnColorRGBRange (OLE_COLOR crLower, OLE_COLOR crUpper, short iCombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates or updates the bitmap region by adding a region that consists of all the pixels that fall in the range crLower ... crUpper, inclusively.

This method uses the RGB color model to set a region based on a color range.

To be added to the region a color must fall in the range crLower..crUpper. To set a region for all pure red, specify crLower and crUpper as follows:

crLower RGB(1,0,0)
crUpper(255,0,0)

Note that this would fail to include many colors that look red to the eye (like RGB(255,4,4)). To include ALL shades of red, you can use the SetRgnColorHSVRange method.

To update an existing region, you specify how the new region is to be combined with the existing one. For possible values, specified in the iCombineMode parameter, refer to Flags for Setting a Region

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | SetRgnColorHSVRange method, SetRgnColor method
Topics | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnCurve method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetRgnCurve(RgnPolygonFillModeConstants FillMode, RgnCombineModeConstants CombineMode)
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates or updates the bitmap region by adding a curved region.

This method can draw two types of curves: a smooth curve that goes through all of the points, or a series of Bezier curves that use the points as control points. The type of curve drawn is determined by the CurveType property. The points are contained int the CurveX property and the CurveY property.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, CurveY property, CurveSize property, CurveToBezier method, CurveTension property, CurveClose property, CurveType property, SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, SetRgnColor method, OffsetRgn method
Topics: | Raster Images: Creating and Using a Region


SetRgnEllipse method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnEllipse (float fLeft, float fTop, float fWidth, float fHeight, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds an elliptical region to the bitmap.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements | SetRgnRect method, SetRgnRoundRect method, SetRgnColor method, PolygonSize property, OffsetRgn method
Topics | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnFromMask method (ILEADRaster)

Visual Basic example

Visual C++ example

Syntax | short SetRgnFromMask (RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Creates or updates the bitmap region in the Bitmap property by adding the region specified by the white pixels in the MaskBitmap property.

The MaskBitmap property must contain a 1-bit image before calling this method. The MaskBitmap property can be set manually, by the user, or it may be updated by calling the CreateMaskFromRgn method.

See Also

Elements: | MaskBitmap property, SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, PolygonSize property, OffsetRgn method, SetRgnColor method.
Topics: | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnHandle method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnHandle (long hRgn, float fDx, float fDy, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds a stored region to the current bitmap region.

You can store a region using the GetRgnHandle method or the DeleteRgnHandle method. Keep in mind that the region data contains only positioning information, not the bitmap's pixel values.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

See Also

Elements: | GetFloaterHandle method, GetRgnHandle method, DeleteRgnHandle method, FreeRgn method
Topics: | Raster Images: Creating and Using a Region


SetRgnMagicWand method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnMagicWand (float x, float, y, OLE_COLOR crLowerTolerance, OLE_COLOR crUpperTolerance, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Sets a region based on the color found at point x, y in the region.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

For color bitmaps:

If the value at pixel (x, y) is (125, 125, 125) and crLowerTolerance is (20, 30, 15) the lower stopping point is (105, 95, 110). If crUpperTolerance is (10, 25, 20), then the upper stopping point is (135, 150, 145). Pixels with values of (105, 95, 110) up to (135, 150, 145) will be included in the region.

For gray scale bitmaps:

The minimum channel tolerance value of crLowerTolerance will be used to set the lower stopping point, and the value of crUpperTolerance will be used to set the upper stopping point. For example, if the value of the pixel at (x, y) is (125, 125, 125) and crLowerTolerance is (20,30,15), the smallest value of the triplet (15) will be used to create the lower stopping point of (110,110,110). If crUpperTolerance is (10,25,20), the smallest value of that triplet (10) will be used to create the upper stopping point of (135,135,135).

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | SetRgnColor method
Topics | Raster Images: Creating and Using a Region
 | Using Color Values in LEADTOOLS
 | Saving a Region


SetRgnPolygon method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnPolygon (short iFillMode, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds a polygonal region to the bitmap.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

To create a polygonal region, you must first build an ordered array of points for the vertices of the polygon; then create the region based on the array. The PolygonSize property specifies the size of the array. You can either specify a large array to start with, or you can increase the size of the array when necessary (without losing the existing points). For each vertex, you update the array by setting the following indexed properties:

PolygonX property

PolygonY property

You can then call the SetRgnPolygon method.

See Also

Topics | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnRect method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnRect (float fLeft, float fTop, float fWidth, float fHeight, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds a rectangular region to the bitmap.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements | SetRgnEllipse method, SetRgnRoundRect method, SetRgnColor method, PolygonSize property, OffsetRgn method
Topics | Raster Images: Creating and Using a Region
 | Saving a Region


SetRgnRoundRect method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetRgnRoundRect (float fLeft, float fTop, float fWidth, float fHeight, float fWidthEllipse, float fHeightEllipse, RgnCombineModeConstants CombineMode);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Adds a rounded rectangular region to the bitmap.

With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the CombineMode parameter, refer to Flags for Setting a Region.

Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

The following illustration shows how the you describe the rounded corners by specifying the width and height of an ellipse:

See Also

Elements | SetRgnEllipse method, SetRgnRect method, SetRgnColor method, PolygonSize property, OffsetRgn method
Topics | Raster Images: Creating and Using a Region
 | Saving a Region


UnlockSupport method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void UnlockSupport (RasterSupportLockConstants iType, BSTR pszKey);
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

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

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

Note: UnlockSupport can be replaced by entering the appropriate keys in LTOCX14.LIC. Edit the LTOCX14.LIC file and append at the end of a line, and on the same line, one or more pairs in the form |L_SUPPORT_xxx=key. For a list of the keys that can be specified, refer to the iType parameter for this method.

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

|L_SUPPORT_DOCUMENT=dockey|L_SUPPORT_OCR=ocrkey

See Also

Topics:

Support: Version and License Information


WindowLevelFillLUT method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax

short WindowLevelFillLUT (OLE_COLOR crStart, OLE_COLOR crEnd, long nLow, long nHigh, short nLowBit, short nHighBit, long nMinValue, long nMaxValue, short nFactor, long lFlags);

Remarks

(Document/ Medical Imaging only) Maps grayscale intensities to a specified color range, and fills the LevelLUT property with these values.

Use this method to fill the LevelLUT property, used in WindowLevel method, according to LUT type flag.

If you select FILLLUT_LINEAR the LevelLUT property will be filled as follows:

Inside/Outside | nMinValue-nLow | nLow-nHigh | nHigh-nMaxValue
FILLLUT_INSIDE | solid black (0,0,0) | color gradient ranging from crStart to crEnd | solid white (255,255,255)
FILLLUT_OUTSIDE | solid color (crStart) | grayscale values from solid black (0,0,0) to solid white (255, 255, 255) | solid color (crEnd)

In either case, the grayscale values are a linear interpolation of nMinValue to nMaxValue into RGB(0,0,0) to RGB(255,255,255).

The nFactor parameter is used for log, exp and sigmoid functions only. If nFactor = 0 the method performs a linear interpolation between the two points nLow and nHigh and stores the results in the lookup table, regardless of the value in lFlags.

If lFlag is FILLLUT_EXPONENTIAL the value of nFactor modifies the lookup table values (see figure below) according to the following equations:

Y | = | uStart | + | (uEnd – uStart) * (exp ((nFactor/10. * (x-uStart))/(uEnd-uStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where :

nFirstValue = exp(0).

nLastValue = exp(nFactor)

x = the intensity value of the selected point

uStart = the nLow parameter of this method

uEnd = the nHigh parameter of this method

If lFlag is FILLLUT_ LOGARITHMIC the value of nFactor modifies the lookup table values (see figure below) according to the following equations:

Y | = | uStart | + | (uEnd – uStart) * (ln (1 + (nFactor/10. * (x-uStart))/(uEnd- uStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where:

nFirstValue = 0.

nLastValue = ln(1 + nFactor)

x = the intensity value of the selected point

uStart = the nLow parameter of this method

uEnd = the nHigh parameter of this method

If lFlag is FILLLUT_ SIGMOID the value of nFactor modifies the lookup table values (see figure below)according to the following equations:

Y | = | uStart | + | (uEnd – uStart) * (1./ (1 + exp(2*nFactor/10. * (x-Center))/(uEnd- uStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where:

nFirstValue = 1./(1+exp(2.*nFactor/10.*(nStart - Center)/ (uEnd- uStart))).

nLastValue = 1./(1+exp(2.*nFactor/10.*(nEnd - Center)/ (uEnd- uStart))).

Center = (nEnd + nStart)/2.

x = the intensity value of the selected point

uStart = the nLow parameter of this method

uEnd = the nHigh parameter of this method

If lFlag is FILLLUT_LINEAR, nFactor is ignored. The method fills the lookup table linearly.

Note: This method only works for 12 or 16 bit grayscale images. Trying to use this method with other images will result in an error.

You must allocate the memory for the LUT before calling this method. You can calculate the required size with (sizeof(RGBQUAD) * (1<<(pBitmap->HighBit - pBitmap->LowBit + 1))), as seen in the example below.

For example, suppose you are working with a 12 bit grayscale image. There are 4096 intensity levels in a 12 bit image (2 raised to the 12th power). Normally, the interval between 0 and 4095 would be mapped to colors between (0, 0, 0) and (255, 255, 255). With this method, any value that falls between the low level and the high level will be mapped to colors between the start color and the end color. If you do not want a mapping function, set the start and end colors equal.

If you only want to map the values between 1972 and 3273 (in a 12-bit image), then set nLow to 1972, set nHigh to 3273, and set bInside to TRUE. To map the values less than 1972 and greater than 3273, select FILLLUT_OUTSIDE option.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | WindowLevel method, LevelLUT property
Topics: | Using Color Values in LEADTOOLS
 | Saving Window-Leveled Bitmaps


BezierSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BezierSize;
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

(Read only) Indicates the size of the arrays (BezierX property and BezierY property) used to store the vertices of the Bezier curve.

This property is updated by the CurveToBezier method.

See Also

Elements: | BezierX property, BezierY property, CurveToBezier method, CurveX property, CurveY property, CurveSize property, CurveTension property, CurveType property, SetRgnCurve method
Topics: | Raster Images: Creating and Using a Region


BezierX property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BezierX(long iIndex)
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

(Read only) Gets an array of long values that represent the X coordinates for the control points of the Bezier curve.

The number of points in the array is contained in the BezierSize property.

This property is updated by the CurveToBezier method.

See Also

Elements: | BezierSize property, BezierY property, CurveToBezier method, CurveX property, CurveY property, CurveSize property, CurveTension property, CurveType property, SetRgnCurve method
Topics: | Raster Images: Creating and Using a Region


BezierY property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BezierY(long iIndex)
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

(Read only) Gets an array of long values that represent the Y coordinates for the control points of the Bezier curve.

The number of points in the array is contained in the BezierSize property.

This property is updated by the CurveToBezier method.

See Also

Elements: | BezierSize property, BezierX property, CurveToBezier method, CurveX property, CurveY property, CurveSize property, CurveTension property, CurveType property, SetRgnCurve method
Topics: | Raster Images: Creating and Using a Region


Bitmap property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long Bitmap
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Gets or sets the bitmap of the ILEADRaster object.

If you wish to use a bitmap in another control or LEADTOOLS COM Object, you must assign the Bitmap property to the destination control.

Setting this property to 0 clears the bitmap from memory. You can assign its value to another Object's Bitmap property to create a copy.

If a region is defined for the bitmap, the region is also freed or copied.

When assigning from this property to one of the other objects, a reference is made to the source object's bitmap. For more information, refer to LEADRasterOLEDB Raster.

When assigning to this property, a copy of the source object's bitmap is made unless the destination object's RefBitmap property is set to True. Use the RefBitmap property to avoid having a second copy of the source image in memory.

If you assign a bitmap to the Bitmap property, the current bitmap in the bitmap list will be replaced. If you set the Bitmap property to 0, the current bitmap is removed from the bitmap list. For example, if you load a file that contains 4 images into a bitmap list, and then set the Bitmap property to 0, the current bitmap will be removed from the bitmap list and BitmapListCount property will be decreased by 1.

See Also

Elements: | RefBitmap property
Topics: | Raster Images: Creating and Deleting Images
 | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Copying Images
 | LEADTOOLS API Integration Functions


BitmapAlpha property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long BitmapAlpha
Overview | Refer to Working with the Alpha Channel.

Remarks

Lets you get or set alpha-channel data in a bitmap.

Typically, an alpha channel contains a mask that is used for transparency. This property, used with the region processing methods, lets you implement transparency in saved images.

When you get the value of this property (assigning it to another Object) you get an 8-bit grayscale bitmap that matches the current alpha channel data. When you set the value from another Object, LEADTOOLS interprets the bitmap data, if necessary, to update the alpha channel data.

Only 16- and 32-bit images can have an alpha channel. If you set this property in a control that has any other color resolution, the bitmap is converted to 32-bit. (If you want 16-bit, you should change it using the ColorRes method, if necessary, before setting the property.)

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property, SetRgnColor method, GetRgnHandle method, SetRgnHandle method
Topics | Implementing Transparency
 | Saving a Region
 | Handling CMYK Files as Separate Bitmaps


BitmapBits property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapBits
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Is the number of bits per pixel for the bitmap.

See Also

Elements: | BitmapHeight property, BitmapWidth property, BitmapXRes property, BitmapYRes property, GetColorCount method
Topics: | Raster Images: Getting Current Information


BitmapBytesPerLine property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapBytesPerLine
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Gets the number of bytes per line, rounded upward to the nearest multiple of four.

See Also

Elements: | BitmapHeight property, BitmapWidth property, BitmapBits property, BitmapCompression property, BitmapSize property
Topics: | Raster Images: Getting Current Information


BitmapCompression property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | BitmapCompressionConstants BitmapCompression;
Overview | Refer to Super Compressed Bitmaps

Remarks

(Read Only) Indicates the compression used in storing the bitmap in memory. For a list of possible values, refer to the BitmapCompressionConstants enumeration.

The property gives the user the current compression used by the bitmap.

To change the bitmap's compression, use the SetBitmapCompression method.

See Also

Elements: | LoadCompressed property, SetBitmapCompression method
Topics: | Raster Images: Getting Current Information


BitmapDelay property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long BitmapDelay
Overview | Refer to Playing an Animation.

Remarks

Sets or gets the animation playback delay in milliseconds (ms).

The delay is the wait period before the bitmap is displayed during playback. It can be different for each bitmap in a list (but it is usually the same). This value affects animations in ILEADRasterView.

See Also

Elements: | BitmapDisposalMethod property, BitmapEnableTransparency property, BitmapTransparentColor property
Topics: | Raster Images: Playing Animated Images


BitmapDisposalMethod property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnimationDisposalConstants BitmapDisposalMethod
Overview | Refer to Playing an Animation.

Remarks

Sets or gets the animation playback disposal method.

The disposal method can be different for each bitmap in a list (but it is usually the same). The following are constants for the disposal methods used after rendering an image in an animation playback:

Value | Meaning
ANIMATIONDISPOSAL_NONE | Do nothing.
ANIMATIONDISPOSAL_LEAVE | Leave the target bitmap as is.
ANIMATIONDISPOSAL_RESTOREBACKGROUND | Restore the background.
ANIMATIONDISPOSAL_RESTOREPREVIOUS | Restore the previous image.

See Also

Elements: | BitmapDelay property, BitmapEnableTransparency property, BitmapTransparentColor property
Topics: | Raster Images: Playing Animated Images


BitmapEnableTransparency property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL BitmapEnableTransparency
Overview | Refer to Playing an Animation.

Remarks

Enables or disables the use of a transparent color when playing an animation.

The color is specified by the BitmapTransparentColor property. The use of transparency can be different for each bitmap in a list (but it is usually the same).

Value | Meaning
TRUE | Enable transparency.
FALSE | Disable transparency.

See Also

Elements: | BitmapDelay property, BitmapDisposalMethod property, BitmapTransparentColor property
Topics: | Raster Images: Playing Animated Images
 | Implementing Transparency


BitmapHeight property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BitmapHeight
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Is the height of the bitmap. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | BitmapBits property, BitmapWidth property, BitmapXRes property, BitmapYRes property, GetColorCount method
Topics: | Raster Images: Getting Current Information


BitmapLeft property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BitmapLeft
Overview | Refer to Playing an Animation.

Remarks

Specifies the X coordinate of the origin of the bitmap relative to the target bitmap during animation playback. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | BitmapTop property
Topics: | Raster Images: Playing Animated Images


BitmapList property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long BitmapList
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Gets or sets the bitmap list.

You can use this property to copy an entire list of bitmaps from one Main Control to another. You can also set this property to 0 to free all bitmaps in the list.

If you assign a bitmap to the Bitmap property, the current bitmap in the bitmap list will be replaced. If you set the Bitmap property to 0, the current bitmap is removed from the bitmap list. For example, if you load a file that contains 4 images into a bitmap list, and then set the Bitmap property to 0, the current bitmap will be removed from the bitmap list and BitmapListCount property will be decreased by 1.

See Also

Topics: | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Copying Images


BitmapListCount property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapListCount
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Read only) Is the number of bitmaps in the object's bitmap list.

See Also

Topics:

Raster Images: Creating and Maintaining Lists of Images


BitmapListIndex property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapListIndex
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Is the index of the current bitmap in the object's bitmap list.

You can set this property to specify the current bitmap. For example, if you wanted to resize all bitmaps in a list, you would use a loop that updates this property before calling the Size method.

See Also

Topics:

Raster Images: Creating and Maintaining Lists of Images


BitmapPalette property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR BitmapPalette (short iIndex);
Overview | Refer to Managing Palettes

Remarks

Sets a color in the bitmap's palette.

The palette is an array of 256 elements. Each element is a long integer value containing the red, green and blue (RGB) components of the color. You can specify a color using the RGB function.

Palettes are used only for images that are 8 bits per pixel or less.

See Also

Topics: | Raster Images: Palettes
 | Using Color Values in LEADTOOLS


BitmapSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapSize;
Overview | Refer to Super Compressed Bitmaps

Remarks

(Read only) Gets the number of bytes used by the bitmap data.

See Also

Elements: | BitmapHeight property, BitmapWidth property, BitmapBits property, BitmapCompression property
Topics: | Raster Images: Getting Current Information


BitmapTop property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BitmapTop
Overview | Refer to Playing an Animation.

Remarks

Specifies the Y coordinate of the origin of the bitmap relative to the target bitmap during animation playback. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | BitmapLeft property
Topics: | Raster Images: Playing Animated Images


BitmapTransparentColor property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR BitmapTransparentColor
Overview | Refer to Playing an Animation.

Remarks

Specifies the color to use for transparency in an animation playback.

You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

See Also

Elements: | BitmapDelay property, BitmapDisposalMethod property, BitmapEnableTransparency property
Topics: | Raster Images: Playing Animated Images
 | Using Color Values in LEADTOOLS
 | Implementing Transparency


BitmapWidth property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BitmapWidth
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Is the width of the bitmap. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | BitmapBits property, BitmapHeight property, BitmapXRes property, BitmapYRes property, GetColorCount method
Topics: | Raster Images: Getting Current Information


BitmapXRes property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapXRes
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Dots per inch in the width direction.

This value is commonly used for printing. Loading an image from a file updates this property, using the value stored in the file.

If the values of the BitmapXRes property and the BitmapYRes property are not equal, set the PaintSizeUseDPI property to TRUE to have LEAD's automated scaling properties account for the physical resolution of the bitmap. These automated scaling properties include:

AutoRepaint property

AutoScroll property

AutoSetRects property

AutoSize property

DstHeight property

DstLeft property

DstTop property

DstWidth property

PaintSizeMode property

PaintZoomFactor property

See Also

Elements | BitmapBits property, BitmapHeight property, BitmapWidth property, BitmapYRes property, GetColorCount method, AutoRepaint property, AutoScroll property, AutoSetRects property, AutoSize property, DstHeight property, DstLeft property, DstTop property, DstWidth property, PaintSizeMode property, PaintZoomFactor property
Topics | Raster Images: Getting Current Information


BitmapYRes property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapYRes
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Dots per inch in the height direction.

This value is commonly used for printing. Loading an image from a file updates this property, using the value stored in the file.

If the values of the BitmapXRes property and the BitmapYRes property are not equal, set the PaintSizeUseDPI property to TRUE to have LEAD's automated scaling properties account for the physical resolution of the bitmap. These automated scaling properties include:

AutoRepaint property

AutoScroll property

AutoSetRects property

AutoSize property

DstHeight property

DstLeft property

DstTop property

DstWidth property

PaintSizeMode property

PaintZoomFactor property

See Also

Elements | BitmapBits property, BitmapHeight property, BitmapWidth property, BitmapXRes property, GetColorCount method, AutoRepaint property, AutoScroll property, AutoSetRects property, AutoSize property, DstHeight property, DstLeft property, DstTop property, DstWidth property, PaintSizeMode property, PaintZoomFactor property
Topics | Raster Images: Getting Current Information


CreateUserBitmap2 method (Main Control)

CreateUserBitmap2 method (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CreateUserBitmap2 (float fWidth, float fHeight, short iBitsPerPixel, VARIANT vData, long lDataSize);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

This method creates a user bitmap. The user is responsible for allocating and managing the bitmap data pointer. The bitmap data pointer can be specified when the bitmap is created or it can be set later using SetBitmapDataPointer2 . Freeing this type of bitmap will not free the data pointer set by the SetBitmapDataPointer2 method.

If the bitmap is 8 bits/pixel or less, the bitmap’s palette should be set with the BitmapPalette property.

The data is not copied. The user is responsible for making sure the bitmap data is valid. This method is designed for high-speed bitmap manipulation.

Note that in LEADTOOLS, the bitmap data is allocated so every row contains a multiple of 4 bytes. The data that you pass to this method should follow the same convention.

See Also

Elements: | CreateBitmap method, SetBitmapDataPointer method, CreateUserBitmap method, SetBitmapDataPointer2 method
Topics: | Raster Images: Creating and Deleting Images


CurveClose property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | CurveCloseConstants CurveClose;
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Indicates how the curve is closed. This property is used only when the CurveType property is set to CURVE_STANDARD. Possible values are:

Value | Meaning
CURVE_NO_CLOSE | [0x0] For n points, draw (n – 3) segments. For example, for points {P0, P1, P2, P3, P4}, draw segments P1P2 and P2P3.
CURVE_CLOSE | [0x1] For n points draw (n) segments. For example, for points {P0, P1, P2, P3, P4}, draw segments P0P1, P1P2, P2P3, P3P4, P4P0.
CURVE_PARTIAL_CLOSE | [0x2] For n points draw (n – 1) segments. For example, for points {P0, P1, P2, P3, P4}, draw segments P0P1, P1P2, P2P3, P3P4 (but not P4P0).

In the following diagram, the resulting region is shown in gray.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, CurveY property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveType property, CurveTension property
Topics: | Raster Images: Creating and Using a Region


CurveSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CurveSize;
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Indicates the size of the arrays (CurveX property and CurveY property) used to store the vertices of the curve.

This property is used by both the SetRgnCurve method and the CurveToBezier method.

The CurveType property can define two types of curves:

If the CurveType property is set to CURVE_STANDARD, the points contained in the CurveX property and the CurveY property represent a smooth curve that goes through all of the points. In this case, the CurveSize property must be at least three.

If the CurveType property is set to CURVE_BEZIER, the points contained in the CurveX property and the CurveY property represent a series of Bezier curves that use the points as control points. In this case, the CurveSize property must be 3n + 1, where n >= 1. For example, CurveSize can be 4, 7, 10, 13, and so on. The first four points define the first Bezier curve, and each subsequent group of three points defines the next Bezier curve, using the last point of the previous Bezier curve as the starting point.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, CurveY property, SetRgnCurve method, CurveTension property, CurveToBezier method, CurveType property, CurveClose property
Topics: | Raster Images: Creating and Using a Region


CurveTension property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CurveTension;
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Indicates the "straightness" of the curves that connect the points.

This property is used only when CurveType property is set to CURVE_STANDARD. Valid values are between 0.0 and 1.0, where 0.0 indicates straight lines, and 1.0 indicates lines with the highest curvature. A typical value is 0.5.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, CurveY property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveType property, CurveClose property
Topics: | Raster Images: Creating and Using a Region


CurveType property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | CurveTypeConstants CurveType;
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Indicates the type of curve defined by the array of points specified in the CurveX property and the CurveY property. Possible values are:

Value | Meaning
CURVE_BEZIER | The points specified in the CurveX and CurveY properties define a Bezier curve.
CURVE_STANDARD | The points specified in the CurveX and CurveY properties define a standard curve.

This property must be set to CURVE_STANDARD to use the CurveX and CurveY arrays with the CurveToBezier method.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, CurveY property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveTension property, CurveClose property
Topics: | Raster Images: Creating and Using a Region


CurveX property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CurveX(long iIndex)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

An array of float values that represent the X coordinates for the points that define the curve.

This property is used by both the SetRgnCurve method and the CurveToBezier method.

The position is relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveY property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveTension property, CurveClose property, CurveType property
Topics: | Raster Images: Creating and Using a Region


CurveY property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CurveX(long iIndex)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

An array of float values that represent the Y coordinates for the points that define the curve.

This property is used by both the SetRgnCurve method and the CurveToBezier method.

The position is relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

To create a curve region, first build an ordered array of points for the curve. Then create the region based on the array. The CurveSize property specifies the size of the array. Either specify a large array to start with, or increase the size of the array as needed, without losing existing points. For each point, update the following indexed properties:

CurveX property

CurveY property

And define the characteristics of the curve by setting the following properties:

CurveType property

CurveTension property

CurveClose property

Then call the SetRgnCurve method to add the region to the bitmap.

See Also

Elements: | CurveX property, SetRgnCurve method, CurveSize property, CurveToBezier method, CurveTension property, CurveClose property, CurveType property
Topics: | Raster Images: Creating and Using a Region


HasRgn property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL HasRgn
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Determines whether a region is defined in the LEAD bitmap.

When a bitmap has a region, some methods act on the region, rather than the whole bitmap. For a list of affected methods, refer to Raster Images: Where the Region Preempts the Bitmap.

Value | Meaning
TRUE | The bitmap has a region.
FALSE | The bitmap does not have a region.

See Also

Elements: | IsPtInRgn method, GetRgnArea method, RgnHeight property, RgnLeft property, RgnTop property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


IsGrayscale property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | GrayScaleTypes IsGrayscale
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Is an indicator of the kind of grayscale palette, if any, that a bitmap has.

Grayscale images can be 1-bit, 4-bit, or 8-bit. With a 1-bit image, you can use this property to check for inversion (for example, white lines on a black background) caused by an inverted palette.

Value | Meaning
GRAY_NO | Not grayscale.
GRAY_ORDEREDNORMAL | Normally ordered grayscale (dark to light).
GRAY_ORDEREDINVERSE | Reverse ordered grayscale (light to dark).
GRAY_NOTORDERED | Unordered grayscale.

See Also

Topics:

Raster Images: Doing Color Expansion or Reduction


IsSigned property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL IsSigned;
Overview | Refer to Examining and Altering Bitmaps

Remarks

Indicates whether the bitmap currently loaded in the object contains signed data. This property is valid only if the object contains a bitmap. Possible values are:

Value | Meaning
TRUE | The bitmap data is signed.
FALSE | The bitmap data is not signed.

If this property is TRUE, the signed bitmap data should be converted to unsigned using the ConvertSignedToUnsigned method. If the bitmap data is signed, image processing and the paint functionality may not work correctly. Currently, only TIF files contain signed data. A bitmap with signed data will not be loaded unless the LoadSigned property is set to TRUE before loading the image.

If this property is FALSE, no further processing is needed.

Support for 12 and 16-bit grayscale images are only available in the Document/Medical toolkits.

See Also

Elements: | LoadSigned property, ConvertSignedToUnsigned method
Topics: | Raster Images: Doing Color Expansion or Reduction
 | Raster Images: Getting and Setting File Information


LevelHighBit property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LevelHighBit
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/ Medical Imaging only) Sets the value of the highest bit considered as image data when painting a 12 or 16-bit grayscale image. Valid values are: 0 <= LevelHighBit <= BitmapBits property. For example, to specify that only the high (most significant) 8 bits of a 16-bit grayscale image are considered part of the image, set Level LowBit property to 8 and LevelHighBit property to 15 (not 16! 15 - 8 + 1 = 8 bits). To consider only the lowest 8 bits, set LevelLowBit to 0 and LevelHighBit to 7 (not 8!).

This property does not change the image data, only the way it is painted. Call WindowLevel method to change the image data to match the display image.

See Also

Elements: | WindowLevel method, LevelLowBit property
Topics: | Raster Images: Palettes


LevelLUTLength property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LevelLUTLength
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) (Read Only) Gets the length of the LevelLUT remapping palette. It is equal to 2 raised to the power of (LevelHighBit - LevelLowBit + 1).

See Also

Elements: | LevelLUT property, LevelHighBit property, LevelLowBit property
Topics: | Raster Images: Palettes


LevelLowBit property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LevelLowBit
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Imaging only) Sets the value of the lowest bit considered as image data when painting a 12 or 16-bit grayscale image. Valid values are: 0 <= LevelLowBit <= LevelHighBit property. For example, to specify that only the high (most significant) 8 bits of a 16-bit grayscale image are considered part of the image, set Level LowBit property to 8 and LevelHighBit property to 15 (not 16! 15 - 8 + 1 = 8 bits). To consider only the lowest 8 bits, set LevelLowBit to 0 and LevelHighBit to 7 (not 8!).

This property does not change the image data, only the way it is painted. Call WindowLevel method to change the image data to match the display image.

See Also

Elements: | WindowLevel method, LevelHighBit property
Topics: | Raster Images: Palettes


LevelLUT property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | COLORREF LevelLUT (short iIndex);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) Gets or sets a color stored in the Window Level Look UP Table (LUT). The LUT specifies a remapping palette that can be used to change the color of every pixel painted on the screen. For each pixel, LevelLowBit property and LevelHighBit property are used to generate a value between 0 and LevelLUTLength - 1. This value is used as an index into the LevelLUT palette to obtain the corresponding color. By default the interval 0 to LevelLUTLength - 1 is remapped to 0 to 255 and the corresponding gray value is used.

See Also

Elements: | LevelLowBit property, LevelHighBit property, LevelLUTLength property, LevelLUT property, WindowLevel method
Topics: | Raster Images: Palettes
 | Using Color Values in LEADTOOLS


MaskBitmap property (ILEADRaster)

Visual Basic example

Visual C++ example

Syntax | long MaskBitmap
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Gets or sets the mask bitmap.

This property is updated by the CreateMaskFromRgn method.

The mask bitmap will be updated with a 1-bit, black-and-white image after calling the CreateMaskFromRgn method, where pixels from the region are white, and all others are black.

The user can also directly assign a bitmap to this property, but the bitmap must be a 1-bit mask image.

The image in this property is used by the SetRgnFromMask method to create or modify a region in the Bitmap property.

See Also

Elements: | CreateMaskFromRgn method, SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, PolygonSize property, OffsetRgn method, SetRgnColor method.
Topics: | Raster Images: Creating and Using a Region


MaxBit property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MaxBit
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Imaging only) (Read Only) Gets the maximum bit value of the pixels in the image. For example, in a 12-bit grayscale image MaxBit would be <= 11 and MinBit would be >= 0. This value is not affected by LevelLowBit property or LevelHighBit property.

This value is only valid after calling GetMinMaxBits method.

The MinBit, MaxBit, MinVal and MaxVal values are useful for setting up the LevelLUT property for remapping to a user palette.

See Also

Elements: | GetMinMaxBits method, MinBit property, LevelLowBit property, LevelHighBit property, WindowLevel method, MinVal, MaxVal
Topics: | Raster Images: Palettes


MaxConventionalSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MaxConventionalSize
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets the maximum size for a conventional bitmap (default is 0x7FFFFFFF). Any bitmaps with a size bigger than this will be allocated as tiled.

If this property is >0, then it represents the maximum size in bytes.

If the property is <0, then it represents the maximum size in percentage of the total memory (physical and swap).

Values less than –100 are not allowed.

This parameter is ignored if the MemoryFlags property does not contain MEMORY_MAX_CONV_SIZE.

See Also

Elements: | MemoryTiledThreshold property, TiledBitmapsSize property, MemoryConventionalTile property, MemoryFlags property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


MaxVal property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long MaxVal
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) (Read Only) Gets the maximum intensity value of the pixels in the image. This value is not affected by LevelLowBit property or LevelHighBit property.

This value is only valid after calling GetMinMaxVal method.

The MinBit, MaxBit, MinVal and MaxVal values are useful for setting up the LevelLUT property for remapping to a user palette.

See Also

Elements: | GetMinMaxVal method, MinVal property, LevelLowBit property, LevelHighBit property, WindowLevel method, MinBit, MaxBit
Topics: | Raster Images: Palettes


MemoryConventionalBuffers property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryConventionalBuffers
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

This property represents the number of buffers in conventional memory that will cache the disk tiles. It is used when working with tiled images, which have disk tiles. The swap buffers will greatly improve the access to these disk tiles. The default is 1 (one swap buffer will be used to cache the disk tiles).

This property specifies how many buffers should be used:

>0, MemoryConventionalBuffers indicates the number of swap buffers

<0, - MemoryConventionalBuffers indicates the percentage of the total of disk tiles. For example, -50 means the number of buffers is half of the disk tiles will be used.

0, no swap buffers will be used. This uses the least amount of memory.

It is useful to have more than one swap buffer when you have an algorithm that constantly reads data going up and down. Usually, the data is read in one direction (from top to bottom or bottom to top) – in this case, one swap buffer will be enough. Also, if you only view a certain portion of the image, you might benefit from having enough swap buffers to cache the visible portion of the image (or the bitmap’s region).

The buffers are dynamic: when data is being read/written to a disk tile, a cache buffer is created (if permitted and there is enough memory). If the maximum number of cache buffers for that bitmap has been reached, the cache buffer for the last used tile will be deleted and used for the new tile.

See Also

Elements: | MemoryTiledThreshold property, TiledBitmapsSize property, MaxConventionalSize property, MemoryFlags property, MemoryConventionalTile property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


MemoryConventionalTile property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryConventionalTile
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that is used when working with a tiled image. It represents the maximum number of tiles that will reside in conventional memory at any time. The tiles that do not reside in conventional memory will be on disk. (Default is –100 = all tiles are in memory)

If the value is >0, then this property represents the number of tiles.

If 0, then all the tiles in a tiled bitmap will be disk tiles.

If the value is < 0, then this property represents the percentage of tiles that will reside in memory.

Values less than -100 are not allowed.

This property is ignored if the MemoryFlags property does not contain MEMORY_CONV_TILES.

See Also

Elements: | MemoryTiledThreshold property, TiledBitmapsSize property, MaxConventionalSize property, MemoryFlags property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


MemoryFlags property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryFlags
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets flags that indicate which of the memory threshold properties are valid. The flags can be or-ed together to change only some of the flags, or you can pass MEMORY_ALL to change all flags. Possible values are:

Value | Meaning
MEMORY_TILED_THRESHOLD | [0x0001] The MemoryTiledThreshold property is valid.
MEMORY_MAX_CONV_SIZE | [0x0002] The MaxConventionalSize property is valid.
MEMORY_TILE_SIZE | [0x0004] The TiledBitmapsSize property is valid.
MEMORY_CONV_TILES | [0x0008] The MemoryConventionalTile property is valid.
MEMORY_CONV_BUFFERS | [0x0010] The MemoryConventionalBuffers property is valid.
MEMORY_ALL | [0x001F] All parameters are valid. You do not need to ‘or’ this with the other flags.

See Also

Elements: | MemoryTiledThreshold property, TiledBitmapsSize property, MaxConventionalSize property, MemoryConventionalTile property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


MemoryInfoConventionalTiles property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoConventionalTiles
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the number of tiles stored in conventional memory. This property is used to set the number of tiles in conventional memory only if SET_MEMORYINFO_CONVTILES is set in the MemoryInfoFlags property before calling the SetMemoryInfo method.

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryInfoFlags property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoFlags
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets flags that indicate which property should be considered valid when setting the memory info data using SetMemoryInfo method. Possible values are one or an OR-ed combination of the following:

Value | Meaning
SET_MEMORYINFO_MEMORY | [0x0001] The MemoryInfoType property is valid.
SET_MEMORYINFO_TILESIZE | [0x0002] The MemoryInfoTileSize property is valid.
SET_MEMORYINFO_TOTALTILES | [0x0004] The MemoryInfoTotalTiles property is valid.
SET_MEMORYINFO_CONVTILES | [0x0008] The MemoryInfoConventionalTiles property is valid.
SET_MEMORYINFO_MAXTILEVIEWS | [0x0010] The MemoryInfoMaxTileViews property is valid.
SET_MEMORYINFO_TILEVIEWS | [0x001F] The MemoryInfoTileViews property is valid.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryInfoMaxTileViews property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoMaxTileViews
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the maximum number of swap buffers for the disk tiles. This property is used to set the maximum number of buffers only if SET_MEMORYINFO_MAXTILEVIEWS is set in the MemoryInfoFlags property before calling the SetMemoryInfo method.

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryInfoTileSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoTileSize
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the size of the tile. This property is used for setting the tile size only if SET_MEMORYINFO_TILESIZE is set in the MemoryInfoFlags property before calling the SetMemoryInfo method.

Each tile will contain a full number of rows. You can obtain the number of rows in each tile by dividing the tile size by the BytesPerLine property. All tiles in the bitmap, except for the last tile, will have the same size. The last tile contains the leftover rows. The size of the last tile can be calculated using the following formula:

BitmapSize – (MemoryInfoTotalTiles – 1) * MemoryInfoTileSize

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryInfoTileViews property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoTileViews
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the number of swap buffers allocated for the disk tiles. This property is used to set the number of buffers only if SET_MEMORYINFO_TILEVIEWS is set in the MemoryInfoFlags property before calling the SetMemoryInfo method.

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryTiledThreshold property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryTiledThreshold
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets the Minimum amount of free memory required to allow the allocation of conventional bitmaps (default 0). If the amount of free memory falls below this threshold, all bitmaps will be allocated as tiled. The exception is when the bitmap size is smaller than the tile size – in this case, the bitmap will be allocated in conventional memory.

Values less than –100 are not allowed.

If this property is > 0, it represents the required number of free bytes.

If the property is 0, then there is no minimum requirement for free memory, all bitmaps are allocated as conventional if there is enough memory.

Tiled bitmaps use a combination of memory tiles and disk tiles. When a bitmap is allocated, LEADTOOLS decides how many conventional memory tiles and how many disk tiles should be allocated. This property influences the number of conventional tiles allocated as follows: the toolkit will not allocate any more conventional tiles when the amount of memory falls below the value of this property. When the amount of memory falls below the value of this property, disk tiles will be allocated and several swap buffers might back these disk tiles. For each bitmap there will be at least one swap tile.

If this property is < 0, then it represents a percentage of free memory out of the total memory. For example, when you pass –20, tiled bitmaps will be used when the amount of free physical and swap memory will drop below 20% of the total memory.

The value of this property is ignored if the MemoryFlags property does not contain MEMORY_TILED_THRESHOLD.

See Also

Elements: | MaxConventionalSize property, TiledBitmapsSize property, MemoryConventionalTile property, MemoryFlags property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


MemoryInfoTotalTiles property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoTotalTiles
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the total number of tiles. This property is used to set the total number of tiles only if SET_MEMORYINFO_TOTALTILES is set in the MemoryInfoFlags property before calling the SetMemoryInfo method.

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoType Property, MemoryInfoTileSize Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MemoryInfoType property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MemoryInfoType
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets a value that represents the memory type for the bitmap. This property is used for setting the memory type only if SET_MEMORYINFO_MEMORY is set in the MemoryInfoFlags property before calling the SetMemoryInfo method. Possible values for this property are:

Value | Meaning
MEMORY_TYPE_CONV | The bitmap is allocated in conventional memory. The other properties will be ignored.
MEMORY_TYPE_DISK | The bitmap is allocated entirely on disk. The other properties will be ignored.
MEMORY_TYPE_COMPRESSED | The bitmap is allocated in conventional memory and it is using run-length 1-bit compression. The other properties will be ignored.
MEMORY_TYPE_SUPERCOMPRESSED | The bitmap is allocated in conventional memory and is using SuperCompression (JPEG24-bit or 1-bit Fax G4). The other properties will be ignored.
MEMORY_TYPE_TILED | The bitmap is tiles and can contain a combination of conventional tiles and disk tiles. The other properties will be updated with information about the tiles.

This property is updated by the GetMemoryInfo method.

See Also

Elements: | MemoryInfoTileSize Property, MemoryInfoTotalTiles Property, MemoryInfoConventionalTiles Property, MemoryInfoMaxTileViews Property, MemoryInfoTileViews Property, MemoryInfoFlags Property, SetMemoryInfo Method, GetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


MinBit property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MinBit
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical Imaging only) (Read Only) Gets the minimum bit value of the pixels in the image. For example, in a 12-bit grayscale image MaxBit would be <= 11 and MinBit would be >= 0. This value is not affected by LevelLowBit property or LevelHighBit property.

This value is only valid after calling GetMinMaxBits method.

The MinBit, MaxBit, MinVal and MaxVal values are useful for setting up the LevelLUT property for remapping to a user palette.

See Also

Elements: | GetMinMaxBits method, MaxBit property, LevelLowBit property, LevelHighBit property, WindowLevel method, MinVal, MaxVal
Topics: | Raster Images: Palettes


MinVal property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long MinVal
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) (Read Only) Gets the minimum intensity value of the pixels in the image. This value is not affected by LevelLowBit property or LevelHighBit property.

This value is only valid after calling GetMinMaxVal method.

The MinBit, MaxBit, MinVal and MaxVal values are useful for setting up the LevelLUT property for remapping to a user palette.

See Also

Elements: | GetMinMaxVal method, MaxVal property, LevelLowBit property, LevelHighBit property, WindowLevel method, MinBit, MaxBit
Topics: | Raster Images: Palettes


Pixel property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR Pixel (float x, float y);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Sets or gets the value of the specified pixel in the current bitmap.

The position is relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property, although the value is always that of a pixel.

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette which holds the color value.You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values. Please note that just because an image has a palette, that does not mean the value returned by this property is a palette index.

In the Document/Medical toolkits, the COLORREF value may represent a 16 bit grayscale value if the bBitmap is a 12 or 16-bit grayscale. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask (0x04000000) is set. In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS elements will recognize a COLORREF having this format, but Windows elements will not. For information on converting from a 16-bit value, refer to Converting 16-bit Grayscale Values.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | PixelData property
Topics: | Raster Images: Getting Current Information
 | Using Color Values in LEADTOOLS


PixelData property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterVariant *PixelData(float x, float y)
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Gets or sets the value of the specified pixel in the current bitmap. This property is similar to the Pixel property.

The position specified by x and y is relative to the bitmap in the object. The unit of measure is determined by the ScaleMode property.

This property differs from the Pixel property in that the pixel data contained in this property is not converted to a color. The data contained in this property is exactly as it is in the bitmap, with no conversions made. This is designed to preserve all the data associated with a pixel. For example, for bitmaps those contain alpha channel information, that information is preserved in this property.

In addition, this property actually manipulates 48 and 64-bit data for 48 or 64-bit bitmaps. The Pixel property, on the other hand, performs conversions to 24-bit data, which may cause some data loss.

Use the ShortItemValue Property in the ILEADRasterVariant object to get and set the specified pixel in the current bitmap.

See Also

Elements: | Pixel property
Topics: | Raster Images: Getting Current Information


PolygonSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PolygonSize
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Specifies the size of the array used to store the vertices when creating a polygonal region.

To create a polygonal region, you must first build an ordered array of points for the vertices of the polygon; then create the region based on the array. The PolygonSize property specifies the size of the array. You can either specify a large array to start with, or you can increase the size of the array when necessary (without losing the existing points). For each vertex, you update the array by setting the following indexed properties:

PolygonX property

PolygonY property

You can then call the SetRgnPolygon method to add the region to the bitmap.

See Also

Elements: | SetRgnEllipse method, SetRgnRect method, SetRgnRoundRect method, SetRgnColor method, OffsetRgn method
Topics: | Raster Images: Creating and Using a Region


PolygonX property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float PolygonX (short iIndex);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Specifies the X coordinate of a vertex of a polygonal region.

The position is relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

To create a polygonal region, you must first build an ordered array of points for the vertices of the polygon; then create the region based on the array. The PolygonSize property specifies the size of the array. You can either specify a large array to start with, or you can increase the size of the array when necessary (without losing the existing points). For each vertex, you update the array by setting the following indexed properties:

PolygonX property

PolygonY property

You can then call the SetRgnPolygon method to add the region to the bitmap.

See Also

Topics:

Raster Images: Creating and Using a Region


PolygonY property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float PolygonY (short iIndex);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Specifies the Y coordinate of a vertex a polygonal region.

The position is relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

To create a polygonal region, you must first build an ordered array of points for the vertices of the polygon; then create the region based on the array. The PolygonSize property specifies the size of the array. You can either specify a large array to start with, or you can increase the size of the array when necessary (without losing the existing points). For each vertex, you update the array by setting the following indexed properties:

PolygonX property

PolygonY property

You can then call the SetRgnPolygon method to add the region to the bitmap.

See Also

Topics:

Raster Images: Creating and Using a Region


RefBitmap property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL RefBitmap
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Indicates whether an assignment to the Bitmap property should do a copy or simply reference the source control's Bitmap property.

When this property is TRUE, any assignments to the object's Bitmap property will cause the object to reference the source object's Bitmap, instead of making a copy. This can be used to reduce memory load when dealing with large images.

When this property is FALSE, an assignment to the object's Bitmap proprety will create a copy of the source object's Bitmap in memory.

Note: When this property is set to True, any assignment to the object's Bitmap property will invalidate the bitmap in the source control.

You should set this property back to False after making an assignment if you do not always wish to make references. For example:

LEAD1.RefBitmap = True
LEAD1.Bitmap = LEAD2.Bitmap
LEAD1.RefBitmap = False

See Also

Elements:

Main Bitmap property


RefBitmapList property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL RefBitmapList
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Indicates whether an assignment to the BitmapList property should do a copy or simply move the source object's BitmapList to the destination object's BitmapList. Possible values are:

Value | Meaning
TRUE | Move the source control's bitmap list to the bitmap list of the destination control.
FALSE | Copy the source control's bitmap list into the bitmap list of the destination control.

This property is taken into account when setting the BitmapList property of the object. If RefBitmapList is true, then the destination object will ‘steal’ the bitmaps from the source object. The source object will eventually detect that its bitmap list is empty, but you should notify the source object that its list has been freed by setting its bitmap list to NULL. If RefBitmapList is False, then the destination object makes a copy of the source object’s bitmap list. That means that two copies of the list exist in memory. Many times, we are trying to move the list from one object to the other with code like this:

LEAD1.BitmapList = LEAD2.BitmapList
LEAD2.BitmapList = 0

In this case, it is much faster to set RefBitmapList to TRUE before assigning the bitmap list. By doing that, you don’t have two copies of the bitmap list.

See Also

Elements: | BitmapList property
Topics: | Raster Images: Creating and Maintaining Lists of Images


RgnHeight property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RgnHeight
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The height of the bounding rectangle of the bitmap region.

The size is unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | HasRgn property, IsPtInRgn method, GetRgnArea method, RgnLeft property, RgnTop property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


RgnLeft property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RgnLeft
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The X coordinate of the origin of the bounding rectangle of the bitmap region.

The position is unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | HasRgn property, IsPtInRgn method, GetRgnArea method, RgnHeight property, RgnTop property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


RgnTop property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RgnTop
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The Y coordinate of the origin of the bounding rectangle of the bitmap region.

The position is unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | HasRgn property, IsPtInRgn method, GetRgnArea method, RgnHeight property, RgnLeft property, RgnWidth property
Topics: | Raster Images: Creating and Using a Region


RgnWidth property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RgnWidth
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The width of the bounding rectangle of the bitmap region.

The size is unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | HasRgn property, IsPtInRgn method, GetRgnArea method, RgnHeight property, RgnLeft property, RgnTop property
Topics: | Raster Images: Creating and Using a Region


TempDirectory property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR TempDirectory
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets the directory in which LEADTOOLS will create temporary files.

Files used to store bitmaps of type MEMORY_TYPE_DISK will be created here. Also, disk tiles for bitmaps of type MEMORY_TYPE_TILED bitmaps will be created here.

This property will have no effect on any existing bitmaps. The files associated with the existing bitmaps stay where they were. The new temporary directory will be used for creating new bitmaps.

See Also

Elements: | SetMemoryThresholds Method, GetMemoryThresholds Method, GetMemoryInfo Method, SetMemoryInfo Method
Topics: | Raster Images: Creating and Deleting


TiledBitmapsSize property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | long TiledBitmapsSize
Overview | Refer to Memory Storage Types for Bitmaps.

Remarks

Gets or sets the size of the tile for tiled bitmaps (default 0). Set this property to a value smaller than the MaxConventionalSize property .

All bitmaps with a size smaller than the TiledBitmapsSize property will be allocated as conventional. (A tiled bitmap of a size smaller than the TiledBitmapsSize property would consist of only small tile, which is the equivalent of the conventional bitmap).

If the TiledBitmapsSize property is 0, then LEADTOOLS will pick a default size for the tile. (Currently it is 16MB)

The tiles will be smaller than this value and will be a complete number of rows. No rows will be split between tiles.

Values less than 0 are not allowed.

This property is ignored if the MemoryFlags property does not contain MEMORY_TILE_SIZE.

See Also

Elements: | MemoryTiledThreshold property, MaxConventionalSize property, MemoryConventionalTile property, MemoryFlags property, SetMemoryThresholds method, GetMemoryThresholds method
Topics: | Raster Images: Creating and Deleting


UseLUT Property (ILEADRaster)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL UseLUT
Overview | Refer to Grayscale Images

Remarks

Gets or sets a value that indicates when the LUT is used. Possible values are:

Value | Meaning
TRUE | The LUT is used in all image processing methods, including save. (Default)
FALSE | The LUT is used only when painting. It is ignored when an image processing method is applied or when a file is saved.

This property is designed primarily for use with 12 or 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available in the Document/Medical toolkits.

See Also

Elements | WindowLevel method, LevelLUT property, WindowLevelFillLUT method
Topics | Raster Images: Palettes
 | Examining and Altering Bitmaps


Change event (ILEADRaster)

Change event (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Change (long nChange, long nReserved1, long nReserved2);
Overview | Refer to Detecting Events.

Remarks

Occurs when any change occurs in the object's bitmap.

In ILEADRasterView, this event is fired in response to the internal ILEADRaster object's Change event.

See Also

Elements: | FilePage event, Raster property
Topics: | Raster Images: Loading Files


EnableClearDecryptorKey property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableClearDecryptorKey;
Overview | Refer to Implementing Annotations.

Remarks

Indicates what happens to encrypt keys after calling AnnEncryptApply.

Setting | Description
VARIANT_TRUE | All encrypt objects whose state has become ‘decryptor’ have the key set to 0.
VARIANT_FALSE | All encrypt objects whose state has become ‘decryptor’ have the key unchanged.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableClearEncryptorKey property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableClearEncryptorKey;
Overview | Refer to Implementing Annotations.

Remarks

Indicates what happens to encrypt keys after calling AnnEncryptApply.

Setting | Description
VARIANT_TRUE | All encrypt objects whose state has become ‘encryptor’ have the key set to 0.
VARIANT_FALSE | All encrypt objects whose state has become ‘encryptor’ have the key unchanged.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableEncryptor property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableEncryptor;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the object is an encryptor or decryptor. Possible values are:

Setting | Description
VARIANT_TRUE | The object is an encryptor.
VARIANT_FALSE | The object is a decryptor.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableNeverEncrypted property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableNeverEncrypted;
Overview | Refer to Implementing Annotations.

Remarks

Flag that indicates whether you can change the key and location of the decryptor.

This property is only relevant for decryptors (EnableEncryptor is VARIANT_FALSE). Possible values are:

Setting | Description
VARIANT_TRUE | The decryptor has never been encrypted. This means that in automation, the key and location of the decryptor can be changed.
VARIANT_FALSE | The decryptor was originally an encryptor that was applied. You cannot change the key or location of this kind of decryptor.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableSaveDecryptorKey property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableSaveDecryptorKey;
Overview | Refer to Implementing Annotations.

Remarks

Indicates if decryptor keys are saved. Possible values are:

Setting | Description
VARIANT_TRUE | Decryptor keys are saved with the AnnSave, SaveOffset, AnnSaveMemory, or AnnSaveTag methods.
VARIANT_FALSE | Decryptor keys are saved with a value of 0 with the AnnSave, SaveOffset, AnnSaveMemory, or AnnSaveTag methods.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableSaveEncryptorKey property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableSaveEncryptorKey;
Overview | Refer to Implementing Annotations.

Remarks

Indicates if encryptor keys are saved. Possible values are:

Setting | Description
VARIANT_TRUE | Encryptor keys are saved with the AnnSave, SaveOffset, AnnSaveMemory, or AnnSaveTag methods.
VARIANT_FALSE | Encryptor keys are saved with a value of 0 with the AnnSave, SaveOffset, AnnSaveMemory, or AnnSaveTag methods.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EncryptRaster property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRaster EncryptRaster;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the ILEADRaster object that references the bitmap that is being encrypted or decrypted.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property
Topics: | Annotations (Document/Medical only): Object Manipulation


Flags property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags;
Overview | Refer to Implementing Annotations.

Remarks

Flags that indicate which properties contain valid data. Possible values are one or more of the following constants "or"ed together:

Value | Meaning
ANN_ENCRYPT_TYPE | [0x001] The EnableEncryptor Property contains valid data.
ANN_ENCRYPT_KEY | [0x002] The Key property contains valid data.
ANN_ENCRYPT_RESERVED1 | [0x004] Reserved for future use.
ANN_ENCRYPT_NEVER_ENCRYPTED | [0x008] The EnableNeverEncrypted property contains valid data.
ANN_ENCRYPT_ENCRYPT_BITMAP | [0x010] The EncryptRaster property contains valid data.
ANN_ENCRYPT_ALL | [0x01F] All properties contain valid data.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


Key property (ILEADRasterAnnEncryptOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Key;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a Key that is used for the encryption/decryption. This has a minimum value of 0 and a maximum value of 4294967295 (0xffffffff). When used in automation using the Encrypt dialog (right-clicking an encryptor), the maximum value is 999999999. When decrypting, use the same key that was used when the encryptor was applied.

See Also

Elements: | AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, EnableEncryptor property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientX property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | double ClientX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the X coordinate of the location of the handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientY property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | double ClientY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the Y coordinate of the location of the handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerX property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the X coordinate of the location of the handle in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerY property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the Y coordinate of the location of the handle in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableVisible property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableVisible;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a values that indicates whether the annotation handle is visible. Possible values are:

Setting | Description
VARIANT_TRUE | The handle is visible.
VARIANT_FALSE | The handle is not visible.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


FillColor property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR FillColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the color used to fill the user handle.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


Flags property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates which properties of the ILEADRasterAnnHandle object are valid. If the corresponding flag for a property is not set, the default values for that property will be used. Possible values may be one or more, combined using bitwise OR, of the following:

Value | Meaning
ANN_HANDLE_ID | [0x0001] The ID property contains valid data and should be used.
ANN_HANDLE_LOCATION | [0x0002] Either the ContainerX property and the ContainerY property contain valid data and should be used, or, the ClientX property and the ClientY property contain valid data and should be used.
ANN_HANDLE_CONTAINER_COORDINATES | [0x0004] The ContainerX property and the ContainerY property contain valid data and should be used. This flag must be set with ANN_HANDLE_LOCATION.
ANN_HANDLE_VISIBLE | [0x0008] The EnableVisible property contains valid data and should be used.
ANN_HANDLE_PEN_COLOR | [0x0010] The PenColor property contains valid data and should be used.
ANN_HANDLE_FILL_COLOR | [0x0020] The FillColor property contains valid data and should be used.
ANN_HANDLE_SHAPE | [0x0040] The Shape property contains valid data and should be used.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


hCursor property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long hCursor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the handle to a cursor.

This is the cursor that appears when the mouse hovers over the user handle.

Set this field to zero to use the default cursor.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


ID property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ID;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a unique ID associated with a user handle.

When adding more than one user handle to an annotation object, give each user handle a different ID. The ID is used to uniquely identify the annotation user handle in a hit test().

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


PenColor property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PenColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the color of the pen used to draw the user handle (the outline of the handle).

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), Shape property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


Shape property (ILEADRasterAnnHandle)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Shape;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates the shape of the user handle. Possible values are:

Value | Meaning
ANN_HANDLE_SHAPE_SQUARE | The user handle is square
ANN_HANDLE_SHAPE_CIRCLE | The user handle is circular.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, ID property (ILEADRasterAnnHandle), ContainerX property (ILEADRasterAnnHandle), ContainerY property (ILEADRasterAnnHandle), ClientX property (ILEADRasterAnnHandle), ClientY property (ILEADRasterAnnHandle), EnableVisible property (ILEADRasterAnnHandle), PenColor property (ILEADRasterAnnHandle), FillColor property (ILEADRasterAnnHandle), hCursor property (ILEADRasterAnnHandle), Flags property (ILEADRasterAnnHandle)
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientX property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | double ClientX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the X coordinate of the location of the handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientY property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | double ClientY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the Y coordinate of the location of the handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerX property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the X coordinate of the location of the handle in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerY property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the Y coordinate of the location of the handle in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableVisible property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableVisible;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates whether the handle is visible. Possible values are:

Setting | Description
VARIANT_TRUE | The handle is visible.
VARIANT_FALSE | The handle is not visible.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


FillColor property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR FillColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the color used to fill the user handle.

See Also

Elements: | AnnEnumerateHandle method, OnEnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


hCursor property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long hCursor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the handle to a cursor.

This is the cursor that appears when the mouse hovers over the user handle.

Set this field to zero to use the default cursor.

See Also

Elements: | AnnEnumerateHandle method, OnEnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


ID property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ID;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a unique identifier of the user handle. If the Type property is ANN_HANDLE_TYPE_ROTATE_HANDLE, then the ID property specifies whether this is a center rotate handle (ANN_ROTATE_HANDLE_CENTER_ID) or a gripper rotate handle (ANN_ROTATE_HANDLE_GRIPPER_ID).

When adding more than one user handle to an annotation object, give each user handle a different ID.

See Also

Elements: | AnnEnumerateHandle method, OnEnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


Index property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Index;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the index of a user handle in a privately maintained array of user handles. This property is only valid if the Type property of the handle is ANN_HANDLETYPE_DEFAULT_HANDLE.

See Also

Elements: | AnnEnumerateHandle method, OnEnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


PenColor property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PenColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the color of the pen used to draw the user handle (the outline of the handle).

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


Shape property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Shape;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates the shape of the user handle. Possible values are:

Value | Meaning
ANN_HANDLE_SHAPE_SQUARE | The user handle is square
ANN_HANDLE_SHAPE_CIRCLE | The user handle is circular.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


Totalhandles property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Totalhandles;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the total number of annotation handles, both default handles and user-defined handles.

See Also

Elements: | AnnEnumerateHandle method, EnumerateHandle event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


Type property (ILEADRasterAnnHandleInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Type;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that represents the type of handle. Possible values are:

Value | Meaning
ANN_HANDLE_TYPE_DEFAULT_HANDLE | A default annotation handle
ANN_HANDLE_TYPE_USER_HANDLE | A user-defined annotation handle
ANN_HANDLE_TYPE_ROTATE_HANDLE | A rotate annotation handle

See Also

Elements: | AnnEnumerateHandle method, OnEnumerateHandle event, ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


AddItem method (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AddItem(BSTR pszString, short iType, long nID, short iIndexBefore);
Overview | Refer to Annotation Menu

Remarks

Adds a menu item with the specified string, type and id, before the item specified in iIndexBefore.

When the user selects an item added using this method, the OnAnnUserMenu event will be fired. The nID value passed to the OnAnnUserMenu event is the same nID passed to this method.

This method is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the OnAnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemEnabled property, ItemChecked property, DeleteItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


DeleteItem method (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DeleteItem (short iIndex);
Overview | Refer to Annotation Menu

Remarks

Deletes the specified menu item

This method is associated with the AnnMenu object that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemEnabled property, ItemChecked property, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


GetSubMenu method (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetSubMenu (short iIndex,ILEADRasterAnnMenu ** ppAnnMenu);
Overview | Refer to Annotation Menu

Remarks

Gets the object that references the specified submenu.

This method will only work for menu items of type ANN_MENUITEMTYPE_SUBMENU.

This method is associated with the AnnMenu object that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemEnabled property, ItemChecked property, DeleteItem method, AddItem Method
Topics: | Annotations (Document/Medical only): Automation


SetAnnMenu method (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetAnnMenu(long hMenu);
Overview | Refer to Annotation Menu

Remarks

This method sets the Menu handle used by the ILEADRasterAnnMenu interface.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemEnabled property, ItemChecked property, DeleteItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


Count property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Count
Overview | Refer to Annotation Menu

Remarks

(Read only) Gets the number of menu items in the menu object.

This property is associated with the AnnMenu object that is passed to the AnnMenu event.

See Also

Elements: | ItemString property, ItemID property, ItemType property, ItemChecked property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


ItemChecked property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL ItemChecked (short iIndex)
Overview | Refer to Annotation Menu

Remarks

Gets or sets the checked state of the specified menu items. Possible values are:

Value | Meaning
VARIANT_TRUE | The menu item is checked.
VARIANT_FALSE | The menu item is not checked.

This property is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


ItemEnabled property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANY_BOOL ItemEnabled (short iIndex)
Overview | Refer to Annotation Menu

Remarks

Gets or sets the enabled state of the specified menu item. Possible values are:

Value | Meaning
VARIANY_TRUE | The menu item is enabled.
VARIANY_FALSE | The menu item is not enabled.

This property is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemID property, ItemChecked property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


ItemID property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ItemID (short iIndex)
Overview | Refer to Annotation Menu

Remarks

Gets or sets the command ID value for the specified menu item.

The ID value set must be in the range ANN_EVENT_MENUFIRST [0x0100] to ANN_EVENT_MENULAST [0x01FF].

This property is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemType property, ItemChecked property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


ItemString property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR ItemString (short iIndex)
Overview | Refer to Annotation Menu

Remarks

Gets or sets the text to be displayed for the specified menu item.

This property is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemID property, ItemType property, ItemChecked property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


ItemType property (ILEADRasterAnnMenu)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnnMenuItemTypeConstants ItemType (short iIndex)
Overview | Refer to Annotation Menu

Remarks

(Read only) Gets the specified menu item’s type. Possible values are:

Value | Meaning
ANN_MENUITEMTYPE_NORMAL | [0] Normal menu item.
ANN_MENUITEMTYPE_SEPARATOR | [1] Menu item is a separator.
ANN_MENUITEMTYPE_SUBMENU | [2] Menu item is a popup menu.

This property is associated with an ILEADRasterAnnMenu object. The ILEADRasterAnnMenu object can be created from the AnnMenu handle that is passed to the AnnMenu event.

See Also

Elements: | Count property, ItemString property, ItemID property, ItemChecked property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method
Topics: | Annotations (Document/Medical only): Automation


AnnotationName property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnotationName;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a character string that contains the name of the annotation object.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


BackNameColor property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR BackNameColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or set the background color of the annotation name text.

The text of the annotation name can be set or obtained in the AnnotationName property. To get or set the foreground color for the name text, use the FaceNameColor property.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


EnableFontBold property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFontBold;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the font is bold. Possible values are:

Setting | Description
VARIANT_TRUE | The font is bold
VARIANT_FALSE | The font is not bold

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableFontItalic property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFontItalic;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the font is italicized. Possible values are:

Setting | Description
VARIANT_TRUE | The font is italicized
VARIANT_FALSE | The font is not italicized

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, EnableFontBold property, FontName property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableFontStrikeOut property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFontStrikeOut;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the font is drawn with a strikeout. Possible values are:

Setting | Description
VARIANT_TRUE | The font is drawn with a strikeout
VARIANT_FALSE | The font is drawn without a strikeout

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, EnableFontBold property, FontName property, EnableFontItalic property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableFontUnderLine property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFontUnderLine;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the font is drawn with an underline. Possible values are:

Setting | Description
VARIANT_TRUE | The font is drawn with an underline.
VARIANT_FALSE | T he font is drawn without an underline.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, EnableFontBold property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableNameBackTransparent property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableNameBackTransparent
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the background text color is transparent. Possible values are:

Setting | Description
VARIANT_TRUE | Background text color is transparent.
VARIANT_FALSE | Use the color in the BackNameColor property for the background color of the text.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, FaceNameColor property, BackNameColor property, EnableNameRestrict property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableNameRestrict property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableNameRestrict
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the annotation object name is restricted to appear fully within the bitmap. Possible values are:

Setting | Description
VARIANT_TRUE | Restrict the annotation name to appear fully within the bitmap. (Annotation container).
VARIANT_FALSE | Allow the annotation name to be moved outside the container.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableShowName property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableShowName
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether to display the annotation object's name. Possible values are:

Setting | Description
VARIANT_TRUE | Show the annotation object name.
VARIANT_FALSE | Hide the annotation object name.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features


FaceNameColor property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR FaceNameColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or set the foreground color of the annotation name text.

The text of the annotation name can be set or obtained in the AnnotationName property. To get or set the background color for the name text, use the BackNameColor property.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


Flags property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates which ILEADRasterAnnNameOptions properties are valid. Possible values are one or more of the following constants "or"ed together:

Value | Meaning
ANN_NAME_SHOW_NAME | [0x0001] EnableShowName property is valid
ANN_NAME_NAME | [0x0002] AnnotationName property is valid
ANN_NAME_OFFSET | [0x0008] X and Y property are valid
ANN_NAME_RESTRICT | [0x0010] EnableNameRestrict property is valid
ANN_NAME_FORECOLOR | [0x0020] FaceNameColor property is valid
ANN_NAME_BACKCOLOR | [0x0040] BackNameColor property is valid
ANN_NAME_BACK_TRANSPARENT | [0x0080] EnableNameBackTransparent property is valid
ANN_NAME_FONT_BOLD | [0x0100] EnableFontBold property is valid
ANN_NAME_FONT_ITALIC | [0x0200] EnableFontItalic property is valid
ANN_NAME_FONT_STRIKEOUT | [0x0400] EnableFontStrikeOut property is valid
ANN_NAME_FONT_UNDERLINE | [0x0800] EnableFontUnderline property is valid
ANN_NAME_FONT_NAME | [0x1000] FontName property is valid
ANN_NAME_FONT_SIZE | [0x2000] FontSize property is valid
ANNNAME_FONT_INFO | (ANN_NAME_FONT_BOLD |
 | ANN_NAME_FONT_ITALIC |
 | ANN_NAME_FONT_STRIKEOUT |
 | ANN_NAME_FONT_UNDERLINE |
 | ANN_NAME_FONT_SIZE |
 | ANN_NAME_FONT_NAME)
ANNNAME_ALL | (ANN_NAME_SHOW_NAME | All Properties are valid
 | ANN_NAME_NAME |
 | ANN_NAME_NAME_LENGTH |
 | ANN_NAME_OFFSET |
 | ANN_NAME_RESTRICT |
 | ANN_NAME_FORECOLOR |
 | ANN_NAME_BACKCOLOR |
 | ANN_NAME_BACK_TRANSPARENT |
 | ANN_NAME_FONT_INFO)

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features


FontName property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR FontName;
Overview | Refer to Implementing Annotations.

Remarks

Gets or set a string that contains the name of the font used to display the annotation name text.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


FontSize property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | double FontSize;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the size, in logical units, of the font's character cell or character.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, EnableNameBackTransparent property, BackNameColor property, EnableFontBold property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderLine property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


X property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | double X;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the X coordinate of the name offset (in pixels viewed at 100%) relative to the upper left corner of the bounding box of the annotation object.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


Y property (ILEADRasterAnnNameOptions)

Visual Basic example

Visual C++ 5.0 example

Syntax | double Y;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the Y coordinate of the name offset (in pixels viewed at 100%) relative to the upper left corner of the bounding box of the annotation object.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, AnnSetNameOptions method, EnableShowName property, AnnotationName property, X property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontBold property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderline property, FontSize property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnAddUndoNode method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnAddUndoNode (void);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Manually adds a node to the undo stack.

The automation object automatically does this when changing, adding or deleting annotation objects. This method should be called before making changes programmatically to the annotation objects. Calling this method insures that the changes can be undone using the Undo menu item.

The number of operations that can be undone should be set in the AnnUndoDepth property before calling this method. If the AnnUndoDepth property is not set, a default of 5 is used.

This method adds an undo node to the automation object. When used with the AnnUndoEnable property, a lengthy operation, consisting of multiple steps, can be combined into one undo call to the AnnUndo method. To accomplish this, use the following steps:

1. | Set the number of operations that can be undone in the AnnUndoDepth property. (The default for this property is 5.)
2. | Call the AnnAddUndoNode method to add an undo node to the container.
3. | Disable the undo feature by setting the AnnUndoEnable property to FALSE.
4. | Perform the operations to be combined into one undo.
5. | Re-enable the undo feature by setting the AnnUndoEnable property to TRUE.

Now, all the operations can be undone with one call to the AnnUndo method instead of several calls to the AnnUndo method.

See Also

Elements: | AnnUndoEnable property, AnnUndoDepth property, AnnUndo method
Topics: | Annotations Automation
 | Undoing Automation Operations


AnnAddUserHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnAddUserHandle (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Adds a user-defined handle to an annotation object.

To add a new user handle to an annotation object, set the AnnHandle property with the desired handle information, and then call the AnnAddUserHandle method.

To change an existing user handle, call the AnnGetUserHandle method to get the current handle information. The AnnGetUserHandle method updates the AnnHandle property with the annotation handle information for the specified handle. Set the desired values in the AnnHandle property and then call the AnnChangeUserHandle method.

A user handle can be deleted using the AnnDeleteUserHandle method.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnChangeUserHandle method, AnnDeleteUserHandle method, ID property, ContainerX property, ContainerY property, ClientX property, ClientY property, EnableVisible property, PenColor property, FillColor property, Shape property, hCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations


AnnAdjustPoint method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnAdjustPoint (double AnchorX, double AnchorY, double MoveX, double MoveY, double Angle, long nType);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Modifies the point (MoveX, MoveY) based on the angle between line (Anchor, Move) and the horizontal.

This utility method is used when creating custom annotation objects. It can be used to calculate the horizontal, vertical, or 45 degree component of a rotated annotation object. It can also be used to easily restrict the mouse cursor on rotated annotation objects.

As an example, consider a rectangle that is rotated 35 degrees in the clockwise direction.

The user has clicked on the Anchor point, and moved the mouse to the Move point.

To find the horizontal component of the line that goes from (Anchor, Move), make the following call, and the (MoveX, MoveY) point is adjusted to contain only the horizontal component.

The adjusted (MoveX, MoveY) point can be seen in step 4.

Conceptually, the following occurs:

1. | Initial situation
2. | Points and rectangle are rotated 35 degrees counter clockwise
3. | Move point is adjusted to contain only the horizontal component
4. | Points and rectangle are rotated 35 degrees clockwise to the adjusted Move point.

See Also

Elements: | AnnHitTestExt method, AnnRotateAngle property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations


AnnBringToFront method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnBringToFront(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Reorders the specified annotation object so that it is displayed on top of other objects in the same container.

This method moves the object to the end of the enumeration order for objects in the same container. When the container is displayed, this object is displayed last.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSendToBack method
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects


AnnCalibrateRuler method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnCalibrateRuler(long hObject, double dCalibrateLength, long lCalibrateUnit, double dDpiRatioXtoY);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Calibrates an ANN_OBJECT_RULER annotation object.

Call this method to calibrate an ANN_OBJECT_RULER object. This function is used to assign a specific length to any existing ANN_OBJECT_RULER object.

Note that this method only works on ANN_OBJECT_RULER objects, but can be used to indirectly calibrate other objects.

The dDpiRatioXtoY is the ratio of the horizontal resolution of the image (dots per inch or ‘DPI’) to the vertical resolution of the image. For most images, the horizontal resolution and the vertical resolution are the same, so this value will be 1.0. However for some fax images, the horizontal resolution is twice the vertical resolution (this would correspond to a dDpiRatioXtoY of 2.0). The dDpiRatioXtoY must be between (1/100) and 100 inclusive.

While this function only works on ANN_OBJECT_RULER objects, it can be used indirectly to calibrate any or all ruler objects, including ANN_OBJECT_POLYRULER, ANN_OBJECT_CROSSPRODUCT, and ANN_OBJECT_POLYRULER. To do this, calibrate an ANN_OBJECT_RULER object, get the resulting resolutions, and assign this resolution to all objects in the container. The example illustrates how to do this.

If you pass a negative value to the dDpiRatioXtoY parameter, the ERROR_INV_PARAMETER error will be returned.

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_CALIBRATE_RULER flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiX method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetUnit method, AnnGetDistance method, AnnGetDistance2 method.
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Calibrating Annotation Ruler Objects
 | New Annotation Features of Version 14.5
 | Using Rulers In Annotation Objects


AnnChangeUserHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnChangeUserHandle (long hObject, long uIndex);
Overview | Refer to Implementing Annotations.

Remarks

Changes properties of an existing user-defined annotation handle.

To change an existing user handle, call the AnnGetUserHandle method to get the current handle information. The AnnGetUserHandle method updates the AnnHandle property with the annotation handle information for the specified handle. Set the desired values in the AnnHandle property and then call the AnnChangeUserHandle method.

To add a new user handle to an annotation object, set the AnnHandle property with the desired handle information, and then call the AnnAddUserHandle method.

A user handle can be deleted using the AnnDeleteUserHandle method.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, AnnDeleteUserHandle method, ID property, ContainerX property, ContainerY property, ClientX property, ClientY property, EnableVisible property, PenColor property, FillColor property, Shape property, hCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations


AnnClearTokenTable method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnClearTokenTable();
Overview | Refer to Implementing Annotations.

Remarks

Removes all tokens from the text token table.

Call this method to delete ALL the tokens from the text token table. This method is used with the text annotation objects that support tokens, namely the following:

ANN_OBJECT_AUTOMATION

ANN_OBJECT_BUTTON

ANN_OBJECT_NOTE

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_STAMP

See Also

Elements: | Description property, TokenString property, Token property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, EnumerateTextTokenTable event, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


AnnConvert method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnConvert (long hContainer, long nConvert);
Overview | Refer to Implementing Annotations.

Remarks

Use this method to convert back and forth between container coordinates and client coordinates

The number of elements in the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY arrays must be AT LEAST equal to the value in the PointsCount property.

When nConvert is ANN_CONVERT_TO_CONTAINER, the ClientPointX and ClientPointY arrays must contain valid entries. If this method Returns successfully, ContainerPointX and ContainerPointY will be updated with the converted points.

When nConvert is ANN_CONVERT_TO_CLIENT, the ContainerPointX and ContainerPointY arrays must contain valid entries. If this method Returns successfully, ClientPointX and ClientPointY will be updated with the converted points.

See Also

Elements: | ClientPointX property, ClientPointY property, ContainerPointX property, ContainerPointY property, PointsCount property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects
 | Annotations (Document/Medical only): Creating Custom Annotations


AnnCopy method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnCopy(short iFormat, VARIANT_BOOL bSelected, VARIANT_BOOL bEmpty);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Copies the specified annotation objects to the Windows clipboard in either the native format, XML, or WMF format.

Use the WMF format only for copying for use in another application.

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnCut method, AnnPaste method, AnnPasteReady property
Topics | Annotations (Document/Medical only): Using the Clipboard
 | Displaying and Manipulating Annotation Objects
 | New Annotation Features of Version 14.5


AnnCreate method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnCreate(short iType, VARIANT_BOOL bAutoInsert, VARIANT_BOOL bVisible);
Overview | Refer to Implementing Annotations.

Remarks

Creates an annotation object of the specified type.

If you set bAutoInsert to VARIANT_FALSE, the object is not inserted in any container. You must insert the object yourself, or destroy the object using AnnDestroy, to avoid memory leaks.

Read the AnnObject property after calling this method to get the handle to the new annotation object.

Note:

You should not call this method during processing of the OnAnnCreate, OnAnnDestroy or OnAnnEnumerate events.

See Also

Elements | AnnDefine, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method, AnnObject property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating and Deleting Annotations
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnCreateItem method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnCreateItem(long hContainer, short iType, VARIANT_BOOL bVisible);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Creates an annotation object in a container.

You must use the AnnSet... methods to initialize the object after it is created.

Note:

You should not call this method during processing of the OnAnnCreate, OnAnnDestroy or OnAnnEnumerate events.

See Also

Elements | AnnCreate method, AnnDefine method, AnnInsert method, AnnRemove method, AnnDestroy method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnCut method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnCut(long hObject, short iFormat, VARIANT_BOOL fSelected, VARIANT_BOOL fEmpty);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Cuts the specified annotation objects to the Windows clipboard in either the native format XML, or WMF format.

Use the WMF format only for copying for use in another application.

Use the hObject and fSelected parameters as follows:

To copy the specified object, set hObject to that object and set fSelected to FALSE.

To copy only selected objects in a container, set hObject to the container and set fSelected to TRUE.

To copy all objects in a container, set hObject to the container and set fSelected to FALSE.

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnCopy method, AnnPaste method, AnnPasteReady property
Topics | Annotations (Document/Medical only): Using the Clipboard
 | Annotations (Document/Medical only): Creating and Deleting Annotations
 | Displaying and Manipulating Annotation Objects
 | New Annotation Features of Version 14.5


AnnDataPath method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnDataPath(BSTR pszURL);
Overview | Refer to Implementing Annotations.

Remarks

Loads the Annotation data from the specified URL.

See Also

Elements: | BitmapDataPath method
Topics: | Annotations (Document/Medical only): Input and Output


AnnDefine method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnDefine(long hObject, float x, float y, AnnDefineConstants iState);
Overview | Refer to Implementing Annotations.

Remarks

Specifies the shape when creating or transforming an annotation object. This method specifies one point in the current window each time it is called.

See Also

Elements | AnnCreate method, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnDefine2 method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDefine2 (long hObject, double aptX, double aptY, long uState);
Overview | Refer to Implementing Annotations.

Remarks

Specifies the shape when creating or transforming an annotation object. This method specifies one point in the current window each time it is called. This method is similar to the AnnDefine method, except that AnnDefine2 takes a point in container coordinates, whereas the AnnDefine method takes a point in client coordinates.

See Also

Elements: | AnnDefine method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnDeletePage method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDeletePage(BSTR pszName, long lPage);
Overview | Refer to Annotation Files

Remarks

(Document/Medical only)Deletes a page from a multi-page annotation file. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, and so on.

This method is valid only for annotation files that contain at least two pages. If an annotation file contains only one page, calling this method will return an error.

See Also

Elements: | AnnDeletePageMemory method, AnnDeletePageArray method, AnnLoadArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method, AnnSaveArray method
Topics: | Annotations (Document/Medical only): Input and Output


AnnDeletePageArray method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDeletePageArray(ILEADRasterVariant * pvMem,long lPage);
Overview | Refer to Annotation Files

Remarks

(Document/Medical only)Deletes a page from a multi-page annotation file in memory. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, and so on. Deleting a page from an annotation file will cause the size of the annotation file to change. To obtain the new size, use the following:

Size = UpperBound of the VARIANT – LowerBound of the VARIANT + 1;

This method is valid only for annotation files that contain at least two pages. If an annotation file contains only one page, calling this method will return an error.

See Also

Elements: | AnnDeletePageMemory method, AnnDeletePage method, AnnLoadArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method, AnnSaveArray method
Topics: | Annotations (Document/Medical only): Input and Output


AnnDeletePageMemory method(ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDeletePageMemory(long hMem, long lPage);
Overview | Refer to Annotation Files

Remarks

(Document/Medical only)Deletes a page from a multi-page annotation file in memory. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, and so on. Deleting a page from an annotation file will cause the size of the annotation file to change. The argument plSize will contain the new size of the annotation file in memory. (For VC, pass the address of a long variable. For VB, just pass the long variable). This method is valid only for annotation files that contain at least two pages. If an annotation file contains only one page, calling this method will return an error.

Read the AnnPageMemorySize property after calling this method to get the size of the annotation file in memory.

See Also

Elements: | AnnDeletePage method, AnnDeletePageArray method, AnnLoadArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method, AnnSaveArray method, AnnPageMemorySize property
Topics: | Annotations (Document/Medical only): Input and Output


AnnDeleteTokenTable method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDeleteTokenTable(BSTR cToken);
Overview | Refer to Annotation Files

Remarks

Deletes a text token from the annotation text token table.

Call this method to delete the token #<cToken> from the text token table.

This method Returns SUCCESS (0) if cToken is successfully deleted, or if cToken was not already in the text token table. This method is used with the text annotation objects that support tokens, namely the following:

ANN_OBJECT_AUTOMATION

ANN_OBJECT_BUTTON

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

ANN_OBJECT_STAMP

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

See Also

Elements: | Description property, TokenString property, Token property, TokenType property, AnnInsertTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, EnumerateTextTokenTable event, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


AnnDeleteUserHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnDeleteUserHandle (long hObject, long uIndex);
Overview | Refer to Implementing Annotations.

Remarks

Deletes an existing user-defined annotation handle.

Set uIndex to -1 to delete all the user-defined handles for annotation object hObject.

To change an existing user handle, call the AnnGetUserHandle method to get the current handle information. The AnnGetUserHandle method updates the AnnHandle property with the annotation handle information for the specified handle. Set the desired values in the AnnHandle property and then call the AnnChangeUserHandle method.

To add a new user handle to an annotation object, set the AnnHandle property with the desired handle information, and then call the AnnAddUserHandle method.

See Also

Elements: | AnnHandle property, AnnGetUserHandle method, AnnAddUserHandle method, AnnChangeUserHandle method, ID property, ContainerX property, ContainerY property, ClientX property, ClientY property, EnableVisible property, PenColor property, FillColor property, Shape property, hCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations


AnnDestroy method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnDestroy(long hObject, short iFlags);
Overview | Refer to Implementing Annotations.

Remarks

Deletes an annotation object and frees the memory that was used to store the object.

Note:

You should not call this method during processing of the OnAnnCreate, OnAnnDestroy or OnAnnEnumerate events.

See Also

Elements | AnnCreate method, AnnDefine, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating and Deleting Annotations


AnnEncryptApply method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnEncryptApply (long hObject, long uEncryptFlags);
Overview | Refer to Implementing Annotations.

Remarks

Applies an encryptor annotation object to the underlying bitmap.

An encrypt object can have two states: it can be an encryptor or it can be a decryptor.

Use this method to apply encryptor(s), decryptor(s), or both. Applying an encryptor means that the part of the bitmap that is under the encryptor is scrambled according to the encryptor properties.

Once applied, the portion of the bitmap under the encrypt object becomes scrambled or unscrambled, and the encrypt object changes state (encryptors become decryptors, and decryptors become encryptors). Using different keys before calling this method gives different scrambling patterns. The decryptor state differs from the encryptor state in that a decryptor cannot be moved, and cannot be changed to an encryptor. The scrambling can be removed by calling AnnEncryptApply on the decryptor with the appropriate arguments. If successful, the decryptor again changes state to become an encryptor. An encryptor can be moved, and can be changed to a decryptor.

The encrypt object is useful for encrypting portions of a bitmap. After encrypting, the scrambled bitmap cannot easily be unscrambled without the associated annotation file. The scrambling can be removed by using the associated annotation file, or by using automation mode to manually change the encrypt state from encryptor to a decryptor, position the object correctly, and setting the key appropriately.

You must set the Flags property before calling this method, to indicate the objects to which to apply the encryption objects. Possible values for the Flags property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

See Also

Elements: | AnnSetEncryptOptions method, AnnEncryptOptions property, AnnGetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnEnumerate method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnEnumerate(long hObject, short iFlags, BSTR pszUserList);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Enumerates all objects contained in hObject.

Note:

You should not call this method during processing of the OnAnnCreate, OnAnnDestroy or OnAnnEnumerate events.

See Also

Elements | OnAnnEnumerate event
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information
 | Displaying and Manipulating Annotation Objects


AnnEnumerateHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnEnumerateHandle (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Enumerates all handles contained in hObject.

Use this Method to get information about all annotation handles for an annotation object.

For each handle enumerated by this method, the OnEnumerateHandle Event is fired, if the EnableFireEnumerateHandleEvent property has been set to VARIANT_TRUE. The EnumerateHandles event receives a pointer to an ILEADRasterAnnHandleInfo structure that contains information about the handle. The following elements may contain information about the handle:

Type property (ILEADRasterAnnHandleInfo)

ID property (ILEADRasterAnnHandleInfo)

Index property (ILEADRasterAnnHandleInfo)

ContainerX property (ILEADRasterAnnHandleInfo)

ContainerY property (ILEADRasterAnnHandleInfo)

ClientX property (ILEADRasterAnnHandleInfo)

ClientY property (ILEADRasterAnnHandleInfo)

EnableVisible property (ILEADRasterAnnHandleInfo)

PenColor property (ILEADRasterAnnHandleInfo)

FillColor property (ILEADRasterAnnHandleInfo)

Shape property (ILEADRasterAnnHandleInfo)

hCursor property (ILEADRasterAnnHandleInfo)

Totalhandles property (ILEADRasterAnnHandleInfo)

To discontinue generating OnEnumerateHandle event, set the StopFireEnumerateHandleEvent property to VARIANT_TRUE.

See Also

Elements: | EnableFireEnumerateHandleEvent property, StopFireEnumerateHandleEvent property, OnEnumerateHandle Event, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnEnumerateTextToken method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnEnumerateTextToken();
Overview | Refer to Implementing Annotations.

Remarks

Enumerates the text tokens in the annotation text token table.

For each text token in the table, this method generates an OnEnumerateTextTokenTable event, if the OnEnableFireEnumerateTextTokenTableEvent property has been set to VARIANT_TRUE. The EnumerateTextTokenTable event receives information about each enumerated text token.

To discontinue generating OnEnumerateTextTokenTable event, set the StopFireEnumerateTextTokenTableEvent property to VARIANT_TRUE.

See Also

Elements: | Description property, TokenString property, Token property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, EnumerateTextTokenTable event, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnFileInfo method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnFileInfo(BSTR pszName);
Overview | Refer to Annotation Files

Remarks

Gets information about the specified annotation file.

The AnnFileInfo method updates the following properties:

AnnInfoVersion property

AnnInfoFormat property

AnnInfoTotalPages property

See Also

Elements | AnnFileInfoMemory method, AnnFileInfoArray method, AnnInfoFormat property, AnnInfoTotalPages property, AnnInfoVersion property
Topics | Annotations: Input and Output (Document/Medical only)
 | New Annotation Features of Version 14.5


AnnFileInfoArray method(ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnFileInfoArray(VARIANT vMem);
Overview | Refer to Annotation Files

Remarks

Gets information about an annotation file in memory.

The AnnFileInfoArray method updates the following properties:

AnnInfoVersion property

AnnInfoFormat property

AnnInfoTotalPages property

See Also

Elements | AnnFileInfo method, AnnFileInfoMemory method, AnnInfoFormat property, AnnInfoTotalPages property, AnnInfoVersion property
Topics | Annotations: Input and Output (Document/Medical only)
 | New Annotation Features of Version 14.5


AnnFileInfoMemory method(ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnFileInfoMemory (long hMem, long lSize);
Overview | Refer to Annotation Files

Remarks

Gets information about an annotation file in memory.

The AnnFileInfoMemory method updates the following properties:

AnnInfoVersion property

AnnInfoFormat property

AnnInfoTotalPages property

See Also

Elements | AnnFileInfo method, AnnFileInfoArray method, AnnInfoFormat property, AnnInfoTotalPages property, AnnInfoVersion property
Topics | Annotations: Input and Output (Document/Medical only)
 | New Annotation Features of Version 14.5


AnnFlip method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnFlip(VARIANT_BOOL bUseHorz, float fHorz, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Flips one or more annotation objects, top to bottom.

If you pass VARIANT_TRUE in the bSelected parameter, this method affects only the currently selected objects. Otherwise, it affects all objects.

If you pass VARIANT_TRUE in the bUseHorz parameter, this method flips all affected objects on the axis specified in the fHorz parameter. Otherwise, it flips each affected object on its own center.

You cannot flip or reverse an object that contains text. If you flip or reverse a group of objects on a common axis, the text will move to the new position, but will retain its orientation.

See Also

Topics | Annotations (Document/Medical only): Object Manipulation
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects


AnnGetAngle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetAngle (long hObject);
Overview | Refer to Protractor Annotation Object.

Remarks

(Document/Medical only) Gets the angle of the Protractor object in the object's unit of measurement, set by the AnnSetProtractorOptions method.

This method is only valid for Protractor annotation objects.

See Also

Elements | AnnSetProtractorOptions method, AnnGetProtractorOptions method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetArea method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetArea(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the pixel count of the specified annotation object.

The pixel count is the number of pixels contained in a region extracted from the annotation object, without resizing. It is equivalent to calling AnnGetRgnHandle and then getting a pixel count of the resulting region.

See Also

Elements: | AnnGetRgnHandle method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnGetAutoBackColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnGetAutoBackColor(long hObject, short iType);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the background color of one or more annotation objects.

Please note the following:

if iType is: | then the background color retrieved is:
ANN_OBJECT_NOTE or ANN_OBJECT_PUSHPIN | the background color used for Note objects and push pin objects created by the automation object
ANN_OBJECT_HILITE | the background color used for Hilite objects created by the automation object.
ANN_OBJECT_REDACT | the background color used for Redact objects created by the automation object.
any other object such as ANN_OBJECT_TEXT, ANN_OBJECT_RECT, etc. | the background color used for all other objects, created by the automation object, which have a background color property.

See Also

Elements | AnnAutoSnapCursor property, AnnSetAutoBackColor method, AnnGetBackColor method, AnnSetBackColor method
Topics | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS


AnnGetAutoMenuItemEnable method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetAutoMenuItemEnable(long hObject, short iType, short iItem);
Overview | Refer to Implementing Annotations.

Remarks

Set the AnnAutoMenuItemEnable property to indicate whether the specified menu item is enabled or disabled.

If for the specified object, the menu item’s enable state is ANN_MENU_DEFAULT, the method determines whether the enable state has been set for objects of the specified type. If the enable state for objects of the specified type is also ANN_MENU_DEFAULT, the method determines whether the enable state has been set for ANN_OBJECT_ALL. If this is also ANN_MENU_DEFAULT, the method determines whether the menu item text is NULL or not NULL. If it is NULL, the method Returns ANN_MENU_DISABLE. If the menu item is not NULL, the method returns ANN_MENU_ENABLE.

Read the AnnAutoMenuItemEnable property after calling this method to get the value that indicates whether the specified menu item is enabled or disabled.

See Also

Elements | AnnAutoSnapCursor property, AnnSetAutoMenuItemEnable, AnnAutoMenuEnable property, AnnAutoMenuItemEnable property, AnnAutoHilightPen property
Topics | Annotations (Document/Medicalonly): Automation


AnnGetAutoText method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetAutoText(short iItem);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Set the AnnAutoText property to the current text string that will be used for the specified menu item or other element that LEADTOOLS provides for automated annotations.

To modify the text strings you can use the AnnSetAutoText method.

Read the AnnAutoText property after calling this method to get with the current text string.

See Also

Elements | AnnAutoSnapCursor property, AnnTextEdit method, AnnSetAutoText method, AnnAutoText property, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information


AnnGetBackColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnGetBackColor(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the background color of the annotation object.

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetForeColor method, AnnGetForeColor method, AnnSetBackColor method, AnnGetAutoBackColor method, AnnSetAutoBackColor method, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS
 | Obtaining Annotation Object Information


AnnGetBitmap method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetBitmap(long hObject, ILEADRaster *pRaster);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the bitmap at the specified annotation object. The specified bitmap is a LEAD bitmap.

The AnnGetBitmap method is valid only for the following object types:

ANN_OBJECT_POINT

ANN_OBJECT_PUSHPIN

ANN_OBJECT_STAMP

The ANN_OBJECT_STAMP objects (which include the Rubber Stamp tools which are available in Automation) can display text, a bitmap or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two.

Initially, the ANN_OBJECT_STAMP object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).

Use the PointRaster property to get or set a pointer to an ILEADRaster obect that references the bitmap to use for the point, and the EnablePointUseBitmap to specify whether to draw the point using the bitmap or as a circle.

Call the AnnSetBitmap method to set the bitmap for one or more annotation objects.

For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnSetBitmap method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnGetBitmapDpiX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetBitmapDpiX(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the horizontal Bitmap DPI (dots per inch) that is used to translate the horizontal distance for the Ruler object.

The Bitmap DPI properties apply only to Automation and Ruler objects. Refer to AnnAutomation property.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnSetBitmapDpiX method, AnnSetBitmapDpiY method, AnnGetBitmapDpiY method, AnnSetUnit method, AnnGetUnit method, AnnGetDistance method, AnnSetGaugeLength method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Bitmap
 | Using Rulers in Annotation Objects
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetBitmapDpiY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetBitmapDpiY(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the vertical Bitmap DPI (dots per inch) that is used to translate the vertical distance for the Ruler object.

The Bitmap DPI properties apply only to Automation and Ruler objects. Refer to AnnAutomation property.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnSetBitmapDpiX method, AnnSetBitmapDpiY method, AnnGetBitmapDpiX method, AnnSetUnit method, AnnGetUnit method, AnnGetDistance method, AnnSetGaugeLength method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Bitmap
 | Using Rulers in Annotation Objects
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetContainer method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetContainer(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the handle of the container of the specified annotation object.

See Also

Elements | AnnInsert method, AnnRemove method, AnnGetTopContainer method, AnnEnumerate method, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Automation
 | Using Rulers in Annotation Objects
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetDistance method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetDistance(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the distance of the ruler in the specified annotation object. The unit of measure is set by calling the AnnSetUnit method.

This method can be called for ANN_OBJECT_RULER, ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR and ANN_OBJECT_POLYRULER types of annotation objects. However, please note the following:

  • If the annotation object is type ANN_OBJECT_RULER, then this method returns the length of the ruler.
  • If the annotation object is type ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR or ANN_OBJECT_POLYRULER, then this method returns the length of the primary ruler and updates the AnnDistance property with the length of the second ruler. (This method does not provide a means for getting the lengths of all rulers of a polyruler object. To get that information, AnnGetDistance2 must be called.)
  • If the annotation object is type ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR or ANN_OBJECT_POLYRULER, the AnnGetDistance2 method provides more information on the length of each ruler, the number of rulers, the unit of measure of each ruler and the total length of all rulers.

To determine the type of an annotation object, call the AnnGetType method.

See Also

Elements: | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetUnit method, AnnSetGaugeLength method, AnnGetGaugeLength method, AnnDistance property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetDistance2 method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetDistance2 (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the length of each ruler that makes up an object, and the total length of all rulers.

This method works only for the following objects:

ANN_OBJECT_RULER

ANN_OBJECT_PROTRACTOR

ANN_OBJECT_CROSSPRODUCT

ANN_OBJECT_POLYRULER

The ANN_OBJECT_POLYRULER object is composed of a variable number of rulers. The other ruler objects are composed of a predetermined number of rulers, as follows:

ANN_OBJECT_RULER always has one distance.

ANN_OBJECT_PROTRACTOR and ANN_OBJECT_CROSSPRODUCT always have two distances.

ANN_OBJECT_POLYRULER can have from one to any number of distances.

This method will update the properties listed below with information about the ruler(s) contained in the specified object:

TotalDistance property

TotalRulerUnit property

TotalSmartUnit property

Distance property

RulerUnit property

SmartUnit property

DistanceCount property

See Also

Elements: | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, TotalDistance property, TotalRulerUnit property, TotalSmartUnit property, Distance property, RulerUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetEncryptOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetEncryptOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets the annotation encryption options for the specified Encrypt annotation object.

This method updates the AnnEncryptOptions property with the annotation encryption options for the object specified in hObject.

To set annotation encryption options set the AnnEncryptOptions property with the desired encryption options, and then call the AnnSetEncryptOptions method.

See Also

Elements: | AnnEncryptApply method, AnnEncryptOptions property, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFillMode method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetFillMode(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the fill mode of the specified annotation object.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnGetROP2 method, AnnSetROP2 method, AnnSetBackColor, AnnSetForeColor, AnnGetSelected, AnnSetSelected, AnnGetTransparent, AnnSetTransparent, AnnGetTransparentColor, AnnSetTransparentColor
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFillModeExt method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetFillModeExt(long hObject);
Overview | Refer to New Annotation Features of Version 14.5

Remarks

(Document/Medical only) Gets the fill mode and alpha of the specified annotation object.

Like the AnnGetFillMode method, you can use this method to get the fill mode settings for annotation objects. This method extends the AnnGetFillMode method to support the new fill mode ANN_FILLMODE_ALPHA.

Before calling AnnGetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

VB Example:
Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_ALPHA)
End Sub

VC++ Example:
void CAnnCOMView::ExampleEnableOption()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_ALPHA);
}

The following figure displays rectangle annotation objects using different alpha values:

This method will update the AnnFillMode property with the annotation object's fill mode constant. If the returned fill mode is ANN_FILLMODE_ALPHA, then there is also a corresponding alpha value (0..255). Use the AnnAlpha property to get the alpha value. Note that if the AnnFillMode property is anything other than ANN_FILLMODE_ALPHA, then there is no corresponding alpha value.

The AnnAlpha property allows you to declare the amount of transparency of the annotation background. The alpha value can be between 0 (completely transparent) and 255 (completely opaque) inclusive.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

Note that the AnnSetROP2 method and the AnnSetFillModeExt method affect each other. If you set nFillMode to ANN_FILLMODE_OPAQUE, then nROP2 cannot be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSLUCENT, then nROP2 has to be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSPARENT, nROP2 can be anything.

See Also

Elements: | AnnSetFillMode method, AnnGetFillMode method, AnnSetFillModeExt method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnGetROP2 method, AnnSetROP2 method, AnnSetBackColor method, AnnSetForeColor method, AnnFillMode property
Topics: | Implementing Annotations
 | Annotations (Document/Medical only): Object Manipulation


AnnGetFillPattern method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetFillPattern(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the fill pattern of the specified annotation object.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFillPattern method, AnnSetFillMode method, AnnGetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontBold method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetFontBold(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates whether the font of the specified annotation object is bold.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontItalic method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetFontItalic(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates whether the font of the specified annotation object is italic.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontName method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnGetFontName(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the font name (character string) for the text in the specified annotation object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontSize method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetFontSize(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the current unscaled value of the font size of the specified annotation object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontStrikeThrough method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetFontStrikeThrough(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates whether the font of the specified annotation object has a strike-through (a line through the middle of the text).

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetFontUnderline method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetFontUnderline(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates whether the font of the specified annotation object has an underline.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetForeColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnGetForeColor(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the current value of the specified annotation object's foreground color.

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetForeColor method, AnnSetBackColor method, AnnGetBackColor method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS
 | Obtaining Annotation Object Information


AnnGetGaugeLength method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetGaugeLength(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the length of the gauge (the perpendicular lines at the ends of the Ruler object).

The gauge length applies only to Automation and Ruler objects. Refer to Annotation Automation object and Ruler Annotation Object.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetUnit method, AnnGetDistance method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetGrouping method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnGetGrouping (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the status of the grouping feature of the objects within the specified container.

This method is valid only for container objects.

Each container contains a "grouping" feature, which indicates whether the objects in the container should be treated as a group.

Typically, container handles are obtained by enumerating all the objects with the AnnEnumerate method and checking the object type with the AnnGetType method.

See Also

Elements: | AnnSetGrouping method, AnnGroup method, AnnUngroup method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Grouping and Ungrouping Annotation Objects


AnnGetHyperlinkParam method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetHyperLinkParam (long hObject, short iParamIndex);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only Sets the AnnHyperlinkParam property with the Hyperlink param value. This method is only valid if the AnnGetHyperlinkType Returns ANNLINK_USERMSG.

Read the AnnHyperlinkParam property after calling this method to get the Hyperlink param value.

See Also

Elements: | AnnSetHyperlinkString method, AnnGetHyperlinkType method, AnnHyperlinkParam property
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


AnnGetHyperlinkString method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetHyperlinkString (long hObject);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) Sets the AnnHyperlinkString property with the string containing the program name or the web page address, for an annotation object with a hyperlink of type ANN_LINK_RUN or ANN_LINK_WEBPAGE.

Call AnnHyperlinkString property after this Method To get the string

See Also

Elements: | AnnSetHyperlinkString method, AnnGetHyperlinkType method, AnnHyperlinkString property
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


AnnGetHyperlinkType method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetHyperlinkType (long hObject);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) Fills the AnnHyperlinkType property with the hyperlink type for a given object.

Call AnnHyperlinkType property after this Method To get the hyperlink type

See Also

Elements: | AnnSetHyperlinkMsg method, AnnSetHyperlinkString method, AnnHyperlinkType property
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


AnnGetLineStyle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetLineStyle(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the line style of the specified annotation object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetLineWidth method, AnnGetLineWidth method, AnnSetLineStyle method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetLineWidth method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetLineWidth(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the current unscaled value of the line width of the specified annotation object.

The line width is scaled using an average of the horizontal and vertical scaling factors of the container object. For more information, refer to Low-Level Coordinate System for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetLineWidth method, AnnSetLineStyle method, AnnGetLineStyle method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetLocked method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetLocked(long hObject);
Overview | Refer to Implementing Annotation Security.

Remarks

(Document/Medical only) Fills the AnnLocked property with a value that indicates whether the specified annotation object is locked.

Read the AnnLocked property after calling this method to get the value that indicates whether the specified annotation object is locked.

See Also

Elements: | AnnLock method, AnnUnlock method, AnnShowLockedIcon property
Topics: | Annotations (Document/Medical only): Annotation Security


AnnGetMetafile method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetMetafile(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Retrieves the metafile handle associated with a Stamp object (including the Rubber Stamp tools), Encrypt object, Hotspot object, or Freehand Hotspot object.

The Stamp object (which includes the Rubber Stamp tools) can display text, a bitmap or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two.

Initially, the Stamp object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).

Initially, the Hotspot, Freehand Hotspot, and Encrypt objects are also set to display predefined metafiles.

Call the AnnGetMetafile method to retrieve a metafile for an object. Call the AnnSetMetafile method to change the metafile for an object. Any new objects will still get the default metafile.

See Also

Elements | AnnSetMetafile method, AnnSetPredefinedMetafile method, AnnGetPredefinedMetafile method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnGetNameRestrict method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetNameRestrict(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Gets a value that indicates whether the name of the specified annotation object is restricted. If the name of an annotation object is restricted, the name will fully appear on the bitmap. If the name is not restricted, part of the name may appear on the bitmap while other parts do not.

For example, if the name of an annotation object has been restricted by calling the AnnSetNameRestrict method with the bNameRestrict parameter set to TRUE, the name offset cannot be set so that the object name is outside the bitmap (annotation container). The name offset is set by calling the AnnSetNameOffsetX methodand the AnnSetNameOffsetY method. To determine the current offset, call the AnnGetNameOffsetX method and the AnnGetNameOffsetY method.

For example, consider a 200 x 200 bitmap that has a 100 x 100 button in the lower right corner and the name of the button is "Button". Attempting to set the name offset to anything larger than (43,100) will result in the name offset being set to (43,100) anyway. In addition, dragging the annotation object itself in such a way that would cause the object name to be moved outside the bitmap will cause the name offset to change.

The restriction on an object name can be changed by:

1. | Calling the AnnSetNameRestrict method.
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameRestrict check box, and clicking "Apply.

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method, AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnGetNameOffsetX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetNameOffsetX(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Gets the X-coordinate of the name offset of the specified annotation object.

The name offset of an annotation object is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset coordinates are in pixels, where the image is viewed at 100%. The name offset can be changed by:

1. | Calling the AnnSetNameOffsetX or AnnSetNameOffsetY methods
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameOffset using the text box, and clicking "Apply.
3. | Clicking on the object name in design-mode and dragging it to a new location

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method, AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnGetNameOffsetY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetNameOffsetY(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Gets the Y-coordinate of the name offset of the specified annotation object.

The name offset of an annotation object is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset coordinates are in pixels, where the image is viewed at 100%. The name offset can be changed by:

1. | Calling the AnnSetNameOffsetXor AnnSetNameOffsetY methods
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameOffset using the text box, and clicking "Apply.
3. | Clicking on the object name in design-mode and dragging it to a new location

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method , AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnGetNameOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetNameOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets the annotation name options for the specified annotation object.

This method updates the AnnNameOptions property with the annotation name options for the object specified in hObject.

To set annotation name options set the AnnNameOptions property with the desired name options, and then call the AnnSetNameOptions method.

See Also

Elements: | AnnNameOptions property, AnnSetNameOptions method, Flags property, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderLine property, FontSize property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetNodes method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetNodes(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Fills the AnnShowNodes property with information on how to display the nodes of the annotation object in design mode.

This method is valid for the following annotation objects:

Curve

Closed Curve

Freehand

Freehand Hotspot

Polygon

Polyline

In addition, the Automation object stores node settings along with the other object default settings

Note:

The last node is always shown. Therefore, using a large value for uGapNodes will probably result in only the first and last nodes being shown.

Read the AnnShowNodes property after calling this method to get the information on how to display the nodes.

See Also

Elements | AnnSetNodes method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetObjectFromTag method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetObjectFromTag(long hObject, long lTag, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

Fills the AnnTagObject property with a handle to the object that has the specified tag.

For more information on getting and setting tags, refer to AnnGetTag method and AnnSetTag method.

Read the AnnTagObject property after calling this method to get to the object that has the specified tag.

See Also

Elements | AnnGetTag method, AnnSetTag method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetOffsetX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetOffsetX(long hObject);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Gets the X offset of the annotation object. Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the AnnSetScalarX and AnnSetScalarY methods. For more information, refer to Low-Level Coordinate System for Annotations.

See Also

Elements | AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Automation
 | Fixed Annotations
 | Obtaining Annotation Object Information


AnnGetOffsetY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetOffsetY(long hObject);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Gets the Y offset of the annotation object. Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the AnnSetScalarX and AnnSetScalarY methods. For more information, refer to Low-Level Coordinate System for Annotations.

See Also

Elements | AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetX method, AnnSetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Automation
 | Fixed Annotations
 | Obtaining Annotation Object Information


AnnGetOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetOptions(void);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the currently set user interface and other annotation options introduced in version 14.5.

In version 14.5 of LEADTOOLS, many changes to annotations are being introduced. Some of these features change the way annotations look. Other features change the behavior of the user interface (automated mode). To maintain backward compatibility, the new features are disabled by default. To enable these features, call the AnnSetOptions method with the desired flags. To get the current Version 14.5 options, call the AnnGetOptions method. For a description of the changes, refer to New Annotation Features of Version 14.5.

See Also

Elements: | ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property, ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, AnnSetOptions method, AnnGetFillModeExt method, AnnSetFillModeExt method, AnnAutoCursor property, AnnSave method, AnnSaveMemory method, AnnLoad method, AnnLoadMemory method, AnnSetTextOptions method, AnnGetTextOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method
Topics: | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects
 | Annotations (Document/Medical only): Automation


AnnGetPointCount method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetPointCount(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Fills the AnnPointCount property with the number of vertices (corner points) in an annotation object.

AnnGetPointCount works only with the following types of objects:

ANN_OBJECT_POINTER
ANN_OBJECT_FREEHAND
ANN_OBJECT_LINE
ANN_OBJECT_POLYGON
ANN_OBJECT_POLYLINE

You can use the AnnGetType method to identify the object type.

Read the AnnPointCount property after calling this method to Get the number of vertices.

See Also

Elements | AnnGetPointX method, AnnGetPointY method
Topics | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information


AnnGetPointOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetPointOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets the annotation point options for the specified Point annotation object.

This method updates the AnnPointOptions property with the annotation point options for the object specified in hObject.

To set annotation point options set the AnnPointOptions property with the desired point options, and then call the AnnSetPointOptions method.

See Also

Elements: | AnnPointOptions property, AnnSetPointOptions method, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetPointX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetPointX(long hObject, ILEADRasterVariant * pVarPoint);
Overview | Refer to Implementing Annotations.

Remarks

Fills the pVarPoint parameter with an array of floating-point numbers for the X coordinates of the vertices (corner points) of the specified annotation object. You can use this method with the AnnGetPointY method to get the vertices of the object. The points that define the vertices are relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.

AnnGetPointX works only with the following types of objects:

ANN_OBJECT_POINTER
ANN_OBJECT_FREEHAND
ANN_OBJECT_LINE
ANN_OBJECT_POLYGON
ANN_OBJECT_POLYLINE

You can use the AnnGetType method to identify the object type. You can use the AnnGetPointCount method to find out how many vertices are in the object.

Note:

For an ANN_OBJECT_TEXTPOINTER object, Points is updated with 5 points. The first four points are coordinates of a rectangle. The last two are the endpoints of the "pointer" segment.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetPointCount method, AnnGetPointY method
Topics | Annotations (Document/Medical only): Automation
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetPointY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetPointY(long hObject, ILEADRasterVariant * pVarPoint);
Overview | Refer to Implementing Annotations.

Remarks

Returns an array of floating-point numbers for the Y coordinates of the vertices (corner points) of the specified annotation object. You can use this method with the AnnGetPointX method to get the vertices of the object. The points that define the vertices are relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.

AnnGetPointX works only with the following types of objects:

ANN_OBJECT_POINTER
ANN_OBJECT_FREEHAND
ANN_OBJECT_LINE
ANN_OBJECT_POLYGON
ANN_OBJECT_POLYLINE

You can use the AnnGetType method to identify the object type. You can use the AnnGetPointCount method to find out how many vertices are in the object.

Note:

For an ANN_OBJECT_TEXTPOINTER object, Points is updated with 5 points. The first four points are coordinates of a rectangle. The last two are the endpoints of the "pointer" segment.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetPointCount method, AnnGetPointX method
Topics | Annotations (Document/Medical only): Automation
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetPolyFillMode method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetPolyFillMode(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates how a polygonal annotation with crossing lines is filled.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetFillMode method, AnnSetPolyFillMode method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetPredefinedMetafile method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetPredefinedMetafile(short nType);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Retrieves a copy of the specified predefined metafile.

The AnnGetPredefinedMetafile method is valid only for the following object types:

Encrypt

Freehand Hotspot

Hot Spot

Stamp (Including the Rubber Stamp tools)

Use the AnnGetPredefinedMetafile method to get the default metafiles for these objects. To reset a metafile to its original metafile, call the AnnSetMetafile method.

When the metafile handle is no longer needed, it must be freed using either DeleteMetaFile or DeleteEnhMetaFile Windows API functions.

Read the AnnPredefinedMetafileEnhanced property after calling this method to get a value that indicates whether the retrieved metafile is enhanced.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetPredefinedMetafile method, AnnGetMetafile method, AnnSetMetafile method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnGetProtractorOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnGetProtractorOptions(long hObject);
Overview | Refer to Protractor Annotation Object.

Remarks

(Document/Medical only) Gets the options for the specified Protractor object.

Read the AnnProtractorAcute, AnnProtractorUnit, AnnProtractorPrecision AND AnnProtractorArcRadius properties after calling this method to get the options for the specified Protractor object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetProtractorOptions method, AnnGetAngle method, AnnProtractorAcute property, AnnProtractorUnit property, AnnProtractorPrecision property, AnnProtractorArcRadius property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetRgnHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetRgnHandle(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Creates a region from the specified annotation object and retrieves a handle to that region.

Regions can be created from the following annotation objects:

ANN_OBJECT_FREEHAND
ANN_OBJECT_POLYLINE
ANN_OBJECT_POLYGON
ANN_OBJECT_RECT
ANN_OBJECT_ELLIPSE
ANN_OBJECT_FREEHANDHOTSPOT
ANN_OBJECT_HOTSPOT
ANN_OBJECT_STAMP
ANN_OBJECT_NOTE
ANN_OBJECT_TEXT
ANN_OBJECT_HILITE
ANN_OBJECT_BUTTON
ANN_OBJECT_REDACT

See Also

Elements | AnnGetArea method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetROP2 method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetROP2(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a constant that indicates which binary raster operation (ROP2) code is being used for one or more objects. ROP2 codes specify how pen or brush colors are to be combined with the colors in the image.

The AnnGetROP2 method is valid only for the following object types:

Crossproduct

Curve

Closed Curve

Ellipse

Freehand Line

Freehand Hotspot

Line

Pointer

Point

Polygon

Polyline

Polyruler

Protractor

Rectangle

Ruler

Stamp (including the Rubber Stamp tools)

Text Pointer

In addition, the Automation object stores ROP2 settings along with the other object default settings

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetROP2 method, AnnGetFillMode method, AnnSetFillMode method, AnnGetTransparent method, AnnSetTransparent method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetRotateOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetRotateOptions(long hObject, long lFlags);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the rotation options for the specified annotation object.

This function is one of the new functions being introduced as part of Version 14.5. Use this method to get the rotation options of any annotation object, including the automation object. The following properties will be updated after calling this method:

AnnShowRotateHandles property

With the new rotate options, two rotate handles are displayed on a selected object. One of the handles is the "gripper" handle, which rotates the object when dragged. The other handle is the "center" handle, which determines the center of rotation. The center of rotation can be moved by dragging. The gripper handle can be moved anywhere by dragging.

The following figure illustrates a rotate by dragging the "gripper" handle:

The following figure illustrates moving the "center" handle:

The rotate handles can be reset to a default location by right-clicking the annotation object, and selecting the Reset Rotate Handles option, as shown in the following figure:

The rotate handles can be globally hidden or displayed by right-clicking on the image (not an annotation object), and selecting the Hide Rotate Handles For All Objects option, as shown in the following figure:

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_ROTATE flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnSetRotateOptions method, AnnShowRotateHandles property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | New Annotation Features of Version 14.5


AnnGetScalarX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetScalarX(long hContainer);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Gets the horizontal scaling factor that is applied to the annotation object. Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the AnnSetOffsetXand AnnSetOffsetY methods, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarY method, AnnSetOffsetX method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Automation
 | Fixed Annotations
 | Displaying and Manipulating Annotation Objects


AnnGetScalarY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnGetScalarY(long hContainer);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Gets the vertical scaling factor that is applied to the annotation object. Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the AnnSetOffsetXand AnnSetOffsetY methods, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarX method, AnnSetOffsetX method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Automation
 | Fixed Annotations
 | Displaying and Manipulating Annotation Objects


AnnGetSecondaryBitmap method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetSecondaryBitmap(long hObject, ILEADRaster *pRaster);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Retrieves the secondary bitmap of the specified object.

Only PushPin objects use a secondary bitmap.

A pushpin object has a primary bitmap, (manipulated using AnnSetBitmap/AnnGetBitmap) when the text is shown, and a secondary bitmap, changed using AnnSetSecondaryBitmap method. The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized.

In design mode, the PushPin object shows the text and displays the primary bitmap. In run mode, the object shows/hides the text when clicked. The pushpin object has the active mode property. When the mode is ANN_ACTIVE_ENABLED, the text is shown and the primary bitmap is painted in the top-left corner of the note.

When the mode is ANN_ACTIVE_DISABLED, the text is hidden and the secondary bitmap is displayed.

See Also

Elements | AnnSetSecondaryBitmap method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnGetSecondaryMetaFile method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetSecondaryMetaFile (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets the metafile handle associated with an encryptor object when it is in the ‘decryptor’ state.

The encrypt object has two states:

Encryptor

Decryptor

Each state is displayed with its own metafile.

Use this method to retrieve the current metafile for an encrypt object in a ‘decryptor’ state. The default image is shown in the figure below:

See Also

Elements: | AnnGetMetaFile method, AnnSetMetafile method, AnnEncryptApply method, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnGetSelectCount method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetSelectCount();
Overview | Refer to Implementing Annotations.

Remarks

Fills the AnnSelectCount property with the number of currently selected annotation objects.

Read the AnnSelectCount property after calling this Method to get the number of currently selected annotation objects.

See Also

Elements | AnnGetSelectList method, AnnSelectCount property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetSelected method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetSelected(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value that indicates whether the specified annotation object is selected.

The AnnSet... methods can be used to set the properties of all objects that have the selected property set to TRUE.

See Also

Elements | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectTop property, AnnGetType method, AnnHitTest method, AnnSelectRectWidth property, AnnSelectRectHeight property, AnnShowLockedIcon property, AnnSelectPoint method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetSelectList method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetSelectList ILEADRasterVariant * pVarList);
Overview | Refer to Implementing Annotations.

Remarks

Fills the pVarList with an array of object handles for the currently selected annotation objects.

You can use the AnnGetSelectCount method to see how many handles will be in the array.

See Also

Elements | AnnGetSelectCount method
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetShowFlags method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetShowFlags(long hObject);
Overview | Refer to Crossproduct Annotation Object

Remarks

(Document/Medical only) Gets a value that indicates how the rulers, cross-products, and protractors will be displayed.

For Protractor objects, the default value for the Return Value is ANN_SHOW_NONE. For the Ruler, PolyRuler, and Cross-Product objects the default value for the Return Value is ANN_SHOW_LENGTH | ANN_SHOW_TICMARKS.

This method can only be used for Ruler, Cross-Product, PolyRuler, and Protractor objects.

In addition, the Automation object stores show flag settings along with the other object default settings

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnSetShowFlags method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnGetTag method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetTag(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Fills the pnTag parameter with the numeric tag that you assigned to the specified annotation object using the AnnSetTag method.

You can use these two methods to keep track of particular objects such as buttons or hot spots over time.

When you load a file, an OnAnnCreate event is generated for each annotation object. You can add code in this event to see which tags are already used in a file.

Read the AnnTag property after calling this Method to get the Tag Object.

See Also

Elements: | AnnTag property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetText method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnGetText(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the text (character string) of the specified annotation object.

Note:

The text of the ruler object (which can be retrieved through AnnGetText is the length + unit abbrev. The distance is reset every time the object is changed.

AnnGetText can be used to retreive the text from a Rich Text annotation object (ANN_OBJECT_RTF). However, no formatting information will be preserved. To retrieve the text with formatting, see AnnRTFText.

See Also

Elements | AnnAutoSnapCursor property, AnnTextEdit method, AnnSetText method, AnnGetAutoText method, AnnSetAutoText method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetTextOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetTextOptions(long hObject, long lFlags);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the text options for the specified annotation object.

The following properties will be updated after calling this method:

AnnShowText property

AnnShowBorder property

AnnTextColor property

The hObject parameter can represent any annotation object type, but the return information is only useful for text annotatations.

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_TEXT_OPTIONS flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnSetTextOptions method, AnnSetText method, AnnGetText method, AnnTextAlign property, AnnTextRotate property, AnnSetOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnShowBorder property, AnnTextColor property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnGetTopContainer method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetTopContainer(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets the handle of the root container of the specified annotation object.

See Also

Elements | AnnInsert method, AnnRemove method, AnnGetContainer method, AnnEnumerate method
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetTransparent method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnGetTransparent(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets a value indicating whether the bitmap the object is using is using a transparent color. A transparent color is not painted when the image is painted.

The AnnGetTransparent method is valid only for the following object types when they are using a bitmap:

Point

Stamp (including the Rubber Stamp tools)

In addition, the Automation object stores transparency settings along with the other object default settings

Call the AnnSetTransparent method to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). Call the AnnSetTransparentColor method to set the color to be used as the transparent color. Call the AnnGetTransparent method to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the AnnGetTransparentColor method to get a value that indicates which color is being used as the transparent color.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetTransparent method, AnnGetROP2 method, AnnSetROP2 method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Displaying and Manipulating Annotation Objects
 | Implementing Transparency
 | Obtaining Annotation Object Information


AnnGetTransparentColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnGetTransparentColor(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Retrieves the transparent color set by the AnnSetTransparentColor method.

By default the transparent color is white (0x00FFFFFF). A transparent color is not painted when the image is painted. For information on how LEADTOOLS uses colors, refer to Using Color Values in LEADTOOLS.

The AnnGetTransparentColor method is valid only for the following object types when they are using a bitmap:

Automation

Point

Stamp (including the Rubber Stamp tools)

Call the AnnSetTransparent method metod to set such objects to use a transparent color. Call the AnnSetTransparentColor method to set the color to be used as the transparent color. Call the AnnGetTransparent method to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetTransparentColor method, AnnSetTransparent method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS
 | Displaying and Manipulating Annotation Objects
 | Implementing Transparency
 | Obtaining Annotation Object Information


AnnGetType method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetType(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Fills the AnnType property with a value that identifies the type of annotation object.

Read the AnnType property after calling this method to get the type of annotation object.

See Also

Elements | AnnTool property, AnnType property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetUnit method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnGetUnit(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Fills the AnnUnit property with the current unit of measurement values set by AnnSetUnit method.

Read the AnnUnit property and AnnPrecision property after calling this mthod to get the current Unit and Precision.

The following annotation objects utilize one or more rulers as part of the annotation:

ANN_OBJECT_RULER

ANN_OBJECT_POLYRULER

ANN_OBJECT_PROTRACTOR

ANN_OBJECT_CROSSPRODUCT

In addition, the Automation object stores ruler settings along with the other object default settings.

The default unit of measure for ruler, polyruler, and crossproduct objects is Smart English. With the smart units, the unit changes with the length. For example, if the length is 11 inches (assuming the default precision of 2 is being used), "11.00 in" displays whereas if the length is 15 inches, "1 ft 3.00 in" displays. Call the AnnSetUnit method to set the unit of measurement and its precision for the ruler. The precision indicates how many digits to display to the right of the decimal point in the length. Call the AnnGetUnit method to fill the AnnUnit Property with the unit of measurement and its precision for the ruler. The AnnGetDistance2 method gets the length of each ruler that makes up an object, and the total length of all rulers.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnUnit property, AnnPrecision property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetUserData method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetUserData (long hObject, ILEADRasterVariant *pData)
Overview | Refer to Implementing Annotations.

Remarks

Use this Method to get the associated user-defined data of an annotation object.

If you set the Variant Type (pData->Type) = VALUE_STRING then Data Will come as String else it will Come As Array of Byte

See Also

Elements: | AnnAutoSnapCursor property, Flags property, AnnAutoCursor property, AnnSetUserData method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnGetUserHandle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetUserHandle (long hObject, long uIndex);
Overview | Refer to Implementing Annotations.

Remarks

Gets information about the specified user-defined annotation handle.

This method updates the AnnHandle property with the annotation handle information for the specified handle.

To add a new user handle to an annotation object, set the AnnHandle property with the desired handle information, and then call the AnnAddUserHandle method.

To change an existing user handle, call the AnnGetUserHandle method to get the current handle information. Set the desired values in the AnnHandle property and then call the AnnChangeUserHandle method.

A user handle can be deleted using the AnnDeleteUserHandle method.

See Also

Elements: | AnnHandle property, AnnAddUserHandle method, AnnChangeUserHandle method, AnnDeleteUserHandle method, ID property, ContainerX property, ContainerY property, ClientX property, ClientY property, EnableVisible property, PenColor property, FillColor property, Shape property, hCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetUserHandles method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnGetUserHandles (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets information about all existing user-defined annotation handles for the specified annotation object.

The AnnGetUserHandles method updates the UserHandle property with the annotation handle information for all handles associated with the specified annotation object. The UserHandleCount property is updated with the number of handles retrieved by the AnnGetUserHandles method.

See Also

Elements: | UserHandleCount property, UserHandle
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnGetVisible method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGetVisible(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Fills the AnnVisible property with a value that indicates whether the specified object is visible.

Read the AnnVisible property after calling this method to get the visible state of the object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnCreate method, AnnDefine, AnnDestroy method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method, AnnVisible property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnGetWnd method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnGetWnd(long hObject);
Overview | Refer to Container Annotation Object.

Remarks

(Document/Medical only) Gets the window handle of the specified annotation object.

See Also

Elements | AnnSetWnd method
Topics | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information


AnnGroup method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnGroup(long hObject, short iFlags, BSTR pszUserList);
Overview | Refer to Implementing Annotations.

Remarks

Groups a number of objects within a container.

The Group automation menu item operates like AnnGroup(hObject, ANN_FLAG_RECURSE|ANN_FLAG_SELECTED|ANN_FLAG_CHECKMENU, NULL).

If ANN_FLAG_USER is included in iFlags, any user associated with an object to be "grouped" must be included in pszUserList. The method checks pszUserList before grouping the objects and any object that has a user not in pszUserList will not be included in the group.

If ANN_FLAG_USER is not included in iFlags, the user list is ignored.

Please note that if you include ANN_FLAG_SELECTED|ANN_FLAG_USER, for example, in iFlags, the grouped objects must have a user in pszUserList AND must also be selected.

See Also

Elements | AnnUngroup method, AnnGetGrouping method, AnnSetGrouping method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnHitTest method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnHitTest(long hContainer, float x, float y);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Fills the AnnHitTestObject property with the handle to the annotation object that is located at a specified point. If objects overlap, this method gets the front object.

Read the AnnHitTestObject property after calling this method to get the object handle.

See Also

Elements | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectTop property, AnnSelectRectWidth property, AnnSelectRectHeight property, AnnSelectPoint method, AnnHitTestObject property
Topics | Annotations (Document/Medical only): Automation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnHitTestExt method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnHitTestExt(long hContainer, double ptX, double ptY);
Overview | Refer to Implementing Annotations.

Remarks

This method encapsulates the AnnHitTest, which gets the handle to the annotation object that is located at a specific point. (If objects overlap, it gets the front object.) AnnHitTestExt gets additional information about the annotation object handle if the handle is a default or user-defined handle. This additional information can be found in the HandleIndex property and the HandleID property.

See Also

Elements: | HandleIndex property, HandleID property, PositionResult property, ObjectHitHandle property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnInsert method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnInsert(long hContainer, long hObject, VARIANT_BOOL bStripContainer);
Overview | Refer to Implementing Annotations.

Remarks

Inserts the specified annotation object into the specified container.

If hObject is a single annotation object, set bStripContainer to FALSE. That way the object itself is inserted.

If hObject is a container, setting bStripContainer to TRUE will insert only the objects within the container, not the container itself.

If hObject is a container, setting bStripContainer to FALSE will insert the container and all objects within the container.

See Also

Elements | AnnCreate method, AnnDefine, AnnDestroy method, AnnGetVisible method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating and Deleting Annotations
 | Displaying and Manipulating Annotation Objects


AnnInsertTokenTable method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnInsertTokenTable();
Overview | Refer to Implementing Annotations.

Remarks

Inserts a text token into the text token table.

See Also

Elements: | Description property, TokenString property, Token property, TokenType property, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, EnumerateTextTokenTable event, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


AnnLoad method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnLoad(BSTR pszFile, long nPage);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Loads the annotations from the designated file and page.

The annotations are sized to fit their original size and position relative to the bitmap in the control. If the ILEADRasterAnnotation object does not have a bitmap image, an error occurs. AnnLoad will load annotations stored in LEAD files. It will also load annotations stored in a Wang compatible TIFF tag in a TIF file.

See Also

Elements | AnnSave method
Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnLoadArray method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnLoadArray(ILEADRasterVariant *pvMem, long lSize, long lPage);
Overview | Refer to Implementing Annotations.

Remarks

Loads annotations from a file that is stored in memory.

The argument vMem can refer to either an annotation file (single page or multipage) or a TIF file (single or multipage). In either case, the argument lPage refers to the page number.

The annotations are sized to fit their original size and position relative to the bitmap in the control. If the ILEADRasterAnnotation object does not have a bitmap image, an error occurs.

This method operates like AnnLoadMemory, except it loads the data from a byte array variant instead of a memory handle.

See Also

Elements | AnnSaveArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method
Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnLoadMemory method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnLoadMemory(long hMem, long nSize, long lPage);
Overview | Refer to Implementing Annotations.

Remarks

Loads annotations from a file that is stored in memory.

The argument hMem can refer to either an annotation file (single page or multipage) or a TIF file (single or multipage). In either case, the argument lPage refers to the page number.

The annotations are sized to fit their original size and position relative to the bitmap in the control. If the ILEADRasterAnnotation object does not have a bitmap image, an error occurs.

See Also

Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnLock method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnLock(long hObject, BSTR pszKey, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotation Security

Remarks

(Document/Medical only) Locks annotations with the specified key. Annotations cannot be modified through the automated mode unless they are unlocked with the same key either using AnnUnlock method, or through the automated mode unlock menu item. The key is case sensitive! If the AnnShowLockedIcon property is VARIANT_TRUE, the locked objects are drawn with a padlock icon on top of them. If a redact object is locked, AnnUnrealize method will fail on that object.

There is one property associated with this method. The AnnShowLockedIcon property determines how locked objects are drawn.

See Also

Elements: | AnnUnlock method, AnnUnrealize method, AnnShowLockedIcon property, AnnRealize method
Topics: | Annotations (Document/Medical only): Annotation Security


AnnMagGlass method (ILEADRasterAnnotation)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short AnnMagGlass (long hDC, long lMagXPos, long lMagYPos, long lMagWidth, long lMagHeight, short nZoom);
Overview | Refer to Customizing Magnifying Glass Painting.

Remarks

Displays the annotation object in the specified magnifying glass device context.

See Also

Elements: | AnnEnableMagGlass property, EnableMagGlassDraw property, MagGlassOwnerDraw event
Topics: | Using the Magnifying Glass Implementing Annotations Raster Images: Displaying Images Annotations: Displaying Annotations
 | Using the Zoom View


AnnMove method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnMove (float dxOffset, float dyOffset, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Moves annotation objects, using delta values that are relative to the bitmap.

The unit of measure is determined by the ScaleMode property. If you pass VARIANT_TRUE in the bSelected parameter, this method affects only the currently selected objects. Otherwise, it affects all objects.

See Also

Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnPaste method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnPaste ();
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Pastes annotation objects from the clipboard to the ILEADRasterAnnotation object. The data on the clipboard must be a LEAD annotation in native format.

Before calling this method, you can use the AnnPasteReady property to test the validity of data on the clipboard.

See Also

Topics | Annotations (Document/Medical only): Using the Clipboard
 | Displaying and Manipulating Annotation Objects
 | New Annotation Features of Version 14.5


AnnPopFixedState method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnPopFixedState(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Re-enables the ‘fixed’ state of the specified annotation.

You must set the Flags property before calling this method. Possible values for the Flags property for this method are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANNFLAG_CHECKMENU

See Also

Elements: | Flags property, AnnIsFixedRect property, AnnPushFixedState method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations


AnnPushFixedState method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnPushFixedState(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Temporarily disables the ‘fixed’ state of the specified annotation object.

You must set the Flags property before calling this method. Possible values for the Flags property for this method are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

See Also

Elements: | Flags property, AnnIsFixedRect property, AnnPopFixedState method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations


AnnRealize method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnRealize (VARIANT_BOOL bRedactOnly);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Renders the annotation objects to the bitmap, altering the bitmap, itself.

When you call AnnRealize, for every Redact object, the background of the image behind is saved inside the object. You can restore that background by calling AnnUnrealize.

This method works only for 1, 4, 8, 16, and 24-bit images. When using an image that has some other number of bits per pixel, call the ColorRes method (ILEADRasterProcess) to change the image to a supported bits per pixel before calling the AnnRealize method.

See Also

Elements | AnnUnrealize method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnRemove method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnRemove(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Removes the specified annotation object from its current container, leaving the object with no container.

To insert the object into another container, such as the main container of the display, use the AnnInsert method.

See Also

Elements | AnnInsert method, AnnGetContainer method, AnnGetTopContainer method, AnnEnumerate method
Topics | Annotations (Document/Medical only):Object Manipulation
 | Annotations (Document/Medical only): Creating and Deleting Annotations
 | Displaying and Manipulating Annotation Objects


AnnRestrictCursor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnRestrictCursor (long hContainer, long left, long top, long right, long bottom, double ptX, double ptY, VARIANT_BOOL bRestrictClient);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Restricts the mouse cursor in conjunction with annotation objects. It should be used when creating custom annotation objects.

Calling this method always restricts the mouse cursor to the annotation container. However, depending on the arguments passed, the mouse cursor can be restricted further.

This method can be used in the following ways:

To restrict the cursor to the bounds of the container, pass 0 for left, top, right and bottom and 0 for ptX and ptY.

To restrict the cursor to a box around ptX, ptY (and the container), pass left, top, right, bottom, ptX and ptY. This is used to restrict movement when dragging an annotation. The ptX and ptY parameters specify the location at which the user begins the dragging operation by pressing the mouse button. The left, top, right and bottom parameters specify the bounding box of the annotation. Calling this method when the mouse button is pressed restricts movement of the annotation so that no part of the annotation can go outside the container. In the diagram below, the red rectangle is restricted so it cannot move outside the container.

To restrict the cursor to a box (not centered around a point), pass pass left, top, right and bottom and pass 0 for ptX and ptY.

To do the above, and also restrict to the client area, set bRestrictClient to VARIANT_TRUE.

See Also

Elements: | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, LeftPreviousClip property, TopPreviousClip property, RightPreviousClip property, BottomPreviousClip property
Topics: | Annotations (Document/Medical only):Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects


AnnReverse method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnReverse( VARIANT_BOOL bUseVert, float fVert, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Reverses one or more annotation objects, left to right.

If you pass VARIANT_TRUE in the bSelected parameter, this method affects only the currently selected objects. Otherwise, it affects all objects.

If you pass VARIANT_TRUE in the bUseVert parameter, this method reverses all affected objects on the axis specified in the fVert parameter. Otherwise, it reverses each affected object on its own center.

You cannot flip or reverse an object that contains text. If you flip or reverse a group of objects on a common axis, the text will move to the new position, but will retain its orientation.

See Also

Topics | Annotations (Document/Medical only): Object Manipulation
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects


AnnRotate method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnRotate(VARIANT_BOOL bUseCenter, float fCenterX, float fCenterY, float fAngle, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Rotates one or more annotation objects.

If you pass VARIANT_TRUE in the bSelected parameter, this method affects only the currently selected objects. Otherwise, it affects all objects.

If you pass VARIANT_TRUE in the bUseCenter parameter, this method rotates all affected objects around the point specified by the fCenterX and fCenterY parameters. Otherwise, it rotates each affected object on its own center.

You cannot rotate a note, hot spot, button, or audio clip. If you rotate a group of objects around a common center, these objects will move to new positions, but will retain their orientation.

See Also

Topics | Annotations (Document/Medical only): Object Manipulation
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects


AnnSave method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSave(BSTR pszFile, AnnFMTConstants iFormat, VARIANT_BOOL bSelected, SaveModifyConstants iModify, long lSavePage);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Saves the specified annotations in a file.

Annotation files can store multiple pages. This method saves annotations to an annotation file. It can also append, replace, or overwrite pages in an existing annotation file.

To overwrite an existing annotation file, pass SAVE_OVERWRITE for the iModify parameter (lSavePage will be ignored).

To add a page to the end of an annotation file, pass SAVE_APPEND for the iModify argument (lSavePage will be ignored).

To replace a page in an annotation file, pass SAVE_REPLACE and set lSavePage to the page number to be replaced. Note that page numbers are 1-based. Therefore, the first page is page 1, the second page is page 2, etc.

To insert a new page, pass SAVE_INSERT and set lSavePage. The new page will be inserted BEFORE the page specified in lSavePage.

You can also save annotations in a Wang-compatible TIFF tag. For more information concerning this option, refer to AnnSaveTag method.

See Also

Elements | AnnLoad method, AnnSaveTag method
Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnSaveArray method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSaveArray(AnnFMTConstants iFormat, VARIANT_BOOL bSelected, ILEADRasterVariant *pVarArray, SaveModifyConstants iModify, long lSavePage);
Overview | Refer to Implementing Annotations.

Remarks

Saves the specified annotations to a file in memory.

Annotation files can store multiple pages. This method saves annotations to an annotation file. It can also append, replace, or overwrite pages in an existing annotation file.

To overwrite an existing annotation file, pass SAVE_OVERWRITE for the iModify parameter (lSavePage will be ignored).

To add a page to the end of an annotation file, pass SAVE_APPEND for the iModify argument (lSavePage will be ignored).

To replace a page in an annotation file, pass SAVE_REPLACE and set lSavePage to the page number to be replaced. Note that page numbers are 1-based. Therefore, the first page is page 1, the second page is page 2, etc.

To insert a new page, pass SAVE_INSERT and set lSavePage. The new page will be inserted BEFORE the page specified in lSavePage.

To see the correct data types, refer to the code example for your development system.

To load annotations from a file in memory, refer to the AnnLoadArray method.

This method can also be used in ASP.

To determine the size, use the following:

Size = UpperBound of the VARIANT – LowerBound of the VARIANT + 1;

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnLoadArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method
Topics | Annotations (Document/Medical only): Input and Output


AnnSaveMemory method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSaveMemory(long* phMem, AnnFMTConstants iFormat, VARIANT_BOOL bSelected, long * pnSize, SaveModifyConstants iModify, long lSavePage);
Overview | Refer to Implementing Annotations.

Remarks

Saves the specified annotations to a file in memory.

Annotation files can store multiple pages. This method saves annotations to an annotation file. It can also append, replace, or overwrite pages in an existing annotation file.

To overwrite an existing annotation file, pass SAVE_OVERWRITE for the iModify parameter (lSavePage will be ignored).

To add a page to the end of an annotation file, pass SAVE_APPEND for the iModify argument (lSavePage will be ignored).

To replace a page in an annotation file, pass SAVE_REPLACE and set lSavePage to the page number to be replaced. Note that page numbers are 1-based. Therefore, the first page is page 1, the second page is page 2, etc.

To insert a new page, pass SAVE_INSERT and set lSavePage. The new page will be inserted BEFORE the page specified in lSavePage.

To use this method, do the following:

1. | To create a new annotation memory file, declare a variable of the appropriate data type to reference the file in memory, and set the value to NULL (or 0).You can then pass its address (pass the variable by reference) in this method, which will allocate the memory, save the bitmap, and unlock the memory. To add a page to an existing annotation memory file, pass the address of the existing memory handle (which must be non-zero).
2. | Declare a long integer variable for the file-size. You can then pass its address in this method, which will update its value with the size of the file.
3. | Pass the appropriate value for iModify (SAVE_OVERWRITE, SAVE_APPEND, SAVE_REPLACE or SAVE_INSERT).
4. | If iModify is SAVE_REPLACE or SAVE_INSERT, pass the appropriate page number for lSavePage. If iModify is SAVE_OVERWRITE or SAVE_APPEND then lSavePage is ignored.
5. | Call this method to save the bitmap in the specified memory handle.

To see the correct data types, refer to the code example for your development system.

To load annotations from a file in memory, refer to the AnnLoadMemory method.

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnLoad method, AnnSaveTag method, AnnSave method, AnnSaveArray method
Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnSaveTag method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSaveTag(LPDISPATCH pRasterIO,VARIANT_BOOL bWangMode, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations

Remarks

(Document/Medical only) Saves all or selected annotation objects in a Wang-compatible TIFF tag. The next time a file is saved as one of the TIFF formats, the file will contain these annotations. This tag is automatically cleared when a new image is loaded into the Main Control. For more information on TIFF formats, refer to Summary of All Supported Image File Formats.

See Also

Elements | AnnSave method
Topics | Annotations (Document/Medical only): Input and Output
 | New Annotation Features of Version 14.5


AnnSelectPoint method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSelectPoint(long hContainer, float x, float y);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Selects the annotation object at the specified point, relative to the window. If objects overlap, this method selects the front object.

Selecting an object sets its selected property to TRUE.

See Also

Elements | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectTop property, AnnHitTest method, AnnSelectRectWidth property, AnnSelectRectHeight property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects


AnnSelectRect method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSelectRect(long hContainer, float left, float top, float right, float bottom);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Selects all objects within the specified rectangle, relative to the window.

Selecting an object sets its selected property to TRUE.

See Also

Elements | AnnSelectRectLeft property, AnnSelectRectTop property, AnnSelectRectWidth property, AnnSelectRectHeight property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects


AnnSendToBack method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSendToBack(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Reorders the specified annotation object so that it is displayed behind other objects in the same container.

This method moves the object to the beginning of the enumeration order for objects in the same container. When the container is displayed, this object is displayed first.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnBringToFront method, AnnBoundingRectTop property, AnnBoundingRectLeft property, AnnBoundingRectHeight property, AnnBoundingRectWidth property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects


AnnSetAutoBackColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetAutoBackColor(long hObject, short iType, OLE_COLOR crBack);
Overview | Refer to Implementing Annotations.

Remarks

Sets the background color of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations. Please note the following:

if iType is: | then the background color is changed for:
ANN_OBJECT_NOTE or ANN_OBJECT_PUSHPIN | Note objects and push pin objects created by the automation object
ANN_OBJECT_HILITE | Hilite objects created by the automation object.
ANN_OBJECT_REDACT | Redact objects created by the automation object.
any other object such as ANN_OBJECT_TEXT, ANN_OBJECT_RECT, etc. | All other objects, created by the automation object, which have a background color property.

See Also

Topics | AnnAutoSnapCursor property, AnnGetAutoBackColor method, AnnGetBackColor method, AnnSetBackColor method, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Automation
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS


AnnSetAutoDefaults method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetAutoDefaults(long hObject, short iFlags);
Overview | Refer to Implementing Annotations.

Remarks

Assigns all the automation default properties to the specified annotation object.

This method simulates the action that takes place when an annotation object is created using the automated mode. An annotation object created in automated mode receives the same default properties as the automation object, such as foreground color, line width, etc. This lets you assign the same default properties in the automation object to the specified annotation object.

See Also

Elements | AnnAutoSnapCursor property, AnnCreate method, AnnDefine, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetSelected method, AnnSetVisible method, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetAutoMenuItemEnable method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetAutoMenuItemEnable(long hObject, short iType, short iItem, short iEnable, short iFlags, BSTR pszUserList);
Overview | Refer to Implementing Annotations.

Remarks

Enables or disables a menu item for one or more annotation objects.

By default, all automation menu items that are not NULL are displayed.

If an automation menu item is NULL, that menu item will not be displayed, even if the menu item has been enabled using this method.

The menu item strings are changed using the AnnSetAutoText method.

Menu items can be enabled or disabled for one or more than one object, depending on the object passed in the hObject parameter. The following table indicates the possible options:

Menu Item String | Status | HObject | iType | Result
NULL | Enabled | Annotation or automation | Any type | Menu item is not displayed.
NULL | Disabled | Annotation or automation | Any type | Menu item is not displayed.
Not NULL | Disabled | Automation object | ANN_OBJECT_XXX | Menu item is not displayed for all objects of type ANN_OBJECT_XXX.
Not NULL | Disabled | Automation object | ANN_OBJECT_ALL | Menu item is not displayed for all objects.
Not NULL | Enabled | Automation object | ANN_OBJECT_XXX | Menu item is displayed for all objects of type ANN_OBJECT_XXX.
Not NULL | Enabled | Automation object | ANN_OBJECT_ALL | Menu item is displayed for all objects.
Not NULL | Disabled | Annotation object | Ignored | Menu item is not displayed for the specified object, based on the value of uFlags.
Not NULL | Enabled | Annotation object | Ignored | Menu item is displayed for the specified object, based on the value of uFlags.

See Also

Elements | AnnAutoSnapCursor property, AnnGetAutoMenuItemEnable, AnnAutoMenuEnable property
Topics | Annotations (Document/Medical only): Automation


AnnSetAutoText method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetAutoText (short iItem, BSTR pszText);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the character string that is used for the specified menu item or other element that LEADTOOLS provides for automated annotations.

To get the current value of a text string, you can use the AnnGetAutoText method.

When you call this method with an empty string for pszText, the menu item defined by iItem will be disabled and removed from the automation menu. To re-enable the menu item, call this method again and pass a valid string.

See Also

Elements | AnnAutoSnapCursor property, AnnTextEdit method, AnnGetAutoText method, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Automation


AnnSetBackColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetBackColor(long hObject, OLE_COLOR crBack, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the background color of one or more annotation objects.

Use the Windows COLORREF data type to specify the color. For example, use the Pixel propertyor the Windows RGB macro to get a color value.

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetForeColor method, AnnGetForeColor method, AnnGetBackColor method, AnnSetROP2 method, AnnGetROP2 method, AnnGetAutoBackColor method, AnnSetAutoBackColor method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS


AnnSetBitmap method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetBitmap(long hObject, ILEADRaster *pRaster, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the bitmap of one or more annotation objects. The specified bitmap is a LEAD bitmap.

The AnnSetBitmap method is valid only for the following object types:

Point

Pushpin

Stamp (including the Rubber Stamp tools)

The Stamp object (which include the Rubber Stamp tools) can display text, a bitmap or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two.

Initially, the Stamp object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).

Call the AnnGetBitmap method to get the bitmap for one or more annotation objects.

For descriptions of the various types of objects and their properties, refer to Types of Annotations.

This method applies to multiple or selected objects, based on the value of the bSelected parameter.

See Also

Elements | AnnGetBitmap method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects


AnnSetBitmapDpiX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetBitmapDpiX(long hObject, float fBitmapDpix, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the horizontal Bitmap DPI (dots per inch) value that is used to translate the horizontal distance for the Ruler object.

The value of the AnnContainer property must not be passed for the hObject parameter.

Only Automation and Ruler objects are affected. Refer to AnnAutomation property.

Set this value to the bitmap’s XResolution. This method should be called when loading objects or pasting them from the clipboard to containers other than the Main Control's AnnContainer. Otherwise, the distances shown by the ruler objects will not be accurate.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetUnit method, AnnSetGaugeLength method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Bitmap
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetBitmapDpiY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetBitmapDpiY(long hObject, float fBitmapDpiY, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the horizontal Bitmap DPI (dots per inch) value that is used to translate the vertical distance for the Ruler object.

The value of the AnnContainer property must not be passed for the hObject parameter.

Only Automation and Ruler objects are affected. Refer to AnnAutomation property.

Set this value to the bitmap’s XResolution. This method should be called when loading objects or pasting them from the clipboard to containers other than the Main Control's AnnContainer. Otherwise, the distances shown by the ruler objects will not be accurate.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetUnit method, AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Bitmap
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetEncryptOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetEncryptOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Sets the encryption options for the specified Encrypt annotation object.

To set the Encryption options for one or more objects you must set the desired options in the AnnEncryptOptions property before calling this method. In addition, you must set the Flags property before calling this method, to indicate the objects for which to set the encryption options. Possible values for the Flags property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

To get the annotation encryption options for a specific Encrypt annotation object, call the AnnGetEncryptOptions method. The AnnEncryptOptions property will be updated with the encryption options.

See Also

Elements: | AnnEncryptApply method, AnnEncryptOptions property, AnnGetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetFillMode method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFillMode(long hObject, short nFillMode, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the fill mode of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

Note that the AnnSetROP2 method and the AnnSetFillMode method affect each other. If you set nFillMode to ANN_FILLMODE_OPAQUE, then nROP2 cannot be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSLUCENT, then nROP2 has to be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSPARENT, nROP2 can be anything.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFillPattern method, AnnGetFillPattern method, AnnGetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnSetBackColor, AnnSetForeColor, AnnGetSelected, AnnSetSelected, AnnGetTransparent, AnnSetTransparent, AnnGetTransparentColor, AnnSetTransparentColor
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFillModeExt method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFillModeExt(long hObject, short nFillMode, short nAlpha, VARIANT_BOOL bSelected)
Overview | Refer to Implementing Annotations

Remarks

(Document/Medical only) Sets the fill mode and alpha of the specified annotation object.

Like AnnSetFillMode method, you can use this method to set the fill mode for annotation objects. With this method, the AnnSetFillMode method has been extended to support the new fill mode ANN_FILLMODE_ALPHA.

Before calling AnnSetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

VB Example:

Private Sub ExampleEnableOption_Click()
Dim lOptions As Long
lOptions = RasterAnn.AnnGetOptions()
RasterAnn.AnnSetOptions (lOptions Or ANN_OPTIONS_NEW_ALPHA)
End Sub

VC++ Example:

void CAnnCOMView::ExampleEnableOption()
{
long lOptions;
lOptions = m_pltAnn->AnnGetOptions();
m_pltAnn->AnnSetOptions(lOptions | ANN_OPTIONS_NEW_ALPHA);
}

The following figure displays rectangle annotation objects using different alpha values:

The nAlpha parameter is used only if the nFillMode parameter is passed as ANN_FILLMODE_ALPHA, in which case, nAlpha can be between -1 and 255 inclusive. Values are used as follows:

bmc sqrblit.bmp}a value of -1 means to leave the existing nAlpha value unchanged

bmc sqrblit.bmp}a value of 0 means the annotation object background is completely transparent

bmc sqrblit.bmp}a value of 255 means the annotation background is completely opaque.

bmc sqrblit.bmp}any value between 0 and 255 can be used to specify a varying degree of transparency.

Note that the AnnSetROP2 method and the AnnSetFillModeExt method affect each other. If you set nFillMode to ANN_FILLMODE_OPAQUE, then nROP2 cannot be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSLUCENT, then nROP2 has to be ANN_ROP2_AND. If you set nFillMode to ANN_FILLMODE_TRANSPARENT, nROP2 can be anything.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

This method applies to multiple and selected objects based on values of the bSelected parameter.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements: | AnnSetFillMode method, AnnGetFillMode method, AnnGetFillModeExt method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnGetROP2 method, AnnSetROP2 method, AnnSetBackColor method, AnnSetForeColor method, AnnFillMode property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation.


AnnSetFillPattern method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFillPattern(long hObject, short nFillPattern, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the fill pattern of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontBold method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontBold(long hObject, VARIANT_BOOL bFontBold, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the bold-font property of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontItalic method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontItalic(long hObject, VARIANT_BOOL bFontItalic, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the italic-font property of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontName method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontName(long hObject, BSTR pszFontName, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the font of one or more annotation objects. You specify the name of the font in a character string.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontSize method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontSize(long hObject, float fFontSize, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the font size of one or more annotation objects.

The font size of an object is relative to its container object. The height of a font is interpreted using the container's vertical scaling factor. For example, suppose you want the font to appear as a 10-point font on your screen using the current scaling factor. You would use the following calculation, where A is the pixel height of a 10-point font, B is the value that you get from the AnnGetScalarX method, and C is the value that you get from the AnnGetScalarY method:

dFontSize = A / sqrt( B * C )

For more information, refer to Low-Level Coordinate System for Annotations.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontStrikeThrough method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontStrikeThrough(long hObject, VARIANT_BOOL bFontStrikeThrough, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Applies or removes the strike-through (a line through the middle of the text), of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnSetFontUnderline method, AnnGetFontUnderline method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetFontUnderline method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetFontUnderline(long hObject, VARIANT_BOOL bFontUnderline, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Applies or removes the underline of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetFontBold method, AnnSetFontBold method, AnnSetFontName method, AnnGetFontName method, AnnSetFontSize method, AnnGetFontSize method, AnnGetFontUnderline method, AnnSetFontStrikeThrough method, AnnGetFontStrikeThrough method, AnnSetFontItalic method, AnnGetFontItalic method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetForeColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetForeColor(long hObject, OLE_COLOR ForeColor, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the foreground color of one or more annotation objects. The default foreground color is red.

Use the Windows COLORREF data type to specify the color. For example, use the Pixel property or the Windows RGB macro to get a color value.

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetForeColor method, AnnSetBackColor method, AnnGetBackColor method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS


AnnSetGaugeLength method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetGaugeLength(long hObject, float fGaugeLength, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the length of the gauge (the perpendicular lines at the ends of the Ruler object).

The gauge length property applies only to Automation and Ruler objects. Refer to AnnAutomation property.

Length is expressed in pixels, not in points. The length is for the whole line, not just from the end point of the ruler to the end point of the gauge - it is from one end of the gauge to the other end of the gauge.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetUnit method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetGrouping method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetGrouping (long hObject, VARIANT_BOOL bAutoGroup, short iFlags);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the grouping of the objects within the specified container.

This method is valid only for container objects.

Each container contains a "grouping" property, which indicates whether the objects in the container should be treated as a group.

See Also

Elements | AnnGetGrouping method, AnnGroup method, AnnUngroup method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Grouping and Ungrouping Annotation Objects
 | Displaying and Manipulating Annotation Objects


AnnSetHyperlinkMsg method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetHyperlinkMsg(long hObject, short iType, long lParam1, long lParam2, long lParam3, long lParam4, long lParam5);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) Annotations may be hyperlinked to run a program, access a Web page, or send a user defined message to the OnAnnHyperlink event. This method creates a hyperlink from an annotation to the OnAnnHyperlink event with either no parameters or five parameters, depending on uType.

See Also

Elements: | AnnSetHyperlinkString method
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


AnnSetHyperlinkString method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetHyperlinkString(long hObject, short iType, BSTR pszHyperlink);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) Annotations may be hyperlinked to run a program, access a Web page, or send a user defined message to the OnAnnHyperlink event. This method sets the string containing the name of the program, with all required command line parameters, or the URL of the Web page.

See Also

Elements: | AnnSetHyperlinkMsg method, AnnGetHyperlinkString method, AnnGetHyperlinkType method
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


AnnSetLineStyle method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetLineStyle(long hObject, short nLineStyle, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the line style of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements: | AnnSetLineWidth method, AnnGetLineWidth method, AnnGetLineStyle method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetLineWidth method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetLineWidth(long hObject, float fLineWidth, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the unscaled line width of one or more annotation objects.

The line width of an object is relative to its container object, and the value is interpreted using the container's scaling factors. For example, suppose you want the line to be three pixels wide on your screen using the current scaling factors. You would use the following calculation, where A is the desired width of three pixels, B is the value that you get from the AnnGetScalarX method, and C is the value that you get from the AnnGetScalarY method:

fLineWidth = A / sqrt( B * C )

For more information, refer to Low-Level Coordinate System for Annotations.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements: | AnnGetLineWidth method, AnnSetLineStyle method, AnnGetLineStyle method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetMetafile method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetMetafile(long hObject, long hMetafile, short nType, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the metafile associated with Stamp objects (including the Rubber Stamp tools), Encrypt object, Hotspot objects, or Freehand Hotspot objects.

The AnnSetMetafile method is valid only for the following object types:

Encrypt

Freehand Hotspot

Hot Spot

Stamp

The Stamp object (which include the Rubber Stamp tools) can display text, a bitmap or a metafile. Only one of these three can be displayed at any time—setting the object to one of these destroys any settings for the other two.

Initially, the Stamp object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).

Initially, the Hotspot, Freehand Hotspot, and Encrypt objects are also set to display predefined metafiles.

Call the AnnGetMetafile method to retrieve a metafile for an object. Call the AnnSetMetafile method to change the metafile for an object. Any new objects will still get the default metafile.

If nType == ANN_METAFILE_USER, then hMetafile is the metafile handle. You can use the windows functionality to create a metafile.

If nType is one of the ANN_METAFILE_XXX values, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 28 predefined metafiles. You can change the predefined metafiles by using the AnnSetPredefinedMetafile method.

See Also

Elements | AnnGetMetafile method, AnnSetPredefinedMetafile method, AnnGetPredefinedMetafile method, AnnGetEncryptOptions, AnnSetEncryptOptions, AnnEncryptApply, AnnGetSecondaryMetafile, AnnPredefinedRaster property, AnnGetPointOptions
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects


AnnSetNameOffsetX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetNameOffsetX(long hObject, long NameOffsetX, VARIANT_BOOL bSelected );
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Sets the X-coordinate of the name offset of the specified annotation object.

The name offset of an annotation object is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset coordinates are in pixels, where the image is viewed at 100%. The name offset can be changed by:

1. | Calling the AnnSetNameOffsetX or AnnSetNameOffsetY methods
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameOffset using the text box, and clicking "Apply.
3. | Clicking on the object name in design-mode and dragging it to a new location

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method, AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnSetNameOffsetY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetNameOffsetY( hObject, long NameOffsetY, VARIANT_BOOL bSelected);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Sets the Y-coordinate of the name offset of the specified annotation object.

The name offset of an annotation object is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset coordinates are in pixels, where the image is viewed at 100%. The name offset can be changed by:

1. | Calling the AnnSetNameOffsetX or AnnSetNameOffsetY methods
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameOffset using the text box, and clicking "Apply.
3. | Clicking on the object name in design-mode and dragging it to a new location

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method, AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnSetNameOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetNameOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Sets the name options for the specified annotation object.

To set the name options for one or more objects you must set the desired options in the AnnNameOptions property before calling this method. In addition, you must set the Flags property before calling this method, to indicate the objects for which to set the name options. Possible values for the Flags property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

To get the annotation name options for a specific annotation object, call the AnnGetNameOptions method. The AnnNameOptions property will be updated with the name options.

See Also

Elements: | AnnNameOptions property, AnnGetNameOptions method, Flags property, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderLine property, FontSize property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetNameRestrict method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetNameRestrict(long hObject, VARIANT_BOOL bNameRestrict, VARIANT_BOOL bSelected);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Document/Medical only) Sets a value that determines whether the name of the specified annotation object is restricted. If the name of an annotation object is restricted, the name will fully appear on the bitmap. If the name is not restricted, part of the name may appear on the bitmap while other parts do not.

For example, if the name of an annotation object has been restricted by calling the AnnSetNameRestrict method with the bNameRestrict parameter set to TRUE, the name offset cannot be set so that the object name is outside the bitmap (annotation container). The name offset is set by calling the AnnSetNameOffsetX method and the AnnSetNameOffsetY method. To determine the current offset, call the AnnGetNameOffsetX method and the AnnGetNameOffsetY method.

For example, consider a 200 x 200 bitmap that has a 100 x 100 button in the lower right corner and the name of the button is "Button". Attempting to set the name offset to anything larger than (43,100) will result in the name offset being set to (43,100) anyway. In addition, dragging the annotation object itself in such a way that would cause the object name to be moved outside the bitmap will cause the name offset to change.

The restriction on an object name can be changed by:

1. | Calling the AnnSetNameRestrict method.
2. | Right-clicking the object in design-mode, selecting Name Properties, setting the NameRestrict check box, and clicking "Apply.

When an object is created in automation mode, the newly created object will have the same name restrictions that the automation object had. That is, if the name of the automation object is restricted, the name of the newly created object is restricted. If the name of the automation object was not restricted, then the name of the newly created object will not be restricted.

See Also

Elements: | AnnSetNameOptions method, AnnGetNameOptions method, AnnGetNameRestrict method, AnnSetNameRestrict method, AnnGetNameOffsetX method, AnnGetNameOffsetY method, AnnSetNameOffsetX method, AnnSetNameOffsetY method
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnSetNodes method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetNodes(long hObject, VARIANT_BOOL bShowNodes, short nGapNodes, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Determines which nodes will be displayed for those annotation objects that use nodes.

This method is valid for the following annotation objects:

Curve

Closed Curve

Freehand

Freehand Hotspot

Polygon

Polyline

In addition, the Automation object stores node settings along with the other object default settings.

If hObject is a Curve, Closed Curve, Polygon, Polyline, Freehand Hot Spot, or Freehand object, this method determines how the nodes for the object will be displayed in design mode.

If hObject is an Automation object, this method determines how the nodes will be displayed for the next Curve, Closed Curve, Polygon, Polyline, Freehand Hot Spot, or Freehand object created in automated mode.

If hObject is a Container object, this method determines how the nodes of the Curves, Closed Curves, Polygons, Polylines, Freehand Hot Spot, or Freehand objects within the container will be displayed.

If bShowNodes is FALSE, nGapNodes will be ignored since the nodes will not be shown.

Note:

The last node is always shown. Therefore, using a large value for nGapNodes will probably result in only the first and last nodes being shown.

See Also

Elements | AnnGetNodes method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetOffsetX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetOffsetX(long hObject, float OffsetX, VARIANT_BOOL bSelected);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Sets the X offset of the annotation object. Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the AnnSetScalarX and AnnSetScalarY methods. For more information, refer to Low-Level Coordinate System for Annotations.

The value of the AnnContainer property cannot be passed for the hObject parameter.

See Also

Elements: | AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics: | Annotations (Document/Medical only): Automation
 | Fixed Annotations


AnnSetOffsetY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetOffsetY(long hObject, float OffsetY, VARIANT_BOOL bSelected);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Sets the Y offset of the annotation object. Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the AnnSetScalarX and AnnSetScalarY methods. For more information, refer to Low-Level Coordinate System for Annotations.

The value of the AnnContainer property cannot be passed for the hObject parameter.

See Also

Elements: | AnnSetScalarX method, AnnSetScalarY method, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetX method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics: | Annotations (Document/Medical only): Automation
 | Fixed Annotations


AnnSetOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetOptions(long lOptions);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets user interface and other annotation options introduced in version 14.5.

In version 14.5 of LEADTOOLS, many changes to annotations have been introduced. Some of these features change the way annotations look. Other features change the behavior of the user interface (automated mode). To maintain backward compatibility, the new features are disabled by default. To enable these features, call the AnnSetOptions method with the desired flags. To get the current Version 14.5 options, call the AnnGetOptions method. For a description of the changes, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnAutoSnapCursor property, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property, ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, AnnGetOptions method, AnnGetFillModeExt method, AnnSetFillModeExt method, AnnAutoCursor property, AnnSave method, AnnSaveMemory method, AnnLoad method, AnnLoadMemory method, AnnSetTextOptions method, AnnGetTextOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method
Topics: | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects
 | Annotations (Document/Medical only): Automation


AnnSetPointOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetPointOptions (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Sets the point options for the specified annotation object.

To set the point options for one or more objects you must set the desired options in the AnnPointOptions property before calling this method. In addition, you must set the Flags property before calling this method, to indicate the objects for which to set the point options. Possible values for the Flags property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetPoints method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetPoints(long hObject, ILEADRasterVariant * vXArray, ILEADRasterVariant * vYArray, long lPointCount);
Overview | Refer to Point Annotation Object.

Remarks

(Document/Medical only) Defines the shape of an annotation object, such as a polygon, that requires multiple points.

Coordinates of an object's points are relative to its container object. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

For annotation objects that are defined by a rectangle, use the AnnRect... properties.

You can position a Point object using the following (VB):

ReDim x(1) As Single, y(1) As Single
x(1) = 100
y(1) = 200
LEAD1.AnnSetPoints hPoint, x, y, 1
where x,y contain the desired position.

To set the points of a cross-product object, do the following:

ReDim x(5) As Single, y(5) As Single
' Assign values for x and y from 1 through 5
LEAD1.AnnSetPoints hXproduct, x, y, 5

hXproduct is the handle to the cross-product object. x(1),y(1) and x(2),y(2) are the points for the primary ruler. x(3),y(3) is the intersection point. x(4),y(4) and x(5),y(5) are the points for the secondary ruler.

To set the points of a protractor object, do the following:

ReDim x(3) As Single, y(3) As Single
' Assign values for x and y from 1 through 3
LEAD1.AnnSetPoints hProtractor, x, y, 3

hProtractor is the handle to the protractor object. x(1),y(1) and x(3),y(3) are the endpoints for the two rulers. x(2),y(2) is the intersection point. This is shown below:

Note:

When calling AnnSetPoints on a ANN_OBJECT_TEXTPOINTER object, specify three points. The three points are (Upper Left), (Lower Right), (Anchor).

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnBringToFront method, AnnSendToBack method, AnnRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnBoundingRectTop property, AnnBoundingRectLeft property, AnnBoundingRectHeight property, AnnBoundingRectWidth property, AnnGetPointCount method, AnnGetPointX method, AnnGetPointY method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetPolyFillMode method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetPolyFillMode(long hObject, short nPolyFillMode, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the value that determines how a polygonal annotation with crossing lines is filled.

This method affects only polygon objects. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetFillMode method, AnnGetPolyFillMode method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetPredefinedMetafile method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetPredefinedMetafile(short nType, long hMetafile);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Changes a predefined metafile.

This function affects the Rubber Stamp tools, the Hotspot objects and the Freehand objects created by the Automation object. For example, if you replace the ANNMETAFILE_APPROVED default metafile with another metafile, then objects created by the automation mode when the ANNTOOL_STAMP_APPROVED tool is set will look like the new metafile.

A predefined metafile can be reset to its original metafile by passing NULL for hMetafile. For example, to reset the Hotspot and Freehand Hotspot predefined metafiles to their original value, do the following:

AnnSetPredefinedMetafile(ANN_METAFILE_HOTSPOT, 0);

See Also

Elements | AnnGetPredefinedMetafile method, AnnGetMetafile method, AnnSetMetafile method, AnnGetEncryptOptions, AnnSetEncryptOptions, AnnEncryptApply, AnnGetSecondaryMetafile, AnnPredefinedRaster property, AnnGetPointOptions
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects


AnnSetProtractorOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetProtractorOptions(long hObject, VARIANT_BOOL bAcute, short nUnit, BSTR pszAbbrev, short nPrecision, float fArcRadius, VARIANT_BOOL bSelected);
Overview | Refer to Protractor Annotation Object

Remarks

(Document/Medical only) Sets various options for a Protractor object.

Note:

This method can be called for Container objects, allowing you to change Protractor objects within the container. The objects to change are determined by the settings in bSelected.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetProtractorOptions method, AnnGetAngle method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetROP2 method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetROP2(long hObject, short nROP2, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the binary raster operation (ROP2) code for one or more annotation objects. ROP2 codes specify how pen or brush colors are to be combined with the colors in the image.

The AnnSetROP2 method is valid only for the following object types:

Crossproduct

Curve

Closed Curve

Ellipse

Freehand Line

Freehand Hotspot

Line

Pointer

Point

Polygon

Polyline

Polyruler

Protractor

Rectangle

Ruler

Stamp (including the Rubber Stamp tools)

Text Pointer

In addition, the Automation object stores ROP2 settings along with the other object default settings

The AnnSetROP2 method can be used to turn a simple rectangle into a hilite-type object. This is the only way to have a Hilite object that has different colors for border and interior. To do that, draw a rectangle with a thick border, choose different foreground and background colors (using the AnnSetForeColor method and the AnnSetBackColor method), and call this method with nROP2 set to ANN_ROP2_AND.

Note that AnnSetROP2 method and the AnnSetFillModeExt method affect each other. If you set nFillMode to ANN_MODE_OPAQUE, then nROP2 cannot be ANN_ROP2_AND. If you set nFillMode to ANN_MODE_TRANSLUCENT, then nROP2 has to be ANN_ROP2_AND. If you set nFillMode to ANN_MODE_TRANSPARENT, nROP2 can be anything.

Use the AnnGetROP2 method to obtain the ROP2 code being used for one or more annotation objects.

When working with automated annotations, note that it is possible to change the color of the pen that is used for highlighting and selecting by setting the AnnAutoHilightPen property for that automation object.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetROP2 method, AnnGetFillMode method, AnnSetFillMode method, AnnSetBackColor method, AnnSetForeColor method, AnnGetSelected method, AnnSetSelected method, AnnGetTransparent method, AnnSetTransparent method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Displaying and Manipulating Annotation Objects


AnnSetRotateOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetRotateOptions(long hObject, VARIANT_BOOL bShowRotateHandles, long lReserved, long lFlags, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the rotation options for the annotation object.

This function is one of the new functions being introduced as part of Version 14.5. Use this method to set the rotate options of any annotation object, including the automation object.

With the new rotate options, two rotate handles are displayed on a selected object. One of the handles is the "gripper" handle, which rotates the object when dragged. The other handle is the "center" handle, which determines the center of rotation. The center of rotation can be moved by dragging. The gripper handle can be moved anywhere by dragging.

The following figure illustrates a rotate by dragging the "gripper" handle:

The following figure illustrates moving the "center" handle:

The rotate handles can be reset to a default location by right-clicking the annotation object, and selecting the Reset Rotate Handles option, as shown in the following figure:

The rotate handles can be globally hidden or displayed by right-clicking on the image (not an annotation object), and selecting the Hide Rotate Handles For All Objects option, as shown in the following figure:

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_ROTATE flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnGetRotateOptions method, AnnShowRotateHandles property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | New Annotation Features of Version 14.5


AnnSetScalarX method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetScalarX(long hObject, float fScalarX, VARIANT_BOOL bSelected);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Sets the horizontal scaling factor that is applied to the annotation object. Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the AnnSetOffsetX and AnnSetOffsetY methods, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

The value of the AnnContainer property cannot be passed for the hObject parameter.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetScalarY method, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetX method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Autoamtion
 | Fixed Annotations


AnnSetScalarY method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetScalarY(long hObject, float fScalarY, VARIANT_BOOL bSelected);
Overview | Refer to Low-Level Coordinate System for Annotations.

Remarks

(Document/Medical only) Sets the vertical scaling factor that is applied to the annotation object. Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the AnnSetOffsetX and AnnSetOffsetY methods, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

The value of the AnnContainer property cannot be passed for the hObject parameter.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetScalarX method\, AnnGetScalarX method, AnnGetScalarY method, AnnSetOffsetX method, AnnSetOffsetY method, AnnGetOffsetY method, AnnGetOffsetX method, AnnFixed property, AnnPushFixedState method, AnnPopFixedState method, AnnIsFixedRect property
Topics | Annotations (Document/Medical only): Autoamtion
 | Fixed Annotations


AnnSetSecondaryBitmap method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetSecondaryBitmap(long hObject, ILEADRaster *pRaster, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the secondary bitmap used by the specified annotation object.

Only PushPin objects use a secondary bitmap.

A pushpin object has a primary bitmap, (manipulated using AnnSetBitmap/AnnGetBitmap) when the text is shown, and a secondary bitmap, changed using AnnSetSecondaryBitmap. The primary bitmap is shown with the note text. The secondary bitmap is shown by itself when the note is minimized.

In design mode, the PushPin object shows the text and displays the primary bitmap. In run mode, the object shows/hides the text when clicked. The pushpin object has the active mode property. When the mode is ANN_ACTIVE_ENABLED, the text is shown and the primary bitmap is painted in the top-left corner of the note.

When the mode is ANN_ACTIVE_DISABLED, the text is hidden and the secondary bitmap is displayed.

See Also

Elements | AnnGetSecondaryBitmap method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects


AnnSetSelected method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetSelected(long hObject, VARIANT_BOOL bValue, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

Sets the Selected property for one or more annotation objects.

See Also

Elements | AnnCreate method, AnnDefine, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetVisible method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnSetShowFlags method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetShowFlags(long hObject, short nShowFlags, VARIANT_BOOL bSelected);
Overview | Refer to Crossproduct Annotation Object.

Remarks

(Document/Medical only) Determines how the rulers will be displayed.

This method can be called for Ruler, Cross-Product, PolyRuler, Protractor and Automation objects.

For Protractor objects, the default value for nShowFlags is 0. For Ruler, Polyruler, and Cross-Product objects, the default value for nShowFlags is ANN_SHOW_LENGTH | ANN_SHOW_TICMARKS.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetShowFlags method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetTag method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetTag(long hObject, long nTag);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Assigns a numeric tag to identify an annotation object. You can use the AnnGetTag method to get the tag.

You can use these two methods to keep track of particular objects such as buttons or hot spots over time.

When you load a file, an OnAnnCreate event is generated for each annotation. You can add code in this event to see which tags are already used in a file.

See Also

Topics:

Annotations (Document/Medical only): Object Manipulation


AnnSetText method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetText(long hObject, BSTR pszText, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the text (character string) of one or more annotation objects.

This method does not affect objects that do not have this property or that do not let you change the property. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

This method can be used to load unformatted text into an ANN_OBJECT_RTF object. To load rich text into an ANN_OBJECT_RTF object, see the documentation for AnnRTFText.

See Also

Elements | AnnAutoSnapCursor property, AnnGetText method, AnnGetAutoText method, AnnSetAutoText method
Topics | Annotations (Document/Medical only): Object Manipulation


AnnSetTextOptions method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetTextOptions(long hObject, VARIANT_BOOL bShowText, VARIANT_BOOL bShowBorder, OLE_COLOR crText, long lReserved, long lFlags, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the text options for the annotation object.

Use this method to set the text options of any annotation object that uses text. These options include changing the text color so that it is different form the border color and optionally showing or hiding the text. For the ANN_OBJECT_TEXT and the ANN_OBJECT_STAMP objects you can also optionally show or hide the border.

The hObject parameter must be one of the following types:

ANN_OBJECT_CONTAINER

ANN_OBJECT_AUTOMATION

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_STAMP

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

ANN_OBJECT_BUTTON

Otherwise ERROR_FEATURE_NOT_SUPPORTED is return.

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_TEXT_OPTIONS flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetTextOptions method, AnnSetText method, AnnGetText method, AnnTextAlign property, AnnTextRotate property, AnnSetOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnShowBorder property, AnnTextColor property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnSetTransparent method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetTransparent(long hObject, VARIANT_BOOL bTransparent, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted.

The AnnSetTransparent method is valid only for the following object types when they are using a bitmap:

ANN_OBJECT_POINT

ANN_OBJECT_STAMP

In addition, the Automation object stores transparency settings along with the other object default settings

Call the AnnSetTransparent method to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF).

When this method is applied to an automation object, it indicates whether the next bitmap object created will be transparent.

When an object has a bitmap with a region and the object is transparent, the inside of the region is considered non-transparent. If the bitmap has no region, and the object is transparent, a region is created from all the pixels that are not the transparent color.

Call the AnnSetTransparentColor method to set the color to be used as the transparent color. Call the AnnGetTransparent method to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the AnnGetTransparentColor method to get a value that indicates which color is being used as the transparent color.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetTransparent method, AnnGetSelected method, AnnSetSelected method, AnnGetROP2 method, AnnSetROP2 method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Displaying and Manipulating Annotation Objects
 | Implementing Transparency


AnnSetTransparentColor method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetTransparentColor(long hObject, OLE_COLOR crTransparent, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets the transparent color. A transparent color is not painted when the image is painted. For information on how LEADTOOLS uses colors, refer to Using Color Values in LEADTOOLS.

The AnnSetTransparentColor method is valid only for the following object types when they are using a bitmap:

Point

Stamp (including the Rubber Stamp tools)

In addition, the Automation object stores transparent color settings along with the other object default settings

This transparent color is used only if the object is set to transparent using the AnnSetTransparent method.

By default, the transparent color is white (0x00FFFFFF).

If hObject is a container object, then bSelected indicates which objects to process. If hObject is an automation object, all objects created by this automation object will have this transparent color.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

Call the AnnSetTransparent method to set such objects to use a transparent color. Call the AnnSetTransparentColor method to set the color to be used as the transparent color. Call the AnnGetTransparent method to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the AnnGetTransparentColor method to determine which color is being used as the transparent color.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetTransparentColor method, AnnSetTransparent method
Topics | Annotations (Document/Medical only): Bitmap
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Getting and Setting Color Properties
 | Using Color Values in LEADTOOLS
 | Displaying and Manipulating Annotation Objects
 | Implementing Transparency


AnnSetUnit method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetUnit(long hObject, short nUnit, BSTR pszUnitAbbrev, short nPrecision, VARIANT_BOOL bSelected);
Overview | Refer to Ruler Annotation Object.

Remarks

(Document/Medical only) Sets the unit of measurement for objects that use rulers.

The following annotation objects utilize one or more rulers as part of the annotation:

ANN_OBJECT_RULER

ANN_OBJECT_POLYRULER

ANN_OBJECT_PROTRACTOR

ANN_OBJECT_CROSSPRODUCT

In addition, the Automation object stores ruler settings along with the other object default settings.

The default unit of measure for ruler, polyruler, and crossproduct objects is smart English. With the smart units, the unit changes with the length. For example, if the length is 11 inches (assuming the default precision of 2 is being used), "11.00 in" displays whereas if the length is 15 inches, "1 ft 3.00 in" displays. Call the AnnSetUnit method to set the unit of measurement and its precision for the ruler. The precision indicates how many digits to display to the right of the decimal point in the length. Call the AnnGetUnit method to fill the AnnUnit Property with the unit of measurement and its precision for the ruler. The AnnGetDistance2 method gets the length of each ruler that makes up an object, and the total length of all rulers.

Refer to AnnAutomation property.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, AnnGetUnit method, AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnGetDistance method, AnnGetGaugeLength method, AnnTicMarkLength property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnSetUser method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetUser(long hObject, BSTR pOldUser, BSTR pNewUser, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotation Security.

Remarks

Sets the user string for the specified object.

If the specified object does not have a specified user, set pOldUser to NULL and set pNewUser to the new user string.

To change an object’s user, set pOldUser to the old user string and set pNewUser to the new user string. For any object having a specified user, you must know the old user string in order to change the user.

You can change an object from having a specified user to having no user by setting pOldUser to the old user string and setting pNewUser to NULL.

Please note that when using bSelected to change the user on more than one object, only those objects with a user set to pOldUser will be changed. For example, if you set pOldUser to "YourObject" and set pNewUser to "MyObject", and set bSelected to TRUE, only those objects having user "YourObject" will be changed. Objects with other users, or with NULL users will not be modified.

See Also

Elements: | AnnLock method, OnAnnLocked event, OnAnnUnlocked event, AnnUnlock method
Topics: | Annotations (Document/Medical only): Annotation Security


AnnSetUserData method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetUserData (long hObject, ILEADRasterVariant *pData)
Overview | Refer to Implementing Annotations.

Remarks

Use this Method to associate user-defined data with ANY annotation object. User data can be binary or text data, and can be any length. When the annotation object is copied, any user data is also copied. When saving the annotation (AnnSave, AnnSaveMemory), the user data is saved.

You must set Flags property before set this method and the Possible values for Flags Property for this property is:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

See Also

Elements: | AnnAutoSnapCursor property, Flags property, AnnAutoCursor property, AnnGetUserData method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSetVisible method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnSetVisible(long hObject, VARIANT_BOOL bVisible, short iFlags, BSTR pszUserList);
Overview | Refer to Implementing Annotations.

Remarks

When an object is not visible, it cannot be displayed. Some objects (notably containers) may be transparent, but if their visible-object property is VARIANT_TRUE, a user can select them with a mouse.

This method applies to multiple and selected objects based on values of the iFlags parameter.

To make objects belonging to a user visible, you must set ANN_FLAG_USER in iFlags, pass the user name in pszUserList, and set bVisible to VARIANT_TRUE.

See Also

Elements | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnCreate method, AnnDefine, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnSetWnd method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSetWnd(long hObject, long hWnd);
Overview | Refer to Container Annotation Object.

Remarks

(Document/Medical only) Sets the window handle for all objects.

Set this property on the root container, and all objects in the container inherit the property.

The value of the AnnContainer property cannot be passed for the hObject parameter.

See Also

Elements: | AnnGetWnd method
Topics: | Annotations (Document/Medical only): Automation


AnnTextEdit method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnTextEdit(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Causes a text-based annotation to enter edit mode.

This method causes a text-based annotation to enter edit mode, which displays an edit window for direct entry of text. Calling this method allows a user to programmatically force an object into edit mode—an action that is normally available in automation mode when creating or double-clicking text-based annotations.

It can be used with any of the text-based annotations including:

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

ANN_OBJECT_RTF

A successful call to the AnnSetText method affects hObject in the following way:

If hObject is not selected, hObject becomes selected, and all other objects become unselected.

If hObject is already selected, then the selection state of all objects is unchanged.

If hObject is one of several objects selected, then the selection state of all objects is unchanged.

Only one object can be in text edit mode. Therefore, if another text object is in text edit mode (hObject2), calling the AnnTextEdit method will get hObject2 out of the text edit mode and put hObject into the text edit mode.

This method will fail with ERROR_AUTOMATION_INV_HANDLE if hObject is not contained in the root container and if it is not in the automated mode. This method works only with the following objects:

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

ANN_OBJECT_RTF

If you pass an object that is not one of these types, the method will return ERROR_INV_PARAMETER.

See Also

Elements: | AnnGetText method, AnnGetAutoText method, AnnSetAutoText method, AnnRTFText property, AnnTextAlign property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnUndo method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnUndo (void);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Reverses the last change that was made using automated annotations.

The number of automation operations that can be undone is contained in the AnnUndoDepth property.

For information about grouping multiple operations into a single undo process, refer to the AnnAddUndoNode method.

Calling this method is the same as selecting Undo on the automation menu.

See Also

Elements: | AnnUndoEnable property, AnnUndoDepth property, AnnAddUndoNode method
Topics: | Annotations Automation
 | Undoing Automation Operations


AnnUngroup method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnUngroup(long hObject, short iFlags, BSTR pszUserList);
Overview | Refer to Implementing Annotations.

Remarks

Ungroups a group of objects.

See Also

Elements | AnnGroup method, AnnGetGrouping method, AnnSetGrouping method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


AnnUnlock method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnUnlock(long hObject, BSTR pszKey);
Overview | Refer to Implementing Annotation Security.

Remarks

(Document/Medical only) Unlocks annotations with the specified key. Use the same key used in AnnLock method. The key is case sensitive!

See Also

Elements: | AnnLock method
Topics: | Annotations (Document/Medical only): Annotation Security


AnnUnrealize method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnUnrealize(long hObject, VARIANT_BOOL bSelected);
Overview | Refer to Implementing Annotations

Remarks

(Document/Medical only) Restores the background of a redact object. This method is valid only for redact or container objects. When you call AnnRealize and specify RedactOnly, for every Redact object, the background of the image behind is saved inside the object. You can restore that background by calling AnnUnrealize. AnnUnrealize will restore the background from a redact object that contains a background bitmap. The background of a locked object cannot be restored until the object is unlocked. If hObject is a container, then bSelected indicates whether all the Redact objects included in the container should be restored, or if only selected objects should be restored. If hObject is a Redact object, bSelected is ignored.

Note: When AnnRealize method is called, if all objects are realized, any Redact objects that are realized cannot be unrealized.

See Also

Elements | AnnRealize method, AnnUnlock method
Topics | Annotations (Document/Medical only): Object Manipulation
 | Displaying and Manipulating Annotation Objects


SetMousePos method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetMousePos (float x, float y, VARIANT_BOOL bUpdatePos);
Overview | Refer to Implementing Annotations.

Remarks

Sets the coordinates for the automation object to use when processing mouse messages and changes the position of the cursor.

This method can be called while processing the AnnMouseXXX events.

See Also

Elements:

AnnMouseDown event, AnnMouseMove event, AnnMouseUp event


AnnAlpha property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnAlpha
Overview | Refer to Implementing Annotations

Remarks

(Read Only) (Document/Medical only) Gets the object’s alpha value. This is only valid if the AnnFillMode property is set to ANN_FILLMODE_ALPHA. Possible values range from 0 – 255 where:

Value | Meaning
0 | Transparent background
255 | Opaque background.

This property is updated by the AnnGetFillModeExt method.

See Also

Elements: | AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnAutoSnapCursor property, AnnSetFillMode method, AnnGetFillMode method, AnnGetFillModeExt method, AnnSetFillModeExt method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnGetROP2 method, AnnSetROP2 method, AnnSetBackColor method, AnnSetForeColor method, AnnFillMode property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation.


AnnAutoCursor property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | LPPICTUREDISP AnnAutoCursor (long uItem)
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets one of the cursors associated with automated annotations.

Read the AnnError property to check for errors.

In version 14.5 of LEADTOOLS, many changes to annotations have been introduced. These include displaying rotation handles on objects in design mode, displaying side handles on rectangular objects in design mode, and displaying different cursors for each of the annotation tools and when hovering over handles in design mode. To maintain backward compatibility, the new features are disabled by default. To enable these features, call the AnnSetOptions method with the desired flags. To get the current Version 14.5 options, call the AnnGetOptions method. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnGetUserData method, AnnSetUserData method, AnnAutoHilightPen property, AnnError property, AnnSetOptions method, AnnGetOptions method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information
 | Annotations (Document/Medical only): Automation
 | New Annotation Features of Version 14.5


AnnAutoDialogFontSize property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnAutoDialogFontSize
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Contains the font size, in points, used to display the automation dialog boxes.

This property should be set when the font name is set. The font name can be set by calling AnnSetAutoText(ANN_AUTOTEXT_DIALOG_FONT, "New font name").

This property may be used to convert the annotation automation dialogs to another language. For more information, refer to Converting Annotation Automation Dialogs to Other Languages.

See Also

Elements | AnnAutoSnapCursor property, AnnSetAutoText method, AnnAutoHilightPen property
Topics | Annotations Automation
 | Obtaining Annotation Object Information


AnnAutoDrawEnable property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnAutoDrawEnable
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Enables or disables the default use of the left mouse button to draw an annotation object.

To implement the automated design mode for annotations, this property must be set to (VARIANT_TRUE), and the AnnUserMode property must be set to ANN_USERMODE_DESIGN.

Setting | Description
VARIANT_TRUE | The left mouse button can be used to draw objects.
VARIANT_FALSE | The automated functions of the left mouse button are disabled.

See Also

Elements | AnnAutoSnapCursor property, AnnAutoMenuEnable property, AnnUserMode property, AnnAutoHilightPen property
Topics | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information
 | Displaying and Manipulating Annotation Objects


AnnAutoHilightPen property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnAutoHilightPen
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets or sets the color of the pen that is used for highlighting. The default value is 0xFFFFFF (white).

Use the AnnAutoHilightPen property to change the color of the pen that is used for highlighting and selecting. More specifically, this pen is used in the following situations:

In automated annotation design mode, after selecting ANY tool and clicking and dragging the mouse to draw an outline. The outline is displayed using the highlight pen.

In automated annotation design mode, after choosing the Select tool and clicking on an existing annotation object. When the mouse is down, the selected object is displayed using the highlight pen.

The highlighting is implemented by taking the "exclusive-or" (XOR) of the highlight pen color and the underlying image.

The default highlight pen has an RGB value of 0xFFFFFF(white). This color works well for most images. However, images that have many mid-range gray colors will not effectively show a highlight. To understand why this is so, consider an image that contains only the color gray 0x808080. The highlight color will be determined by

Highlight Color = (0xFFFFFF) XOR (0x808080)

= 0x7F7F7F

The highlight color (0x7F7F7F) (gray) and the underlying image color (0x808080) (gray) are almost the same color, and nearly indistinguishable to the naked eye. In cases like this, the highlight will not be visible.

To avoid this, choose a different highlight pen color so that the XOR with the underlying color will give a result that is visibly different from the underlying color. A good choice is (silver). Using this color the highlight color will be determined as follows:

Highlight Color = (0xC0C0C0) XOR (0x808080)

= 0x404040

The resulting highlight color (0x404040) is another gray, but is more visible and stands out much more clearly against the underlying image color (0x808080), allowing for easy differentiation between the two.

Note that several of the automated mode annotation cursors are displayed using an XOR operation. For images with many mid-range grays, these cursors will not be visible. To avoid this, define new cursors and use the AnnAutoCursor property.

See Also

Elements: | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnSetAutoBackColor method, AnnGetBackColor method, AnnSetBackColor method, AnnAutoCursor property, AnnGetContainer method, AnnAutoDialogFontSize property, AnnAutoDrawEnable property, AnnAutoMenuEnable property, AnnGetAutoMenuItemEnable method, AnnAutoMenuItemEnable property, AnnGetAutoText method, AnnSetAutoDefaults method, AnnSetAutoText method, AnnUndoEnable property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Automation
 | Obtaining Annotation Object Information
 | Annotations (Document/Medical only): Getting and Setting Color Properties


AnnAutoMenuItemEnable property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | AnnMenuConstants AnnAutoMenuItemEnable
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Indicates whether the specified menu item has been enabled or disabled for the object. This property is updated by calling the AnnGetAutoMenuItemEnable method.

Possible values are:

Value | Meaning
ANN_MENU_ENABLED | Enable the menu item.
ANN_MENU_DISABLED | Disable the menu item.
ANN_MENU_DEFAULT | Enable or disable the menu item, based on the setting for the object type.

See Also

Elements: | AnnSetAutoMenuItemEnable method, AnnAutoMenuEnable property, AnnGetAutoMenuItemEnable method, AnnAutoHilightPen property
Topics: | Obtaining Annotation Object Information


AnnAutoSnapCursor property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnAutoSnapCursor
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets or sets the behavior of the cursor location when creating annotations using automation in design mode. Possible values are:

Value | Meaning
TRUE | The cursor location will snap to on or within the annotation container.
FALSE | The cursor location is not restricted.

This property gets or sets the automation cursor behavior when clicking outside the container. It has no effect on the behavior of the cursor when clicking inside the container. When creating annotations using automation in design mode, the user first chooses an annotation tool. Next the user clicks the mouse in the window containing the image, either on or outside the container (annotation image).

If cursor snapping is enabled and the user clicks outside the container the cursor will "snap" to the container border, as shown in the following figure):

If cursor snapping is disabled and the user clicks outside the container but in the window, drawing of the annotation object begins with the annotation object outside of the container.

The default for behavior is to have cursor snapping enabled.

See Also

Elements: | AnnAutoCursor property, AnnSetUserData method, AnnGetUserData method, AnnRestrictCursor method, EnableRestrictToContainer property, AnnSetUserData method, AnnGetAutoBackColor method, AnnGetAutoMenuItemEnable method, AnnGetAutoText method, AnnUndoEnable property, AnnSetAutoBackColor method, AnnSetAutoDefaults method, AnnAutoMenuEnable property, AnnSetAutoMenuItemEnable method, AnnSetAutoText method
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnAutomation property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long AnnAutomation
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Is the handle to the annotation automation object in the current window.

This is the object that you can use with LEADTOOLS DLL functionality to implement automation and to set default properties.

See Also

Elements: | AnnContainer property
Topics: | Annotations (Document/Medical only): Automation


AnnAutoMenuEnable property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnAutoMenuEnable
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Enables or disables the pop-up menus that appear when you click the right mouse button on an annotation object.

Setting | Description
VARIANT_TRUE | Enables the pop-up menus.
VARIANT_FALSE | Disables the pop-up menus.

See Also

Elements | AnnAutoSnapCursor property, AnnAutoDrawEnable property, AnnUserMode property, AnnAutoHilightPen property
Topics | Annotations (Document/Medicalonly): Automation
 | Obtaining Annotation Object Information


AnnAutoText property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnAutoText
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the current text string. This property is updated by calling the AnnGetAutoText method.

See Also

Elements:

AnnSetAutoText method, AnnGetAutoText method


AnnAutoUpdate property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnAutoUpdate
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Indicates whether to automatically update annotations when the bitmap is changed. Possible values are:

Setting | Description
VARIANT_TRUE | Annotations are automatically updated when the bitmap is changed.
VARIANT_FALSE | Annotations are not automatically updated when the bitmap is changed.

Setting this property to TRUE will automatically update annotations when the bitmap undergoes the following changes:

Rotate
Deskew
Size
Flip
Reverse

The default value is VARIANT_TRUE.

See Also

Elements: | AnnParentRasterView property
Topics: | Annotations (Document/Medicalonly): Automation


AnnBoundingRectHeight property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnBoundingRectHeight(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Read only) (Document/Medical only) Gets the height of the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements | AnnRectHeight property, AnnRectLeft property, AnnBoundingRectLeft property, AnnRectTop property, AnnBoundingRectTop property, AnnRectWidth property, AnnBoundingRectWidth property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnBoundingRectLeft property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnBoundingRectLeft(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Read only) (Document/Medical only) Gets the left boundary of the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements | AnnRectHeight property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnBoundingRectTop property, AnnRectWidth property, AnnBoundingRectWidth property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnBoundingRectTop property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnBoundingRectTop(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Read only) (Document/Medical only) Gets the top boundary of the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements | AnnRectHeight property, AnnBoundingRectHeight property, AnnRectLeft property, AnnBoundingRectLeft property, AnnRectTop property, AnnRectWidth property, AnnBoundingRectWidth property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnBoundingRectWidth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnBoundingRectWidth(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Read only) (Document/Medical only) Gets the width of the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements | AnnRectHeight property, AnnBoundingRectHeight property, AnnRectLeft property, AnnBoundingRectLeft property, AnnRectTop property, AnnBoundingRectTop property, AnnRectWidth property
Topics | Annotations (Document/Medical only): Object Manipulation
 | Obtaining Annotation Object Information


AnnContainer property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long AnnContainer
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Is the handle to the annotation container for objects in the current window.

This is the root container, which you may need to specify when using LEADTOOLS DLL functionality for annotations.

The value of this property is VARIANT_FALSE if you have no annotations. Therefore, you can use it to check for the existence of annotations.

See Also

Elements | AnnAutomation property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects


AnnDistance property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | double AnnDistance
Overview | Refer to Implementing Annotations.

Remarks

(Read only) This property is updated with the length of the ruler in the object passed to the AnnGetDistance method. The unit of measure for the ruler is set by calling the AnnSetUnit method.

Please note the following:

  • If the annotation object passed to the AnnGetDistance method is type ANN_OBJECT_RULER, then the AnnGetDistance method returns the length of the ruler and this property is not updated.

  • If the annotation object passed to the AnnGetDistance method is type ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR or ANN_OBJECT_POLYRULER, then the method returns the length of the primary ruler and this property is updated with the length of the second ruler. (The AnnGetDistance method does not provide a means for getting the lengths of all rulers of a polyruler object. To get that information, AnnGetDistance2 must be called.)

  • For annotations of type ANN_OBJECT_CROSSPRODUCT, ANN_OBJECT_PROTRACTOR or ANN_OBJECT_POLYRULER, the AnnGetDistance2 method provides more information on the length of each ruler, the number of rulers, the unit of measure of each ruler and the total length of all rulers.

To determine the type of an annotation object, call the AnnGetType method.

See Also

Elements:

AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetUnit method, AnnSetGaugeLength method, AnnGetGaugeLength method, AnnGetDistance method


AnnEnableMagGlass property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnEnableMagGlass
Overview | Refer to Customizing Magnifying Glass Painting.

Remarks

Indicates whether annotation objects may be displayed using the magnifying glass. Possible values are:

Setting | Description
VARIANT_TRUE | Annotation objects can be displayed using the magnifying glass.
VARIANT_FALSE | Annotation objects cannot be displayed using the magnifying glass.

See Also

Elements: | AnnMagGlass method, EnableMagGlassDraw property, MagGlassOwnerDraw event
Topics: | Using the Magnifying Glass Implementing Annotations Raster Images: Displaying Images Annotations: Displaying Annotations
 | Using the Zoom View


AnnEnableZoomView property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnEnableZoomView
Overview | Refer to Using the Zoom View.

Remarks

Gets or sets a value that indicates whether annotation objects can be displayed using the zoom view. Possible values are:

Setting | Description
VARIANT_TRUE | Annotation objects can be displayed using the zoom view.
VARIANT_FALSE | Annotation objects cannot be displayed using the zoom view. This is the default value.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, DstLeft property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


AnnEncryptOptions property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterAnnEncryptOptions * AnnEncryptOptions;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the annotation encryption options.

This property is updated with the annotation encryption options when the AnnGetEncryptOptions method is called. To set annotation encryption options set this property with the desired encryption options, and then call the AnnSetEncryptOptions method.

See Also

Elements: | AnnEncryptApply method, AnnGetEncryptOptions method, AnnSetEncryptOptions method, EnableEncryptor property, Flags property, Key property, EnableNeverEncrypted property, EnableSaveDecryptorKey property, EnableSaveEncryptorKey property, EnableClearDecryptorKey property, EnableClearEncryptorKey property, EncryptRaster property, AnnGetSecondaryMetafile method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnError property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnError;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets any errors that occur in the following properties:

AnnRTFText

AnnTextAlign

AnnTextRotate

AnnTextPointerFixed

AnnTextExpandTokens

AnnPredefinedRaster

AnnRotateAngle

EnableRestrictToContainer

AnnFixed

AnnAutoCursor

AnnTicMarkLength

See Also

Elements: | AnnRTFText property, AnnTextAlign property, AnnTextRotate property, AnnTextPointerFixed property, AnnTextExpandTokens property, AnnPredefinedRaster property, AnnRotateAngle property, EnableRestrictToContainer property, AnnFixed property, AnnAutoCursor property, AnnTicMarkLength property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnFillMode property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnFillMode
Overview | Refer to Implementing Annotations

Remarks

(Read Only) (Document/Medical only) Gets the object's fill mode constant. Possible values are:

Value | Meaning
ANN_FILLMODE_TRANSPARENT | [0] Transparent
ANN_FILLMODE _TRANSLUCENT | [1] Translucent
ANN_FILLMODE_OPAQUE | [2] Opaque
ANN_FILL MODE_ALPHA | [3] Alpha

This property will be updated by the AnnGetFillModeExt method.

See Also

Elements: | AnnAlpha property, AnnAutoSnapCursor property, AnnCalibrateRuler method, AnnFillMode property, AnnGetFillModeExt method, AnnGetOptions method, AnnGetRotateOptions method, AnnGetTextOptions method, AnnSetFillModeExt method, AnnSetOptions method, AnnSetRotateOptions method, AnnSetTextOptions method, AnnShowBorder property, AnnShowRotateHandles property, AnnShowText property, AnnTextColor property, AnnTextEdit method, AnnAutoSnapCursor property, AnnSetFillMode method, AnnGetFillMode method, AnnGetFillModeExt method, AnnSetFillModeExt method, AnnSetFillPattern method, AnnGetFillPattern method, AnnSetFillMode method, AnnGetPolyFillMode method, AnnSetPolyFillMode method, AnnGetROP2 method, AnnSetROP2 method, AnnSetBackColor method, AnnSetForeColor method, AnnAlpha property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation.


AnnFixed property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnFixed ( long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the specified annotation object is fixed. Possible values are:

Value | Meaning
VARIANT_TRUE | The annotation object is fixed.
VARIANT_FALSE | The annotation object is not fixed.

The following annotations cannot be fixed:

ANN_OBJECT_CONTAINER

ANN_OBJECT_REDACT

ANN_OBJECT_ENCRYPT

You must set the Flags property before setting this property. Possible values for the Flags property, when used with this property, are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | Flags property, AnnFixed property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations


AnnHandle property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterAnnHandle * AnnHandle;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a user-defined annotation handle.

This property is updated with the user handle information when the AnnGetUserHandle method is called.

To add a new user handle to an annotation object, set this property with the desired handle information, and then call the AnnAddUserHandle method.

To change an existing user handle, call the AnnGetUserHandle method to get the current handle information. Set the desired values in this property and then call the AnnChangeUserHandle method.

A user handle can be deleted using the AnnDeleteUserHandle method.

See Also

Elements: | AnnGetUserHandle method, AnnAddUserHandle method, AnnChangeUserHandle method, AnnDeleteUserHandle method, ID property, ContainerX property, ContainerY property, ClientX property, ClientY property, EnableVisible property, PenColor property, FillColor property, Shape property, hCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnHitTestObject property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnHitTestObject
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the handle of the annotation object that is found at the specified point. This property is updated by calling the AnnHitTest method.

See Also

Elements:

AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectWidth property, AnnSelectRectHeight property, AnnSelectPoint method, AnnHitTest method


AnnHyperlinkMenuEnable property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARAINT_BOOL AnnHyperlinkMenuEnable
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) (Persistent property, available at design time) Enables or disables a hyperlink menu item provided for automated annotations. If AnnHyperlinkMenuEnable is VARIANT_TRUE, then the menu provided for automated annotations will contain an extra menu item when the right mouse button is clicked. If the user clicks on the extra menu item, the ILEADRasterAnnotation object will send an OnAnnHyperlinkMenu event.

See Also

Topics:

Annotations (Document/Medical only): Annotation Hyperlinks


AnnHyperlinkParam property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnHyperlinkParam
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the value that represents the param value of the hyperlink. This property is updated by calling the AnnGetHyperlinkParam method.

See Also

Elements:

AnnSetHyperlinkString method, AnnGetHyperlinkType method, AnnGetHyperlinkParam method


AnnHyperlinkString property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnHyperlinkString
Overview | Refer to Implementing Annotations.

Remarks

(Read only) String to be updated with a program name or a web page address, if the hyperlink type is ANN_LINK_RUN or ANN_LINK_WEBPAGE. If the hyperlink type is not ANN_LINK_RUN or ANN_LINK_WEBPAGE, this will be updated with a NULL string.

This property is updated by calling the AnnGetHyperlinkString method.

See Also

Elements:

AnnSetHyperlinkString method, AnnGetHyperlinkType method, AnnGetHyperlinkString method


AnnHyperlinkType property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnHyperlinkType
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the type of annotation hyperlink. This property is updated by calling the AnnGetHyperlinkType method.

Value | Meaning
ANN_LINK_NONE | [0] means that the object has no hyperlink
ANN_LINK_ANNEVENT | [1] means that WM_LTANNHYPERLINK message will be sent with no parameters.
ANN_LINK_ANNEVENT5 | [2] means that WM_LTANNHYPERLINK message will be sent with 2 parameters.
ANN_LINK_RUN | [3] that a program will be run.
ANN_LINK_WEBPAGE | [4] that the default browser will be instructed to go to the specified web page.

See Also

Elements:

AnnSetHyperlinkMsg method, AnnSetHyperlinkString method, AnnGetHyperlinkType method


AnnInfoFormat property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnInfoFormat
Overview | Refer to Annotation Files

Remarks

(Document/Medical only) (Read only) This property is updated with the annotation file type. Possible values are:

Value | Meaning
ANN_FMT_NATIVE | [0x0000] LEAD text-based format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
ANN_FMT_WMF | [0x0001] The Windows WMF format.
ANN_FMT_ENCODED | [0x0004] The LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.
ANN_FMT_XML | [0x0005] The XML text format. This is LEAD’s new text based format which is upward-compatible. It should be used instead of ANN_FMT_NATIVE.

Use the AnnFileInfo method, the AnnFileInfoArray method or the AnnFileInfoMemory method to update this property.

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnInfoVersion property, AnnInfoTotalPages property, AnnFileInfo method, AnnFileInfoArray method, AnnFileInfoMemory method
Topics | Annotations: Input and Output (Document/Medical only)


AnnInfoTotalPages property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnInfoTotalPages
Overview | Refer to Annotation Files

Remarks

(Read only) This property is updated with the total number of pages in the annotation file.

Use the AnnFileInfo method, the AnnFileInfoArray method or the AnnFileInfoMemory method to update this property.

See Also

Elements | AnnInfoVersion property, AnnInfoFormat property, AnnFileInfo method, AnnFileInfoArray method, AnnFileInfoMemory method
Topics | Annotations: Input and Output (Document/Medical only)
 | New Annotation Features of Version 14.5


AnnInfoVersion property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnInfoVersion
Overview | Refer to Annotation Files

Remarks

(Read only) This property is updated with the version of the annotation file. If ‘12’ is returned, this refers to version 12 or earlier (which could not be multi-page). There is support for multi-page annotation files beginning with version 13.

Use the AnnFileInfo method, the AnnFileInfoArray method or the AnnFileInfoMemory method to update this property.

See Also

Elements | AnnInfoFormat property, AnnInfoTotalPages property, AnnFileInfo method, AnnFileInfoArray method, AnnFileInfoMemory method
Topics | Annotations: Input and Output (Document/Medical only)
 | New Annotation Features of Version 14.5


AnnIsFixedRect property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnIsFixedRect (long hObject, long Left, long Top, long Right, long Bottom);
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Indicates whether there are any fixed annotations in the client rectangle (left, top, right and bottom). Possible values are:

Setting | Description
VARIANT_TRUE | There is a fixed annotation object in the client area.
VARIANT_FALSE | There are no fixed annotation objects in the client area.

You must set the Flags property before setting this property. Possible values for the Flags property, when used with this property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

See Also

Elements: | Flags property, AnnPopFixedState method, AnnPushFixedState method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations


AnnLocked property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnLocked
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Indicates whether the annotation object is locked. This property is updated by calling the AnnGetLocked method. Possible values are:

Value | Meaning
VARIANT_TRUE | Object is locked.
VARIANT_FALSE | Object is not locked.

See Also

Elements:

AnnLock method, AnnUnlock method, AnnShowLockedIcon property, AnnGetLocked method


AnnNameBoundingRectHeight property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameBoundingRectHeight(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read only) (Document/Medical only) Gets the width of the bounding rectangle of the name of the specified annotation object. This is the rectangle in which the object name is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameBoundingRectLeft property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameBoundingRectLeft(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read only) (Document/Medical only) Gets the left boundary of the bounding rectangle of the name of the specified annotation object. This is the rectangle in which the object name is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth propert, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameBoundingRectTop property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameBoundingRectTop(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read only) (Document/Medical only) Gets the top boundary of the bounding rectangle of the name of the specified annotation object. This is the rectangle in which the object name is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameBoundingRectWidth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameBoundingRectWidth(long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read only) (Document/Medical only) Gets the width of the bounding rectangle of the name of the specified annotation object. This is the rectangle in which the object name is displayed. The unit of measure is determined by the ScaleMode property.

The bounding rectangle is different from the defining rectangle as follows:

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the AnnRectXXX properties.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameOptions property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterAnnNameOptions * AnnNameOptions;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the annotation name options.

This property is updated with the annotation name options when the AnnGetNameOptions method is called. To set annotation name options set this property with the desired name options, and then call the AnnSetNameOptions method.

See Also

Elements: | AnnGetNameOptions method, AnnSetNameOptions method, Flags property, EnableShowName property, AnnotationName property, X property, Y property, EnableNameRestrict property, FaceNameColor property, BackNameColor property, EnableNameBackTransparent property, FontName property, EnableFontItalic property, EnableFontStrikeOut property, EnableFontUnderLine property, FontSize property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameRectHeight property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameRectHeight (long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read Only) (Document/Medical only) Contains the height of the name of the specified annotation object.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameRectLeft property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameRectLeft (long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read Only) (Document/Medical only) Contains the left boundary of the name of the specified annotation object. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameRectTop property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameRectTop (long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read Only) (Document/Medical only) Contains the top boundary of the name of the specified annotation object. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop property, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnNameRectWidth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnNameRectWidth (long hObject);
Overview | Refer to Moving the Name of an Annotation.

Remarks

(Read Only) (Document/Medical only) Contains the width of the name of the specified annotation object.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnNameBoundingRectLeft property, AnnNameBoundingRectTop property, AnnNameBoundingRectWidth property, AnnNameBoundingRectHeight property, AnnNameRectLeft property, AnnNameRectTop property, AnnNameRectWidth property, AnnNameRectHeight property, AnnBoundingRectLeft property, AnnBoundingRectTop propert, AnnBoundingRectWidth property, AnnBoundingRectHeight property, AnnRectLeft property, AnnRectTop property, AnnRectWidth property, AnnRectHeight property
Topics: | Annotations (Document/Medical only):Object Manipulation


AnnObject property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnObject
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the handle of an annotation object. This property is updated by calling the AnnCreate method.

Possible values are:

Value | Meaning
! NULL | Handle to the newly created annotation object.
NULL | An error occurred.

See Also

Elements:

AnnDefine method, AnnDestroy method, AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method, AnnCreate method


AnnPageMemorySize property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnPageMemorySize
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value used to track the size of the file in memory.

This property is updated by calling the AnnSaveMemory method.

See Also

Elements:

AnnDeletePage method, AnnDeletePageArray method, AnnLoadArray method, AnnLoadMemory method, AnnSaveMemory method, AnnLoad method, AnnSave method, AnnSaveArray method, AnnDeletePageMemory method


AnnParentRasterView property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnParentRasterView(ILEADRasterView *pRasterView);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) This property attaches the Annotation COM object to a LEAD RasterView control. this property must be set before using any of the LEAD Annotation COM Object methods or properties.

To remove the attachment, and subsequently destroy all annotations, set this property to 0, or Nothing in Visual Basic.

See Also

Topics:

Annotations (Document/Medical only): Automation


AnnPasteReady property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnPasteReady;
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Indicates whether the Windows clipboard contains annotation data that you can paste into the ILEADRasterAnnotation object.

See Also

Topics | Annotations (Document/Medical only): Using the Clipboard
 | Displaying and Manipulating Annotation Objects
 | New Annotation Features of Version 14.5


AnnPointCount property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnPointCount
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the number of vertices (corner points) in the annotation object. This property is updated by calling the AnnGetPointCount method.

See Also

Elements:

AnnGetPointX method, AnnGetPointY method, AnnGetPointCount method


AnnPointOptions property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterAnnPointOptions * AnnPointOptions;
Overview | Refer to Implementing Annotations.

Remarks

Remarks:

Gets or sets the annotation point options.

This property is updated with the annotation point options when the AnnGetPointOptions method is called. To set annotation point options set this property with the desired point options and then call the AnnSetPointOptions method.

See Also

Elements: | AnnGetPointOptions method, AnnSetPointOptions method, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnPrecision property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnPrecision
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the number of digits to be displayed after the decimal place. This property is updated by calling the AnnGetUnit method.

See Also

Elements: | AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnGetUnit method
Topics: | Using Rulers in Annotation Objects


AnnPredefinedMetafileEnhanced property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnPredefinedMetafileEnhanced
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates whether the retrieved metafile is enhanced. This property is updated by calling the AnnGetPredefinedMetafile method.

Possible values are:

Value | Meaning
TRUE | The retrieved metafile is an enhanced metafile.
FALSE | The retrieved metafile is a windows metafile.

See Also

Elements:

AnnSetPredefinedMetafile method, AnnGetMetafile method, AnnSetMetafile method, AnnGetPredefinedMetafile method


AnnPredefinedRaster property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRaster AnnPredefinedRaster (long uType);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a copy of the specified predefined bitmap. This function is valid only for the ANN_OBJECT_POINT object.

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | AnnGetMetafile method, AnnSetMetafile method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Displaying Annotations
 | Annotations (Document/Medical only): Annotation Object Bitmap
 | Using Annotation Bitmap Objects
 | Obtaining Annotation Object Information


AnnProtractorAcute property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnProtractorAcute
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates whether the inside angle or the outside angle of the protractor is being drawn. Possible values are:

Setting | Description
True | The inside (acute) angle of the protractor is being drawn.
False | The outside (obtuse) angle of the protractor is being drawn.

This property is updated by calling the AnnGetProtractorOptions method.

See Also

Elements:

AnnSetProtractorOptions method, AnnGetAngle method, AnnGetProtractorOptions method


AnnProtractorArcRadius property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | double AnnProtractorArcRadius
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates the length of the arc radius.

This property is updated by calling the AnnGetProtractorOptions method.

See Also

Elements:

AnnSetProtractorOptions method, AnnGetAngle method, AnnGetProtractorOptions method


AnnProtractorPrecision property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | shot AnnProtractorPrecision
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates the number of digits after the decimal. ( "." ) Valid values are 0 – 200.

This property is updated by calling the AnnGetProtractorOptions method.

See Also

Elements:

AnnSetProtractorOptions method, AnnGetAngle method, AnnGetProtractorOptions method


AnnProtractorUnit property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnProtractorUnit
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates whether the unit of measurement for the angle is degrees or radians.

The updated values are:

Value | Meaning
ANN_ANGLE_DEGREES | The angle is measured in degrees. The default abbreviation for this unit is the degree sign.
ANN_ANGLE_RADIANS | The angle is measured in radians. The default abbreviation for this unit is "rad".

This property is updated by calling the AnnGetProtractorOptions method.

See Also

Elements:

AnnSetProtractorOptions method, AnnGetAngle method, AnnGetProtractorOptions method


AnnRectHeight property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnnRectHeight(long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Contains the height of the specified annotation object.

This property lets you resize an annotation object.

Point objects cannot be resized.

Objects with a height of zero (horizontal lines or pointers, or freehand objects for which all points are on a horizontal line) cannot have their height changed.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnRectLeft property. AnnRectTop property, AnnRectWidth property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnRectLeft property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnnRectLeft (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Contains the left boundary for the specified annotation object.

This property lets you reposition an annotation object.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnRectHeight property. AnnRectTop property, AnnRectWidth property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnRectTop property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnnRectTop (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Contains the top boundary for the specified annotation object.

This property lets you reposition an annotation object.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnRectHeight property. AnnRectLeft property, AnnRectWidth property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnRectWidth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnnRectWidth (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Contains the width of the specified annotation object.

This property lets you resize an annotation object.

Point objects cannot be resized.

Objects with a width of zero (vertical lines or pointers, or freehand objects for which all points are on a vertical line) cannot have their width changed.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnRectHeight property. AnnRectLeft property, AnnRectTop property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnRotateAngle property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | double AnnRotateAngle (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the rotation angle for an annotation object.

The angle is in radians, and uses the following convention.

The possible range of rotate values is (-Pi) ... (Pi)

A rotation in the clockwise direction is considered a positive rotation.

A rotation in the counter-clockwise direction is considered a negative rotation.

For example, if a rectangle is rotated 90 degrees in the counter clockwise direction, this property will get (-PI/2) for the rotation angle. If a rectangle is rotated 90 degrees in the clockwise direction, this property will get PI/2 for the rotation angle. If a rectangle is rotated 270 degrees in the counter clockwise direction, this is equivalent to 90 degrees in the clockwise direction so the rotation value returned is PI/2.

This property is only valid for the following annotation object types:

ANN_OBJECT_POINTER

ANN_OBJECT_LINE

ANN_OBJECT_RULER

ANN_OBJECT_AUDIO

ANN_OBJECT_BUTTON

ANN_OBJECT_ELLIPSE

ANN_OBJECT_HILITE

ANN_OBJECT_HOTSPOT

ANN_OBJECT_NOTE

ANN_OBJECT_RECT

ANN_OBJECT_REDACT

ANN_OBJECT_STAMP

ANN_OBJECT_TEXT

ANN_OBJECT_VIDEO

ANN_OBJECT_PUSHPIN

ANN_OBJECT_ENCRYPT

If hObject is not one of the annotation object types listed above, an error will be set in the AnnError property.

See Also

Elements: | AnnHitTestExt method, EnableRestrictToContainer property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnRTFText property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR AnnRTFText (long hObject, long uFormat);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the text (unformatted text or rich text) of an ANN_OBJECT_RTF or ANN_OBJECT_AUTOMATION annotation object.

You must set the Flags property before setting this property. Possible values for the Flags Property, when used with this property, are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | AnnTextEdit method, Flags property, AnnGetText method, AnnSetText method, AnnGetAutoText method, RTFTextLength property, AnnSetAutoText method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnSelectCount property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnSelectCount
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the number of currently selected annotation objects. This property is updated by calling the AnnGetSelectCount method.

See Also

Elements:

AnnGetSelectList method, AnnGetSelectCount method


AnnSelectRectHeight property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnSelectRectHeight(long hContainer);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) (Read Only) Contains the height of the rectangle in the current window that surrounds all selected annotation objects.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectTop property, AnnSelectRectWidth property
Topics: | Annotations (Document/Medical only): Automation


AnnSelectRectLeft property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnSelectRectLeft(long hContainer);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) (Read Only) Contains the left boundary for the rectangle in the current window that surrounds all selected annotation objects.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnSelectRect method, AnnSelectRectTop property, AnnSelectRectWidth property, AnnSelectRectHeight property
Topics: | Annotations (Document/Medical only): Automation


AnnSelectRectTop property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnSelectRectTop(long hContainer);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) (Read Only) Contains the top boundary for the rectangle in the current window that surrounds all selected annotation objects.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectWidth property, AnnSelectRectHeight property
Topics: | Annotations (Document/Medical only): Automation


AnnSelectRectWidth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | float AnnSelectRectWidth(long hContainer);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) (Read Only) Contains the width of the rectangle in the current window that surrounds all selected annotation objects.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AnnSelectRect method, AnnSelectRectLeft property, AnnSelectRectTop property, AnnSelectRectHeight property
Topics: | Annotations (Document/Medical only): Automation


AnnShowBorder property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnShowBorder;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) (Document/Medical only) Boolean value that indicates whether you want to show the border. Possible values are:

Value | Meaning
TRUE | Show the border.
FALSE | Do not show the border.

See Also

Elements: | AnnAutoSnapCursor property, AnnSetTextOptions method, AnnGetTextOptions method, AnnSetText method, AnnGetText method, AnnTextAlign property, AnnTextRotate property, AnnSetOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnTextColor property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnShowLockedIcon property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnShowLockedIcon
Overview | Refer to Implementing Annotation Security.

Remarks

(Document/Medical only) (Persistent property, available at design time) Indicates how locked objects should be drawn. If this property is VARIANT_TRUE, then all locked objects are drawn with a padlock icon on top. If this property is 0, the locked objects are drawn the same way as the unlocked objects.

See Also

Elements | AnnLock method, OnAnnLocked event, OnAnnUnlocked event, AnnUnlock method
Topics | Annotations (Document/Medical only): Annotation Security
 | Displaying and Manipulating Annotation Objects


AnnShowNodes property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnShowNodes
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets a value that indicates whether to show the nodes. This property is updated by calling the AnnGetNodes method.

Value | Meaning
TRUE | Show nodes
FALSE | Do not Show nodes

See Also

Elements:

AnnSetNodes method, AnnGetNodes method


AnnShowRotateHandles property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnShowRotateHandles
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) (Read Only) Flag that indicates whether the annotation rotate handles are shown or hidden. Possible values are:

Value | Meaning
TRUE | The annotation object rotate handles are shown.
FALSE | The annotation object rotate handles are shown hidden.

The default value for AnnShowRotateHandles property is FALSE, which means that when an object is selected it will not show rotate handles. This function is one of the new functions being introduced as part of Version 14.5.

Note:

In Version 14.5, you need to first enable this function by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_ROTATE flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements: | AnnGetRotateOptions method, AnnSetRotateOptions method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | New Annotation Features of Version 14.5


AnnShowText property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnShowText;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) (Document/Medical only) Boolean value that indicates whether you want to show the text. Possible values are:

Value | Meaning
TRUE | Show the text.
FALSE | Do not show the text.

See Also

Elements: | AnnAutoSnapCursor property, AnnSetTextOptions method, AnnGetTextOptions method, AnnSetText method, AnnGetText method, AnnTextAlign property, AnnTextRotate property, AnnSetOptions method, AnnFillMode property, AnnAlpha property, AnnShowBorder property, AnnTextColor property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnTag property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnTag
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the current annotation tag. This property is updated by calling the AnnGetTag method.

See Also

Elements: | AnnGetTag method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnTagObject property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnTagObject
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the handle of the annotation object that has the specified tag. This property is updated by calling the AnnGetObjectFromTag method.

Possible values are:

Value | Meaning
NULL | An object with the specified tag was not found.
! NULL | Handle to the annotation object that has the tag specified in lTag.

See Also

Elements:

AnnGetTag method, AnnSetTag method, AnnGetObjectFromTag method


AnnTextAlign property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnTextAlign (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the text alignment of the specified annotation. Possible values are:

Value | Meaning
TEXT_ALIGN_LEFT | [1] Align text to left.
TEXT_ALIGN_CENTER | [2] Center the text.
TEXT_ALIGN_RIGHT | [3] Align text to the right.

This property is valid only for the following annotation objects:

ANN_OBJECT_AUTOMATION

ANN_OBJECT_NOTE

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

You must set the Flags property before setting this property. Possible values for the Flags property for this property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | AnnAutoSnapCursor property, AnnTextEdit method, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnTextColor property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR AnnTextColor;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) (Document/Medical only) An OLE_COLOR property that represents the color to be used for the text.

See Also

Elements: | AnnAutoSnapCursor property, AnnSetTextOptions method, AnnGetTextOptions method, AnnSetText method, AnnGetText method, AnnTextAlign property, AnnTextRotate property, AnnSetOptions method, AnnFillMode property, AnnAlpha property, AnnShowText property, AnnShowBorder property
Topics: | New Annotation Features of Version 14.5
 | Annotations (Document/Medical only): Object Manipulation


AnnTextExpandTokens property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnTextExpandTokens (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the annotation object's text tokens will expand. Possible values are:

Setting | Description
VARIANT_TRUE | Text tokens will be expanded for this object.
VARIANT_FALSE | Text tokens will not be expanded for this object.

This property is valid only for the following annotation objects:

ANN_OBJECT_AUTOMATION

ANN_OBJECT_BUTTON

ANN_OBJECT_NOTE

ANN_OBJECT_PUSHPIN

ANN_OBJECT_STAMP

ANN_OBJECT_TEXT

ANN_OBJECT_TEXTPOINTER

Getting or setting this property for an annotation object other than ones listed above will set an error in the AnnError property.

If this property is VARIANT_TRUE, then all tokens will be expanded.

For example, if you have an ANN_OBJECT_BUTTON object that will expand text tokens, and #D is defined to be the current day of the week (ANN_TOKEN_DATE_DAY_OF_WEEK), then entering #D for the text of this button will cause it to display the current day of the week when in design or run mode.

You must set the Flags property before setting this property. Possible values for the Flags property, when used with this property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

See Also

Elements: | Flags property, AnnClearTokenTable method, AnnDeleteTokenTable method, AnnEnumerateTextToken method, AnnInsertTokenTable method
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnTextPointerFixed property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnTextPointerFixed (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates whether the pointer of an ANN_OBJECT_TEXTPOINTER object is fixed. Possible values are:

Setting | Description
VARIANT_TRUE | The pointer of the ANN_OBJECT_TEXTPOINTER object is fixed.
VARIANT_FALSE | The pointer of the ANN_OBJECT_TEXTPOINTER moves with the object.

If this property is updated with VARIANT_TRUE, the text pointer of the object is fixed. When the text pointer is fixed, the location that the text pointer points to does not change when moving the object (either programatically or through automation).

If this property is updated with VARIANT_FALSE, the text pointer of the object is not fixed. This means that when the object is moved, the location the text pointer points to moves along with the object.

Getting or setting this property for an object other an ANN_OBJECT_TEXTPOINTER object will result in an error being set in the AnnError property.

You must set the Flags property before setting this property. Possible values for Flags Property, when used with this property, are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

See Also

Elements: | Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnTextRotate property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long AnnTextRotate (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates whether the text of an annotation object is rotated, and if so, then by how many degrees. Possible values are:

Value | Meaning
TEX_TROTATE_0 | [0] Do not rotate the text.
TEX_TROTATE_90 | [90] The text is rotated 90 degrees counter clockwise.
TEX_TROTATE_180 | [180] The text is rotated 180 degrees counter clockwise.
TEX_TROTATE_270 | [270] The text is rotated 270 degrees counter clockwise.

This property is valid only for the following annotation objects:

ANN_OBJECT_AUTOMATION

ANN_OBJECT_NOTE

ANN_OBJECT_TEXTPOINTER

You must set the Flags property before setting this property. Possible values for the Flags property when using this property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError Property.

See Also

Elements: | AnnAutoSnapCursor property, Flags property
Topics: | Annotations (Document/Medical only): Object Manipulation


AnnTicMarkLength property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | double AnnTicMarkLength (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Gets and sets the length of the tic mark of the specified annotation object, if hObject specifies an ANN_OBJECT_RULER or an ANN_OBJECT_POLYRULER object. The tic marks are the perpendicular lines that measure the units.

The length of the tic mark is expressed in pixels, not in points. The length is for the whole line, not just from the intersection point with the ruler to the end point of the tic mark - it is from one end of the tic mark to the other end of the tic mark.

Note that a ruler can have tic marks of different lengths. For example, the ruler in the figure below has tic marks with several different lengths. In this case, this property is updated with the length of the longest tic mark.

You must set the Flags property before setting this property. Possible values for the Flags property for this property are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, Flags property, AnnSetUnit method, AnnGetUnit method, AnnGetDistance method
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


AnnTool property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnnToolConstants AnnTool
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Is the currently selected annotation tool. For a list of available values, refer to Annotation Toolbar Buttons.

See Also

Elements | AnnGetType method
Topics | Annotations (Document/Medical only): Automation
 | Using Rulers in Annotation Objects


AnnType property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | AnnObjectType AnnType
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the annotation type. This property is updated by calling the AnnGetType method. Possible values are:

Value | Meaning
ANN_OBJECT_CONTAINER | Container object
ANN_OBJECT_LINE | Line
ANN_OBJECT_RECT | Rectangle
ANN_OBJECT_ELLIPSE | Ellipse
ANN_OBJECT_POLYLINE | Polyline
ANN_OBJECT_POLYGON | Polygon
ANN_OBJECT_POINTER | Pointer
ANN_OBJECT_FREEHAND | Freehand Line
ANN_OBJECT_HILITE | Highlight
ANN_OBJECT_REDACT | Redaction
ANN_OBJECT_TEXT | Text
ANN_OBJECT_NOTE | Note
ANN_OBJECT_STAMP | Stamp
ANN_OBJECT_HOTSPOT | Hot spot
ANN_OBJECT_BUTTON | Button
ANN_OBJECT_AUDIO | Audio Clip
ANN_OBJECT_RULER | Ruler Tool
ANN_OBJECT_CROSSPRODUCT | Cross product Tool
ANN_OBJECT_POINT | Point Tool
ANN_OBJECT_PROTRACTOR | Protractor Tool
ANN_OBJECT_PUSHPIN | PushPin Tool
ANN_OBJECT_FREEHANDHOTSPOT | Freehand Hot Spot Tool

See Also

Elements:

AnnTool property, AnnGetType method


AnnUndoDepth property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnUndoDepth
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets or sets the undo level for the container object. It contains the length of the undo stack.

The undo level determines the number of automation operations that can be undone. The default value is 5.

This property should be set before calling the AnnAddUndoNode method.

See Also

Elements: | AnnUndoEnable property, AnnAddUndoNode method, AnnUndo method
Topics: | Annotations Automation
 | Undoing Automation Operations


AnnUndoEnable property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL AnnUndoEnable
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Enables or disables the undo mechanism for an automation object. Possible values are:

Value | Meaning
TRUE | Enable the undo mechanism for the specified automation object.
FALSE | Disable the undo mechanism for the specified automation object.

Please note that the undo stack is not changed. This is intended to temporarily disable the undo mechanism.

This property, along with the AnnAddUndoNode method can be used to combine multiple changes into a single undo call. For more information of this process, refer to the AnnAddUndoNode method.

See Also

Elements | AnnAutoSnapCursor property, AnnUndoDepth property, AnnAddUndoNode method, AnnUndo method, AnnAutoHilightPen property
Topics | Annotations Automation
 | Undoing Automation Operations


AnnUnit property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AnnUnit
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Gets the object's unit of measurement. This property is updated by calling the AnnGetUnit method. Possible values are:

Value | Meaning
ANN_UNIT_INCHES | [0x0000] inches
ANN_UNIT_FEET | [0x0001] feet
ANN_UNIT_YARDS | [0x0002] yards
ANN_UNIT_MICROMETERS | [0x0003] micrometers
ANN_UNIT_MILIMETERS | [0x0004] millimeters
ANN_UNIT_CENTIMETERS | [0x0005] centimeters
ANN_UNIT_METERS | [0x0006] meters
ANN_UNIT_TWIPS | [0x0007] twips
ANN_UNIT_POINTS | [0x0008] points
ANN_UNIT_PIXELS | [0x0009] pixels
ANN_UNIT_SMART_METRIC | [0x0010] Smart Metric
ANN_UNIT_SMART_ENGLISH | [0x0011] Smart English

See Also

Elements: | AnnSetGaugeLength method, AnnSetBitmapDpiX method, AnnGetBitmapDpiX method, AnnGetBitmapDpiY method, AnnSetBitmapDpiY method, AnnSetUnit method, AnnGetDistance method, AnnGetGaugeLength method, AnnGetUnit method
 | Using Rulers in Annotation Objects


AnnUserMode property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnnUserModeConstants AnnUserMode
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Sets or gets the current annotation mode.

The following are possible values:

Value | Meaning
ANN_USERMODE_DESIGN | The user can create annotations. In this mode, the toolbar is present, hot spots are visible, and popup menus can be activated with the right mouse button.
ANN_USERMODE_RUN | The user can view annotations and can activate hot spots, buttons, and audio clips. In this mode, hot spots are transparent.
ANN_USERMODE_NONE | Annotations are invisible.

See Also

Elements | AnnAutoMenuEnable property, AnnAutoDrawEnable property
Topics | Annotations (Document/Medical only): Automation
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information


AnnVisible property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL AnnVisible
Overview | Refer to Implementing Annotations.

Remarks

(Read only) Indicates whether the object is visible. This property is updated by calling the AnnGetVisible method.

Value | Meaning
VARIANT_TRUE | The specified object is visible.
VARIANT_FALSE | The specified object is not visible.

See Also

Elements:

AnnCreate method, AnnDefine method, AnnDestroy method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method


AutoSetTool property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoSetTool
Overview | Refer to Annotation Toolbar.

Remarks

Contains a value indicating if the annotation toolbar and the main annotation object are linked. Possible values are:

Value | Meaning
TRUE | Setting the AnnTool property of the ILEADRasterAnnotation object will also set the Tool property of the ILEADRasterAnnToolBar object and will update the annotation toolbar, if the bar has been created. Also, clicking on a button in the annotation toolbar will automatically set the AnnTool property of the ILEADRasterAnnotation object.
FALSE | The AnnTool property property of the ILEADRasterAnnotation object and the Tool property of the ILEADRasterAnnToolBar object are independent.

If you want to synchronize the AnnTool property property of the ILEADRasterAnnotation object and the Tool property of the ILEADRasterAnnToolBar object, you should set AutoSetTool to TRUE, or keep track of the currently selected tool by intercepting the OnAnnToolChecked event of the ILEADRasterAnnotation object.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapUp property, ButtonColumns property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, hWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects


BottomPreviousClip property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BottomPreviousClip;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the bottom boundary of the previous clip rectangle.

This property is updated by the AnnRestrictCursor method. Therefore, you must call the AnnRestrictCursor method before checking this property for the information.

See Also

Elements: | AnnRestrictCursor method, TopPreviousClip property, RightPreviousClip property, LeftPreviousClip property
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientPointX property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ClientPointX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets an array of X coordinates for one or more points to be converted. These values are in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

You must set the PointIndex property, in order to allocate adequate memory for the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY properties, before using any of these properties.

For more information on the conversion process, refer to AnnConvert method.

See Also

Elements: | AnnConvert method, ClientPointY property, ContainerPointX property, ContainerPointY property, PointsCount property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation


ClientPointY property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ClientPointY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets an array of Y coordinates for one or more points to be converted. These values are in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

You must set the PointIndex property, in order to allocate adequate memory for the ClientPointY, ClientPointX, ContainerPointX and ContainerPointY properties, before using any of these properties.

For more information on the conversion process, refer to AnnConvert method.

See Also

Elements: | AnnConvert method, ClientPointX property, ContainerPointX property, ContainerPointY property, PointsCount property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerPointX property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerPointX;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets an array of X coordinates for one or more points to be converted. These values are in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

You must set the PointIndex property, in order to allocate adequate memory for the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY properties, before using any of these properties.

For more information on the conversion process, refer to AnnConvert method.

See Also

Elements: | AnnConvert method, ClientPointY property, ClientPointX property, ContainerPointY property, PointsCount property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation


ContainerPointY property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContainerPointY;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets an array of Y coordinates for one or more points to be converted. These values are in container coordinates. Container coordinates are typically the same dimensions as the underlying bitmap, and are independent of zooming and scrolling.

You must set the PointIndex property, in order to allocate adequate memory for the ClientPointX, ClientPointY, ContainerPointY and ContainerPointX properties, before using any of these properties.

For more information on the conversion process, refer to AnnConvert method.

See Also

Elements: | AnnConvert method, ClientPointY property, ClientPointX property, ContainerPointY property, PointsCount property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation


Description property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR Description;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a character string that describes the token. This string appears on the text token table menu. For example, the string for token #0 in the default text token table is "Two Digit Month". The text token table menu is displayed by:

1. | Right-clicking on a Button, Note, PushPin, Rubber Stamp, Stamp, Text, or Text Pointer annotation object.
2. | Select Text option in menu that appears.
3. | Click the Insert Token button. A menu for the existing text token table appears, as shown in the following figure:
4. | Select the token to be inserted.

See Also

Elements: | EnumerateTextTokenTable event, Token property, TokenString property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


Distance property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | double Distance (long Index);
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets an array of values that represents the length of each ruler contained in the annotation object specified in the AnnGetDistance2 method.

To determine the unit of measure for each ruler, check the RulerUnit property and the SmartUnit property.

If the entry in RulerUnit (i) is ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the actual unit of measure can be found in SmartUnit(i). If RulerUnit (i) is not ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then both RulerUnit (i) and SmartUnit (i) contain the unit of measure.

See Also

Elements: | AnnGetDistance2 method, TotalDistance property, TotalRulerUnit property, TotalSmartUnit property, RulerUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


DistanceCount property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | long DistanceCount;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the total number of rulers that make up the object. This property is updated by the AnnGetDistance2 method.

See Also

Elements: | AnnGetDistance2 method, TotalDistance property, TotalRulerUnit property, TotalSmartUnit property, RulerUnit property, SmartUnit property, Distance property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


EnableAdjust property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableAdjust;
Overview | Refer to Implementing Annotations.

Remarks

Specifies whether the annotation will be automatically adjusted when changing the fixed states. Possible values are:

Setting | Description
VARIANT_TRUE | The annotation object is automatically adjusted when changing the fixed state.
VARIANT_FALSE | The annotation object is not automatically adjusted when changing the fixed state.

Setting EnableAdjust to VARIANT_TRUE automatically adjusts the size and location of the object before fixing or un-fixing the annotation object. The result is the annotation object will not jump around as you change its fixed state.

If you set EnableAdjust to VARIANT_FALSE, the annotation object can move or resize if the annotation container has scalar values other than 1, or offset values other than 0.

See Also

Elements: | AnnFixed property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableFireEnumerateHandleEvent property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFireEnumerateHandleEvent;
Overview | Refer to Implementing Annotations.

Remarks

(Persistent property, available at design time) Enables or disables the generation of the OnEnumerateHandle Event. Possible values are:

Setting | Description
VARIANT_TRUE | Generate OnEnumerateHandle events.
VARIANT_FALSE | Don't generate OnEnumerateHandle events.

To discontinue generating EnumerateHandle event, set the StopFireEnumerateHandleEvent property to VARIANT_TRUE.

See Also

Elements: | StopFireEnumerateHandleEvent property, AnnEnumerateHandle method
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableFireEnumerateTextTokenTableEvent property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableFireEnumerateTextTokenTable;
Overview | Refer to Implementing Annotations.

Remarks

(Persistent property, available at design time) Enables or disables the generation of the OnEnumerateTextTokenTable Event. Possible values are:

Setting | Description
VARIANT_TRUE | Generate OnEnumerateTextTokenTable event.
VARIANT_FALSE | Don't generate OnEnumerateTextTokenTable event.

To discontinue generating EnumerateTextTokenTable event, set the StopFireEnumerateTextTokenTableEvent property to VARIANT_TRUE.

See Also

Elements: | StopFireEnumerateTextTokenTableEvent property, OnEnumerateTextTokenTable Event, AnnEnumerateTextToken method
Topics: | Annotations (Document/Medical only): Object Manipulation


EnableRestrictToContainer property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableRestrictToContainer (long hObject)
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the specified annotation object(s) is(are) restricted to the container. Possible values are:

Setting | Description
VARIANT_TRUE | Restrict the object to the container.
VARIANT_FALSE | Do not restrict the object to the container.

If an object is restricted to the container, then no part of that object can be moved outside of the container using automation.

You must set the Flags property before setting this property. Possible values for the Flags property, when used with this property, are:

0

ANN_FLAG_SELECTED

ANN_FLAG_NOTTHIS

ANN_FLAG_RECURSE

ANN_FLAG_NOTCONTAINER

ANN_FLAG_NOINVALIDATE

ANN_FLAG_CHECKMENU

To determine whether an error has occurred, check the AnnError property.

See Also

Elements: | Flags property, AnnHitTestExt method, AnnRotateAngle property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Annotations (Document/Medical only): Creating Custom Annotations


Flags property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR (|). Possible values are:

Value | Meaning
0 | Process only the specified object.
ANN_FLAG_SELECTED | [0x0001] Process only objects that have the selected property set to VARIANT_TRUE. For getting and setting the selected property, use the AnnGetSelected and AnnSetSelected Methods.
ANN_FLAG_NOTCONTAINER | [0x0002] (Used with ANN_FLAG_RECURSE) Process objects within containers, not the containers themselves.
ANN_FLAG_NOTTHIS | [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANN_FLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANN_FLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANN_FLAG_CHECKMENU | [0x0020] Process objects only if ANN_AUTOTEXT_MENU_ menu item has been selected.

See Also

Elements: | AnnTextExpandTokens property, AnnTicMarkLength property, AnnTextAlign property, AnnTextRotate property, AnnTextPointerFixed property, AnnSetNameOptions method, AnnSetEncryptOptions method, AnnEncryptApply method, AnnSetPointOptions method, EnableRestrictToContainer property, AnnFixed property, AnnIsFixedRect property, AnnPopFixedState method, AnnPushFixedState method, AnnRTFText property
Topics: | Annotations (Document/Medical only): Object Manipulation


HandleID property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long HandleID;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a unique ID associated with the user handle. The ID can be set with the AnnAddUserHandle, AnnChangeUserHandle, and AnnEnumerateHandle methods.

See Also

Elements: | HandleIndex property, PositionResult property, ObjectHitHandle property, AnnHitTestExt method
Topics: | Annotations (Document/Medical only): Object Manipulation


HandleIndex property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long HandleIndex;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the index of a handle. This is the zero-based index. This property is valid only if the PositionResult property is updated with either ANN_HIT_HANDLE or ANN_HIT_USER_HANDLE. The default handles and the user handles are maintained internally as separate arrays of handles. This means that there is both a default handle "0" and a user handle "0".

See Also

Elements: | HandleID property, PositionResult property, ObjectHitHandle property, AnnHitTestExt method
Topics: | Annotations (Document/Medical only): Object Manipulation


LeftPreviousClip property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LeftPreviousClip;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the left boundary of the previous clip rectangle.

This property is updated by the AnnRestrictCursor method. Therefore, you must call the AnnRestrictCursor method before checking this property for the information.

See Also

Elements: | AnnRestrictCursor method, TopPreviousClip property, RightPreviousClip property, BottomPreviousClip property
Topics: | Annotations (Document/Medical only): Object Manipulation


ObjectHitHandle property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ObjectHitHandle;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the handle to the annotation object that was found at the point specified for the AnnHitTestExt method.

See Also

Elements: | HandleIndex property, PositionResult property, PositionResult property, AnnHitTestExt method
Topics: | Annotations (Document/Medical only): Object Manipulation


OnEnumerateHandle Event (LEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OnEnumerateHandle(long hObject, ILEADRasterAnnHandleInfo * AnnHandleInfo);
Overview | Refer to Implementing Annotations.

Remarks

Occurs for each handle enumerated by the AnnEnumerateHandle method.

The AnnHandleInfo parameter can be used to obtain detailed information about an annotation object handle. It can also be used to change some (but not all) of the properties of a user handle. All properties of an annotation object handle can be changed EXCEPT the location. The properties of a handle that can be changed within this event are:

ID property

EnableVisible property

PenColor property

FillColor property

Shape property

hCursor property

See Also

Elements: | AnnEnumerateHandle method, Type property, ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property, Totalhandles property
Topics: | Annotations (Document/Medical only): Object Manipulation


OnEnumerateTextTokenTable Event (LEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | OnEnumerateTextTokenTable(ByVal nTextTokenCount As Long, ByVal bstrToken As String, ByVal bstrDescription As String, ByVal bstrTokenString As String, ByVal TokenType As LTANNLib.AnnTokenTextType)
Overview | Refer to Implementing Annotations.

Remarks

Occurs for each token enumerated in the AnnEnumerateTextTokenmethod.

See Also

Elements: | Description property, Token property, TokenString property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method
Topics: | Annotations (Document/Medical only): Automation


PointIndex property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PointIndex;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that represents the index for the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY properties. This property must be set before using any of these properties, in order to allocate an adequate amount of memory for these arrays.

See Also

Elements: | AnnConvert method, ClientPointY property, ClientPointX property, ContainerPointX property, ContainerPointY property, PointsCount property
Topics: | Annotations (Document/Medical only): Object Manipulation


PointsCount property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PointsCount;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that represents the minimum number of elements in the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY arrays. That is, the number of elements in the ClientPointX, ClientPointY, ContainerPointX and ContainerPointY arrays must be AT LEAST equal to PointsCount.

See Also

Elements: | AnnConvert method, ClientPointY property, ClientPointX property, ContainerPointX property, ContainerPointY property, PointIndex property
Topics: | Annotations (Document/Medical only): Object Manipulation


PositionResult property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PositionResult;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) (Document/Medical only) Gets a value that represents the position on the annotation object that was found at the point specified for the AnnHitTestExt method. Possible values are:

ANN_HIT_NONE [0]

ANN_HIT_BODY [1]

ANN_HIT_HANDLE [2]

ANN_HIT_NAME [3]

ANN_HIT_USER_HANDLE [4]

ANN_HIT_ROTATE_HANDLE [5]

ANN_HIT_MULTISELECT_HANDLE [6]

ANN_HIT_MULTISELECT_ROTATE_HANDLE [7]

ANN_HIT_MULTISELECT_BODY [8]

For example, if the PositionResult property is ANN_HIT_ROTATE_HANDLE, the HandleID property will be either ANN_ROTATE_HANDLE_CENTER_ID [100] or ANN_ROTATE_HANDLE_GRIPPER_ID [101] to identify which rotate handle was hit.

If the PositionResult property is updated with ANN_HIT_HANDLE or ANN_HIT_USER_HANDLE the HandleIndex property and the HandleID property will be updated with extra information about the handle.

See Also

Elements: | HandleIndex property, HandleID property, ObjectHitHandle property, AnnHitTestExt method
Topics: | Annotations (Document/Medical only): Object Manipulation


SmartUnit property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | long SmartUnit (long Index);
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets an array of values that represents the unit of measure for each ruler length in the Distance property. This property is updated by the AnnGetDistance2 method. Possible values are:

ANN_UNIT_INCHES | 0
ANN_UNIT_FEET | 1
ANN_UNIT_YARDS | 2
ANN_UNIT_MICROMETERS | 3
ANN_UNIT_MILLIMETERS | 4
ANN_UNIT_CENTIMETERS | 5
ANN_UNIT_METERS | 6
ANN_UNIT_TWIPS | 7
ANN_UNIT_POINTS | 8
ANN_UNIT_PIXELS | 9

Please note that if RulerUnit (i) is ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the actual unit of measure for the ruler length in Distance (i) can be found in SmartUnit (i). If RulerUnit (i) is not ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then both RulerUnit (i) and SmartUnit (i) contain the unit of measure.

A "smart unit" is a unit that can be automatically promoted to the next higher unit.

For example, suppose you have a ruler that is 13 inches long. If the units of the ruler are ANN_UNIT_INCHES, then the length is 13. However, if the units of the ruler are ANN_UNIT_SMART_ENGLISH, then the length of the ruler is automatically promoted to feet. The length in this case would be 1.0833 feet.

See Also

Elements: | AnnGetDistance2 method, Distance property, TotalDistance property, TotalRulerUnit property, TotalSmartUnit property, RulerUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


StopFireEnumerateHandleEvent property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL StopFireEnumerateHandleEvent;
Overview | Refer to Implementing Annotations.

Remarks

(Persistent property, available at design time) Disables or enables the generation of the OnEnumerateHandle Event. Possible values are:

Setting | Description
VARIANT_TRUE | [0x0001] Do not continue to generate OnEnumerateHandle events.
VARIANT_FALSE | [0x0002] Continue to generate OnEnumerateHandle events.

To continue generating EnumerateHandle events, make sure the StopFireEnumerateHandleEvent property is set to VARIANT_FALSE. To generate OnEnumerateHandle events once they have been stopped, set the OnEnableFireEnumerateHandleEvent property to VARIANT_TRUE.

See Also

Elements: | EnableFireEnumerateHandleEvent property, AnnEnumerateHandle method
Topics: | Annotations (Document/Medical only): Object Manipulation


StopFireEnumerateTextTokenTableEvent property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL StopFireEnumerateTextTokenTableEvent;
Overview | Refer to Implementing Annotations.

Remarks

(Persistent property, available at design time) Disables or enables the generation of the OnEnumerateTextTokenTable Event. Possible values are:

Setting | Description
VARIANT_TRUE | Stop generating OnEnumerateTextTokenTable event.
VARIANT_FALSE | Continue to generate OnEnumerateTextTokenTable event.

To continue generating OnEnumerateTextTokenTable event, make sure the StopFireEnumerateTextTokenTableEvent property is set to VARIANT_FALSE. To generate OnEnumerateTextTokenTable events again once they have been stopped, set the EnableFireEnumerateTextTokenTableEvent property to VARIANT_TRUE.

See Also

Elements: | EnableFireEnumerateTextTokenTableEvent property, EnumerateTextTokenTable Event, AnnEnumerateTextToken method
Topics: | Annotations (Document/Medical only): Object Manipulation


RightPreviousClip property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RightPreviousClip;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the right boundary of the previous clip rectangle.

This property is updated by the AnnRestrictCursor method. Therefore, you must call the AnnRestrictCursor method before checking this property for the information.

See Also

Elements: | AnnRestrictCursor method, LeftPreviousClip property, TopPreviousClip property, BottomPreviousClip property
Topics: | Annotations (Document/Medical only): Object Manipulation


RTFTextLength property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RTFTextLength
Overview | Refer to Implementing Annotations

Remarks

(Read Only) Gets the text length of an ANN_OBJECT_RTF or ANN_OBJECT_AUTOMATION annotation object.

See Also

Elements: | AnnRTFText property, AnnGetText method, AnnSetText method, AnnGetAutoText method, AnnSetAutoText method
Topics: | Annotations (Document/Medical only): Object Manipulation


RulerUnit property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | long RulerUnit (long Index);
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets an array of values that represents the unit of measure for each ruler length in the Distance property. This property is updated by the AnnGetDistance2 method. Possible values are:

ANN_UNIT_INCHES | 0
ANN_UNIT_FEET | 1
ANN_UNIT_YARDS | 2
ANN_UNIT_MICROMETERS | 3
ANN_UNIT_MILLIMETERS | 4
ANN_UNIT_CENTIMETERS | 5
ANN_UNIT_METERS | 6
ANN_UNIT_TWIPS | 7
ANN_UNIT_POINTS | 8
ANN_UNIT_PIXELS | 9
ANN_UNIT_SMART_METRIC | 10
ANN_UNIT_SMART_ENGLISH | 11

If the entry in RulerUnit (i) is ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the actual unit of measure for the ruler length in Distance (i) can be found in SmartUnit (i). If RulerUnit (i) is not ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then both RulerUnit (i) and SmartUnit (i) contain the unit of measure.

See Also

Elements: | AnnGetDistance2 method, Distance property, TotalDistance property, TotalRulerUnit property, TotalSmartUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


Token property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR Token;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a character representing the token. This can be ANY ASCII character EXCEPT ‘#’, because the token ## is reserved to display the # character.

See Also

Elements: | EnumerateTextTokenTable event, Description property, TokenString property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


TokenString property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR TokenString;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a character string that contains any combination of existing token strings, or any new string. This property is used only if the TokenType property is ANNTOKEN_TEXT. If the TokenType property is not ANNTOKEN_TEXT, then the TokenString property is ignored.

See Also

Elements: | EnumerateTextTokenTable event, Description property, Token property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


TokenType property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | AnnTokenTextType TokenType;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates the type of token. Must be one of the constants in the following table:

ANN_TOKEN_NONE | [0] String not treated as a token
ANN_TOKEN_SEPARATOR | [1] Add a separator to the automation token menu
ANN_TOKEN_TEXT | [2] A text string
ANN_TOKEN_DATE_YYYY | [3] Current four digit year
ANN_TOKEN_DATE_YY | [4] Current two digit year
ANN_TOKEN_DATE_MM | [5] Two digit representation of current month
ANN_TOKEN_DATE_DD | [6] Two digit representation of current day
ANN_TOKEN_DATE_MONTH_NAME | [7] Current month name (i.e. January)
ANN_TOKEN_DATE_DAY_OF_WEEK | [8] Current day of week (i.e. Monday)
ANN_TOKEN_TIME_HH_12 | [9] Current hour,using a 12 hour clock
ANN_TOKEN_TIME_HH_24 | [10] Current hour, using a 24 hour clock
ANN_TOKEN_TIME_MM | [11] Current minute (00-59)
ANN_TOKEN_TIME_SS | [12] Current second (00-59)
ANN_TOKEN_TIME_MILLISECONDS | [13] Current milliseconds (000-999)
ANN_TOKEN_AM_PM | [14] Time of day indicator (AM or PM)

See Also

Elements: | EnumerateTextTokenTable event, Description property, Token property, TokenString property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method, OnEnumerateTextTokenTable event
Topics: | Annotations (Document/Medical only): Automation


TopPreviousClip property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long TopPreviousClip;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the top boundary of the previous clip rectangle.

This property is updated by the AnnRestrictCursor method. Therefore, you must call the AnnRestrictCursor method before checking this property for the information.

See Also

Elements: | AnnRestrictCursor method, LeftPreviousClip property, RightPreviousClip property, BottomPreviousClip property
Topics: | Annotations (Document/Medical only): Object Manipulation


TotalDistance property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | double TotalDistance;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Total length of the ruler(s).

To determine the unit of measure for the ruler, check the TotalRulerUnit property and the TotalSmartUnit property.

To get information on individual rulers in an annotation object, check the following properties:

Distance property

DistanceCount property

RulerUnit property

SmartUnit property

The TotalDistance property and the properties listed above are updated by the AnnGetDistance2 method.

See Also

Elements: | AnnGetDistance2 method, Distance property, TotalRulerUnit property, TotalSmartUnit property, RulerUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


TotalRulerUnit property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | double TotalRulerUnit;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets a value that indicates the unit of measure for the total length of all rulers, found in the TotalDistance property. This property is updated by the AnnGetDistance2 method. Possible values are:

ANN_UNIT_INCHES | 0
ANN_UNIT_FEET | 1
ANN_UNIT_YARDS | 2
ANN_UNIT_MICROMETERS | 3
ANN_UNIT_MILLIMETERS | 4
ANN_UNIT_CENTIMETERS | 5
ANN_UNIT_METERS | 6
ANN_UNIT_TWIPS | 7
ANN_UNIT_POINTS | 8
ANN_UNIT_PIXELS | 9
ANN_UNIT_SMART_METRIC | 10
ANN_UNIT_SMART_ENGLISH | 11

If the TotalRulerUnit property is ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the actual unit of measure can be found in the TotalSmartUnit property. If the TotalRulerUnit property is not ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the TotalRulerUnit property contains the unit of measure.

See Also

Elements: | AnnGetDistance2 method, Distance property, TotalDistance property, TotalSmartUnit property, RulerUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


TotalSmartUnit property (ILEADRasterAnnotation)

Visual Basic example | Visual C++ 5.0 example
Syntax | double TotalSmartUnit;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets a value that indicates the unit of measure for the total length of all rulers, found in the TotalDistance property. Possible values are:

ANN_UNIT_INCHES | 0
ANN_UNIT_FEET | 1
ANN_UNIT_YARDS | 2
ANN_UNIT_MICROMETERS | 3
ANN_UNIT_MILLIMETERS | 4
ANN_UNIT_CENTIMETERS | 5
ANN_UNIT_METERS | 6
ANN_UNIT_TWIPS | 7
ANN_UNIT_POINTS | 8
ANN_UNIT_PIXELS | 9

Please note that if the TotalRulerUnit property is ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then the actual unit of measure can be found in the TotalSmartUnit property. If the TotalRulerUnit property is not ANN_UNIT_SMART_METRIC or ANN_UNIT_SMART_ENGLISH, then both the TotalRulerUnit property and the TotalSmartUnit property contain the unit of measure.

A "smart unit" is a unit that can be automatically promoted to the next higher unit.

For example, suppose you have a ruler that is 13 inches long. If the units of the ruler are ANN_UNIT_INCHES, then the length is 13. However, if the units of the ruler are ANN_UNIT_SMART_ENGLISH, then the length of the ruler is automatically promoted to feet. The length in this case would be 1.0833 feet.

See Also

Elements: | AnnGetDistance2 method, Distance property, TotalDistance property, TotalRulerUnit property, RulerUnit property, SmartUnit property, DistanceCount property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Rulers in Annotation Objects


UserHandle property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterAnnHandle * UserHandle (long uIndex);
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets user – defined annotation handle properties for all user-defined handles associated with an annotation object.

The AnnGetUserHandles method updates the UserHandle property with the annotation handle information for all handles associated with the specified annotation object. The UserHandleCount property is updated with the number of handles retrieved by the AnnGetUserHandles method.

See Also

Elements: | AnnGetUserHandles method, UserHandleCount property
Topics: | Annotations (Document/Medical only): Object Manipulation


UserHandleCount property (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserHandleCount;
Overview | Refer to Implementing Annotations.

Remarks

(Read Only) Gets the total number of user - defined handles associated with an annotation object.

This property is updated when the AnnGetUserHandles method returns. Therefore, you must call the AnnGetUserHandles method before checking this property for the number of user – defined handles.

See Also

Elements: | AnnGetUserHandles method, UserHandle property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnumerateHandle Event (LEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | void EnumerateHandle(long hObject, ILEADRasterAnnHandleInfo * AnnHandleInfo);
Overview | Refer to Implementing Annotations.

Remarks

Occurs for each handle enumerated by the AnnEnumerateHandle method.

The AnnHandleInfo parameter can be used to obtain detailed information about an annotation object handle. It can also be used to change some (but not all) of the properties of a user handle. All properties of an annotation object handle can be changed EXCEPT the location. The properties of a handle that can be changed within this event are:

ID property

EnableVisible property

PenColor property

FillColor property

Shape property

hCursor property

See Also

Elements: | AnnEnumerateHandle method, Type property (ILEADRasterAnnHandleInfo), ID property (ILEADRasterAnnHandleInfo), Index property (ILEADRasterAnnHandleInfo), ContainerX property (ILEADRasterAnnHandleInfo), ContainerY property (ILEADRasterAnnHandleInfo), ClientX property (ILEADRasterAnnHandleInfo), ClientY property (ILEADRasterAnnHandleInfo), EnableVisible property (ILEADRasterAnnHandleInfo), PenColor property (ILEADRasterAnnHandleInfo), FillColor property (ILEADRasterAnnHandleInfo), Shape property (ILEADRasterAnnHandleInfo), hCursor property (ILEADRasterAnnHandleInfo), Totalhandles property (ILEADRasterAnnHandleInfo)
Topics: | Annotations (Document/Medical only): Object Manipulation


EnumerateTextTokenTable Event (LEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Syntax | void EnumerateTextTokenTable(ByVal nTextTokenCount As Long, ByVal bstrToken As String, ByVal bstrDescription As String, ByVal bstrTokenString As String, ByVal TokenType As LTANNLib.AnnTokenTextType);
Overview | Refer to Implementing Annotations.

Remarks

Occurs for each token enumerated in the AnnEnumerateTextToken method.

See Also

Elements: | Description property, Token property, TokenString property, TokenType property, AnnInsertTokenTable method, AnnDeleteTokenTable method, AnnClearTokenTable method, EnableFireEnumerateTextTokenTableEvent property, StopFireEnumerateTextTokenTableEvent property, AnnEnumerateTextToken method
Topics: | Annotations (Document/Medical only): Automation


OnAnnChange event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnChange (long hAnnObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Occurs when any property of an annotation object changes.

When an action affects more than one object, this event occurs once for each affected object. This happens, for example, if a user changes the font for a group of selected objects.

See Also

Topics:

Annotations (Document/Medicalonly): Annotation Events


OnAnnClicked event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnClicked (long hAnnObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Occurs when the user clicks on a button or hot spot annotation object.

The object handle that this event provides can be used to immediately identify the object, but it should not be used as a unique identifier over time. (The annotation undo feature can cause object handles to change.)

Therefore, to keep track of particular objects over time, you should use the AnnSetTag method and the AnnGetTag method.

See Also

Topics:

Annotations (Document/Medical only): Annotation Events


OnAnnCreate event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnCreate (long hAnnObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Occurs whenever an annotation object is added by any means, including loading from a file, pasting from the clipboard, or drawing with an annotation tool selection.

The object handle that this event provides can be used to immediately identify the object, but it should not be used as a unique identifier over time. (The annotation undo feature can cause object handles to change.)

Therefore, to keep track of particular objects such as buttons or hot spots over time, you should use the AnnSetTag method and the AnnGetTag method.

When you load a file, an OnAnnCreate event is generated for each annotation object. You can add code in this event to see which tags are already used in a file.

See Also

Topics:

Annotations (Document/Medical only): Annotation Events


OnAnnDestroy event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnDestroy (long hAnnObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Occurs when an annotation object is deleted. If the user deletes several objects at the same time, a separate event occurs for each object.

See Also

Topics:

Annotations (Document/Medical only): Annotation Events


OnAnnDrawn event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnDrawn (long hAnnObject);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) Occurs after the user finishes drawing an annotation object.

This is different from the onAnnCreate event, which occurs whenever an object is added by any means, including loading from a file or pasting from the clipboard.

This event is useful for setting the annotation tool selection for the next operation. For example, it is common to change the tool to a selection pointer after an object is drawn.

See Also

Topics:

Annotations (Document/Medical only): Annotation Events


OnAnnEnumerate event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnEnumerate (long hObject);
Overview | Refer to Implementing Annotations.

Remarks

Occurs for each object enumerated in the AnnEnumerate method.

Do not insert or destroy annotations within this event.

See Also

Elements: | AnnEnumerate method
Topics: | Annotations (Document/Medical only): Annotation Events


OnAnnHyperlink event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnHyperlink (long hObject, short iParamCount, long lParam1, long lParam2, long lParam3, long lParam4, long lParam5);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) This event occurs when AnnUserMode property is set to ANNUSERMODE_RUN and an object with an ANNLINK_EVENT or ANNLINK_EVENT5 hyperlink type is clicked.

See Also

Elements: | AnnHyperlinkMenuEnable property, AnnGetHyperlinkType method, AnnUserMode property, AnnGetHyperlinkParam method
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


OnAnnHyperlinkMenu event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnHyperlinkMenu (ILEADRasterVariant * aObjects, short uCount);
Overview | Refer to Implementing Annotation Hyperlinks.

Remarks

(Document/Medical only) This event occurs when the AnnUserMode property is set to ANN_USERMODE_RUN and an object with an ANN_LINK_EVENT or ANN_LINK_EVENT5 hyperlink type is clicked.

See Also

Elements: | AnnHyperlinkMenuEnable property
Topics: | Annotations (Document/Medical only): Annotation Hyperlinks


OnAnnLocked event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnLocked (long hAnnObject);
Overview | Refer to Implementing Annotation Security.

Remarks

(Document/Medical only) This event occurs whenever the user locks an object. The event will occur once for each object if a group of objects is locked.

See Also

Elements: | AnnLock method, OnAnnUnlocked event, AnnUnlock method
Topics: | Annotations (Document/Medical only): Annotation Security


OnAnnMenu event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnMenu (long hMenu);
Overview | Refer to Annotation Menu

Remarks

(Document/Medical only)Occurs just before an annotation automation menu is displayed.

The hMenu parameter is an object that references the menu that will be displayed. You can use this AnnMenu object to modify the menu prior to displaying it.

The following properties and methods are associated with the AnnMenu object:

Count property

ItemString property

ItemID property

ItemType property

ItemChecked property

ItemEnabled property

DeleteItem method

AddItem method

GetSubMenu Method

See Also

Elements: | Count property, ItemString property, ItemID property, ItemType property, ItemChecked property, ItemEnabled property, DeleteItem method, AddItem method, GetSubMenu Method, OnAnnUserMenu event
Topics: | Annotations (Document/Medical only): Automation


OnAnnMouseDown event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnMouseDown (short Button, short Shift, long x, long y);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only)Occurs when the user presses a mouse button in design mode.

See Also

Elements: | OnAnnMouseMove event, OnAnnMouseUp event
Topics: | Annotations (Document/Medical only): Annotation Events


OnAnnMouseMove event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnMouseMove (short Button, short Shift, long x, long y);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only)Occurs when the user moves the mouse over the Main Control in design mode.

See Also

Elements: | OnAnnMouseDown event, OnAnnMouseUp event
Topics: | Annotations (Document/Medical only): Annotation Events


OnAnnMouseUp event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnMouseUp (short Button, short Shift, long x, long y);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only)Occurs when the user releases a mouse button in design mode.

See Also

Elements: | OnAnnMouseMove event, OnAnnMouseDown event
Topics: | Annotations (Document/Medical only): Annotation Events


OnAnnSelect event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnSelect (ILEADRasterVariant * aObjects, short uCount);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only)Occurs when annotation objects are selected or deselected. If uCount is 0, then no objects are selected. If you click outside all the annotation objects, this event will still be fired and uCount will be 0.

See Also

Elements: | AnnGetSelectCount method, AnnGetSelectList method
Topics: | Annotations (Document/Medical only): Automation, Annotations (Document/Medical only): Annotation Events


OnAnnToolChecked event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnToolChecked (short iTool);
Overview | Refer to Annotation Toolbar

Remarks

(Document/Medical only)This event is fired when the user clicks on an annotation toolbar button. In this case, iTool contains the ANN_TOOL_XXX value that indicates the selected tool.

If the AutoSetTool of AnnToolbar is set to TRUE, the AnnTool of the RasterAnnotation object has already been set to iTool.

Note: iTool contains the same value as the Tool property of AnnToolbar.

See Also

Elements: | AutoSetTool property, ButtonBitmapUp property, ButtonBitmapDown property, ButtonColumns property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, hWnd property, Tool property, Visible property
Topics: | Annotations (Document/Medical only): Automation


OnAnnToolDestroy event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnToolDestroy ();
Overview | Refer to Annotation Toolbar

Remarks

(Document/Medical only)This event is fired when the user closes the annotation toolbar by clicking on the close button at the top of the annotation toolbar.

See Also

Elements: | AutoSetTool property, ButtonBitmapUp property, ButtonBitmapDown property, ButtonColumns property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, hWnd property, Tool property, Visible property, OnAnnToolChecked event
Topics: | Annotations (Document/Medical only): Automation


OnAnnUnlocked event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnUnlocked (long hAnnObject);
Overview | Refer to Implementing Annotation Security.

Remarks

(Document/Medical only) This event occurs whenever the user unlocks an object. The event will occur once for each object if a group of objects is unlocked.

See Also

Elements: | AnnUnlock method, OnAnnLocked event, AnnLock method
Topics: | Annotations (Document/Medical only): Annotation Security


OnAnnUserMenu event (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OnAnnUserMenu (long nID);
Overview | Refer to Annotation Menu

Remarks

(Document/Medical only)This event is fired when a user-defined menu item has been clicked in an annotation automation menu. The user-defined menu items can be added to the annotation automation menu by processing the OnAnnMenu event and adding user-defined items with AddItem method.

When a user selects a menu item added with the AddItem method, the OnAnnUserMenu event is fired. The nID parameter passed to this event is the same nID passed to the AddItem method when the item was added to the menu.

See Also

Elements: | OnAnnMenu event, AddItem method
Topics: | Annotations (Document/Medical only): Automation


EnablePointBitmapTransparent property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePointBitmapTransparent;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether there is a transparent color. Possible values are:

Setting | Description
VARIANT_TRUE | If the point is drawn using a bitmap, draw with a transparent color. The transparent color to use is in the PointBitmapTransparentColor property.
VARIANT_FALSE | If the point is drawn using a bitmap, there is no transparent color.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnablePointFixedSize property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePointFixedSize;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether a point drawn as a circle is a fixed size. Possible values are:

Setting | Description
VARIANT_TRUE | If the point is drawn as a circle, the size does not change, regardless of the zoom factor
VARIANT_FALSE | If the point is drawn as a circle, the size changes with the zoom factor.

The point is drawn as a circle if the EnablePointUseBitmap property is VARIANT_FALSE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnablePointTransparentFill property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePointTransparentFill;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether the inside of a point, drawn as a circle, is transparent or uses the fill color. Possible values are:

Setting | Description
VARIANT_TRUE | The inside of the point, drawn as a circle, is transparent.
VARIANT_FALSE | The inside of the point, drawn as a circle, is filled with the color in the PointFillColor property.

The point is drawn as a circle if the EnablePointUseBitmap property is VARIANT_FALSE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


EnablePointUseBitmap property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePointUseBitmap;
Overview | Refer to Implementing Annotations.

Remarks

Indicates whether to draw the point using the current point bitmap or as a circle. Possible values are:

Setting | Description
VARIANT_TRUE | Draw the point using the current point bitmap.
VARIANT_FALSE | Draw the point as a circle.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


Flags property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Flags;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a value that indicates which properties contain valid data. Possible values are one or more of the following constants "or"ed together.

Value | Meaning
ANN_POINT_USE_BITMAP | [0x001] The EnablePointUseBitmap property contains valid data.
ANN_POINT_BITMAP | [0x002] The PointRaster property contains valid data.
ANN_POINT_BITMAP_TRANSPARENT | [0x004] The EnablePointBitmapTransparent property contains valid data.
ANN_POINT_BITMAP_TRANSPARENT_COLOR | [0x008] The PointBitmapTransparentColor property contains valid data.
ANN_POINT_RADIUS | [0x010] The PointRadius property contains valid data.
ANN_POINT_BORDER_COLOR | [0x020] The PointBorderColor property contains valid data.
ANN_POINT_FILL_COLOR | [0x040] The PointFillColor property contains valid data.
ANN_POINT_TRANSPARENT_FILL | [0x080] The EnablePointTransparentFill property contains valid data.
ANN_POINT_FIXED_SIZE | [0x100] The EnablePointFixedSize property contains valid data.
ANN_POINT_ALL | [0x1ff] All property are valid.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


PointBitmapTransparentColor property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PointBitmapTransparentColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the transparent color to use if the EnablePointUseBitmap property is VARIANT_TRUE and the EnablePointBitmapTransparent property is VARIANT_TRUE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


PointBorderColor property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PointBorderColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the outline color for the point, if the point is drawn as a circle.

The point is drawn as a circle if the EnablePointUseBitmap property is VARIANT_FALSE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


PointFillColor property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PointFillColor;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the color used to fill the inside of a point, if it is drawn as a circle and the EnablePointTransparentFill property is VARIANT_FALSE.

The point is drawn as a circle if the EnablePointUseBitmap property is VARIANT_FALSE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation
 | Using Color Values in LEADTOOLS


PointRadius property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PointRadius;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets the radius of the point, in pixels (assuming no zooming), if the point is drawn as a circle.

The point is drawn as a circle if the EnablePointUseBitmap property is VARIANT_FALSE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property, PointRaster property
Topics: | Annotations (Document/Medical only): Object Manipulation


PointRaster property (ILEADRasterAnnPointOption)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRaster * PointRaster;
Overview | Refer to Implementing Annotations.

Remarks

Gets or sets a pointer to an ILEADRaster obect that references the bitmap to use for the point, if the point is drawn using a bitmap.

The point is drawn using a bitmap if the EnablePointUseBitmap property is VARIANT_TRUE.

See Also

Elements: | AnnPointOptions property, AnnGetPointOptions method, AnnSetPointOptions method, Flags property, EnablePointUseBitmap property, EnablePointBitmapTransparent property, PointBitmapTransparentColor property, PointRadius property, PointBorderColor property, EnablePointTransparentFill property, PointFillColor property, EnablePointFixedSize property
Topics: | Annotations (Document/Medical only): Object Manipulation


Create method (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Create (float x, float y, short iAlign);
Overview | Refer to Annotation Toolbar.

Remarks

Creates the annotation toolbar. You must create the toolbar before using most of the properties associated with the AnnToolbar object. Only the Visible property can be used before creating the toolbar.

See Also

Elements: | ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, ParenthWnd property, Tool property, Visible property
Topics: | Annotations (Document/Medicalonly): Automation


AnnParentRasterView property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnnParentRasterView(ILEADRasterView *pRasterView);
Overview | Refer to Implementing Annotations.

Remarks

(Document/Medical only) This property attaches the Annotation Toolbar COM object to a LEAD RasterView control. this property must be set before using any of the LEAD Annotation Toolbar COM Object methods or properties.

To remove the attachment, and subsequently destroy all annotations, set this property to 0, or Nothing in Visual Basic.

See Also

Topics:

Annotations (Document/Medical only): Automation


ButtonBitmapDown property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ButtonBitmapDown (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains a bitmap used to paint the specified button when the button is pressed. If this property is NULL, the control will assume the same bitmap is used to paint the button when it is up or down.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapUp property, ButtonColumns property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonBitmapUp property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ButtonBitmapUp (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains a bitmap used to paint the specified button when the button is up. If the ButtonBitmapDown property is NULL, the control will assume the same bitmap is used to paint the button whether it is up or down.

The bitmap should have the one of the following sets of dimensions, depending on the toolbar style you are using:

Old style toolbar (16, 15)

New XP style toolbar (24, 24)

If using the old style toolbar, It is recommended that all bitmaps used for the annotation buttons should use the same palette.

Note:

In Version 14.5, you need to first enable the display of the XP style toolbar by calling the AnnSetOptions method with the ANN_OPTIONS_NEW_TOOLBAR flag set. For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonColumns property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonColumns property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonColumns
Overview | Refer to Annotation Toolbar.

Remarks

Number of columns in the toolbar. The buttons in the toolbar are ordered left to right and top to bottom.

If you change the number of columns, the number of rows is adjusted accordingly. The relationship between rows and columns is given by the following equation:

ButtonRows = (ButtonCount + ButtonColumns – 1) / ButtonColumns

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonCount property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonCount property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonCount
Overview | Refer to Annotation Toolbar.

Remarks

Contains the number of buttons in the toolbar. To add another toolbar button to an existing toolbar, you should set the tool and the bitmaps for the new button in the ButtonTool property, and increment the number of buttons to make the button visible.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonMenuText property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR ButtonMenuText (short iButtonIndex, short iToolIndex);
Overview | Refer to Annotation Toolbar.

Remarks

String containing the menu text for the specified menu item of the specified button in the AnnToolbar object. For example, if ButtonMenuText(2,1) contains the string "Select", then when the user clicks the third button of the annotation toolbar (iButtonIndex is zero-based), a menu will be displayed. The second menu item will display the text Select.

This property is only valid if ButtonMenuTextID is -1.

The ButtonMenuXXX properties are only used for buttons that are associated with multiple tools.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonMenuTextID property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonMenuTextID (short iButtonIndex, short iToolIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains an index into the annotation menu dialog strings (ANN_AUTOTEXT_XXX). If this value is -1, the text for the tool tip is in the ButtonMenuText property. If this value is >= 0, this value is an index into the set of annotation menu dialog strings and the tool tip text will come from here.

The index stored in this property associates the corresponding menu text with the specified menu item of the specified menu button. For example, if ButtonMenuTextID(2, 1) contains the value ANN_AUTOTEXT_MENU_PROTRACTOR, then the text associated with the second menu item of the third button of the annotation toolbar will be "&Protractor …". Therefore, when the user clicks on the third button of the annotation toolbar, a menu will be displayed. The second menu item will display Protractor.

Please note that a character following an ampersand will be underlined.

The ButtonMenuXXX properties are only used for buttons that are associated with multiple tools.

For a list of the available dialog strings, refer to Annotation Automation Strings.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonMenuTool property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonMenuTool (short iButtonIndex, short iToolIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains the tool associated with the specified menu item of the specified annotation toolbar button.

For example, if ButtonMenuTool(2, 1) contains the value ANN_TOOL_POINT, then the second menu item of the third button of the annotation toolbar will be associated with the Point Tool. Therefore, when the user clicks on the third button of the annotation toolbar a menu will be displayed with all the tools associated with that button. The second menu item will be the Point Tool.

You must use the ButtonMenuText and ButtonMenuTextID properties to set the text for the menu item.

The ButtonMenuXXX properties are only used for buttons that are associated with multiple tools.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonRows property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonRows
Overview | Refer to Annotation Toolbar.

Remarks

Number of rows in the toolbar. The buttons in the toolbar are ordered left to right and top to bottom.

If you change the number of rows, the number of columns is adjusted accordingly. The relationship between rows and columns is given by the following equation:

ButtonColumns = (ButtonCount + ButtonRows – 1) / ButtonRows

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonTool property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnnToolConstants ButtonTool(short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains the tool associated with the specified button of the annotation toolbar. This is actually an array of values that indicate the tools associated with every button in the annotation toolbar.

If ButtonToolCount for the specified button is one, then the button has one tool associated with it, and the ButtonTool property and the Tool property contain the ANN_TOOL_XXX constant corresponding to that tool.

If ButtonToolCount for the specified button is >1 then there are several tools associated with the specified button. In that case, ButtonTool() and the Tool property contain the ANN_TOOL_XXX constant corresponding to the currently selected tool. When the user clicks on a button having more than one tool, a menu is displayed. The ButtonMenuXXX properties describe the menu items and the tools associated with the specified button.

For example, if ButtonToolCount(2) contains the value 1, then there is only one tool associated with the third button of the annotation toolbar. The constant for that tool is contained in ButtonTool(2).

If ButtonToolCount(2) contains the value 3, then there are three tools associated with the third button of the annotation toolbar. Clicking on this button will display a menu. The text for the menu is set in the ButtonMenuText and ButtonMenuTextID properties. The tools associated with the menu are set in the ButtonMenuTool property.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonToolCount property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonToolCount (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains the number of tools associated with the specified button in the AnnToolbar object. For example, if ButtonToolCount(2) contains the value 4, then there are four tools associated with the third button in the AnnToolbar object. (iButtonIndex is zero-based.)

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonToolTipText property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR ButtonToolTipText (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

String containing the tooltip text for the specified button in the AnnToolbar object. This text will be displayed when the user places the cursor over the associated button in the Annotation Toolbar. For example, if ButtonToolTipText(2) contains the string "Select", then when the user places the cursor over the third button of the annotation toolbar (iButtonIndex is zero-based), the text "Select" will be displayed.

This property is only valid if ButtonToolTipTextID is -1.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipTextID property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonToolTipTextID property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ButtonToolTipTextID (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains an index into the annotation menu dialog strings (ANN_AUTOTEXT_XXX). If this value is -1, the text for the tool tip is in the ButtonToolTipText property. If this value is >= 0, this value is an index into the set of annotation menu dialog strings and the tool tip text will come from here.

For a list of the available dialog strings, refer to Annotation Automation Strings.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonVisible property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


ButtonVisible property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL ButtonVisible (short iButtonIndex);
Overview | Refer to Annotation Toolbar.

Remarks

Contains a value that indicates whether the specified button is visible. This can be set to hide specific buttons on the toolbar.

If a button is hidden on the annotation toolbar, the remaining buttons are rearranged to take up the space left by the hidden button.

Possible values are:

Value | Meaning
VARIANT_TRUE | The specified button is visible.
VARIANT_FALSE | The specified button is invisible.

For example, if ButtonVisible(2) is set to VARIANT_FALSE, the third button in the annotation toolbar will be hidden and the remaining buttons will be rearranged to take up the space left by the hidden button.

See Also

Elements | AnnGetFillModeExt method, AnnSetFillModeExt method, AnnFillMode property, AnnAlpha property, AnnSetOptions method, AnnGetOptions method, AnnSetTextOptions method, AnnGetTextOptions method, AnnShowText property, AnnShowBorder property, AnnTextColor property, AnnAutoSnapCursor property, AnnTextEdit method, AnnShowRotateHandles property, AnnGetRotateOptions method, AnnSetRotateOptions method, AnnCalibrateRuler method, ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, Create method, ParenthWnd property, Tool property, Visible property
Topics | Annotations (Document/Medical only): Automation


Tool property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | AnnToolConstants Tool
Overview | Refer to Annotation Toolbar.

Remarks

Gets / sets the currently selected tool. When setting this property, the first button in the toolbar that has an assigned tool with the value stored in this property will be enabled. For a list of possible values, refer to Annotation Toolbar Buttons.

Please note that the automation mode does not automatically create objects for the ANN_TOOL_USER_XXX tools.

See Also

Elements: | ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ToolBarhWnd property, Visible property
Topics: | Annotations (Document/Medical only): Automation


ToolBarhWnd property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ToolBarhWnd
Overview | Refer to Annotation Toolbar.

Remarks

(Read only) Handle to the annotation toolbar window.

See Also

Elements: | ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, Tool property, Visible property
Topics: | Annotations (Document/Medicalonly): Automation


Visible property (ILEADRasterAnnToolBar)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL Visible
Overview | Refer to Annotation Toolbar.

Remarks

Contains a value that indicates whether the toolbar is visible or not. This is the only property that can be set before calling the Create method. Possible values are:

Value | Meaning
TRUE | The toolbar is (will be) visible.
FALSE | The toolbar is not (will not be) visible.

See Also

Elements: | ButtonBitmapDown property, ButtonBitmapDown property, ButtonColumns property,ButtonCount property, ButtonMenuText property, ButtonMenuTextID property, ButtonMenuTool property, ButtonRows property, ButtonTool property, ButtonToolCount property, ButtonToolTipText property, ButtonToolTipTextID property, ButtonVisible property, Create method, ToolBarhWnd property, Tool property
Topics: | Annotations (Document/Medical only): Automation


CreateObject2 method (ILEADRasterFactory Interface)

Syntax | LPDISPATCH CreateObject2(BSTR pszClassID, BSTR pszLic)
Overview | Refer to Creating Instances of Licensed COM Objects.

Remarks

Creates an instance of a licensed COM Object. This function returns an IDispatch pointer to the created object.

Use this method in ASP/VBScript/JavaScript/Delphi.

See Also

Elements: | CreateObject method
Topics: | Support: Creating Instances of Licensed COM Objects


CreateObject method (ILEADRasterFactory Interface)

Visual C++ 5.0 example

Syntax | LPUNKNOWN CreateObject(BSTR pszClassID, BSTR pszLic)
Overview | Refer to Creating Instances of Licensed COM Objects.

Remarks

Creates an instance of a licensed COM Object.

Use this method in languages like Visual Basic.

See Also

Elements: | CreateObject2 method
Topics: | Support: Creating Instances of Licensed COM Objects


DrawEllipse method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawEllipse(ILEADRaster *pRaster, long hDC, float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Drawing Simple Objects.

Remarks

Draws an ellipse on the window or on the bitmap raster. The DrawPersistence property determines whether the object is drawn on the window or the bitmap raster.

Whether you draw to the window or to the bitmap raster, drawing objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawLine method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawLine (ILEADRaster *pRaster, long hDC, float fX1, float fY1, float fX2, float fY2);
Overview | Refer to Drawing Simple Objects.

Remarks

Draws a line on the screen or on the raster bitmap. The DrawPersistence property determines whether the object is drawn on the screen or the raster bitmap.

Whether you draw to the screen or to the raster bitmap, drawing objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawRectangle method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawRectangle(ILEADRaster *pRaster, long hDC, float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Drawing Simple Objects.

Remarks

Draws a rectangle on the screen or on the raster bitmap. The DrawPersistence property determines whether the object is drawn on the screen or the raster bitmap.

Whether you draw to the screen or to the bitmap, drawing objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawShape method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawShape(ILEADRaster *pRaster, long hDC, short uShape, long BackgroundImage);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Draws the specified three-dimensional shape in the control's client area or on the current bitmap. The size, position, and other aspects of the shape are determined by related properties, as explained in Drawing Three-Dimensional Shapes and Text.

For possible values of the uShape parameter, refer to Shapes.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawText method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawText(ILEADRaster *pRaster, long hDC, BSTR szText, long ForegroundImage);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Draws a text object in the control's client area or on the current bitmap. Placement and other aspects of the text object are specified by related properties described in Drawing Three-Dimensional Shapes and Text.

You can create an image that consists of a pattern or gradient color to use as a foreground of the text. Refer to Gradients and Patterns for related properties.

The bitmap that you specify is positioned at the origin of the text object's rectangle, and it is not scaled. Therefore the bitmap that you use for this purpose should be sized accordingly. In most cases it should be the same size as the rectangle.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawTextHeight method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DrawTextHeight(long hDC, BSTR pszText);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Returns the height of the specified text string, using the current values of the Font property.

The scale is relative to the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property. You can use this method to position the text relative to another drawing object, such as a line or rectangle.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


DrawTextOut method (ILEADRasterFXD)

Syntax | short DrawTextOut (ILEADRaster *pRaster, long hDC, float fX, float fY, BSTR pszText);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Draws a text object in the control's client area or on the current bitmap. Use this method instead of DrawText in Access 2.0, which has limited support for text objects.

The DrawTextOut method recognizes only the following related text-object properties:

DrawPersistence property

Font property

DrawFontColor property

The DrawPersistence property determines whether the object is drawn on the screen or the bitmap. Whether you draw on the screen or the bitmap, the text is always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Elements: | DrawText method
Topics: | Raster Images: Drawing on a Bitmap
 | Working with the Control: Client Area Usage


DrawTextWidth method (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DrawTextWidth (long hDC, BSTR pszText);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Returns the width of the specified text string, using the current values of the Font property.

The scale is relative to the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property. You can use this method to position the text relative to another drawing object, such as a line or rectangle.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


BackgroundImageHeight property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BackgroundImageHeight
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the height of the source rectangle that defines which part of a bitmap to use for the background of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | DrawShape method, ShapeBackgroundStyle property, BackgroundImageLeft property, BackgroundImageTop property, BackgroundImageWidth property
Topics: | Drawing Effects:3D Drawing Special Effects


BackgroundImageLeft property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BackgroundImageLeft
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the X coordinate of the origin of the source rectangle that defines which part of a bitmap to use for the background of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | DrawShape method, ShapeBackgroundStyle property, BackgroundImageTop property, BackgroundImageWidth property, BackgroundImageHeight property
Topics: | Drawing Effects:3D Drawing Special Effects


BackgroundImageTop property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BackgroundImageTop
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the Y coordinate of the origin of the source rectangle that defines which part of a bitmap to use for the background of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | DrawShape method, ShapeBackgroundStyle property, BackgroundImageLeft property, BackgroundImageWidth property, BackgroundImageHeight property
Topics: | Drawing Effects:3D Drawing Special Effects


BackgroundImageWidth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float BackgroundImageWidth
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the width of the source rectangle that defines which part of a bitmap to use for the background of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | DrawShape method, ShapeBackgroundStyle property, BackgroundImageLeft property, BackgroundImageTop property, BackgroundImageHeight property
Topics: | Raster Images: Drawing on a Bitmap
 | Working with the Control: Client Area Usage


ClientSizeX property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ClientSizeX
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

This property sets the X dimension of the client area to be used when working with paint effects.

See Also

Elements: | ClientSizeY property, SrcTop property, SrcLeft property, SrcRight property, DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


ClientSizeY property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ClientSizeY
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

This property sets the Y dimension of the client area to be used when working with paint effects.

See Also

Elements: | ClientSizeX property, SrcTop property, SrcLeft property, SrcRight property, DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


DrawFillColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR DrawFillColor
Overview | Refer to Drawing Simple Objects.

Remarks

Specifies the interior color of a drawing object.

You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


DrawFillStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawFillStyle
Overview | Refer to Drawing Simple Objects.

Remarks

Specifies the fill pattern of a drawing object.

Value | Meaning
DRAWFILLSTYLE_SOLID | Solid color
DRAWFILLSTYLE_TRANSPARENT | Transparent
DRAWFILLSTYLE_HORIZONTAL_LINE | Horizontal lines
DRAWFILLSTYLE_VERTICAL_LINE | Vertical lines
DRAWFILLSTYLE_UPWARD_DIAGONAL | Upward diagonal lines
DRAWFILLSTYLE_DOWNWARD_DIAGONAL | Downward diagonal lines
DRAWFILLSTYLE_CROSS | Straight cross-hatch
DRAWFILLSTYLE_DIAGONAL_CROSS | Diagonal cross-hatch
DRAWFILLSTYLE_DIAGONAL_LAST | Last value (for testing a loop counter)

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawFontColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR DrawFontColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the color of any text that you draw using the DrawText method.

You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


DrawMode property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawMode
Overview | Refer to Drawing Simple Objects.

Remarks

Determines how each pixel of a drawing object is combined with the existing pixel on the target surface (the screen or bitmap, as specified by the DrawPersistence property).

For normal drawing, use DRAWMODE_COPY_PEN. The DrawPenColor property specifies the pen color. For rubberband-style interactive display, use DRAWMODE_INVERT (as shown in the code example).

Value | Description of the Resulting Pixel
DRAWMODE_BLACKNESS | Pixel is always black.
DRAWMODE_COPY_PEN | Pixel is the pen color.
DRAWMODE_MASK_NOT_PEN | Pixel is a combination of the colors common to both the target and the inverse of the pen.
DRAWMODE_MASK_PEN | Pixel is a combination of the colors common to both the pen and the target.
DRAWMODE_MASK_PEN_NOT | Pixel is a combination of the colors common to both the pen and the inverse of the target.
DRAWMODE_MERGE_NOT_PEN | Pixel is a combination of the target color and the inverse of the pen color.
DRAWMODE_MERGE_PEN | Pixel is a combination of the pen color and the target color.
DRAWMODE_MERGE_PEN_NOT | Pixel is a combination of the pen color and the inverse of the target color.
DRAWMODE_NOP | Pixel remains unchanged.
DRAWMODE_INVERT | Pixel is the inverse of the target color.
DRAWMODE_NOT_COPY_PEN | Pixel is the inverse of the pen color.
DRAWMODE_NOT_MASK_PEN | Pixel is the inverse of the DRAWMODE_MASK_PEN color.
DRAWMODE_NOT_MERGE_PEN | Pixel is the inverse of the DRAWMODE_MERGE_PEN color.
DRAWMODE_NOT_XOR_PEN | Pixel is the inverse of the DRAWMODE_XOR_PEN color.
DRAWMODE_WHITENESS | Pixel is always white.
DRAWMODE_XOR_PEN | Pixel is a combination of the colors in the pen and in the target, but not in both.
DRAWMODE_LAST | Last value (for testing a loop counter).

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawPenColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR DrawPenColor
Overview | Refer to Drawing Simple Objects.

Remarks

Specifies the line color of the drawing object.

You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


DrawPenStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawPenStyle
Overview | Refer to Drawing Simple Objects.

Remarks

Specifies the line style of the drawing object. The following are valid values:

Value | Description
DRAWPENSTYLE_SOLID | Lines are solid.
DRAWPENSTYLE_DASH | Lines are dashed. This style is valid only when the DrawPenWidth property is 1.
DRAWPENSTYLE_DOT | Lines are dotted. This style is valid only when the DrawPenWidth property is 1.
DRAWPENSTYLE_DASH_DOT | Lines alternate dashes and dots. This style is valid only when the DrawPenWidth property is 1.
DRAWPENSTYLE_DASH_DOT_DOT | Lines alternate dashes and double dots. This style is valid only when the DrawPenWidth property is 1.
DRAWPENSTYLE_TRANSPARENT | Lines are invisible.
DRAWPENSTYLE_INSIDE_SOLID | Lines are solid, and are inside the bounds of the object.
DRAWPENSTYLE_LAST | Last value (for testing a loop counter).

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawPenWidth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DrawPenWidth
Overview | Refer to Drawing Simple Objects.

Remarks

Specifies the width, in pixels, of the lines of a drawing object.

If the target is the screen, the measurement is in screen pixels; if the target is the raster bitmap, it is in bitmap pixels. Therefore, if you draw to the bitmap, and the displayed image is scaled down (the destination rectangle is smaller than the source rectangle), thin lines may not appear on the displayed image. This happens because scaling down an image causes some pixels to be thrown out. In a bitonal (black and white) image, you can overcome this problem with favor-black setting of the BitonalScaling property, which is Document/Medical only.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


DrawPersistence property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL DrawPersistence
Overview | Refer to Drawing Simple Objects and Drawing Three-Dimensional Shapes and Text.

Remarks

Determines whether drawing objects are drawn on the screen or on the bitmap. When drawing text to the bitmap, the best quality is achieved when the image is not scaled (when PaintSizeMode = PAINTSIZEMODE_NORMAL).

Whether you draw to the screen or to the bitmap, drawing objects are always positioned in the Main Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

Value | Meaning
TRUE | Draw to the bitmap.
FALSE | Draw to the screen.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Examining and Altering Bitmaps


DstBottom property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long DstBottom
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The Y coordinate or the bottom of the destination rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property

See Also

Elements: | DstTop property, DstRight property, DstLeft property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


DstLeft property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long DstLeft
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The X coordinate of the origin of the destination rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property..

See Also

Elements: | DstTop property, DstRight property, DstBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


DstRight property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long DstRight
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The X coordinate of the right boundary of the destination rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property.

See Also

Elements: | DstTop property, DstLeft property, DstBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


DstTop property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long DstTop
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The Y coordinate of the origin of the destination rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property.

See Also

Elements: | DstLeft property, DstRight property, DstBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


Font property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | IFontDisp* Font
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the Font object for any text that you draw using the DrawText method.

You set these properties as in the following example: LeadRasFxd1.Font.Name = "Arial".

The Font object has the following properties:

Property | Description
Bold | TRUE for bold text; FALSE for not bold.
Italic | TRUE for italic text; FALSE for not italic.
Name | Text string for name of the font. For example: "Times New Roman".
Size | Size of the font, in points. The maximum value s 2048 points.
StrikeThrough | TRUE for a line through the text; FALSE for no line.
Underline | TRUE for underlined text; FALSE for not underlined.
Weight | Possible runtime values are 400 for light and 700 for heavy.

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


PatternBackColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR PatternBackColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Works with related ILEADRasterFXD properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape.

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor property specifies the foreground color of the pattern.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


PatternForeColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR PatternForeColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Works with related ILEADRasterFXD properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor property specifies the foreground color of the pattern.

See Also

Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


PatternStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PatternStyleConstants PatternStyle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Works with related ILEADRasterFDX properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape.

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor propertyspecifies the foreground color of the pattern.

Possible values are:

Value | Meaning
FXD_PATTERN_SOLID | [0] Solid filling
FXD_PATTERN_TRANSPARENT | [1] Transparent filling (not valid for transitions)
FXD_PATTERN_HORZ_LINE | [2] Horizontal lines (==)
FXD_PATTERN_VERT_LINE | [3] Vertical lines (||)
FXD_PATTERN_DOWNWARD_DIAG | [4] Downward diagonal lines (//)
FXD_PATTERN_UPWARD_DIAG | [5] Upward diagonal lines (\\)
FXD_PATTERN_CROSS | [6] Cross line (++)
FXD_PATTERN_DIAG_CROSS | [7] Diagonal cross lines (XX)

See Also

Topics:

Drawing Effects:3D Drawing Special Effects


ScaleMode property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ScaleMode
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the unit of measure for the ILEADRasterFXD properties.

Setting | Description
1 | Twips (1440 twips per logical inch; 567 twips per logical centimeter).
2 | Points (72 points per logical inch).
3 | Pixels (smallest unit of monitor or printer resolution).
4 | Characters (horizontal = 120 twips per unit; vertical = 240 twips per unit).
5 | Inches.
6 | Millimeters.
7 | Centimeters.

See Also

Elements: | DstLeft property, DstTop property, DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


ShadowColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShadowColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the color of a drop shadow that is applied to a three-dimensional shape or text object.

To have no drop shadow, set the ShadowXDepth and ShadowYDepth properties to 0.

For text objects, drop shadows are available only for the following TextStyle values:

FXD_TEXTSTYLE_DROPSHADOW
FXD_TEXTSTYLE_BLOCKSHADOW
FXD_TEXTSTYLE_OUTLINEBLOCK

For text objects, the shadow color is used for three-dimensional effects in the following TextStyle styles:

FXD_TEXTSTYLE_INSETHEAVY
FXD_TEXTSTYLE_INSETEXTRAHEAVY
FXD_TEXTSTYLE_RAISEDHEAVY
FXD_TEXTSTYLE_RAISEDEXTRAHEAVY

See Also

Elements: | DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShadowXDepth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShadowXDepth
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the X offset of a drop shadow that is applied to a three-dimensional shape or text object.

To have no drop shadow, set the ShadowXDepth and ShadowYDepth properties to 0.

Whether you draw to the screen or to the bitmap, drawing objects are always positioned in the LEAD Raster View Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

For text objects, drop shadows are available only for the following TextStyle values:

FXD_TEXTSTYLE_DROPSHADOW
FXD_TEXTSTYLE_BLOCKSHADOW
FXD_TEXTSTYLE_OUTLINEBLOCK

See Also

Elements: | DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


ShadowYDepth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShadowYDepth
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the Y offset of a drop shadow that is applied to a three-dimensional shape or text object.

To have no drop shadow, set the ShadowXDepth and ShadowYDepth properties to 0.

Whether you draw to the screen or to the bitmap, drawing objects are always positioned in the LEAD Raster View Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

For text objects, drop shadows are available only for the following TextStyle values:

FXD_TEXTSTYLE_DROPSHADOW
FXD_TEXTSTYLE_BLOCKSHADOW
FXD_TEXTSTYLE_OUTLINEBLOCK

See Also

Elements: | DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeBackgroundStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ShapeBackgroundStyle
Overview | Refer to Drawing Three Dimensional Shapes and Text.

Remarks

Specifies the background style of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three Dimensional Shapes and Text.

For a list of possible values, refer to BackStyle.

For styles that require an image you must specify a LEAD bitmap in a parameter of the DrawShape method. To use a background image, the PatternStyle property must not be FXD_PATTERN_SOLID.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeBorderColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShapeBorderColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the line (border) color of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShapeBorderStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ShapeBorderStyle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the line (border) style of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

For a list of possible values, refer to BorderStyles.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeBorderThickness property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeBorderThickness
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the line (border) thickness of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property. and it is relative to the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS scales the value if necessary. If the scaled value equates to less than half a pixel, it is rounded to 0.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeHeight property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeHeight
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the height of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

Whether you draw to the screen or to the bitmap, shapes are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeInnerBandHiliteColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShapeInnerBandHiliteColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the inner-band highlight color of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShapeInnerBandShadowColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShapeInnerBandShadowColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the inner-band shadow color of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShapeInnerBandStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ShapeInnerBandStyle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the inner-band style of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

For a list of possible values, refer to ShapeInnerStyles.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeInnerBandThickness property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeInnerBandThickness
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the inner-band thickness of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property. and it is relative to the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS scales the value if necessary. If the scaled value equates to less than half a pixel, it is rounded to 0.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeLeft property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeLeft
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the X coordinate of the origin of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

Whether you draw to the screen or to the bitmap, shapes are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeOuterBandHiliteColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShapeOuterBandHiliteColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the outer-band highlight color of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShapeOuterBandShadowColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR ShapeOuterBandShadowColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the outer-band shadow color of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


ShapeOuterBandStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ShapeOuterBandStyle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the outer-band style of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

For a list of possible values, refer to ShapeOuterStyle.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeOuterBandThickness property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeOuterBandThickness
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the outer-band thickness of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

The unit of measure is determined by the ScaleMode property. and it is relative to the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS scales the value if necessary. If the scaled value equates to less than half a pixel, it is rounded to 0.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeTop property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeTop
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Persistent property, available at design time) Specifies the Y coordinate of the origin of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

Whether you draw to the screen or to the bitmap, shapes are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


ShapeWidth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ShapeWidth
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the width of a three-dimensional shape that you draw with the DrawShape method. The size, position, and other aspects of the shape are determined by a number of properties, as explained in Drawing Three-Dimensional Shapes and Text.

Whether you draw to the screen or to the bitmap, shapes are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DrawShape method
Topics: | Drawing Effects:3D Drawing Special Effects


SrcBottom property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long SrcBottom
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The Y coordinate of the bottom boundary of the source rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property.

See Also

Elements: | SrcTop property, SrcRight property, SrcLeft property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


SrcLeft property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long SrcLeft
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The X coordinate of the origin of the source rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property.

See Also

Elements: | SrcTop property, SrcRight property, SrcBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


SrcRight property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long SrcRight
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The X coordinate of the right boundary of the source rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property

See Also

Elements: | SrcLeft property, SrcTop property, SrcBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


SrcTop property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long SrcTop
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Set only property) The Y coordinate of the origin of the source rectangle used when painting the 3D drawing on a bitmap using DrawPersistence property

See Also

Elements: | SrcLeft property, SrcRight property, SrcBottom property,DrawEllipse method, DrawRectangle method, DrawLine method, DrawTextWidth method, DrawTextHeight method, DrawShape method, DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextAlign property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short TextAlign
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the alignment of a text object within a rectangle. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

For a list of possible values of the TextAlign property, refer to TextAlign Effects.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextAngle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short TextAngle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the angle of rotation of a text object. The angle is in tenths of degrees. Only TrueType fonts can be rotated.

You specify other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextHeight property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

SyntaxSyntax | float TextHeight
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the height of the rectangle in which a text object is positioned. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

Whether you draw to the screen or to the bitmap, text objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextHiliteColor property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR TextHiliteColor
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the highlight color of a text object. You specify other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

The highlight color is used only for the following TextStyle values:

FXD_TEXTSTYLE_INSETLIGHT
FXD_TEXTSTYLE_INSETEXTRALIGHT
FXD_TEXTSTYLE_INSETHEAVY
FXD_TEXTSTYLE_INSETEXTRAHEAVY
FXD_TEXTSTYLE_RAISEDLIGHT
FXD_TEXTSTYLE_RAISEDEXTRALIGHT
FXD_TEXTSTYLE_RAISEDHEAVY
FXD_TEXTSTYLE_RAISEDEXTRAHEAVY
FXD_TEXTSTYLE_OUTLINEBLOCK
FXD_TEXTSTYLE_MAX

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects
 | Using Color Values in LEADTOOLS


TextLeft property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float TextLeft
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the X coordinate of the origin of the rectangle in which a text object is positioned. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

Whether you draw to the screen or to the bitmap, text objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextStyle property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short TextStyle
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the style of a text object. You specify other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

For a list of possible values of the TextStyle property, refer to TextStyle Effects.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextTop property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float TextTop
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the Y coordinate of the origin of the rectangle in which a text object is positioned. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

Whether you draw to the screen or to the bitmap, text objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextWidth property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float TextWidth
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Specifies the width of the rectangle in which a text object is positioned. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

Whether you draw to the screen or to the bitmap, text objects are always positioned in the ILEADRasterView Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


TextWordWrap property (ILEADRasterFXD)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL TextWordWrap
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Determines whether words wrap within the rectangle in which a text object is positioned. You specify the rectangle and other aspects of the text object using related properties described in Drawing Three-Dimensional Shapes and Text.

The DrawText method draws the text object in the control's client area or on the current bitmap.

See Also

Elements: | DrawText method
Topics: | Drawing Effects:3D Drawing Special Effects


Clear method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void Clear (void);
Overview | Refer to Using the Image List Control.

Remarks

Removes all items from the ImageList Control and frees the memory associated with the items.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Insert method, Remove method, Count property, Sort method
Topics | Raster Images: Displaying Images


EnsureVisible method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long EnsureVisible (long nIndex );
Overview | Refer to Using the Image List Control.

Remarks

Scrolls the items in the ImageList Control such that the item specified is completely visible.

See Also

Elements: | Item property, Scroll event, ScrollItems method, ScrollStyle property, Insert method
Topics: | Raster Images: Displaying Images


ExportBitmapList method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ExportBitmapList(long nStart, long nItemsCount);
Overview | Refer to Using the Image List Control.

Remarks

Exports a number of bitmaps from the ImageList Control to a Bitmap List.

The list of bitmaps will be exported from the ImageList control into the ExportedBitmapList property starting from nStart to (nStart + nItemsCount –1).

See Also

Elements: | ExportedBitmapList property, ImportBitmapList method, Item property
Topics: | Raster Images: Displaying Images


HitTest method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long HitTest (float x, float y);
Overview | Refer to Using the Image List Control.

Remarks

Queries the specified location to determine if the point is over an ImageList Control item.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, AllowSelection property, ItemSelected event, Click event, MouseMove event, MouseDown event, MouseUp event.
Topics | Raster Images: Displaying Images


BitmapList Parameter For ImportBitmapList

BitmapList

Bitmap list that contains the bitmaps to be imported in the Image List control.


ImportBitmapList method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ImportBitmapList(long BitmapList, long nStart, long nItemsCount, BSTR pszDefaultText, BSTR pszExtendedText);
Overview | Refer to Using the Image List Control.

Remarks

Inserts a list of bitmaps into the ImageList Control.

The list of bitmaps found in the BitmapList parameter will be inserted into the Image List control starting from nStart to (nStart + nItemsCount –1).

See Also

Elements: | ExportedBitmapList property, ExportBitmapList method, Item property
Topics: | Raster Images: Displaying Images


Insert method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Insert (long Bitmap, BSTR pszText, long Data );
Overview | Refer to Using the Image List Control.

Remarks

Inserts a new item into the ImageList Control. Insertion occurs at the end of the list.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, InsertAt method, Remove method, Count property, Sort method, InsertFromBitmapList method, LoadFromFile method, SaveToFile method
Topics | Raster Images: Displaying Images


InsertAt method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InsertAt (long Bitmap, BSTR pszText, long Data, long nIndex );
Overview | Refer to Using the Image List Control.

Remarks

Inserts a new item into the ImageList Control at the specified index. All items past nIndex are pushed up one position. The index is zero-based.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Insert method, Remove method, Count property, Sort method, InsertFromBitmapList method, LoadFromFile method, SaveToFile method
Topics | Raster Images: Displaying Images


InsertFromBitmapList method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InsertFromBitmapList (long hBitmapList, BSTR pszDefaultText);
Overview | Refer to Using the Image List Control.

Remarks

Inserts new items into the ImageList Control from the specified LEAD Bitmap List. All items are inserted with the same Text attribute, specified in pszDefaultText. You can change this after the items are inserted using the Item collection property.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, InsertAt method, Remove method, Count property, Sort method, Insert method, LoadFromFile method, SaveToFile method
Topics | Raster Images: Displaying Images


LoadDatabase method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadDatabase (BSTR pszFilename);
Overview | Refer to Using the ImageList Control.

Remarks

Call this method to load items from a previously saved database (multipage TIFF file).

The text for each item will be read from the CMNT_SZNAMEOFPAGE comment.

See Also

Elements: | SaveToFile method, SaveDatabase method, LoadFromFile method
Topics: | Raster Images: Displaying Images


LoadFromFile method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadFromFile (BSTR pszFile, short nBits, long nStart, long nItems);
Overview | Refer to Using the ImageList Control.

Remarks

Inserts new items into the ImageList Control from the specified file. This method supports loading multiple pages from a multi-page file. All items are inserted with the same Text attribute, which is the filename. You can change this after the items are inserted using the Item collection property.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Insert method, InsertAt method, Remove method, Count property, Sort method, InsertFromBitmapList method, SaveToFile method
Topics | Raster Images: Displaying Images


Remove method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Remove (long nIndex);
Overview | Refer to Using the Image List Control.

Remarks

Removes the specified item from the ImageList Control and frees the memory associated with the item.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Insert method, InsertAt method, Count property, Sort method, InsertFromBitmapList method, LoadFromFile method, SaveToFile method
Topics | Raster Images: Displaying Images


SaveDatabase method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveDatabase (VARIANT_BOOL bSelected, BSTR pszFilename);
Overview | Refer to Using the ImageList Control.

Remarks

Call this method to save the ImageList's contents as a database (multipage TIFF file).

The items will be saved as pages in a multipage TIFF file.

The format of the pages will be as follows:

BitsPerPixel | Format
1 | FILE_CCITT_GROUP4
8 | FILE_TIF_PACKBITS
24 | FILE_JTIF
other | FILE_TIF

The text for each item will be saved in the CMNT_SZNAMEOFPAGE comment.

See Also

Elements: | SaveToFile method, LoadDatabase method, LoadFromFile method
Topics: | Raster Images: Displaying Images


SaveToFile method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveToFile (BSTR pszFile, short nFormat, short nBits, short nQFactor, VARIANT_BOOL bSelected);
Overview | Refer to Using the Image List Control.

Remarks

Saves the items from the ImageList Control into the specified file. This method supports saving into any of the multi-page file formats supported by LEADTOOLS. If bSelected is True, only the items with the Selected attribute of True are saved.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Insert method, InsertAt method, Remove method, Count property, Sort method, InsertFromBitmapList method, LoadFromFile method
Topics | Raster Images: Displaying Images


ScrollItems method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ScrollItems (long nAmount);
Overview | Refer to Using the ImageList Control.

Remarks

Scrolls the items in the ImageList Control by the specified amount. The direction of the scroll depends on the current setting for ScrollStyle.

See Also

Elements: | Item property, Scroll event, EnsureVisible method, ScrollStyle property, Insert method
Topics: | Raster Images: Displaying Images


SelectAll method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectAll (BOOL bFlag);
Overview | Refer to Using the ImageList Control.

Remarks

Selects or deselects all items in the ImageList Control.

Use this method to set the Selected attribute for all items to bFlag.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Clear method
Topics | Raster Images: Displaying Images


SetSelectionBitmap method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetSelectionBitmap (OLE_COLOR crTransparent, long Bitmap);
Overview | Refer to Using the Image List Control.

Remarks

Displays selected items using the specified user-defined bitmap when the SelectionStyle property is set to IMGLST_SELECTIONSTYLE_USERBITMAP. The specified bitmap will be drawn with the specified color as transparent, and will be centered around each selected item.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, ItemWidth property, ItemHeight property, SelectionStyle property
Topics | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


Sort method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Sort (BOOL bAscending);
Overview | Refer to Using the ImageList Control.

Remarks

Sorts the items in the ImageList Control based on their Text attribute.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, Insert method, InsertAt method, Count property, Remove method, InsertFromBitmapList method, LoadFromFile method, SaveToFile method
Topics | Raster Images: Displaying Images


SortExt method (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SortExt (VARIANT_BOOL bAscending, VARIANT_BOOL bCaseSensitive, VARIANT_BOOL bUseExtText, long lFlags);
Overview | Refer to Using the Image List Control.

Remarks

Like the Sort method, this method sorts the items in the ImageList Control. However this method has been extended to allow sorting based on either their Text (referenced in the Text property of the Item property) or their Extended Text (referenced in the TextExt property of the Item property) attribute.

See Also

Elements: | Item property, Insert method, InsertAt method, Count property, Remove method, InsertFromBitmapList method, LoadFromFile method, SaveToFile method
Topics: | Raster Images: Displaying Images


AllowSelection property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListAllowSelectionConstants AllowSelection
Overview | Refer to Using the Image List Control .

Remarks

(Persistent property, available at design time) Specifies whether or not automatic item selection is allowed.

If automatic item selection is enabled, items are automatically selected and de-selected when the user clicks on them using the mouse.

Value | Meaning
IMGLST_ALLOWSELECTION_NONE | Automatic selection is disabled, selection is manual
IMGLST_ALLOWSELECTION_SINGLE | Automatic selection of single items is enabled
IMGLST_ALLOWSELECTION_MULTI | Automatic selection of multiple items is enabled

The default setting is IMGLST_ALLOWSELECTION_NONE.

Note:

When IMGLST_ALLOWSELECTION_MULTI is enabled, the user can select multiple items using the mouse and the CTRL and SHIFT keys.

See Also

Elements: | SelectionStyle property, SelectionColor property, ItemSelected event, Item property, SelectAll method, HitTest method
Topics: | Raster Images: Displaying Images


Appearance property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Appearance
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Determines whether the ImageList Control has a flat or three-dimensional appearance.

Value | Meaning
IMGLST_APPEARANCE_FLAT | Flat appearance
IMGLST_APPEARANCE_THREED | Three-dimensional appearance

See Also

Elements: | ForeColor, ItemBackgroundColor property, BackColor, BorderColor, Font, BorderStyle
Topics: | Raster Images: Displaying Images


BackColor property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR BackColor
Overview | Refer to Using the Image List Control.

Remarks

Sets the background color of the ImageList Control.

See Also

Elements: | ForeColor property, ItemBackgroundColor property, BorderColor property, BorderStyle property, Font property, Appearance property
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


BitonalScaling property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListBitonalScalingConstants BitonalScaling
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Sets options to improve the display of bitonal bitmaps in the ImageList Control.

Setting | Description
IMGLST_BITONALSCALING_NORMAL | Causes bitonal images to be displayed normally when they are scaled.
IMGLST_BITONALSCALING_FAVORBLACK | Enables a bias in preserving black objects when displaying zoomed-out 1-bit images. This can prevent the disappearance of fine lines and details, but it slows down the display.
IMGLST_BITONALSCALING_SCALETOGRAY | Enables grayscaling of 1-bit images when they are displayed. This improves the readability of the images when they are zoomed in or zoomed out, but it slows down the display.

The default is IMGLST_BITONALSCALING_NORMAL.

See Also

Elements: | PaintDither property, PaintScaling property
Topics: | Raster Images: Displaying Images


BorderColor property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR BorderColor
Overview | Refer to Using the Image List Control.

Remarks

Sets the border color of the ImageList Control.

See Also

Elements: | ForeColor property, ItemBackgroundColor property, BackColor property, BorderStyle property, Font property, Appearance property
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


BorderStyle property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BorderStyle
Overview | Refer to Using the Image List Control.

Remarks

Sets the border style of the ImageList Control.

Value | Meaning
0 | No border.
1 | Place a single line border around the control.

See Also

Elements: | ForeColor property, ItemBackgroundColor property, BackColor property, BorderColor property, Font property, Appearance property
Topics: | Raster Images: Displaying Images


ColumnCount property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColumnCount
Overview | Refer to Using the Image List Control.

Remarks

(Read-only)(Runtime-only) Gets the current number of columns of items in the ImageList Control.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Insert method, Remove method, RowCount, Count property, Clear method, Item property
Topics | Raster Images: Displaying Images


ControlWindow property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ControlWindow
Overview | Refer to Using the Image List Control.

Remarks

(Read only) Is the handle of the actual contained ImageList Control window. Use this instead of the Window property to use GDI functions such as GetDC to directly draw on or send messages to the ImageList Control's window.

See Also

Elements: | Window property, BorderColor property, BackColor property, BorderStyle property, Appearance property
Topics: | Raster Images: Displaying Images


Count property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Count
Overview | Refer to Using the Image List Control.

Remarks

(Read-only)(Runtime-only) Gets the current number of items in the ImageList Control.

Note:

Item indexing begins with 0 and continues to Count - 1.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Item property, RowCount property, ColumnCount property, PageCount property, Insert method, EnsureVisible method, Remove method, Clear method
Topics | Raster Images: Displaying Images


CurrentPage property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CurrentPage
Overview | Refer to Using the Image List Controll.

Remarks

(Read-only)(Runtime-only) Gets the number of the currently visible page of items in the ImageList Control.

This will return the highest visible page number in the ImageList Control. Pages are calculated using the total number of rows or columns (depending on the scroll style) and the total number of rows or columns (depending on the scroll style) that are completely visible in the ImageList Control's client area. A page is not visible unless its first row/column is completely visible.

See Also

Elements: | PageCount property, Insert method, Remove method, RowCount property, ColumnCount property, Count property, Clear method, Item property, ScrollItems method
Topics: | Raster Images: Displaying Images


DisplayItemText property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL DisplayItemText
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies whether or not each Item's Text attribute is to be displayed as a label for the item.

The default setting is True.

See Also

Elements: | Font property, ItemBackgroundColor property, ItemWidth property, ItemHeight property, ItemVerticalSpacing property, ItemHorizontalSpacing property, Item property
Topics: | Raster Images: Displaying Images


EnableKeyboard property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableKeyboard
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Enables or disables the ImageList control's automatic processing of the keyboard.

Setting | Meaning
TRUE | ImageList Control will process the keyboard
FALSE | ImageList Control will not process the keyboard

When automatic keyboard processing is enabled, the ImageList Control will process the following keys:

Key | Event
PageUp |
Up Arrow |
Left Arrow | scroll up/left one item (depends on scroll style)
PageDown |
Down Arrow |
Right Arrow | scroll down/right one item (depends on scroll style)
Ctrl + PageUp |
Ctrl + Up |
Ctlr + Left |
Home | scroll up/left to beginning of list (depends on scroll style)
Ctrl + PageDown |
Ctrl + Down |
Ctlr + Right |
End | scroll up/left to end of list (depends on scroll style)

Note:

If the setting for AllowSelection is not IMGLST_ALLOWSELECTION_NONE, then the selected item will move up, down, left, or right, depending on the key(s) being processed. If AllowSelection is set to IMGLST_ALLOWSELECTION_MULTI, multiple items can be selected using the CTRL and/or SHIFT keys in conjunction with the keys listed above.

The default setting is True.

See Also

Elements: | ScrollStyle property, AllowSelection property
Topics: | Raster Images: Displaying Images


EnableMethodErrors property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Using the Image List Control.

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Topics:

Raster Images: Displaying Images


EnableOLEDragMethod property (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL EnableOLEDragMethod;
Overview | Refer to Drag and Drop.

Remarks

(Persistent property, available at design time) Enables or disables the OLE drag and drop operation in the image list Control. Possible values are:

Setting | Description
TRUE | Enables drag-and-drop operation.
FALSE | Disables drag-and-drop operation.

If EnableOLEDragMethod is TRUE:

an OLEStartDrag event will occur when the drag process begins,

an OLEDragOver event will occur repeatedly while the image is being dragged over the image list control, and

an OLECompleteDrag event will occur when the dragging process is over and the image is dropped.

In addition, an OLEGiveFeedback event will be fired repeatedly while the image is being dragged over the image list control to determine the visual feedback for the drag-and-drop operation.

The drag-and-drop operation will paste the selected image to another image list control.

Note:

Set this property to FALSE before closing the window or the operating system may not release the window.

See Also

Elements | OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


EnableUseDefaultCursor property (ImageList Control)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL EnableUseDefaultCursor;
Overview | Refer to Drag and Drop.

Remarks

(Persistent property, available at design time) Gets or sets a value that indicates whether to use the default cursor in the OLE drag and drop operation in the image list control. Possible values are:

Setting | Description
TRUE | Use the default Drag and Drop cursor.
FALSE | Use the custom cursor specified in the OLEDragCursor property.

See Also

Elements | OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


ExportedBitmapList property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ExportedBitmapList
Overview | Refer to Using the Image List Control.

Remarks

Bitmap list to be updated by the exported bitmaps.

See Also

Elements: | ImportBitmapList method, ExportBitmapList method, Item property
Topics: | Raster Images: Displaying Images


FirstVisibleItem property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long FirstVisibleItem
Overview | Refer to Using the Image List Control.

Remarks

(Read only) (Runtime only) Contains the index of the first visible item in the ImageList Control's view. This is a 0-based index.

See Also

Elements: | ViewSize property, RowCount property, ColumnCount property, Count property
Topics: | Raster Images: Displaying Images


Font property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | IFontDisp* Font
Overview | Refer to Using the Image List Control

Remarks

(Persistent property, available at design time) Specifies the Font object for displaying each item's Text attribute when DisplayItemText is set to True.

In Visual Basic, you can set the Font object's properties at design time by double-clicking the ImageList Control's Font property in the Properties window. At run time, you set these properties as in the following example:

LEADImgList1.Font.Name = "Arial".

The Font object has the following properties:

Property | Description
Bold | TRUE for bold text; FALSE for not bold.
Italic | TRUE for italic text; FALSE for not italic.
Name | Text string for name of the font. For example: "Times New Roman".
Size | Size of the font, in points. The maximum value s 2048 points.
StrikeThrough | TRUE for a line through the text; FALSE for no line.
Underline | TRUE for underlined text; FALSE for not underlined.
Weight | Possible runtime values are 400 for light and 700 for heavy.

See Also

Elements: | ForeColor property, ItemBackgroundColor property, BackColor property, BorderColor property, DisplayItemText property, Appearance property
Topics: | Raster Images: Displaying Images


ForeColor property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR ForeColor
Overview | Refer to Using the Image List Control.

Remarks

Sets the color to be used for drawing each item's Text attribute when DisplayItemText is set to True.

See Also

Elements: | DisplayItemText property, BorderColor property, ItemBackgroundColor property, BackColor property, BorderStyle property, Font property, Appearance property
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


Item property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterImageListItem Item(long Index)
Overview | Refer to Using the Image List Control.

Remarks

(Runtime-only) This property returns an item from the ImageList Control's collection of items.

The index of the first item is 0, and the index of the last item is Count -1.

The Item object has the following properties (attributes):

Property | Type | Description
Bitmap | Long | The handle of the item’s bitmap
Text | BSTR | The item’s text attribute.
Data | Long | Extra data for user-defined use.
Selected | VARIANT_BOOL | Selected flag. True if item is selected. False if item is not selected.
TextExt | BSTR | The item’s extended text attribute.

The Bitmap property can be used to copy or change the image that an item is displaying.

The Text property can be displayed as a label for the item if DisplayItemText is set to True.

The Data property can be used to store extra, user-defined information for each item.

The Selected property is used to indicate if an item is selected or not. When an item is selected, it is displayed according to the value set in the SelectionStyle and SelectionColor properties.

The TextExt property can be used to store an extra text string for the item. For example, you can store the filename in the Text property (which gets displayed in the control), and the fully qualified path and filename in the TextExt property.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Count property, RowCount property, PageCount property, ColumnCount property, Insert method, Remove method, Clear method, SelectAll method, SelectionStyle property, SelectionColor property
Topics | Raster Images: Displaying Images


ItemBackgroundColor property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR ItemBackgroundColor
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the color to use as the background of each item that is displayed.

The default setting is the return value of the Windows API GetSysColor(COLOR_BTNFACE).

See Also

Elements: | ItemWidth property, ItemHeight property, ItemVerticalSpacing property, ItemHorizontalSpacing property, DisplayItemText property
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


ItemHeight property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ItemHeight
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the height for displayed items. The unit of measure is determined by the ScaleMode property.

The default setting is 115 pixels.

See Also

Elements: | ItemBackgroundColor property, ItemWidth property, ItemVerticalSpacing property, ItemHorizontalSpacing property, DisplayItemText property
Topics: | Raster Images: Displaying Images


ItemHorizontalSpacing property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ItemHorizontalSpacing
Overview | Refer to Using the Image List Control Control.

Remarks

(Persistent property, available at design time) Specifies the horizontal distance between displayed items. The unit of measure is determined by the ScaleMode property.

The default setting is 5 pixels.

See Also

Elements: | ItemBackgroundColor property, ItemWidth property, ItemHeight property, ItemVerticalSpacing property, DisplayItemText property
Topics: | Raster Images: Displaying Images


ItemVerticalSpacing property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ItemVerticalSpacing
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the vertical distance between displayed items. The unit of measure is determined by the ScaleMode property.

The default setting is 5 pixels.

See Also

Elements: | ItemBackgroundColor property, ItemWidth property, ItemHeight property, ItemHorizontalSpacing property, DisplayItemText property
Topics: | Raster Images: Displaying Images


ItemWidth property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ItemWidth
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the width for displayed items. The unit of measure is determined by the ScaleMode property.

The default setting is 115 pixels.

See Also

Elements: | ItemBackgroundColor property, ItemHeight property, ItemVerticalSpacing property, ItemHorizontalSpacing property, DisplayItemText property
Topics: | Raster Images: Displaying Images


MouseIcon property (ILEADRasterImgList)

Visual Basic example

Other system

Syntax | IPictureDisp* MouseIcon
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Sets a custom mouse icon.

You can set this property to a cursor or icon file. Then, you can set the MousePointer property to 99 to implement the custom mouse icon.

See Also

Elements: | MousePointer property
Topics: | Raster Images: Displaying Images


MousePointer property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MousePointer
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Sets or returns the value that indicates the type of mouse pointer for the ImageList Control.

Setting | Meaning
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the MouseIcon property

See Also

Elements: | MouseIcon property
Topics: | Raster Images: Displaying Images


OLEDragCursor property (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | IPictureDisp* OLEDragCursor;
Overview | Refer to Drag and Drop.

Remarks

(Persistent property, available at design time) Gets or sets a custom mouse icon for the OLE drag-and-drop operation.

To use a custom mouse icon for the Drag and Drop operation, set this property to the desired icon and set the EnableUseDefaultCursor property to FALSE.

See Also

Elements | EnableUseDefaultCursor property, EnableOLEDragMethod property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event
Topics | Raster Images: Copying Images


OwnerDrawItems property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL OwnerDrawItems
Overview | Refer to Using the Image List Control.

Remarks

Enables or disables custom/user-defined painting of the ImageList Control's items. Possible values are:

Setting | Description
TRUE | The user is responsible for drawing each ImageList Control item when the OwnerDrawItem event occurs.
FALSE | The toolkit is responsible for drawing each ImageList Control item.

This property must be set to TRUE in order for the OwnerDrawItem event to occur.

See Also

Elements: | OwnerDrawItem event, Item property
Topics: | Raster Images: Displaying Images


PageCount property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PageCount
Overview | Refer to Using the Image List Control.

Remarks

(Read-only)(Runtime-only) Gets the current number of pages of items in the ImageList Control.

This will return the total number of pages of items in the ImageList Control. Pages are calculated using the total number of rows or columns (depending on the scroll style) and the total number of rows or columns (depending on the scroll style) that are completely visible in the ImageList Control's client area.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, CurrentPage property, Insert method, Remove method, RowCount property, ColumnCount property, Count property, Clear method, Item property, ScrollItems method
Topics | Raster Images: Displaying Images


PaintDither property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListPaintDitherConstants PaintDither
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the type of dithering to use when painting an image on a device with 256 colors or less in the ImageList Control.

Setting | Description
IMGLST_PAINTDITHER_ORDERED | Use ordered dithering.
IMGLST_PAINTDITHER_DIFFUSION | Use error diffusion.

The default is IMGLST_PAINTDITHER_ORDERED.

See Also

Elements: | BitonalScaling
Topics: | Raster Images: Displaying Images


PaintScaling property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListPaintScalingConstants PaintScaling
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Type of resizing to use when painting in the ImageList control. Possible values are:

Value | Meaning
IMGLST_PAINTSCALING_NORMAL | [0] normal resize (fastest)
IMGLST_PAINTSCALING_RESAMPLE | [1] bilinear interpolation (slower than IMGLST_PAINTSCALING_NORMAL, but produces better looking results)
IMGLST_PAINTSCALING_BICUBIC | [2] bicubic interpolation (slowest, best quality)

Default is IMGLST_PAINTSCALING_NORMAL, which is the fastest.

For 1-bit images, the PaintScaling is considered only if BitonalScaling is IMGLST_BITONALSCALING_NORMAL. Otherwise, the FavorBlack and ScaleToGray options take precedence over PaintScaling.

IMGLST_PAINTSCALING_BICUBIC produces the same result as IMGLST_PAINTSCALING_RESAMPLE when zooming out on an image.

See Also

Elements: | BitonalScaling property
Topics: | Raster Images: Displaying Images


RowCount property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RowCount
Overview | Refer to Using the Image List Control.

Remarks

(Read-only)(Runtime-only) Gets the current number of rows of items in the ImageList Control.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, Insert method, Remove method, ColumnCount property, Count property, Clear method, Item property
Topics | Raster Images: Displaying Images


ScaleHeight property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ScaleHeight
Overview | Refer to Using the Image List Control .

Remarks

(Persistent property, available at design time) Is the height of the client area of the ImageList Control.

This is the true client area. The unit of measure is determined by the ScaleMode property.

If you write this property, the actual height of the control does not change, but the current height is expressed using the value that you provide. This lets you use a custom coordinate system. For example, you could set the ScaleWidth and ScaleHeight both to 100; then express all coordinates as percentage offsets.

See Also

Elements: | ScaleMode property, ScaleTop property, ScaleLeft property, ScaleWidth property, ScaleMode property (ILEADRaster, ILEADRasterView)
Topics: | Raster Images: Displaying Images


ScaleLeft property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ScaleLeft
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Is the X coordinate of the origin, in a custom coordinate system, for the client area.

This value is always 0, unless you change it to implement a custom coordinate system.

See Also

Elements: | ScaleMode property, ScaleTop property, ScaleHeight property, ScaleWidth property, ScaleMode property (ILEADRaster, ILEADRasterView)
Topics: | Raster Images: Displaying Images


ScaleMode property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | RasterScaleModeConstants ScaleMode
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the unit of measure for the ImageList Control.

You can change the unit of measure at any time without affecting measurements that the ImageList Control maintains. The control accepts floating point values and converts them to pixels internally. This means, for example, that if you set a property value in twips, the value that you get back may be slightly different, since it is rounded to the nearest pixel.

Value | Meaning
0 | Indicates that one or more of the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties are set to custom values.
1 | Twips (1440 twips per logical inch; 567 twips per logical centimeter).
2 | Points (72 points per logical inch).
3 | Pixels (smallest unit of monitor or printer resolution).
4 | Characters (horizontal = 120 twips per unit; vertical = 240 twips per unit).
5 | Inches.
6 | Millimeters.
7 | Centimeters.

See Also

Elements: | ScaleTop property, ScaleLeft property, ScaleHeight property, ScaleWidth property, ScaleMode property (ILEADRaster, ILEADRasterView)
Topics: | Raster Images: Displaying Images


ScaleTop property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ScaleTop
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Is the Y coordinate of the origin, in a custom coordinate system, for the client area.

This value is always 0, unless you change it to implement a custom coordinate system.

See Also

Elements: | ScaleMode property, ScaleLeft property, ScaleHeight property, ScaleWidth property, ScaleMode property (ILEADRaster, ILEADRasterView)
Topics: | Raster Images: Displaying Images


ScaleWidth property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | float ScaleWidth
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Is the width of the client area of the ImageList Control.

This is the true client area. The unit of measure is determined by the ScaleMode property.

If you write to this property, the actual width of the control does not change, but the current width is expressed using the value that you provide. This lets you use a custom coordinate system. For example, you could set the ScaleWidth and ScaleHeight both to 100; then express all coordinates as percentage offsets.

See Also

Elements: | ScaleMode property, ScaleTop property, ScaleLeft property, ScaleHeight property, ScaleMode property (ILEADRaster, ILEADRasterView)
Topics: | Raster Images: Displaying Images


ScrollStyle property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListScrollStyleConstants ScrollStyle
Overview | Refer to Using the Image List Control .

Remarks

(Persistent property, available at design time) Specifies the direction the ImageList Control scrolls the displayed items.

Value | Meaning
IMGLST_SCROLLSTYLE_VERTICAL | Control has vertical scrollbar
IMGLST_SCROLLSTYLE_HORIZONTAL | Control has horizontal scrollbar

The default setting is IMGLST_SCROLLSTYLE_VERTICAL.

See Also

Elements: | Scroll event, ScrollItems method, EnsureVisible method
Topics: | Raster Images: Displaying Images


SelectedCount property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long SelectedCount
Overview | Refer to Using the Image List Control.

Remarks

(Read only) (Runtime only) Gets the number of currently selected items in the ImageList control

See Also

Elements: | Count property, SelectedItems property, Item property
Topics: | Raster Images: Displaying Images


SelectedItems property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5 example

Syntax | LEADImageListItem SelectedItems (long Index)
Overview | Refer to Using the Image List Control.

Remarks

(Runtime only) This property contains an array of the ImageList items that are currently selected in the ImageList Control.

For more information on the LEADImageListItem data type, refer to the Item property.

See Also

Elements: | Count property, SelectedItems property, Item property
Topics: | Raster Images: Displaying Images


SelectionColor property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR SelectionColor
Overview | Refer to Using the Image List Control.

Remarks

(Persistent property, available at design time) Specifies the color to use to display items that have the selected attribute when the SelectionStyle property is set to IMGLST_SELECTIONSTYLE_SELECTCOLOR.

The default setting is RGB(0, 0, 255).

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, AllowSelection property, SelectionStyle property, ItemSelected event, Item property, SelectAll method, HitTest method
Topics | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


SelectionStyle property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageListSelectionStyleConstants SelectionStyle
Overview | Refer to Using the Image List Control .

Remarks

(Persistent property, available at design time) Specifies the style used to display items that have the selected attribute.

Setting | Description
IMGLST_SELECTIONSTYLE_SELECTCOLOR | show selected items using the SelectionColor
IMGLST_SELECTIONSTYLE_PRESSEDBUTTON | show selected items as pressed buttons
IMGLST_SELECTIONSTYLE_USERBITMAP | show selected items using a user-defined bitmap.

The default setting is IMGLST_SELECTIONSTYLE_SELECTCOLOR.

See Also

Elements | ExportBitmapList method, ExportedBitmapList property, ImportBitmapList method, SortExt method, AllowSelection property, SelectionColor property, ItemSelected event, Item property, SelectAll method, HitTest method
Topics | Raster Images: Displaying Images


Window property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Window
Overview | Refer to Using the Image List Control

Remarks

(Read only) Is the handle of the ImageList Control.

See Also

Elements: | BorderColor property, BackColor property, BorderStyle property, Appearance property
Topics: | Raster Images: Displaying Images


ViewSize property (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ViewSize
Overview | Refer to Using the Image List Control.

Remarks

(Read only) (Runtime only) Contains the ImageList Control's view size.

The value of this property may be in rows or columns. The value depends on the current scroll style. If the ScrollStyle property is SCROLLSTYLE_VERTICAL, then the value will indicate rows. If the ScrollStyle property is SCROLLSTYLE_HORIZONTAL, then the value will indicate columns.

For more information on the LEADImageListItem data type, refer to the Item property.

See Also

Elements: | ScrollStyle property, FirstVisibleItem property
Topics: | Raster Images: Displaying Images


Click event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void Click (void);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user presses and releases a mouse button over the ImageList Control.

This is one of three events that occur in the following order:

1. | MouseDown event
2. | MouseUp event
3. | Click event

The first two events let you check which mouse button is pressed.

See Also

Elements: | Resize event, DblClick event, KeyDown event, KeyPress event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


DblClick event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void DblClick (void);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user double-clicks a mouse button over the ImageList Control. This is one of four events that occur in the following order when the user double-clicks a mouse button:

1. | MouseDown event
2. | Click event
3. | MouseUp event
4. | DblClick event

The MouseDown and MouseUp events let you check which mouse button is pressed.

See Also

Elements: | Resize event, Click event, KeyDown event, KeyPress event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


ItemSelected event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ItemSelected (long nIndex );
Overview | Refer to Using the ImageList Control.

Remarks

Occurs when an item’s Selected attribute is automatically set to True in response to the user clicking the item.

See Also

Elements: | AllowSelection property, SelectionStyle property, SelectionColor property, Item property
Topics: | Raster Images: Displaying Images


ItemUnSelected event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ItemUnSelected (long nIndex);
Overview | Refer to Using the ImageList Control.

Remarks

Occurs when an item’s Selected attribute is automatically set to False in response to the user clicking an item.

See Also

Elements: | AllowSelection property, SelectionStyle property, SelectionColor property, Item property, ItemSelected event
Topics: | Raster Images: Displaying Images


KeyDown event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void KeyDown (short KeyCode, short Shift);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user presses a key while the ImageList Control has the focus. (To interpret ANSI characters, use the KeyPress event.)

See Also

Elements: | Resize event, Click event, DblClick event, KeyPress event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


KeyPress event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void KeyPress (short KeyAscii);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user presses and releases an ANSI key.

See Also

Elements: | Resize event, Click event, DblClick event, KeyDown event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


KeyUp event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void KeyUp (short KeyCode, short Shift);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user releases a key while an object has the focus. (To interpret ANSI characters, use the KeyPress event.)

See Also

Elements: | Resize event, Click event, DblClick event, KeyPress event, KeyDown event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


MouseDown event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseDown (short Button, short Shift, float x, float y);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user presses a mouse button.

See Also

Elements: | Resize event, Click event, DblClick event, KeyPress event, KeyDown event, KeyUp event, MouseMove event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


MouseMove event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseMove (short Button, short Shift, float x, float y);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user moves the mouse over the ImageList Control.

See Also

Elements: | Resize event, Click event, DblClick event, KeyPress event, KeyDown event, KeyUp event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


MouseUp event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseUp (short Button, short Shift, float x, float y);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the user releases a mouse button.

See Also

Elements: | Resize event, Click event, DblClick event, KeyPress event, KeyDown event, KeyUp event, MouseMove event, MouseDown event, Scroll event
Topics: | Raster Images: Displaying Images


OLECompleteDrag event (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | void OLECompleteDrag (short Button, short Shift, long X, long Y);
Overview | Refer to Drag and Drop

Remarks

Occurs when the dragging operation is complete and the image is dropped.

See Also

Elements | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


OLEDragOver event (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | void OLEDragOver (short Button, short Shift, long X, long Y);
Overview | Refer to Drag and Drop

Remarks

Occurs repeatedly while dragging an image over the image list control. It also provides the I image list control with feedback pertaining to the cursor position and the button used in the drag and drop process.

See Also

Elements | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


OLEGiveFeedback event (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | void OLEGiveFeedback ();
Overview | Refer to Drag and Drop

Remarks

Occurs repeatedly while an image is being dragged over the image list control to determine the visual feedback for the drag-and-drop operation.

Note:

To use a custom cursor during the drag and drop process, set the OLEDragCursor property to the custom cursor and set the EnableUseDefaultCursor property to FALSE. Specify whether to use the default cursor or a custom cursor by setting the EnableUseDefaultCursor property within the OLEGiveFeedback event.

See Also

Elements | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


OLEStartDrag event (ILEADRasterImgList)

Visual Basic example

Visual C++ example

Syntax | void OLEStartDrag (short Button, short Shift, long X, long Y);
Overview | Refer to Drag and Drop

Remarks

Occurs when the drag-and-drop operation starts, if a drop can be accepted. A drag and drop can be accepted if the EnableOLEDragMethod property has been set to TRUE. If the drag and drop operation fails, this event will not be generated.

To start the drag-and-drop operation:

1. | Set the EnableOLEDragMethod property to TRUE.
3. | Select an image in this image list control.
4. | Press the left mouse button down on the same image list control and drag the selected image. The OLEStartDrag event will occur.

See Also

Elements | EnableOLEDragMethod property, OLEDragCursor property, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics | Raster Images: Copying Images


OwnerDrawItem event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | Void OwnerDrawItem (long nIndex, long hDC, float ItemLeft, float ItemTop, float ItemRight, float ItemBottom, float ItemBackLeft, float ItemBackTop, float ItemBackRight, float ItemBackBottom);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when an item in the ILEADRasterImgList object needs to be repainted. This event occurs only if the OwnerDrawItems property has been set to TRUE.

This event must be used for custom/user-defined painting of ImageList items.

See Also

Elements: | OwnerDrawItems property, Item property
Topics: | Raster Images: Displaying Images


Resize event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void Resize (void);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when the ImageList Control first appears and whenever the size of the control changes.

See Also

Elements: | Click event, DblClick event, KeyDown event, KeyPress event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Scroll event
Topics: | Raster Images: Displaying Images


Scroll event (ILEADRasterImgList)

Visual Basic example

Visual C++ 5.0 example

Syntax | void Scroll (void);
Overview | Refer to Using the Image List Control.

Remarks

Occurs when a user scrolls the items using the scrollbar.

See Also

Elements: | Resize event, DblClick event, KeyDown event, KeyPress event, KeyUp event, MouseMove event, MouseDown event, MouseUp event, Click event
Topics: | Raster Images: Displaying Images


DefaultOptions method (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | ILEADOptimizeOptions * DefaultOptions();
Overview | Refer to Image Optimization.

Remarks

Returns the default optimization options used by LEADTOOLS for optimizing an image.

This method will update the following properties:

JPEGQFactor property

PNGQFactor property

JPEGColorSpace property

Percent property

Distance property

PickSamePalette property

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


OptimizeBuffer method (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | short OptimizeBuffer(ILEADRasterVariant *pOrginalBuffer, ILEADRasterVariant **pOptimizedBuffer, ILEADOptimizeOptions * pOptimizeOptions, VARIANT_BOOL bOptimizeEvent);
Overview | Refer to Image Optimization.

Remarks

Optimizes a supported image format buffer and reduces its size using the passed optimization options.

The method will initialize the pOptimizedBuffer to hold the optimized image. Note that the image buffer to be optimized should be one of the LEAD Image Optimizer Supported Formats, otherwise the method will return an error.

You can optimize an image buffer in memory as follows:

1. | Save the image to be optimized (the original image) in memory. Use the SaveArray method to get the result in an ILEADRasterVariant variable. Pass this variable as the pOriginalBuffer parameter.
2. | Declare a variable of type ILEADRasterVariant and pass it as the pOptimizedBuffer parameter. This method will create it, if it’s not created, and fill it with the optimized image.
3. | Determine the optimization options to use, by doing one of the following:
 | Pass NULL to the pOptimizeOptions parameter to optimize the image buffer using the default optimization options.
 | Get the default optimization options by calling the DefaultOptions method, and update the values. Pass the updated optimization options to the pOptimizeOptions parameter.
4. | Call this method to optimize the image buffer and update the pOptimizedBuffer with the optimized buffer.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, OptimizeDir method. OnOptimize event
Topics: | Optimizer: Optimization Methods


OptimizeDir method (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | short OptimizeDir(BSTR pszDirectory, BSTR pszOptDirectory, ILEADOptimizeOptions * pOptimizeOptions, BSTR pszFileExt, VARIANT_BOOL bIncludeSubDirs, VARIANT_BOOL bOptimizeDirEvent);
Overview | Refer to Image Optimization.

Remarks

Optimizes a directory of images using the specified optimization options, and saves the optimized images to a new directory with the same hierarchy.

This method looks for all the selected and supported files in the pszDirectory directory and optimizes them using the optimization options passed in the pOptimizeOptions parameter. It then saves the optimized images to the pszOptDirectory directory.

Both the pszDirectory and pszOptDirectory parameters should contain a full path, complete with drive name. The pszDirectory parameter should contain the full path to the input (original) directory, and the pszOptDirectory parameter should contain the full path to the output (optimized) directory.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, OptimizeBuffer method, OnOptimizeDir event
Topics: | Optimizer: Optimization Methods


DirectoryInfo property (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | ILEADOptimizeDirInfo* DirectoryInfo;
Overview | Refer to Image Optimization.

Remarks

This property provides information about the image(s) being optimized.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


EnableMethodErrors property (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL EnableMethodErrors;
Overview | Refer to Image Optimization.

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Elements | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


OptimizingError property (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | Short OptimizingError;
Overview | Refer to Image Optimization.

Remarks

Gets or sets a value that indicates whether to continue or stop the optimization operation.

If this property is set to 1 during the OnOptimize event or OnOptimizeDir event, the optimizing operation will continue. To stop the optimizing operation, set this property to any value <> 1 in the OnOptimize event or OnOptimizeDir event.

See Also

Elements: | OrginalFileName property, OptimizedFileName property, StatusCode property, FilePercent property, TotalPercent property, TotalFolderFilesCount property, OptimizeOptions property, DefaultOptions method, OptimizeBuffer method, OptimizeDir method.
Topics: | Optimizer: Optimization Methods


OnOptimize Event (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | void OnOptimize (short nPercent);
Overview | Refer to Image Optimization.

Remarks

This event is fired repeatedly by the OptimizeBuffer method, to notify the user of the percentage of the optimization operation that has been completed. The event is fired for every 1% of the optimization that has been completed.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, OptimizeBuffer method. OnOptimizeDir event, OptimizingError property.
Topics: | Optimizer: Optimization Methods


OnOptimizeDir Event (ILEADRasterImgOpt)

Visual Basic example

Visual C++ example

Syntax | void OnOptimizeDir();
Overview | Refer to Image Optimization.

Remarks

Gives the user information about the image(s) being optimized by the OptimizeDir method.

See Also

Elements: | JPEGQFactor property, PNGQFactor property, JPEGColorSpace property, Percent property, Distance property, PickSamePalette property, OptimizeDir method, OnOptimize event, OptimizingError property.
Topics: | Optimizer: Optimization Methods


ArraySize method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ArraySize (ILEADRasterVariant * vMem);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Returns the size of the specified byte array.

To save a bitmap to a byte array in memory, refer to the SaveArray method.

See Also

Elements:

LoadMemory method, SaveArray method, SaveMemory method, LoadArray method,GetArrayInfoMethod


BitmapDataPath method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short (ILEADRaster *pRaster, BSTR pszURL);
Overview | Refer to Implementing Internet Features.

Remarks

Loads the specified bitmap asynchronously. The value can be a local pathname or an Internet URL.

To manage the loading, you can use the ReadyState property and the ReadyStateChange event.

The ReadyStateChange event can be used to determine the status of the transfer.

See Also

Elements: | ReadyState property, ReadyStateChange event, LoadOffset method
Topics: | Raster Images: Loading Files


CompactFile method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CompactFile(BSTR bstrSrcFile, BSTR bstrDstFile, long lFlags, long lPage, long uPages, short iModify, long lSavePage);
Overview | Refer to Loading and Saving Large TIFF Files

Remarks

Compacts TIFF files. It can also be used to copy or extract one or more pages from a TIFF file and copy them without recompression to another TIFF file.

Other properties of the ILEADRasterIO control can be used to control the behavior of the CompactFile method, as follows:

Use the LoadIFD property to designate the beginning of the source file. The lPage parameter of the CompactFile method designates the page relative to the virtual beginning of the source file. The virtual beginning of the file is:

the real beginning of the file, if the LoadIFD property is not set

or

the page indicated by LoadIFD, if the LoadIFD property is set.

Use the SaveIFD property to designate the beginning of the destination file. The lSavePage parameter of the CompactFile method designates the page relative to the virtual beginning of the destination file. The virtual beginning of the file is:

the real beginning of the file, if the SaveIFD property is not set

or

the page indicated by SaveIFD, if the SaveIFD property is set.

Use the iModify parameter to specify how to save a new page in a multipage file that supports insert and replace operations. In cases where there is conflict between iModify and lSavePage, the value of the iModify parameter takes precedence.

If you pass USE_MOTOROLA_ORDER to the lFlags parameter and you are creating a new file, the pages will be saved in Motorola byte order. If the flag is not passed, the pages will be saved in Intel byte order. If you are modifying an existing file, this flag has no meaning – the pages will be saved in the same byte order used in the file.

See Also

Elements: | Save method, Load method, GetFileInfo method, LoadIFD property, SaveIFD property
Topics: | Raster Images: Loading and Saving Large TIFF Files


CopyMarkers method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CopyMarkers(ILEADMarkers *Dst, ILEADMarkers *Src)
Overview | Refer to Markers.

Remarks

Copies the specified source collection of metadata markers to the specified destination ILEADMarkers object.

If Src is NULL, then the method will return ERROR_INVALID_BUFFER.

See Also

Elements: | Count property, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Load method, SetMarkers method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


DecodeABIC method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DecodeABIC(ILEADRasterVariant *pInputData, ILEADRasterVariant **pOutputData, long lAlign, long lWidth, long lHeight, VARIANT_BOOL bBiLevel);
Overview | Refer to Compressing and Decompressing Buffers.

Remarks

Decodes the ABIC data and updates the pOutputData parameter with the uncompressed raw data. This method decompresses 1-bit bi-level or 4-bit grayscale ABIC raw data.

See Also

Elements | EncodeABIC method
Topics | Raster Images: Compression Functionality


DeletePage method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DeletePage (BSTR pszName, long lPage);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Deletes the specified page from a multipage file that supports delete operations.

The following file formats support delete operations:

TIFF (most TIFF formats, including JTIF, but excluding EXIF)

PCX

Winfax

See Also

Topics:

Raster Images: Creating and Deleting Images


DeleteTag method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short DeleteTag(BSTR bstrFileName, short nPage, long uTag, long uFlags);
Overview | Refer to Implementing TIFF Tags

Remarks

Deletes a tag from a file, if the file format supports tags (TIFF or Exif).

If you want to delete the tag from a particular IFD in the file, set the SaveIFD property. This method will delete tags only from the main IFDs that make up an image. Some TIFF tags are themselves SubIFDs. You can delete tags from such SubIFDs by setting the SaveIFD property and specifying the IFD as above.

Notes: | The LFCMP filter is used to delete the tag from all the TIFF and Exif files.
 | Do not attempt to use this function to delete tags from inside an EnumTags event. If you want to delete tags that you enumerate, use the EnumTags event to add the tags to a list. Upon returning from the EnumFileTags method, you can delete all the tags from the list.
 | You should be careful when you delete non-custom tags (tags below 32768). If you delete the wrong tag, you might corrupt the TIFF file!

Note to the documentation team: the Raster Images: Maintaining TIFF Tags is a new topic.

See Also

Elements: | ReadTag method, WriteTag method, SetTag method, GetTagData method, EnumFileTags method, EnumTags event
Topics | Raster Images: Maintaining TIFF Tags


EncodeABIC method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EncodeABIC(ILEADRasterVariant *pInputData, long lAlign, long lWidth, long lHeight, LEADRasterVariant **pOutputData, VARIANT_BOOL bBiLevel);
Overview | Refer to Compressing and Decompressing Buffers.

Remarks

Compresses the input raw data using the ABIC encoder.

This method compresses the input raw data to 1-bit bi-level or 4-bit grayscale ABIC data.

See Also

Elements | DecodeABIC method
Topics | Raster Images: Compression Functionality


EnumFileGeoKeys method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | short EnumFileGeoKeys(BSTR bstrFile, long uFlags, long lPage);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Enumerates all the GeoKeys in a GeoTIFF file.

For multipage GeoTIFF files, you can enumerate the tags from a particular page. Specify the page number on which to enumerate the keys using the lPage parameter.

The EnumGeoKeys event is called for each GeoKey value stored in the three standard GeoTIFF tags (34735, 34736 and 34737). For enumerating the other standard GeoTIFF information stored as separate tags, you can use the EnumFileTags method. Or you can call the ReadTag method for each of these tags (since there are not that many of them to warrant the use of EnumFileTags method).

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


EnumFileTags method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short EnumFileTags(BSTR bstrFileName, long lPage, long uFlags);
Overview | Refer to Implementing TIFF Tags

Remarks

Enumerates all the tags in a file. Currently, only TIFF and Exif files contain tags.

For multipage TIFF files, you can enumerate the tags from a particular page.

This function enumerates the standard TIFF tags and the user tags. Standard TIFF tags are less than 32767. User TIFF tags are usually between 32768 and 65535.

If you abort firing the EnumTags event by setting the StopFireEnumTags property to TRUE, then the EnumTags method returns an error.

Do not attempt to use the DeleteTag method to delete tags from inside an EnumTags event function. If you want to delete tags that you enumerate, use the EnumTags event to add the tags to a list. Upon returning from the EnumFileTags method, you can delete all the tags from the list.

To read a tag value, call the ReadTag method.

See Also

Elements: | ReadTag method, WriteTag method, SetTag method, GetTagData method, EnumTags event, StopFireEnumTags property
Topics | Raster Images: Maintaining TIFF Tags


FeedLoad method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short FeedLoad (ILEADRasterVariant * pvBuffer, long iSize);
Overview | Refer to Loading a Bitmap from Your Own Buffer.

Remarks

Supplies image data to the file-load process from a buffer that you provide.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

Use this method with the StartFeedLoad method and the StopFeedLoad method. For a description of how the methods relate to each other, refer to the StartFeedLoad method.

See Also

Elements: | LoadStatus property
Topics | Raster Images: Loading Files


GetArrayInfo method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetArrayInfo (ILEADRaster* pRaster, ILEADRasterVariant * vMem, long lPage, long iSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Gets information about a file that is stored in memory.

This method updates the following properties:

InfoBits property

InfoCompress property

InfoFormat property

InfoHeight property

InfoPage property

InfoSizeDisk property

InfoSizeMem property

InfoWidth property

To save an image to a file in memory, refer to the SaveArray method. To load an image from a file in memory, refer to the LoadArray method.

Note: You cannot save a multipage file using the SaveArray method, but if you get a multipage file into memory in some other way, you can specify a page when using the GetArrayInfo method or the LoadArray method.

See Also

Elements: | GetFileInfo method, GetMemoryInfo method
Topics: | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


GetFileInfo method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetFileInfo (ILEADRaster* pRaster, BSTR pszName, long lPage, long uFlags);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets information about the specified file.

This method updates the following properties:

InfoAnimation property

InfoAnimationHeight property

InfoAnimationWidth property

InfoBits property

InfoCompress property

InfoFormat property

InfoHeight property

InfoPage property

InfoPCDRes property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoViewPerspective property

InfoWidth property

InfoXRes property

InfoYRes property

See Also

Elements | ColorSpace property, GetMemoryInfo method
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images


GetGeoKey method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | short GetGeoKey(long uTag);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Gets the information that is ready to be saved as GeoKeys in a GeoTIFF file.

You can use this method to obtain GeoKey information that will be saved the next time you save a GeoTIFF (FILE_GEOTIFF) file.

If you want to get the GeoKey information from a particular file, use the ReadFileGeoKey method.

Calling this method will update the following properties:

GeoKeyType property

GeoKeyCount property

GeoKeyData property

To set the GeoKey information, update all of the properties referenced above and call the SetGeoKey method.

See Also

Elements: | SetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


GetLayerMaskBitmap method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetLayerMaskBitmap(ILEADRaster *pRaster, ILEADRaster *pRasterMask, short iLayer);
Overview | Refer to Layers in Files

Remarks

Gets the mask bitmap for the layer. The mask bitmap is an 8-bit grayscale bitmap. The value of each pixel in the mask layer bitmap determines the transparency of the corresponding layer bitmap. A value of 0 represents full transparency while a value of 0xFF represents complete opacity. Intermediate values represent translucency. If the mask bitmap does not exist, then the layer is considered to be visible (it is as if the mask bitmap contained only 0xFF pixels.

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

See Also

Elements:

LayerBlendModeKey property, LayerOpacity property, LayerLeft property, LayerClipping property, LayerTop property, Save method, SaveLayers property


GetLoadResolution method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetLoadResolution (short iFormat);
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

Get the last values set by the SetLoadResolution method. These values determine the physical resolution of the PhotoCD, FlashPix, or JBIG file to be loaded.

This method sets the LoadResolutionCount property to 1 and updates the following properties with the current values:

LoadResolutionHeight property

LoadResolutionWidth property

See Also

Elements: | ReadLoadResolutions method, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, SaveResolutionCount property, SaveResolutionHeight property, SaveResolutionWidth property
Topics: | Raster Images: Loading Files


GetMemoryInfo method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetMemoryInfo (ILEADRaster* pRaster, long hMem, long lPage, long iSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Gets information about a file that is stored in memory.

This method updates the following properties:

InfoBits property
InfoCompress property
InfoFormat property
InfoHeight property
InfoPage property
InfoSizeDisk property
InfoSizeMem property
InfoWidth property

To save an image to a file in memory, refer to the SaveMemory method. To load an image from a file in memory, refer to the LoadMemory method.

Note: You cannot save a multipage file using the SaveMemory method, but if you get a multipage file into memory in some other way, you can specify a page when using the GetMemoryInfo method or the LoadMemory method.

See Also

Elements | ColorSpace property, GetFileInfo method
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


GetServerBitmap method (ILEADRasterIO)

Visual Basic example

Other systems

Syntax | short GetServerBitmap (ILEADRaster *pRaster, long pServer);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Copies the specified LEAD OLE Server control's bitmap to the LEAD Raster Object.

You can use this method with the SetServerBitmap method to take advantage of the different capabilities of the LEAD Com Objects and the OLE server. For more information on the OLE server, refer to LEAD OLE Server .

See Also

Elements: | SetServerBitmap method
Topics: | Raster Images: Exchanging Images with Other Objects


GetTagCount method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetTagCount (long lTag);
Overview | Refer to Implementing TIFF Tags

Remarks

Returns the number of data values associated with the specified tag.

For more information on setting tags, refer to the SetTag method.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, GetTagType method, GetTagData method, ReadTag method, SetTag method, WriteTag method, Save method, Comment property
Topics: | Raster Images: Getting and Setting File Information


GetTagData method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ILEADRasterVariant * GetTagData (long lTag);
Overview | Refer to Implementing TIFF Tags

Remarks

Returns the data associated with the specified tag.

The number of values in the array can be retrieved using GetTagCount method. The type of values can be retrieved using GetTagType method. Note that if the type is TAG_RATIONAL, then each element is represented with two LONG values: the numerator and denominator. So for a Rational tag, you have twice as many entries in the array: the even index elements in the array contain the numerators and the odd indexes contain the denominators.

For more information on setting tags, refer to the SetTag method.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, GetTagCount method, GetTagType method, ReadTag method, SetTag method, WriteTag method, Comment property, Save method
Topics: | Raster Images: Getting and Setting File Information


GetTagType method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetTagType(long lTag);
Overview | Refer to Implementing TIFF Tags

Remarks

Returns the data type of the specified tag.

If the tag type is rational, then each element is represented by two longs. Otherwise, the size of each element is indicated by its type. (An element of type TAG_LONG is type long. An element of type TAG_SHORT is type short. etc.)

For more information on setting tags, refer to the SetTag method.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, GetTagCount method, GetTagData method, ReadTag method, SetTag method, WriteTag method, Comment property, Save method
Topics: | Raster Images: Getting and Setting File Information


IgnoreFilters method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short IgnoreFilters (BSTR pszFilters);
Overview | Refer to Loading Filters

Remarks

Specifies which file filters LEADTOOLS should NEVER load, even if present. Use this method if you never want to load a particular file filter(s). This is useful for instance if you never load AVI files and you want to ignore the AVI filter since this filter on its own loads all the DLLs required for Video for Windows (there are about 10 of them).

The files specified in PreLoadFilters take priority over the files specified in IgnoreFilters. This means that if the filter is present in pszFilters for both methods, then the filter will be loaded and will not be ignored.

Note that IgnoreFilters has effect only if called prior to loading, saving or getting information about a file. Calling this method after that will have no effect.

See Also

Elements | PreLoadFilters method
Topics | Working with the Control: General Behavior, Files To Be Included With Your Application


InstallFilter method (ILEADRasterIO)

JAVA Script example

Syntax | VARIANT_BOOL InstallFilter(BSTR bstrFilterName, VARIANT_BOOL bSilent);
Overview | Refer to Using LEAD RasterIO COM Object To Install LEAD Static Filters From Within A Web Page.

Remarks

Before using this method you should call SetFilterURL method must be called to set a url for the filter you want to install. The InstallFilter method checks the registry for the specified Filter name. If filter name is xxx then the search will be under the following registry key HKEY_LOCAL_MACHINE\Software\LEAD Filters\xxx.

if the key does not exist, the method creates it, downloads a cab file from the internet and extracts the xxx filter dll to the system directory. Note that if the parameter bSilent = TRUE, then no user interface is displayed during the process.

Upon successful filter installation, this method will create a key

in the system registry for the filter that was installed.

For example, if LFCMP14S.DLL (LEAD CMP/JPEG filter) is installed:

HKEY_LOCAL_MACHINE\SOFTWARE\LEAD Filters\CMP

You can delete this key from the registry in order to force re-installation of the filter.

See Also

Elements:

SetFilterURL method


J2KSetDefaults method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short J2KSetDefaults ();
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Updates the J2K properties with the default values used when saving a JPEG 2000 file. To change the values used when saving a JPEG 2000 file, set the following properties:

J2KCBS_ErrorResilienceSymbol property

J2KCBS_PredictableTermination property

J2KCBS_ResetContextOnBoundaries property

J2KCBS_SelectiveACBypass property

J2KCBS_TerminationOnEachPass property

J2KCBS_VerticallyCausalContext property

J2KCodBlockHeight property

J2KCodBlockWidth property

J2KCompressionControl property

J2KCompressionRatio property

J2KDecompLevel property

J2KDerivedBaseExponent property

J2KDerivedBaseMantissa property

J2KDerivedQuantization property

J2KGuardBits property

J2KProgressOrder property

J2KSetDefaults method

J2KTargetFileSize property

J2KUseColorTransform property

J2KUseEPHMarker property

J2KUseSOPMarker property

J2KXOsiz property

J2KXTOsiz property

J2KXTsiz property

J2KYOsiz property

J2KYTOsiz property

J2KYTsiz property

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


Load method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Load (ILEADRaster *pRaster, BSTR pszName, short iBitsPerPixel, long lPage, long lPages);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Loads one or more images from a file into the ILEADRaster object. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

When loading an image from a file, LEADTOOLS normally determines the file format from the header. If the format is unrecognized, or there is no header, an error is returned. Raw Fax files do not have headers, therefore a LoadInfo event must be sent when loading raw Fax files.

For supported formats, refer to Summary of All Supported Image File Formats.

To load an image from a specific location within a file, use the following method:

LoadOffset method

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

See Also

Elements | FastLoad property, CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property, LoadStatus property, LoadStamp method, BitmapDataPath method, LoadMemory method, StartFeedLoad method, LoadInfo event, EnableProgressEvent property, SetLoadResolution method, PCDResolution property, WMFResolution property, LoadOffset method
Topics | Raster Images: Loading Files
 | Raster Images: Creating and Maintaining Lists of Images
 | Handling CMYK Files as Separate Bitmaps


LoadArray method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadArray (ILEADRaster *pRaster, ILEADRasterVariant * vMem, short iBitsPerPixel, long lPage, long lPages, long lSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Loads an image from a file that is stored in memory. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

For supported formats, refer to Summary of All Supported Image File Formats.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

To save an image to a file in memory, refer to the SaveArray method.

Note: You cannot save a multipage file using the SaveArray method, but if you get a multipage file into memory in some other way, you can use the LoadArray method to load a specific page from the file.

See Also

Elements: | LoadMemory method, SaveArray method, SaveMemory method
Topics: | Raster Images: Loading Files


LoadArray2 method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadArray2 (ILEADRaster *pRaster, VARIANT vMem, short iBitsPerPixel, long lPage, long lPages, long lSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Loads an image from a file that is stored in memory. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

For supported formats, refer to Summary of All Supported Image File Formats.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

To save an image to a file in memory, refer to the SaveArray method.

Note: You cannot save a multipage file using the SaveArray method, but if you get a multipage file into memory in some other way, you can use the LoadArray2 method to load a specific page from the file.

See Also

Elements: | LoadMemory method, SaveArray method, SaveMemory method, LoadArray method
Topics: | Raster Images: Loading Files


LoadBuffer method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadBuffer(ILEADRaster *pRaster, long lBufferAddress, short iBitsPerPixel, long lPage, long lPages, long lSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Loads an image from a file that is stored in memory. The ‘lBufferAddress’ is the address of the memory buffer. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

For supported formats, refer to Summary of All Supported Image File Formats.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Topic Selection.

To load an image from a file in memory, use one of the following methods:

LoadMemory—use this if you have a global handle to the file in memory

LoadArray—use this if you have a VARIANT byte array that contains the file in memory

LoadBuffer—use this if you have the address of a memory location that contains the file in memory

To save an image to a memory file, use one of the following methods:

SaveMemory—returns a global handle to a file in memory

SaveArray—returns a VARIANT byte array that contains the file in memory

SaveBuffer—saves a file into a memory location that the user allocates

See Also

Elements: | SaveBuffer method, SaveBufferSize property, SaveBufferAddress property, EnableSaveBufferEvent property, SaveBuffer event, Load method, LoadStamp method, BitmapDataPath method, StartFeedLoad method, LoadInfo event, EnableProgressEvent property, SetLoadResolution method, PCDRes property, WMFResolution property, LoadArray method, LoadMemory method, SaveArray method, SaveMemory method
Topics: | Raster Images: Loading Files


LoadFileCMYKArray method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadFileCMYKArray(BSTR bstrFileName, long nBitsPerPixel, long lPage);
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Loads CMYK TIFF files as CMYK files and avoids the color space conversion to RGB.

This method will fail if the page being loaded is not TIFF CMYK. However, not all pages in the file have to be CMYK, just the page being loaded.

All the bitmaps in the array must have the same width, height, bits per pixel and palette.

If the data does not have to be loaded as CMYK, use one of the regular load functions: the LoadResize method, the Load method, the LoadOffset method, or the LoadMemory method.

To convert the CMYK array to a regular BGR bitmap and use the other functions, or to save to a file format other than TIFF CMYK, use the ColorMerge method and pass COLORSEP_CMYK to the Flags parameter. If alpha information is included, use the BitmapAlpha property to set the alpha bitmap.

To load a non-CMYK file as an array of color planes, use the LoadResize method, the Load method, the LoadOffset method, or the LoadMemory method and then call the ColorSeparate method and the BitmapAlpha property.

Set the RasterIO property and the CMYKRasterCount property before loading CMYK Raster bitmaps by calling the LoadFileCMYKArray method.

This method will update the following property:

CMYKRaster property

You can use the LoadIFD property to designate the beginning of the file. . The lPage parameter of the LoadFileCMYKArray method designates the page relative to the virtual beginning of the file. The virtual beginning of the file is:

the real beginning of the file, if the LoadIFD property is not set

or

the page indicated by LoadIFD, if the LoadIFD property is set.

To paint a CMYK raster list, pass a valid RasterIO object to the RasterIO property and pass TRUE to the EnablePaintCMYKArray property.

Call the SaveFileCMYKArray method to save this array as a CMYK TIFF file.

Note that if you pass 5 raster bitmaps to the LoadFileCMYKArray method and the file does not have alpha information, the 5th bitmap in the array will not be allocated.

Image processing can be performed on each individual bitmap in the array, thereby processing each color plane separately.

Support for 16-bit grayscale images is only available in the Document/Medical Imaging editions.

See Also

Elements: | CMYKRaster property, CMYKRasterCount property, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property
Topics | Raster Images: Loading Files


LoadLayer method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadLayer(ILEADRaster *pRaster, BSTR pszName, short iBitsPerPixel, short iLayer);
Overview | Refer to Layers in Files

Remarks

Loads a layer from a file that contains layers. To determine whether a file contains layers, check the InfoLayers property.

Currently, only PSD files support layers, but not all PSD files contain layers.

The layers are numbered starting with 0. The first layer is 0; the second layer is 1, etc. Call the GetFileInfo method to update the InfoLayers property. The last layer in the file is InfoLayers - 1.

After a layer is loaded, the LayerLeft(0) and LayerTop(0) properties can be examined for positioning information on this layer.

See Also

Elements: | LayerLeft property, LayerTop property, Save method, SaveLayers property, GetFileInfo method, InfoLayers property
Topics: | Raster Images: Loading Files


LoadMemory method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadMemory (ILEADRaster *pRaster, long hMem, short iBitsPerPixel, long lPage, long lPages, long iSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Loads an image from a file that is stored in memory. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

For supported formats, refer to Summary of All Supported Image File Formats.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

To get information about a file stored in memory, refer to the GetMemoryInfo method. To save an image to a file in memory, refer to the SaveMemory method.

Note: You cannot save a multipage file using the SaveMemory method, but if you get a multipage file into memory in some other way, you can use the LoadMemory method to load a specific page from the file.

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property, LoadStatus property, Load method, LoadStamp method, BitmapDataPath method, StartFeedLoad method, LoadInfo event, EnableProgressEvent property, SetLoadResolution method, PCDResolution property, WMFResolution property, LoadOffset method
Topics | Raster Images: Loading Files
 | Handling CMYK Files as Separate Bitmaps


LoadOffset method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadOffset (ILEADRaster *pRaster, BSTR pszName, long nOffsetBegin, long nBytesToLoad, short iBitsPerPixel, long lPage, long lPages)
Overview | Refer to Loading a Bitmap from a File.

Remarks

Loads an image from a file from a specified location. Calling this method allows an image file that is embedded in another file to be loaded. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed. If an image does not exist at the specified location or the specified image size does not match the size of the embedded image, the method will return an error.

When loading an image from a file, LEADTOOLS normally determines the file format from the header. If the format is unrecognized, or there is no header, an error is returned. Raw Fax files do not have headers, therefore a LoadInfo event must be sent when loading raw Fax files.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

For supported formats, refer to Summary of All Supported Image File Formats.

This method is similar to the Load method with the following difference: the file can be loaded starting at any file offset

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property, LoadStatus property, Load method, LoadStamp method, BitmapDataPath method, LoadMemory method, StartFeedLoad method, LoadInfo event, EnableProgressEvent property, SetLoadResolution method, SaveOffset Method
Topics: | Raster Images: Loading Files Multipage File Formats Loading a Bitmap from a File Summary of All Supported Image File Formats
 | Handling CMYK Files as Separate Bitmaps


LoadResize method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadResize(ILEADRaster *pRaster, BSTR pszName, float fWidth, float fHeight, LoadResizeConstants Flags, short iBitsPerPixel);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Loads an image file into the LEAD Raster object, resizing the bitmap as it loads, to the desired width, height, and bits per pixel. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

This method resizes a file as it loads, to the desired width, height, and bits per pixel.

Note that the original file is not completely loaded into memory. This method is ideal for sampling large images (i.e. generating a thumbnail) without the memory overhead of loading the large file itself.

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property, Load method
Topics | Raster Images: Loading Files
 | Handling CMYK Files as Separate Bitmaps


LoadStamp method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadStamp (ILEADRaster *pRaster, BSTR pszName);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Loads a thumbnail image stored in a JFIF or LEAD CMP compressed file.

Note that not all CMP or JFIF compressed files contain thumbnail images.

See Also

Elements | LoadStatus property, SaveWithStamp method, EnableProgressEvent property, PCDResolution property, SetLoadResolution method, WMFResolution property, LoadOffset method
Topics | Raster Images: Loading Files
 | Raster Images: Loading and Saving Stamp Images


PreLoadFilters method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PreLoadFilters (short iFixedFilters, short iCachedFilters, BSTR pszFilters);
Overview | Refer to Loading Filters

Remarks

Specifies the file format filters to be loaded. Some operating systems (like Windows 95) have a limit for the number of DLLs that can be loaded at a time and that limit can be quickly reached, especially if there are several different controls on the same page/form or if the programming environments themselves load many DLLs. You can use this method to restrict the number of DLLs that LEADTOOLS COM objects will load. Note that the fewer file import/export DLLs the COM objects load, the slower the loading/saving of files will be, since there will be more loading/unloading of DLLs.

pszFilters is in the form xyz, yuv... where XYZ are the 3 letters describing the file filter as in LFxyz14S.DLL. For instance, if pszFilter is PCX, TIF, CMP then LFPCX14S.DLL will be loaded then LFTIF14S.DLL and then LFCMP14S.DLL, in that order. The first iFixedFilters will stay in memory at all times, then the next iCachedFilters will be loaded. However, if other filters will be needed, the cached filters might be unloaded to make room for the new DLLs. It is recommended that the most commonly used DLLs be loaded as fixed to minimize the time required to load/unload file filters. Also, some DLLs may require additional DLLs (like the LFAVI14S.DLL or LFFPX14S.DLL) so the exact number of DLLs loaded is not necessarily iFixedFilters+iCachedFilters. For more information on available DLLs, refer to Files To Be Included With Your Application.

Note that PreLoadFilters has effect only if called before the first time you try to load, save or get information about a file. Calling this method after that will have no effect.

See Also

Elements | IgnoreFilters method
Topics | Working with the Control: General Behavior


ReadComment method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ILEADRasterVariant * ReadComment (ILEADRaster* pRaster, BSTR pszFile, long lPage, short iIndex);
Overview | Refer to Maintaining File Comments.

Remarks

Returns the value of the specified comment in an image file.

Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. With the ReadComment method, you can get the value of any comment in the file. The index into the array of comments determines the type of comment, as described in Types of File Comments.

The Comment property specifies the comments to be saved when you save an image in a file. If you want to preserve existing comments in the file when you save the image, you must use the ReadComment method to update the Comment property array.

See Also

Elements | ReadFileCommentOffset method, Comment property, WriteComment method
Topics | Raster Images: Getting and Setting File Information


ReadFileCommentOffset method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short ReadFileCommentOffset(BSTR bstrFileName, long nOffsetBegin, long nBytesToLoad, long uType, ILEADRasterVariant * pVarComment);
Overview | Refer to Maintaining File Comments

Remarks

Reads a comment from a file and lets you specify the location of the image data within the file. This enables you to read comments from an image file that is embedded in another file.

Like the ReadComment method, this method lets you read comments that are already saved in a file header. The only difference between the ReadComment method and this method is that this method allows you to specify an offset for the image data. For more information refer to the Comment property.

The location of the image is specified as shown in the following simple illustration:

Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. When you save a file, the comments, which LEADTOOLS maintains in a global array, are saved in the file. The index into the array (specified using a constant) determines the type of comment, as described in Types of File Comments.

Before saving a file, set the Comment property to specify the comments to be saved.

See Also

Elements: | ReadComment method, SaveOffset method, Comment property
Topics | Raster Images: Getting and Setting File Information
 | Raster Images: Maintaining File Comments


ReadFileGeoKey method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | short ReadFileGeoKey(BSTR bstrFile, long uTag);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Gets the specified GeoKey information from a TIFF file. This method is provided to support GeoKeys that you define.

You can use this method to obtain the GeoKey information from a particular file.

The most efficient way of reading the GeoKeys in a file is to enumerate them with EnumFileGeoKeys method and then read each GeoKey with ReadFileGeoKey.

Calling this method will update the following properties:

GeoKeyType property

GeoKeyCount property

GeoKeyData property

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


ReadLoadResolutions method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ReadLoadResolutions (BSTR pszFile);
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

Examines a FlashPix, PhotoCD, or JBIG file to determine which resolutions it contains.

A FlashPix, PhotoCD, or JBIG file can contain more than one copy of the same image, each at a different physical resolution (width and height in pixels). For PhotoCD files, the resolutions are fixed sizes, and you can use an older property (the InfoPCDRes property) to examine them. For FlashPix and JBIG files, which can contain images of various sizes, you must use this method to examine them.

This method updates an array of the available dimensions, which you can examine with the following properties:

LoadResolutionCount property

LoadResolutionHeight property

LoadResolutionWidth property

To specify which physical resolution to load, use the SetLoadResolution method.

See Also

Elements | ColorSpace property, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveResolutionCount property, SaveResolutionHeight property, SaveResolutionWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


ReadTag method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ReadTag (LPCTSTR pszFile, long lPage, long lTag);
Overview | Refer to Implementing TIFF Tags

Remarks

Reads the specified tag from the specified file. The tag will be set as tag 0 in the control’s internal tag list. Once read, the type, number of data values and actual data values can be retrieved using the GetTagType method, the GetTagCount method and the GetTagData method.

For more information on setting tags, refer to the SetTag method.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, SetTag method, GetTagType method, GetTagCount method, GetTagData method, WriteTag method, Save method, Comment property
Topics: | Raster Images: Getting and Setting File Information


ReadTagMemory method (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short ReadTagMemory (long hMem, long lPage, long lTag, long lSize);
Overview | Refer to Implementing TIFF Tags.

Remarks

Reads the specified tag from the specified file that is stored in memory. The tag will be set as tag 0 in the control’s internal tag list. Once read, the type, number of data values and actual data values can be retrieved using the GetTagType method, the GetTagCount method and the GetTagData method.

For more information on setting tags, refer to the SetTag method.

See Also

Elements: | ReadTag method, SetTag method, GetTagType method, GetTagCount method, GetTagData method, WriteTag method, Save method, Comment property
Topics: | Raster Images: Getting and Setting File Information


Save method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Save (ILEADRaster *pRaster, BSTR pszName, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, short iModify);
Overview | Refer to Saving a Bitmap to a File.

Remarks

Saves the bitmap to a file in any of the supported compressed or uncompressed formats.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For a list of available products, refer to Summary of LEADTOOLS Products.

If the bitmap is 8 bits per pixel or greater, use the LEAD CMP format or one of the JPEG (JTIF or JFIF) formats to save disk space. You can set the ProgressivePasses property if you want to save a CMP or JFIF file as a progressive file.

If the bitmap is 1-bit per pixel, use the LEAD 1-bit format or a CCITT Group 3 or 4 format to save disk space.

For CCITT Group 3 and 4 formats, the first RGBQUAD structure in the bitmap's palette determines the white component of the image. If the rgbRed field is 0, then all 0 bits in the image are assumed to be black. Otherwise, all zero (0) bits in the image are assumed white.

If you save an animated GIF file, all bitmaps in the bitmap list are saved. Also, the following properties update global fields in the file:

AnimationPalette property

AnimationBackColor property

AnimationHeight property

AnimationWidth property

AnimationLoop property

This method does not support signed data images, but only DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | SaveWithStamp method, SaveMemory method, SaveTileHeight property, SaveTileWidth property
Topics | Raster Images: Saving Files
 | Raster Images: Creating and Maintaining Lists of Images
 | Saving a Region


SaveArray method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ILEADRasterVariant * SaveArray (ILEADRaster *pRaster, RasteFileConstants Format, short iBitsPerPixel, QFactorConstants Quality);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

To see the correct data types, refer to the code example for your development system.

To load an image from a file in memory, refer to the LoadArray method.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For a list of available products, refer to Summary of LEADTOOLS Products.

Note: You cannot save a multipage file using the SaveArray method, but if you get a multipage file into memory in some other way, you can use the LoadArray method to load a specific page from the file.

You can calculate the size using the following:

Size = UBound(variant) – LBound(variant) + 1

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | LoadArray method, LoadMemory method, Save method, SaveTileHeight property, SaveTileWidth property
Topics | Raster Images: Saving Files
 | Saving a Region


SaveBuffer method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveBuffer(ILEADRaster *pRaster, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, short iModify);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Saves a bitmap to a file in memory. It is up to the user to allocate the memory that will hold the bitmap file. If the memory allocated by the user is not large enough to accommodate the image, the SaveBuffer event will be fired so that the memory location can be reallocated.

It is advisable to set the EnableSaveBufferEvent property to TRUE so that the SaveBuffer event can be fired. If the EnableSaveBufferEvent property is set to FALSE and the allocated memory is not large enough to accommodate the image, the SaveBuffer event will not be fired and the method will fail.

Note that this method is different from the SaveArray method and SaveMemory method in that the user is completely responsible for allocating the memory to hold the bitmap file. To avoid having to handle the allocating/deallocatingof the memory, use either the SaveArray method or the SaveMemory method.

An overview of the process follows:

1. | Set the EnableSaveBufferEvent property to TRUE.
2. | Allocate a section of memory.
3. | Set the SaveBufferAddress property to the address of the allocated memory.
4. | Set the SaveBufferSize property equal to the size of the allocated memory.
5. | Call the SaveBuffer method.
6. | In the SaveBuffer event, reallocate the memory to be AT LEAST as large as the size requested by the event. Then set the SaveBufferAddress property to the address of the memory location (if it has changed), and set the SaveBufferSize to the size of the reallocated memory buffer. If you cannot reallocate the required memory size, set the EnableSaveBufferEvent property to FALSE to cause the SaveBuffer method to abort.
7. | When you are finished using the file in memory, free the memory that you have allocated.

The output can be in any of the supported compressed or uncompressed file formats.

To see the correct data types, refer to the code example for your development system.

To load an image from a file in memory, use one of the following methods:

LoadMemory—use this for a global handle to the file in memory

LoadArray—use this for a VARIANT byte array that contains the file in memory

LoadBuffer—use this for an address of a memory location that contains the file in memory

To save an image to a memory file, use one of the following methods:

SaveMemory—returns a global handle to a file in memory

SaveArray—returns a VARIANT byte array that contains the file in memory

SaveBuffer—saves a file into a memory location that the user allocates

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

This method does not support signed data images, but only DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | SaveBufferSize property, SaveBufferAddress property, EnableSaveBufferEvent property, LoadArray method, LoadMemory method, LoadBuffer method, SaveArray method, SaveMemory method, Save method, SaveTileHeight property, SaveTileWidth property
Topics | Raster Images: Saving Files
 | Saving a Region


SaveFileCMYKArray method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveFileCMYKArray(BSTR bstrFileName, long nFormat, long nBitsPerPixel, long nQFactor, long uFlags, VARIANT_BOOL bSavePlanar);
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Saves an array of bitmaps as a CMYK TIFF file.

This method saves a CMYK file without performing a color conversion. Each raster bitmap in the array that is specified by the CMYKRaster property will contain one of the C (cyan), M (magenta), Y (yellow), K (black), or Alpha planes. The Alpha plane is optional. The CMYKRaster property should have:

4 elements if no Alpha information is included

or

5 elements if the Alpha information is included

CMYK TIFF files can be saved as planar (each bitmap in its own plane) or chunky (the data from all the bitmaps is interleaved while saving). Planar images will be saved faster, while chunky images are more compatible (some TIFF readers will not read planar files) and require less memory during the load process. The default is to save chunky files. To save a file as planar, pass TRUE to bSavePlanar.

To load the array of bitmaps, use the LoadFileCMYKArray method.

To save the array of bitmaps to a file format not supported by this function, call the ColorMerge method to create a BGR bitmap and save the generated bitmap using the Save method.

See Also

Elements: | CMYKRaster property, CMYKRasterCount property, LoadFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property
Topics | Raster Images: Saving Files


SaveList method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveList(LPDISPATCH pRaster, BSTR pszFileName, long lFormat);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Saves MRC images contained in a bitmap list to a file using the MRC LEAD, standard Proprietary T44 or PDF format.

Use this method to save a list of bitmaps as a TIF file using the Standard T44 format (if the nFormat value is FILE_TIF_MRC), as a TIF file with a LEAD MRC subtype format (if the nFormat value is FILE_TIF_LEAD_MRC), or as a multipage PDF using segmentation capabilities (if the lFormat value is FILE_PDF_LEAD_MRC). If lFormat is FILE_TIF_MRC or FILE_TIF_LEAD_MRC, *.TIF is the default file extension. If lFormat is FILE_PDF_LEAD_MRC, *.PDF is the default file extension.

Use the SaveList method to save a list of bitmaps as a TIF file with a Standard T44 subtype format, LEAD MRC subtype format, or PDF file, based on the LEAD segmentation technique, if you want to:

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

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

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

All formats supported by this method generate multi-page files (TIF, or PDF). The number of pages in the file is either the value in MRCRasterCount property or the number of images in pRaster, whichever is smaller.

Use the SaveT44, or Save methods to save a single image or to append, inset overwrite to already existing TIF file.

It is best to perform segmentation for all images in the list before calling the SaveList method. Segmentation can be performed automatically by calling the AutoSegmentExt method, or performed manually by calling the CreateNewSegment method.

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

SEGTYPE_BACKGROUND

SEGTYPE_ONECOLOR

SEGTYPE_TEXT_1BIT_BW

SEGTYPE_TEXT_1BIT_COLOR

SEGTYPE_TEXT_2BITBW

SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_GRAYSCALE_2BIT

SEGTYPE_GRAYSCALE_8BIT

SEGTYPE_PICTURE

Each element in MRCRaster array will contains a segment for each bitmap in the pRaster.

If there is an element in the MRCRaster array that does not contain a segment then the method will automatically segment the bitmaps in pRaster by calling AutoSegmentExt method. The AutoSegmentExt method maps the text, grayscale and picture segments into layers (mask, background and foreground layers) as defined in the NLS* model of the T.44 standard. A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44. For more information on Mixed Raster Content (MRC) formats, refer to General Information.

Note that the Grayscale2BitCoder, Grayscale8BitCoder, and the Grayscale8BitQFactor properties are used only with the FILE_TIF_LEAD_MRC formats. The Text2BitCoder property is used with the FILE_TIF_LEAD_MRC and FILE_PDF_LEAD_MRC formats only.

See Also

Elements | StartSegmentation method, StopSegmentation method, SetSegmentData method, DeleteSegment method, CombineSegments method, EnumSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, AutoSegmentExt method
Topics | Saving a Bitmap to a File
 | Raster Images: Creating and Maintaining Lists of Images
 | Saving Capabilities
 | Raster Images: Saving a Page


SaveMemory method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SaveMemory (ILEADRaster *pRaster, long* phMem, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, long* piSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

To use this method, do the following:

1. | Declare a variable of the appropriate data type to reference the file in memory. You can then pass its address (pass the variable by reference) in this method, which will allocate the memory, save the bitmap, and unlock the memory.
2. | Declare a long integer variable for the file-size. You can then pass its address in this method, which will update its value with the size of the file.
3. | Call this method to save the bitmap in the specified memory handle.

To see the correct data types, refer to the code example for your development system.

To get information about a file stored in memory, refer to the GetMemoryInfo method. To load an image from a file in memory, refer to the LoadMemory method.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

For a list of available products, refer to Summary of LEADTOOLS Products.

Note: You cannot save a multipage file using the SaveMemory method, but if you get a multipage file into memory in some other way, you can use the LoadMemory method to load a specific page from the file.

This method does not support signed data images, but only DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | Save method, SaveWithStamp method , SaveTileHeight property, SaveTileWidth property
Topics | Raster Images: Saving Files
 | Saving a Region


SaveMemory2 method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | Short SaveMemory2 (LPDISPATCH pRaster, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, short iModify);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats, and includes multi-page files.

To use this method, do the following:

1. | Assign an OLE_HANDLE to the SaveMemory2Handle property to reference the file in memory.
2. | Call this method to save the bitmap in the specified memory handle.

To see the correct data types, refer to the code example for your development system.

To get information about a file stored in memory, refer to the GetMemoryInfo method. To load an image from a file in memory, refer to the LoadMemory method.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images, but DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

The following file formats support append operations (iModify = SAVE_APPEND):

TIFF (most TIFF formats, including JTIF but excluding EXIF)
PCX
FlashPix
AWD
Winfax
GIF

The following file formats support replace operations (iModify = SAVE_REPLACE):

TIFF (most TIFF formats, including JTIF but excluding EXIF)
PCX

The following file formats support insert operations (iModify = SAVE_INSERT):

TIFF (most TIFF formats, including JTIF but excluding EXIF)
PCX

See Also

Elements: | SaveMemory2Handle property, SaveMemory2Size property, Save method, SaveMemory method, SaveWithStamp method , SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveOffset Method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SaveOffset(ILEADRaster *pRaster, BSTR pszName, long iOffsetBegin, RasterFileConstants iFormat, short iBitsPerPixel, QFactorConstants iQuality, short iModify);
Overview | Refer to Saving a Bitmap to a File.

Remarks

This method is similar to the Save method with the following differences:

1. | the file can be saved starting at any file offset
2. | When saving an animated GIF, only the first bitmap in the list saved
3. | The FileSizeWritten property is updated with total file size (in bytes)

For more information, see the documentation for the Save method.

This method does not support signed data images, but only DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | SaveWithStamp method, SaveMemory method, SaveTileHeight property, SaveTileWidth property, LoadOffset method
Topics | Raster Images: Saving Files, Raster Images: Creating and Maintaining Lists of Images
 | Saving a Region


SaveWithStamp method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SaveWithStamp (ILEADRaster* pRaster, BSTR pszName, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, float fStampWidth, float fStampHeight, short iStampBits);
Overview | Refer to Saving a Bitmap to a File.

Remarks

Saves the specified bitmap to create a JPEG or LEAD CMP output file that includes a thumbnail (stamp) image.

Neither the width nor the height of the stamp can exceed 255 pixels. In addition, the following overall size limitations apply:

If you save an 8-bit stamp, the following calculation cannot exceed 65,535: (width * height) + 778.

If you save a 24-bit stamp, the following calculation cannot exceed 65,535: (width * height * 3) + 10.

The method will return an error (ERROR_INV_RANGE) if you exceed any of these size limitations. Because the limitations are in pixels, it is best to work with the ScaleMode property set to pixels.

If you are working with compressed (JPEG) Exif files, the stamp size has been restricted to 160x120x24. When you call SaveWithStamp method and specify that you want to save a compressed Exif file, the StampWidth, StampHeight and StampBits parameters are ignored. They are assumed to be 160 (StampWidth), 120 (StampHeight) and 24 (StampBits). That limitation has been imposed in order to conform with the ExifR98 interoperability rules imposed by japanese digital camera manufacturers.

If you are working with uncompressed (TIFF) Exif files, the stamp size is (width x height x 24 bpp), with no limitations on width and height.

The stamp image can be retrieved by calling the LoadStamp method.

See Also

Elements: | LoadStamp method, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files
 | Raster Images: Loading and Saving Stamp Images


SetFilterUrl method (ILEADRasterIO)

JAVA Script example

SyntaxSyntax | short SetFilterUrl (BSTR bstrValue)
Overview | Refer to Using LEAD RasterIO COM Object To Install LEAD Static Filters From Within A Web Page.

Remarks

Sets the full URL for the filter to be installed. Filters are installed using the InstallFilter method. The URL must be set in this property before calling the InstallFilter method.

Upon successful filter installation, this method will create a key in the system registry for the filter that was installed. For example, if LFCMP14S.DLL (LEAD CMP/JPEG filter) is installed:

HKEY_LOCAL_MACHINE\SOFTWARE\LEAD Filters\CMP

You can delete this key from the registry in order to force re-installation of the filter.

See Also

Elements:

InstallFilter method


SetGeoKey method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | short SetGeoKey(long uTag);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Sets the GeoKey information to be saved in a file.

This method copies the data in the GeoKeyData property into an internal list of buffers maintained by RasterIO.

Any GeoTIFF file that you save will include the GeoKey information set until you clear the GeoKey information. To save this information to a file, save FILE_GEOTIFF files.

To clear a particular GeoKey, set the values of the GeoKeyType and GeoKeyCount properties to 0.

To clear all the GeoKeys, set the values of the GeoKeyType and GeoKeyCount properties to 0 and pass 0 to the uTag parameter of this method.

The information set will be saved in the files into three TIFF tags:

GeoKeyDirectoryTag: 34735 (0x87AF) – this tag will store all the keys and the SHORT values.

GeoDoubleParamsTag: 34736 (0x87B0) – this tag will store the DOUBLE values.

GeoAsciiParamsTag: 34737 (0x87B1) – this tag will store the ASCII values.

SetGeoKey will overwrite any values saved for these tags previously using the SetTag method.

You can get the last value set with SetGeoKey using the GetGeoKey method.

To write the GeoKey information directly to an existing file, call the WriteFileGeoKey method.

Note that LEADTOOLS does not verify the validity of the GeoKeys that you set. It is your responsibility to make sure you write correct values according to the GeoTIFF specification.

This method sets the GeoKeys using the values of the following properties:

GeoKeyType property

GeoKeyCount property

GeoKeyData property

To get the current values for the above properties, call the GetGeoKey method.

When setting the GeoKey information prior to calling the SetGeoKey method, set the GeoKeyCount property, to determine the number of items in the GeoKeyData property, then set the new information in the GeoKeyData property, and then call the SetGeoKey method.

See Also

Elements: | GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


SetLayerMaskBitmap method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetLayerMaskBitmap(ILEADRaster *pRaster, ILEADRaster *pRasterMask, short iLayer);
Overview | Refer to Layers in Files

Remarks

Sets the mask bitmap for the layer. The mask bitmap is an 8-bit grayscale bitmap. The value of each pixel in the mask layer bitmap determines the transparency of the corresponding layer bitmap. A value of 0 represents full transparency while a value of 0xFF represents complete opacity. Intermediate values represent translucency. If the mask bitmap does not exist, then the layer is considered to be visible (it is as if the mask bitmap contained only 0xFF pixels.

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

See Also

Elements:

LayerBlendModeKey property, LayerOpacity property, LayerLeft property, LayerClipping property, LayerTop property, Save method, SaveLayers property


SetLoadResolution method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetLoadResolution (ILEADRaster* pRaster, RasterFileConstants Format, float fWidth, float fHeight);
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

Specifies the physical resolution (width and height) of the FlashPix or PhotoCD file to load.

For PhotoCD files, you can do either of the following:

Specify one of the exact sets of dimensions in the file. You can determine the available dimensions using the ReadLoadResolutions method.

Specify 0 for both dimensions to load the default resolution.

For FlashPix files, you can do any of the following:

Specify one of the exact sets of dimensions in the file. You can determine the available dimensions using the ReadLoadResolutions method.

Specify either the desired width or desired height to load, and use 0 to get the default for the other dimension. The default preserves the aspect ratio. The load procedure resizes the bitmap while loading it if necessary.

Specify 0 for both dimensions to load the default resolution.

For JBIG files, you can do any of the following:

Specify 0 for both dimensions to load the default resolution, which is the highest resolution layer, which corresponds to the image with its FULL DIMENSIONS.
Ex: If the file contains the image at the following dimensions: 800X600, 400X 300 and 200X150, then in the default case the filter will load the image at 800X600.

Specify either the desired width or desired height to load, and use 0 to get the default for the other dimension. The load procedure will determine the closest resolution layer, which best fits the user's request.
Ex: If the file contains the image at the following dimensions: 800X600, 400X 300 and 200X150 and the user requests an image with width equal to 780 for example, then LEADTOOLS will automatically know that the proper width is 800 and load the image at the (800X600) resolution.

Specify one of the exact sets of dimensions in the file. You can determine the available dimensions using the ReadLoadResolutions method.

See Also

Elements: | ReadLoadResolutions method, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, GetLoadResolution method, Load method, LoadMemory method, LoadStamp method , LoadOffset method
Topics: | Raster Images: Loading Files


SetMarkers method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetMarkers(ILEADMarkers *Marker, long lFlags)
Overview | Refer to Markers.

Remarks

Set the metadata markers to be used in the current thread.

All save operations performed in this thread will use these markers until SetMarkers is called again.

A copy of these markers will be made.

Pass NULL to the Marker parameter to clear any markers previously set by SetMarkers.

Comments set by setting the Comment property and calling the Save method, the SaveMemory method or the WriteComment method will override comments contained in the markers.

Tags set with SetTag will overwrite any user-defined tags contained in the markers.

If the Save method is instructed to save a stamp, the stamp will be regenerated from the bitmap and will override whatever Exif stamp is present in the markers.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Save method, SaveBuffer method, SaveMemory method, SaveOffset method, SaveMemory method, SaveLayers method, TransformFile method, Type property, WriteMetaData method
Topics: | Raster Images: Markers


SetServerBitmap method (ILEADRasterIO)

Visual Basic example

Other systems

Syntax | short SetServerBitmap (long pServer);
Overview | Refer to Copying and Creating Bitmaps.

Remarks

Copies the ILEADRaster bitmap to the specified LEAD OLE Server control.

You can use this method with the GetServerBitmap method to take advantage of the different capabilities of the ILEADRaster object and the OLE server. For more information on the OLE server, refer to LEAD OLE Server.

See Also

Elements: | GetServerBitmap method
Topics: | Raster Images: Exchanging Images with Other Objects


SetTag method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetTag (long lTag, short iType, long lCount, ILEADRasterVariant * vData);
Overview | Refer to Implementing TIFF Tags

Remarks

Sets tags to be written to a file. The set tags will actually be written when the WriteTag method or one of the SaveXXX methods is called. This process is similar to the process of writing comments to files using the Comment property and the WriteComment method or Save method.

Only TIFF files support tags. The TIFF specification reserved tags 1 to 32767 for general use (restricted tags) and recommends that tags 32768 to 65535 should be used for application use (user-defined tags). To avoid two applications using the same user-defined tag, it is also recommended that the user-defined tags should be registered with the TIFF administrator (Adobe).

The contact address for the TIFF administrator, as of Nov 5, 1999 is:

Adobe Developers Association

1585 Charleston Road

P.O. Box 7900

Mountain View, CA 94039

E-mail: devsup-person@adobe.com

The control will maintain a list of tags that have been set. To remove a tag from the list, call SetTag(lTag, 0, 0, NULL).

To remove all tags from the list, call SetTag(0,0,0,NULL). Note that ReadTag method uses tag 0, so you cannot set it by calling SetTag.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, WriteTag method, ReadTag method, GetTagData method, GetTagCount method, GetTagType method, Comment property, Save method
Topics: | Raster Images: Getting and Setting File Information


StartFeedLoad method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short StartFeedLoad (ILEADRaster* pRaster, short iBitsPerPixel, long lPage, long lPages);
Overview | Refer to Loading a Bitmap from Your Own Buffer.

Remarks

Initializes a file-load process in which you control the input stream. You must call the FeedLoad method to supply buffered data, and you must call StopFeedLoad method when the loading is complete.

This file-load process is useful when receiving transmitted images, such as those on the Internet. It works the same way as the Load method , except that your code supplies the image data. The file-load process works as follows:

1. | You call the StartFeedLoad method to initialize the file-load process.
2. | You create a buffer, and each time you fill it with information, you call the FeedLoad method, which sends the data to the file-load process just as if the data were being read from a file on disk.
3. | Whenever it has enough data to do so, the file-load process behaves the same as in the Load method. It allocates and begins loading the bitmap. It generates a ProgressStatus event whenever it has enough data in its input buffer.
 | The file-load process does not update information in the ILEADRaster Object until the StopFeedLoad method is called.
4. | To end the file-load process, you call the StopFeedLoad method, which cleans up the process. If you call this method before supplying the complete file, it will successfully clean up the process, but will return a file-read error. You should trap the error if the load is canceled purposely.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Elements | LoadStatus property, Load method, LoadStamp method, BitmapDataPath method, LoadMemory method, LoadOffset method
Topics | Raster Images: Loading Files


StopFeedLoad method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short StopFeedLoad ();
Overview | Refer to Loading a Bitmap from Your Own Buffer.

Remarks

Ends a file-load process in which you control the input stream. This cleans up all the variables and buffers allocated by the StartFeedLoad method and the FeedLoad method, and resets all internal variables to their default settings.

You must call this method to complete a file load that was started with the StartFeedLoad method. If you call this method before supplying the complete file, it will successfully clean up the process, but will return a file-read error. You should trap the error if the load is canceled purposely.

For a description of how the methods relate to each other, refer to the StartFeedLoad method.

See Also

Topics:

Raster Images: Loading Files


TransformFile method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short TransformFile(BSTR pszNameSrc, BSTR pszNameDst, TransformFileConstants Transform, long lPage);
Overview | Refer to Examining and Altering Bitmaps

Remarks

Performs a lossless transformation for certain formats. Currently, only JPEG, CMP and JPEG TIFF formats are supported.

The flip and reverse flags can be combined with the rotate flags. More than one rotate flags cannot be combined.

Be careful when combining flags, because unexpected results are possible. For example, combining flip, reverse and 180 degree rotation produces a no-transform. Flip and reverse produce a 180 degree rotation which, when combined with another 180 degree rotation produces a 0 degree rotation (a no-transform).

The rotation transformations are performed before the flip/reverse operations.

See Also

Elements: | TransformMarker event, WriteMarker method, WriteMarkerAction property
Topics: | Raster Images: Doing Geometric Transformations


WriteComment method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short WriteComment (BSTR pszFile, long lPage);
Overview | Refer to Maintaining File Comments

Remarks

Write comments to an existing file.

This method writes all the comments set in the Comment property to the specified file, just like the Save method. However, the WriteComment method only writes the comments to the file. It does not overwrite the image stored in the file with the control’s bitmap. Any comments already in the file will be overwritten.

For more information on setting comments, refer to the Comment property. For more information on saving files, refer to the Save method. For information on reading comments, refer to the ReadComment method.

See Also

Functions: | ReadFileCommentOffset method, Comment property, Save method, ReadComment method
Topics: | Raster Images: Getting and Setting File Information


WriteFileGeoKey method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | short WriteFileGeoKey(BSTR bstrFile, long lPage, short iModify);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Writes GeoKeys to a file or changes the existing GeoKeys in a file.

This method writes to or changes the GeoKeys in an existing file.

This method will write all the GeoKeys that have been set using the SetGeoKey method. There must be at least one GeoKey set for this method to work. If no GeoKeys have been set, an error will be returned by this method.

This method works only with TIFF files.

If you also want to write the other TIFF tags and comments, use the WriteMetaData method instead of this method.

Note:

Use this method carefully. LEADTOOLS will not restrict the GeoKeys that you write. If you write bad GeoKeys, the file might become corrupted. Consult the GeoTIFF specification documentation for a list of GeoKeys.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


WriteMarker method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short WriteMarker(short iMarker, long lSize, ILEADRasterVariant *vData);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Writes the transformed marker to the file.

This method can only be called from inside the TransformMarker event.

After calling this method, it is best to set the WriteMarkerAction property to WRITEMARKER_SKIP. Otherwise, this marker can occur twice in the file.

See Also

Elements: | WriteMarkerAction property
Topics: | Raster Images: Doing Geometric Transformations


WriteMetaData method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short WriteMetaData(BSTR FileName, long lFlags)
Overview | Refer to Markers.

Remarks

Writes metadata of the specified type to the specified file.

This method can be used to update an existing file (fileName) with comments, tags and/or markers.

The comments are set by setting the Comment property and then calling either the Save method, the SaveMemory method or the WriteComment method.

The tags are set by calling the SetTag method, prior to calling this method.

The markers are set by calling the SetMarkers method, prior to calling this method.

See Also

Elements: | Count property, CopyMarkers method, CreateMarkers method, DeleteMarker method, DeleteMarkerAt method, Element property, ElementCount property, EnumerateMarkers event, EnumMarkers method, GetMarker method, GetMarkers method, InsertMarker method, Save method, SaveBuffer method, SaveMemory method, SaveOffset method, SaveMemory method, SaveLayers method, SetMarkers method, TransformFile method, Type property
Topics: | Raster Images: Markers


WriteTag method (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short WriteTag (LPCTSTR pszFile, long lPage);
Overview | Refer to Implementing TIFF Tags

Remarks

Writes the tag(s) to the specified file.

For more information on setting tags, refer to the SetTag method.

See Also

Functions: | DeleteTag , EnumFileTags method, EnumTags event, StopFireEnumTags property, SetTag method, ReadTag method, GetTagType method, GetTagCount method, GetTagData method, Save method, Comment property
Topics: | Raster Images: Getting and Setting File Information


CMYKRaster property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

SyntaxSyntax | LPDISPATCH CMYKRaster(short iIndex)
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Gets or sets the CMYK Raster list to be used with the LoadFileCMYKArray method and the SaveFileCMYKArray method.

This property is updated by the LoadFileCMYKArray method.

The CMYK Raster list contains raster bitmaps for each of the color planes. This list should contain 4 or 5 raster bitmaps, depending on whether the alpha channel information needs to be loaded. The raster bitmaps are in this order: C (cyan), M (magenta), Y (yellow), K (black), Alpha (optional).

Set this property before calling the EnablePaintCMYKArray property.

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property
Topics | Raster Images: Loading Files


CMYKRasterCount property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CMYKRasterCount
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Gets or sets the number of raster bitmaps in the CMYK Raster list that is specified by the CMYKRaster property.

Pass 4 if the alpha raster bitmap is not needed, or 5 if the alpha bitmap is needed.

Set this property before calling the LoadFileCMYKArray method or the EnablePaintCMYKArray property.

See Also

Elements: | CMYKRaster property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property
Topics | Raster Images: Loading Files


ColorSpace property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ColorSpace
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets the color space of the file. Possible values are:

Value | Meaning
COLORSPACE_BGR | [0] Color space is RGB or BGR
COLORSPACE_YUV | [1] Color space is YUV or YcbCr
COLORSPACE_CMYK | [2] Color space is CMYK
COLORSPACE_CIELAB | [3] Color space is CIELab

See Also

Elements: | LoadInfo event, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property
Topics: | Raster Images: Loading Files


Comment property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ILEADRasterVariant * Comment(short iIndex);
Overview | Refer to Maintaining File Comments.

Remarks

Is the array of comments to be saved with the next call of the Save or SaveMemory method.

Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. With the Comment property, you can get and set the value of any comment in the array. The index into the array (specified using a constant) determines the type of comment, as described in Types of File Comments.

There is an array of comments for each ILEADRasterIO object. You control the contents of the array; loading or saving a file does not initialize the array. You can clear the array by setting each element of the array to Empty.

If you want to preserve existing comments in a file when you save an image,you must use the ReadComment method to update the array.

See Also

Elements

ReadFileCommentOffset method, ReadComment method


DJVResolution property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DJVResolution
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets the display resolution, in dots per inch, that LEADTOOLS is to use when loading DJV files.

The default value for this property is 96 DPI.

See Also

Elements: | PDFXResolution property, PDFYResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property, PDFInitDir property
Topics: | Raster Images: Loading Files


EnableLoadInfoEvent property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableLoadInfoEvent
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to generate the LoadInfo event. Possible values are:

Setting | Description
VARIANT_TRUE | Generate the LoadInfo Event. This is the default value.
VARIANT_FALSE | Don't generate the LoadInfo Event.

See Also

Elements: | LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property, IOPalette property, LoadInfo event
Topics: | Raster Images: Loading Files


EnablePDF128bit property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePDF128bit
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Gets or sets a flag that specifies the encryption method that will be used. Possible values are:

Value | Meaning
TRUE | Use an RC4 128-bit encryption key.
FALSE | Use an RC4 40-bit encryption key.

See Also

Elements: | PDFUserPassword property, PDFOwnerPassword property, PDFEncryptFlags property
Topics: | Raster Images : Saving Files


EnablePaintCMYKArray property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnablePaintCMYKArray
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Enables or disables drawing a CMYK raster array as the RasterIO object in an ILEADRasterView object. Possible values are:

Value | Meaning
TRUE | A CMYK raster array may be drawn in the ILEADRasterView object.
FALSE | A CMYK raster array may not be drawn in the ILEADRasterView object.

Set the RasterIO property, the CMYKRaster property, and the CMYKRasterCount property before using the EnablePaintCMYKArray property.

See Also

Elements: | CMYKRaster property, CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property
Topics | Raster Images: Displaying Images


EnableSaveBufferEvent property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableSaveBufferEvent;
Overview | Refer to Using Memory-Resident Image Files.

Remarks

(Persistent property, available at design time) Specifies whether LEADTOOLS generates a SaveBuffer event. This event indicates to the user that the memory buffer referenced by the SaveBufferAddress property is too small to accommodate the bitmap to be saved by the SaveBuffer method. The user can reallocate memory of adequate size within the SaveBuffer event.

To abort a SaveBuffer process, set the EnableSaveBufferEvent property to FALSE in the SaveBuffer event.

This property must be set to TRUE in order to generate the SaveBuffer event.

If this property is set to TRUE, the SaveBuffer event can be used to reallocate the memory buffer to the size requested in the SaveBuffer event, and update the SaveBufferSize and SaveBufferAddress properties.

If this property is set to FALSE and the memory location referenced by the SaveBufferAddress property is not large enough to accommodate the save, the SaveBuffer method will fail.

For more information, refer to the SaveBuffer method.

Setting | Description
TRUE | Generate SaveBuffer events.
FALSE | Do not generate SaveBuffer events.

See Also

Elements: | SaveBuffer method, SaveBufferSize property, SaveBufferAddress property, SaveBuffer event, LoadBuffer method
Topics: | Raster Images: Saving Files
 | Controlling Events


FastLoad property (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL FastLoad
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a flag that indicates whether to use the fast loading algorithm while loading LEAD ABC files. The fast loading algorithm provides faster loading with less image details. Possible values are:

Value | Meaning
TRUE | Use the fast loading algorithm.
FLASE | Don't use the fast loading algorithm.

See Also

Elements: | Load method, LoadCompressed property
Topics: | Raster Images: Loading Files


FileSizeWritten Property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long FileSizeWritten;
Overview | Refer to Saving a Bitmap to a File.

Remarks

(Read only) Is the length of a file (in bytes) written when using the SaveOffset method. This property is automatically updated with the correct length if the SaveOffset method is successful.

See Also

Elements: | SaveOffset method, SavePad4 property, BitmapHeight property, BitmapWidth property, BitmapXRes property, BitmapYRes property, GetColorCount method
Topics: | Raster Images: Saving Files


GeoKeyCount property (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | long GeoKeyCount
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Gets or sets the number of items in the GeoKeyData property.

The following methods update this property:

ReadFileGeoKey method (used to read GeoKey information from a TIFF file)

Or

GetGeoKey method (used to obtain GeoKey information that will be saved the next time the user saves a GeoTIFF (FILE_GEOTIFF) file)

When setting the GeoKey information prior to calling the SetGeoKey method, set the GeoKeyCount property, to determine the number of items in the GeoKeyData property, then set the new information in the GeoKeyData property, and then call the SetGeoKey method.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


GeoKeyData property (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | ILEADRasterVariant * GeoKeyData
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Gets or sets GeoKey data. The data is saved into ILEADRasterVariant object.

To set the GeoKey data do the following:

1. | Fill the Type property of the ILEADRasterVariant object.
2. | Fill the ItemCount property if you need to set more than 1 item.
3. | Fill the data.
 | For example if the data type is SHORT and count is 1, use the ShortValue property. If count > 1 use the ShortItemValue property, and so on.

The following methods and events updates the value of this property:

ReadFileGeoKey method

GetGeoKey method

EnumGeoKeys event

To set the GeoKey data, assign a new value to this property and call the SetGeoKey method.

When setting the GeoKey information prior to calling the SetGeoKey method, set the GeoKeyCount property, to determine the number of items in the GeoKeyData property, then set the new information in the GeoKeyData property, and then call the SetGeoKey method.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


GeoKeyType property (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | long GeoKeyType
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Gets or sets the type of GeoKey.

The value of this property indicates whether the data specified in the GeoKeyData property is SHORT, DOUBLE or ASCII. Possible values are:

Value | Meaning
TAG_ASCII | [2] The data in the GeoKeyData property is an array of ASCII bytes.
TAG_SHORT | [3] The data in the GeoKeyData property is an array of SHORT values (2 bytes each).
TAG_DOUBLE | [12] The data in the GeoKeyData property is an array of floating points in DOUBLE format (8 bytes each).

The following methods update this property:

ReadFileGeoKey method (used to read GeoKey information from a TIFF file)

Or

GetGeoKey method (used to obtain GeoKey information that will be saved the next time the user saves a GeoTIFF (FILE_GEOTIFF) file)

To set the type of GeoKey, assign a new value to this property and call the SetGeoKey method.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


Grayscale2BitCoder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | Grayscale2BitCoder Grayscale2BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

See Also

Elements | Save method, Grayscale8BitCoder property, Grayscale8BitQFactor property, Text2BitCoder property
Topics | Saving Capabilities
 | Raster Images: Saving a Page


Grayscale8BitCoder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | Grayscale8BitCoder Grayscale8BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) (Persistent property, available at design time) ) Indicates which grayscale 8-bit compression type is to be used when saving a T44 file. This property is used only when saving in the LEAD Proprietary T44 format using the Save method (when using the SaveT44 method, all 8-bit grayscale segments are treated as picture segments). This property is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either Save or SaveList methods. Possible values are:

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

See Also

Elements | Save method, Grayscale2BitCoder property, Grayscale8BitQFactor property, Text2BitCoder property
Topics | Saving Capabilities
 | Raster Images: Saving a Page


Grayscale8BitQFactor property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Grayscale8BitQFactor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Possible values are between 2 and 255, where 2 is the highest quality and 255 is the most compression. If the Grayscale8BitCoder property is CMW lossless or JPEG lossless compression, the Grayscale8BitQFactor property should be 0. This property is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveT44 methods. The default value is 2.

See Also

Elements | Save method, Grayscale2BitCoder property, Grayscale8BitCoder property, Text2BitCoder property
Topics | Saving Capabilities
 | Raster Images: Saving a Page


IgnoreFilterList property(ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | BSTR IgnoreFilterList
Overview | Refer to Loading Filters

Remarks

(Read only) This property is updated, both automatically, and when the IgnoreFilters method is called, with the current list of file format filters to be ignored by LEADTOOLS. These file format filters are never loaded.

Read this property to determine the current list of file format filters to be ignored by LEADTOOLS, before calling the IgnoreFilters method to change the list.

If this property is read before the IgnoreFilters method has ever been called in an application, then this property will contain an empty list.

Read the PreLoadFilterList property to determine the current list of file format filters to be loaded by LEADTOOLS. To change the list of file format filters to be loaded, call the PreloadFilters method.

For more information on ignoring filters, refer to the IgnoreFilters method.

See Also

Elements: | IgnoreFilters method, PreloadFilters method, PreLoadFilterList property, PreLoadFilterFixedCount property, PreLoadFilterCachedCount property
Topics: | Raster Images: Input/Output File Filters


IgnoreViewPerspective property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL IgnoreViewPerspective
Overview | Refer to Loading and Saving Large TIFF Files.

Remarks

(TIF and Exif only) Flag that determines whether to ignore the view perspective stored in the file and loads the file as TOP_LEFT. If you are loading a TIF or Exif file that looks rotated or flipped, try setting this property before loading the file. Possible values are:

Value | Meaning
TRUE | Ignores the view perspective stored in the file and load the file as TOP_LEFT.
FALSE | Uses the view perspective stored in the file.

See Also

Elements: | InfoIFD property, LoadIFD property, SaveIFD property
Topics | Raster Images: Loading and Saving Large TIFF Files


InfoAnimation property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL InfoAnimation
Overview | Refer to Playing an Animation.

Remarks

(Read only) Indicates whether the specified file is an animation file.

If this value is TRUE, the file is played as an animation as it is loaded (when the AutoAnimate property is TRUE).

This property is TRUE only for animated GIF files and AVI files. Keep in mind, however, that any multipage file can be loaded to create a bitmap list, and any bitmap list can be played as an animation after it is loaded or created.

Use the GetFileInfo method to update this property.

Setting | Description
TRUE | The file is an animated GIF or AVI file.
FALSE | The file is not an animated file (although it may be a multipage file).

See Also

Elements: | GetFileInfo method, InfoAnimationHeight property, InfoAnimationWidth property
Topics: | Raster Images: Playing Animated Images


InfoAnimationHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float InfoAnimationHeight
Overview | Refer to Playing an Animation.

Remarks

(Read only) Is the height that will be used for the target bitmap when playing an animation.

Use the GetFileInfo method to update this property. The value of this property is valid only if the InfoAnimation property is TRUE. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | GetFileInfo method, InfoAnimation property, InfoAnimationWidth property
Topics: | Raster Images: Playing Animated Images


InfoAnimationWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float InfoAnimationWidth
Overview | Refer to Playing an Animation.

Remarks

(Read only) Is the width that will be used for the target bitmap when playing an animation.

Use the GetFileInfo method to update this property. The value of this property is valid only if the InfoAnimation property is TRUE. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | GetFileInfo method, InfoAnimation property, InfoAnimationHeight property
Topics: | Raster Images: Playing Animated Images


InfoBits property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short InfoBits
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the number of bits per pixel of the specified image file.

Use the GetFileInfo method to update this property.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Elements | ColorSpace property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoCompress property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR InfoCompress
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the compression method of the specified image file.

Use the GetFileInfo method to update this property.

See Also

Elements | ColorSpace property, InfoBits property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoFormat property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RasterFileConstants InfoFormat
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the format of the specified image file.

Use the GetFileInfo method to update this property. For possible values, refer to Formats of Input Files. Please note that if a TIFF file of unknown compression is used, this property will be updated

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoHasAlpha property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL InfoHasAlpha
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Indicates whether the specified file contains an Alpha Bitmap.

Use the GetFileInfo method to update this property.

Setting | Description
TRUE | The file contains an Alpha Bitmap.
FALSE | The file does not contain an Alpha Bitmap.

See Also

Elements | ColorSpace property, GetFileInfo method, InfoAnimation property, InfoAnimationHeight property, InfoAnimationWidth property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoTotalPages property, InfoWidth property, InfoXRes property, InfoYRes property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information
 | PNG Files and Transparency


InfoHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float InfoHeight
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the height of the image in the specified file.

The unit of measure is determined by the ScaleMode property. Use the GetFileInfo method to update this property.

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoIFD property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoIFD
Overview | Refer to Loading and Saving Large TIFF Files.

Remarks

Specifies the offset within the current file of the current page.

This property value is valid only if it is greater than 0. A value of zero indicates that the file format does not support Image File Directories (IFDs).

The value of this property can be used for the LoadIFD property and the SaveIFD property to speed up loading and saving of TIFF files with many pages.

See Also

Elements | ColorSpace property, IgnoreViewPerspective property, LoadIFD property, SaveIFD property
Topics: | Raster Images: Loading and Saving Large TIFF Files


InfoLayers property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoLayers;
Overview | Refer to Layers in Files

Remarks

Represents the total number of layers present in a file.

Currently, only PSD files support layers, but not all PSD files have layers.

Use this property to determine which layers can be loaded from a file.

See Also

Elements: | ColorSpace property, LoadLayer method, GetFileInfo method, InfoTotalPages property, LayerLeft property, LayerTop property, Save method, SaveLayers property, GetFileInfo method
Topics: | Raster Images: Getting and Setting File Information


InfoPage property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoPage
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the page number, in a multipage file, of the image.

Use the GetFileInfo method to update this property. The resulting value is either the page number specified in the method or the last page in the file. It is the last page only if the specified number was greater than the total pages in the file.

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoPCDRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL InfoPCDRes (short iIndex);
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is true if the resolution specified by the index value is in the PhotoCD file.

You load the values of this property by using the GetFileInfo method.

Before loading a bitmap from a file, use the PCDRes property to specify which resolution to load. (The PhotoCD format is read only; so the PhotoCD resolution is not an issue when saving a file.)

Index | Resolution
PCDRES_BASE_OVER_64 | 64 x 96
PCDRES_BASE_OVER_16 | 128 x 192
PCDRES_BASE_OVER_4 | 256 x 384
PCDRES_BASE | 512 x 768
PCDRES_4BASE | 1024 x 1536
PCDRES_16BASE | 2048 x 3072

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoSizeDisk property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoSizeDisk
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the size of the specified image file.

Use the GetFileInfo method to update this property. The value is expressed in bytes.

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoSizeMem property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoSizeMem
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the amount of memory required to load a bitmap from the specified file.

Use the GetFileInfo method to update this property. The value is expressed in bytes.

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoTotalPages property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoTotalPages
Overview | Refer to Loading a Bitmap from a File.

Remarks

Represents the total number of pages in a multipage file.

See Also

Topics:

Raster Images: Getting and Setting File Information


InfoWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float InfoWidth
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the width of the image in the specified file.

The unit of measure is determined by the ScaleMode property. Use the GetFileInfo method to update this property.

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoFormat property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoViewPerspective property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ViewPerspectiveConstants InfoViewPerspective
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Is the view perspective of the specified image file.

Use the GetFileInfo method to update this property. Possible values:

Value | Description
TOP_LEFT | Top-left of image is first in memory
BOTTOM_LEFT | Bottom-left of image is first in memory
TOP_RIGHT | Top-right of image is first in memory
BOTTOM_LEFT180 | TOP_RIGHT is BOTTOM_LEFT rotated clockwise by 180 degrees
BOTTOM_RIGHT | Bottom-right of image is first in memory
TOP_LEFT180 | BOTTOM_RIGHT is TOP_LEFT rotated clockwise by 180 degrees
RIGHT_TOP | First row is the right side, first column is top side
TOP_LEFT90 | RIGHT_TOP is TOP_LEFT rotated clockwise by 90 degrees
LEFT_BOTTOM | First row is the left side, first column is top side
TOP_LEFT270 | LEFT_BOTTOM is TOP_LEFT rotated clockwise by 270 degrees
LEFT_TOP | First row is the left side, first column is the top side
BOTTOM_LEFT90 | LEFT_TOP is BOTTOM_LEFT rotated clockwise by 90 degrees
RIGHT_BOTTOM | First row is the right side, first column is the bottom side
BOTTOM_LEFT270 | RIGHT_BOTTOM is BOTTOM_LEFT rotated clockwise by 270 degrees

See Also

Elements | ColorSpace property, InfoBits property, InfoCompress property, InfoHeight property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files, Raster Images: Getting and Setting File Information


InfoXRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoXRes
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Gets the X resolution in the specified file.

Use the GetFileInfo method to update this property.

See Also

Elements | ColorSpace property, InfoYRes property, InfoBits property, InfoCompress property, InfoFormat property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InfoYRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long InfoYRes
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read only) Gets the Y resolution in the specified file.

Use the GetFileInfo method to update this property.

See Also

Elements | ColorSpace property, InfoXRes property, InfoBits property, InfoCompress property, InfoFormat property, InfoPage property, InfoPCDRes property, InfoSizeDisk property, InfoSizeMem property, InfoWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


InstallFilterMsg property (ILEADRasterIO)

JAVA Script example

Syntax | BSTR InstallFilterMsg (InstallFilterMsgConstants Msg);
Overview | Refer to Using LEAD RasterIO COM Object To Install LEAD Static Filters From Within A Web Page.

Remarks

Contains the string that will be displayed during filter installation.

The following example changes the install start message string:

RasterIO.InstallFilterMsg(0) = "I need to download the following file in order to display the images: "

See Also

Elements:

InstallFilter method, SetFilterURL method


IOPalette Property (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR IOPalette (short iIndex);
Overview | Refer to Working with the RAW File Filter.

Remarks

This property is used when loading raw, uncompressed data that is 8 bits per pixel or less. To do this, assign a palette to the IOPalette property in the LoadInfo event.

Palettes are used only for images that are 8 bits per pixel or less.

See Also

Topics: | Raster Images: Palettes
 | Using Color Values in LEADTOOLS


J2KCBS_ErrorResilienceSymbol property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KCBS_ErrorResilienceSymbol
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether a 4 symbol marker is included for each bit-plane, following the normalization pass. Possible values are:

Value | Meaning
TRUE | A 4 symbol marker is included for each bit-plane, following the normalization pass.
FALSE | A 4 symbol marker is not included for each bit-plane, following the normalization pass.

See Also

Elements: | J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCBS_PredictableTermination property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KCBS_PredictableTermination
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether the encoder has a predictable termination policy and identifies that the policy was used in the code-stream COD/COC markers. This can be used to implement error detection and concealment. Possible values are:

Value | Meaning
TRUE | The encoder has a predictable termination policy and identifies that the policy was used in the COD/COC markers.
FALSE | The encoder does not have a predictable termination policy.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCBS_ResetContextOnBoundaries property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KCBS_ResetContextOnBoundaries
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether the arithmetic coder's probability models are reset between coding passes. This controls where the end of encoded data is and limits the amount of potentially lost data in the event of a transmission error. Possible values are:

Value | Meaning
TRUE | The arithmetic coder's probability models are reset between coding passes.
FALSE | The arithmetic coder's probability models are not reset between coding passes.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCBS_SelectiveACBypass property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Overview

Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether the "lazy coding mode" is adopted. If the lazy coding mode is adopted, trailing bit-planes bypass the arithmetic coder except in the normalization pass. Possible value are:

Value | Meaning
TRUE | The "lazy-coding mode" is adopted. Trailing bit-planes bypass the arithmetic coder except in the normalization pass.
FALSE | The arithmetic encoder will be used on all passes.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCBS_TerminationOnEachPass property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KCBS_TerminationOnEachPass
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether the arithmetic code-word generation process stops on a byte boundary at the end of each coding pass. Possible values are:

Value | Meaning
TRUE | The arithmetic code-word generation process stops on a byte boundary at the end of each coding pass.
FALSE | The arithmetic code-word generation process does not stop on a byte boundary at the end of each coding pass.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCBS_VerticallyCausalContext property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KCBS_VerticallyCausalContext
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether the context models are restricted to being vertically causal within each sub-block. Possible values are:

Value | Meaning
TRUE | The context models are restricted to being vertically causal within each sub-block.
FALSE | The context models are not restricted to being vertically causal within each sub-block.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCodBlockHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KCodBlockHeight
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Height of the code block, following wavelet transformation. The value must be a power of 2. It must be at least 4 and less than or equal to 1024.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCodBlockWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KCodBlockWidth
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Width of the code block, following wavelet transformation. The value must be a power of 2. It must be at least 4 and less than or equal to 1024.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCompressionControl property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | J2KCompressionControl J2KCompressionControl
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates how to determine the resulting compression. The value of this property determines which property should be used for determining the compression. Possible values are:

Value | Meaning
J2K_COMPRESSION_LOSSLESS | Lossless compression.
J2K_COMPRESSION_RATIO | Compress the file based on the value of the J2KCompressionRatio property.
J2K_COMPRESSION_TARGETSIZE | Compress the file based on the target file size in the J2KTargetFileSize property.
J2K_COMPRESSION_QFACTOR | Compress the file based on the quality factor used when saving the file.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KCompressionRatio property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float J2KCompressionRatio
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates the compression ratio to use. This value is used only if the J2KCompressionControl property is set to J2K_COMPRESSION_RATIO.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KDecompLevel property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KDecompLevel
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Number of resolution levels in the compressed file. The maximum number of levels depends on the size of the image. Passing values that are too large will cause the save operation to fail. Each resolution level is one-half the size of the previous resolution, starting with the full image resolution. The default value is 5.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KDerivedBaseExponent property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KDerivedBaseExponent
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

The base exponent used for derived quantization.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KDerivedBaseMantissa property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KDerivedBaseMantissa
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

The base mantissa used for derived quantization.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KDerivedQuantization property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KDerivedQuantization
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether to use derived quantization or expounded quantization. Possible values are:

Value | Meaning
TRUE | Use derived quantization.
FALSE | Use expounded quantization.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KGuardBits property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KGuardBits
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Number of extra bits to consider when encoding an image. This prevents coding overflow. Possible values are 0 - 7. The default is 2.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KProgressOrder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | J2KProgressionFlags J2KProgressOrder
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates the order of progression. Possible values are:

Value | Description
J2K_LAYER_RESOLUTION_COMPONENT_POSITION | [0] Quality–axis order.
J2K_RESOLUTION_LAYER_COMPONENT_POSITION | [1] Resolution-axis order.
J2K_RESOLUTION_POSITION_COMPONENT_LAYER | [2] Resolution-axis order.
J2K_POSITION_COMPONENT_RESOLUTION_LAYER | [3] Position–axis order.
J2K_COMPONENT_POSITION_RESOLUTION_LAYER | [4] Color-axis order.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KROIControl property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | J2KRegionOfInterest J2KROIControl
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Flag that indicates how to define the region of interest. Possible values are:

Value | Description
J2K_USEOPTION_RECT | [0] J2KROILeft, J2KROITop, J2KROIWidth and J2KROIHeight will be used to define the region of interest rectangle.
J2K_USELEAD_REGION | [1] The LEAD bitmap region will be used to define the region of interest rectangle.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KUseROI property, J2KROILeft property, J2KROITop property, J2KROIWidth property, J2KROIHeight property
Topics: | Raster Images: Saving Files


J2KROIHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KROIHeight
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Gets or sets the height of a rectangle that defines the region of interest within the image.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KROIControl property, J2KUseROI property, J2KROILeft property, J2KROITop property, J2KROIWidth property
Topics: | Raster Images: Saving Files


J2KROILeft property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KROILeft
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Gets or sets the left coordinate of a rectangle that defines the region of interest within the image.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KROIControl property, J2KUseROI property, J2KROITop property, J2KROIWidth property, J2KROIHeight property
Topics: | Raster Images: Saving Files


J2KROITop property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KROITop
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Gets or sets the top coordinate of a rectangle that defines the region of interest within the image.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KROIControl property, J2KUseROI property, J2KROILeft property, J2KROIWidth property, J2KROIHeight property
Topics: | Raster Images: Saving Files


J2KROIWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KROIWidth
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Gets or sets the width of a rectangle that defines the region of interest within the image.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KROIControl property, J2KUseROI property, J2KROILeft property, J2KROITop property, J2KROIHeight property
Topics: | Raster Images: Saving Files


J2KTargetFileSize property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KTargetFileSize
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates the size of the target file, in bytes. This value is used only if the J2KCompressionControl property is set to J2K_COMPRESSION_TARGETSIZE.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KUseColorTransform property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KUseColorTransform
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates whether to convert an RGB image to YUV space before compressing. (YUV space provides greater compression with higher image quality.) Possible values are:

Value | Meaning
TRUE | Convert to YUV space before compressing. (Default)
FALSE | Do not convert to YUV space before compressing.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KUseEPHMarker property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KUseEPHMarker
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether to use the EPH marker. Possible values are:

Value | Meaning
TRUE | Use the EPH marker.
FALSE | Do not use the EPH marker. (Default)

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KUseROI property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL J2KUseROI
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Indicates whether to use a region of interest. Possible values are:

Setting | Description
TRUE | Use a region of interest as specified in the J2KROIControl property.
FALSE | Do not use a region of interest. If you do not want to use a region of interest, set this property to FALSE. Otherwise, there may be a significant compression and speed performance loss.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property, J2KROIControl property, J2KROILeft property, J2KROITop property, J2KROIWidth property, J2KROIHeight property
Topics: | Raster Images: Saving Files


J2KUseSOPMarker property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL J2KUseSOPMarker
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Boolean value that indicates whether to use the SOP marker. Possible values are:

Value | Meaning
TRUE | Use the SOP marker.
FALSE | Do not use the SOP marker. (Default)

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KXOsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KXOsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Horizontal offset from the origin of the reference grid to the left side of the image area.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KXTOsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KXTOsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Horizontal offset from the origin of the reference grid to the left side of the first tile.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KXTsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KXTsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Width of one reference tile, with respect to the reference grid.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KYOsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KYOsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KYOsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Vertical offset from the origin of the reference grid to the top of the image area.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYTOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KYTOsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KYTOsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Vertical offset from the origin of the reference grid to the top of the first tile.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTsiz property
Topics: | Raster Images: Saving Files


J2KYTsiz property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long J2KYTsiz
Overview | Refer to Implementing JPEG 2000 Plug In Features

Remarks

Height of one reference tile, with respect to the reference grid.

See Also

Elements: | J2KCBS_ErrorResilienceSymbol property, J2KCBS_PredictableTermination property, J2KCBS_ResetContextOnBoundaries property, J2KCBS_SelectiveACBypass property, J2KCBS_TerminationOnEachPass property, J2KCBS_VerticallyCausalContext property, J2KCodBlockHeight property, J2KCodBlockWidth property, J2KCompressionControl property, J2KCompressionRatio property, J2KDecompLevel property, J2KDerivedBaseExponent property, J2KDerivedBaseMantissa property, J2KDerivedQuantization property, J2KGuardBits property, J2KProgressOrder property, J2KSetDefaults method, J2KTargetFileSize property, J2KUseColorTransform property, J2KUseEPHMarker property, J2KUseSOPMarker property, J2KXOsiz property, J2KXTOsiz property, J2KXTsiz property, J2KYOsiz property, J2KYTOsiz property
Topics: | Raster Images: Saving Files


JBIG2GBATX1 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATX1
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the X location of the adaptive template pixel A1.

Possible values range from - 128 to 127.

When the value of the JBIG2GBATY1 property is 0, then the possible values range from -128 to -1.

See Also

Elements: | JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATX2 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATX2
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the X location of the adaptive template pixel A2.

Possible values range from -128 to 127.

When the value of the JBIG2GBATY2 property is 0, then the possible values range from -128 to -1.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATX3 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATX3
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the X location of the adaptive template pixel A3.

Possible values range from -128 to 127.

When the value of the JBIG2GBATY3 property is 0, then the possible values range from -128 to -1.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATX4 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATX4
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the X location of the adaptive template pixel A4.

Possible values range from -128 to 127.

When the value of the JBIG2GBATY4 property is 0, then the possible values range from -128 to -1.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATY1 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATY1
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the Y location of the adaptive template pixel A1.

Possible values range from -128 to 0.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATY2 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATY2
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the Y location of the adaptive template pixel A2.

Possible values range from -128 to 0.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATY3 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATY3
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the Y location of the adaptive template pixel A3.

Possible values range from -128 to 0.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2GBATY4 property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2GBATY4
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the Y location of the adaptive template pixel A4.

Possible values range from -128 to 0.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2TemplateType property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2SaveFlags property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | long JBIG2SaveFlags
Overview | Refer to Saving a Bitmap to a File

Remarks

Flags that indicate the unwanted JBIG2 segments and whether to use the typical prediction (TP). You can use a bit wise OR (|) to specify more than one flag. Possible values are:

Value | Meaning
JBIG2_REMOVE_MARKER | [0x0001] Removes the two-byte marker from generic region segment data.
JBIG2_REMOVE_HEADER_SEGMENT | [0x0002] Removes the JBIG2 header.
JBIG2_REMOVE_EOP_SEGMENT | [0x0004] Removes the End Of Page segment.
JBIG2_REMOVE_EOF_SEGMENT | [0x0008] Removes the End Of File segment.
JBIG2_TPON | [0x0010] Uses typical prediction (TP) while encoding.

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


JBIG2TemplateType property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | short JBIG2TemplateType
Overview | Refer to Saving a Bitmap to a File

Remarks

Gets or sets the value that specifies the template to be used for the template-based arithmetic encoder. Possible values are:

Value | Meaning | Template
0 | Three lines with 16 pixels template. |
1 | Three lines with 13 pixels template. |
2 | Three lines with 10 pixels template. |
3 | Two lines with 10 pixels template. |

See Also

Elements: | JBIG2GBATX1 property, JBIG2GBATY1 property, JBIG2GBATX2 property, JBIG2GBATY2 property, JBIG2GBATX3 property, JBIG2GBATY3 property, JBIG2GBATX4 property, JBIG2GBATY4 property, JBIG2SaveFlags property
Topics: | Raster Images: Saving Files


LayerBlendModeKey property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR LayerBlendModeKey(ILEADRaster *pRaster, short iLayer);
Overview | Refer to Layers in Files

Remarks

Gets or sets the blend mode key, a four byte character array, for the layer(s). Possible values are:

Value | Meaning
'norm' | Normal
'dark' | Darken
'lite' | Lighten
'hue' | Hue
'sat' | Saturation
'colr' | Color
'lum' | Luminosity
'mul' | Multiply
'scrn' | Screen
'diss' | Dissolve
'over' | Overlay
'hLit' | Hard light
'sLit' | Soft light
'diff' | Difference
'smud' | Exclusion
'div' | Color dodge
'idiv' | Color burn

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

See Also

Elements:

LayerClipping property, LayerOpacity property, LayerLeft property, GetLayerMaskBitmap method, SetLayerMaskBitmap method, LayerTop property, Save method, SaveLayers property


LayerClipping property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LayerClipping(ILEADRaster *pRaster, short iLayer);
Overview | Refer to Layers in Files

Remarks

Gets or sets the clipping value for the layer.

A value of 0 represents base and 1 represents non-base.

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

See Also

Elements:

LayerBlendModeKey property, LayerOpacity property, LayerLeft property, GetLayerMaskBitmap method, SetLayerMaskBitmap method, LayerTop property, Save method, SaveLayers property


LayerLeft property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float LayerLeft(ILEADRaster *pRaster, short iLayer);
Overview | Refer to Layers in Files

Remarks

When iLayer is 0, LayerLeft(0) is a read-only property and contains information that was last read from the file using the LoadLayer method.

When iLayer is > 0, then LayerLeft(iLayer) contains positioning information for the layers that will be saved in the file. In this case, LayerLeft(iLayer) contains the left offset for layer iLayer. It is the corresponding offset for element iLayer in the bitmap list.

This information will be used the next time the Save method is called to save a PSD file.

See Also

Elements: | LayerTop property, Save method, SaveLayers property, LayerOpacity property, LayerClipping property, LayerBlendModeKey property, GetLayerMaskBitmap method, SetLayerMaskBitmap method
Topics: | Raster Images: Saving Files


LayerOpacity property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LayerOpacity(ILEADRaster *pRaster, short iLayer);
Overview | Refer to Layers in Files

Remarks

Gets or sets the opacity value for the layer.

A value of 0 represents full transparency and 255 is completely opaque. Intermediate values represent translucency.

For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

See Also

Elements:

LayerBlendModeKey property, LayerClipping property, LayerLeft property, GetLayerMaskBitmap method, SetLayerMaskBitmap method, LayerTop property, Save method, SaveLayers property


LayerTop property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float LayerTop(ILEADRaster *pRaster, short iLayer);
Overview | Refer to Layers in Files

Remarks

When iLayer is 0, LayerLeft(0) is a read-only property and contains information that was last read from the file using the LoadLayer method.

When iLayer is > 0, then LayerTop(iLayer) contains positioning information for the layers that will be saved in the file. In this case, LayerTop(iLayer) contains the top offset for layer iLayer. It is the corresponding offset for element iLayer in the bitmap list.

This information will be used the next time the Save method is called to save a PSD file.

See Also

Elements: | LayerLeft property, Save method, SaveLayers property, LayerOpacity property, LayerClipping property, LayerBlendModeKey property, GetLayerMaskBitmap method, SetLayerMaskBitmap method
Topics: | Raster Images: Saving Files


LoadCompressed property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | LoadCompressedConstants LoadCompressed
Overview | Refer to Loading a Bitmap from a File.

Remarks

Indicates whether an image will be loaded compressed or uncompressed, and if compressed, what compression will be used. For a list of possible values, refer to the LoadCompressedConstants enumeration.

Bitmaps loaded with COMP_SUPER will take up the least amount of memory. Most operations on the bitmap will be slower than on compressed or uncompressed bitmaps. The use of super compressed bitmaps is recommended when the bitmaps being loaded are really large and it would make the operating system to swap the bitmap data to disk (if the bitmap was uncompressed). In these situations, the manipulation of super compressed bitmaps can be faster than the manipulation of compressed or uncompressed bitmaps.

Note that the super compression for 24-bit bitmaps is lossy, which means repeated modifications of the bitmap could cause image degradation. To avoid this, read the bitmap compression value for the bitmap from the BitmapCompression property and save that to a variable. Then, uncompress the bitmap using the SetBitmapCompression method. Make any changes and then recompress the bitmap using the SetBitmapCompression method and the original compression value you stored in the variable.

See Also

Elements | FastLoad property, Load method, LoadArray method, LoadCompressed, LoadMemory method, BitmapCompression property
Topics | Raster Images: Loading Files


LoadICCProfile method (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short LoadICCProfile(BSTR pszName, ILEADRasterVariant *pData, long lPage);
Overview | Refer to Using ICC Profile Functionality

Remarks

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multipage and you can load the profile from a particular page using the lPage parameter.

See Also

Elements: | LoadICCProfile2 method, SaveICCProfile method, SaveICCProfile2 method.
Topics: | Raster Images: Loading Files


LoadICCProfile2 method (ILEADRasterIO)

Visual Basic example

Visual C++ example

SyntaxSyntax | short LoadICCProfile2(BSTR pszName, VARIANT *pData, long lPage);
Overview | Refer to Using ICC Profile Functionality

Remarks

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multipage and you can load the profile from a particular page using the lPage parameter.

See Also

Elements: | LoadICCProfile method, SaveICCProfile method, SaveICCProfile2 method.
Topics: | Raster Images: Loading Files


LoadIFD property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long LoadIFD
Overview | Refer to Loading and Saving Large TIFF Files

Remarks

Specifies the offset within the current file of the page to load.

The LoadIFD property can be used to speed up the loading of TIFF files with many pages.

If the value of this property is <= 7, the LoadXXX methods will ignore this property. This property is only valid for TIFF files. The default value is 0, which indicates that the file format does not support IFDs.

If the value of this property is >= 8, then when information about a TIF file is retrieved, the page at the offset given by this property will be page 1. The page after will be page 2, etc. When the current TIF file is no longer needed, this property must be reset to 0, otherwise the processing of any other TIF files will be incorrect.

See Also

Elements | IgnoreViewPerspective property, InfoIFD property, SaveIFD property
Topics: | Raster Images: Loading and Saving Large TIFF Files


LoadInfoBits property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadInfoBits
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the bits per pixel of the image data to be loaded. LEADTOOLS uses this value only if it fails to find the value in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Elements: | EnableLoadInfoEvent property, LoadInfo event, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property
Topics: | Raster Images: Loading Files


LoadInfoFlags property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long LoadInfoFlags
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies format information about the image data to be loaded. LEADTOOLS uses these flags only if it fails to find the value in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4), and RAW uncompressed data.

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

The following are valid values. When it is appropriate, you can use a bitwise OR ( | ) to specify more than one value. In high-level languages, such as Visual Basic, use a plus (+) for a bitwise OR.

LOADINFO_TOPLEFT, LOADINFO_TOPLEFT90 and LOADINFO_TOPLEFT270 cannot be combined using the bitwise OR.

LOADINFO_REVERSE can be combined with LOADINFO_TOPLEFT, LOADINFO_TOPLEFT90 or LOADINFO_TOPLEFT270. If LOADINFO_REVERSE is set, every line is reversed before being put into the bitmap.

Flag | Meaning
LOADINFO_TOPLEFT | The image has a TOP_LEFT view perspective.
LOADINFO_ORDERRGB | The color order is RGB.
LOADINFO_WHITEONBLACK | The image is white-on-black.
LOADINFO_LSB | The least significant bit is filled first.
LOADINFO_TOPLEFT90 | The image has a TOP_LEFT90 view perspective. (Document/Medical only).
LOADINFO_TOPLEFT270 | The image has a TOP_LEFT270 view perspective. (Document/Medical only).
LOADINFO_REVERSE | The image is reversed (Mirrored.)
LOADINFO_TOPLEFT180 | [0x00000080] The image has a TOP_LEFT180 view perspective. (Document/Medical only)
LOADINFO_BOTTOMLEFT90 | [0x00000100] The image has a BOTTOM_LEFT90 view perspective. (Document/Medical only)
LOADINFO_BOTTOMLEFT180 | [0x00000200] The image has a BOTTOM_LEFT180 view perspective. (Document/Medical only)
LOADINFO_BOTTOMLEFT270 | [0x00000400] The image has a BOTTOM_LEFT270 view perspective. (Document/Medical only)
LOADINFO_PAD4 | [0x00000800] Each line is padded to a multiple of 4 bytes (raw data only)
LOADINFO_PALETTE | [00001000] A palette is supplied in the IOPalette property (raw data only)
0 | Clear the flags, defaulting to thier opposite meanings.
LOADINFO_BITFIELDS | [0x00002000] 3 color masks are specified in the rgbColorMask field. This is for raw Bitfield compressed data only.
LOADINFO_ORDERGRAY | [0x00004000] Image is grayscale.
LOADINFO_MOTOROLAORDER | [0x00008000] Image bytes are in Motorola byte order. Valid only for 16, 48 and 64-bit.)
LOADINFO_ORDERROMM | [0x00010000] The color order is ROMM. Valid only for 24 and 48-bit.)

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property
Topics | Raster Images: Loading Files


LoadInfoFormat property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RasterFileConstants LoadInfoFormat
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies format of the image data to be loaded. LEADTOOLS uses this value only if it fails to find the value in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

LEADTOOLS checks the LoadInfoFormat property first. If this property has a non-zero value, LEADTOOLS uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

The following are valid formats:

FILE_FAX_G3_1D | Raw FAX, compressed using CCITT group 3, 1 dimension.
FILE_FAX_G3_2D | Raw FAX, compressed using CCITT group 3, 2 dimensions.
FILE_FAX_G4 | Raw FAX, compressed using CCITT group 4.
FILE_RAW | Raw uncompressed data.
FILE_RAW_RLE4 | Raw RLE4 compressed, 4 bit data. (Read only)
FILE_RAW_RLE8 | Raw RLE8 compressed, 8 bit data. (Read only
FILE_RAW_BITFIELDS | Raw BITFIELD data, 16 or 32-bit data. (Read only)
FILE_RAW_PACKBITS | Raw PackBits compression. (Read only)

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property, IOPallette, Working with the RAW File Filter
Topics | Raster Images: Loading Files


LoadInfoHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float LoadInfoHeight
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the height, in pixels, of the image to be loaded. LEADTOOLS uses this value only if it fails to find format information in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

If you want LEADTOOLS to automatically recognize any fax file, set the LoadInfoWidth and LoadInfoHeight properties to -1 once, at the beginning of the program.

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property
Topics | Raster Images: Loading Files


LoadInfoOffset property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long LoadInfoOffset
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the position of the first byte of image data to be loaded. This can be 0 if your file does not have a header. LEADTOOLS uses this value only if it fails to find format information in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoWidth property, LoadInfoXRes property, LoadInfoYRes property
Topics | Raster Images: Loading Files


LoadInfoWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float LoadInfoWidth
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the width, in pixels, of the image to be loaded. LEADTOOLS uses this value only if it fails to find format information in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

If you want LEADTOOLS to automatically recognize any fax file, set the LoadInfoWidth and LoadInfoHeight properties to -1 once, at the beginning of the program.

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo …property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoXRes property, LoadInfoYRes property
Topics | Raster Images: Loading Files


LoadInfoXRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadInfoXRes
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the horizontal resolution, in DPI (dots per inch), of the image to be loaded. LEADTOOLS uses this value only if it fails to find format information in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoYRes property
Topics | Raster Images: Loading Files


LoadInfoYRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadInfoYRes
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the vertical resolution, in DPI (dots per inch), of the image to be loaded. LEADTOOLS uses this value only if it fails to find format information in the file header. You can use this and the other LoadInfo... properties for loading raw FAX data (CCITT Group 3 or Group 4).

LEADTOOLS checks the LoadInfoFormat property first. If that property has a non-zero value, it uses the other LoadInfo... property values. Keep in mind that when these values are used, LEADTOOLS does not validate the data in the file. If you want LEADTOOLS to validate the data, you must set the LoadInfoFormat property to zero.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoXRes property
Topics | Raster Images: Loading Files


LoadResolutionCount property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LoadResolutionCount
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

The number of available resolutions in the specified PhotoCD, FlashPix, or JBIG file.

The ReadLoadResolutions method updates this property.

The GetLoadResolution method can also update this property, setting it to 1.

See Also

Elements | ColorSpace property, ReadLoadResolutions method, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveResolutionCount property, SaveResolutionHeight property, SaveResolutionWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


LoadResolutionHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float LoadResolutionHeight (short iIndex);
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

Is the height component in an array that specifies the available dimensions in a PhotoCD, FlashPix, or JBIG file.

The ReadLoadResolutions method updates this property. The LoadResolutionCount property specifies the number of available dimensions.

The GetLoadResolution method can also update this property with the current value for loading a file.

See Also

Elements | ColorSpace property, ReadLoadResolutions method, LoadResolutionCount property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveResolutionCount property, SaveResolutionHeight property, SaveResolutionWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


LoadResolutionWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float LoadResolutionWidth (short iIndex);
Overview | Refer to Implementing PhotoCD and FlashPix Features.

Remarks

Is the height component in an array that specifies the available dimensions in a PhotoCD, FlashPix, or JBIG file.

The ReadLoadResolutions method updates this property. The LoadResolutionCount property specifies the number of available dimensions.

The GetLoadResolution method can also update this property with the current value for loading a file.

See Also

Elements | ColorSpace property, ReadLoadResolutions method, LoadResolutionCount property, LoadResolutionHeight property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveResolutionCount property, SaveResolutionHeight property, SaveResolutionWidth property
Topics | Raster Images: Loading Files
 | Raster Images: Getting and Setting File Information


LoadSigned property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL LoadSigned;
Overview | Refer to Loading a Bitmap from a File.

Remarks

Indicates how to load files with signed bitmap data. Possible values are:

Value | Meaning
TRUE | Do not automatically convert signed images before loading.
FALSE | Automatically convert signed images to unsigned at load time.

LEADTOOLS automatically converts signed images to unsigned by setting the negative pixels to 0.

If this property is TRUE, the signed image should be converted by calling the ConvertSignedToUnsigned method. If signed images are not converted, the images may not be painted properly and the image processing methods will not perform correctly.

To determine whether a bitmap is signed or not, check the IsSigned property.

See Also

Elements: | IsSigned property, ConvertSignedToUnsigned method
Topics: | Raster Images: Loading Files
 | Examining and Altering Bitmaps


LoadStatus property (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short LoadStatus;
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Read Only) Gets a value that indicates whether the image that was last loaded has an error.

Possible values are:

Value | Meaning
0 | The image loaded by the last load call does not have any errors.
ERROR_COMPRESSED_DATA_FAILURE | There were errors decoding the last image. The bottom part of the image might be corrupted.
ERROR_BAD_RESYNC_MARKER | Some of the resync markers were incorrect or missing while decoding the last image. Resync markers are used by JPEG files to recover from decoding errors. Portions of the image are corrupted. They are indicated by a checkerboard pattern.
ERROR_FILE_READ | The file was truncated. The bottom part of the image is missing.
<> 0 | An error occurred. Refer to Error Codes.

The error code in this property describes a warning that portions of the image that was last loaded might be corrupted.

This property should be read after a load method returned 0. This value is reset after each page is loaded, so if you are loading multiple pages, this error code is valid only for the last page.

If the last load method returned an error code, then this property should not be used, as its value is undefined.

This property is valid for all of the methods that will load a bitmap. Examples of such functions: Load method, LoadOffset method, etc.

See Also

Elements: | Load method, LoadStamp method, BitmapDataPath method, LoadMemory method, StartFeedLoad method, LoadInfo event, LoadOffset method
Topics: | Raster Image: Loading Files


LoadUseViewPerspective property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL LoadUseViewPerspective
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Document/Medical only, persistent property, available at design time) Determines whether a bitmap with a rotated view perspective keeps its internal orientation when it is loaded.

Note: This property does not affect the orientation of the displayed image. You do not have to account for view perspective in the COM object unless you call certain LEADTOOLS DLL functionality, which are noted in the LEADTOOLS API documentation.

This property is most useful if you want to retain the existing view perspective when loading TIFF images that are stored with a rotated view perspective. Setting this property to TRUE may speed the loading of a file that contains a rotated image. After an image is loaded, the rotated view perspective may slow down other operations.

Setting | Description
TRUE | Keep the bitmap's rotated view perspective when loading.
FALSE | If a bitmap in a file has a rotated view perspective, convert the internal data to a top-left orientation when loading.

See Also

Topics:

Raster Images: Loading Files


LZWAutoClear property (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL LZWAutoClear
Overview | Refer to Saving a Bitmap to a File.

Remarks

Enables or disables automatically inserting CLEAR codes during LZW compression. Possible values are:

Setting | Description
TRUE | Enables automatically inserting CLEAR LZW codes and resets the LZW compression engine if the compression ratio is not adequate. This is the default value.
FALSE | Disables automatically inserting CLEAR LZW codes, and saves TIFF LZW files compatible with some buggy LZW decoders that cannot handle early CLEAR codes.

Some IBM decoders are known to have this problem. They will not decode the LEAD TIFF LZW files unless the user sets the value of this property to FALSE.

See Also

Elements: | Load method, LoadStamp method, BitmapDataPath method, LoadMemory method, StartFeedLoad method, LoadInfo event, LoadOffset method
Topics: | Raster Images: Saving Files


MaskCoder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCMaskCoderConstants MaskCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Value | Meaning
MRC_MASK_COMPRESSION_JBIG | [0x00] Use JBIG compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G4 | [0x01] Use Fax group 4 compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G3_1D | [0x02] Use Fax group 3 (1D) compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_ MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G3_2D | [0x03].Use Fax group 3 (2D) compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_ MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_ZIP | [0x04] Use ZIP compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_LZW | [0x05] Use LZW compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G3_1D | [0x06] Fax group 3 (1D) compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G3_2D | [0x07] Fax group 3 (2D) compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G4 | [0x08] Fax group 4 compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_JBIG2 | [0x09] JBIG2 compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


MRCRaster property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MRCRaster (long lIndex)
Overview | Refer to Working with the MRC Bitmap.

Remarks

Array of ILEADRasterMrc objects to be saved.

See Also

Elements | MRCRaster property, SaveList method
Topics | Saving a Bitmap to a File
 | Raster Images: Saving Files
 | Raster Images: Creating and Maintaining Lists of Images


MRCRasterCount property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MRCRasterCount
Overview | Refer to Working with the MRC Bitmap.

Remarks

Gets or sets the number of ILEADRasterMrc objects in the MRCRaster property to be saved.

See Also

Elements | MRCRaster property, SaveList method
Topics | Saving a Bitmap to a File
 | Raster Images: Saving Files
 | Raster Images: Creating and Maintaining Lists of Images


PCDRes property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PCDResConstants PCDRes
Overview | Refer to Loading a Bitmap from a File.

Remarks

Sets the resolution to be used for loading or converting a PhotoCD file.

Use the InfoPCDRes property to see which resolutions are available in a PhotoCD file.

Setting | Description
PCDRES_BASE_OVER_64 | 64 x 96
PCDRES_BASE_OVER_16 | 128 x 192
PCDRES_BASE_OVER_4 | 256 x 384
PCDRES_BASE | (Default) 512 x 768
PCDRES_4BASE | 1024 x 1536
PCDRES_16BASE | 2048 x 3072

See Also

Elements: | ReadLoadResolutions method, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, SetLoadResolution method, GetLoadResolution method, Load method, LoadMemory method, LoadStamp method
Topics: | Raster Images: Loading Files


PDFDisplayDepth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PDFDisplayDepth
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the pixel depth value that LEADTOOLS uses when loading PDF, PS or EPS files.

Value | Meaning
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap

The default setting is 24.

See Also

Elements: | PDFXResolution property, PDFYResolution property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property
Topics: | Raster Images: Loading Files


PDFEncryptFlags property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long PDFEncryptFlags
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Gets or sets flags that indicate the access rights users of the document will have. These values may be combined using a bitwise OR. Possible values are:

Value | Meaning
PDF_SECURITY_REV2_PRINTDOCUMENT | Give the user of the PDF document permission to print the document.
PDF_SECURITY_REV3_PRINTFAITHFUL | [128 bit only] Give the user of the PDF document permission to print the document in high quality.
PDF_SECURITY_REV2_MODIFYDOCUMENT | Give the user of the PDF document permission to edit the document.
PDF_SECURITY_REV2_EXTRACTTEXT | Give the user of the PDF document permission to extract text from the document.
PDF_SECURITY_REV3_EXTRACTTEXTGRAPHICS | [128 bit only] Give the user of the PDF document permission to extract graphics from the document.
PDF_SECURITY_REV2_MODIFYANNOTATION | Give the user of the PDF document permission to edit annotations.
PDF_SECURITY_REV3_FILLFORM | Give the user of the PDF document permission to fill in forms in the document.
PDF_SECURITY_REV3_ASSEMBLEDOCUMENT | [128 bit only] Give the user of the PDF document permission to add pages to or delete pages from the document.

See Also

Elements: | PDFUserPassword property, EnablePDF128bit property, PDFOwnerPassword property
Topics: | Raster Images: Saving Files


PDFGraphicsAlpha property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PDFGraphicsAlpha
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the flag that indicates what type of graphics anti-aliasing that LEADTOOLS uses when loading PDF, PS or EPS files.

Value | Meaning
1 | Do not use graphics anti-aliasing.
2 | Use 2-bit graphics anti-aliasing.
4 | Use 4-bit graphics anti-aliasing.

The default setting is 1.

Graphics anti-aliasing slows down the drawing of the resulting bitmap.

Graphics anti-aliasing can only be used if PDFDisplayDepth property is set to 8 or greater.

See Also

Elements: | PDFXResolution property , PDFYResolution property , PDFDisplayDepth property, PDFTextAlpha property, PDFUseLibFonts property
Topics: | Raster Images: Loading Files


PDFInitDir property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR PDFInitDir
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Gets or sets the path of the PDF Lib, Font and Resource initialization directories.

The default PDF initialization directories path is stored in the system registry key: "HKEY_LOCAL_MACHINE\SOFTWARE\LEAD Technologies, Inc.\Pdf\GS_LIB". If this property is not set, the engine will look for the PDF initialization files in the default PDF initialization directories path (specified by the registry key).

See Also

Elements:

PreLoadFilters method, IgnoreFilters method, PDFXResolution property, PDFYResolution property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property, PDFUserPassword property, EnablePDF128bit property, PDFEncryptFlags property, PDFSaveUseDPI property, PDFSaveLowMemory property, PreLoadFilters method, IgnoreFilters method, PDFDisplayDepth property, PDFGraphicsAlpha property, PDFSaveLowMemory property, PDFSaveUseDPI property, PDFTextAlpha property, PDFUseLibFonts property, PDFXResolution property, PDFInitDir property, PDFYResolution property


PDFOwnerPassword property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR PDFOwnerPassword
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Gets or sets a string that contains the owner password. This should be provided to prevent users from changing access/protection settings.

See Also

Elements: | PDFUserPassword property, EnablePDF128bit property, PDFEncryptFlags property
Topics: | Raster Images: Saving Files


PDFSaveLowMemory property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL PDFSaveLowMemory
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Indicates whether to try to use less memory when creating a PDF file with JPEG or Fax compression. Possible values are:

Setting | Description
TRUE | Try to use less memory when creating a PDF file with JPEG or Fax compression.
FALSE | Do not try to use less memory when creating a PDF file with JPEG or Fax compression. This is the default value.

See Also

Elements: | PDFDisplayDepth property, PDFGraphicsAlpha property, PDFTextAlpha property, PDFUseLibFonts property, PDFXResolution property, PDFYResolution property
Topics: | Raster Images: Saving Files


PDFSaveUseDPI property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL PDFSaveUseDPI
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Indicates whether to use the bitmap's DPI in calculating page dimensions when saving a PDF file. The BitmapXRes property and the BitmapYRes property are updated with the bitmap's DPI when a bitmap is loaded. If this property is TRUE, the values in the BitmapXRes and BitmapYRes properties will be used to calculate the page dimensions when a PDF file is saved.

Possible values are:

Value | Meaning
TRUE | Use the bitmap's DPI in calculating page dimensions when saving a PDF file.
FALSE | Ignore bitmap DPI when saving a PDF file.

The default setting is FALSE.

See Also

Elements: | PDFDisplayDepth property, PDFGraphicsAlpha property, PDFTextAlpha property, PDFUseLibFonts property, PDFXResolution property, PDFYResolution property
Topics: | Raster Images: Saving Files


PDFTextAlpha property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PDFTextAlpha
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the flag that indicates what type of font anti-aliasing that LEADTOOLS uses when loading PDF, PS or EPS files.

Value | Meaning
1 | Do not use font anti-aliasing.
2 | Use 2-bit font anti-aliasing.
4 | Use 4-bit font anti-aliasing.

The default setting is 4.

Aliasing is the effect on all pixel devices where diagonal and curved lines have a zigzag appearance. As pixels get larger, this effect becomes more noticeable. Anti-aliasing refers to methods designed to decrease or eliminate this effect. This is done by shading the pixels along the borders of the affected lines.

Font anti-aliasing slows down the drawing of the resulting bitmap.

Font anti-aliasing can only be used if PDFDisplayDepth property is set to 8 or greater.

See Also

Elements: | PDFXResolution property, PDFYResolution property, PDFDisplayDepth property, PDFGraphicsAlpha property, PDFUseLibFonts property
Topics: | Raster Images: Loading Files


PDFUseLibFonts property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL PDFUseLibFonts
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the flag that indicates whether to use fonts installed by the PDF module or system fonts when loading PDF, PS or EPS files.

Value | Meaning
TRUE | Use the PDF module installed fonts.
FALSE | Use the system fonts.

The default setting is TRUE.

See Also

Elements: | PDFXResolution property, PDFYResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property
Topics: | Raster Images: Loading Files


PDFUserPassword property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR PDFUserPassword
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Gets or sets a string that contains the user password. This should be provided to protect the document from being opened/read.

See Also

Elements: | PDFOwnerPassword property, EnablePDF128bit property, PDFEncryptFlags property
Topics: | Raster Images: Saving Files


PDFXResolution property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PDFXResolution
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the horizontal DPI (dots per inch) value that LEADTOOLS uses when loading PDF, PS or EPS files.

The default for this property is 96.

See Also

Elements: | PDFYResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property
Topics: | Raster Images: Loading Files


PDFYResolution property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PDFYResolution
Overview | Refer to Implementing PDF Plug in Features.

Remarks

Sets the vertical DPI (dots per inch) value that LEADTOOLS uses when loading PDF, PS or EPS files.

The default for this property is 96.

See Also

Elements: | PDFXResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property
Topics: | Raster Images: Loading Files


PictureCoder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCPictureCoderConstants PictureCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Setting | Description
MRC_PICTURE_COMPRESSION_CMW | [0x00] Use LEAD Wavelet (CMW) compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_LOSSLESS_CMW | [0x01] Use LEAD Wavelet lossless compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_CMP | [0x02] Use LEAD CMP compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG | [0x03] Use JPEG Compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PICTURE_COMPRESSION_LOSSLESS_JPEG | [0x04] Use JPEG Lossless Compression. This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_YUV422 | [0x05] JPEG Compression with YUV 4:2:2 color space.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_YUV411 | [0x06] JPEG Compression with YUV 4:1:1 color space.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE | [0x07] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE_YUV422 | [0x08] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE_YUV411 | [0x09] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_JPEG | [0x0A] Use JPEG Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_YUV422 | [0x0B] JPEG Compression with YUV 4:2:2 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_YUV411 | [0x0C] JPEG Compression with YUV 4:1:1 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE | [0x0D] JPEG Progressive Compression.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE_YUV422 | [0x0E] JPEG Progressive Compression with YUV 4:2:2 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE_YUV411 | [0x0F] JPEG Compression with YUV 4:1:1 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_ZIP | [0x10] Use ZIP Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_LZW | [0x11] Use LZW Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveT44 methods.

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

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


PictureQFactor property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PictureQFactor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

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

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

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


PLTPenColor property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR PLTPenColor (short iIndex);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets an array of colors that represent pen colors used by an HPGL file.

Default values are:

PLTPenColor(0) | RGB( 255, 255, 255 )
PLTPenColor(1) | RGB( 0, 0, 0 )
PLTPenColor(2) | RGB( 255, 0, 0 )
PLTPenColor(3) | RGB( 0, 255, 0 )
PLTPenColor(4) | RGB( 255, 255, 0 )
PLTPenColor(5) | RGB( 0, 0, 255 )
PLTPenColor(6) | RGB( 255, 0, 255 )
PLTPenColor(7) | RGB( 0, 255, 255 )

If this property is not set before loading a PLT file, the default values listed above will be used.

See Also

Elements: | PLTPenWidth property
Topics: | Raster Images: Loading Files
 | Using Color Values in LEADTOOLS


PLTPenWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PLTPenWidth (short iIndex);
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets an array of integers that represent pen widths used by an HPGL file.

Default values are:

PLTPenWidth(0) | 1
PLTPenWidth(1) | 1
PLTPenWidth(2) | 1
PLTPenWidth(3) | 1
PLTPenWidth(4) | 1
PLTPenWidth(5) | 1
PLTPenWidth(6) | 1
PLTPenWidth(7) | 1

If this property is not set before loading a PLT file, the default values listed above will be used.

See Also

Elements: | PLTPenColor property
Topics: | Raster Images: Loading Files


PreferredLoadFormat property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RasterFileConstants PreferredLoadFormat
Overview | Refer to Loading a Bitmap from a File

Remarks

Contains the file format to try first when recognizing files for loading or getting file information, etc. For a list of possible values, refer to Formats of Input Files. For example, if your application is going to work with lots of PNG files, you can set this to FILE_PNG. Then, when a file is loaded, LEADTOOLS will test to see if the file is a PNG first. If it is not, then LEADTOOLS will continue with its normal process for recognizing a file.

Set this property to - 1 for normal behavior.


PreLoadFilterCachedCount property (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short PreLoadFilterCachedCount
Overview | Refer to Loading Filters

Remarks

(Read only) This property is updated, automatically, and when the PreloadFilters method is called, with the current number of cached filters in the preload filters list.

Use the PreloadFilters method to set the current list of file format filters to be loaded by LEADTOOLS.

For more information on preloading filters, refer to the PreloadFilters method.

See Also

Elements: | IgnoreFilters method, PreloadFilters method, PreloadFilterList property, PreLoadFilterFixedCount property, IgnoreFilterList property
Topics: | Raster Images: Input/Output File Filters


PreLoadFilterFixedCount property(ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short PreLoadFilterFixedCount
Overview | Refer to Loading Filters

Remarks

(Read only) This property is updated automatically, and when the PreloadFilters method is called, with the current number of fixed filters in the preload filters list.

Use the PreloadFilters method to set the current list of file format filters to be loaded by LEADTOOLS.

For more information on preloading filters, refer to the PreloadFilters method.

See Also

Elements: | IgnoreFilters method, PreloadFilters method, PreloadFilterList property, PreLoadFilterCachedCount property, IgnoreFilterList property
Topics: | Raster Images: Input/Output File Filters


PreLoadFilterList property(ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | BSTR PreLoadFilterList
Overview | Refer to Loading Filters

Remarks

(Read only) This property is updated, both automatically, and when the PreloadFilters method is called, with the current list of file format filters to be loaded.

Read this property to determine the current list of file format filters to be loaded by LEADTOOLS, before calling the PreloadFilters method to change the list.

If this property is read before the PreloadFilters method has ever been called, then this property will contain the list of default filters.

Read the IgnoreFiltersList property to determine the current list of file format filters to be ignored by LEADTOOLS. To change the list of file format filters to be ignored, call the IgnoreFilters method.

For more information on preloading filters, refer to the PreloadFilters method.

See Also

Elements: | IgnoreFilters method, PreloadFilters method, PreLoadFilterFixedCount property, PreLoadFilterCachedCount property, IgnoreFiltersList property
Topics: | Raster Images: Input/Output File Filters


ProgressivePasses property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ProgressivePasses
Overview | Refer to Loading a Bitmap from a File.

Remarks

Specifies the number of paint-while-load passes when the file is a progressive LEAD or JPEG file.

This property is also valid when reading (but not when writing) interlaced PNG files.

When the PaintWhileLoad property is TRUE, the full dimensions of the image can paint quickly on the first pass. Then, the image becomes progressively clearer on subsequent passes.

You can set this property before saving a LEAD or JPEG file to specify the possible number of passes. You can set it before loading a progressive LEAD or JPEG file (or an interlaced PNG file) to determine how many passes are actually used.

Technically, only files with more than three passes are progressive files. They include full color in the low-resolution first pass; subsequent passes improve the resolution. Files that contain two or three passes are multiscan files. They include grayscale information in the first pass, and color information in the subsequent pass or passes.

For information on progressive loading of JBIG files, refer to Implementing JBIG Features.

Setting | Description
0 | (When saving) Save as an ordinary CMP or JPEG file, not a progressive file.
Any positive number | (When saving or loading) Use the specified number of passes.
PROGRESSIVEPASSES_WHEN_MEANINGFUL | (Only when loading) Stop painting when full clarity is achieved.
PROGRESSIVEPASSES_ALWAYS | (Only when loading) Use the number of passes specified in the file being loaded.
PROGRESSIVEPASSES_ONCE | (Only when loading) Paint once with full clarity.

See Also

Topics: | Raster Images: Loading Files
 | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information


PTKResolution property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PTKResolution;
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets the display resolution that LEADTOOLS uses when loading PTOCA and AFP: PTOCA files.

The default for this property is 96.

See Also

Elements: | PDFYResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property, PDFUseLibFonts property, PLTPenWidth property, PLTPenColor property, RTFTopMarg property, RTFBottomMarg property, RTFRightMarg property, RTFLeftMarg property, RTFPaperWidth property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


RasterizeViewMode property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RasterizeViewModeConstants RasterizeViewMode
Overview | Refer to Loading Vector Files.

Remarks

Sets the viewport mode value that LEADTOOLS uses when loading the following Vector file formats: DXF, DWF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector.

Value | Meaning
L2D_USE_BEST | Fit the drawing into the current viewport width and height. Final image size is less than or equal to viewport size.
L2D_USE_WIDTH | Use the current viewport width. Calculate new height, preserving the aspect ratio. Final image size has the same width as the current viewport width, with the height less than or equal to the current viewport height.
L2D_USE_HEIGHT | Use the current viewport height. Calculate the new width, preserving the aspect ratio. Final image size has the same height as the current viewport height, with the width less than or equal to the current viewport width.
L2D_USE_WIDTH_HEIGHT | Use both the width and the height (stretch image if necessary). Final image size has the same width and height as the current viewport size.

Please note that read and write support for the file formats listed above require a LEADTOOLS Vector toolkit. Read support for the file formats listed above require an additional file format plug in. In addition, support for these files formats must be unlocked. For information about unlocking support, refer to Unlocking Vector File Format Support. For more information on available File Format Plug ins, refer to Topic Selection and click on LEAD Products.

See Also

Elements: | RasterizeViewportWidth property ,RasterizeViewportHeight property
Topics: | Raster Images: Loading Files


RasterizeViewportHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short RasterizeViewportHeight
Overview | Refer to Loading Vector Files.

Remarks

Sets the viewport height value that LEADTOOLS uses when loading the following Vector file formats: DXF, DWF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector.

A 3D file format usually doesn't have a physical size. The user can specify a viewport (physical size up to which the drawing can be rendered) by using the RasterizeViewportHeight property and the RasterizeViewportWidth property. How the drawing is to be rendered inside this viewport depends on the current viewport mode set with the RasterizeViewMode property.

The default for this property is 480.

Please note that read and write support for the file formats listed above requires a LEADTOOLS Vector toolkit. Read support for the file formats listed above requires an additional file format plug in. In addition, support for these files formats must be unlocked. For information about unlocking support, refer to Unlocking Vector File Format Support. For more information on available File Format Plug ins, refer to Topic Selection and click on LEAD Products.

See Also

Elements: | RasterizeViewportWidth property, RasterizeViewMode property
Topics: | Raster Images: Loading Files


RasterizeViewportWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short RasterizeViewportWidth
Overview | Refer to Loading Vector Files.

Remarks

Sets the viewport width value that LEADTOOLS uses when loading the following Vector file formats: DXF, DWF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector.

A 3D file format usually doesn't have a physical size. The user can specify a viewport (physical size up to which the drawing can be rendered) by using the RasterizeViewportWidth property and the RasterizeViewportHeight property. How the drawing is to be rendered inside this viewport depends on the current viewport mode set with the RasterizeViewMode property.

The default for this property is 640.

Please note that read and write support for the file format listed above requires a LEADTOOLS Vector toolkit. Read support for the file format listed above requires an additional file format plug in. In addition, support for these files formats must be unlocked. For information about unlocking support, refer to Unlocking Vector File Format Support. For more information on available File Format Plug ins, refer to Topic Selection and click on LEAD Products.

See Also

Elements: | RasterizeViewportHeight property, RasterizeViewMode property
Topics: | Raster Images: Loading Files


ReadyState property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ReadyState
Overview | Refer to Implementing Internet Features.

Remarks

Indicates the current state of an image that is loaded asynchronously using the BitmapDataPath method.

Value | Description
READYSTATE_LOADING | Currently loading
READYSTATE_COMPLETE | Finished loading

See Also

Elements: | BitmapDataPath method, ReadyStateChange event
Topics: | Raster Images: Loading Files


RTFBottomMarg property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFBottomMarg
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the width of the bottom margin used when loading RTF files in LEADTOOLS.

Default value is 1 inch.

See Also

Elements: | RTFTopMarg property, RTFRightMarg property, RTFLeftMarg property, RTFPaperWidth property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


RTFLeftMarg property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFLeftMarg
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the width of the left margin used when loading RTF files in LEADTOOLS.

Default value is 1.25 inch.

See Also

Elements: | RTFTopMarg property, RTFBottomMarg property, RTFRightMarg property, RTFPaperWidth property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


RTFPaperHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFPaperWidth
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the height of the paper used when loading RTF files in LEADTOOLS.

Default value is 11.69 inches.

See Also

Elements: | RTFTopMarg property, RTFBottomMarg property, RTFRightMarg property, RTFLeftMarg property, RTFPaperWidth property
Topics: | Raster Images: Loading Files


RTFPaperWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFPaperWidth
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the width of the paper used when loading RTF files in LEADTOOLS.

Default value is 8.27 inches.

See Also

Elements: | RTFTopMarg property, RTFBottomMarg property, RTFRightMarg property, RTFLeftMarg property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


RTFRightMarg property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFRightMarg
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the width of the right margin used when loading RTF files in LEADTOOLS.

Default value is 1.25 inches.

See Also

Elements: | RTFTopMarg property, RTFBottomMarg property, RTFLeftMarg property, RTFPaperWidth property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


RTFTopMarg property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | double RTFTopMarg
Overview | Refer to Loading a Bitmap from a File.

Remarks

Gets or sets a value that represents the width of the top margin used when loading RTF files in LEADTOOLS.

Default value is 1 inch.

See Also

Elements: | RTFBottomMarg property, RTFRightMarg property, RTFLeftMarg property, RTFPaperWidth property, RTFPaperHeight property
Topics: | Raster Images: Loading Files


SaveBufferAddress property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long SaveBufferAddress;
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Holds the address of the memory buffer that the user allocates in a SaveBuffer process.

Prior to calling the SaveBuffer method, the user must allocate a memory buffer and set the SaveBufferAddress property to the address of the memory buffer. For more information, refer to the SaveBuffer method.

See Also

Elements: | SaveBuffer method, SaveBufferSize property, EnableSaveBufferEvent property, SaveBuffer event, LoadBuffer method, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveBufferSize property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long SaveBufferSize;
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Holds the size of the memory buffer that the user allocates in a SaveBuffer process.

Prior to calling the SaveBuffer method, the user must allocate a memory buffer and set the SaveBufferSize property to the size of the memory buffer. For more information, refer to the SaveBuffer method.

See Also

Elements: | SaveBuffer method, SaveBufferAddress property, EnableSaveBufferEvent property, SaveBuffer event, LoadBuffer method, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveICCProfile method (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short SaveICCProfile(BSTR pszName, ILEADRasterVariant *pData, long lPage);
Overview | Refer to Using ICC Profile Functionality

Remarks

Saves (embeds) an ICC profile in an image file.

ICC profiles can be saved into JPEG, TIFF or GIF files. TIFF files are multipage, so the profile can be saved to a particular page using the lPage parameter.

See Also

Elements: | LoadICCProfile method, LoadICCProfile2 method, SaveICCProfile2 method.
Topics: | Raster Images: Saving Files


SaveICCProfile2 method (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | short SaveICCProfile2(BSTR pszName, VARIANT *pData, long lPage);
Overview | Refer to Using ICC Profile Functionality

Remarks

Saves (embeds) an ICC profile in an image file.

ICC profiles can be saved into JPEG, TIFF or GIF files. TIFF files are multipage, so the profile can be saved to a particular page using the lPage parameter.

See Also

Elements: | LoadICCProfile method, LoadICCProfile2 method, SaveICCProfile method
Topics: | Raster Images: Saving Files


SaveIFD property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long SaveIFD
Overview | Refer to Loading and Saving Large TIFF Files.

Remarks

Specifies the offset within the current file of the reference page used when saving a page in a TIFF file. If this property is 0, then page 1 is the first page in the file. If this property is not 0, then page 1 is the page that starts at the offset.

The SaveIFD property can be used to speed up the process of appending, replacing or deleting a page inside a TIFF file with many pages.

The page starting at the offset given by this property is treated as page 1. The next page can be replaced by setting the SavePage property to 2 and calling the Save method. To delete the page after the one indicated by SaveIFD, call DeletePage("test.tif", 2).

Due to the organization of TIFF files, SaveIFD can be used to speed up the replacement, deletion and insertion of pages after the offset indicated by SaveIFD. However, to delete the page indicated by SaveIFD, by calling DeletePage("test.tif", 1), LEADTOOLS will have to go through all the pages from the beginning of the file, to get to the page to delete. Consequently, there will be no speed improvement in this situation.

When the current TIF file is no longer needed, this property must be reset to 0, otherwise the processing of any other TIF files will be incorrect.

See Also

Elements | IgnoreViewPerspective property, InfoIFD property, LoadIFD property, DeletePage method, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Loading and Saving Large TIFF Files


SaveInterlaced property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL SaveInterlaced
Overview | Refer to Saving a Bitmap to a File.

Remarks

Determines whether GIF files are saved as interlaced files.

Value | Meaning
TRUE | Whenever a GIF file is saved, make it an interlaced file.
FALSE | Whenever a GIF file is saved, make it non-interlaced.

See Also

Elements: | SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveLayers property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL SaveLayers;
Overview | Refer to Layers in Files

Remarks

Indicates whether PSD files are saved with or without layers. Possible values are:

Value | Meaning
TRUE | When a PSD file is saved, all the bitmaps in the list are saved as layers. The LayerLeft and LayerTop properties contain positioning information for each layer.
FALSE | PSD files are saved without layers. The layer information is ignored.

See Also

Elements: | Save method, LayerLeft property, LayerTop property, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveLSB property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL SaveLSB
Overview | Refer to Saving a Bitmap to a File.

Remarks

Indicates whether to save TIFF 1-bit images or RAW uncompressed data least significant bit first or most significant bit first. Possible values are:

Value | Meaning
TRUE | Save TIFF 1-bit or RAW uncompressed images least significant bit first.
FALSE | Save TIFF 1-bit or RAW uncompressed images most significant bit first.

When saving RAW uncompressed data, the bits in each byte can be reversed by setting this property to TRUE.

Saving TIFF 1-bit images least significant bit first is used only when saving uncompressed and fax compressed images.

The default is FALSE (most significant bit first).

To save Class F compatible images, it is recommended that you save files with SaveLSB set to TRUE. In addition, the image’s BitmapXRes should be 204, 300 or 400, and the BitmapYRes should be 98, 196, 300 or 400.

See Also

Elements: | BitmapXRes property, BitmapYRes property, ScaleMode property, Save method, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveMemory2Handle property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long SaveMemory2Handle;
Overview | Refer to Using Memory-Resident Image Files.

Remarks

Gets or sets the OLE_HANDLE used to reference the file in memory.

See Also

Elements: | SaveMemory2Size property, SaveMemory2 method
Topics: | Raster Images: Saving Files


SaveMemory2Size property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | long SaveMemory2Size;
Overview | Refer to Using Memory-Resident Image Files.

Remarks

(Read only) Gets the size of the file in memory.

See Also

Elements: | SaveMemory2Handle property, SaveMemory2 method
Topics: | Raster Images: Saving Files


SaveNoPalette property (ILEADRasterIO)

Syntax | VARIANT_BOOL SaveNoPalette;
Overview | Refer to Saving a Bitmap to a File..

Remarks

Indicates whether to save TIFF grayscale images with or without a plaette. Possible values are:

Value | Meaning
TRUE | Save TIFF grayscale images without a palette.
FALSE | Save TIFF grayscale images with a palette.

The default is FALSE (saves the image with the grayscale palette).

See Also

Elements: | BitmapXRes property, BitmapYRes property, ScaleMode property, Save method, SaveTileHeight property, SaveTileWidth property, SaveLSB property
Topics: | Raster Images: Saving Files


SavePad4 property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL SavePad4
Overview | Refer to Saving a Bitmap to a File.

Remarks

Indicates whether to save RAW uncompressed data with each line padded so that the length is a multiple of four bytes.

Value | Meaning
TRUE | Save RAW uncompressed images with each line padded to a multiple of four bytes
FALSE | Save RAW uncompressed data with no padding at the end of each line.

When saving RAW uncompressed data, each row of data can be saved as is, or padded so that the byte-length is a multiple of four.

See Also

Elements: | SaveOffset method, FileSizeWritten property, SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files


SavePage property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SavePage
Overview | Refer to Saving a Bitmap to a File.

Remarks

Represents a page number in a multipage file. This property is used only if the iModify parameter of the Save method is SAVE_REPLACE or SAVE_INSERT. If iModify is SAVE_REPLACE, SavePage represents the number of the page to replace (the first page is page 1). If iModify is SAVE_INSERT, SavePage represents the number of the page in front of which the new page will be inserted. For example, if SavePage is 1 and iModify is SAVE_INSERT, then the page you save will become the first page in the file.

See Also

Elements: | SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information


SavePageNumberTag property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL SavePageNumberTag
Overview | Refer to Saving a Bitmap to a File.

Remarks

Indicates whether or not to update and save the PageNumber tag associated with the pages of a multi-page TIFF file. Possible values are:

Value | Meaning
TRUE | Update and save the PageNumber tag associated with each page of a TIFF file.
FALSE | Do not update and save the PageNumber tag associated with each page of a TIFF file.

By default, this property is TRUE. Therefore, whenever TIFF files are saved, or pages are deleted from a TIFF file, the PageNumber tag for each page is updated and saved. For files having many pages, this may be time consuming.

Note: This property must be set to TRUE in order to save Class-F compatible TIFF files.

See Also

Elements: | SaveTileHeight property, SaveTileWidth property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information


SaveResolutionCount property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SaveResolutionCount
Overview | Refer to Implementing JBIG Features

Remarks

Specifies the number of resolutions to write.

When you set this property, you should also fill the SaveResolutionWidth and SaveResolutionHeight array properties with the desired resolutions to save. The arrays should be filled from SaveResolutionWidth(0) to SaveResolutionWidth(SaveResolutionCount-1) and SaveResolutionHeight(0) to SaveResolutionHeight(SaveResolutionCount-1).

Currently, only the JBIG format uses these properties.

Note that for a JBIG save, only the first resolution is used. Each subsequent dimension up to SaveResolutionCount will actually be calculated as 1/2 the previous dimension.

Ex.

SaveResolutionCount = 3
SaveResolutionWidth(0) = 800
SaveResolutionWidth(0) = 400

If you then save an image that is 1600 x 800, the resolutions that are stored in the file would be:

800 x 400
400 x 200
200 x 100

By default, the control will save images using the default of the file format. For JBIG only one resolution which has the size of the bitmap being saved will be saved.

See Also

Elements:

Save method, SaveResolutionWidth property, SaveResolutionHeight property, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveTileHeight property, SaveTileWidth property


SaveResolutionHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SaveResolutionHeight(short nIndex)
Overview | Refer to Implementing JBIG Features

Remarks

Specifies the height component of the resolution to write.

The array range is SaveResolutionWidth(0) to SaveResolutionWidth(SaveResolutionCount-1).

Currently, only the JBIG format uses these properties.

Note that for a JBIG save, only the first resolution is used. Each subsequent dimension up to SaveResolutionCount will actually be calculated as 1/2 the previous dimension. You can set this to 0 to use the default or, you can set this to 0 and set a value for the height component, and the width component will be automatically calculated for you based on the aspect ratio of the image being saved.

Ex.

SaveResolutionCount = 3
SaveResolutionWidth(0) = 800
SaveResolutionWidth(0) = 400

If you then save an image that is 1600 x 800, the resolutions that are stored in the file would be:

800 x 400
400 x 200
200 x 100

By default, the control will save images using the default of the file format. For JBIG only one resolution which has the size of the bitmap being saved will be saved.

The unit of measure is determined by the ScaleMode property.

See Also

Elements:

Save method, SaveResolutionCount property, SaveResolutionWidth property, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveTileHeight property, SaveTileWidth property


SaveResolutionWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SaveResolutionWidth(short nIndex)
Overview | Refer to Implementing JBIG Features

Remarks

Specifies the width component of the resolution to write.

The array range is SaveResolutionWidth(0) to SaveResolutionWidth(SaveResolutionCount-1).

Currently, only the JBIG format uses these properties.

Note that for a JBIG save, only the first resolution is used. Each subsequent dimension up to SaveResolutionCount will actually be calculated as 1/2 the previous dimension. You can set this to 0 to use the default or, you can set this to 0 and set a value for the height component, and the width component will be automatically calculated for you base on the aspect ratio of the image being saved.

Ex.

SaveResolutionCount = 3
SaveResolutionWidth(0) = 800
SaveResolutionWidth(0) = 400

If you then save an image that is 1600 x 800, the resolutions that are stored in the file would be:

800 x 400
400 x 200
200 x 100

By default, the control will save images using the default of the file format. For JBIG only one resolution which has the size of the bitmap being saved will be saved.

The unit of measure is determined by the ScaleMode property.

See Also

Elements:

Save method, SaveResolutionCount property, SaveResolutionHeight property, LoadResolutionCount property, LoadResolutionHeight property, LoadResolutionWidth property, PCDRes property, SetLoadResolution method, GetLoadResolution method, SaveTileHeight property, SaveTileWidth property


SaveTileHeight property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SaveTileHeight;
Overview | Refer to Saving a Bitmap to a File.

Remarks

This property indicates the strip height or tile height to use when saving TIF files.

If this property is 0, the default height is used when saving TIF files.

The SaveTileWidth property determines whether the bitmap will be saved in strips or tiles.

See Also

Elements: | Save method, SaveTileWidth property
Topics: | Raster Images: Saving Files


SaveTileWidth property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | float SaveTileWidth;
Overview | Refer to Saving a Bitmap to a File.

Remarks

This property influences the way TIF files are saved, based on the following:

If SaveTileWidth is 0, TIF files will be saved in strips (default). This is recommended, since not all programs read tiled files.

If SaveTileWidth is greater than the bitmap width, the file will be saved as strips.

If SaveTileWidth is less than the bitmap width, the file will be saved as tiles. Please note that files saved in this way may not be read by all software packages. However, LEADTOOLS will still read these files.

If TIF files are saved as tiles, the tile size might be rounded to the closest available size. The following restrictions apply when saving TIF files as tiles:

1, 2, 3, 5, 6, and 7-bit images must have a tile width that is a multiple of 8.

4-bit and 12-bit images must have a tile width that is a multiple of 2.

Other bits per pixel have no restrictions.

See Also

Elements: | Save method, SaveTileHeight property
Topics: | Raster Images: Saving Files


StopFireEnumTags property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL StopFireEnumTags
Overview | Refer to Implementing TIFF Tags

Remarks

Stops the EnumTags event. This property should be called from inside the EnumTags event. Possible values are:

Value | Meaning
TRUE | Abort firing the EnumTags event.
FALSE | Continue firing the EnumTags event.

See Also

Elements: | EnumTags event, EnumFileTags method, ReadTag method
Topics: | Raster Images: Maintaining TIFF Tags


Text2BitCoder property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCText2BitCoderConstants Text2BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Setting | Description
MRC_TEXT_COMPRESSION_JBIG_2BIT | [0x00] JBIG 2-bit compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_TEXT_COMPRESSION_GIF_2BIT | [0x01] GIF 2-bit compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_TEXT_COMPRESSION_ZIP | [0x02] ZIP compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_TEXT_COMPRESSION_LZW | [0x03] LZW compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.

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

See Also

Elements | Save method, Grayscale8BitCoder property, Grayscale8BitQFactor property
Topics | Saving Capabilities
 | Raster Images: Saving a Page


TXTBold property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | VARIANT_BOOL TXTBold
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to display the text as bold. Possible values are:

Setting | Description
VARIANT_TRUE | Displays the text as bold.
VARIANT_FALSE | Displays the text as not bold. This is the default value.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTBottomMarg property(ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTBottomMarg
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the width in inches of the bottom margin used when loading TXT files.

The default value is 1.

See Also

Elements: | TXTTopMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTEnabled property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | VARIANT_BOOL TXTEnabled
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to call the TXT filter. Possible values are:

Setting | Description
VARIANT_TRUE | Call the filter.
VARIANT_FALSE | Don't call the filter. This is the default value.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTFaceName property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | BSTR TXTFaceName
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the text font face name used when loading TXT files.

The default value is "Courier New".

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTFontColor property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | OLE_COLOR TXTFontColor
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the value of the text font color used when loading TXT files in LEADTOOLS.

The default value is RGB( 0, 0, 0).

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTFontSize property(ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | Short TXTFontSize
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the text font size used when loading TXT files.

The default value is 12.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTHighlight property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | OLE_COLOR TXTHighlight
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the value of the text high light color used when loading TXT files.

The default value is RGB( 0xFF, 0xFF, 0xFF).

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTItalic property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | VARIANT_BOOL TXTItalic
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to display the text as italic. Possible values are:

Setting | Description
VARIANT_TRUE | Displays the text as italic.
VARIANT_FALSE | Displays the text as not italic. This is the default value.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTLeftMarg property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTLeftMarg
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the width in inches of the left margin used when loading TXT files.

The default value is 1.25

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTPaperHeight property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTPaperHeight
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the height in inches of the paper used when loading TXT files.

The default value is 11.69.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTPaperWidth property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTPaperWidth
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the width in inches of the paper used when loading TXT files.

The default value is 8.27.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTRightMarg property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTRightMarg
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the width in inches of the right margin used when loading TXT files.

The default value is 1.25

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTStrikeThrough property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | VARIANT_BOOL TXTStrikeThrough
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to display the text with a strikethrough. Possible values are:

Setting | Description
VARIANT_TRUE | Displays the text with a strikethrough.
VARIANT_FALSE | Displays the text without a strikethrough. This is the default value.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTTopMarg property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | double TXTTopMarg
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets the width in inches of the top margin used when loading TXT files.

The default value is 1.

See Also

Elements: | TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTUnderLine property, TXTEnabled property
Topics: | Raster Images: Loading Files


TXTUnderLine property (ILEADRasterIO)

Visual Basic Example

Visual C++ Example

Syntax | VARIANT_BOOL TXTUnderLine
Overview | Refer to Loading a Bitmap from a File

Remarks

Gets or sets a value that indicates whether to display the text underlined. Possible values are:

Setting | Description
VARIANT_TRUE | Displays the text underlined.
VARIANT_FALSE | Displays the text as not underlined. This is the default value.

See Also

Elements: | TXTTopMarg property, TXTBottomMarg property, TXTRightMarg property, TXTLeftMarg property, TXTPaperWidth property, TXTPaperHeight property, TXTFaceName property, TXTFontSize property, TXTFontColor property, TXTHighlight property, TXTStrikeThrough property, TXTBold property, TXTItalic property, TXTEnabled property
Topics: | Raster Images: Loading Files


UseFastConversion property (ILEADRasterIO)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL UseFastConversion
Overview | Refer to Loading a Bitmap from a File.

Remarks

Enables or disables using the fast color conversions when loading CMYK or CIELab files.

Setting this property to TRUE will greatly speed up the loading of CMYK and CIELab files, but it will reduce the image quality.

This property used with TIF and JPEG only.

Possible values are:

Value | Meaning
VARIANT_TRUE | Speed up the loading of CMYK and CIELab files.
VARIANT_FALSE | Don’t speed up the loading of CMYK and CIELab files. This is the default value.

See Also

Elements: | LoadInfo event, LoadInfoBits property, LoadInfoFlags property, LoadInfoFormat property, LoadInfoHeight property, LoadInfoOffset property, LoadInfoWidth property, LoadInfoYRes property
Topics: | Raster Images: Loading Files


WMFResolution property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long WMFResolution
Overview | Refer to Loading a Bitmap from a File.

Remarks

Sets the DPI (dots per inch) value that LEADTOOLS uses when loading WMF files. A value of 0 results in the resolution present in the file being loaded. A positive value results in the image being loaded at the corresponding DPI. By default, the value is 0.

WMF files can contain vectored graphics or raster images. LEADTOOLS can load either type, but can save only raster images. The issue of image resolution arises mainly when loading vectored graphics.

LEADTOOLS loads a WMF file by creating a temporary device context (DC), drawing the vectored graphics (or painting the raster image) in the device context, and converting the resulting device context to a bitmap. Loading an image at some DPI values may yield an image that is smaller, and less detailed, than the original, or, since bitmaps use more memory than vectored graphics, it may yield an image that is too large to handle efficiently.

You can use InfoXRes property and WMFResolution, along with GetFileInfo, to manage these image size issues. The following are examples of how you can use these methods:

To load an image at its saved resolution, you can do the following:

1. | Set WMFResolution to 0.
2. | Call Load method to load the file.

To load an image that will fit a predetermined width (such as the width of your application's client area), you can do the following:

1. | Set WMFResolution to 0.
2. | Call GetFileInfo and check InfoXRes property and InfoWidth property, to determine the resolution and size of the image stored in the file.
3. | Calculate the necessary resolution to get the desired width. Where the necessary resolution is A, the value from InfoXRes property is B, the desired width is C, and the value of the Width field is D, the calculation is as follows: A = B * C / D.
4. | Set WMFResolution to the desired resolution.
5. | Call Load to load the file.

Some WMF files contain viewport information, which requires a device context of a particular size. LEADTOOLS always loads these files using the resolution specified in the file. In this case, the value specified by WMFResolution has no effect.

Note: When saving WMF files, LEADTOOLS saves the current resolution value in the file.

See Also

Elements:

GetFileInfo method, InfoXRes property, InfoYRes property, Load method, LoadMemory method, LoadStamp method


WriteMarkerAction property (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | WriteMarkerConstants WriteMarkerAction;
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Indicates how to process the current marker passed to the TransformMarker event. This property should be accessed only from within the TransformMarker event. Possible values for this property are:

Value | Meaning
WRITEMARKER_DEFAULT | [0] The marker will be transformed using the default transformation, after which it will be written to the file.
WRITEMARKER_IGNORE | [1] The marker will not be written to the file.
WRITEMARKER_ABORT | [2] The transformation process is aborted and the TransformFile method will return ERROR_USER_ABORT.

The value of the WriteMarkerAction property will be reset for every marker to WRITEMARKER_DEFAULT.

See Also

Elements: | TransformFile method, TransformMarker event, WriteMarker method
Topics: | Raster Images: Doing Geometric Transformations


EnumGeoKeys event (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

Syntax | void EnumGeoKeys(long uTag, long uType, long uCount);
Overview | Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

This event is called for each GeoKey enumerated by the EnumFileGeoKeys method.

This event will be called for every GeoKey on the page.

Calling this event will update the following GeoKeyData property in order to receive data indirectly from calling EnumFileGeoKeys method.

See Also

Elements: | SetGeoKey method, GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method
Topics: | Raster Images: Working with Geo Keys
 | Implementing TIFF Tags


EnumTags event (ILEADRasterIO)

Visual Basic Example

Visual C++ 5.0 example

Syntax | void EnumTags(long uTag, long uType, long uCount);
Overview | Refer to Implementing TIFF Tags

Remarks

The EnumFileTags method calls this event for each tag in the page. For more information, refer to the EnumFileTags method.

Abort firing the EnumTags event by setting the StopFireEnumTags property to TRUE. This will cause the EnumFileTags method to return an error.

Do not attempt to use the DeleteTag method to delete tags from inside an EnumTags event function. If you want to delete tags that you enumerate, use the EnumTags event to add the tags to a list. Upon returning from the EnumFileTags method, you can delete all the tags from the list.

See Also

Elements: | EnumFileTags method, ReadTag method, StopFireEnumTags property
Topics | Raster Images: Maintaining TIFF Tags


FilePage event (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void FilePage ();
Overview | Refer to Detecting Events.

Remarks

Occurs before loading each page of a file. For example, if you load all pages of a multipage file that contains three images, this event occurs three times.

See Also

Elements: | Change event
Topics: | Raster Images: Loading Files


KeyDown event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void KeyDown (short KeyCode, short Shift);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user presses a key while the Raster View Control has the focus. (To interpret ANSI characters, use the KeyPress event.)

See Also

Elements: | KeyUp event, KeyPress event
Topics: | Working with the Control: General Behavior
 | C++ Builder Problems


KeyPress event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void KeyPress (short KeyAscii);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user presses and releases an ANSI key.

See Also

Elements: | KeyDown event, KeyUp event
Topics: | Working with the Control: General Behavior
 | C++ Builder Problems


KeyUp event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void KeyUp (short KeyCode, short Shift);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user releases a key while an object has the focus. (To interpret ANSI characters, use the KeyPress event.)

See Also

Elements: | KeyDown event, KeyPress event
Topics: | Working with the Control: General Behavior
 | C++ Builder Problems


LoadInfo event (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void LoadInfo ();
Overview | Refer to Loading a Bitmap from a File.

Remarks

Occurs if LEADTOOLS attempts to load an image file, but does not find valid format information in the file header. You can use this event for loading input data (such as raw fax) that LEADTOOLS cannot recognize.

LEADTOOLS will only attempt to recognize fax files if you respond to this event and have filled the LoadInfoXXX properties listed below. If you want LEADTOOLS to automatically recognize any fax file, set the LoadInfoWidth and LoadInfoHeight properties to -1 once, at the beginning of the program. If you recognize the file and know the width and height of the file, set LoadInfoWidth and LoadInfoHeight to a positive value.

This event occurs before an error message is generated. You can set the following properties in this event to supply the missing header information:

LoadInfoBits property

LoadInfoFlags property

LoadInfoFormat property

LoadInfoHeight property

LoadInfoOffset property

LoadInfoWidth property

LoadInfoXRes property

LoadInfoYRes property

IOPalette property

You can also set these properties elsewhere in your program. For example, you could set them at the time you identify the file that is to be loaded. But LEADTOOLS does not check the property values until after it has failed to find the header information and the LoadInfo event has occurred.

See Also

Elements | EnableLoadInfoEvent property, ColorSpace property, LoadOffset method
Topics | Raster Images: Loading Files, Working with the RAW File Filter


ReadyStateChange event (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void ReadyStateChange (long ReadyState);
Overview | Refer to Implementing Internet Features.

Remarks

Occurs when there is a change in the ReadyState property.

The ready state is the state of an image that is loaded asynchronously using the BitmapDataPath method.

See Also

Elements: | BitmapDataPath method, ReadyState property
Topics: | Raster Images: Loading Files


SaveBuffer event (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | void SaveBuffer(long uRequiredSize);
Overview | Refer to Using Memory-Resident Image Files.

Remarks

This event is generated in a SaveBuffer process to tell the user that the allocated memory buffer is not large enough. This allows the user to reallocate the memory buffer so that it is at least ‘uRequiredSize’ bytes. The user should also set the SaveBufferAddress property to the address of the newly allocated buffer (if it has changed since last allocated), and the SaveBufferSize property to the size of the newly allocated buffer. Note that ‘uRequiredSize’ is the minimum required size of the buffer. The user can allocate a chunk of memory that is larger than ‘uRequiredSize’ if desired.

This event is generated only if the EnableSaveBufferEvent property is set to TRUE prior to calling the SaveBuffer method.

To abort the SaveBuffer process (if for example ‘uRequiredSize’ bytes cannot be reallocated), set the EnableSaveBufferEvent property to FALSE in the SaveBuffer event.

To summarize, when processing the SaveBuffer event you must

1. | Reallocate the memory buffer to be at least ‘uRequiredSize’ bytes
2. | Set the SaveBufferAddress property to be the address of the reallocated memory buffer
3. | Set the SaveBufferSize property to be the size of the reallocated memory buffer
4. | If at least ‘uRequiredSize’ bytes cannot be reallocated, set the EnableSaveBufferEvent property to FALSE to abort the SaveBuffer process.

For more information, refer to the SaveBuffer method.

See Also

Elements | SaveBuffer method, SaveBufferSize property, SaveBufferAddress property, EnableSaveBufferEvent property, LoadBuffer method, SaveTileHeight property, SaveTileWidth property
Topics | Raster Images: Saving Files
 | Saving a Region


TransformMarker event (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Syntax | void TransformMarker(short iMarker, long lSize, ILEADRasterVariant *vData, short iTransform);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

This event is fired for every JPEG marker present in the file transformed by the TransformFile method.

Processing this event is not required. It is recommended that you have a good knowledge of JPEG files before processing this event. Incorrect handling of the markers can create corrupted files.

Typically, this event could be used to process user-defined markers (APP0 – APP14). These markers may contain extra information like stamps, file resolution information, etc.

This can also be used to prevent certain markers from being written in the file. For more information, refer to the WriteMarkerAction property.

Upon returning from this event, LEADTOOLS will examine the value of the WriteMarkerAction property to see if the default processing should be performed for this marker. If the WriteMarkerAction property is:

WRITEMARKER_DEFAULT, then LEADTOOLS will perform the default action and write it to the file.

WRITEMARKER_IGNORE, then LEADTOOLS will not write this marker to the file.

WRITEMARKER_ABORT, then the file transformation process is aborted and the TransformFile method will return ERROR_USER_ABORT.

When transforming the marker data, call the WriteMarker method with the WriteMarkerAction property set to WRITEMARKER_IGNORE. That way the marker will not occur twice in the file.

See Also

Elements: | TransformFile method, WriteMarker method, WriteMarkerAction property
Topics: | Raster Images: Doing Geometric Transformations


ISISAcquire method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISAcquire(long hWnd, LPDISPATCH pRaster, long uFlags, ISISInsertModeConstants InsertMode);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Scans a single page into the given ILEADRaster object.

You must call the ISISLoadDriver method before calling ISISAcquire.

The InsertMode parameter determines whether the newly scanned image will destroy any existing Bitmap or Bitmap List in the destination object.

See Also

Elements: | ISISAcquireMulti method
Topics: | Raster Images: Scanning Images using ISIS®


ISISAcquireMulti method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISAcquireMulti(long hWnd, LPDISPATCH pRaster, BSTR pszBaseFileName, long uFlags, RasterFileConstants Format, VARIANT_BOOL bMultiPageFile, ISISInsertModeConstants InsertMode);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical Scans multiple pages into a multipage file or into multiple single page files.

To generate ISISPage events, you must set the EnableISISEvent property to TRUE before calling ISISAcquireMulti. Otherwise, the destination object will not receive scanned images.

You must call the ISISLoadDriver method before calling ISISAcquireMulti.

The InsertMode parameter determines whether the newly scanned images will destroy any existing Bitmap or Bitmap List in the destination object

See Also

Elements: | ISISAcquire method, EnableISISEvent property, PagesDiscarded property, ISISGetTag method, ISISSetTag method, ISISPage event
Topics: | Raster Images: Scanning Images using ISIS


ISISGetTag method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISGetTag (ISISTagConstants uTag);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical Fills the ISISTagValue property with the current value of the ISIS® Scanner Driver tag designated in uTag.

You must call the ISISLoadDriver method before calling ISISGetTag.

Read the ISISTagValue property after calling this method to get the current tag value.

See Also

Elements: | ISISSetTag method, ISISAcquire method, ISISAcquireMulti method, ISISTagValue property
Topics: | Raster Images: Scanning Images using ISIS


ISISLoadDriver method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISLoadDriver (void);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Loads the driver set in the DriverName property. You must load the ISIS® Driver before calling ISISAcquire, ISISAcquireMulti, ISISGetTag, or ISISSetTag.

If DriverName property is NULL, the currently selected driver will be loaded.

See Also

Elements: | ISISLoadDriver method, ISISAcquire method, ISISAcquireMulti method, ISISGetTag method, ISISSetTag method, DriverName property
Topics: | Raster Images: Scanning Images using ISIS


ISISSelect method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISSelect (long hWnd);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Displays the ISIS® Scanner Select dialog box, allowing the user to select an ISIS® driver currently installed, or to add a new ISIS® driver. The DriverName property will be updated with the selected driver.

See Also

Elements: | IsISISAvailable property, DriverName property, ISISLoadDriver method
Topics: | Raster Images: Scanning Images using ISIS


ISISSetScanOptions method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISSetScanOptions (long hWnd);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Displays the ISIS® Scan Options dialog box. You must call the ISISLoadDriver method before calling ISISSetScanOptions.

See Also

Elements: | ISISAcquire method, EnableISISEvent property, PagesDiscarded property, ISISGetTag method, ISISSetTag method, ISISPage event
Topics: | Raster Images: Scanning Images using ISIS


ISISSetTag method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISSetTag (ISISTagConstants uTag, ISISTagValueConstants Value );
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Sets one of the supported ISIS® Scanner Driver tags.

You must call the ISISLoadDriver method before calling ISISSetTag.

When determining the color format, tags must be set in the following order:

TAG_SAMPLESPERPIXEL

TAG_BITSPERSAMPLE

TAG_COMPRESSION

When setting the following tags, the tags must be set in the following order:

TAG_XRESOLUTION

TAG_YRESOLUTION

TAG_XPOSITION

TAG_YPOSITION

TAG_IMAGELENGTH

TAG_IMAGEWIDTH

See Also

Elements: | ISISGetTag method, ISISAcquire method, ISISAcquireMulti method
Topics: | Raster Images: Scanning Images using ISIS


ISISUnloadDriver method (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ISISUnloadDriver (void);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Unloads the ISIS® driver. You must unload the ISIS® driver when you are finished with ISIS® support.

See Also

Elements: | ISISLoadDriver method, ISISAcquire method, ISISAcquireMulti method, ISISGetTag method, ISISSetTag method, DriverName property
Topics: | Raster Images: Scanning Images using ISIS


DriverName property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR DriverName
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Contains the string representing the currently selected driver. It is filled by the ISISSelect method. Set this property to change the default driver.

See Also

Elements: | ISISSelect method
Topics: | Raster Images: Scanning Images using ISIS


EnableISISEvent property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableISISEvent
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Indicates whether to enable the ISISPage event. If EnableISISEvent is TRUE, ISISPage event is enabled for multipage scanning. If it is FALSE, ISISPage event is disabled for multipage scanning.

Set EnableISISEvent property to FALSE in the ISISPage event to cancel multipage scanning.

See Also

Elements: | ISISPage event, ISISAcquireMulti method, PagesDiscarded property
Topics: | Raster Images: Scanning Images using ISIS


EnableMethodErrors property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Elements: | ISISAcquireMulti method, ISISAcquire method, ISISSelect method,ISISGetTag method, ISISSetTag method, ISISLoadDriver method, ISISUnloadDriver method
Topics: | Raster Images: Scanning Images using ISIS


IsISISAvailable property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL IsISISAvailable
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Indicates whether ISIS® support DLLs are present. If IsISISAvailable is TRUE, the ISIS® support DLLs were successfully located and loaded. If IsISISAvailable is FALSE, the DLLs were not located and were not loaded successfully.

Note:

This method only indicates whether the ISIS® support DLLs have been properly installed. It does not indicate the presence of the scanner driver itself. You must get the ISIS® scanner driver from either the scanner manufacturer or from Pixel Translations. The .chn or .chw file must be in your path for ISIS® scanning to work.

See Also

Elements: | ISISSelect method
Topics: | Raster Images: Scanning Images using ISIS


PagesDiscarded property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PagesDiscarded
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical) Gets the number of ScanAhead pages that are discarded if the ISISAcquireMulti method is canceled and the ScanAhead tag has been set. For more information on tags, refer to the ISISSetTag method and the ISISGetTag method.

To cancel multipage scanning, set the EnableISISEvent property to FALSE in the ISISPage event.

See Also

Elements: | ISISAcquireMulti method, ISISSetTag method, ISISGetTag method, ISISPage event, EnableISISEvent property
Topics: | Raster Images: Scanning Images using ISIS


ISISTagValue property (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | ISISTagValueConstants ISISTagValue
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Read only) Gets the current value of the tag designated in uTag, when calling ISISGetTag. If the value is ISIS_DEFAULT [-99], then the scanner's default for the tag designated by uTag will be used for scanning. For example, if the value is ISIS_DEFAULT and uTag is TAG_COMPRESSION, then the scanner's default setting for compression will be used for scanning, unless the value is set to another value using the ISISSetTag method.

See Also

Elements:

ISISGetTag method, ISISSetTag method, ISISAcquire method, ISISAcquireMulti method


ISISPage event (ILEADRasterISIS)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ISISPage (long nPage, BSTR pszFileName);
Overview | Refer to Using ISIS® to Scan Images

Remarks

(Document/Medical ISISPage event is called after each page is acquired by the ISISAcquireMulti method.

You must set the EnableISISEvent property to TRUE, before calling ISISAcquireMulti, in order to generate ISISPage events.

In the ISISPage event, the ILEADRaster object will hold the current page. Refer to the ISISAcquireMulti method for more details.

See Also

Elements: | ISISAcquireMulti method, EnableISISEvent property
Topics: | Raster Images: Scanning Images using ISIS


AutoSegment method (ILEADRasterMrc)

Please note that the AutoSegment method will be removed in Version 15. It is being replaced with the AutoSegmentExt method.


AutoSegmentExt method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AutoSegmentExt(LPDISPATCH pRaster, long lCleanSize, long lSegmentQuality, long lColorThreshold, long lBackGroundThreshold, long lCombineThreshold, long lFlags);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Automatically segments the specified bitmap, finding the best segment combination without specifying minimum segment dimensions.

Please note that this method handles background segments and certain text segments that the AutoSegment method does not. In addition, the AutoSegment method will be removed in the next major release of LEADTOOLS and this method will replace it.

Call this method to segment the bitmap automatically. LEAD will process the bitmap and break it into appropriate picture, grayscale, text and background segments.

Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | StartSegmentation method, StopSegmentation method, SetSegmentData method, DeleteSegment method, CombineSegments method, EnumSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, AutoSegment method
Topics | Raster Images: Automatic Segmentation
 | Auto-Segmentation


CombineSegments method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CombineSegments (long lSegId1, long lSegId2);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

This method is valid with both the automatic and the manual segmentation process.

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | CombineFactor property, CombineFlags property, CreateNewSegment method, StartSegmentation method, StopSegmentation method, AutoSegment method, SetSegmentData method, EnumSegments method, LoadSegmentation method, CopySegmentationHandle method, AutoSegmentExt method
Topics | Raster Images: Manipulating Segments
 | Auto-Segmentation


CopySegmentationHandle method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CopySegmentationHandle(ILEADRasterMrc pRasterMrc);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Copies the MRC object referenced in pRasterMrc to this ILEADRasterMrc object. This method copies the MRC object segmentation data. Call the StopSegmentation method to free the new raster MRC object.

See Also

Elements | CreateNewSegment method, StartSegmentation method, StopSegmentation method, AutoSegment method, SetSegmentData method, EnumSegments method, CombineSegments method, LoadSegmentation method
Topics | Raster Images: Manipulating Segments
 | Auto-Segmentation


CreateNewSegment method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CreateNewSegment(LPDISPATCH pRaster, long SegmentLeft, long SegmentTop, long SegmentRight, long SegmentBottom, MRCSegmentTypeConstants SegType);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | StartSegmentation method, StopSegmentation method, EnumSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, SegmentExt method
Topics | Raster Images: Manual Segmentation


DeleteSegment method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DeleteSegment(long nSegId);
Overview | Refer to Working with the MRC Bitmap.

Remarks

Deletes a specific segment from the object. This method is valid with the auto and manual segmentation process.

In the manual segmentation process, segment IDs are returned by the CreateNewSegment method.

In the auto segmentation process the user may call the EnumSegments method to get the segment information and their IDs.

See Also

Elements: | EnumSegments method, SetSegmentData method
Topics: | Raster Images: Manipulating Segments


EnumSegments method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EnumSegments();
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Enumerates the segments created by automatic or manual segmentation. Use the EnumSegments event to obtain information about the segments.

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | CreateNewSegment method, StartSegmentation method, StopSegmentation method, SetSegmentData method, DeleteSegment method, CombineSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, SegmentExt method, EnumSegments event, AutoSegment method
Topics | Raster Images: Manipulating Segments


GetPagesCount method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetPagesCount(BSTR pszFileName);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Fills the MRCPagesCount property with the number of pages of an MRC file.

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

See Also

Elements | Save method, SaveT44 method, Load method, MRCPagesCount property
Topics | Raster Images: Loading a Page


Load method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Load(LPDISPATCH pRaster, BSTR pszFileName, long nPageNo)
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Loads MRC files that were saved using either the LEAD Proprietary T44 Format or the Standard T44 Format.

See Also

Elements | Save method, SaveT44 method, GetPagesCount method
Topics | Raster Images: Loading a Page


LoadSegmentation method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LoadSegmentation (LPDISPATCH pRaster, BSTR pszFileName);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Call the EnumSegments method to enumerate the segments.

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | CreateNewSegment method, StartSegmentation method, StopSegmentation method, AutoSegment method, SetSegmentData method, EnumSegments method, CombineSegments method, LoadSegmentation method, CopySegmentationHandle method
Topics | Raster Images: Manipulating Segments
 | Auto-Segmentation


Save method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Save(LPDISPATCH pRaster, BSTR pszFileName, long lFormat, short iPage, short iModify);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only)

Saves the bitmap in one of the LEAD Proprietary T44 formats: either as a LEAD proprietary T44 format file (if the lFormat value is FILE_LEAD_MRC) or as a TIF file with a LEAD MRC subtype format (if the lFormat value is FILE_TIF_LEAD_MRC). When an lFormat value of FILE_LEAD_MRC is used, *.MRC is the default file extension. When an lFormat value of FILE_TIF_LEAD_MRC is used, *.TIF is the default file extension.

The Save method will map the text, grayscale and picture segments found using automatic or manual segmentation into layers (mask, background and foreground layer) as defined in the NLS* model in T.44 standard.

A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44. For more information on Mixed Raster Content (MRC) formats, refer to General Segmentation.

Use the Save method to save a file in one of the LEAD proprietary MRC formats or PDF file based on LEAD segmentation technique if you want to:

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

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

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

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

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

It is best to perform segmentation before calling the Save method. Segmentation can be performed automatically by calling the AutoSegment method, or manually by calling the CreateNewSegment method. Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

For more information on segmentation, refer to General Segmentation, Auto-Segmentation, and Manual Segmentation.

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

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

SEGTYPE_TEXT_1BIT_BW

SEGTYPE_TEXT_1BIT_COLOR

SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_GRAYSCALE_2BIT

SEGTYPE_GRAYSCALE_8BIT

SEGTYPE_PICTURE

SEGTYPE_BACKGROUND

SEGTYPE_ONE_COLORED

SEGTYPE_TEXT_2BIT_BW

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

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

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

See Also

Elements | MaskCoder property, PictureCoder property, PictureQFactor property, SaveT44 method, Grayscale2BitCoder property, Grayscale8BitCoder property, Grayscale8BitQFactor property¸ Text2BitCoder property, AutoSegmentExt method
Topics | Raster Images: Saving a Page


SaveSegmentation method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveSegmentation (BSTR pszFileName);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) This function is used to export the segments from the segmentation handle to the specified file in a binary file format.

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | CreateNewSegment method, StartSegmentation method, StopSegmentation method, AutoSegmentExt method, SetSegmentData method, EnumSegments method, CombineSegments method, LoadSegmentation method, CopySegmentationHandle method
Topics | Raster Images: Manipulating Segments
 | Auto-Segmentation


SaveT44 method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SaveT44(LPDISPATCH pRaster, BSTR pszFileName, long lFormat, short iPage, short iModify);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

The SaveT44 method maps the text and picture segments into layers (mask, background and foreground layers) as defined in the NLS* model of the T.44 standard. If segmentation has been performed, when the SaveT44 method is called any 2-bit text, 2-bit grayscale, and 8-bit grayscale segments are treated as 24-bit image segments. If a text segment contains text over a background, when it is saved using the SaveT44 method the background color is lost. For more information on Mixed Raster Content (MRC) formats, refer to Working with MRC Bitmaps.

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

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

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

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

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

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

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

SEGTYPE_TEXT_1BIT_BW

SEGTYPE_TEXT_1BIT_COLOR

SEGTYPE_PICTURE

SEGTYPE_BACKGROUND

SEGTYPE_ONE_COLORED

SEGTYPE_TEXT_2BIT_BW

Set the compression for 1-bit text segments by setting the MaskCoder property. Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression can be used. Note that when using the SaveT44 method all segments that have been classified through segmentation as 2-bit text, 2-bit grayscale, or 8-bit grayscale segments will be treated as 24-bit image segments. Set the compression for pictures by setting the PictureCoder property. JPEG compression can be used. Set the quality factor for pictures by setting the PictureQFactor property.

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

It is best to perform segmentation before calling the SaveT44 method. Segmentation can be performed automatically by calling the AutoSegment method, or manually by calling the CreateNewSegment method. Call the StartSegmentation method before calling any of the segmentation methods. When the LEADMrc object is no longer needed, free it by calling the StopSegmentation method. For more information on segmentation, refer to General Segmentation, Auto-Segmentation, and Manual Segmentation.

Control the segmentation process by setting the following properties:

CombineFactor property

CombineFlags property

ImageType property (If using the AutoSegment method)

Sensitivity property (If using the AutoSegment method)

If segmentation has not been performed before the SaveT44 method is called, segmentation is performed internally. The StartSegmentation and AutoSegment methods are called, in that order. The image is segmented into blocks 60 pixels wide and 60 pixels high, and the function tries to combine similar segments using a CombineFactor property of 30, and an ImageType of scanned. The SaveT44 function can recognize two different segment types: 1-bit text and picture. The compression for 1-bit schemes can be Fax G3 1D, Fax G3 2D, Fax G4 or JBIG. Use the MaskCoder property to set the compression for the 1-bit schemes. The default is Fax G4. The compression for pictures can be JPEG, and can be set using the PictureCoder property and the PictureQFactor property. The default is JPEG compression with a PictureQFactor of 2.

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

See Also

Elements | MaskCoder property, PictureCoder property, PictureQFactor property, Save method, Grayscale2BitCoder property, Grayscale8BitCoder property, Grayscale8BitQFactor property¸ Text2BitCoder property, AutoSegmentExt method
Topics | Raster Images: Saving a Page


SegmentExt method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SegmentExt(LPDISPATCH pRaster, long lCleanSize, long lSegmentQuality, long lColorThreshold, long lBackGroundThreshold, long lCombineThreshold, long lFlags);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Segments the specified bitmap, finding the best segment combination without specifying minimum segment dimensions.

Please note that this method handles background segments and certain text segments, like the AutoSegmentExt method, but the SegmentExt method applies manual segmetnation.

Call the StartSegmentation method before using the SegmentExt method.

Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

Please note that the AutoSegment method will be removed in the next major release of LEADTOOLS. Either this method or the AutoSegmentExt method can be used to replace it.

See Also

Elements | StartSegmentation method, StopSegmentation method, SetSegmentData method, DeleteSegment method, CombineSegments method, EnumSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, AutoSegment method
Topics | Raster Images: Automatic Segmentation
 | Auto-Segmentation


SetSegmentData method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetSegmentData(LPDISPATCH pRaster, long nSegId, long SegmentLeft, long SegmentTop, long SegmentRight, long SegmentBottom, MRCSegmentTypeConstants SegType);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

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

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | AutoSegment method, DeleteSegment method, EnumSegments method
Topics | Raster Images: Manipulating Segments


StartSegmentation method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short StartSegmentation (LPDISPATCH pRaster);
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) Initializes the segmentation process. This method must be called before using any segmentation methods. When the MRC object is no longer needed, it should be freed by calling the StopSegmentation method.

See Also

Elements | StopSegmentation method, SetSegmentData method, DeleteSegment method, EnumSegments method, CombineSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, AutoSegmentExt method, BaseBackColor property, BaseForeColor property
Topics | Raster Images: General Segmentation
 | Raster Images: Automatic Segmentation
 | Raster Images: Manual Segmentation
 | General Segmentation
 | Auto-Segmentation
 | Using Color Values in LEADTOOLS


StopSegmentation method (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short StopSegmentation();
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

See Also

Elements | StartSegmentation method, SetSegmentData method, DeleteSegment method, EnumSegments method, CombineSegments method, SaveSegmentation method, LoadSegmentation method, CopySegmentationHandle method, AutoSegmentExt method, BaseBackColor property, BaseForeColor property
Topics |


BaseBackColor property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR BaseBackColor
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Persistent property, available at design time) Default base background color for the MRC bitmap.

See Also

Elements: | BaseForeColor property
Topics: | Raster Images: General Segmentation
 | Using Color Values in LEADTOOLS


BaseForeColor property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR BaseForeColor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

See Also

Elements | BaseBackColor property
Topics | Raster Images: General Segmentation
 | Using Color Values in LEADTOOLS


CombineFactor property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CombineFactor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

This property may be used when automatically segmenting using the AutoSegment method, or it may be used when combining two segments using the CombineSegments method.

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | AutoSegment method, CombineSegments method, CombineFlags property
Topics |


CombineFlags property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | CombineFlagsConstants CombineFlags
Overview | Refer to Working with the MRC Bitmap.

Remarks

(Document/Medical only) (Persistent property, available at design time) Flag that indicates how segments will be combined. Possible values are:

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

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

SEGTYPE_TEXT_1BIT_BW, SEGTYPE_TEXT_1BIT_COLOR or SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_TEXT_1BIT_COLOR or SEGTYPE_TEXT_2BIT_COLOR

SEGTYPE_GRAYSCALE_2BIT or SEGTYPE_GRAYSCALE_8BIT

SEGTYPE_GRAYSCALE_8BIT or SEGTYPE_PICTURE

Call the StartSegmentation method before using any of the segmentation functions. Call the StopSegmentation method to end the bitmap segmentation and free all data variables and buffers.

See Also

Elements | AutoSegment method, CombineSegments method, CombineFactor property
Topics |


EnableMethodErrors property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

See Also

Elements | Load method, Save method, SaveT44 method, GetPagesCount method, EnumSegments method, AutoSegment method
Topics | Raster Images: Auxiliary Elements


Grayscale2BitCoder property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | Grayscale2BitCoder Grayscale2BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

See Also

Elements | Save method, Grayscale8BitCoder property, Grayscale8BitQFactor property¸ Text2BitCoder property
Topics |


Grayscale8BitCoder property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | Grayscale8BitCoder Grayscale8BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

See Also

Elements | Save method, Grayscale2BitCoder property, Grayscale8BitQFactor property¸ Text2BitCoder property
Topics |


Grayscale8BitQFactor property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Grayscale8BitQFactor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Possible values are between 2 and 255, where 2 are the highest quality and 255 is the most compression. If the Grayscale8BitCoder property is CMW lossless or JPEG lossless compression, the Grayscale8BitQFactor property should be 0. This property is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveT44 methods.The default value is 2.

See Also

Elements | Save method, Grayscale2BitCoder property, Grayscale8BitCoder property¸ Text2BitCoder property
Topics |


ImageType property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | ImageTypeConstants ImageType
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

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

See Also

Elements | AutoSegment method, Sensitivity property, CombineFlags property, CombineFactor property
Topics | Raster Images: Automatic Segmentation


MaskCoder property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCMaskCoderConstants MaskCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Value | Meaning
MRC_MASK_COMPRESSION_JBIG | [0x00] Use JBIG compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G4 | [0x01] Use Fax group 4 compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G3_1D | [0x02] Use Fax group 3 (1D) compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_ MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_MASK_COMPRESSION_FAX_G3_2D | [0x03].Use Fax group 3 (2D) compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_ MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_ZIP | [0x04] Use ZIP compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_LZW | [0x05] Use LZW compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G3_1D | [0x06] Fax group 3 (1D) compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G3_2D | [0x07] Fax group 3 (2D) compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_CCITT_G4 | [0x08] Fax group 4 compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_ONEBIT_COMPRESSION_JBIG2 | [0x09] JBIG2 compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


MRCPagesCount property (ILEADRasterMrc)

Visual Basic example Visual C++ 5.0 example

Syntax short MRCPagesCount

Overview Refer to Working with the MRC Bitmap.

Remarks

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

See Also

Elements: Save method, SaveT44 method, Load method, GetPagesCount method


PictureCoder property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCPictureCoderConstants PictureCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Setting | Description
MRC_PICTURE_COMPRESSION_CMW | [0x00] Use LEAD Wavelet (CMW) compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_LOSSLESS_CMW | [0x01] Use LEAD Wavelet lossless compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_CMP | [0x02] Use LEAD CMP compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG | [0x03] Use JPEG Compression. This flag is used only if FILE_LEAD_MRC, FILE_TIF_LEAD_MRC, FILE_MRC, or FILE_TIF_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PICTURE_COMPRESSION_LOSSLESS_JPEG | [0x04] Use JPEG Lossless Compression. This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save, SaveT44 or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_YUV422 | [0x05] JPEG Compression with YUV 4:2:2 color space.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_YUV411 | [0x06] JPEG Compression with YUV 4:1:1 color space.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE | [0x07] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE_YUV422 | [0x08] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PICTURE_COMPRESSION_JPEG_PROGRESSIVE_YUV411 | [0x09] JPEG Progressive Compression.This flag is used only if FILE_LEAD_MRC, or FILE_TIF_LEAD_MRC, is set in the lFormat parameter of either Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_JPEG | [0x0A] Use JPEG Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_YUV422 | [0x0B] JPEG Compression with YUV 4:2:2 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE | [0x0D] JPEG Progressive Compression.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE_YUV422 | [0x0E] JPEG Progressive Compression with YUV 4:2:2 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_PROGRESSIVE_YUV411 | [0x0F] JPEG Compression with YUV 4:1:1 color space.This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_ZIP | [0x10] Use ZIP Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_PICTURE_COMPRESSION_LZW | [0x11] Use LZW Compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveT44 methods.

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

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


PictureQFactor property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PictureQFactor
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

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

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

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

See Also

Elements | Save method, SaveT44 method
Topics | Raster Images: Saving a Page


Sensitivity property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Sensitivity
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

See Also

Elements | AutoSegment method, ImageType property, CombineFlags property, CombineFactor property
Topics | Raster Images: Automatic Segmentation


Text2BitCoder property (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | MRCText2BitCoderConstants Text2BitCoder
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

Setting | Description
MRC_TEXT_COMPRESSION_JBIG_2BIT | [0x00] JBIG 2-bit compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_TEXT_COMPRESSION_GIF_2BIT | [0x01] GIF 2-bit compression. This flag is used only if FILE_LEAD_MRC or FILE_TIF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_TEXT_COMPRESSION_ZIP | [0x02] ZIP compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.
MRC_PDF_TEXT_COMPRESSION_LZW | [0x03] LZW compression. This flag is used only if FILE_PDF_LEAD_MRC is set in the lFormat parameter of either the Save or SaveList methods.

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

See Also

Elements | Save method, Grayscale8BitCoder property, Grayscale8BitQFactor property
Topics |


EnumSegments event (ILEADRasterMrc)

Visual Basic example

Visual C++ 5.0 example

Syntax | void EnumSegments(long nSegId, long SegmentLeft, long SegmentTop, long SegmentRight, long SegmentBottom, MRCSegmentTypeConstants SegType);
Overview | Refer to Working with the MRC Bitmap.

Remarks

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

The EnumSegments event is fired once for each segment.

See Also

Elements | EnumSegments method
Topics | Raster Images: Manipulating Segments


dbAddNew method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbAddNew ();
Overview | Refer to Managing Images in a Database

Remarks

Prepares a new, empty record for the current the recordset.

After you call dbAddNew, you can set values in the record's fields. (You do not have to call the dbEdit method for this purpose; use dbEdit only for existing records.) When you subsequently call the dbUpdate method, changed values are saved in the data source.

You must call the dbRequery method to see the newly added record.

Note: If you move to a new record before you call the dbUpdate method, the new record is lost, and no warning is given.

See Also

Elements: | dbEdit method, dbUpdate method, dbDelete method, dbLockingMode property
Topics: | Databases: Using ODBC


dbClose method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbClose ();
Overview | Refer to Managing Images in a Database

Remarks

Closes the current recordset and the database.

See Also

Elements: | dbOpen method, dbRequery method, dbLoadBits property
Topics: | Databases: Using ODBC


dbDelete method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbDelete ();
Overview | Refer to Managing Images in a Database

Remarks

Deletes data from the current record, effectively deleting the record.

After using this method, use one of the dbMove... methods to go to another record. Afterward, you cannot return to the deleted record.

See Also

Elements: | dbAddNew method, dbEdit method, dbUpdate method, dbLockingMode property
Topics: | Databases: Using ODBC


dbEdit method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbEdit ();
Overview | Refer to Managing Images in a Database

Remarks

Prepares the current record to be updated.

When you call this method, current field values are saved in a buffer. You can then change values and call the dbUpdate method to update the database.

If before calling the dbUpdate method, you call one of the dbMove... methods or you call the dbEdit method again, the original values (saved in the buffer) are restored.

See Also

Elements: | dbAddNew method, dbUpdate method, dbDelete method, dbLockingMode property
Topics: | Databases: Using ODBC


dbMove method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbMove (long lRows);
Overview | Refer to Managing Images in a Database

Remarks

Selects the record that is the specified number of rows forward or backward from the current one.

To avoid errors, ensure that a record exists in the specified position before using this method.

This method cancels any record additions or edits that have not been completed using the dbUpdate method.

See Also

Elements: | dbMoveFirst method, dbMoveLast method, dbMoveNext method, dbMovePrev method
Topics: | Databases: Using ODBC


dbMoveFirst method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbMoveFirst ();
Overview | Refer to Managing Images in a Database

Remarks

Selects the first record in the recordset.

To avoid errors, ensure that a record exists in the specified position before using this method.

This method cancels any record additions or edits that have not been completed using the dbUpdate method.

See Also

Elements: | dbMove method, dbMoveLast method, dbMoveNext method, dbMovePrev method
Topics: | Databases: Using ODBC


dbMoveLast method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbMoveLast ();
Overview | Refer to Managing Images in a Database

Remarks

Selects the last record in the recordset.

To avoid errors, ensure that a record exists in the specified position before using this method.

This method cancels any record additions or edits that have not been completed using the dbUpdate method.

See Also

Elements: | dbMove method, dbMoveFirst method, dbMoveNext method, dbMovePrev method
Topics: | Databases: Using ODBC


dbMoveNext method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbMoveNext ();
Overview | Refer to Managing Images in a Database

Remarks

Selects the next record (forward) in the recordset.

To avoid errors, ensure that a record exists in the specified position before using this method.

This method cancels any record additions or edits that have not been completed using the dbUpdate method.

See Also

Elements: | dbMove method, dbMoveFirst method, dbMoveLast method, dbMovePrev method
Topics: | Databases: Using ODBC


dbMovePrev method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void dbMovePrev ();
Overview | Refer to Managing Images in a Database

Remarks

Selects the previous record (backward) in the recordset.

To avoid errors, ensure that a record exists in the specified position before using this method.

This method cancels any record additions or edits that have not been completed using the dbUpdate method.

See Also

Elements: | dbMove method, dbMoveFirst method, dbMoveLast method, dbMoveNext method
Topics: | Databases: Using ODBC


dbOpen method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbOpen (BSTR pszConnect, BSTR pszSQL, BSTR pszField, long iOptions);
Overview | Refer to Managing Images in a Database

Remarks

Opens a recordset in an ODBC-accessible database.

After the recordset is open, you can use other db... methods and properties to access and update images in the recordset. To close the database, use the dbClose method.

If you get the following error, the ODBC data source is not set up properly. Refer to Using ODBC for information on setting up a data source.

Error #61704 "OLE IDISPATCH error #61704

See Also

Elements: | dbClose method, dbRequery method, dbLoadBits property
Topics: | Databases: Using ODBC


dbRequery method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbRequery ();
Overview | Refer to Managing Images in a Database

Remarks

Rebuilds the recordset from the database.

This method uses the same recordset specified in the dbOpen method. The first record becomes the current record.

If the rebuild fails, the database is automatically closed.

See Also

Elements: | dbOpen method, dbClose method, dbLoadBits property
Topics: | Databases: Using ODBC


dbUpdate method (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short dbUpdate (short iFormat, short iBitsPerPixel, short iQuality);
Overview | Refer to Managing Images in a Database

Remarks

Updates the database, implementing changes specified with the dbAddNew method or the dbEdit method.

This method's parameters specify how the image is saved. The image field is specified in the dbOpen method.

If the bitmap is 8 bits per pixel or greater, use the LEAD CMP format or one of the JPEG (JTIF or JFIF) formats to save disk space.

If the bitmap is 1-bit per pixel, use the LEAD 1-bit format or a CCITT Group 3 or 4 format to save disk space.

For CCITT Group 3 and 4 formats, the first RGBQUAD structure in the bitmap's palette determines the white component of the image. If the rgbRed field is 0, then all 0 bits in the image are assumed to be black. Otherwise, all zero (0) bits in the image are assumed white.

See Also

Elements: | dbAddNew method, dbEdit method, dbDelete method, dbLockingMode property
Topics: | Databases: Using ODBC


AnnContainer property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long AnnContainer
Overview | Refer to Managing Images in a Database

Remarks

(Document/Medical only) Is the handle to the annotation container for objects loaded from the database or to be saved to the database.

To delete any existing annotation objects, set this property to 0.

To save annotations to the database, assign the LEADRasterAnnotation object's AnnContainer property to the LEADRasterODBC Control's AnnContainer property.

See Also

Elements: | dbOpen method, dbClose method, dbRequery method, dbLoadBits property
Topics: | Databases: Using ODBC


dbCanAppend property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbCanAppend
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether it is possible to add a record to the current recordset.

Value | Description
TRUE | You can use the dbAddNew method and the dbUpdate method to add a record to the recordset.
FALSE | Either the recordset is not opened for updating or the data source does not allow updating.

See Also

Elements: | dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbCanRestart property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbCanRestart
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether it is possible to rebuild the recordset from the database.

Value | Description
TRUE | You can use the dbRequery method to refresh the recordset.
FALSE | The data source does not support the dbRequery method.

See Also

Elements: | dbCanAppend property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbCanScroll property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbCanScroll
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether the data source supports the dbMove... methods, which let you scroll through the recordset.

Value | Description
TRUE | You can use the dbMove.methods.
FALSE | The data source does not support all of the dbMove... methods, although it should support forward scrolling, as in the (dbMoveNext method).

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbCanUpdate property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

SyntaxSyntax | BOOL dbCanUpdate
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether it is possible to add or update a record to the current recordset.

Value | Description
TRUE | You can use the dbAddNew method or the dbEdit method; then use the dbUpdate method to update the recordset.
FALSE | Either the recordset is not opened for updating or the data source does not allow updating.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbCurrentRecord property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long dbCurrentRecord
Overview | Refer to Managing Images in a Database

Remarks

Is the number of the current record in the recordset.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbEditMode property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short dbEditMode
Overview | Refer to Managing Images in a Database

Remarks

Indicates the edit mode of the current record.

Value | Meaning
DB_EDITMODE_NONE | The current mode is read-only.
DB_EDITMODE_EDIT | The dbEdit method has been called, and calling the dbUpdate method will update the current record.
DB_EDITMODE_ADDNEW | The dbAddNew method has been called, and calling the dbUpdate method will add the current record to the database.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbIsBOF property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbIsBOF
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether you have scrolled to a position before the first record in the recordset.

This helps you avoid errors when using the dbMove... methods. Also, you can use this method to determine whether a recordset contains any records. Immediately after calling the dbOpen method, the dbIsBOF method will return TRUE if the recordset is empty.

Value | Meaning
TRUE | You have scrolled before the first record (or the recordset is empty).
FALSE | You have not scrolled before the first record.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbIsDeleted property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbIsDeleted
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether the current record has been deleted.

Value | Meaning
TRUE | You have called the dbDelete method but have not yet moved to another record.
FALSE | The current record has not been deleted.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbIsEOF property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbIsEOF
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether you have scrolled beyond the last record in the recordset.

This helps you avoid errors when using the dbMove... methods. Also, you can use this method to determine whether a recordset contains any records. Immediately after calling the dbOpen method, the dbIsEOF method will return TRUE if the recordset is empty.

Value | Meaning
TRUE | You have scrolled beyond the last record (or the recordset is empty).
FALSE | You have not scrolled beyond the first record.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


dbIsOpen property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL dbIsOpen
Overview | Refer to Managing Images in a Database

Remarks

Indicates whether you are connected to a database.

Value | Meaning
TRUE | You are connected to a database.
FALSE | You are not connected to a database.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbRecordCount property
Topics: | Databases: Using ODBC


dbLoadBits property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short dbLoadBits
Overview | Refer to Managing Images in a Database

Remarks

Specifies the bits per pixel of the bitmap to be loaded from the database. Use 0 to keep the same bits per as the stored image.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Elements: | dbOpen method, dbClose method, dbRequery method
Topics: | Databases: Using ODBC


dbLockingMode property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short dbLockingMode
Overview | Refer to Managing Images in a Database

Remarks

Specifies the record-locking strategy to use when updating an existing record in the database.

Setting | Meaning
DB_LOCKINGMODE_OPTIMISTIC | Locks the record being updated only during the call to the dbUpdate method.
DB_LOCKINGMODE_PESSIMISTIC | Locks the record as soon as dbEdit method is called and keeps it locked until the dbUpdate method call completes or you move to a new record.

See Also

Elements: | dbAddNew method, dbEdit method, dbUpdate method, dbDelete method
Topics: | Databases: Using ODBC


dbRecordCount property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long dbRecordCount
Overview | Refer to Managing Images in a Database

Remarks

Is the number of records in the recordset.

See Also

Elements: | dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property
Topics: | Databases: Using ODBC


EnableMethodErrors property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableMethodErrors
Overview | Refer to Managing Images in a Database

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). If EnableMethodErrors is TRUE, the runtime exceptions will be generated. If FALSE, they will not be generated.

See Also

Elements: | Raster property, dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


Raster property (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRaster Raster
Overview | Refer to Managing Images in a Database

Remarks

Is the LEAD RasterODBC Control's internal ILEADRaster Object.

The LEAD RasterODBC Control contains an internal instance of an ILEADRaster object. You can use this property to get that object, which can then be passed as a reference to other LEADTOOLS COM Objects such as ILEADRasterIO and ILEADRasterProcess.

See Also

Elements: | Raster property, dbCanAppend property, dbCanRestart property, dbCanScroll property, dbCanUpdate property, dbCurrentRecord property, dbEditMode property, dbIsBOF property, dbIsDeleted property, dbIsEOF property, dbIsOpen property, dbRecordCount property
Topics: | Databases: Using ODBC


ODBCChanged event (ILEADRasterODBC)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ODBCChanged
Overview | Refer to Managing Images in a Database

Remarks

(Document/Medical only) Occurs when any change occurs in the LEADRasterODBC object's bitmap. This event is generated by the following ODBC methods:

dbAddNew method

dbDelete method

dbEdit method

dbMove method

dbMoveFirst method

dbMoveLast method

dbMoveNext method

dbMovePrev method

dbOpen method

dbRequery method

dbUpdate method

See Also

Elements: | dbOpen method, dbEdit method, dbUpdate method, dbAddNew method, dbDelete method, dbMove method, dbMoveFirst method, dbMoveLast method, dbMoveNext method, dbMovePrev method, dbRequery method
Topics: | Databases: Using ODBC


AnnContainer property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long AnnContainer
Overview | Refer to Using the OLE DB Control.

Remarks

(Document/Medical only) Is the handle to the annotation container for objects loaded from the database or to be saved to the database.

To delete any existing annotation objects, set this property to 0.

After the DataLoaded event, if annotations were loaded from the database, you can copy them to the LEADRasterOLEDB Control using this property.

To save annotations to the database, assign the LEADRasterAnnotation Control's AnnContainer property to the LEADRasterOLEDB Control's AnnContainer property, and set the DataDirty property to True before changing the recordset.

See Also

Elements: | DataDirty property, Bitmap property
Topics: | Databases: LEADRasterOLEDB


DataDirty property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL DataDirty
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, not available at design time) Specifies the data in the OLEDB Control is "dirty", and should be written to the database during the next update. Use this after updating the bitmap or annotations when you wish the changes to be stored in the database.

See Also

Elements: | Bitmap property, AnnContainer property
Topics: | Databases: LEADRasterOLEDB


DataField property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR DataField
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Binds the LEADRasterOLEDB Control to a database field.

The DataSource property of a bound LEADRasterOLEDB Control specifies a valid data control name, and the DataField property specifies a valid field name in the data control's Recordset property. Together, these properties specify which bitmap is loaded into the LEADRasterOLEDB Control.

See Also

Elements: | DataMember property, DataSource property
Topics: | Databases: LEADRasterOLEDB


DataLoadBits property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DataLoadBits
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Specifies the bits per pixel for the bitmap that is loaded into memory from a database field.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

Possible values are:

Value | Meaning
0 | Keep the original field's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap

See Also

Topics:

Databases: LEADRasterOLEDB


DataMember property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR DataMember
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Returns or sets a specified data member from among several offered by the data provider.

A data provider can have multiple sets of data to which a data consumer can choose to bind. Each set of data is called a "data member," and is identified by a unique string.

For example, when using a Data Environment that contains several Command objects as a DataSource, the DataMember specifies which Command object to use.

See Also

Elements: | DataSource property, DataField property
Topics: | Databases: LEADRasterOLEDB


DataSaveBits property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DataSaveBits
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Specifies the bits per pixel to use when adding or updating an image field in a database record.

The format of the saved image, which is specified using the DataSaveFormat property, determines the valid bits per pixel. For valid values, refer to Formats of Output Files.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Topics:

Databases: LEADRasterOLEDB


DataSaveFormat property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DataSaveFormat
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Specifies the file format to use when adding or updating an image field in a database record.

For valid values, refer to Formats of Output Files.

See Also

Topics:

Databases: LEADRasterOLEDB


DataSaveQuality property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DataSaveQuality
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Specifies the image quality, when using CMP or JPEG compression, to add or update an image field in a database record.

For possible values, refer to Compression Quality Factors.

See Also

Topics:

Databases: LEADRasterOLEDB


DataSource property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | IDataSource* DataSource
Overview | Refer to Using the OLE DB Control.

Remarks

(Persistent property, available at design time) Sets the LEADRasterOLEDB data control through which the LEADRasterOLEDB Control is bound to the database.

To bind a control to a field in a database at run time, you must specify a data control in this property at design time. To complete the connection with a database, you must also provide the name of a Field object in the DataField property.

See Also

Elements: | DataMember property, DataField property
Topics: | Databases: LEADRasterOLEDB


EnableMethodErrors property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableMethodErrors property
Overview | Refer to Using the OLE DB Control.

Remarks

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

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

See Also

Topics:

Databases: Using OLEDB


Raster property (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRaster Raster
Overview | Refer to Using the OLE DB Control.

Remarks

This property gets/sets the ILEADRaster interface pointer to be used with the ILEADRasterOLEDB.

Is the LEAD RasterOLEDB Control's internal ILEADRaster Object.

The LEAD RasterOLEDB Control contains an internal instance of an ILEADRaster object. You can use this property to get that object, which can then be passed as a reference to other LEADTOOLS COM Objects such as ILEADRasterIO and ILEADRasterProcess.

See Also

Elements: | RefBitmapProperty, AnnContainer property, DataDirty property, DataLoaded event, DataSaved event
Topics: | Databases: LEADRasterOLE DB


DataLoaded event (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void DataLoaded (short nStatus);
Overview | Refer to Using the OLE DB Control.

Remarks

Occurs after data is loaded from the record in the database.

Note: This event can occur with the nStatus = ERROR_FILENOTFOUND for records that have no image stored in the bound field. Also, this can occur after a record is first inserted, but before the image data is actually saved to the recordset.

See Also

Elements: | Raster property, AnnContainer property
Topics: | Databases: LEADRasterOLEDB


DataSaved event (ILEADRasterOLEDB)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void DataSaved (short nStatus);
Overview | Refer to Using the OLE DB Control.

Remarks

Occurs after data is saved to the record in the database.

See Also

Elements: | Bitmap property, AnnContainer property, DataDirty property
Topics: | Databases: LEADRasterOLEDB


AdaptiveContrast method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short AdaptiveContrast (ILEADRaster *pRaster, long lDim, long lAmount, AdaptiveContrastConstants Flags);
Overview | Refer to Changing Brightness and Contrast

Remarks

(Medical only.) Performs adaptive contrast enhancement (ACE) to regions that are originally low in contrast.

Adaptive contrast enhancement (ACE) adjusts bitmap contrast by giving more contrast to areas which are originally low in contrast. This is different from histogram-based techniques which are based on all bitmap pixels (the histogram itself).

Local histogram equalization is another technique that can be used to reveal detail of areas, since it depends on area pixels only. Use the LocalHistoEqualize method to perform a local histogram equalization.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | HistoEqualize method, Contrast method, Intensity, GammaCorrect, HistoContrast, StretchIntensity, Invert, Hue, Saturation, Fill, GetHistogram, WindowLevel, LocalHistoEqualize, HueSaturationIntensity Method
Topics: | Raster Images: Modifying Intensity Values


AddBitmaps method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddBitmaps(ILEADRaster *pRaster, AddBitmapsConstants Flags);
Overview | Refer to Combining Images.

Remarks

Adds or averages the bitmaps in the BitmapList property.

This operation can be used to add several images of the same view to improve the lightness or brightness of the image. It can also eliminate the random noise contained in these images by doing an average of all bitmaps.

This method performs operations between data byte-by-byte. An image can be any color resolution. The resulting image of this operation will be stored in the first bitmap in the list. The operations are performed based on the smallest width and height of the input images.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements: | Underlay method, Combine method
Topics: | Raster Images: Modifying Intensity Values
 | Image Processing
 | Changing Brightness and Contrast
 | Removing Noise


AddBorder method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddBorder(ILEADRaster *pRaster, float fLeftThickness, float fTopThickness, float fRightThickness, float fBottomThickness, AddBorderLocationConstants Location, AddBorderStyleConstants Style, AddBorderEffectStyleConstants EffectStyle, ILEADRaster *pRasterTile, AddBorderGradientStyleConstants GradientStyle, OLE_COLOR crGradientStart, OLE_COLOR crGradientEnd, short nCurveIntensity, VARIANT_BOOL bSoftCurve, VARIANT_BOOL bShadow, short nShadowSize, AddBorderShadowDirectionConstants ShadowDirection, VARIANT_BOOL bBumpyShadow);
Overview | Refer to Combining Images.

Remarks

(DigitalPaint only) Adds a border to the bitmap. The border is specified by the method's parameters.

This method supports grayscale images.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | AddFrame method
Topics | Image Processing
 | Using Color Values in LEADTOOLS


AddFrame method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddFrame(ILEADRaster *pRaster, ILEADRaster *pRasterFrame, VARIANT_BOOL bKeepFrameState, VARIANT_BOOL bUseMask, OLE_COLOR crMask, short SmoothEdge, AddFrameLocationConstants Location, AddFrameQualityConstants Quality);
Overview | Refer to Combining Images.

Remarks

(DigitalPaint only) Adds a frame to the bitmap. The frame is specified by the method's parameters.

This method supports grayscale images.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | AddBorder method
Topics | Image Processing
 | Using Color Values in LEADTOOLS


AddMessage method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short AddMessage (ILEADRaster* pRaster);
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Adds a message (text or file) to the specified bitmap. The message is specified by the Message, Password, FileName , Directory, StartX, and StartY properties.

The purpose of this method is for security since the message added will be embedded into the image without any visible changes and the resulting image has the same size as the original.

This method can add messages to any type of lossless image format such as bmp, tiff, lossless jpeg, and so forth. If used with lossy format types the message may be corrupted or lost.

This method supports 24 and 48-bit color images, and 8 and 16-bit grayscale images.

To extract the embedded message, use the ExtractMessage method.

This method supports signed data images.

See Also

Elements: | Message property, Password property, FileName property, Directory property, StartX property, StartY property, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


AddNoise method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AddNoise (ILEADRaster* pRaster, short iRange, short iChannel);
Overview | Refer to Applying Artistic Effects.

Remarks

Adds random pixels to the bitmap, letting you specify the percentage of coverage and the color plane.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Where the Region Preempts the Bitmap
 | Raster Images: Filtering Images


AddShadow Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddShadow (ILEADRaster* pRaster, ShadowDirectionConstants Direction, long lThreshold, AddShadowConstants Flags)
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Adds shadows to the bitmap.

This method applies a convolution matrix upon each color component and then combines the results in order to add shadows.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | LensFlare Method, Light method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, GetObjectInfo method, MathFunction method, RevEffect method, Segment method
Topics: | Raster Images: Artistic Effects


AddWeightedBitmaps method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AddWeightedBitmaps (ILEADRaster* pRaster, long lFlag);
Overview | Refer to Removing Noise.

Remarks

Adds or averages the bitmaps in the BitmapList property according to their weight factors.

This method can be used to modify the brightness (with the add operations) or remove the noise (with the average operations). Typically, you would call this method for a series of images taken of the same object at short intervals.

If lFlag is BC_ADD, the method can be used to add several images of the same view to improve the lightness or brightness of the image. In this case, the Factor property is ignored.

If lFlag is BC_AVG, the function can be used to average several images. In this case, the Factor property is ignored.

If lFlag is BC_ADDWEIGHTED, the method can be used to obtain an image as the sum of several weighted images. Each bitmap in any position in the list has a corresponding weight factor in the same position in the Factor property. The real values are the weight factors divided by 100. For example if a weight factor is 131 its real value is 1.31. If Factor equals 0, each bitmap has the same weight factor of 100 and the result is the same as for BC_ADD.

If lFlag is BC_AVGWEIGHTED, the method can eliminate random noise by performing a weighted average. Each bitmap in any position in the list has a corresponding weight factor in the Factor array. The real values are the weight factors in the array divided by 100. The weighted sum will be divided by the sum of the weights. If the Factor property equals 0, each bitmap has the same weight factor of 100 and the result is the same as for BC_AVG.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements: | AddBitmaps method, Factor property, FactorCount property
Topics: | Raster Images: Combining Images
 | Raster Images: Modifying Intensity Values
 | Changing Brightness and Contrast


AdjustTint method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short AdjustTint(ILEADRaster * pRaster, long lAngleA, long lAngleB)
Overview | Refer to Correcting Colors.

Remarks

(Raster Pro and above only) Adjusts the bitmap tint by changing the colors in an image by using two separate color wheel rotations.

This method changes the colors in an image by using two separate color wheel rotations. For the lAngleA parameter, a positive rotation takes blue toward green and red, as shown in the following figure:

Negative rotation has the opposite effect. For the lAngleB parameter, a positive rotation takes red toward green. Negative rotation has the opposite effect.

Use the Hue method to rotate the color wheel in either direction using one angle change that changes each color in the image. A 180-degree rotation in either direction changes each color to its complement. Positive rotation takes red toward green, green toward blue, and blue toward red. Negative rotation has the opposite effect.

This method only supports colored images.

This method supports 48 and 64 bit color images. Support for 48 and 64 bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Hue method, Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Saturation method, HistoEqualize method, Fill method, Pixel property, GetHistogram method, ChannelMix method, LightControl method, SmoothEdges method, LocalHistoEqualize method, AddWeightedBitmaps method, ColorMerge method, ColorSeparate method, Multiply method, AutoColorLevel method, ColorLevel method, SelectiveColor method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, MathFunction method, AdaptiveContrast method, ApplyMathLogic method, ColorIntensityBalance method, ContrastBrightIntensity method, FunctionalLight method, MultiScaleEnhancement method, SelectData method, ShiftData method, SampleTarget method
Topics: | Raster Images: Modifying Intensity Values.


Aging method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Aging (ILEADRaster *pRaster, long lHScratchCount, long lVScratchCount, long lMaxScratchLen, long lDustDensity,long lPitsDensity, long lMaxPitSize,OLE_COLOR crScratch, OLE_COLOR crDust, OLE_COLOR crPits,long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits.) Adds effects that simulate random color changes, scratches, dust and pits, making a bitmap look like it was made from an old film.

The width of the scratches is 1 pixel. The length of the scratches is random (between 2 and lMaxScratchLen).

The size of dust particles is 1 pixel (1x1).

The size and shape of pits is selected at random. The pit shapes are random and will be between 1x1 and lMaxPitSize x lMaxPitSize.

The method will also make random changes to the pixel’s intensities.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen, Posterize, Emboss, Average, Median, AddNoise method, IntensityDetect, SpatialFilter, BinaryFilter, MaxFilter, MinFilter, Oilify, Solarize, WindowLevel, Mosaic.
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Artistic Effects
 | Using Color Values in LEADTOOLS


AlphaBlend method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AlphaBlend(ILEADRaster *pRaster, float fLeft, float fTop, float fWidth, float fHeight, ILEADRaster *pRasterSrc, float fSrcLeft, float fSrcTop, short iOpacity);
Overview | Refer to Combining Images.

Remarks

Combines image data from two bitmaps, using the specified opacity value.

The opacity determines how much the destination bitmap will show through the source bitmap. For example, if the opacity is 255 (completely opaque) then the source image will appear and the destination image will not show through the source image at all. If the opacity is 128 (half opacity), then the pixels for that area will consist of 50 percent from the source image and 50 percent from the destination image.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, FeatherAlphaBlend method, CreateFadedMask method
Topics: | Raster Images: Combining Images
 | Image Processing


AntiAlias method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AntiAlias(ILEADRaster *pRaster, short iThreshold, short iDim, AntiAliasConstants Filter);
Overview | Refer to Correcting Colors.

Remarks

(Document only) Applies an anti-aliasing filter to the bitmap.

The best results for anti-aliasing text can be obtained with the filter ANTIALIAS_2.

The value of the iDim parameter determines the extent of the anti-aliasing.

The threshold range for 16, 48 and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps the threshold range is from 0 to 4095. Otherwise, it is from 0 to 255. The threshold is applied on channels separately.

This method also supports 12 and 16 - bit grayscale bitmaps and can process the whole image or a region of the image. Support for 12 and 16 - bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Average method
Topics: | Raster Images: Filtering Images


ApplyLinearModalityLUT Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyLinearModalityLUT (LPDispatch pRaster, double dIntercept,double dSlope, ModalityLUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Remaps the bitmap pixels by applying a linear transformation described by rescale slope and intercept. In DICOM this is referred to as "applying a linear Modality LUT".

This method will remap the bitmap pixels by applying the linear transformation described by the equation:

Y = mX + b

m: slope of a straight line, this is also referred to as "Rescale Slope" in the DICOM world.

b: the y-intercept of a straight line, this is also referred to as "Rescale Intercept" in the DICOM world.

Y: the resulting pixel value.

X: the input or original pixel value.

This method is helpful in applying what is referred to as a "Linear Modality LUT" in the DICOM world. According to the DICOM standard a "Modality LUT" defines the transformation of manufacturer-dependent pixel values into pixel values, which are manufacturer independent (e.g. Hounsfield units for CT, Optical Density for film digitizers, etc.).

This method only works on grayscale bitmaps. Calling this function for non-grayscale bitmaps will return an error .

It’s recommended to always set the M_LUT_UPDATE_MIN_MAX flag.

This method could change the bitmap from signed to unsigned or from unsigned to signed, this is determined by the values of the resulting image pixels after applying the linear transformation.

Only the useful bits in the bitmap are considered. The values are considered as if the bitmap pixel values are normalized so LowBit = 0.

This function supports signed data images.

If M_LUT_ALLOW_RANGE_EXPANSION is set in Flags, consider the following example:

If the bitmap has the following attributes:

Bits per pixel 16
High Bit 11
Low Bit 0
Pixel Range 0 to +4095,
Unsigned

The number of bits stored inside the bitmap is 11-0+1 =12.

If the dIntercept is set to –1024 and dSlope is set to 0, then after applying the rescale slope and intercept:

Output minimum pixel value = (0 * 1 +(-1024)) = -1024
Output maximum pixel value = (4095 * 1 + (-1024)) = 3071

The new pixel value range (–1024 to 3071) can’t be represented with the current bits stored (12 bits), which can represent values in the range (–2048 to 2048). In this case the method will change the high bit inside the bitmap handle to be 12 instead of 11 (bits stored becomes 13), which can represent values in the range (–8192 to 8191). Please note that the method won’t be able to update the high bit and/or low bit if the number of bits stored was already equal to the number of bits allocated.

See Also

Elements: | RemapIntensity method, ApplyLinearModalityLUT method, ApplyVOILUT method, ApplyLinearVOILUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


ApplyLinearVOILUT Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyLinearVOILUT (LPDISPATCH pRaster, double dCenter, double dWidth, VOILUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Sets up the paint or paint and image processing functions' window leveling options for a specific bitmap through a linear transformation described by window center and width. In DICOM world, this is referred to as "applying a linear VOI LUT".

This method will remap the LUT used to display and process a bitmap by applying the linear transformation described by window center and window width, in the DICOM world this is referred to as applying a "linear VOI LUT". The DICOM standard states:

"Window Center and Window Width specify a linear conversion from stored pixel values (after any Modality LUT or Rescale Slope and Intercept specified in the IOD have been applied) to values to be displayed. Window Center contains the input value that is the center of the window. Window Width contains the width of the window." Please see "VOI LUT Module Attributes" in the DICOM standard for more details.

This method doesn’t change the image data; it only updates the entries inside the bitmap LUT.

It’s recommended to always set the VOI_LUT_UPDATE_MIN_MAX flag.

In the DICOM world you will need to set VOI_LUT_REVERSE_ORDER flag if the photometric interpretation of the image is "MONOCHROME1", where the minimum grayscale value is intended to be displayed as white after any VOI gray scale transformations have been performed.

This function supports signed data images.

See Also

Elements: | ApplyVOILUT method, RemapIntensity method, ApplyModalityLUT method, ApplyLinearModalityLUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


ApplyMathLogic method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyMathLogic (ILEADRaster *pRaster, short iFactor, long lFlags);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Performs specific mathematical or logical operations on the colors of a bitmap.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Combine method, Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Hue method, Saturation method, HistoEqualize method, Fill method, GetHistogram method, WindowLevel method
Topics: | Raster Images: Modifying Intensity Values


ApplyModalityLUT2 Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyModalityLUT2 (LPDispatch pRaster, VARIANT Data, long lFirstStoredPixelValueMapped, ModalityLUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Remaps the bitmap pixels through a lookup-table (LUT). In DICOM, this is referred to as "applying a non-linear Modality LUT".

This method is similar to the RemapIntensity because it remaps the bitmap pixel values through a LUT. The method is different than RemapIntensity in that:

1. | It allows you to specify an incomplete LUT. Values less than the first mapped index will go to the first entry in the palette. Values higher than "first mapped index" + "LUT length" will go to the last entry in the LUT.
2. | It only works on grayscale bitmaps. Calling this method for non-grayscale bitmaps will return an error
3. | It can create signed bitmaps. The output bitmap will be signed (if UT_SIGNED is set), or unsigned (LUT_SIGNED is not set).

The values in the LUT will be masked so only the useful bits in the bitmap are considered. The values are considered as if the bitmap pixel values are normalized so LowBit = 0.

If the bitmap is unsigned, the indexes are unsigned. The indexes are between 0..65535.

It’s recommended to always set the LUT_UPDATE_MIN_MAX flag.

This method is helpful in applying what is referred to as a "Non-Linear Modality LUT" in the DICOM world. According to the DICOM standard a "Modality LUT" defines the transformation of manufacturer-dependent pixel values into pixel values, which are manufacturer independent (e.g. Hounsfield units for CT, Optical Density for film digitizers, etc.).

This function supports signed data images.

See Also

Elements: | RemapIntensity method, ApplyLinearModalityLUT method, ApplyVOILUT method, ApplyLinearVOILUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


ApplyModalityLUT Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyModalityLUT (LPDispatch pRaster, ILEADRasterVariant *Data, long lFirstStoredPixelValueMapped, ModalityLUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Remaps the bitmap pixels through a lookup-table (LUT). In DICOM world, this is referred to as "applying a non-linear Modality LUT".

This method smilar to RemapIntensity method because it remaps the bitmap pixel values through a LUT. The method is different than RemapIntensity as:

1. | It allows you to specify an incomplete LUT. Values less than the first mapped index will go to the first entry in the palette. Values higher than "first mapped index" + "LUT length" will go to the last entry in the LUT.
2. | It only works on grayscale bitmaps. Calling this method for non-grayscale bitmaps will return an error
3. | It can create signed bitmaps. The output bitmap will be signed (if UT_SIGNED is set), or unsigned (LUT_SIGNED is not set).

The values in the LUT will be masked so only the useful bits in the bitmap are considered. The values are considered as if the bitmap pixel values are normalized so LowBit = 0.

If the bitmap is unsigned, the indexes are unsigned. The indexes are between 0..65535.

It’s recommended to always set the LUT_UPDATE_MIN_MAX flag.

This method is helpful in applying what is referred to as a "Non-Linear Modality LUT" in the DICOM world. According to the DICOM standard a "Modality LUT" defines the transformation of manufacturer-dependent pixel values into pixel values, which are manufacturer independent (e.g. Hounsfield units for CT, Optical Density for film digitizers, etc.).

This function supports signed data images.

See Also

Elements: | RemapIntensity method, ApplyLinearModalityLUT method, ApplyVOILUT method, ApplyLinearVOILUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


ApplyTransformationParameters method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyTransformationParameters (ILEADRaster *pRaster, short iXTranslation, short iYTranslation, long lAngle, long lXScale, long lYScale, long lFlags);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Corrects the image by removing the translation, rotation, and scaling deformations that have been applied on the image.

This method corrects the image by removing the translation, rotation, and scaling deformations that have been applied to the image. These transformations make this bitmap match a reference bitmap.

This method is designed to work with the GetTransformationParameters method.

You can get the translation, rotation, and scaling information by calling the GetTransformationParameters method, which will update the XTranslation, YTranslation, TransformationAngle, XScale and YScale properties. The values in these properties must be passed as they are to the ApplyTransformationParameters method.

You must call the GetTransformationParameters method before using the XTranslation, YTranslation, TransformationAngle, XScale and YScale properties

The shift operation is performed first, followed by the rotation and resize operations.

If you simply want to automatically straighten a bitmap, use the Deskew method.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine method, Rotate method, Size method, Deskew method, GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, YTranslation property, TransformationAngle property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


ApplyVOILUT2 Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyVOILUT2 (LPDISPATCH pRaster, VARIANT Data, long lFirstStoredPixelValueMapped, VOILUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Sets up the paint or paint and image processing methods window leveling options for a specific bitmap through a lookup-table (LUT). In DICOM world, this is referred to as "applying a non-linear VOI LUT".

This method will remap the LUT used to display and process a bitmap by applying a user-defined lookup table, in the DICOM world this is referred to as applying a "non-linear VOI LUT". The DICOM standard states:

" A VOI LUT defines the transformation of the modality pixel values into pixel values that are meaningful for print, display, etc. This transformation is applied after any Modality LUT". Please see "VOI LUT Module Attributes" in the DICOM standard for more details.

This method doesn’t change the image data; it only updates the entries inside the bitmap display LUT.

It’s recommended to always set the VOI_LUT_UPDATE_MIN_MAX flag.

For DICOM files you will need to set the VOI_LUT_REVERSE_ORDER flag if the photometric interpretation of the image is "MONOCHROME1", where the minimum grayscale value is intended to be displayed as white after any VOI gray scale transformations have been performed.

This function supports signed data images.

See Also

Elements: | ApplyLinearVOILUT method, RemapIntensity method, ApplyModalityLUT method, ApplyLinearModalityLUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


ApplyVOILUT Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ApplyVOILUT (LPDISPATCH pRaster, ILEADRasterVariant *Data, long lFirstStoredPixelValueMapped, VOILUTConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Sets up the paint or paint and image processing methods window leveling options for a specific bitmap through a lookup-table (LUT). In DICOM world, this is referred to as "applying a non-linear VOI LUT".

This method will remap the LUT used to display and process a bitmap by applying a user-defined lookup table, in the DICOM world this is referred to as applying a "non-linear VOI LUT". The DICOM standard states:

" A VOI LUT defines the transformation of the modality pixel values into pixel values that are meaningful for print, display, etc. This transformation is applied after any Modality LUT". Please see "VOI LUT Module Attributes" in the DICOM standard for more details.

This method doesn’t change the image data; it only updates the entries inside the bitmap display LUT.

It’s recommended to always set the VOI_LUT_UPDATE_MIN_MAX flag.

In the DICOM world you will need to set VOI_LUT_REVERSE_ORDER flag if the photometric interpretation of the image is "MONOCHROME1", where the minimum grayscale value is intended to be displayed as white after any VOI gray scale transformations have been performed.

This method supports signed data images.

See Also

Elements: | ApplyLinearVOILUT method, RemapIntensity method, ApplyModalityLUT method, ApplyLinearModalityLUT method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast


AutoTrim method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AutoTrim (ILEADRaster* pRaster, short iThreshold);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Trims the current bitmap, removing blank space (usually white space) around the edges.

The threshold is a delta value for detecting blank space. Starting at each edge of the bitmap and evaluating toward the center, any change in intensity that is less than or equal to iThreshold is considered blank space. Valid values are 0 to 255.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics:

Raster Images: Doing Geometric Transformations


AutoBinary method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short AutoBinary (ILEADRaster *pRaster);
Overview | Refer to Removing Noise

Remarks

(Document/Medical only) Applies binary segmentation to the bitmap using an automatically calculated threshold based on a two-peak method of statistical analysis of the histogram.

The bitmap is transformed into a binary image using a threshold calculated automatically based on statistical features of the bitmap. Best results are obtained with grayscale bitmaps.

This function also supports 12 and 16 - bit grayscale bitmaps. If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16 - bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen method, Average method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, BinaryFilter method, ColorLevel method, IntensityDetect method
Topics: | Raster Image Functions: Filtering Images


AutoColorLevel method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short AutoColorLevel (ILEADRaster * pRaster, long lBlackClip, long lWhiteClip, long lFlags);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Applies one of several types of automatic color leveling to an image.

This method makes the dark values darker and the light values lighter, which automatically enhances shadows and brightens the image. It also maximizes the tonal range of the image. It enhances the contrast and intensity using the image's histogram and a color distribution-based algorithm.

If you set the AUTO_NOPROCESS flag in lFlags, the ColorLevel properties, listed below, will be updated with the color leveling information used by the AutoColorLevel method.

MasterMinInput

MasterMaxInput

MasterMinOutput

MasterMaxOutput

MasterGamma

RedMinInput

RedMaxInput

RedMinOutput

RedMaxOutput

RedGamma

GreenMinInput

GreenMaxInput

GreenMinOutput

GreenMaxOutput

GreenGamma

BlueMinInput

BlueMaxInput

BlueMinOutput

BlueMaxOutput

BlueGamma

If you then call the ColorLevel method with the same values set in the Color Level properties, you will obtain the same result that you would have obtained if you had called the AutoColorLevel method with the leveling flag by itself.

If the image is a grayscale image, then AUTO_LEVEL, AUTO_CONTRAST and AUTO_INTENSITY give identical results. The properties listed above will have the same values.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, the effect will be applied on the region only.

As an example, the following figure shows an image before any automatic color leveling has been performed:

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_LEVEL flag.

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_INTENSITY flag.

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_CONTRAST flag.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MasterMinInput property MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


Average method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Average (ILEADRaster* pRaster, short iDim);
Overview | Refer to Removing Noise.

Remarks

Changes the color of each pixel in the bitmap to the average color of pixels in its neighborhood. This results in a blur effect.

You control the amount of blur by specifying the size of the neighborhood that is used for averaging.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


BalanceColors method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short BalanceColors(ILEADRaster *pRaster, float fRedToRed, float fRedToGreen, float fRedToBlue, float fGreenToRed, float fGreenToGreen, float fGreenToBlue, float fBlueToRed, float fBlueToGreen, float fBlueToBlue);
Overview | Refer to Correcting Colors.

Remarks

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

For each pixel in the bitmap, the red value is modified using the values of the fRedToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

For each pixel in the bitmap the green value is modified using the values of the fGreenToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

For each pixel in the bitmap the blue value is modified using the values of the fBlueToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

The intermediate red values are added to generate the new red value for the pixel. The intermediate green values are added to generate the new green value for the pixel and the intermediate blue values are added to generate the new blue value for the pixel. This triplet forms the new RGB value for the pixel.

For example, if a the following parameter values are used to redistribute the red value of a pixel:

fRedToRed = 0.50

fRedToGreen = 0.50

fRedToBlue = 0.0

then 50% of the current red value of the pixel will be added to the new red value for the pixel and 50% of the current red value of the pixel will be added to the new green value for the pixel.

This method can process the whole image or a region of the image.

This method supports 48 and 64-bit color images. Support for 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ConvertToColoredGray method, GrayScale method, GrayscaleExt method, IsGrayscale property
Topics: | Raster Images: Modifying Intensity Values


Bending method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Bending (ILEADRaster *pRaster, short iValue, short CenterX, short CenterY, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Warps the image along a curved plane, centered on the specified point.

This method bends the image around the center point specified in CenterX and CenterY. The center point must be defined inside the bitmap or inside the region, if the bitmap has a region. If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, ShowBendingDlg method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


BinaryFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BinaryFilter (ILEADRaster* pRaster, short iType);
Overview | Refer to Removing Noise.

Remarks

(Document/Medical only) Imposes one of the predefined binary filters for erosion or dilation of black objects.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MaxFilter method, MinFilter method
Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


BorderRemove method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BorderRemove (ILEADRaster *pRaster, BorderRemoveFlags Flags, BorderRemoveConstants BorderToRemove, long iBorderPercent, long iWhiteNoiseLength, long iVariance);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Removes borders from 1-bit images. To "fine-tune" the performance of this method, try modifying the values for iWhiteNoiseLength, iBorderPercent and iVariance.

This method triggers both the BorderRemove event and the ProgressStatus event.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | BorderRemove event
Topics: | Raster Images: Cleaning - up 1-Bit Images


BricksTexture method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BricksTexture(ILEADRaster * pRaster, long lBricksWidth, long lBricksHeight, long lOffsetX, long lOffsetY, long lEdgeWidth, long lMortarWidth, long lShadeAngle, long lRowDifference, long lMortarRoughness, long lMortarRoughnessEevenness, long lBricksRoughness, long lBricksRoughnessEevenness, OLE_COLOR crMortarColor, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Creates a brick texture that makes the image look like it has been drawn on a brick wall.

This method creates a brick-like texture. Edges that are in the angle of the light source are brightened and the others are darkened. Apply this texture to a bitmap by using pRaster as the source raster object. You can obtain the best result by applying this method on a medium brightness image.

Using the shading option of BRICKS_SMOOTHEDOUT results in bricks that have a more chiseled look than the same settings with a shading option of BRICKS_SMOOTHEDIN.

As an example, suppose you were to start with a gray image, like the following figure:

Now, suppose you call the BricksTexture method. The following settings apply to all of the following figures:

Parameter | Value
lOffsetX | 0
lOffsetY | 0
lRowDifference | 35
lBricksWidth | 60
lBricksHeight | 20

If you were to use the following additional settings:

Parameter | Value
lMortarRoughness | 0
lMortarRoughnessEevenness | 0
lBricksRoughness | 0
lBricksRoughnessEevenness | 0
lFlags | BRICKS_SMOOTHEDOUT

The following figure results:

Note how smooth the surface of both the mortar and the bricks is. In the following figure, the only change from the previous settings is the value of lBricksRoutness, which is set to 196:

In the following figure, lBricksRoutness remains set to 196 and in addition, lBricksRoutnessSmooth is set to 4:

The next two figures show the difference between the BRICKS_SMOOTHEDOUT flag and the BRICKS_SMOOTHEDIN flag. For these figures the following settings are used:

Parameter | Value
lMortarRoughness | 0
lMortarRoughnessEevenness | 0
lBricksRoughness | 250
lBricksRoughnessEevenness | 4
lEdgeWidth | 7
lMortarWidth | 4

In the following figure the BRICKS_SMOOTHEDOUT flag is set:

In the following figure, the BRICKS_SMOOTHEDIN flag is set:

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Emboss method, AddShadow method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, DirectionEdgeStatistical method, GetBitmapStatisticsInfo method, GetFeretsDiameter method, GetObjectInfo method, GetRgnContourPoints method, GetRgnPerimeterLength method, MathFunction method, Segment method, SubtractBackground method, UserFilter method.
Topics: | Raster Images: Filtering Images.
 | Raster Images: Artistic Effects


BumpMap method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short BumpMap (LPDISPATCH pDstRast, LPDISPATCH pBumpRas, short iAzimuth, short iElevation, short iDepth, short iXOffset, short iYOffset, short iXDst, short iYDst, VARIANT_BOOL bTile, short iBright, short iIntensity);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Adds a three-dimensional texture pattern created by applying the bump image to the destination image.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AlphaBlend method, Combine method, CombineBitmapWarp method, CombineExt method, CreateFadedMask method, FeatherAlphaBlend method, Picturize method, PicturizeBitmapList method, PicturizeSingle method, Underlay method
Topics: | Raster Image Functions: Combining Images


Canvas method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Canvas(ILEADRaster * pRaster, ILEADRaster * pRasterThumb, long lTransparency, long lEmboss, long lXOffset, long lYOffset, long lTilesOffset, long lFlags);
Overview | Refer to Combining Images.

Remarks

(Raster Pro and above only) Combines two bitmaps, superimposing one bitmap on another bitmap that is used like a canvas.

As an example, if you use the following figure:

And you use the following figure as the canvas bitmap:

And you call Canvas using the following values:

Parameter | Value
lTransparency | 90
lEmboss | 117
lXOffset | 0
lYOffset | 0
lFlags | CANVAS_SHIFT
lTilesOffset | 0

The following figure results:

In the following figure the rafting image has been combined with the canvas bitmap using the same values, except that the CANVAS_FIT flag is used and so instead of tiling the canvas bitmap has been stretched to fit the dimensions of the rafting image:

Other methods that allow you to combine images include:

BumpMap method

Combine method

CombineBitmapWarp method

TextureAlphaBlend method

Underlay method

For more information on this and other methods that can be used to combine bitmaps, refer to Image Processing.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

If the one of the bitmaps has a region, the effect will be applied on the region only?

See Also

Elements: | Emboss method, AddShadow method, BumpMap method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, Combine method, CombineBitmapWarp method, DirectionEdgeStatistical method, GetBitmapStatisticsInfo method, GetFeretsDiameter method, GetObjectInfo method, GetRgnContourPoints method, GetRgnPerimeterLength method, MathFunction method, Segment method, SubtractBackground method, TextureAlphaBlend method, Underlay method, UserFilter method.
Topics: | Raster Images: Combining Images.
 | Raster Images: Artistic Effects.


ChannelMix method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ChannelMix (ILEADRaster *pRaster, short iRedFactorR, short iRedFactorG, short iRedFactorB, short iRedFactorConstant, short iGreenFactorR, short iGreenFactorG, short iGreenFactorB, short iGreenFactorConstant, short iBlueFactorR, short iBlueFactorG, short iBlueFactorB, short iBlueFactorConstant);
Overview | Refer to Correcting Colors

Remarks

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

This method is used to rebalance the colors in a bitmap. It can be used to make color adjustments and corrections.

This method supports 1, 2, 3, 4, 5, 6, 7, 8, 24 and 48 bit bitmaps and can support regions for 24 and 48 bit bitmaps. If the bitmap has a region, the effect will be applied on the region only.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ConvertToColoredGray, BalanceColors, GrayScale, GrayScaleExt, IsGrayScale
Topics: | Raster Image Functions: Modifying Intensity Values


Clouds method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Clouds(ILEADRaster * pRaster, long lSeed, long lFrequency, long lDensity, long lOpacity, OLE_COLOR crBackColor, OLE_COLOR crCloudsColor, CloudsEffectConstants Flags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Applies cloud effects to a bitmap.

The lSeed parameter allows you to change the shape of the cloud effect. The clouds are created using a pseudo-random process based on the value of the lSeed parameter. Each lSeed parameter value produces a different cloud effect from the other lSeed parameter values.

Use the CLD_PURE flag to create a bitmap of the cloud effect by itself.

When using the CLD_OPACITY flag, if the opacity is 0, the resulting pixel value relies entirely on the value of the original pixel. As the opacity increases to 100, the value of the cloud pixel has an increasing effect on the resulting pixel value.

When using the CLD_DIFFERENCE flag, if the opacity is 0, the resulting pixel value is just the absolute difference between the original pixel value and the cloud pixel value. As the opacity increases, the resulting pixel value is increasingly affected by an additional factor related to the absolute difference.

The following two figures illustrate the cloud effect by itself.

This figure was obtained by using the following settings:

Parameter | Value
lFrequency | 16
lDensity | 1
crBackColor | Black
crCloudsColor | White
lSeed | 0
Flags | CLD_PURE

This figure was obtained by using the following settings:

Parameter | Value
lFrequency | 1
lDensity | 16
crBackColor | Black
crCloudsColor | White
lSeed | 0
Flags | CLD_PURE

The following two figures show the effects of the method using the CLD_OPACITY flag. If you use the following image

And call this method using the following values:

Parameter | Value
lFrequency | 16
lDensity | 16
crBackColor | Black
crCloudsColor | White
lSeed | 0
Flags | CLD_OPACITY
lOpacity | 50

The following figure results:

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method.
Topics: | Raster Images: Artistic Effects.


ColoredBalls method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColoredBalls(ILEADRaster * pRaster, long lNumBalls, long lSize, long lSizeVariation, long lHighLightAng, OLE_COLOR crHighLight, OLE_COLOR crBkgColor, OLE_COLOR crShadingColor, long lAvrBallClrOpacity, long lBallClrOpacityVariation, long lRipple, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) This method adds colored balls to the bitmap. Various parameters control the color and appearance of the balls.

The CLRBALLS_STICKER flag produces balls with more distinct edges than the CLRBALLS_BALL option.

As an example, if you use the following figure.

If you call the ColoredBalls method using the following values:

Parameter | Value
lNumBalls | 500
lSize | 10
lSizeVariation | 90
lHighLightAng | 315
crHighLight | White
crBkgColor | Blue
crShadingColor | Black
lAvrBallClrOpacity | 0
lBallClrOpacityVariation | 0
lRipple | 4250
lFlags | CLRBALLS_SHADING_TOPBOTTOM | CLRBALLS_STICKER | CLRBALLS_IMAGE | CLRBALLS_ BALLCLR_OPACITY

The following figure will result:

As another example, if you call the method using the following settings:

Parameter | Value
lNumBalls | 1500
lSize | 4
lSizeVariation | 0
lHighLightAng | 315
crHighLight | White
crBkgColor | Blue
crShadingColor | Black
lAvrBallClrOpacity | 108
lBallClrOpacityVariation | 13
lRipple | 1000
lFlags | CLRBALLS_SHADING_LEFTRIGHT | CLRBALLS_BALL | CLRBALLS_IMAGE | CLRBALLS_ BALLCLR_OPACITY

You will obtain the following figure if you use magenta as the color for the balls:

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ColoredBallsCount property, ColoredBalls method, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, DrawStar method.
Topics: | Raster Images: Artistic Effects.


ColoredPencil method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColoredPencil(ILEADRaster * pRaster, long lRatio, long lDim);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Applies an effect to a bitmap that makes it look like it has been drawn with colored pencils.

As an example, if you use the following figure:

If you call the ColoredPencil method using the following values:

Parameter | Value
lRatio | 90
lDim | 3

The following figure will result:

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64 bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Impressionist method, Dry method.
Topics: | Raster Images: Modifying Intensity Values.
 | Raster Images: Filtering Images


ColorHalfTone method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColorHalfTone(ILEADRaster * pRaster, long lMaxRad, long lCyanAngle, long lMagentaAngle, long lYellowAngle, long lBlackAngle);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above only) Creates an enlarged halftone screen for each image channel.

The filter divides the image into rectangles and replaces each rectangle with circles. Each channel has a separate grid of circles, and has its own angle setting. The size of each circle is proportional to the brightness of the rectangle that it is replacing.

This filter is named after the colored print process of color halftoning, where individual separations are made for each color: Cyan, Magenta, Yellow, and Black. The four separations are combined to make the final print. To prevent moiré patterns, each separation uses a different screen angle when they are combined. In the true print process the circles are not large enough to be seen without magnification.

As an example, if you use the following figure:

And you call ColorHalfTone using the following values:

Parameter | Value
lMaxRad | 8
lCyanAngle | 108
lMagentaAngle | 163
lYellowAngle | 90
lBlackAngle | 45

The following figure results:

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, GrayScaleExt method, AutoColorLevel method, ColorLevel method, Correlation method, GrayScaleToDuotone method, GrayScaleToMultitone method, HolesRemovalBitmapRgn method, SelectiveColor method, Skeleton method, HalfTone method, ColorSeparate method, ColorMerge method, Desaturate method, HalfTonePattern method, GetBitmapStatisticsInfo method, GetHistogram method, GetColorCount method, GetMinMaxBits method, GetMinMaxVal method, ConvertToColoredGray method, ColorizeGray method, BitmapAlpha property, ShiftData method, SelectData method, GetHistogramGray method, IsGrayScale property, WindowLevel method, WindowLevelFillLUT method.
Topics: | Raster Images: Doing Color Expansion or Reduction.


ColorIntensityBalance method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColorIntensityBalance (ILEADRaster *pRaster, VARIANT_BOOL bLuminance);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Changes the distribution of the red, green, or blue channels to make the colors in an image more accurate or more different.

Each color component is treated independently. The color range for each component is split into Shadows, Midtones and Highlights based on the intensity. The values in each range are adjusted differently using the Shadow, Midtone and Highlight properties.

The preserve luminance option aims to minimize the luminance change in the image.

This method supports only RGB images. It does not support grayscale images.

Support for 48-bit and 64-bit colored images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MidTone property, HighLight property Shadow property, Red property, Green property, Blue property, ConvertToColoredGray, GrayScale method, GrayScaleExt method, Sharpen method, Posterize method, Mosaic method, Emboss method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method
Topics: | Raster Images: Modifying Intensity Values


ColorizeGray method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColorizeGray (ILEADRaster *pRasterDst, ILEADRaster *pRasterSrc);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Changes the distribution of the red, green, or blue channels.

The method can be used as a visualization aid. More precisely, this method can be used to show variations in a bitmap’s intensity values.

This method colors the grayscale bitmap by converting specified ranges of grayscale intensities into corresponding RGB values.

Use the GrayColorRed, GrayColorGreen, GrayColorBlue and GrayColorThreshold properties to set the intensity ranges and the RGB values.

Using this method you can show details that were never seen in the original bitmap. In 12 and 16-bit grayscale bitmaps, only the 8 most significant bits are displayed, whereas the rest are discarded. So by coloring these discarded bits you can make them visible instead.

If you don’t set the GrayColorRed, GrayColorGreen, GrayColorBlue and GrayColorThreshold properties then the method colors the bitmap automatically using an algorithm that generates unique output colors. The output bitmap will contain 256 colors if the input bitmap is 8-bit, 4096 colors if the input bitmap is 12-bit and 65535 colors if the input bitmap is 16-bit.

The sample below shows you how to color a 16-bit grayscale bitmap using the GrayColorRed, GrayColorGreen, GrayColorBlue and GrayColorThreshold properties.

In a 16-bit grayscale bitmap, the lowest pixel value is 0 and the highest pixel value is 65535.

The colors from the input images will be colored as follows:

Pixel intensities from 0 – 9999 will be colored as Red.

Pixel intensities from 10000 – 19999 will be colored as Green.

Pixel intensities from 20000 – 29999 will be colored as Blue.

Pixel intensities from 30000 – 39999 will be colored as Cyan.

Pixel intensities from 40000 – 49999 will be colored as Magenta.

Pixel intensities from 50000 – 65535 will be colored as Yellow. (Note: the GrayColorThreshold value is ignored for the last entry in the GrayColorXXX array.)

This method supports 8, 12 and 16-bit grayscale bitmaps only. Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits. It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayColorRed property, GrayColorBlue property, GrayColorGreen property, GrayColorThreshold property, GrayColorCount property, GrayScaleToDuotone method,GrayScaleToMultitone method
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


ColorLevel method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ColorLevel (ILEADRaster * pRaster, long lFlags);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Applies color leveling to an image. It changes the image shadows, midtones and highlights.

Before you call this method, you need to set all Color Level properties. These properties tell the ColorLevel method what constitutes shadows, midtones, and highlights and how to remap the shadows, midtones and highlights.

Control the amount of image balance and leveling by controlling the values of the Color Level properties, listed below:

MasterMinInput

MasterMaxInput

MasterMinOutput

MasterMaxOutput

MasterGamma

RedMinInput

RedMaxInput

RedMinOutput

RedMaxOutput

RedGamma

GreenMinInput

GreenMaxInput

GreenMinOutput

GreenMaxOutput

GreenGamma

BlueMinInput

BlueMaxInput

BlueMinOutput

BlueMaxOutput

BlueGamma

If only LEVEL_MASTER is set in lFlags then the rest of the channels will still be affected.

If the image is a grayscale image, then you must set LEVEL_MASTER in lFlags, otherwise the method will not have any effect.

If XXXMinOutput property > XXXMaxOutput property then the bitmap’s shadows and highlights will be inverted.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, the effect will be applied on the region only.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MasterMinInput property MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


ColorReplace Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ColorReplace (ILEADRaster* pRaster, short iHue, short iSaturation, short iBrightness)
Overview | Refer to Correcting Colors

Remarks

Replaces specified colors by adjusting values of hue, saturation and brightness.

The value of the ReplaceColorFuzziness property determines the range around each color where the pixels will be changed according to iHue, iSaturation and iBrightness.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ReplaceColorFuzziness property, ReplaceColorValue property, ReplaceColorsCount property, Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Saturation method, HistoEqualize method, Fill method, GetHistogram method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, GetBitmapStatisticsInfo method, GetObjectInfo method, MathFunction method, RevEffect method, Segment method, SubtractBackground method, UserFilter method
Topics: | Raster Images: Modifying Intensity Values.


ColorThreshold Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ColorThreshold (ILEADRaster* pRaster, ColorThresholdConstants ColorSpace);
Overview | Refer to Correcting Colors

Remarks

Resets those bitmap pixel component values that fall outside of a specified range, using any one of eight color spaces.

This method is similar to the ConvertColorSpace method but provides greater flexibility by allowing the specification of a range and different options for handling those values that fall outside of the range.

This method works as follows:

The bitmap is converted to the required color space.

For every pixel, the following operations are performed: Each component is compared with the ComponentMinRange and ComponentMaxRange properties

If it is inside the range, the component is considered to have "passed" the test.

If it is outside the range, the component has been rejected". The CLTH_TYP_BANDREJECT flag inverts this by making "rejected" components "passed" and vice versa.

If CLTH_MOD_CHANNEL is set, the components are modified independently. If CLTH_MOD_ALL has been passed, the pixel is rejected by the test if any component is rejected. If the pixel/component is rejected, then:

If CLTH_VALUE_MIN is passed, the rejected pixel/component is set to 0.

If CLTH_VALUE_MAX is passed, the rejected pixel/component is set to 255.

If CLTH_VALUE_CLAMP is passed, components less that ComponentMinRange go to 0 and components greater than ComponentMaxRange go to 255. This would work only with the CLTH_MOD_CHANNEL and CLTH_TYP_BANDPASS flag.

This method works for 1, 2, 3, … 8,16, 24, 32, 48 and 64-bit color bitmaps and can support regions for 24 and 48-bit bitmaps. If a 24 or 48-bit bitmap has a region the effect will be applied on the region only.

One structure is used for each color component. The order is considered to be the same as in the CLTH_xxx_SPACE name. For example, for CLTH_RGB_SPACE:

ComponentXXX(0)is used for the Red component

ComponentXXX(1)is used for the Green component

ComponentXXX(2)is used for the Blue component

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ComponentMaxRange property, ComponentMaxRange property, ComponentFlags property, ColorSeparate method, ColorMerge method, AddShadow method, HueSaturationIntensity method, ColorReplace method, MathFunction method, RevEffect method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Doing Color Space Conversions


ColorMerge method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ColorMerge (ILEADRaster *pRaster, ColorSeparationConstants Flags);
Overview | Refer to Managing Color Separations.

Remarks

Creates a color bitmap by merging grayscale bitmaps that were created as color separations. You can use this to recombine the bitmaps that the ColorSeparate method creates.

The supported color-space models are RGB, CMYK, CMY, HSV, and HLS

If all the bitmaps are 16-bit grayscale bitmaps, then the resulting bitmap is 48 bits per pixel. Otherwise, the resulting bitmap is 24 bits per pixel.

You can use the ColorPlanes property to access the grayscale bitmaps.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property
Topics | Raster Images: Doing Color Space Conversions
 | Examining and Altering Bitmaps
 | Changing Brightness and Contrast
 | Handling CMYK Files as Separate Bitmaps


ColorRes method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ColorRes (ILEADRaster *pRaster, short iBitsPerPixel, ColorResPaletteConstants Palette, ColorResDitherConstants Dither, short iColors);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts the bitmap from any bits-per-pixel to any bits-per-pixel, letting you specify the palette to use.

Also, when converting to 16-bits per pixel or higher, you can specify RGB or BGR color order.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | UserPalette property
Topics: | Raster Images: Doing Color Expansion or Reduction


ColorResList method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ColorResList (ILEADRaster *pRaster, short iBitsPerPixel, ColorResPaletteConstants Palette, ColorResDitherConstants Dither, short iColors);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts all bitmaps in a list from any bits-per-pixel to any bits-per-pixel.

This method also updates the palette that is referenced by the AnimationPalette property.

See Also

Elements: | ColorRes method, UserPalette property
Topics: | Raster Images: Doing Color Expansion or Reduction


ColorSeparate method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ColorSeparate (ILEADRaster *pRaster, ColorSeparationConstants Flags);
Overview | Refer to Managing Color Separations.

Remarks

Separates the bitmap by color plane to produce one grayscale bitmap per plane. You can specify any of several color-space models.

The supported color-space models are RGB, CMYK, CMY, HSV, and HLS.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap is a 48 or 64-bit bitmap, then the created bitmaps are 16-bit grayscale. Otherwise, the created bitmaps are 8-bit grayscale.

You can use the ColorPlanes property to access the grayscale bitmaps.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, RasterIO property, EnablePaintCMYKArray property, CMYKRaster property
Topics | Raster Images: Doing Color Space Conversions
 | Examining and Altering Bitmaps
 | Changing Brightness and Contrast
 | Handling CMYK Files as Separate Bitmaps


Combine method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Combine (ILEADRaster *pRasterDst float fLeft, float fTop, float fWidth, float fHeight, ILEADRaster *pRasterSrc, float fSrcLeft, float fSrcTop, CombineConstants Flags);
Overview | Refer to Combining Images.

Remarks

Combines image data from two bitmaps, letting you specify the areas to be combined and the operations to be performed when combining the data.

For example, suppose you use the SpatialFilter method to apply an edge detection filter. You can then use this method to combine the resulting bitmap with the original one to produce an image with hard edges.

This method combines the data byte-by-byte. Both images must have the same color resolution. Images that are 24 bits per pixel are the easiest to combine. For other color resolutions, you must ensure that the pixel and byte boundaries are aligned on the rectangle borders. Both images must use the same palette, if a palette is required.

For a simple paste, use CB_OP_ADD and CB_DST_0 as the flags.

If a region is defined for the either the source or destination bitmap, or both bitmaps, the combine applies only to the intersection of the regions.

See Also

Topics: | Raster Images: Copying Images
 | Raster Images: Combining Images
 | Implementing Transparency
 | Examining and Altering Bitmaps
 | Removing Noise
 | Detecting and Enhancing Edges and Lines


CombineBitmapWarp method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short (ILEADRaster * pRasterDst, ILEADRasterVariant * vXArray, ILEADRasterVariant * vYArray, long lDstPointCount, ILEADRaster * pRasterSrc, long lXSrc, long lYSrc, long lSrcWidth, long lSrcHeight, long lFlags)
Overview | Refer to Combining Images.

Remarks

Combines image data from the source bitmap (the slave) into the destination bitmap (master) using a perspective warp.

This method takes a rectangular area of the source bitmap, defined by lXSrc, lYSrc, lSrcWidth and lSrcHeight, and warps it into the polygonal area defined by vXArray, vYArray, and lDstPointCount, in the destination bitmap.

See Also

Elements: | Combine method
Topics: | Raster Images: Copying Images
 | Raster Images: Combining Images
 | Implementing Transparency
 | Examining and Altering Bitmaps
 | Removing Noise
 | Detecting and Enhancing Edges and Lines


CombineExt method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CombineExt(ILEADRaster *pRasterDst, float fLeft, float fTop, float fWidth, float fHeight, ILEADRaster *pRasterSrc, float fSrcLeft, float fSrcTop, CombineConstants Flags);
Overview | Refer to Combining Images.

Remarks

Combines image data from two bitmaps, letting you specify the areas to be combined and the operations to be performed when combining the data, and which color planes (R or G or B or R, G, and B) are used.

For example, suppose you use the SpatialFilter method to apply an edge detection filter. You can then use this method to combine the resulting bitmap with the original one to produce an image with hard edges.

This method combines the data pixel-by-pixel. The two images can be any color resolution. Images that are 24-bits per pixel are the easiest and fastest to combine. This method uses Windows-style coordinates (with a top-left origin) to specify the areas to be combined.

If the channel setting for one of the bitmaps is the master channel (CB_SRC_MASTER, CB_DST_MASTER, CB_RES_MASTER) the settings for all the bitmaps will be set to master.

For a simple paste, use CB_OP_ADD and CB_DST_0 as the flags.

If a region is defined for the either the source or destination bitmap, or both bitmaps, the combine applies only to the intersection of the regions.

For example, assume CB_SRC_RED is passed for the source bitmap, CB_DST_BLUE is passed for the destination bitmap and CB_RES_GREEN is passed for the resulting bitmap. In this case, the green channel of the resulting bitmap is calculated as the result of the operations applied to the red channel of the source bitmap and the blue channel of the destination bitmap. The other channels of the resulting bitmap are unchanged.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method
Topics: | Raster Images: Copying Images
 | Raster Images: Combining Images
 | Implementing Transparency
 | Examining and Altering Bitmaps
 | Removing Noise
 | Detecting and Enhancing Edges and Lines


ContourFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ContourFilter (ILEADRaster *pRaster, short nThreshold, short nDeltaDir, short nMaximumError, ContourFilterOptions Option);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

(Medical only) Performs a contour segment filter on the bitmap.

This method supports grayscale images.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics:

Raster Images: Filtering Images


Contrast method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Contrast (ILEADRaster *pRaster, short iChange);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Increases or decreases the contrast of the bitmap.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Intensity method, GammaCorrect method, HistoContrast method, HistoEqualize method, StretchIntensity method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


ContrastBrightIntensity method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ContrastBrightIntensity (ILEADRaster *pRaster, short iContrast, short iBrightness, short iIntensity);
Overview | Refer to Changing Brightness and Contrast

Remarks

(Raster Pro and above toolkits) Applies contrast, brightness and intensity adjustments to enhance the image tonal range.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits. It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

The transformations are applied in this order: Contrast, Brightness then Intensity. Were the three methods to be called separately, then after each method was applied calculated values less than 0 and more than 255 (for 8 bits per component for example) would be clamped to 0 and 255 respectively. Using this method, the values are accumulative and the final result would be clamped. In addition, this method is faster than calling each method separately.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Contrast, Intensity, Saturation, Sharpen, Posterize, Mosaic, Emboss, Median, AddNoise, IntensityDetect, SpatialFilter, BinaryFilter, MaxFilter, MinFilter, Oilify, Solarize, WindowLevel, ColorLevel, AutoColorLevel, SelectData method, ColorizeGray
Topics: | Raster Images: Modifying Intensity Values


ConvertSignedToUnsigned method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ConvertSignedToUnsigned(ILEADRaster *pRaster, ConvertSignedToUnsignedConstants Shift);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts a signed bitmap to unsigned.

To determine whether a bitmap is signed, check the IsSigned property. LEADTOOLS loads signed files only if the LoadSigned property is TRUE. If the LoadSigned property is FALSE, the signed images are automatically converted to signed during loading, by setting all negative pixels to 0.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | ConvertUnsignedToSigned method, IsSigned property, LoadSigned property
Topics: | Raster Images: Doing Color Expansion or Reduction


ConvertToColoredGray method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ConvertToColoredGray(ILEADRaster *pRaster, short iRedFact, short iGreenFact, short iBlueFact, short iRedGrayFact, short iGreenGrayFact, short iBlueGrayFact);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document only) Converts a bitmap to a grayscale bitmap, then enhances the color components based on the specified parameters.

This method is more general than the GrayscaleExt method. ConvertToColoredGray can be used to give images an "sepia" look by adding a blue or brown color.

iRedFact + iGreenFact + iBlueFact must equal 1000. (Internally the values are divided by 1000).

For each pixel in the bitmap the red, green and blue values are modified by the iRedFact, iGreenFact and iBlueFact parameters, respectively. This allows the user to give more weight to one color, essentially enhancing that color, before the pixel is converted to grayscale.

For example, if this method is called with the iRedFact set to 500, the iGreenFact set to 250 and the iBlueFact set to 250, the red value of each pixel will get 50% of the weight when determining the grayscale value. The green value will get 25% of the weight and the blue value will get 25% of the weight when determining the grayscale value. This highlights or enhances the red in the bitmap, prior to conversion to grayscale. Upon conversion to grayscale, the red, green and blue components of the output pixel are the same. Call this value G. Therefore, the RGB values for the pixel would be (G, G, G).

Once the grayscale value for the pixel has been obtained, the red component of the output pixel can be further modified using the iRedGrayFact value. The equation for this can be seen below:

Goutput-red = G + G * iRedGrayFact / 1000

The green and blue components are found similarly, using the iGreenGrayFact and the iBlueGrayFact values, respectively.

Please note that the iRedGrayFact, iGreenGrayFact and iBlueGrayFact values can be negative. A negative value results in a decrease in pixel intensity. A positive value results in an increase in pixel intensity.

If iRedGrayFact = iGreenGrayFact = iBlueGrayFact = 0, then the output is the same as the output from the GrayScaleBitmapExt method.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | BalanceColors method, GrayScale method, GrayscaleExt method, IsGrayscale property
Topics: | Raster Images: Doing Color Expansion or Reduction


ConvertUnsignedToSigned Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ConvertUnsignedToSigned (ILEADRaster * pRaster, ConvertUnSignedToSignedConstants Shift);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts an unsigned bitmap to signed

This method updates the bitmap handle's minimum and maximum values with new values that consider bitmap new signed values. After calling this method the IsSigned property will be TRUE.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements: | ConvertSignedToUnsigned method, IsSigned property, LoadSigned property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


Correlation method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Correlation (ILEADRaster *pRaster, ILEADRaster * pCorrelationRaster, short StepX, short StepY, short Threshold);
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) This method compares the bitmap references by pCorrelationRaster (or part of the bitmap) with all the areas of the same dimensions in the bitmap references by pRaster and finds those portions that match according to the measure of correlation.

Correlation is a measure of association (resemblance) between two images. It varies from 0 (zero resemblance) to 100 (perfect resemblance). This method updates the CorrelationX and CorrelationY properties with the point of origin for those areas of the bitmap referenced by pRaster where the resemblance with the bitmap referenced by pCorrelationRaster (or part of the bitmap) is greater than the value of iThreshold. The dimensions of the bitmap referenced by pCorrelationRaster must be less than or equal to the dimensions of the bitmap referenced by pRaster.

For example:

  1. Select a bitmap of the object for which you want to look. Set it as the bitmap for pCorrelationRaster.

For example:

  2. Select a bitmap that contains the object you are searching and set it as the bitmap for pRaster

For example:

  3. Call Correlation.

  4. The method will update the CorrelationX and CorrelationY properties with the point of origin (top-left) for each area of the bitmap referenced by pRaster where the correlation with the bitmap referenced by pCorrelationRaster is greater than the correlation threshold. The height and width of the rectangles are the same as for the bitmap referenced by pCorrelationRaster.

  5. The result is:

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | CorrelationX property, CorrelationY property, CorrelationMaxPoints property, CorrelationCount property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method.
Topics: | Raster Image Functions: Comparing Images


CorrelationList method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short CorrelationList(ILEADRaster * pRaster, long lXStep, long lYStep, long lThreshold);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Document/Medical only) Compares the images in the BitmapList property with all the areas of the same dimensions in the bitmap referenced by pRaster and finds those portions that match according to the measure of correlation.

All the images in the BitmapList property must have the same dimensions. Correlation is a measure of the association (resemblance) between two images. It varies from 0 (zero resemblance) to 100 (perfect resemblance). This method updates the CorrelationListX and CorrelationListY properties with the X-axis and Y-axis coordinates of the origin for those areas of the bitmap that is referenced by pRaster where the resemblance with an image in the BitmapList property is greater than the value of lThreshold. This method also updates the CorrelationListIndex property with the index of that image. The dimensions of the BitmapList property images must be less than or equal to the bitmap dimensions that is referenced by pRaster.

For example:

1. | Select bitmaps of the objects for which you want to look. Put them in BitmapList property.
 | For example:
2. | Select a bitmap that contains the objects for which you are searching and put it in of the bitmap that is referenced by pRaster.
 | For example:
3. | Call the CorrelationList method.
4. | The method will update the CorrelationListX and CorrelationListY properties with the X-axis and Y-axis coordinates of the origin (top-left) for each area of the bitmap referenced by the pRaster where the correlation with the image in BitmapList property is greater than the correlation threshold. The height and width of the rectangles are the same as for BitmapList property image.
5. | The result is:

To look for one object in a bitmap, use the Correlation method.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | CorrelationListMaxPoints property, CorrelationListX property, CorrelationListY property, CorrelationListCount property, CorrelationListIndex property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CountLUTColors method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

short CountLUTColors (LUTTypeConstants Flags);

Remarks

Gets the total number of entries between the start color and the end color, and the index of the last occurrence of the start color. The start and end colors are determined internally.

This method updates the LUTColorsFirstIndex property with the index of the last occurrence of the start color. It updates the LUTColorsCount property with the number of entries between the start color and the end color.

This method supports signed data images.

See Also

Elements: | LUTColorsFirstIndex property, LUTColorsCount property
Topics: | Raster Images: Palettes


CreateFadedMask method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CreateFadedMask(ILEADRaster *pRaster, ILEADRaster *pRasterMask, short iLength, short iFadeRate, short iStepSize, short iInflate, FadedMaskConstants Flag, short iMaxGray, OLE_COLOR crTransparent);
Overview | Refer to Combining Images.

Remarks

(DigitalPaint only) Creates a fade mask bitmap in which the color of each pixel is changed with respect to its position in the bitmap. This change depends on the fade rate. This method is only available in the DigitalPaint toolkits.

This method is concerned with the size and shape of the region, not the bitmap itself. Therefore, any bitmap with a region can be used to create a fade mask bitmap. The fade mask bitmap can be used by the FeatherAlphaBlend method to combine two bitmaps with feathering.

If the FADE_OUTER flag is not set, then the size of the fade mask bitmap is equal to the size of a region and the fade progresses toward the center of the region. If the FADE_OUTER flag is set, the size is equal to the size of region plus the iInflate value and the fade starts at the edge of the region and progresses toward the edge of the fade mask bitmap. (The iInflate parameter is used only with FADE_OUTER flag).

In order to use the fade mask bitmap in the FeatherAlphaBlend method the fade mask bitmap must contain three portions:

a. | A portion in which the output (from the blending function) will be the same as the destination bitmap. This is called the Transparency portion of the mask and it’s filled with black.
b. | A portion in which the output is a combination of the destination and source bitmap.
c. | A portion in which the output comes from the source bitmap. This is called the Dump portion of the mask and it’s filled with white.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, FeatherAlphaBlend method, AlphaBlend method
Topics: | Raster Images: Combining Images
 | Using Color Values in LEADTOOLS
 | Image Processing


Cubism method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Cubism (ILEADRaster *pRaster, short iSpace, long lLength, short iBrightness, long lAngle, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Remaps the bitmap into a collection of rotated rectangles (cubic faces) so that it appears to have been created in the Cubist art style.

This method remaps the bitmap into a collection of rotated rectangles (cubic faces), producing an image in a Cubist style. For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

uSpace = 5

uLength = 10

nBrightness = 0

nAngle = 0

crColor = RGB(0,0,0)

uFlags = CUB_BKG|CUB_RAND|CUB_RECT

This function supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Dry method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


Cylindrical method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Cylindrical (ILEADRaster *pRaster, short iValue, short iType);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Warps the bitmap around a cylinder.

If the bitmap has a region, the effect will be applied only to the region.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, ShowCylindricalDlg method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


Deinterlace method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Deinterlace (ILEADRaster *pRaster, long lFlags);
Overview | Refer to Removing Noise

Remarks

Deinterlaces a video source image.

This method deinterlaces video source images by removing the black lines. It proceeds by merging lines in the image and/or blending them. Different options are available according to the value of lFlags.

This method does not work on regions.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | BinaryFilter method, Pixelate method, Sharpen method, Posterize method, Mosaic method, Emboss method, Average method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


Desaturate method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Desaturate (ILEADRaster *pRaster);
Overview | Refer to Grayscale Images

Remarks

Converts the image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

This function supports only RGB images. It does not support grayscale images.

Support for 48-bit and 64-bit colored images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | BalanceColors method, Grayscale method
Topics: | Raster Image Functions: Modifying Intensity Values


Deskew method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Deskew (ILEADRaster *pRaster, OLE_COLOR crFill, long lFlags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) Rotates the bitmap to straighten it. This method typically is used to automatically straighten scanned images.

The calculated rotation is limited to 10 degrees in either direction. This method is intended for images, such as scanned documents, that are mainly horizontal lines of text. The results are unpredictable with other types of images.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

Read the DeskewAngle property after calling this method to get the angle that was applied.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements | DeskewAngle property, Despeckle method, WindowLevel method, ApplyTransformationParameters method, GetMarksCenterMass method, GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method
Topics | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS


DeskewExt method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | HRESULT DeskewExt(ILEADRaster * pRaster, long lAngleRange, long lAngleResolution, OLE_COLOR crFill, long lFlags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above only) Rotates the specified bitmap to straighten it. This method typically is used to automatically straighten scanned images.

Like Deskew, you can use this method to automatically straighten scanned documents. With this method, the Deskew method has been extended to increase the possible deskew angle (from 10 degrees to 45 degrees in either direction). In addition it adds the capability to forgo deskewing if the deskew angle is very small and to specify the resolution of the rotation step, and adds the capability to specify the type of interpolation to be performed while rotating.

If lFlags contains DSKW_NOPROCESS, the method will update DeskewExtAngle property with the deskew angle without rotating the image.

The calculated rotation is limited to 45 degrees in either direction. This method is intended for images, such as scanned documents, that are mainly horizontal lines of text. The results are less predictable with other types of images.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | DeskewExtAngle property, Despeckle method, WindowLevel method, ApplyTransformationParameters method, GetMarksCenterMass method, GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, Deskew method.
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images


Despeckle method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Despeckle (ILEADRaster *pRaster);
Overview | Refer to Removing Noise.

Remarks

(Document/Medical only) Removes speckles from the bitmap. Typically, this method is used to clean up scanned images (such as FAX images).

This method removes 1-pixel speckles, and shrinks some larger speckles. Therefore, in some cases, larger speckles can be completely removed by running it more than once.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


DotRemove method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short DotRemove (ILEADRaster *pRaster, DotRemoveFlags Flags, long iMinDotWidth, long iMinDotHeight, long iMaxDotWidth, long iMaxDotHeight);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This method finds and removes dots, specks, and blobs of various sizes in 1-bit documents. The dots, specks, and blobs may or may not be all black.

This method works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this method. If no region is selected, the whole image will be processed.

The behavior of this method can be modified by using the DotRemove event.

This method triggers both the DotRemove event and the ProgressStatus event.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | DotRemove event
Topics: | Raster Images: Cleaning - up 1-Bit Images


DiceEffect method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short DiceEffect (ILEADRaster *pRaster, ong lXBlock, long lYBlock, long lRandomize, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Splits the image into square or rectangular blocks. If the blocks are square, rotates each block by 0, 90, 180, or 270 degrees. If the blocks are rectangular, flips the blocks around the X-axis or Y-axis.

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This method divides the image into a certain number of blocks according to the lFlags parameter. If this flag is set to DICE_SIZE then the image will be divided into blocks according to the width and height for each block, which you set with the lXBlock and lYBlock parameters.

If the lFlags flag is set to DICE_COUNT then the image is divided into blocks according to the number of blocks per row and number of blocks per column you set with the lXBlock and lYBlock parameters.

The lFlags variable must contain DICE_COUNT or DICE_SIZE (but not both).

The lFlags variable can be or-ed with the DICE_BORDER and BITMAP_RESIZE flags. If the DICE_BORDER flag is set, borders will be drawn around the dice blocks and it will be painted by the crColor parameter. If the BITMAP_RESIZE flag is set then the image will be resized so that all blocks have the same size and so there is no remainder in the image, ensuring that all blocks in the image will be manipulated in the same way. If the BITMAP_RESIZE flag is not set then the edge blocks (which may be a different size than the inner blocks) will be treated differently than the inner blocks.

The Dice effect method works in the following manner:

It divides the image into a certain number of blocks.

If the BITMAP_RESIZE flag is set, the bitmap is resized to the closest size to have the edge blocks have the same size as the inner blocks.

If the BITMAP_RESIZE flag is not set, then the inner blocks might have a different size and shape than the edge blocks. Each block is transformed according to its shape.

For each block, a rotation angle is picked at random out of the following values: 0, 90, 180, and 270. The rotation angle is applied depending on the block shape (square or rectangular):

If the block is square, it is rotated by the rotation angle.

If the block is rectangular, it is transformed as follows:

If the rotation angle is 0, the block remains unchanged.

If the rotation angle is 90, the block is flipped around the x-axis.

If the angle is 180, the block is rotated by 180.

If the angle is 270, the block is flipped around the y-axis.

If the DICE_BORDER flag is set, the method draws borders around the blocks.

The starting point (that is, the "randomize value") for the random number generator is selected through the lRandomize parameter.

If lRandomize is set to zero then the method itself selects a random value between 1 and 500 for the randomize value.

If lRandomize is > 0, it is used for the randomize value.

Here are some tips related to the randomize point:

The sequence of generated random numbers is the same if you use the same randomize value > 0. In other words, if you call the method twice with the same randomize value, each block will be transformed the same way.

Calling the method 4 times with the same bitmap and the same randomize value > 0 will leave the bitmap blocks unchanged. So, if you call the method once, the blocks will be transformed. Call the method 3 more times and each block goes to its original transformation. Of course, if you elected to draw borders, there will be a grid drawn on the image.

If you pass 0 for lFlags, the method leaves the image unchanged.

This method supports all bits/pixel supported by LEADTOOLS.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | PuzzleEffect method, RingEffect method.
Topics: | Raster Images: Artistic Effects
 | Using Color Values in LEADTOOLS


DiffuseGlow method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short DiffuseGlow(ILEADRaster * pRaster, long lGlowAmount, long lClearAmount, long lSpreadAmount, long lWhiteNoise, OLE_COLOR crGlowColor);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow.

This filter adds pixels randomly to the bitmap. A glow is added based on a combination of the pixel colors and the glow color.

As an example, if you use the following image:

And you were to call DiffuseGlow using the following settings:

Parameter | Value
lGlowAmount | 50
lClearAmount | 50
lSpreadAmount | 10
lWhiteNoise | 10
crGlowColor | white

The following figure results:

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, Dry method, GlowFilter method, Ocean method, GlassEffect method, LensFlare method, Light method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method.
Topics: | Raster Images: Filtering Images.
 | Raster Images: Artistic Effects.


DigitalSubtract method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short DigitalSubtract (ILEADRaster *pRasterDst, ILEADRaster *pRasterSrc, long lFlags);
Overview | Refer to Examining and Altering Bitmaps

Remarks

(Medical only) Subtracts the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps.

Performs a digital subtraction between two images. The resulting image may be enhanced using the lFlags options. Digital subtraction is mainly used to show the differences or the changes between two images. For the process to be meaningful both images should be related to each other. Digital Subtraction Angiography (DSA) is a practical example of digital subtraction.

Digital Subtraction Angiography (DSA) and Quality Control (QC) are both major fields that use image subtraction. An example of DSA is explained below.

DSA is a technology used for the visualization of blood vessels in the human body. A mask image is obtained using X-ray film of the body part of interest. Then vessels of that part are injected using a contrast medium. A sequence of images is taken after the injection. These are called live images. After applying subtraction between the mask and live images the resulting images are images that show the passage of the contrast medium in the vessels.

Both pRasterDst and pRasterSrct should have the same bits per pixel, number of channels and image dimensions; otherwise the method will return an error code.

If DS_CONTRASTENH is set then the contrast of the subtracted image will be enhanced.

If DS_OPTIMIZERANGE is set then the tonal range of the subtracted image will be optimized. That is, the image intensity will be distributed among the full image intensity range.

The result of the subtraction is placed in pRasterDst.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ShiftData method, SelectData method, ColorizeGray method, MultiScaleEnhancement method, Combine method
Topics: | Raster Images: Modifying Intensity Values


DirectionEdgeStatistical Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DirectionEdgeStatistical (ILEADRaster* pRaster, long lDim, long lThreshold, short iAngle, OLE_COLOR crEdgeColor, OLE_COLOR crBkColor)
Overview | Refer to Detecting and Enhancing Edges and Lines

Remarks

Detects the variation of colors in the specified direction using statistical indices. It is similar to EdgeDetectStatistical, but this method allows you to specify the direction angle.

The edges are detected by applying a statistical filter that analyzes the variations of colors in a specified direction around each pixel.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | SpatialFilter method, EdgeDetector method, DirectionEdgeStatistical method, MathFunction method
Topics: | Raster Images: Filtering Images
 | Using Color Values in LEADTOOLS


DiscreteFourierTransformation Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DiscreteFourierTransformation (ILEADRaster* pRaster, long lMinHarmonicX, long lMaxHarmonicX, long lMinHarmonicY, long lMaxHarmonicY, long lFlags)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Computes the Discrete Fourier transform of an image or the Inverse Discrete Fourier transform as specified in the lFlags parameter.

This method converts the image from the time domain to the frequency domain and vice versa using the Discrete Fourier Transform algorithm. Use the FastFourierTransformation method to use a Fast Fourier Transform algorithm on a bitmap. Please note however, that this method does not impose the size restrictions (the width and height having to be powers of 2) that the Fast Fourier Transform function, FastFourierTransformation, imposes upon bitmaps.

The lMinHarmonicX, lMaxHarmonicX, lMinHarmonicY and lMaxHarmonicY properties specify the frequency range to be computed when DFT_DFT is set in lFlags. It specifies the frequency range that will be used in the image construction when DFT_IDFT is chosen.

Before using this method, you need to use the InitFourierTransformation method. When you are finished, you should free the allocated array by calling the FreeFourierTransformation method.

This function does not work on regions. If a bitmap has a region the function ignores it and processes the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | InitFourierTransformation method, FastFourierTransformation method, FreeFourierTransformation method, FrequencyFilter method, FrequencyFilterMask method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


DisplaceMap method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short DisplaceMap(ILEADRaster * pRaster, ILEADRaster * pDisplacementMap, long lHorzFact, long lVertFact, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Displaces bitmap pixels horizontally and vertically according to the values of the displacement map image.

This effect shifts image pixels according to the values of the displacement map. Red values in the displacement map shift the original pixels horizontally. Green values in the displacement map shift the original values vertically. Blue values are ignored. A displacement map value of 128 means not to shift anything. A displacement map value of 0 means to shift pixels the complete vertical or horizontal percentage, to the left or down. A displacement map value of 255 means to shift pixels the complete vertical or horizontal percentage, to the right or up.

Displacement maps modify the geometry of the object. As a result, pixel shifts and forms may be added to the image, and the image may be warped or distorted.

As an example, if you use the following image:

And you were to use the following bitmap as your displacement map:

And you were to call DisplaceMap using the following settings:

Parameter | Value
lHorzFact | 17
lVertFact | 24
crFill | na
lFlags | FILL_NOCHG | DSPL_STRETCH

The following figure results:

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method
Topics: | Raster Images: Doing Geometric Transformations.


DisplayFourierTransformation Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DisplayFourierTransformation(ILEADRaster* pRaster, long lFlags)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Displays the results of a Fast Fourier Transform or a Discrete Fourier analysis as a bitmap.

This method converts the storage array computed by the DiscreteFourierTransformation method or FastFourierTransformation method into a bitmap. The resulting bitmap may be displayed such that it shows either the frequency harmonics amplitude data or phase data. The (0,0) frequency is located in the bitmap center, positive X harmonics in the right half and positive Y harmonics located in the lower half of the bitmap.

This method does not work on regions. If a bitmap has a region the method ignores it and processes the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | DiscreteFourierTransformation method, DirectionEdgeStatistical method, FastFourierTransformation method, InitFourierTransformation method, FrequencyFilter method, FrequencyFilterMask method, FreeFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


DrawStar method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short DrawStar (ILEADRaster *pRaster, short iCenterX, short iCenterY, short iSpoke, short iStarWidth, short iStarHeight, short iHoleSize, short iPhase, short iAngle, short iDistOpac, short iSpokeDiv, short lAngleOpac, short iBorderOpac, OLE_COLOR crFillLower, OLE_COLOR crFillUpper, short iOpacity, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Draws a star on the bitmap.

If the bitmap has a region, the effect will be applied on the region only.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Artistic Effects


Dry method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Dry (ILEADRaster *pRaster, short iDim);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Simulates painting an image with the watercolor dry brush technique.

This method simulates what would happen if the image had just been painted with paints and the paints were allowed to dry. The colors become darker, with less brightness.

The effect can be controlled by specifying the size of the neighborhood that is used for calculating each pixel value.

If the bitmap has a region, the effect will be applied on the region only.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects


DynamicBinary method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short DynamicBinary (ILEADRaster *pRaster, long lDim, long lLocalContrast);
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Converts a bitmap into a black and white image without changing its bits per pixel by using a local threshold value for each pixel of the image.

Each pixel is compared to a dynamically-calculated threshold. If the intensity of the pixel is higher (that is, the pixel is brighter) than the dynamic threshold, the pixel will be set to white. If the intensity of the pixel is lower (that is, the pixel is darker) than the dynamic threshold, the pixel will be set to black.

This method is good as a prerequisite for converting scanned images to 1-bit, because it uses one threshold for background and another for text.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | IntensityDetect method, Median method, BinaryFilter method, MaxFilter method, MinFilter method, WindowLevel method, Despeckle method, Deskew method
Topics: | Raster Images: Filtering Images


EdgeDetectEffect method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short EdgeDetectEffect (ILEADRaster *pRaster, long lLevel, long lThreshold, EdgeDetectEffectConstants Flags);
Overview | Refer to Detecting and Enhancing Edges and Lines

Remarks

Performs edge detection on the image.

This method detects the edges in a bitmap and then replaces the values of edges by new values calculated according to the Flags value.

Support for 12 and 16-bit grayscale images are available only in the Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | EdgeDetector method, SpatialFilter method, EdgeDetectStatistical method, DirectionEdgeStatistical method.
Topics: | Raster Images: Filtering Images


EdgeDetectStatistical method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EdgeDetectStatistical (ILEADRaster *pRaster, short iDim, short iThreshold, OLE_COLOR crEdge, OLE_COLOR crBk);
Overview | Refer to Detecting and Enhancing Edges and Lines

Remarks

Detects edges by examining the variation of colors in all directions using statistical indices.

The edges are detected by applying a statistical filter that analyzes the variations of colors in all directions around each pixel.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine method, IntensityDetect method, Sharpen method, SpatialFilter method, EdgeDetector method
 | Using Color Values in LEADTOOLS
Topics: | Raster Image Functions: Filtering Images


EdgeDetector method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EdgeDetector(ILEADRaster *pRaster, short iThreshold, EdgeDetectorConstants Filter);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

(Document only) Applies the specified edge filter to the bitmap.

Filters such as Sobel filter, Prewitt filter, Laplacian filter, and Gradient filter are used to determine the pixels belonging to edges in the bitmap.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The threshold range for the 16, 48, and 64-bit bitmaps is from 0 to 32767 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. The threshold is applied on channels separately.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine method, IntensityDetect method, Sharpen method, SpatialFilter method, EdgeDetectorExt method
Topics: | Raster Images: Filtering Images


EdgeDetectorExt method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EdgeDetectorExt(ILEADRaster *pRaster, short lThreshold, EdgeDetectorConstants Filter);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

(Document only) Applies the specified edge filter to the bitmap.

Filters such as Sobel filter, Prewitt filter, Laplacian filter, and Gradient filter are used to determine the pixels belonging to edges in the bitmap.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The threshold range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. The threshold is applied on channels separately.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine method, IntensityDetect method, Sharpen method, SpatialFilter method, EdgeDetectort method
Topics: | Raster Images: Filtering Images


Emboss method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Emboss (ILEADRaster *pRaster, EmbossConstants Direction, short iDepth);
Overview | Refer to Applying Artistic Effects.

Remarks

Applies an emboss effect to the bitmap, letting you specify the depth and direction of the effect.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


ExtractMessage method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ExtractMessage (ILEADRaster* pRaster);
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Extracts a message (text or file) from the specified bitmap, if the bitmap has an embedded message. The information of the extracted message is specified by the Message, Password, FileName , Directory, StartX, and StartY properties.

This method is used to extract the message that was added to the bitmap by the AddMessage method.

Before calling this method, you must set the Password, StartX, StartX, and Directory properties using the same information used for these properties when the message was added. The Message property will be updated with the extracted message. This method can extract a message from any type of lossless image format such as bmp, tiff, lossless jpeg, and so forth. If used with lossy format types the message may be corrupted or lost.

Support for 16-bit grayscale and 48-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | Message property, Password property, FileName property, Directory property, StartX property, StartY property, AddMessage method
Topics: | Raster Images: Getting and Setting File Information


FastRotate method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short FastRotate (ILEADRaster *pRaster, short iAngle);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical only) Rotates the bitmap in 90-degree increments, in a faster way than is possible with the Rotate method.

Valid rotations are +-90, +-180, +-270, or +-360. Positive values are clockwise; negative values are counterclockwise.

Please note that this is only a viewport rotation. The "rotated" data is not saved.

See Also

Elements: | Rotate method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Methods That Transform the Region and the Bitmap


FastFourierTransformation Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FastFourierTransformation (ILEADRaster* pRaster, long lFlags)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Computes the Fast Fourier transform of an image or the Inverse Fast Fourier transform as specified in the lFlags.

This method converts the image from the time domain to the frequency domain and vice versa using a Fast Fourier Transform algorithm. Fast Fourier Transform algorithms are a simplification of a Discrete Fourier Transform and require that the image dimensions must be power of two (i.e. 2, 4, 8, 16, 32…etc). The number of computations needed are reduced from 2N2 to 2N LgN. Use the DiscreteFourierTransformation to use a Discrete Fourier Transform algorithm on a bitmap. If you try to use this method with a bitmap with dimensions that are not a power of two, the method will return an ERROR_INV_PARAMETER error.

Before using this method, you must call the InitFourierTransformation method. When you are finished, you should free the allocated array by calling the FreeFourierTransformation method.

This function does not work on regions. If a bitmap has a region the function ignores it and processes the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | InitFourierTransformation method, DiscreteFourierTransformation method, FreeFourierTransformation method, FrequencyFilter method, FrequencyFilterMask method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


FeatherAlphaBlend method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FeatherAlphaBlend(ILEADRaster *pRaster, float fLeft, float fTop, float fWidth, float fHeight, ILEADRaster *pRasterSrc, float fSrcLeft, float fSrcTop, ILEADRaster *pRasterMask);
Overview | Refer to Combining Images.

Remarks

(DigitalPaint only) Combines image data from two bitmaps with feathering, by combining the two bitmaps with a variable opacity that depends on a fade mask. This method is only available in the DigitalPaint toolkits.

To combine two bitmaps with a fixed opacity, use the AlphaBlend method.

The FeatherAlphaBlend method achieves feathering between two bitmaps by using variable opacity values, obtained from the fade mask contained in pRasterMask.

To create a bitmap that contains a fade mask, use the CreateFadedMask method.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, AlphaBlend method, CreateFadedMask method
Topics: | Raster Images: Combining Images
 | Image Processing


Fill method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Fill (ILEADRaster *pRaster, OLE_COLOR crFill);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Fills the bitmap with the specified color.

The standard Windows values for COLORREF represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette which holds the color value.You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

In the Document/Medical toolkits, the COLORREF value may represent a 16 bit grayscale value if the bitmap is a 12 or 16-bit grayscale. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask (0x04000000) is set. In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS elements will recognize a COLORREF having this format, but Windows elements will not. For information on converting from a 16-bit value, refer to Converting 16-bit Grayscale Values.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Creating and Deleting Images
 | Using Color Values in LEADTOOLS
 | Raster Images: Where the Region Preempts the Bitmap


Flip method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Flip (ILEADRaster *pRaster);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Flips the bitmap from top to bottom.

See Also

Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


Fragment method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Fragment(ILEADRaster * pRaster, long lOffset, long lOpacity)
Overview | Refer to Combining Images.

Remarks

(Raster Pro and above only) Averages a bitmap with its shifted copies.

This method creates four copies of an image. Each copy is shifted by the offset amount into one of the four directions: top, left, bottom and right. Then the bitmap is averaged with its shifted copies.

Use the DisplaceMap method to displace a bitmap's pixels horizontally and vertically according to the values of the displacement map image.

Use the Offset method to shift a bitmap's pixels horizontally and vertically.

Use the OffsetRgn method to move a bitmap region by the specified number of rows and columns.

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, FeatherAlphaBlend method, CreateFadedMask method, TextureAlphaBlend method, DisplaceMap method, Offset method, OffsetRgn method, BumpMap method, Canvas method, CombineBitmapWarp method, BricksTexture method.
Topics: | Raster Images: Combining Images.
 | Raster Images: Artistic Effects


FreeFourierTransformation Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FreeFourierTransformation
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Frees the storage that was allocated by the InitFourierTransformation method.

This method should be called when your program no longer needs the array that is used to hold Fourier Transform coefficients. This method is used only when working with the Fourier Transform methods.

See Also

Elements: | DiscreteFourierTransformation method, DirectionEdgeStatistical method, FastFourierTransformation method, InitFourierTransformation method, FrequencyFilter method, FrequencyFilterMask method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


FreeHandShear method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short FreeHandShear (ILEADRaster *pRaster, short iScale, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Shears the image by the wave drawn using the Amplitudes property.

This method will shear the bitmap using the wave in the Amplitudes property. The wave can be applied vertically or horizontally. The Amplitudes property data can be obtained from the GetCurvePoints method, or from the Wave Shear dialog .

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, ShowCylindricalDlg method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


FreeHandWave method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short FreeHandWave (ILEADRaster *pRaster, short iScale, short iWaveLen, short iAngle, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Distorts the bitmap by the wave specified in the Amplitudes property and the rotation angle in iAngle.

The method applies the wave in the Amplitudes property. You can repeat and rotate the wave in any direction. The Amplitudes property data can be obtained from the GetCurvePoints method, or from the FreeHandWave Dialog .

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, ShowCylindricalDlg method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


FreePlaneBend method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FreePlaneBend (ILEADRaster *pRaster, short iScale, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Wraps the bitmap onto a 3D plane shaped by the Curve property.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, the following figure shows a bitmap before the effect is applied.

The following figure shows the same bitmap after the effect has been applied.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, Dry method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


FreeRadBend method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FreeRadBend (ILEADRaster *pRaster, short iScale, short CenterX, short CenterY, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Wraps the bitmap along its radius on a 3D surface shaped by the Curve property.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, the following figure shows a bitmap before the effect is applied.

The following figure shows the same bitmap after the effect has been applied.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, Dry method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects


FrequencyFilter Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FrequencyFilter (long lMinHarmonicX, long lMaxHarmonicX, long lMinHarmonicY, long lMaxHarmonicY, long lFlags)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Filters the frequency harmonics data produced by a Fourier Transform function using a range rectangle.

This method is used only when working with Fourier Transform functions.

The lMinHarmonicX, lMaxHarmonicX, lMinHarmonicY and l MaxHarmonicY properties specify the filter dimension that will be applied. They represent the frequency range to be kept or removed.

Before using this method, you must call the InitFourierTransformation method. When you are finished, you should free the allocated array by calling the FreeFourierTransformation method.

See Also

Elements: | InitFourierTransformation method, HueSaturationIntensity method, FastFourierTransformation method, FreeFourierTransformation method, DiscreteFourierTransformation method, FrequencyFilterMask method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


FrequencyFilterMask Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FrequencyFilterMask (ILEADRaster* pMaskRaster, VARIANT_BOOL bOnOff)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Creates a mask filter to remove specific frequency components from a bitmap.

This method is used only when working with Fourier Transform methods.

The Mask bitmap will be treated as a grayscale bitmap. The (0,0) frequency is located in the mask bitmap center; with positive X harmonics located in the right half of the mask bitmap and positive Y harmonics located in the lower half of the mask bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | InitFourierTransformation method, FastFourierTransformation method, FreeFourierTransformation method, DiscreteFourierTransformation method, FrequencyFilter method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


FunctionalLight method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short FunctionalLight (ILEADRaster *pRaster);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Adds light to the bitmap according to a function-based distribution. This light will be generated by one of the following methods: linear, quadratic, sine, cosine, or using freehand points.

Controls the brightness of the bitmap according to the method selected for generating the light.

The characteristics of the light to be added are control in the following properties:

LightFrequency property

LightRedAmplitude property

LightGreenAmplitude property

LightBlueAmplitude property

LightXOrigin property

LightYOrigin property

LightPhase property

UserShapeCount property

UserShape property

LightFlags property

This method supports all bits/pixel supported by LEADTOOLS.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property
Topics: | Raster Images: Artistic Effects


GammaCorrect method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GammaCorrect (ILEADRaster *pRaster, short iGamma);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Adjusts the intensity of colors in the bitmap by changing the gamma constant that is used to map the intensity values.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Intensity method, Contrast method, HistoContrast method, HistoEqualize method, StretchIntensity method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


GammaCorrectExt method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GammaCorrectExt(ILEADRaster * pRaster, long lGamma, GammaCorrectConstants flags)
Overview | Refer to Changing Brightness and Contrast.

Remarks

Adjusts the intensity of colors in a bitmap by changing the gamma constant that is used to map the intensity values. Either of two different color spaces can be specified.

This method is like the GammaCorrect method, but has been extended to allow the specification of the colorspace to be used.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

GammaCorrect method, Intensity method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Hue method, Saturation method, HistoEqualize method, Fill method, Pixel property, GetHistogram method, WindowLevel method, ChannelMix method, Deinterlace method, Desaturate method, EdgeDetectStatistical method, LightControl method, SmoothEdges method, LocalHistoEqualize method, AddWeightedBitmaps method, ColorMerge method, ColorSeparate method, Multiply method, AutoColorLevel method, ColorLevel method, Correlation method, GrayScaleToDuotone method, GrayScaleToMultitone method, HolesRemovalBitmapRgn method, SelectiveColor method, Skeleton method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, MathFunction method, Segment method, AdaptiveContrast method, ApplyMathLogic method, ColorIntensityBalance method, ColorizeGray method, ContrastBrightIntensity method, DigitalSubtract method, DynamicBinary method, EdgeDetectEffect method, FunctionalLight method, MultiScaleEnhancement method, SelectData method, ShiftData method

Topics:

Raster Images: Modifying Intensity Values.


GaussianFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GaussianFilter(ILEADRaster *pRaster, short iRadius);
Overview | Refer to Removing Noise.

Remarks

Smoothes or blurs an image by applying a Gaussian filter to the specified bitmap.

Each pixel in the bitmap is blurred based on neighborhood pixels. The parameter iRadius determines the size of the neighborhood to consider when blurring a pixel. The result is a blurred version of the original image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen method, Posterize method, Mosaic method, Emboss method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, Solarize method, WindowLevel method, UnsharpMask method
Topics: | Raster Images: Filtering Images


GetBitmapStatisticsInfo Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetBitmapStatisticsInfo (ILEADRaster* pMaskRaster, ChannelConstants Channel, long lStart, long lEnd)
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Raster Pro and above toolkits) Calculates statistical information about the bitmap.

The lStart and lEnd parameters designate the range of colors that will be taken in consideration for producing the results. Only the values between lStart and lEnd are used for the calculation of the results. The range of each one depends on the bits per pixel of the bitmap: in the case of 8 bits per component (RGB), the range is between 0 and 255; for 16 bits, the range is 0 through 65535; and for 12 bits, the range is 0 through 4095.

This method updates the following properties:

BitmapMean property

BitmapMedian property

BitmapMaxValue property

BitmapMaxValue property

BitmapSelectedPixelPercent property

BitmapPixelsCount property

BitmapTotalPixelCount property

BitmapStandardDeviation property

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | BitmapMean property, BitmapMedian property, BitmapMaxValue property, BitmapMaxValue property, BitmapSelectedPixelPercent property, BitmapPixelsCount property, BitmapTotalPixelCount property, BitmapStandardDeviation property
Topics: | Raster Images: Getting Current Information


GetColorCount method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetColorCount (ILEADRaster *pRaster);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Returns the number of unique colors in the current bitmap.

This method supports signed data images.

See Also

Elements: | BitmapBits property, BitmapHeight property, BitmapWidth property, BitmapXRes property, BitmapYRes property
Topics: | Raster Images: Getting Current Information


GetCurvePoints method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GetCurvePoints (long lFlags);
Overview | Refer to Changing Brightness and Contrast

Remarks

Updates the Amplitudes property based on a curve or lines that pass through the points specified in the UserLUTCurveX and UserLUTCurveY properties.

This method will update the Amplitudes property using either the best curve or lines that pass through the points specified in the UserLUTCurveX and UserLUTCurveY properties. The points in the array may be sorted or not. In most cases, this method is used with the FreeHandShear method, or FreeHandWave method.

The values stored in the Amplitudes property represent the y coordinates of the calculated curve based on the points in the UserLUTCurveX and UserLUTCurveY properties. In the Amplitudes property there can be only one y value for each x coordinate. Therefore, circles, ellipses, and spirals cannot be represented by the Amplitudes property.

The x coordinates for the user points are sorted internally automatically.

This method will also update the AmplitudesCount property with the number of values written to the Amplitudes property.

See Also

Elements: | GetFunctionalLookupTable method, GetUserLookUpTable method, FreeHandShear method, FreeHandWave method
Topics: | Raster Images: Modifying Intensity Values


GetFeretsDiameter Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetFeretsDiameter()
Overview | Refer to Creating and Using a Bitmap Region

Remarks

(Raster Pro and above toolkits) Computes the Feret’s diameter (caliper length) of an object, which is the maximum distance between any two points of the perimeter of a region, and finds the end points.

This diameter is equivalent to the minimum diameter of a tube through which this object/region can pass.

This method updates the following properties with information about the Feret's diameter:

FeretsDiameterLength property

FeretsFirstIndex property

FeretsSecondIndex property

See Also

Elements: | GetRgnContourPoints method, GetRgnPerimeterLength method, Segment method, RgnPerimeterLength property
Topics: | Raster Images: Creating and Using a Region


GetFunctionalLookupTable method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetFunctionalLookupTable(ILEADRaster pRaster, long nStart, long nEnd, short nFactor, GetLookupTableFlags Flag);
Overview | Refer to Using Histograms.

Remarks

Updates a range of entries in the HistogramTable property array, based on the specified mathematical function.

The nFactor parameter is used for log, exp and sigmoid functions only. If nFactor is 0 the method performs a linear interpolation between the two points nStart and nEnd and stores the results in the lookup table, regardless of the value set in Flag.

If Flag is GL_EXP the value of nFactor modifies the lookup table values according to the following equations:

Y | = | nStart | + | (nEnd – nStart) * (exp ((nFactor/10.0 * (x-nStart))/(nEnd-nStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where :

nFirstValue = exp(nFactor * nStart/nEnd)nLastValue = exp(nFactor)

x = the intensity value of the selected point

If Flag is GL_LN the value of nFactor modifies the lookup table values according to the following equations:

where:

nFirstValue = ln(1+ (nFactor * nStart/nEnd))nLastValue = ln(1 + nFactor)

x = the intensity value of the selected point

In the case of linear function, nFactor has no effect. The method performs a linear interpolation between the two points nStart and nEnd and stores the results in the lookup table. The user determines the two points nStart and nEnd and their new values, nFirstValue and nLastValue. The value nFirstValue should be stored in the lookup table at the nStart position and nLastValue at the nEnd position of the lookup table before calling this method.

As an example, suppose a user wants to select a point, change the intensity value of that point (x), and then perform two linear interpolations:

from 0 to the intensity value x

from intensity value x to the end of the range

To accomplish this, the user would proceed by doing the following:

Select the point and get its intensity value (x)

Change the intensity value of the selected point to some new value (newCol).

Store the new intensity value in the Lookup table by assignment:

RemapTable(x) = newCol

Call GetFunctionalLookupTable with nStart set to 0, nEnd set to x, and Flag set to GL_LINEAR.

Call GetFunctionalLookupTable with nStart set to x, nEnd set to 255, and Flag set to GL_LINEAR. (For the example, assume the image is 8-bits per pixel.)

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GetUserLookUpTable method, RemapIntensity method, RemapTable property, RemapTableSize property
Topics: | Changing Brightness and Contrast


GetHistogram method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetHistogram (ILEADRaster *pRaster, long lFlags);
Overview | Refer to Using Histograms.

Remarks

Updates the array that charts how many times each intensity level occurs in the bitmap. This method can chart red, green, and blue separately or together.

You can access the array values using the HistogramTable property. Intensity levels range from 0 to 255. Therefore, the resulting array has 256 items, indexed by intensity value. The value of each item is the number of occurrences of the intensity level.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

For 48 and 64-bit images, the intensity levels range from 0 to 65535. Therefore, the resulting array has 65536 items, indexed by intensity value. The value of each item is the number of occurrences of the intensity level.

Specifically, the HistogramTable property holds at least 2^(HighBit – LowBit + 1) entries if HIST_LOWHIGH_BITS is set in lFlags. If HIST_ALL_BITS is set in lFlags, the table must hold at least 4096 for 12-bit bitmaps and 65536 for 16-bit bitmaps.

This method supports signed data images.

See Also

Topics: | Raster Images: Using Histograms
 | Raster Images: Where the Region Preempts the Bitmap
 | Changing Brightness and Contrast


GetHistogramGray method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GetHistogramGray (ILEADRaster *pRaster);
Overview | Refer to Using Histograms.

Remarks

(Medical only) This method works only on 12-bit and 16-bit grayscale images. For all other images, use the GetHistogram method.

Intensity levels in a grayscale bitmap can range from 0 to( 216 – 1), depending on whether the image is 12-bit or 16-bit grayscale, and the LowBit and HighBit of the image. The LowBit and HighBit identify which bits in a 12-bit or 16-bit entry are used. The LowBit and HighBit can be obtained by calling the GetMinMaxBits method and then looking at the MinBit and MaxBitproperties.

Specifically, a histogram table for a 12-bit or 16-bit grayscale image will have 2(HighBit – LowBit + 1) entries.

After calling GetHistogramGray(), the HistogramGrayTable property is automatically sized and filled in with grayscale intensities.

For example, suppose you have a 16-bit grayscale image with LowBit = 2 and HighBit = 7. There are 2(7-2+1) = 64 possible grayscale intensities. The histogram table will therefore hold 64 entries. The number of entries in the HistogramGrayTable property can be found by examining the HistogramGrayTableSize property. The HistogramGrayTableSize property and the HistogramGrayTable property both can change after each call to the GetHistogramGray method. The number of grayscale values with bits 2 – 7 set to 0 can be found in HistogramGrayTable(0). The number of grayscale values with bit 2 set to 1 and bits 3 – 7 set to 0 can be found in HistogramGrayTable(1), and so on up to HistogramGrayTable(63). Since the low bit is 2 and the high bit is 7, bits 0, 1, and bits 8 – 15 must all be 0. Therefore, the values set in bits 2 – 7 determine the intensities present in the image. In the table below, the gray columns represent those bits that are always 0 for the image. The columns bit 7 through bit 2 represent possible settings for those bits. The last column gives the location within the HistogramGrayTable property of the number of grayscale values having the corresponding settings. For example, HistogramGrayTable(0) contains the number of grayscale values of intensity 0 (all bits set to 0). HistogramGrayTable(1) contains all the grayscale values with intensity 4 (the 2 bit position set to 1). HistogramGrayTable(2) contains all the grayscale values with intensity 8 (the 3 bit set to 1 and the remaining bits set to 0) and so on.

bits 8 – 15 | bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 | count location in HistogramGrayTable
all 0s | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | HistogramGrayTable(0)
all 0s | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | HistogramGrayTable(1)
all 0s | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | HistogramGrayTable(2)
all 0s | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | HistogramGrayTable(3)
all 0s | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | HistogramGrayTable(4)
… |  |  |  |  |  |  | … | … | and so on
all 0s | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | HistogramGrayTable(63)

As another example, suppose you have a 16-bit grayscale image with LowBit = 0 and HighBit = 15. The number of entries in the table will be 216 = 65,536.

See Also

Elements: | HistogramGrayTable property, HistogramGrayTableSize property, GetHistogram method, HistogramTable property
Topics: | Raster Images: Using Histograms
 | Raster Images: Where the Region Preempts the Bitmap
 | Changing Brightness and Contrast


GetLinearVOILUT method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

short GetLinearVOILUT (ILEADRaster *pRaster, long lFlags);

Remarks

Gets the window center and the window width, if the LUT stored inside pRaster is linear. If the LUT stored inside pRaster is not linear, the method will fail.

You have to pay attention to your signed images LUT. The upper half should contain negative values and lower half should contain positive values.

This method supports signed data images.

If this method succeeds, the UserWindowWidth property is updated with the value of the window width and the UserWindowCenter property is updated with the value of the window center.

See Also

Elements: | WindowLevel method, WindowLevelFillLUT method, GetUserLookupTable method, RemapIntensity method, ApplyLinearVOILUT method, UserWindowWidth property, UserWindowCenter property
Topics: | Raster Images: Palettes


GetMarksCenterMass method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GetMarksCenterMass (ILEADRaster *pRaster);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets the center of mass for each of the registration marks specified in the MarkPointX and MarkPointY properties.

This method is used to determine the center of mass for each supplied registration mark, to be used in detecting image rotation, scaling and translation.

The MarkCMPointX and MarkCMPointY properties will be updated by this method.

If you simply want to automatically straighten a bitmap, use the Deskew method.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MarkPointX, MarkPointY, MarkCMPointX, MarkCMPointY
Topics: | Raster Images: Document Imaging


GetObjectInfo Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetObjectInfo(ILEADRaster* pRaster, VARIANT_BOOL bWeighted)
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Raster Pro and above toolkits) Gets the position, orientation and roundness of areas in the image.

All the objects(areas) in the image are considered to be a single object. This method determines various attributes of the object in the image to identify the objects and to determine their position and orientation.

This method updates the following properties with the retrieved information:

ObjectXPos property

ObjectYPos property

ObjectOrientationAngle property

ObjectRoundness property

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | ObjectXPos property, ObjectYPos property, ObjectOrientationAngle property, ObjectRoundness property, FastFourierTransformation method, GetBitmapStatisticsInfo method, GetFeretsDiameter method, MathFunction method, RevEffect method, Segment method, SubtractBackground method, UserFilter method
Topics: | Raster Images: Analysis Image Object or Region Analysis


GetOverlayAttributes method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short GetOverlayAttributes(ILEADRaster *pRaster, short iIndex, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets one or more overlay attributes for the overlay at the specified index. The OverlayAttributes property will be updated with this information.

See Also

Elements: | Size method, Resize event, GetOverlayCount method, OverlayAttributes property, SetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method, OriginX property, OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Image Functions: Combining Images


GetOverlayBitmap method (ILEADRasterProcess Interface)

GetOverlayBitmap method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short GetOverlayBitmap(ILEADRaster *pRaster, short iIndex, ILEADRaster *pOverlayRaster, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets the overlay bitmap for the specified index.

This method can be used to get a copy of the overlay bitmap (OVERLAY_COPY) or to get the bitmap without making a copy (OVERLAY_NOCOPY or OVERLAY_MOVE).

The quickest way to get the overlay bitmap is to avoid making a copy.

If OVERLAY_MOVE is set in lFlags, the overlay bitmap from the corresponding index will be invalidated.

pOverlayRaster is assumed to be unallocated and uninitialized. It will be filled without freeing the existing data.

See Also

Elements: | Size method, Resize event, GetOverlayCount method, OverlayAttributes property, GetOverlayAttributes method, SetOverlayBitmap method, SetOverlayAttributes method, UpdateOverlayBits method, OriginX property, OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Images: Combining Images


GetOverlayCount method (ILEADRasterProcess Interface)

GetOverlayCount method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short GetOverlayCount(ILEADRaster *pRaster, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets the number of overlays that have been defined for the bitmap associated with the specified object.

This method will count how many overlays have been defined. The overlays are defined by calling the SetOverlayBitmap method or the SetOverlayAttributes method.

See Also

Elements: | Size method, Resize event, UpdateOverlayBits method, OverlayAttributes property, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayAttributes method, SetOverlayBitmap method, OriginX property, OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Image Functions: Combining Images


GetRgnContourPoints Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetRgnContourPoints (ILEADRaster* pRaster)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Gets the contour coordinates of a region.

This method updates the following properties with the results:

ContourX property

ContourY property

ContoursCount property

This method works only on bitmaps having a region. If a bitmap does not have a region the function Returns the error: Not Initialized.

This method supports signed data images.

See Also

Elements: | ContourX property, ContourY property, ContoursCount property, GetFeretsDiameter method, GetObjectInfo method, GetRgnContourPoints method, GetRgnPerimeterLength method, Segment method
Topics: | Raster Images: Creating and Using a Region


GetRgnPerimeterLength Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GetRgnPerimeterLength (ILEADRaster* pRaster)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Computes the length of the perimeter of a region.

The RgnPerimeterLength property is updated with the retrieved length value.

This method works only on bitmaps having a region. If a bitmap does not have a region the function Returns the error: Not Initialized.

This method supports signed data images.

See Also

Elements: | RgnPerimeterLength property, GetRgnContourPoints method
Topics: | Raster Images: Creating and Using a Region


GetTransformationParameters method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GetTransformationParameters (ILEADRaster *pRaster);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical) Computes the rotation angle, XY scaling, and XY translation of the transformed bitmap with comparison to the reference bitmap. These are the transformations that would have to be performed to the reference bitmap to have it match the current bitmap.

This method updates the following properties with the rotation, scaling and translation information:

XTranslation

YTranslation

TransformedAngle

XScale

YScale

This method detects transformation parameters of the transformed bitmap by comparing it with the reference bitmap. The number of reference and detected points must be three.

Call the GetMarksCenterMass method for the reference bitmap. This will update the MarkCMPointX and MarkCMPointY properties with the center of mass for each registration mark. These values can then be assigned to the ReferencePointsX, ReferencePointsY properties.

Call the SearchRegMarks to find the new positions for the reference marks.

Again, call the GetMarksCenterMass method to update the MarkCMPointX and MarkCMPointY properties with the center of mass points for the transformed registration marks. These can be assigned to the TransformedPointsX and TransformedPointsY properties.

The values in the XTranslation, YTranslation, TransformedAngle, XScale and YScale properties are internally divided by 100.

This method supports signed images.

See Also

Elements: | Combine method, Rotate method, Size method, Deskew method, ApplyTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, YTranslation property, TransformationAngle property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


GetUserLookupTable method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short GetUserLookupTable();
Overview | Refer to Using Histograms.

Remarks

Updates the HistogramTable property array, based on a curve that passes through points defined by the UserLUTCurveX and UserLUTCurveY properties.

This method will update the lookup table array using the best curve that passes through the points specified in the Lookup Table Curve.

Before using this method, you must allocate a Lookup Table Curve Array using the UserLUTCurveSize property, and then fill the coordinates of its points with the UserLUTCurveX and UserLUTCurveY properties.

Read the UserLookupTablePointCount property after calling this method to get the number of entries in the lookup table that were actually modified.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements: | RemapIntensity method, RemapTable property, RemapTableSize property, UserLUTCurveX property, UserLUTCurveY property, UserLUTCurveSize property, UserLookupTablePointCount property
Topic | Changing Brightness and Contrast


GlassEffect method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GlassEffect (ILEADRaster *pRaster, short iCellWidth, short iCellHeight, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Divides the bitmap into rectangular cells and makes it look as if it is being viewed through glass blocks.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, Dry method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects


GlowFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GlowFilter (ILEADRaster *pRaster, short iDim, short iBright, short iThreshold);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Makes the colored edges shine with a neon glow.

This method detects the edge pixels by comparing the values of the pixel with surrounding pixels and if the edge value (the difference between the surrounding pixels and the pixel being evaluated) is greater than the Threshold value, the pixel is an edge pixel. The function then multiplies the values for the edge pixels by the iBright Brightness factor.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

iDim = 15;
iBright = 5;
iThreshold = 0;

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, Dry method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects


GrayScaleToDuotone method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayScaleToDuotone (ILEADRaster * pRaster, OLE_COLOR crColor, long lFlags);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits) Converts the grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with new colors.

This method was designed for use with grayscale bitmaps. If the bitmap being used is not grayscale, this method only affects those pixels or areas of the bitmap where Red=Green=Blue.

This method transforms the 8-bit grayscale bitmaps into colored 8-bit bitmaps (Palette) meanwhile the 12-bit and 16-bit grayscale bitmaps are transformed into a 48-bit colored bitmap.

Monotone conversion is possible by setting lFlags to DT_REPLACE, which clears the palette.

This method gives you the option of having the toolkit generate the array of colors to use or creating the array of colors to use yourself.

To have the toolkit generate the array of colors:

Pass the color to use for generating the array of gradient colors in the crColor parameter.

(a) If the bitmap is binary, the IsGrayscale property is checked by the GrayScaleToDuotone method to determine the kind of grayscale palette being used. If the IsGrayscale property is GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to the GrayScaleToDuotone method will become the first color in the array generated by the toolkit. The red, green and blue components of each color are stored in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties, respectively.

If the IsGrayscale property contains a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to GrayScaleToDuotone method will become the second color in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue arrays generated by the toolkit, and the toolkit will create the first color in the properties.

(b) If the bitmap is grayscale (not binary) the GrayScaleToDuotone method will take the color passed to it in the crColor parameter and generate a 256 color gradient in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties.

(c) If the bitmap is not grayscale (it is color) then the GrayScaleToDuotone method will use the color passed to it in the crColor parameter and generate a 256 color gradient in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.

To use a user-defined array of colors:

(a) If the bitmap is binary, call the GrayScaleToDuotone method with the two colors you wish to use in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties.

(b) If the bitmap is grayscale (not binary) call the GrayScaleToDuotone method with the 256 colors you wish to use in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties.

(c) If the bitmap is not grayscale (it is color) call the GrayScaleToDuotone method with the 256 colors you wish to use in the GrayScaleRed, GrayScaleGreen and GrayScaleBlue properties. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, GrayScaleToMultitone method, GrayScaleGreen property, GrayScaleRed property, GrayScaleBlue property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Using Color Values in LEADTOOLS


Grayscale method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Grayscale (ILEADRaster *pRaster, short iBitsPerPixel);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts a 1-, 4-, 8-, 16-, 24-, or 32-bit bitmap to an 8, 12, or 16-bit grayscale bitmap. Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics:

Raster Images: Doing Color Expansion or Reduction


GrayscaleExt method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short GrayscaleExt(ILEADRaster *pRaster, short iRedFact, short iGreenFact, short iBlueFact);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts any bitmap to a grayscale bitmap without changing its resolution.

iRedFact + iGreenFact + iBlueFact must equal 1000. (Internally the values are divided by 1000).

For each pixel in the bitmap the red, green and blue values are modified by the iRedFact, iGreenFact and iBlueFact parameters, respectively. This allows the user to give more weight to one color, essentially enhancing that color, before the pixel is converted to grayscale.

For example, if this method is called with iRedFact set to 500, iGreenFact set to 250 and iBlueFact set to 250, the red value of each pixel will get 50% of the weight when determining the grayscale value. The green value will get 25% of the weight and the blue value will get 25% of the weight when determining the grayscale value. This highlights or enhances the red in the bitmap, prior to conversion to grayscale.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, IsGrayscale property, ConvertToColoredGray method, BalanceColors method, SwapColors method
Topics: | Raster Images: Doing Color Expansion or Reduction


GrayScaleToMultitone Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayScaleToMultitone (ILEADRaster * pRaster, MultitoneTypeConstants ToneType, MultitoneDistTypeConstants DistType, ReplaceColorsConstants Flags);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with one or more new colors.

This method was designed for use with grayscale bitmaps. If the bitmap being used is not grayscale, this method only affects those pixels or areas of the bitmap where Red=Green=Blue.

Monotone conversion is possible by setting Flags to DT_REPLACE, which clears the palette.

This method gives you the option of having the toolkit generate the array of colors to use or creating the array of colors to use yourself.

To have the toolkit generate the array of colors:

a. | If the bitmap is binary, call GrayScaleToMultitone with ToneType set to DT_MONOTONE, DistType set to DT_LINEAR and the color you wish to use set in MultitoneColors property. The IsGrayScale property will be called by GrayScaleToDuotone to determine the kind of grayscale palette being used. If IsGrayScale returns GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the MultitoneColors property parameter to GrayScaleToMultitone will become the first color in the array generated by the toolkit, and the toolkit will create the second color in the array. The MultitoneColors property will be updated with these two colors.
 | If IsGrayScale property returns a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the MultitoneColors property to GrayScaleToMultitone will become the second color in the array generated by the toolkit, , and the toolkit will create the first color in the array. The MultitoneColors property will be updated with these two colors.
b. | If the bitmap is grayscale (not binary) call GrayScaleToMultitone with
 | DistType set to DT_LINEAR. The GrayScaleToMultitone method will take the color(s) passed to it in the MultitoneColors property and generate a 256 color gradient for each color.
 | (i) | If the ToneType is set to DT_DUOTONE, set two colors in the MultitoneColors property. The toolkit will create a 256 color array for each color. The MultitoneColors property array will be updated with all 512 colors.
 | (ii) | If the ToneType is set to DT_TRITONE, set three colors in the MultitoneColors property. The toolkit will create a 256 color array for each color. The MultitoneColors property will be updated with all 768 colors.
 | (iii) | If the ToneType is set to DT_QUADTONE, set four colors in the MultitoneColors property. The toolkit will create a 256 color array for each color. The MultitoneColors property will be updated with all 1024 colors.
c. | If the bitmap is not grayscale (it is color) call GrayScaleToMultitone with DistType set to DT_LINEAR. The GrayScaleToMultitone method will take the color(s) passed to it in the MultitoneColors property and generate a 256 color gradient for each color. (See the expanded explanation in i, ii and iii of (b) above.) These colors will be used to change only those pixels in the color image for which Red = Green = Blue.

To use a user-defined array of colors:

a. | If the bitmap is binary, call GrayScaleToMultitone with ToneType set to DT_MONOTONE, DistType set to DT_USER and the two colors you wish to use in the MultitoneGradient property parameter.
b. | If the bitmap is grayscale (not binary) call GrayScaleToMultitone with DistType set to DT_USER.
 | (i) | If the ToneType is set to DT_DUOTONE, set 512 colors (256 for each basic color) in the MultitoneGradient property.
 | (ii) | If the ToneType is set to DT_TRITONE, set 768 colors (256 for each basic color) in the MultitoneGradient property.
 | (iii) | If the ToneType is set to DT_QUADTONE, set 1024 colors (256 for each basic color) in the MultitoneGradient property.
c. | If the bitmap is not grayscale (it is color) call GrayScaleToMultitone with DistType set to DT_USER. (See the expanded explanation in i, ii and iii of (b) above.) These colors will be used to change only those pixels in the color image for which Red = Green = Blue.

See Also

Elements: | GrayScale method, GrayScaleToDuotone method, GrayScaleGreen property, GrayScaleRed property, GrayScaleBlue property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


Halftone method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Halftone (ILEADRaster *pRaster, HalftoneConstants Type, long iAngle, short iDim);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Converts a 1-, 4-, 8-, 16-, 24-, or 32-bit bitmap 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.

For the HALFTONE_USERDEF option, the number of bitmaps in the list must be at least equal to (iDim * iDim + 1). Bitmaps with higher indexes correspond to higher intensity values.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap is originally 1-bit but is not black and white, this method changes it to black and white.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, GrayScaleExt method
Topics: | Raster Images: Doing Color Expansion or Reduction


HalfTonePattern method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short HalfTonePattern(ILEADRaster * pRaster, long lContrast, long lRipple, long lAngleContrast, long lAngleRipple, long lAngleOffset, OLE_COLOR crForeGround, OLE_COLOR crBackGround, HalfTonePatterenConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above only) Creates a halftone screen effect for an image while keeping its continuous range of tones.

Use this method to create a halftone screen effect for an image while keeping its continuous range of tones. Use the lContrast parameter to control the amount of the midtones in the image.

Use the ColorHalfTone to create an enlarged halftone screen for each image channel. The filter divides the image into rectangles and replaces each rectangle with circles, one for each channel. The size of each circle is proportional to the brightness of the rectangle, which it is replacing.

Use the HalfTone method to convert a 1-, 4-, 8-, 16-, 24-, or 32-bit bitmap 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.

Use the GrayScaleExt method to convert any bitmap to a gray scale bitmap without changing its resolution.

As an example, if you use the following image:

And you were to call the HalfTonePattern method using the following settings:

Parameter | Value
lContrast | 1
lRipple | 20000
lAngleContrast | na
lAngleRipple | na
lAngleOffset | na
crForeGround | Black
crBackGround | White
Flags | HTPATTERN_DOT

The following figure results:

As another example, if you were to use the same original bitmap but call HalfTonePattern using the following settings:

Parameter | Value
lContrast | 75
lRipple | 20000
lAngleContrast | 85
lAngleRipple | 4
lAngleOffset | 54
crForeGround | White
crBackGround | Brown
Flags | HTPATTERN_CIRCLE

The following figure results:

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, GrayScaleExt method, AutoColorLevel method, ColorLevel method, Correlation method, GrayScaleToDuotone method, GrayScaleToMultitone method, HolesRemovalBitmapRgn method, SelectiveColor method, Skeleton method, HalfTone method, Pointillist method, ColorHalfTone method, ColorSeparate method, ColorMerge method, Desaturate method, GetBitmapStatisticsInfo method, GetHistogram method, GetColorCount method, GetMinMaxBits method, GetMinMaxVal method, ConvertToColoredGray method, ColorizeGrayBitmap method, BitmapAlpha property, ShiftData method, SelectData method, GetHistogramGray method, IsGrayScale property, WindowLevel method, WindowLevelFillLUT method
Topics: | Raster Images: Doing Color Expansion or Reduction.
 | Raster Images: Filtering Images


HighPassFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short HighPassFilter(ILEADRaster * pRaster, long lRadius, long lOpacity)
Overview | Refer to Removing Noise.

Remarks

(Raster Pro and above only) Removes low frequency details in a bitmap, resulting in a sharpened image.

This filter removes low-frequency detail in the bitmap. The effect is opposite to that of the Gaussian Blur filter (GaussianFilter method).

To increase the thickness of the edges, increase the value of lRadius. Usually a low value for lRadius is better.

Unlike the UnsharpMask method, when using this method the low frequency features are removed from the image.

As an example, if you use the following image:

And you were to call HalfTonePattern using the following settings:

Parameter | Value
lRadius | 6
lOpacity | 100

The following figure results:

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen method, Posterize method, Mosaic method, Emboss method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, Solarize method, WindowLevel method, UnsharpMask method, GaussianFilter method.
Topics: | Raster Images: Filtering Images.


HistoContrast method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HistoContrast (ILEADRaster *pRaster, short iChange);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Increases or decreases the contrast of the image in a bitmap, using a histogram to determine the median brightness.

This method finds the median brightness of the image; then brightens the pixels with values above the median and darkens the pixels with values below the median. This is more sophisticated (but slower) than the Contrast method, which uses the middle possible value (128) rather than finding the actual median.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoEqualize method, StretchIntensity method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Using Histograms
 | Raster Images: Where the Region Preempts the Bitmap


HistoEqualize method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HistoEqualize (ILEADRaster *pRaster, ColorSpaceConstants Flags);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Linearizes the number of pixels in the bitmap, based on the specified color space. This can be used to bring out the detail in dark areas of an image.

Previously, this method only equalized the number of pixels per gray level, using a gray level representation of the image. This functionality is now obtained by passing GRAY_SPACE for Flags.

For the best results, set Flags to YUV_SPACE.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Using Histograms
 | Raster Images: Where the Region Preempts the Bitmap


HolePunchRemove method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short HolePunchRemove (ILEADRaster *pRaster, HolePunchRemoveFlags Flags, long iMinHoleCount, long iMaxHoleCount, long iMinHoleWidth, long iMinHoleHeight, long iMaxHoleWidth, long iMaxHoleHeight, HolePunchRemoveConstants Location);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This method detects and removes hole punches, common in scanned documents.

This method works only on 1-bit black and white images.

Hole punch configurations may consist of 2 or more holes.

If a region is selected, only the selected region will be changed by this method. If no region is selected, the whole image will be processed.

The behavior of this method can be modified using the HolePunchRemove event.

This method triggers both the HolePunchRemove event and the ProgressStatus event.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | HolePunchRemove event
Topics: | Raster Images: Cleaning - up 1-Bit Images


HolesRemovalBitmapRgn method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short HolesRemovalBitmapRgn (ILEADRaster *pRaster);
Overview | Refer to Creating and Using a Bitmap Region

Remarks

(Document/Medical only) Removes all the holes in a region.

This method is designed to work on bitmaps that have a region. It removes the holes from the bitmap’s region. If this method is used with a bitmap that does not have a region, the "Invalid Parameter" error is returned.

This method supports signed data images.

See Also

Elements: | Combine IntensityDetect, Sharpen, SpatialFilter, EdgeDetector, GlowFilter, Correlation
Topics: | Raster Image Functions: Creating and Using a Region


HSV_HfromRGB method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HSV_HfromRGB (OLE_COLOR cr);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Returns the corresponding Hue of a standard Windows COLORREF (OLE_COLOR).

Traditionally, hue ranges from 0 to 359. For HSV_HfromRGB, the range of 0 to 359 is remapped to a range of 0..255. For example,

Color | Hue(0..359) | Hue(0..255)
Red | 0 | 0
Green | 120 | 85
Blue | 240 | 170

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette, which holds the color value. You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes as Color Values. Please note that just because an image has a palette, does not mean the value returned by this property is a palette index.

See Also

Elements: | HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Doing Color Space Conversions
 | Using Color Values in LEADTOOLS
 | Creating and Using a Bitmap Region


HSV_SfromRGB method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HSV_SfromRGB (OLE_COLOR cr);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Returns the corresponding Saturation (S) of a standard Windows COLORREF (OLE_COLOR).

Saturation is the amount of "white" in a color. A saturation of 0 contains the most white and a saturation of 255 contains no white.

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette, which holds the color value. You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes as Color Values. Please note that just because an image has a palette, does not mean the value returned by this property is a palette index.

See Also

Elements: | HSV_HfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Doing Color Space Conversions
 | Using Color Values in LEADTOOLS
 | Creating and Using a Bitmap Region


HSV_VfromRGB method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HSV_VfromRGB (OLE_COLOR cr);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Returns the corresponding Value (V) of a standard Windows COLORREF (OLE_COLOR).

Value is the amount of "black" in a color. A Value of 0 contains the most black and a Value of 255 contains the least black.

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette, which holds the color value. You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes as Color Values. Please note that just because an image has a palette, does not mean the value returned by this property is a palette index.

See Also

Elements: | HSV_HfromRGB method, HSV_SfromRGB method, RGBfromHSV method
Topics: | Raster Images: Doing Color Space Conversions
 | Using Color Values in LEADTOOLS
 | Creating and Using a Bitmap Region


Hue method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Hue (ILEADRaster *pRaster, short iAngle);
Overview | Refer to Correcting Colors.

Remarks

Changes the hue of colors in the bitmap by rotating the color wheel.

This method can rotate the color wheel in either direction. A 180-degree rotation in either direction changes each color to its complement. Positive rotation takes red toward green, green toward blue, and blue toward red. Negative rotation has the opposite effect.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Saturation method, Invert method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


Impressionist method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Impressionist (ILEADRaster *pRaster, short iHorzDim, short iVertDim);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Makes a bitmap look like it was painted by an impressionist painter.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, ShowCylindricalDlg method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


InitFourierTransformation Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InitFourierTransformation (ILEADRaster* pRaster)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Initializes the Fourier Transform coefficients for the specified object.

This method is used only when you are dealing with Fourier Transformation methods.

When you are finished, you should call the FreeFourierTransformation method.

See Also

Elements: | DiscreteFourierTransformation method, FastFourierTransformation method, FreeFourierTransformation method, FrequencyFilter method, FrequencyFilterMask method, DisplayFourierTransformation method
Topics: | Raster Images: Fourier Transform Functions


Intensity method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Intensity (ILEADRaster *pRaster, short iChange);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Changes the intensity (brightness) of the bitmap.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | GammaCorrect method, Contrast method, HistoContrast method, HistoEqualize method, StretchIntensity method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


IntensityDetect method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short IntensityDetect (ILEADRaster *pRaster, short iLow, short iHigh, OLE_COLOR crIn, OLE_COLOR crOut, short iChannel);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

Applies binary segmentation to a bitmap by filtering the specified bitmap to detect colors in a specified intensity range, in the specified color channel(s).

The image is divided into two parts inner and outer according to the values of iLow and iHigh.

The method can process 2 or more channels at a time by OR-ing two or more flags.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Filtering Images
 | Using Color Values in LEADTOOLS
 | Raster Images: Where the Region Preempts the Bitmap


Invert method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Invert (ILEADRaster *pRaster);
Overview | Refer to Correcting Colors.

Remarks

Inverts the colors in the bitmap, making it like a photographic negative.

This method can also be used to invert the color of a 1-bit bitmap, making the black white and the white black.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Hue method, Saturation method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


InvertedText method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short InvertedText (ILEADRaster *pRaster, InvertedTextFlags Flags, long iMinInvertWidth, long iMinInvertHeight, long iMinBlackPercent, long iMaxBlackPercent);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Finds and inverts areas of inverted text in a 1-bit black and white image.

Inverted text is commonly found in scanned text documents.

Below is an example of inverted text often found in scanned images:

Inverting the area of inverted text yields:

This method works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this method. If no region is selected, the whole image will be processed.

The behavior of this method can be modified by using the InvertedText event.

This method triggers both the InvertedText event and the ProgressStatus event.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | InvertedText event
Topics: | Raster Images: Cleaning - up 1-Bit Images


IsRegistrationMark method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short IsRegistrationMark (ILEADRaster *pRaster, MarkTypeConstants Type, long lMinScale, long lMaxScale, long lWidth, long lHeight);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Determines whether the object inside the bitmap is a registration mark.

This method verifies whether the object inside the bitmap is a registration mark. The object must be white and the background be black. Objects that are not white will not be detected. The bitmap must have only one object inside it in order to work properly.

Currently, there is only one Type defined, a T-shaped figure as shown in the following figure. This type is a "T" rotated by 90 degrees counter clockwise. The P4 point must be on the center point of Line P1P2 (that is, the distance from P1 to P4 equals the distance from P2 to P4). The line width should be greater than 2 pixels(preferably 3 pixels). There are no condition on line lengths since you provide the values for lWidth, lHeight, lMaxScale, and ulMinScale.

Do not use this method to search for registration marks inside a bitmap. Use SearchRegMarks method instead.

If you simply want to automatically straighten a bitmap, use the Deskew method.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine method, Rotate method, Size method, Deskew method, ApplyTransformationParameters method, GetTransformationParameters method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, YTranslation property, TransformationAngle property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


LensFlare method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LensFlare (ILEADRaster *pRaster, short CenterX, short CenterY, short iBright, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Simulates the secondary reflections caused when bright lights are facing the camera lens. The lens flare is refracted into a series of lightened circles that surround the flare.

Secondary reflections are caused when bright lights are facing the camera lens. These reflections can show up as spots or banding. The method adds this effect to the bitmap by controlling their number, position, brightness and size of the spots or banding. Each lens type has its own spot distribution and ray thickness.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the method:

CenterX, CenterY = (150, 162);
iBright = 100;
lFlags = LNS_TYPE_1;
crColor = RGB(255,128,0);

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, Dry method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


Light method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Light (ILEADRaster *pRaster, short iCenterX, short iCenterY, short iWidth, short iHeight, long lAngle, short iBright, short iEdge, OLE_COLOR crFill, short iOpacity, short iLightNo, short iImageBright, short iAmbient, OLE_COLOR crAmbient, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Adds many spots of directed light sources to the bitmap.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the method:

iCenterX, iCenterY = (bitmap
 width/2, bitmap height/2);
iWidth = bitmap width;
iHeight = bitmap width * 4/3;
lAngle = 13500;
iBright = 100;
iEdge = 75;
crFill = RGB(0,0,255);
iOpacity = 100;
lFlag = LGT_SPOTLIGHT;
iLightNo = 1;
iImageBright = 100;
iAmbient = 100;
crAmbientClr = RGB(255,255,0);

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Dry method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Modifying Intensity Values
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Artistic Effects


LightControl method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LightControl (ILEADRaster *pRaster, long lFlags);
Overview | Refer to Changing Brightness and Contrast

Remarks

Lightens or darkens all or part of a bitmap by remapping the pixel values.

This method remaps the pixel values of the bitmap across the full range of available pixel values, in order to achieve the values set in the LightLowerAvr, LightAvr and LightUpperAvr properties.

For example, call this function for a grayscale bitmap, with LightAvr containing 150, LightLowerAvr containing 100 and LightUpperAvr containing 190. The pixels of the bitmap will be remapped so that the new average pixel value for the entire bitmap will be 150, the new average value for those pixels with a value between 0 and the average value for the entire bitmap will be 100, and the new average value for those pixels with a value between the average value for the entire bitmap and the maximum pixel value in the bitmap will be 190.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

LightLowerAvr = 100

LightAvr = 255

LightUpperAvr = 255

lFlags = YUV_SPACE

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | LightUpperAvr property, LightLowerAvr property, LightAvr property
Topics: | Raster Image Functions: Modifying Intensity Values


LineProfile method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LineProfile(ILEADRaster *pRaster, long xStart, long yStart, long xEnd, long yEnd);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Updates the LineProfileRed, LineProfileGreen and LineProfileBlue properties with the R, G and B profile for each pixel in the specified line.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Pixel property, LineProfileRed property, LineProfileGreen property, LineProfileBlue property, LineProfileSize property
Topics: | Raster Images: Getting Current Information


LineRemove method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short LineRemove (ILEADRaster *pRaster, LineRemoveFlags Flags, long iMinLineLength, long iMaxLineWidth, long iWall, long iMaxWallPercent, long iGapLength, long iVariance, LineRemoveConstants LineRemove);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Removes horizontal and vertical lines in a 1-bit black and white image.

This method removes horizontal and vertical lines from scanned text documents. If the lines pass through text, the parameters can be set to remove or preserve the text.

This method works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this method. If no region is selected, the whole image will be processed.

The behavior of this method can be further modified by using the LineRemove event.

To "fine-tune" the performance of this method, try modifying the values for iWall, iGapLength and iVariance.

This method triggers both the LineRemove event and the ProgressStatus event.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | LineRemove event
Topics: | Raster Images: Cleaning - up 1-Bit Images


LocalHistoEqualize method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short LocalHistoEqualize (ILEADRaster *pRaster, short iWidth, short iHeight, short ixExt, short iyExt, short iType, short iSmooth);
Overview | Refer to Changing Brightness and Contrast

Remarks

(Medical only) Linearizes the number of pixels locally in a bitmap, based on the specified color space. This can be used to bring out the detail in dark areas of an image, and smooth the edges between blocks.

This method applies the histogram equalizer locally on the image. The image is divided into local rectangles of dimension (iWidth ,iHeight). The number of pixels inside each local rectangle are linearized according the histogram calculated for an extended rectangle around each local rectangle. The extended rectangles are of dimension

((iWidth+2 * ixExt) , ( iHeight + 2 * iyExt)).

For an example, see the following drawing:

Use this method to bring out details in an image that has portions that are too dark or too bright. An example of this is a picture taken with a flashlight in a dark room. In such a picture, the subject receives good light while the background is very dark. The application of the local histogram brings out details, but creates a blocky artifact. Use iSmooth to reduce the blockiness of the result.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Hue method, Saturation method, Fill method, GetHistogram method, Pixel property, ShowLocalHistoEqualizeDlg method
Topics: | Raster Images: Modifying Intensity Values


MaskConvolution method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MaskConvolution(ILEADRaster * pRaster, long lAngle, long lDepth, long lHeight, MaskConvolutionConstants Flags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Applies various 3d effects to a bitmap.

If the Flags parameter is set to MSKC_EDGE, the results are the same for opposite angles. For example, angles 0 and 180 have the same result when used with the edge detection mask.

When an image undergoes image convolution each pixel of the image, is multiplied by a mask to create a new pixel value. The mask is an array of values that describes the weight that should be given to each of the pixels surrounding a specific pixel. The new pixel value is the result of the mask sum being divided by the mask weight. Using different masks result in different alterations of the image. The masks used in this method result in different types of edge detection.

As an example of the different masks, consider the following example:

To obtain these bitmaps, the following settings were used:

Parameter | Emboss | Edge | Esplotch | Splotch
lAngle | 0 | 0 | 180 | 0
lDepth | 3 | 3 | 3 | 3
lHeight | 250 | 250 | 100 | 100

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | PlasmaFilter method, Emboss method, Sharpen method, Posterize method, Mosaic method, Average method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, AddShadow method, RevEffect method, Aging method, DiceEffect method, FunctionalLight method, PuzzleEffect method, RingEffect method, TextureAlphaBlend method
Topics: | Raster Images: Filtering Images


MathFunction Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MathFunction(ILEADRaster* pRaster, ManipulationConstants Type, long lFactor)
Overview | Refer to Changing Brightness and Contrast

Remarks

Re-maps the image colors according to a mathematical function such as: square, log, square root, sine and cosine.

This method uses the RGB color space.

This method makes it possible to apply one of five mathematical functions to a bitmap’s pixel values: square, square root, log, sine and cosine.

Select the mathematical operation to be performed on each pixel’s values with the Type parameter. The resulting values are multiplied by the factor lFactor. The lFactor parameter can be any value greater than 0. It is divided internally by different amounts, according to the type of the function being used.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddBitmaps method, Combine method, AddShadow method, HueSaturationIntensity method, ColorReplace method, DirectionEdgeStatistical method, GetBitmapStatisticsInfo method, GetObjectInfo method, RevEffect method, Segment method, SubtractBackground method, UserFilter method
Topics: | Raster Images: Modifying Intensity Values


MaxFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MaxFilter (short iDim);
Overview | Refer to Removing Noise.

Remarks

(Document/Medical only) Erodes dark objects by the specified amount.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The effect can be controlled by specifying the size of the neighborhood that is used for calculating each pixel value. For example, for 8x8, pass 8 in the iDim parameter. Each pixel is replaced with the maximum value of its neighborhood.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MinFilter method, BinaryFilter method
Topics: | Raster Images: Filtering Images


Median method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Median (ILEADRaster *pRaster, short iDim);
Overview | Refer to Removing Noise.

Remarks

Changes the color of each pixel in the bitmap to the median color of pixels in its neighborhood. This is similar to the Average method, but it is used for noise reduction, rather than a blur effect.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

You control the effect by specifying the size of the neighborhood that is used for calculating the median value. For 8x8, pass 8 in the iDim parameter.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


MinFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MinFilter (short iDim);
Overview | Refer to Removing Noise.

Remarks

(Document/Medical only) Dilates dark objects by the specified amount.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The effect can be controlled by specifying the size of the neighborhood that is used for calculating each pixel value. For example, for 8x8, pass 8 in the iDim parameter. Each pixel is replaced with the minimum value of its neighborhood.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MaxFilter method, BinaryFilter method
Topics: | Raster Images: Filtering Images


Mosaic method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Mosaic (ILEADRaster *pRaster, short iDim);
Overview | Refer to Applying Artistic Effects.

Remarks

Imposes a mosaic effect on the bitmap by dividing the bitmap into tiles of a specified size and changing the color of all pixels in each tile to the average color of pixels within the tile.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


MosaicTiles method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | HRESULT MosaicTiles(ILEADRaster * pRaster, long lOpacity, long lPenWidth, long lTileWidth, long lTileHeight, long lCenterX, long lCenterY, long lFlags, ShadowDirectionConstants ShadowAngle, long lShadowThreshold, OLE_COLOR crBorderColor, OLE_COLOR crTilesColor);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Creates a mosaic effect on an image by dividing an image into rectangular or arc-shaped cells with irregular boundaries and modifying the color of each cell.

This method makes an image look like a mosaic made from tiles. Tiles can be rectangular or arc-shaped, depending upon the coordinate system used to draw the tiles. The method's many parameters control factors like the border color, tile color, pen width, tile width and height, etc.

As an example, if you start with the following image:

And you were to call the MosaicTiles method using the following settings:

Parameter | Value
lOpacity | 60
lPenWidth | 4
lTileWidth | 17
lTileHeight | 17
lCenterX | na
lCenterY | na
ShadowAngle | na
lShadowThreshold | na
crBorderColor | Black
crTilesColor | na
lFlags | MSCT_CART | MSCT_FLAT

The following figure results:

Use the Mosaic method to impose a mosaic effect on a bitmap by dividing the bitmap into square blocks of a specified size and changing the color of all pixels in each block to the average color of pixels within the block.

Use the Pixelate method to divide the bitmap into rectangular or arc-shaped cells and then recreate the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.

Use the RomanMosaic method to divide the bitmap into rectangular or arc-shaped cells and then fill them with a color chosen randomly from the colors of the tile’s pixels.

Use the Pointillist method to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Pixelate method, Pointillist method, MosaicTiles method, RomanMosaic method, DiceEffect method, PuzzleEffect method, RingEffect method, Canvas method, BricksTexture method.
Topics: | Raster Images: Doing Geometric Transformations.


MotionBlur method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MotionBlur(ILEADRaster *pRaster, short iDim, long lAngle, VARIANT_BOOL bUnidirectional);
Overview | Refer to Applying Artistic Effects.

Remarks

Applies a filter, which creates the illusion of movement in an image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen method, Posterize method, Mosaic method, Emboss method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method
Topics: | Raster Images: Filtering Images


Multiply method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Multiply (ILEADRaster *pRaster, short iFactor);
Overview | Refer to Changing Brightness and Contrast

Remarks

Increases or decreases the brightness in the bitmap by multiplying the colors in the specified bitmap by a value equal to the iFactor value divided by 100.

This method is used to increase or decrease the brightness in the bitmap by multiplying the colors in the specified bitmap by a value equal to the iFactor value divided by 100. For example, if iFactor is 131, the colors in the specified bitmap will be multiplied by 1.31.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Hue method, Saturation method, Fill method, HistoEqualize method, GetHistogram method, Pixel property, ShowMultiplyDlg method
Topics: | Raster Images: Modifying Intensity Values


MultiScaleEnhancement method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MultiScaleEnhancement (ILEADRaster *pRaster, long lContrast, long lEdgeLevels, long lEdgeCoeff, long lLatitudeLevels, long lLatitudeCoeff, long lFlags);
Overview | Refer to Changing Brightness and Contrast

Remarks

(Medical only) Enhances an image’s contrast, edges, and density range for use in Computed Radiography (CR), in a way that all relevant image features are rendered with an appropriate level of visibility.

The method wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).

In multi scale enhancement, the image is decomposed into components or levels. Those components or levels that contain details will be enhanced separately from other components or levels.

This will improve the visualization for the subtle image features without the risk of losing information of other features.

The method will consider values larger than 10000 for lContrast as if they were 10000. If the user passed 0 then image contrast will not be improved.

Best results are obtained if lContrast is in the range of 15% ~ 30%. The larger the value the stronger the enhancement will be. Any stronger enhancement than 30% will reveal noise and no new enhancement will be noticed.

The user can further enhance the image with:

edge enhancements (use MSE_EDGEENH) and/or

latitude reduction (use MSE_LATRED)

The lEdgeLevels, lEdgeCoeff, lLatitudeLevels and lLatitudeCoeff parameters are available for advanced users. Setting MSE_DEFAULT in lFlags gives the maximum enhancements. MSE_DEFAULT is defined as (L_UINT)–1

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits. It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, StretchIntensity method, RemapIntensity method, Invert method, Hue method, Saturation method, HistoEqualize method, Fill method, GetHistogram method, WindowLevel method, HistoContrast method
Topics: | Raster Images: Modifying Intensity Values


Offset method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Offset(ILEADRaster * pRaster, long lHorizontalShift, long lVerticalShift, OLE_COLOR crBackColor, OffsetConstants Flags);
Overview | Refer to Combining Images.

Remarks

Shifts the bitmap pixels horizontally and vertically.

Use the OffsetRgn method to move a bitmap region by the specified number of rows and columns.

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Emboss method, AddShadow method, HueSaturationIntensity method, ColorReplace method, ColorThreshold method, DirectionEdgeStatistical method, GetBitmapStatisticsInfo method, GetFeretsDiameter method, GetObjectInfo method, GetRgnContourPoints method, GetRgnPerimeterLength method, MathFunction method, Segment method, SubtractBackground method, UserFilter method, OffsetRgn method.
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Artistic Effects


Ocean method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Ocean (ILEADRaster *pRaster, short iAmplitude, short iFrequency, VARIANT_BOOL bLowerTrnsp);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits.) Reflects the bitmap on an ocean surface.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

iAmplitude=15
iFrequency=20
bLowerTrnsp=TRUE

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Dry method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects


Oilify method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Oilify (ILEADRaster *pRaster, short iDim);
Overview | Refer to Applying Artistic Effects.

Remarks

Applies an oil-painting effect to the bitmap.

You control the effect by specifying the size of the neighborhood that is used for calculating the pixel value. For example, for 8x8, pass 8 in the iDim parameter. You increase the size of the neighborhood in order to decrease the amount of detail in the resulting image.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics:

Raster Images: Filtering Images


Perlin method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Perlin(ILEADRaster * pRaster, long lSeed, long lFrequency, long lDensity, long lOpacity, OLE_COLOR crBackColor, OLE_COLOR crPerlinColor, long lxCircle, long lyCircle, long lFreqLayout, long lDenLayout, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture.

This texture depends on the flags that are set. The texture can be saved as a bitmap by itself, or the texture can be combined with another bitmap. For more information, refer to Using the Perlin method.

This method is similar to the Clouds method in that they both use Perlin equations to generate pseudo-random noise, but each method applies different equations to the noise to produce the texture.

Use the AddNoise method in order to add random noise to a bitmap.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64 bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Sharpen method, Posterize method, Mosaic method, Emboss method, Average method, Median method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, AddShadow method, RevEffect method, Aging method, DiceEffect method, FunctionalLight method, PuzzleEffect method, RingEffect method, TextureAlphaBlend method
Topics: | Raster Images: Filtering Images.


Perspective method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Perspective(ILEADRaster * pRaster, OLE_COLOR crBkgColor, PerspectiveConstants Flags)
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Raster Pro and above only) Gives a bitmap a 3-D effect, as if it exists on a flat plane and has been skewed into a different shape.

The new locations for the image corners should keep the relative relation between corners. For example, the point at index 1 should be to the right of point at index 0 and above the point at index 3. Also, the point at index 2 should be to the left of the point at index 3 and below the point at index 0 and so on. All new locations should remain inside the image.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | PerspectivePointsX property, PerspectivePointsY property, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Spherize method
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images.


Picturize method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Picturize (ILEADRaster *pRaster, BSTR pszDirectory, PicturizeConstants Flags. float fCellWidth, float fCellHeight);
Overview | Refer to Combining Images.

Remarks

Replaces the current image with an image created from images contained in the specified directory. The image, or selected region, is broken down into rectangles of size fCellWidth x fCellHeight. For each rectangle, the image in the directory that is best suited to replace that rectangle is inserted into the original image.

The quality of the result is controlled by three factors:

1. the number of images present in the directory (the more images, the better).

2. the size of the rectangles. Smaller rectangles create an image that more closely resembles the original.

3. the type of images being replaced. If you are replacing a small image with lots of detail, then you will need lots of images in the directory in order to create an image that closely resembles the original.

PICTURIZE_ONCE and PICTURIZE_EQUALUSAGE flags cannot be combined in the iFlags parameter.

If PICTURIZE_BESTFIT is set, then fCellWidth and fCellHeight are used as a starting point for the actual cell size. The cell sizes are modified so that the size of the last rectangle in a row or column differs from the other rectangles by one. Note that the cell width and height are chosen to be smaller than fCellWidth and fCellHeight. For example, if the bitmap is 101x131 and you pass 32 for the cell width and height and set PICTURIZE_BESTFIT, then the actual cell size will be 25x32. The widths of the cells will be 26, 25, 25, 25 (for a total of 101). The heights of the rows will be 33, 33, 33, 32 (for a total of 131). This option should be used if the bitmap width and height are not multiples of fCellWidth and fCellHeight.

If the bitmap width and height are not multiples of fCellWidth and fCellHeight and PICTURIZE_BESTFIT is not passed, then the last rectangle in a row or column might be very small. Using the example given above, if PICTURIZE_BESTFIT is not set, the widths of the cells would be 32, 32, 32, 5 and the heights would be 32, 32, 32, 32, 3.

PICTURIZE_EQUALUSAGE and PICTURIZE_ONCE will reduce the number of times a bitmap is used by this method.

When PICTURIZE_ONCE is set, the method will try not to use the same bitmap twice. Note that if there aren’t enough images, the method will return the ERROR_NOT_ENOUGH_IMAGES code if this flag is set.

When PICTURIZE_EQUALUSAGE is set, the method will use the same image more than once only if it is necessary to successfully complete the picturize process. If PICTURIZE_EQUALUSAGE is set, then for any bitmap, the number of times it is used differs from the number of times another bitmap is used by at most one. Therefore, most bitmaps will be used ‘n’ times, but some bitmaps will be used ‘n+1’ times.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Combining Images
 | Examining and Altering Bitmaps


PicturizeBitmapList method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PicturizeBitmapList(ILEADRaster *pRasterDst, short iCellWidth, short iCellHeight, short iLightnessFact, ILEADRaster *pRasterList);
Overview | Refer to Combining Images.

Remarks

Picturizes the bitmap using thumbnail images created from the specified bitmap list.

The image, or selected region, is broken down into rectangles of size iCellWidth x iCellHeight. For each rectangle, the image in the list that best approximates that rectangle is inserted in the original image. The thumbnail image may be corrected, to approximate a rectangle.

The iLightnessFact parameter can be used to change the lightness of the big image by changing the lightness of each rectangle.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Picturize method, PicturizeSingle method
Topics: | Raster Images: Combining Images
 | Examining and Altering Bitmaps


PicturizeSingle method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PicturizeSingle(ILEADRaster *pRasterDst, ILEADRaster *pRasterThumb, short iCellWidth, short iCellHeight, short iLightnessFact);
Overview | Refer to Combining Images.

Remarks

Picturizes the bitmap using the specified thumbnail image.

The image, or selected region, is broken down into rectangles of size iCellWidth x iCellHeight. For each rectangle, the thumbnail image is corrected to approximate that rectangle, and inserted in the original image. Note that every rectangle is replaced by the same image.

The iLightnessFact parameter can be used to change the lightness of the big image by changing the lightness of each rectangle.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Picturize method, PicturizeBitmapList method
Topics: | Raster Images: Combining Images
 | Examining and Altering Bitmaps


Pixelate method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Pixelate (LEADRaster *pRaster, short iCellWidth, short iCellHeight, short iOpacity, short CenterX, short CenterY, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Divides the bitmap into rectangular or circular cells and then recreates the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.

This method will divide the image into rectangular or circular cells.

The lFlags parameter indicates whether to use rectangular or circular cells and indicates the type of information in the other parameters.

If the image is divided into circular cells by setting PIX_RAD in the lFlags parameter, the cells will be centered around the specified CenterX,CenterY. This center point must be defined inside the bitmap or inside the region, if the bitmap has a region. If the bitmap has a region, the effect will be applied on the region only.

If lFlags contains: | then, iCellWidth contains: | and the range of possible values for iCellWidth is:
PIX_RAD | PIX_WFRQ | the number of cells around the CenterX,CenterY point. That is, the circle around the CenterX,CenterY is divided into iCellWidth equal parts. | 1 to 360. The circle can be divided into anywhere from 1 to 360 equal parts.
PIX_RAD | PIX_WPER | the size, in degrees of the cells around the CenterX,CenterY. That is, the circle around the CenterX,CenterY is divided into cells of oCellWidth degrees | 1 to 360. The circle can be divided into cells of 1 degree to 360 degrees.
PIX_RECT | PIX_WFRQ | the number of cells present across the width of the bitmap | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width.
PIX_RECT | PIX_WPER | the width of each rectangular cell, in pixels | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width.

If lFlags contains: | then, iCellHeight contains: | and the range of possible values for iCellHeight is:
PIX_RAD | PIX_HFRQ | the number of cells present along the radius of the circular cell. | 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle.
PIX_RAD | PIX_HPER | the radial length of each circular cell, in pixels | 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle.
PIX_RECT | PIX_HFRQ | the number of cells present across the height of the bitmap | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height.
PIX_RECT | PIX_HPER | the height of each rectangular cell, in pixels | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

An example of circular cell division can be seen below:

This is the original image:

The image below is the result of the following settings:

lFlags = PIX_RAD | PIX_WPER | PIX_HPER | PIX_AVR

iCellWidth = 90, iCellHeight = 40

This indicates the circular cells are divided into 90 degree cell divisions and each cell has a radial length of 40 pixels. Each cell division is filled with the average value for that cell division.

The image below is the result of the following settings:

PIX_RAD|PIX_WFRQ|PIX_HFRQ|PIX_AVR

iCellWidth = 90, iCellHeight = 40

This indicates the circular cells are divided into 90 separate cell divisions around the center point and there are 40 cell divisions along the radius. Each cell division is filled with the average value for that cell division.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


Plane method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Plane (ILEADRaster *pRaster, short CenterX, short CenterY, short iZValue, short iDistance, short iPlaneOffset, short iRepeat, long lPydAngle, short iStretch, short iStartBright, short iEndBright, short iBrightLength, OLE_COLOR crBright, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Places the bitmap on parallel planes along the Z-axis.

This method shows the effect of placing bitmaps on planes along the Z-axis. These bitmaps may be placed above, below, to the left or to the right of the Z-axis. An external light source of the specified color and brightness may be shined on the bitmaps. The brightness may vary along the z-axis according to the iBrightLength value.

By changing CenterX, CenterY and the viewing screen Z-offset, you can simulate moving along the axis.

If the bitmap has a region, the effect will be applied on the region dimensions only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

CenterX, CanterY= (320,256)

iZValue = 0

iDistance= 256

iPlaneOffset= 256

iRepeat= -1

lPydAngle= 0

iStretch= 100

iStartBright= 0

iEndBright= 0

iBrightLength= 50

crBright= RGB(255,255,255)

crFill= RGB(0,0,0)

lFlags= PLANE_FILL_CLR|PLANE_DOWN

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Dry method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Artisitic Effects


PlaneBend method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short PlaneBend (ILEADRaster *pRaster, short CenterX, short CenterY, short iZValue, short iDistance, short iPlaneOffset, short iRepeat, long lPydAngle, short iStretch, short iBendFactor, short iStartBright, short iEndBright, short iBrightLength, OLE_COLOR crBright, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Places the bitmap on parallel planes along the Z-axis, and bends the planes toward the center point.

This method shows the effect of placing bitmaps on planes along the Z-axis and bending them toward a specific point. These bitmaps may be placed above, below, to the left or to the right of the Z-axis. An external light source of the specified color and brightness may be shined on the bitmaps. The brightness may vary along the z-axis according to the iBrightLength value. The line of bitmaps may be bent toward a specified point by setting a bending value in the iBendFactor parameter.

By changing CenterX, CenterY and the viewing screen Z-offset, you can simulate moving along the axis.

If the bitmap has a region, the effect will be applied on the region dimensions only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

(CenterX,CenterY)= (640,256)

iZValue = 0

iDistance= 256

iPlaneOffset= 256

iRepeat= -1

lPydAngle= 0

iStretch= 100

iBendFactor= 500

iStartBright= 0

iEndBright= 0

iBrightLength= 50

crBright= RGB(255,255,255)

crFill= RGB(0,0,0)

lFlags= PLANE_FILL_CLR|PLANE_DOWN

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, Dry method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Artisitic Effects


PlasmaFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short PlasmaFilter(ILEADRaster * pRaster, long lRedFreq, long lGreenFreq, long lBlueFreq, long lOpacity, long lShift, long lSize, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Applies color patterns that blend into each other like plasma.

As an example, suppose you call the PlasmaFilter method, using a lOpacity value of 0, which means that no image is to be used, and you use the following settings:

Parameter | Value
lShift | 0
lOpacity | 0
lSize | 1000
lFlags | PLSM_RANDOM1 | COLOR_MIX2

The following figure results:

The lOpacity value will always be considered to be 0, unless specified otherwise by a value between (and including) 0 and 100.

Use the lRedFreq, lGreenFreq, and lBlueFreq paramters to create a custom color pattern. To use them, pass the PLSCLR_CUST flag to PlasmaFilter. Otherwise, their values will be ignored.

The PLSCLR_HUE value is a predefined color pattern that is based on the HLS color space. It creates plasma patterns by changing hue values.

The PLSCLR_RGB1 value is a predefined color pattern that is based on the RGB color space. Different combinations of red, green and blue frequencies produce different results.

Like the PLSCLR_RGB1 value, the PLSCLR_RGB2 value is based on the RGB color space, but uses a different combination of red, green and blue frequencies.

The color palette used for lShift is a continuous cylindrical color palette. In the following figures, one shows where on the palette a value of 0 lies, and the other one shows where on the palette the maximum value lies:

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, MaskConvolution method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Pixelate method
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images.


Pointillist method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Pointillist(ILEADRaster * pRaster, long lSize, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Converts image colors into randomly placed dots to create a pointillist painting, and uses the background color to fill the area between dots.

Pointillism is a painting technique where the image is composed of tiny, separate dots of primary color. Non primary colors are created by placing primary colors beside each other and allowing the "mixing" to be performed when the image is viewed.

As an example, if you use the following figure:

And you call Pointillist using the following values:

Parameter | Value
lSize | 4
crColor | Black
lFlags | POINTILLIST_COLOR | POINTILLIST_STICKER

The following figure results:

Use the RomanMosaic method to divide the bitmap into rectangular or arc-shaped cells and then fill each cell with a color chosen randomly from the colors of each tile’s pixels.

Use the Mosaic method to impose a mosaic effect on a bitmap by dividing the bitmap into tiles of a specified size and changing the color of all pixels in each tile to the average color of pixels within the tile.

Use the Pixelate method to divide the bitmap into rectangular or arc-shaped cells and then recreate the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.

Use the MosaicTiles method to make an image look like a mosaic made from tiles. Tiles can be rectangular or arc-shaped, depending upon the coordinate system used to draw the tiles.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | GrayScale method, GrayScaleExt method, AutoColorLevel method, ColorLevel method, Correlation method, GrayScaleToDuotone method, GrayScaleToMultitone method, HolesRemovalBitmapRgn method, SelectiveColor method, Skeleton method, HalfTone method, Mosaic method, Pixelate method, MosaicTiles method, RomanMosaic method, Cubism method, DiceEffect method, GlassEffect method, PuzzleEffect method, RingEffect method, Canvas method, BricksTexture method
Topics: | Raster Images: Doing Color Expansion or Reduction
 | Raster Images: Artistic Effects
 | Raster Images: Filtering Images


Polar method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Polar (ILEADRaster *pRaster, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Converts the bitmap from rectangular to polar coordinates and vice versa.

Rectangular coordinates use the form (x, y) where 'x' and 'y' are the horizontal and vertical distances from the origin, respectively. Polar coordinates are in the form (r, ?) where 'r' is the distance from the origin to the point and '?' is the angle of the line the point makes with the positive x-axis. Polar coordinates use a grid made of concentric circles around the origin, along with lines that are rays radiating outward from the origin.

This method considers the positions of the image's pixels as values in a polar coordinate system. Then it converts all the pixels in a line of the image into a circle around the center of the bitmap.

If there is any region selected on the bitmap, the effect will be applied on the region dimensions only.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


Posterize method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Posterize (ILEADRaster *pRaster, short iLevels);
Overview | Refer to Applying Artistic Effects.

Remarks

Imposes a poster effect on the bitmap by quantizing the bitmap's colors to a specified number of color levels per plane. For example, two levels means two of red, two of green, and two of blue.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


Punch method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Punch (ILEADRaster *pRaster, short iValue, short iStress, short CenterX, short CenterY, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Warps the bitmap by pinching it toward the center or expanding the bitmap away from its center.

This method will punch or pinch the bitmap around the specified CenterX, CenterY coordinates. The CenterX, CenterY point must be defined inside the bitmap or inside the region, if the bitmap has a region.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


PuzzleEffect method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short PuzzleEffect (ILEADRaster *pRaster, long lXBlock,long lYBlock, long lRandomize, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Splits the image into square blocks and randomizes these blocks inside the image.

This method can process the whole image or a region. If a bitmap has a region, the effect is applied only to the region.

Splits the image into a certain number of blocks according to the flags passed to it. If the PUZZLE_SIZE flag is set, then the image will be divided into blocks using the lXBlock and lYBlock parameters for the dimensions of the blocks. If the PUZZLE_COUNT flag is set, then the image will be divided into blocks using the lXBlock and lYBlock parameters for the number of blocks per row and number of blocks per column.

If the BITMAP_RESIZE flag is not set, the edge blocks might have a different size than the inner blocks. This means the edge blocks will be manipulated differently than the inner blocks. The inner blocks that have the same dimensions will be shuffled around. The right edge blocks will be shuffled together and the bottom edge blocks will be shuffled together.

If the BITMAP_RESIZE flag is set, the image will be resized to be sure that all blocks have the same dimensions. In this case, the edge blocks will not be treated differently than the inner blocks.

If the PUZZLE_BORDER flag is set, borders will be drawn with the color passed by the crColor parameter. If this flag is not set, no borders will be drawn.

If the PUZZLE_SHUFFLE flag is not set, the blocks will appear in their original positions. If this flag is set then the blocks will appear randomized. The randomization process will be controlled by the lRandomize parameter as follows:

If lRandomize is set to 0, the method will select the starting point for the randomize process. You will get a different result every time you call the method with lRandomize = 0.

If you set lRandomize to > 0, the method will use this value as a starting point for the randomize process. You will get the same result every time you call the method with the same value of lRandomize > 0.

Edge blocks that have the same size as inner blocks might move into the middle of the resulting image. Edge blocks with a different size than inner blocks will remain on the edge.

You must set PUZZLE_SIZE or PUZZLE_COUNT (but not both) for the method to affect the image. If you pass 0 for lFlags, the method leaves the image unchanged.

This method supports all bits/pixel supported by LEADTOOLS.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Mosaic method, Picturize method, PicturizeBitmapList method, PicturizeSingle method, Pixelate method, DiceEffect method, RingEffect method.
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


RadialBlur method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RadialBlur (LEADRaster *pRaster, short iDim, short iStress, short CenterX, short CenterY);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Blurs the image by rotating the pixels around the specified center point.

The effect will blur the image in a radial form around the specified x,y coordinates. The center point must be defined inside the bitmap or inside the region, if the bitmap has a region.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


RadWave method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RadWave (LEADRaster *pRaster, short iAmplitude, short iWaveLen, long lPhase, short CenterX, short CenterY, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Distorts a bitmap using a wave radiating from the specified center.

The method applies a sinusoidal wave radiating from the specified center. The center point must be define inside the bitmap or inside the region, if the bitmap has a region.

If the bitmap has a region, the effect will be applied on the region only.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


RemapHue method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short RemapHue (ILEADRaster *pRaster, BOOL bUseMaskTable, BOOL bUseHTable, BOOL bUseSTable, BOOL bUseVTable);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Uses a lookup table to change a bitmap's hue values. The saturation and value tables change S and V values only if a particular hue value is marked as non-zero in the MaskTable property

This method can be used to change a range of colors to another range of colors. For example, it could be used to change all red pixels to any color, where a red pixel can have any brightness (V) and any amount of white (saturation). A red pixel in this case would be

RGB(x,y,y) where:
0<=x<255 and
0<=y<x

or in the HSV color space

HSV(0,x,x) where:
0<=x<=255

The MaskTable(i) lookup table identifies which values in the HTable(i) are valid. If a MaskTable(i) value is 0, then the corresponding value in the HTable(i) is ignored. If a MaskTable(i) value is non-zero, then the corresponding value in the HTable(i) is used. For example, if a pixel has a hue value of 240 and MaskTable(240)] is nonzero, then the hue value of 240 is replaced with HTable(240). Traditionally, hue ranges from 0 to 359. For the lookup table, the range of 0 to 359 is remapped to a range of 0..255. For example,

Color | Hue(0..359) | Hue(0..255)
Red | 0 | 0
Green | 120 | 85
Blue | 240 | 170

Use HSV_HfromRGB, HSV_SfromRGB, HSV_VfromRGB, and RGBfromHSV methods to convert between RGB and HSV color space.

Calling this method with bUseMaskTable set to FALSE and bUseSTable set to TRUE will let you change the Saturation of each color. Similarly, calling this method with nUseMaskTable set to FALSE and bUseVTable set to TRUE will let you change the Value of each color.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | MaskTable property, HTable property, STable property, VTable property, HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Modifying Intensity Values


RemapIntensity method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short RemapIntensity (ILEADRaster *pRaster, ChannelConstants Channel);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Uses a lookup table to change the bitmap's intensity values. You can apply the change to red, green, blue, or all color channels.

Use the RemapTable property to maintain the lookup table. Intensity levels range from 0 to 255. Therefore, the lookup table has 256 entries. The current intensity values correspond to the table indexes. The values of the entries are the new values to be applied.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | RemapTable property
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


RemoveRedeye method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RemoveRedeye(ILEADRaster *pRaster, OLE_COLOR rcNewColor, short iThreshold, short iLightness);
Overview | Refer to Applying Artistic Effects.

Remarks

Removes the "red eye" effect in color images by converting the red color in the eye to the new specified color.

This method has no effect on grayscale images, since there is no "red eye" problem in grayscale images.

To use this method the user should select a small region around the eye. Otherwise, the method will change all the red color in the image. This method also allows the user to replace the red color with a new color for the eyes that is nearest to the original color.

This method supports 48 and 64-bit color images. Support for 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | SwapColors method
Topics: | Correcting Colors
 | Raster Images: Modifying Intensity Values
 | Using Color Values in LEADTOOLS
 | Raster Images: Modifying Individual Pixels


ResizeRgn method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ResizeRgn(ILEADRaster *pRaster, short iDim, ResizeRgnConstants iFlag, VARIANT_BOOL bAsFrame);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Resizes the bitmap region by the specified number of pixels.

This method supports signed data images.

See Also

Elements: | Size method
Topics: | Raster Images: Creating and Using a Region


Reverse method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Reverse (ILEADRaster *pRaster);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Reverses the bitmap (left to right) to produce a mirror image.

See Also

Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


RGBfromHSV method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR RGBfromHSV (short nH, short nS, short nV);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Returns a COLORREF that is equivalent to the color represented by the HSV values. Each HSV value ranges from 0..255. Traditionally, hue ranges from 0 to 359. For HSV_HfromRGB, the range of 0 to 359 is remapped to a range of 0..255. For example,

Color | Hue(0..359) | Hue(0..255)
Red | 0 | 0
Green | 120 | 85
Blue | 240 | 170

Saturation entries range from 0 to 255 where

0: | Contains the "most" white
255 | Contains no white

Value entries range from 0 to 255 where

0: | Contains the "most" black
255 | Contains the least black

The standard Windows values for COLORREF(OLE_COLOR) represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette which holds the color value. You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values. Please note that just because an image has a palette, that does not mean the value returned by this property is a palette index.

See Also

Elements: | HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Doing Color Space Conversions
 | Using Color Values in LEADTOOLS
 | Creating and Using a Bitmap Region


RevEffect Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short RevEffect (ILEADRaster* pRaster, long lLineSpace, long lMaxHeight)
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Adds a pseudo-3D wave effect to the bitmap by drawing lines across the bitmap, basing the line’s height at each point on its brightness at that point.

This method adds a pseudo-3D wave effect to the bitmap. It is similar to the Rutt-Etra Video Synthesizer. The Rutt-Etra video synthesizer was a processor that modulated the deflection lines of a television image so that they appeared to adopt the contours of objects. It was invented by Steve Rutt and Bill Etra in the 1970s.

With this method, you set the maximum height to be used for the pixels with the maximum brightness value. The other pixel heights are calculated by linear interpolation. Each line is 1 pixel in width. Control the spacing between the lines that are drawn across the image with the lLineSpace parameter.

You can get a more stable wave by performing either of the following:

Apply any type of blur like GaussianFilter method with a large iRadius value.

Apply the RevEffect method and pass a small value to lMaxHeight.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Emboss method, AddShadow method, InitFourierTransformation method, HueSaturationIntensity method, ColorReplace method, DirectionEdgeStatistical method, MathFunction method, Segment method, SubtractBackground method, UserFilter method
Topics: | Raster Images: Artistic Effects


RingEffect method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RingEffect (ILEADRaster *pRaster, short iXOrigin, short iYOrigin, long lRadius, long lRingCount, long lRandomize, OLE_COLOR crColor, short iAngle, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Divides the image into the specified number of rings. Each ring is rotated according to a rotation angle. The rotation angle for each ring will be chosen randomly by the function or can be passed to the function.

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

The RingEffect method divides the image into a certain number of rings. Each ring is rotated compared to its inner ring according to a rotation angle. The method will pick the rotation angle at random if RING_FIXEDANGLE is not set in lFlags, or will use the angle specified by iAngle if RING_FIXEDANGLE is set in lFlags.

If RING_FIXEDANGLE is not set in lFlags, then the method will pick the rotation angle randomly. The starting point (that is, the "randomization value") for the random number generator is selected through the lRandomize parameter, as follows:

If lRandomize is set to zero then the method will select a random value between 1 and 500 for the randomization value.

If lRandomize is > 0, it will be used for the randomize value. Note that lRandomize should be between 1 and 500 in this case.

Although the numbers generated are random, if you start with the same randomization value you will always get the same sequence of random numbers. This means that if you call the method twice with the same value for lRandomize, you will get the same result.

The center of the rings is determined by the iXOrigin and iYOrigin parameters. The method calculates the width of each ring by dividing the maximum radius (lRadius when lFlags is set to RING_MAXRADIUS) by lRingCount + 1.

The minimum width of each circle is 2. If the result of the division is less than 2, the function will draw lRadius / 2 rings, each ring having a width of 2.

Rings with a large radius might not be completely inside the bitmap. We will refer to these as "incomplete rings". We will refer to a portion of the ring that is outside the bitmap as "undetermined portion". When you rotate an incomplete ring, an undetermined portion of the ring might come into view. The method has 3 ways of specifying the output of the pixels where undetermined portions come into view:

Leave original bitmap pixels unchanged (RING_NOCHANGE is set) or

Repeat edge pixels (RING_REPEAT is set) or

Fill the undefined area with color crColor (RING_COLOR is set).

The determined portion of the ring will always displace the original bitmap pixels.

The image is split into an innermost circle and a number of rings. The innermost circle will not be rotated. Each ring is rotated compared to the inner ring. The rotation angle is as follows:

If RING_FIXEDANGLE is set, each ring will be rotated against its inner ring by iAngle. In other words, each index will be rotated against the original position by iAngle *. (The index is 0-based. The innermost circle is considered to have an index of 0 and will not be rotated).

If RING_FIXEDANGLE is not set, the method will pick random rotation angles for each ring.

The width of the ring is determined as follows:

If RING_RADIUS is set, lRadius is the width of each ring

If RING_MAXRADIUS is set, lRadius will be the maximum ring radius. In this case, the width of each ring will be lRadius / (lRingCount + 1).

This method supports all bits/pixel supported by LEADTOOLS.

But support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Mosaic method, Picturize method, PicturizeBitmapList method, PicturizeSingle method, Pixelate method, Cubism method, DiceEffect method, PuzzleEffect method.
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


Ripple method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Ripple (LEADRaster *pRaster, short iAmplitude, short iFrequency, short iPhase, short iAttenuation, short CenterX, short CenterY, OLE_COLOR crFill, long lFlag);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Warps the image in concentric rings.

This method will warp the image as a series of rings radiating out from CenterX ,CenterY. The center point must be defined inside the bitmap or inside the region, if the bitmap has a region.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


RomanMosaic method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RomanMosaic(ILEADRaster * pRaster, long lTileWidth, long lTileHeight, long lBorder, ShadowDirectionConstants ShadowAngle, long lShadowThresh, OLE_COLOR crColor, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Segments the image into rectangular or rounded rectangular tiles and fills them with a color chosen randomly from the colors of the tile’s pixels.

Use this method to divide the bitmap into rectangular or rounded rectangular tiles and then fill each tile with a color chosen randomly from the colors of each tile’s pixels.

As an example, if you use the following figure:

And you call the RomanMosaic method using the following values:

Parameter | Value
lTileWidth | 2
lTileHeight | 2
lBorder | 20
ShadowAngle | na
lShadowThresh | na
crColor | Black
lFlags | RMN_BOTH | RMN_FLAT

The following figure results:

Use the Mosaic method to impose a mosaic effect on a bitmap by dividing the bitmap into tiles of a specified size and changing the color of all pixels in each tile to the average color of pixels within the tile.

Use the Pixelate method to divide the bitmap into rectangular or arc-shaped cells and then recreate the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.

Use the MosaicTiles method to make an image look like a mosaic made from tiles. Tiles can be rectangular or arc-shaped, depending upon the coordinate system used to draw the tiles.

Use the Pointillist method to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Pixelate method, MosaicTiles method, Pointillist method
Topics: | Raster Images: Doing Geometric Transformations.


Rotate method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Rotate (ILEADRaster *pRaster, long iAngle, short iFlags, OLE_COLOR crFill);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Rotates the bitmap by the hundredths of degrees specified, and lets you specify the background color to be uncovered.

This method has the following features:

It uses the center of the bitmap as the center of rotation.

It can rotate the bitmap clockwise or counterclockwise up to 360 degrees in hundredth-of-a-degree increments.

It can resize the bitmap to accommodate the rotated height and width, or it can retain the original height and width, cropping the bitmap as necessary.

It lets you specify the background color to fill any new area created by the rotation.

The only images that are interpolated are:

8-bit grayscale images (for best results, all gray values should be in the bitmap’s palette). If the rotation doesn’t give the expected results, you can call Grayscale (8) to change the bitmap into a proper grayscale bitmap.

12-bit and 16-bit grayscale bitmaps that don’t have a palette. Grayscale bitmaps can have a palette if they have been loaded from certain DICOM images or if the control’s bitmap has been changed by setting the LevelHighBit property property, or if WindowLevel method has been called. Call Grayscale(12) or Grayscale(16) if Rotate doesn’t seem to do any interpolation during the rotation.

16-bit color images

24-bit, 32-bit, 48-bit and 64-bit color images

For the other images, the Rotate method ignores the interpolation flags and the rotate is performed without interpolation.

ROTATE_RESAMPLE and ROTATE_BICUBIC can be combined with ROTATE_RESIZE, but not with each other. So you can pass ROTATE_RESAMPLE|ROTATE_RESIZE, but not ROTATE_RESAMPLE|ROTATE_BICUBIC.

If ROTATE_RESIZE is set, then the image is resized. Otherwise, the image is cropped.

See Also

Elements: | FastRotate method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


SampleTarget method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SampleTarget (ILEADRaster *pRaster, OLE_COLOR crSample, OLE_COLOR crTarget, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Corrects color values by shifting the sample colors to the target colors.

For example, suppose you are working with a color image. In crSample you set the red value portion of the RGB macro to 125, the green portion to 165 and the blue portion to 100. In crTarget you set the red value portion to 170, the green to 120 and the blue to 200. If you set SAMP_BLUE in lFlags, then for every pixel in the bitmap that has a blue value of 100, that blue value will be changed to 200, thus shifting the colors in the bitmap. Depending on whether you set SAMP_LOW, SAMP_MID, or SAMP_HIGH, either the shadow values in the blue channel will be remapped, or the midtone values in the blue channel will be remapped, or the highlight values in the blue channel will be remapped.

This function supports 16-bit and 12-bit gray scale bitmaps. For gray scale bitmaps the gray value of the crSample and crTarget are used, and the different channel flags have the same effect since it works on the same channel (gray channel).

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, Dry method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artisitic Effects
 | Using Color Values in LEADTOOLS


SearchRegMarks method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SearchRegMarks (ILEADRaster *pRaster);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Searches the specified object for registration marks.

The search parameters should be set in the following properties before calling this method:

Bottom property

Height property

Left property

Mark property

MarksCount property

MaxScale property

MinScale property

NumberOfExpectedMarks property

Right property

Top property

Type property

Width property

This method updates the following properties with information about any detected registration marks:

DetectedMarkCount property

DetectedMarkPointX property

You can call GetTransformationParameters to get the transformation parameters, which can be applied to this bitmap to make it match the reference image.

If you simply want to automatically straighten a bitmap, use the Deskew.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, Mark property, MarksCount property
Topics: | Raster Images: Document Imaging


Segment Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Segment (ILEADRaster* pRaster, long lThreshold, SegmentConstants Flags)
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Divides the bitmap into segments where each segment’s pixels have approximately the same color (homogenous color).

This method divides the images into segments according to its pixel values. The segment shapes will be arbitrary. Adjacent pixels with approximately the same values are put together into homogenous segments. The method may be performed on the RGB and YUV color spaces.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Hue method, Saturation method, Fill method, GetHistogram method, Sharpen method, Mosaic method, Emboss method, Average method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, Posterize method, AddShadow method, HueSaturationIntensity method, ColorReplace method, GetObjectInfo method, MathFunction method, RevEffect method, SubtractBackground method, UserFilter method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Artistic Effects


SelectData method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectData (ILEADRaster *pRasterDst, LPDISPATCH pRasterSrc, OLE_COLOR crColor, long lSrcLowBit, long lSrcHighBit, long lThreshold, VARIANT_BOOL bCombine);
Overview | Refer to Grayscale Images

Remarks

(Medical only) Selects a specified number of bits of an 8, 12 or 16-bit grayscale bitmap and puts them into a mask, then colors the bitmap depending on the mask. This can show bitmap variances depending on user-defined conditions.

This method is used as a visualization aid. You can select certain bits of the supported type bitmap and show the variances of that bitmap under conditions that you define.

When the method returns successfully pRasterDst will be updated with a 24-bit RGB bitmap.

For 8, 12 and 16-bit grayscale bitmap, the lSrcLowBit can range from 0 to 7, 11, and 15 respectively. However, if this value exceeds the range, then the method will not return an error, and the pRasterDst will be a pure black bitmap.

For 8, 12 and 16-bit grayscale bitmap, the lSrcHighBit can range from lSrcLowBit to 7, 11, and 15 respectively. No error will be returned if lSrcHighBit is greater than 7, 11 or 15. The method will return an invalid parameter error if lSrcHighBit < lSrcLowBit.

The method will first construct a mask from bits lSrcLowBit through lSrcHighBit. For each pixel, the pixel value will be combined with the mask using a bitwise ‘and’ operation. The result will be shifted to the right by lSrcLowBit. This result will be compared with the threshold: if the value is greater than or equal to the threshold, the output pixel’s color is changed using crColor. If the result is less than the threshold, the output is set to 0.

This method supports 8, 12 and 16-bit grayscale bitmaps only. Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits. It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | WindowLevel, GrayScaleToDuotone, GrayScaleToMultitone, ShiftData, ColorizeGray, SelectiveColor
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


SelectiveColor method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectiveColor (ILEADRaster *pRaster);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Changes the color of a bitmap by altering the definitions of one or more colors used by the bitmap.

Before you call the SelectiveColor method, you need to set the following Selective Colors properties:

SelectiveColorCyan property

SelectiveColorMagenta property

SelectiveColorYellow property

SelectiveColorBlack property

Selected colors are the additive colors (Red, Green and Blue), the subtractive colors (Cyan, Magenta and Yellow), the highlights (White), the midtones (Neutral) and the shadows (Black). Each of those "Selected Colors" has information about the percentages of cyan, magenta, yellow and black that constructs that selective color. Each unique pixel’s color can be defined as using some certain percentage of CMYK values. By changing the percentage of CMYK values for a "selected color", all colors related to that "selected color" would change also. For example, you can decrease the Magenta percentage from the "Blue selected color" to change a blue color to a color that is more similar to Cyan. Also you can increase the Yellow percentage from the "Magenta selected color" to change magenta color to a color that is more similar to Red.

You control the percentage of CMYK for each of the selected colors using the SelectiveColorCyan, SelectiveColorMagenta, SelectiveColorYellow, and SelectiveColorBlack properties. Each takes a value from –100 to 100. Negative values for any of these properties decreases the percentage of that color, whereas positive values increases the percentage of that color. SelectiveColorCyan = -100 it means no cyan will be used, whereas if SelectiveColorCyan = 100 it means the full percentage of cyan will be used. If a value is out of range, a negative value goes to -100 and a positive value goes to 100.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AutoColorLevel, ColorLevel, SelectiveColorCyan property, SelectiveColorMagenta property, SelectiveColorYellow property, SelectiveColorBlack property
Topics: | Raster Image Functions: Modifying Intensity Values


SetOverlayAttributes method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short SetOverlayAttributes(ILEADRaster *pRaster, short iIndex, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Sets the overlay attributes for the overlay at the specified index. This method can be used to set some or all the overlay attributes. Before calling this method, initialize all the attributes to be set or changed.

There are several attributes in lFlags and you cannot change only one flag. If you want to change only one flag, you will first have to get all the flags and change only the flag you want. See the example for more information.

See Also

Elements: | Size method, Resize event, GetOverlayCount method, OverlayAttributes property, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method, OriginX property, OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Images: Combining Images


SetOverlayBitmap method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short SetOverlayBitmap(ILEADRaster *pRaster, short iIndex, ILEADRaster *pOverlayRaster, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Sets the overlay bitmap for a certain index.

Calling this method with a valid bitmap set in pOverlayRaster frees the old overlay bitmap at the specified index and sets the overlay bitmap at the index to the new bitmap referenced by pOverlayRaster.

See Also

Elements: | Size method, Resize event, GetOverlayCount method, OverlayAttributes property, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayAttributes method, UpdateOverlayBits method, OriginX property, OriginY property, Color property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Images: Combining Images


ShiftData method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ShiftData (ILEADRaster *pRasterDst, LPDISPATCH pRasterSrc, long lSrcLowBit, long lSrcHighBit, long lDstLowBit, long lDstBitsPerPixel);
Overview | Refer to Grayscale Images

Remarks

(Medical only) Selects a specified number of bits from an 8, 12 or 16-bit grayscale bitmap into a mask and places the mask in a new 8, 12 or 16-bit grayscale bitmap.

This method is used mainly as a visualization aid. You can select certain bits of the bitmap and display them in another bitmap.

You can use this method for other purposes than visualization. For example, let’s say you loaded a 16-bit file that has the pixels in Motorola format (where the high and low bytes are swapped). You can swap the high and low 8 bits for each pixel by calling this method twice and OR-ing the results.

When the function returns successfully the pRasterDst will be an 8, 12 or 16-bit grayscale.

For 8, 12 and 16-bit grayscale bitmaps, the lSrcLowBit can range from 0 to 7, 0 to 11, and 0 to 15 respectively. However if this value exceeds the range, then the method will not return an error, and the pRasterDst will be a pure black bitmap.

The lSrcHighBit must be greater than or equal to lSrcLowBit. The method will return an invalid parameter error if lSrcHighBit < lSrcLowBit.

The lDstLowBit can range from 0 to lDstBitsPerPixel – 1. If you pass greater values for lDstLowBit, the method will not return an error, but pRasterDst will become a pure black bitmap.

This method supports 8, 12 and 16-bit grayscale bitmaps only. Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits. It also can process the whole image or a region. If a bitmap has a region, the effect is applied only to the region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | SelectData method, ColorizeGray method
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


SmoothEdges method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SmoothEdges (ILEADRaster *pRaster, short iAmount, short iThreshold);
Overview | Refer to Removing Noise

Remarks

Smoothes the rough edges in the image.

This method performs edge detection, then smoothes those edges that are found. The other points of the image are unchanged.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen, Mosaic, Emboss, Median, SpatialFilter, BinaryFilter, MaxFilter, MinFilter, Solarize.
Topics: | Raster Image Functions: Filtering Images


Spherize method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Spherize (LEADRaster *pRaster, short iValue, short CenterX, short CenterY, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Warps the image around a 3D spherical shape.

This method will warp the image as a 3D spherical shape around the specified CenterX,CenterY. The center point must be defined inside the bitmap or inside the region, if the bitmap has a region.If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


Saturation method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Saturation (ILEADRaster *pRaster, short iChange);
Overview | Refer to Correcting Colors.

Remarks

Increases or decreases the saturation of colors in the bitmap.

Negative values decrease the saturation of colors. Positive values increase the saturation. The saturation level is increased or decreased by a percentage of its present saturation level. For example, an increase of 20% of the current saturation level "L" will raise the new saturation level "L1" to a value of L + 0.20 * L. Likewise, increasing the saturation level 100% doubles the saturation level (L1 = L + 1.0 * L). Decreasing the saturation level 100% will set the new saturation level to 0. This process is carried out for every pixel.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Hue method, Invert method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


SetBitmapCompression method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetBitmapCompression(ILEADRaster *pRaster, enum BitmapCompressionConstants newVal);
Overview | Refer to Layers in Files

Remarks

Changes the bitmap's compression to match the desired compression. An exception occurs if the compression type is invalid. For example, trying to compress a bitmap that is not 1-bit, or trying to super-compress a bitmap that is not 1-bit, 8-bit, or 24-bit will result in an exception. For more information, refer to the LoadCompressed property.

See Also

Elements: | LoadCompressed property, BitmapCompression property
Topics: | Raster Images: Getting Current Information


Sharpen method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Sharpen (ILEADRaster* pRaster, short iChange);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

Increases or decreases the sharpness of the image in the bitmap.

Negative values decrease the sharpness of the image. Specify -1000 for minimum sharpness. Positive values increase the sharpness. Specify +1000 for maximum sharpness.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


Shear method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Shear (ILEADRaster* pRaster, short iAngle, BOOL bHorizontal, OLE_COLOR crFill);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Move the corners of the bitmap in the fashion of a parallelogram.

You specify an angle of slant, horizontal or vertical shear, and the fill color for the created space. The angle is expressed in hundredths of degrees, with a limit of 4500 (45 degrees).

The following is a horizontal example:

See Also

Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


ShiftMinimumToZero method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ShiftMinimumToZero(ILEADRaster * pRaster);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above only) Converts the signed bitmap to an unsigned bitmap by increasing or shifting the bitmap's intensity values, so the lowest intensity value (the most negative value) will be shifted to zero.

This method is similar to the ConvertSignedToUnsigned method, except that the ShiftMinimumToZero method updates the ShiftAmount property with the value by which the data was shifted.

ShiftMinimumToZero and ShiftZeroToNegative methods are most often used in concert with one or more image processing or analysis methods. ShiftMinimumToZero converts signed data to unsigned data, in preparation for some image processing or analysis. (Most image processing methods work only on unsigned data.) After the image processing or analysis is performed, ShiftZeroToNegative converts the unsigned data back to signed data.

This method doesn’t support 8-bit images.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | ShiftAmount property, ConvertUnsignedToSigned Method, ConvertSignedToUnsigned method, ShiftZeroToNegative method
Topics: | Raster Images: Modifying Intensity Values


ShiftZeroToNegative method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ShiftZeroToNegative(ILEADRaster * pRaster, long lShiftAmount, long lMinInput, long lMaxInput, long lMinOutput, long lMaxOutput);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above only) Converts an unsigned bitmap to a signed bitmap by decreasing intensity values by a specific amount.

By decreasing the intensity values of the bitmap (creating some negative values), a value of zero in the original bitmap would be shifted to a value of –lShiftAmount.

This method is similar to ConvertUnsignedToSigned method. However, ShiftZeroToNegative lets the user determine the value by which to shift the data, while in ConvertUnsignedToSigned, the shift is fixed always. (i.e. shift center to zero.)

The ShiftMinimumToZero method and ShiftZeroToNegative method are most often used in concert with one or more image processing or analysis methods. ShiftMinimumToZero converts signed data to unsigned data, in preparation for some image processing or analysis. (Most image processing methods work only on unsigned data.) After the image processing or analysis is performed, ShiftZeroToNegative converts the unsigned data back to signed data.

This method doesn’t support 8-bit images.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | ConvertUnsignedToSigned method, ConvertSignedToUnsigned method, ShiftMinimumToZero method
Topics: | Raster Images: Modifying Intensity Values


Size method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Size (ILEADRaster* pRaster, float fWidth, float fHeight, ResizeConstants Flags);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Resizes the bitmap to a new width and height.

This changes the storage requirements of the bitmap, and it is not the same as scaling the display (zooming out or zooming in).

See Also

Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


Skeleton method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Skeleton (ILEADRaster *pRaster, long Threshold);
Overview | Refer to Detecting and Enhancing Edges and Lines

Remarks

(Medical only) Finds the skeleton of objects or regions in a bitmap.

This method finds the skeleton of regions or objects in a binary bitmap. The white color represents the objects and the black color represents the background. If the bitmap is not a 1-bit image, the threshold will be used to transform the bitmap into a binary image before finding the skeleton.

If the bitmap has a region, this function works only on the region.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Combine, IntensityDetect, Sharpen, SpatialFilter, EdgeDetector, GlowFilter, Correlation
Topics: | Raster Image Functions: Image Processing: Filtering Images


Slice method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Slice(ILEADRaster * pRaster, long lMaxDeskewAngle, OLE_COLOR crFill, long lFlags, VARIANT_BOOL bEnableSliceEvent);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above toolkits) This method extracts individual slices from a radiographic scanned film.

The figures below show examples of radiographic images before and after applying the Slice method where the output data was used to draw a white line around each separate slice.

Film Before Function Is Called

Film After Function Is Called

See Also

Elements: | OnSliceBitmap Event, SliceDeskewAngle property, ContinueSlicing property.
Topics: | Raster Images: Creating and Maintaining Lists of Images.
 | Raster Images: Creating and Using a Region.


Smooth method (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Smooth (ILEADRaster* pRaster, long iLength, SmoothFlags Flags);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Smooths the bumps and fills in the nicks of a 1-bit black and white image.

This method smooths the text in scanned text documents.

The behavior of this method can be modified by using the Smooth event.

This method works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this method. If no region is selected, the whole image will be processed.

This method triggers both the Smooth event and the ProgressStatus event.

See Also

Elements: | Smooth event
Topics: | Raster Images: Cleaning - up 1-Bit Images


Solarize method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Solarize (ILEADRaster* pRaster, short iThreshold);
Overview | Refer to Applying Artistic Effects.

Remarks

Applies an effect that mimics the accidental exposure of photographic film to light. It does so by inverting all color data with an intensity value greater than or equal to the threshold that you specify.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Topics:

Raster Images: Filtering Images


SpatialFilter method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SpatialFilter (ILEADRaster* pRaster, SpatialFilterConstants sfType);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

Imposes a spatial filter on the bitmap. Spatial filters are used for operations such as sharpening an image or detecting edges within the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method works best with 24-bit, 16-bit, or grayscale bitmaps. If a bitmap uses a color palette, this method matches the new brightness value of each pixel to the nearest color in the existing palette.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics: | Raster Images: Filtering Images
 | Raster Images: Where the Region Preempts the Bitmap


StretchIntensity method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short StretchIntensity (ILEADRaster* pRaster);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Increases the contrast in an bitmap by centering, maximizing, and proportioning the range of intensity values.

Unlike the Contrast method, this method always retains the original number of different intensity values. (Ordinary contrast adjustments can lose values at the high and low ends of the scale.)

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

This method supports signed images.

See Also

Elements: | Intensity method, GammaCorrect method, Contrast method, HistoContrast method, HistoEqualize method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Where the Region Preempts the Bitmap


SubtractBackground Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SubtractBackground (ILEADRaster* pRaster, long lRollingBall, ShrinkConstants ShrinkSize, long lBrightnessFactor, long lFlags)
Overview | Refer to Changing Brightness and Contrast

Remarks

(Raster Pro and above toolkits) Removes the background from the image.

This method is useful, especially with medical images and grayscale bitmaps in correcting non-uniform brightness.

The rolling ball algorithm works as follows:

1. | Consider the bitmap to be a 3-D surface and the z-axis to be the intensity of the image [The component V from the HSV color space].
2. | Roll a 3-D ball beneath the surface so all the points of the ball are under the surface with one or more points of the ball tangent to the surface.
3. | The tangent points to the rolling ball are considered to be the background.

Subtract the background from the original image.

The Rolling Ball Radius should be at least as large as the radius of the largest object in the image that is not part of the background to ensure the separation of the background from any objects.

A small radius allows the detection of small objects, whereas a larger radius will detect both small and large objects.

When subtracting the background, sometimes the result is dim. In such a case you can enhance the brightness after subtracting the background by using the lBrightness factor, which functions similar to Multiply method. Passing 100 for lBrightness leaves the brightness unchanged.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddShadow method, InitFourierTransformation method, HueSaturationIntensity method, ColorReplace method, MathFunction method, Segment method, UserFilter method
Topics: | Raster Images: Modifying Intensity Values


SwapColors method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SwapColors(ILEADRaster *pRaster, SwapColorsConstants Flags);
Overview | Refer to Correcting Colors.

Remarks

Swaps the specified color channels.

This method can process the whole image or a region of the image.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements: | ConvertToColoredGray method, BalanceColors method, GrayScale method, GrayscaleExt method, IsGrayscale property
Topics: | Raster Images: Modifying Intensity Values


Swirl method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Swirl (LEADRaster *pRaster, short iAngle, short CenterX, short CenterY);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Spins the image according to the rotation angle to produce a swirl pattern.

This method swirls the image around the specified point CenterX ,CenterY. The center point must be defined inside the bitmap, or inside the region, if the bitmap has a region.If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


TextureAlphaBlend method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short TextureAlphaBlend (ILEADRaster * pRasterDst, short iXDst, short iYDst, short iWidth, short iHeight, ILEADRaster * pRasterSrc, short iXSrc, short iYSrc, ILEADRaster * pRasterMask, short iOpacity, ILEADRaster * pRasterUnderlay, short iXOffset, short iYOffset);
Overview | Refer to Combining Images

Remarks

(Raster Pro and above toolkits) Combines image data from pRasterMask and pRasterUnderlay with an underlay effect. The result is used as a fade mask that will be used to combine pRasterSrc and pRasterDst with variable opacity. The result is combined again with pRasterDst using a constant opacity specified in iOpacity.

To combine two bitmaps with a fixed opacity, use the AlphaBlend method.

To combine two bitmaps with feathering, use the FeatherAlphaBlend method.

To create a bitmap that contains a fade mask, use CreateFadedMask.

This method also supports 12 and 16 - bit grayscale bitmaps. Support for 12 and 16 - bit grayscale images is available only in the Document/Medical toolkits.

This method will use iXOffset and iYOffset to calculate the parts of the underlay bitmap that will be applied to the mask bitmap. Using iXOffset and iYOffset will give the user the ability to give the feel of continuous texture when applying this method to neighboring parts inside the destination bitmap using the same or different mask.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, AlphaBlend method, FeatherAlphaBlend method, CreateFadedMask method.
Topics: | Raster Images: Combining Images


Trim method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Trim (ILEADRaster* pRaster, float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

Trims the bitmap, resulting in a bitmap that is the size of the specified rectangle.

If a region is defined for the bitmap, the region is also trimmed if necessary.

See Also

Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)


Tunnel method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Tunnel (ILEADRaster *pRaster, short CenterX, short CenterY, short iZValue, short iDistance, short iRad, short iRepeat, short iRotationOffset, short iStretch, short iStartBright, short iEndBright, short iBrightLength, OLE_COLOR crBright, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Places the bitmap inside a tunnel along the Z-axis.

This metho shows the effect of placing a bitmap inside a tunnel along the Z-axis. An external light source of the specified color and brightness may be shined on the bitmaps. The brightness may vary along the z-axis according to the iBrightLength value.

Changing the camera center point, the rotation angle and the viewing screen Z-offset will simulate moving along the axis.

If the bitmap has a region, the effect will be applied on the region dimensions only.

Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits.

For an example, see the following figure:

The following figure shows the same bitmap, after the effect has been applied:

To obtain this effect, the following settings were used with the function:

CenterX, CenterY = (200,200)

iZValue= 0

iDistance= 200

iRad= 200

iRepeat= -1

iRotationOffset= 75

iStretch= 25

iStartBright= 0

iEndBright= 100

iBrightLength= 45

crBright= RGB(255,255,255)

crFill= RGB(255,255,255)

lFlags= PLANE_FILL_CLR|TUN_AXIS_WIDTH

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, DrawStar method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Dry method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar Method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS


Underlay method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Underlay (ILEADRaster* pRaster, ILEADRaster* pRasterSrc, UnderlayConstants Flags);
Overview | Refer to Combining Images.

Remarks

Combines two bitmaps so that one appears to be an underlying texture for the other. This is most effective when the underlying image is a filtered one, such as an embossed image.

This method changes the colors of the underlay to grayscale as it combines the images. It updates the current bitmap, leaving the second bitmap (pRasterSrc) unchanged. The underlying image can either be stretched or tiled to fill the target image, as shown in the following illustration:

If a region is defined for the target bitmap, the underlay is applied to the region, not to the whole bitmap. (Any region defined for the underlay bitmap is ignored.)

See Also

Topics: | Raster Images: Combining Images
 | Examining and Altering Bitmaps
 | Applying Artistic Effects


UnsharpMask method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UnsharpMask(ILEADRaster *pRaster, short iAmount, short iRadius, short iThreshold, short ColorType);
Overview | Refer to Detecting and Enhancing Edges and Lines.

Remarks

This method is actually considered a sharpening method. It is used to sharpen the image with a minimum of noise by applying the unsharp mask. To reduce the noise, it starts by blurring a copy of the original image. The amount of blur depends on iRadius. The method then determines the difference between each pixel's value of the original image and the corresponding pixel's value in the blurred image. If the difference is greater than the iThreshold value, then the difference between the pixel values is multiplied by the value in the iAmount parameter and added to the original pixel value.

To increase the thickness of the sharpened edges, increase the value of iRadius.

To increase the amount of sharpness, increase the value of iAmount.

To reduce the noise and eliminate the small edges or individual pixels that will produce noise in image, increase the value of iThreshold.

Using the YUV color space decreases the processing time.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Sharpen method, Posterize method, Mosaic method, Emboss method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, GaussianFilter method
Topics: | Raster Image: Filtering Images


UpdateOverlayBits method (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | short UpdateOverlayBits(ILEADRaster *pRaster, short iIndex, long lFlags);
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Updates the overlay bitmap pixels with the bits from the corresponding bitplane of the main bitmap. It can also update the main bitmap’s bitplane with the data from the overlay bitmap.

The method will only work for grayscale 8, 12 or 16-bit bitmaps. Support for 12 and 16-bit bitmaps is only in the Document/Medical toolkits.

If SETOVERLAYBITS_FROMOVERLAY is set in lFlags, the bitplane in the main bitmap will be updated to match the overlay bitmap data. The left and top coordinates for the overlay bitmap are used. If SETOVERLAYBITS_CLEAR is set, the bits from the bitplane associated with the overlay are set to 0 if they are not covered by the overlay. If SETOVERLAYBITS_CLEAR is not set, the bits from the bitplane associated with the overlay that are not covered by the overlay bitmap are left unchanged.

If SETOVERLAYBITS_FROMBITMAP is set, the overlay bitmap will be updated with the bits from the corresponding bitplane. The size of the overlay bitmap is unchanged if it has ever been set. If the overlay bitmap has never been set, the overlay bitmap will be from left, top coordinate to the bottom-right corner of the bitmap:

See Also

Elements: | Size method, Resize event, GetOverlayCount method, OverlayAttributes property, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayAttributes method, SetOverlayBitmap method, OriginX property, OriginY property, Color property, Flags property, BitPosition property, Rows property, Columns property, Type property, BitsAllocated property, Description property, Subtype property, Label property, ROIMean property, ROIArea property, ROIStandardDeviation property, NumberFramesInOverlay property, ActivationLayer property
Topics: | Raster Images: Combining Images


UserFilter Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UserFilter (ILEADRaster* pRaster)
Overview | Refer to Removing Noise

Remarks

(Raster Pro and above toolkits) Filters the bitmap based on a user-defined filter / mask. This method is similar to the spatial and binary filter functions.

With this method you can create a user-defined filter and apply it to the image. The filter has a rectangular form (matrix) where the values are user-defined. It allows the creation of simple customized filters, where each value found in matrix is multiplied by the corresponding pixel, and then the specified operation is performed on the results.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

When the filter is applied to pixels from the edge and you choose the sum operation, the edge rows and columns are duplicated. For example, if the pixel (-1, 5) is needed, the pixel (0, 5) is used instead.

This method uses the following properties to apply a user-defined filter to a bitmap:

UserFilterWidth property

UserFilterHeight property

UserFilterXCenter property

UserFilterDivisor property

UserFilterYCenter property

UserFilterOffset property

UserFilterFlags property

UserFilterData property

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterDivisor property, UserFilterYCenter property, UserFilterOffset property, UserFilterFlags property, UserFilterData property, MaxFilter method, MinFilter method, AddNoise method, Sharpen method, Average method, Median method, SpatialFilter method, BinaryFilter method
Topics: | Raster Images: Filtering Images


Vignette method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Vignette(ILEADRaster * pRaster, long lCenterX, long lCenterY, long lFading, long lFadingRate, long lWidth, long lHeight, OLE_COLOR crVigColor, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Draws a specified shape and feathers it to the bitmap.

This method can be used to draw a circle, ellipse, rectangle or square to create a vignette shape and then a color is feathered to the bitmap, filling either the inside or the outside of the vignette shape.

As an example, if you use the following figure:

And you call Vignette using the following values:

Parameter | Value
lCenterX | 144
lCenterY | 181
lFading | 50
lFadingRate | 33
lWidth | 145
lHeight | 181
crVigColor | White
lFlags | VIG_ELLIPSE | VIG_FILLIN

The following figure results:

This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Underlay method, Combine method, FeatherAlphaBlend method, CreateFadedMask method, TextureAlphaBlend method.
Topics: | Raster Images: Combining Images
 | Raster Images: Artistic Effects


Wave method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Wave (LEADRaster *pRaster, short iAmplitude, short iWaveLen, short iAngle, short iHorzFact, short iVertFact, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Distorts the bitmap with two perpendicular waves at the specified angle and with the specified wave type.

The method applies two perpendicular waves. The iHorzFact and iVertFact parameters control the size of these waves.

If the bitmap has a region, the effect will be applied on the region only.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wind method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


Wind method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Wind (LEADRaster *pRaster, short iDim, short iAngle, short iOpacity);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Creates thin lines, directed along the specified angle, on the specified bitmap.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, ZoomBlur method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


WindowLevel method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short WindowLevel(ILEADRaster* pRaster);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/ Medical Imaging only) Converts a 12 or 16-bit grayscale image to an 8-bit grayscale or a 24-bit RGB bitmap. This function is available in Document/Medical toolkits only.

There are four properties associated with this method: LevelLowBit property, LevelHighBit property, LevelLUT property and LevelLUTLength property. They are all reset to their default values within this method.

This method applies window leveling to the bitmap, changing the image data to match the display image.

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This function supports signed data images.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements | LevelLowBit property, LevelHighBit property, LevelLUTLength property, LevelLUT property, GetMinMaxBits method, GetMinMaxVal method
Topics | Raster Images: Palettes
 | Saving Window-Leveled Bitmaps


ZigZag method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ZigZag(ILEADRaster * pRaster, long lAmplitude, long lAttenuation, long lFrequency, long lPhase, long lXCenter, long lYCenter, OLE_COLOR crFill, long lFlags);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Radially distorts the bitmap by creating waves that twist the image around a specified center.

As an example, if you use the following image:

And you call the ZigZag method using the following settings:

Parameter | Value
lAmplitude | 47
lAttenuation | 92
lFrequency | 13
lPhase | -162
lXCenter | 192
lYCenter | 82
crFill | Black
lFlags | FILL_CLR | ZG_RAD

The following figure results:

As another settings, if you use the same settings except you use the ZG_POND flag, the following figure results:

To create other zigzag forms refer to Ripple, ZoomWave and RadWave.

If the bitmap has a region, the effect will be applied on the region only.

This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Ripple method, ZoomWave method, RadWave method, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method.
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Artistic Effects.


ZoomBlur method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ZoomBlur (LEADRaster *pRaster, short iDim, short iStress, short CenterX, short CenterY);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Blurs the image along radial lines starting from the specified center point.

The method will blur and zoom the image around the specified point CenterX,CenterY. The center point must be defined inside the bitmap, or inside the region if the bitmap has a region.

If the bitmap has a region, the effect will be applied on the region only.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomWave method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


ZoomWave method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short ZoomWave (LEADRaster *pRaster, short iAmplitude, short iFrequency, short iPhase, short iZoomFact, short CenterX, short CenterY, OLE_COLOR crFill, short lFlag);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Distorts the bitmap with a wave zoomed from the specified center.

The method applies a sinusoidal wave zoomed from the specified center. The center point must be defined inside the bitmap, or inside the region, if the bitmap has a region. If the bitmap has a region, the effect will be applied on the region only.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method
Topics: | Raster Images: Doing Geometric Transformations
 | Using Color Values in LEADTOOLS
 | Raster Images: Artistic Effects


Amplitudes property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short Amplitudes (long lIndex);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits only) Gets or sets an array of integers that represent wave values. The real value of the array elements is divided by 1000, and the valid value of each element in pAmplitudes array is between –1000 and 1000. These values are generally obtained from the GetCurvePoints method. They may also be obtained through the FreeHandWave Dialog .

See Also

Elements: | AmplitudesCount property, FreeHandWave method, FreeHandShear method, GetCurvePoints method
Topics: | Raster Image: Doing Geometric Transformations
 | Raster Images: Artistic Effects


AmplitudesCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long AmplitudesCount
Overview | Refer to Applying Artistic Effects

Remarks

Gets or sets the number of elements in the Amplitudes property.

Set this property to allocate the array for the Amplitudes property before actually setting the Amplitudes property. As an alternate method you can call the GetCurvePoints method to update the Amplitudes property with the appropriate values and update this property with the number of values set in the Amplitudes property.

See Also

Elements: | Amplitudes property, FreeHandWave, FreeHandShear method, GetCurvePoints method
Topics: | Raster Images: Doing Geometric Transformations
 | Raster Images: Artistic Effects


BitmapMaxValue property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapMaxValue
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read only) Gets the maximum pixel value found by the GetBitmapStatisticsInfo method.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMean property, BitmapMinValue property, BitmapPixelsCount property, BitmapTotalPixelCount property, BitmapSelectedPixelPercent property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapMean property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapMean
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Raster Pro and above toolkits) (Read only) Gets the mean bitmap value determined by the GetBitmapStatisticsInfo method. This value is divided internally by 100.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMaxValue property, BitmapMaxValue property, BitmapPixelsCount property, BitmapTotalPixelCount property, BitmapSelectedPixelPercent property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapMedian property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapMedian
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read only) Gets the median pixel value found by the GetBitmapStatisticsInfo method.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMaxValue property, BitmapMaxValue property, BitmapPixelsCount property, BitmapTotalPixelCount property, BitmapSelectedPixelPercent property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapMinValue property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapMinValue
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read only) Gets the minimum pixel value found by the GetBitmapStatisticsInfo method.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMean property, BitmapMaxValue property, BitmapPixelsCount property, BitmapTotalPixelCount property, BitmapSelectedPixelPercent property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapPixelsCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapPixelsCount
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read only) Gets the number of pixels found by the GetBitmapStatisticsInfo method, that fall between the starting color value (lStart) and the ending color value (lEnd) passed to GetBitmapStatisticsInfo method.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMean property, BitmapMaxValue property, BitmapMinValue property, BitmapSelectedPixelPercent property, BitmapTotalPixelCount property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapSelectedPixelPercent property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapSelectedPixelPercent
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read only) Gets the percentage of pixels in the entire bitmap that fall between BitmapMinValue and BitmapMaxValue. This value is in hundredths of a percent. It is divided internally by 100.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMean property, BitmapMaxValue property, BitmapMinValue property, BitmapPixelsCount property, BitmapTotalPixelCount property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapStandardDeviation property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long BitmapStandardDeviation
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Raster Pro and above toolkits) (Read only) Gets the standard deviation determined by the GetBitmapStatisticsInfo method. This value is divided internally by 100.

This property is updated by the GetBitmapStatisticsInfo method.

See Also

Elements: | BitmapMean property, BitmapMedian property, BitmapMaxValue property, BitmapMaxValue property, BitmapSelectedPixelPercent property, BitmapPixelsCount property, BitmapTotalPixelCount property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


BitmapTotalPixelCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

long BitmapTotalPixelCount

Remarks

(Read only) Gets the number of pixels found in the entire image or region.

See Also

Elements: | BitmapStandardDeviation property, BitmapMedian property, BitmapMean property, BitmapMaxValue property, BitmapMinValue property, BitmapPixelsCount property, BitmapSelectedPixelPercent property, GetBitmapStatisticsInfo method
Topics: | Raster Images: Getting Current Information


Blue property (ILEADRasterProcess)

Blue property (ILEADBalanceData)

Visual Basic example

Visual C++ example

Syntax | short Blue
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets a value to be used for adjusting or balancing the blue channel for the ColorIntensityBalance method. Valid values range from –100 to 100. Values > 0 increase the blue component. Values < 0 decrease the blue component. Using 0 leaves the blue component unchanged.

See Also

Elements: | ColorIntensityBalance method, MidTone property, HighLight property Shadow property, Red property, Green property
Topics: | Raster Images: Modifying Intensity Values


BlueGamma property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BlueGamma
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the gamma value. This value is used to modify the midtones for the blue channel of the image. The value in this member is a 100 times the actual value. Therefore, if BlueGamma = 167 then the actual gamma value is 1.67. Likewise, if you want to use a gamma of 1.75, set this member to 175. The default value is DEFAULT_GAMMA, which is 100 (actual gamma value of 1.00) which does not change the gamma value of the image.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMaxOutput property, RedMinOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


BlueMaxInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BlueMaxInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s highlights to be mapped for the blue channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a highlight and will be remapped to the value in BlueMaxOutput property.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, MasterMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


BlueMaxOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BlueMaxOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the highlights will be mapped for the blue channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


BlueMinInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BlueMinInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s shadows to be mapped for the blue channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a shadow and will be remapped to the value in BlueMinOutput.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, MasterMinInput property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


BlueMinOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short BlueMinOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the shadows will be mapped for the blue channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


ColoredBall property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long ColoredBall(long lIndex);
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Gets or sets the colors of the balls.

See Also

Elements: | ColoredBalls method, ColoredBallsCount property, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, DrawStar method.
Topics: | Raster Images: Artistic Effects.


ColoredBallsCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long ColoredBallsCount;
Overview | Refer to Applying Artistic Effects.

Remarks

(Raster Pro and above only) Gets or sets the number of ball colors.

See Also

Elements: | ColoredBalls method, ColoredBall property, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, BumpMap method, Cubism method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Impressionist method, Pixelate method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, DrawStar method.
Topics: | Raster Images: Artistic Effects.


ColorPlanes property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long ColorPlanes (short iIndex);
Overview | Refer to Managing Color Separations.

Remarks

Is the array of grayscale bitmaps created by the ColorSeparate method.

You can merge the bitmaps in the array by using the ColorMerge method. The separations follow the color order of the image data. In most cases, this is the same as the abbreviation of the color-plane model. For example, in a CMYK separation, ColorPlanes(0) is the cyan plane. The only exception is RGB, where the image data is usually stored as blue-green-red, and ColorPlanes(0) is the blue plane.

You can use the equals (=) operator to copy a separation bitmap to or from a LEADRaster Object. For example, in Visual Basic:

LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.ColorPlanes(0)

You can also free a separation bitmap from memory by assigning it a value of 0.

See Also

Topics: | Raster Images: Doing Color Space Conversions
 | Examining and Altering Bitmaps


ComponentFlags property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ComponentFlags (short iIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets a value that indicates how values within the range are treated, how the threshold pixel is treated and the new values for any rejected values. Possible values are

The following are the flags that indicate how the values between the minimum and maximum threshold range are treated:

Value | Meaning
CLTH_TYP_BANDPASS | [0x00000000] The values falling outside the range are modified
CLTH_TYP_BANDREJECT | [0x00000001] The values falling inside the range are modified

The following are the flags that indicate how the threshold pixel is treated:

Value | Meaning
CLTH_MOD_CHANNEL | [0x00000000] Each channel component is modified independently.
CLTH_MOD_ALL | [0x00000010] The pixel is rejected by the test if one of the components is rejected.

The following are the flags that indicate the new values for the rejected values:

Value | Meaning
CLTH_VALUE_MIN | [0x00000000] The rejected values are set to 0.
CLTH_VALUE_MAX | [0x00000100] The rejected values are set to the maximum value.
CLTH_VALUE_CLAMP | [0x00000200] The rejected component values less than the ComponentMinRange property are set to the minimum value in the used color space component. The rejected component values greater than the ComponentMaxRange property are set to the maximum value in the used color space component. This works only with the CLTH_MOD_CHANNEL flag.

See Also

Elements: | ComponentMinRange property, ComponentMaxRange property, ColorThreshold method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Doing Color Space Conversions


ComponentMaxRange property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ComponentMaxRange(short iIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets an array of maximum range values, for each color channel, used by the ColorThreshold method.

See Also

Elements: | ComponentMinRange property, ComponentFlags property, ColorThreshold method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Doing Color Space Conversions


ComponentMinRange property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ComponentMinRange(short iIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets an array of maximum range values, for each color channel, used by the ColorThreshold method.

See Also

Elements: | ComponentMaxRange property, ComponentFlags property, ColorThreshold method
Topics: | Raster Images: Modifying Intensity Values
 | Raster Images: Doing Color Space Conversions


ContinueSlicing property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL ContinueSlicing;
Overview | Refer to Examining and Altering Bitmaps

Remarks

(Raster Pro and above toolkits) If this property is set to VARIANT_TRUE during the OnSliceBitmap Event, the slicing operation will continue. If you wish to stop the slicing operation, set this property to false in the OnSliceBitmap event. The default value is VARIANT_TRUE. Possible values are:

Setting | Description
VARIANT_TRUE | Continue the slicing operation.
VARIANT_FALSE | Stop the slicing operation.

See Also

Elements: | OnSliceBitmap Event, Slice method, SliceDeskewAngle property.
Topics: | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Creating and Using a Region


ContoursCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContoursCount
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Gets the number of contour points obtained by the GetContourPoints method.

The contour points are used to determine the Feret's diameter of the region using the GetFeretsDiameter method.

See Also

Elements: | GetRgnContourPoints method, ContourX property, ContourY property, GetFeretsDiameter method, FeretsDiameterLength property, FeretsFirstIndex property, FeretsSecondIndex property
Topics: | Raster Images: Creating and Using a Region


ContourX property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContourX(long lIndex)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Gets an array of X coordinates for the contour points obtained by the GetRgnContourPoints method.

These points are used to determine the Feret's diameter of the region using the GetFeretsDiameter method.

See Also

Elements: | GetRgnContourPoints method, ContoursCount property, ContourY property, GetFeretsDiameter method, FeretsDiameterLength property, FeretsFirstIndex property, FeretsSecondIndex property
Topics: | Raster Images: Creating and Using a Region


ContourY property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ContourY (long lIndex)
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Gets or sets an array of Y coordinates for the contour points obtained by the GetRgnContourPoints method.

These points are used to determine the Feret's diameter of the region using the GetFeretsDiameter method.

See Also

Elements: | GetRgnContourPoints method, ContoursCount property, ContourX property, GetFeretsDiameter method, FeretsDiameterLength property, FeretsFirstIndex property, FeretsSecondIndex property
Topics: | Raster Images: Creating and Using a Region


CorrelationCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short CorrelationCount
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) (Read only) Gets the number of areas in the bitmap referenced by pRaster actually found to be correlated to areas in the bitmap referenced by pCorrelationRaster. Its maximum is CorrelationMaxPoints property.

See Also

Elements: | CorrelationX property, CorrelationMaxPoints property, CorrelationY property, Correlation method
Topics: | Raster Image Functions: Comparing Images


CorrelationListCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long CorrelationListCount;
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Raster Pro and above only) (Read only) Gets the number of areas in the bitmap referenced by pRaster that correlate to an image in the BitmapList property.

This property will be updated by calling the CorrelationList method.

The maximum value of this property is the value of the CorrelationListMaxPoints property.

See Also

Elements: | CorrelationList method, CorrelationListMaxPoints property, CorrelationListX property, CorrelationListY property, CorrelationListIndex property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CorrelationListIndex property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long CorrelationListIndex(long lIndex);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Raster Pro and above only) (Read only) Gets the indices of the images that match correlated areas.

This property will be updated by calling the CorrelationList method.

See Also

Elements: | CorrelationList method, CorrelationListMaxPoints property, CorrelationListX property, CorrelationListY property, CorrelationListCount property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CorrelationListMaxPoints property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long CorrelationListMaxPoints;
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Raster Pro and above only) Gets or sets the maximum number of values stored in the CorrelationListX and CorrelationListY properties. This is also equal to the maximum number of regions in bitmap referenced by pRaster that can be found to correlate.

See Also

Elements: | CorrelationList method, CorrelationListX property, CorrelationListY property, CorrelationListCount property, CorrelationListIndex property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CorrelationListX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long CorrelationListX(long lIndex);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Raster Pro and above only) Gets or sets the X-axis coordinates of the correlated areas.

See Also

Elements: | CorrelationList method, CorrelationListMaxPoints property, CorrelationListY property, CorrelationListCount property, CorrelationListIndex property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CorrelationListY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long CorrelationListY(long lIndex);
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

(Raster Pro and above only) Gets or sets the Y-axis coordinates of the correlated areas.

See Also

Elements: | CorrelationList method, CorrelationListMaxPoints property, CorrelationListX property, CorrelationListCount property, CorrelationListIndex property, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Correlation method.
Topics: | Raster Images: Comparing Images.


CorrelationMaxPoints property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short CorrelationMaxPoints
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) Size of the arrays in the CorrelationX and CorrelationY properties. This is also equal to the maximum number of regions in the bitmap referenced by the pRaster parameter in the Correlation method that can be found to be correlated.

See Also

Elements: | CorrelationX property, CorrelationY property, CorrelationCount property, Correlation method
Topics: | Raster Image Functions: Comparing Images


CorrelationX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short CorrelationX (short iIndex);
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) (Read only) Gets the X coordinate of the starting point for the correlated area at the specified index.

See Also

Elements: | CorrelationY property, CorrelationMaxPoints property, CorrelationCount property, Correlationt method
Topics: | Raster Image Functions: Comparing Images


CorrelationY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short CorrelationY (short iIndex);
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) (Read only) Gets the Y coordinate of the starting point for the correlated area at the specified index.

See Also

Elements: | CorrelationX property, CorrelationMaxPoints property, CorrelationCount property, Correlation method
Topics: | Raster Image Functions: Comparing Images


DeskewAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long DeskewAngle
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Gets the angle that was applied during Deskew.

See Also

Elements:

Deskew method


DeskewExtAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long DeskewExtAngle
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/Medical) (Read only) This property is updated with the amount that the DeskewExt method rotates the image. The amount of rotation is expressed in hundredths of degrees. For example, 500 mean 5 degrees clockwise.

See Also

Elements: | DeskewExt method, Despeckle method, WindowLevel method, ApplyTransformationParameters method, GetMarksCenterMass method, GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, Deskew method.
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images.


Directory property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | BSTR Directory
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets a string that contains the path name of the directory in which to save the extracted file. This property is used only by the ExtractMessage method. If the extracted message is a file, this parameter is used to specify the path for saving the extracted file. To save the extracted file using the original path, set this property to NULL. If the extracted message is text, this property has no effect.

See Also

Elements: | Message property, Password property, FileName property, StartX property, StartY property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


DocCleanSuccess property (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | DocCleanEventReturnType DocCleanSuccess
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Indicates the status or behavior of the one of the Document Cleanup events listed below.

Set this property during the following events:

BorderRemove event

DotRemove event

HolePunchRemove event

InvertedText event

LineRemove event

Smooth event

Possible values are:

Value | Meaning
0 | Abort the process.
SUCCESS_REMOVE | Remove the object (dot, line, inverted text, border, etc.).
SUCCESS_NOREMOVE | Do not remove the object (dot, line, inverted text, border, etc.).

See Also

Elements: | Smooth event, InvertedText event, LineRemove event, DotRemove event, BorderRemove event, HolePunchRemove event
Topics: | Raster Images: Cleaning - up 1-Bit Images


EnableDocCleanEvents property (LEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableDocCleanEvents
Overview | Refer to Cleaning - up 1-Bit Images.

Remarks

(Persistent property, available at design time) Specifies whether LEADTOOLS generates events when the document cleanup functionality are called. The document cleanup functionality along with their corresponding events are listed below:

LEADRasterProcess method | LEADRasterProcess Event
Smooth method | Smooth event
LineRemove method | LineRemove event
DotRemove method | DotRemove event
InvertedText method | InvertedText event
BorderRemove method | BorderRemove event
HolePunchRemove method | HolePunchRemove event

Setting EnableDocCleanEvents to TRUE and then calling one of the LEADRasterProcess methods in the table above will cause the corresponding event to be generated. Setting EnableDocCleanEvents to FALSE will disable the events for the DocClean methods.

Setting | Description
TRUE | Generate DocClean events.
FALSE | If this property is set to FALSE, the DocClean events will not be generated..

See Also

Elements:

Smooth method, Smooth event, LineRemove method, LineRemove event, DotRemove method, DotRemove event, InvertedText method, InvertedText event, BorderRemove method, BorderRemove event, HolePunchRemove method, HolePunchRemove event


Factor property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Factor (long lIndex)
Overview | Refer to Removing Noise

Remarks

Gets or sets values that represent weights associated with the bitmaps in the bitmap list (BItmapList property). Used only if the lFlag parameter for the AddWeightedBitmaps method is BC_ADDWEIGHTED or BC_AVGWEIGHTED.

See Also

Elements: | FactorCount property, AddWeightedBitmaps method
Topics: | Raster Images: Combining Images
 | Raster Images: Modifying Intensity Values


FactorCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short FactorCount
Overview | Refer to Removing Noise

Remarks

Gets or sets the number of weighted values in the Factor property.

You must set this property before using the Factor property.

See Also

Elements: | Factor property, AddWeightedBitmaps method
Topics: | Raster Images: Combining Images
 | Raster Images: Modifying Intensity Values


FeretsDiameterLength property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long FeretsDiameterLength
Overview | Refer to Creating and Using a Bitmap Region

Remarks

Read Only) Gets the length of the Feret’s diameter. The length is measured in pixels and is internally multiplied by 1000. Divide this value by 1000 to obtain the real length.

This property is updated by the GetFeretsDiameter method.

See Also

Elements: | GetFeretsDiameter method, FeretsFirstIndex property, FeretsSecondIndex property, ContourX property, ContourY property, ContoursCount property
Topics: | Raster Images: Creating and Using a Region


FeretsFirstIndex property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long FeretsFirstIndex
Overview | Refer to Creating and Using a Bitmap Region

Remarks

(Read Only) Gets the index of the first end point of the Feret’s diameter.

This property is updated by the GetFeretsDiameter method.

See Also

Elements: | GetFeretsDiameter method, FeretsDiameterLength property, FeretsSecondIndex property, ContourX property, ContourY property, ContoursCount property
Topics: | Raster Images: Creating and Using a Region


FeretsSecondIndex property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long FeretsSecondIndex
Overview | Refer to Creating and Using a Bitmap Region

Remarks

(Read Only) Gets the index of the second end point of the Feret’s diameter.

This property is updated by the GetFeretsDiameter method.

See Also

Elements: | GetFeretsDiameter method, FeretsDiameterLength property, FeretsSecondIndex property, ContourX property, ContourY property, ContoursCount property
Topics: | Raster Images: Creating and Using a Region


FileName property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | BSTR FileName
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets the string that contains the file name that will be added to or extracted from an image.

When adding a message to a bitmap this property refers to the name of the file that will be added, and the Message property must be set to NULL, otherwise this property has no effect.

See Also

Elements: | Message property, Password property, Directory property, StartX property, StartY property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


GrayColorBlue property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayColorBlue (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Gets or sets an array of blue color values used for coloring the specified range of intensities set in the GrayColorThreshold property at the specified index.

See Also

Elements: | ColorizeGray method, GrayColorRed method, GrayColorGreen property, GrayColorThreshold property GrayColorCount property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayColorCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayColorCount
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Gets or sets the number of entries in the GrayColorRed, GrayColorGreen, and GrayColorBlue properties. It can be any number as long as it corresponds to the size of the above mentioned properties. 1 means there is one entry, 2 means there is two entries. If you set it to 0 then the ColorizeGray method will return an error code.

See Also

Elements: | ColorizeGray, GrayColorRed, GrayColorGreen property, GrayColorBlue, GrayColorThreshold property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayColorGreen property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayColorGreen (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Gets or sets an array of green color values used for coloring the specified range of intensities set in the GrayColorThreshold property at the specified index.

See Also

Elements: | ColorizeGray method, GrayColorRed property, GrayColorBlue property, GrayColorThreshold property, GrayColorCount property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayColorRed property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayColorRed (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Gets or sets an array of red color values used for coloring the specified range of intensities set in the GrayColorThreshold property at the specified index.

See Also

Elements: | ColorizeGray method, GrayColorGreen property, GrayColorBlue property, GrayColorThreshold property, GrayColorCount property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayColorThreshold property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long GrayColorThreshold (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits.) Gets or sets the maximum value of the pixels which will be colored by the ColorizeGray method.

The pixels with a value smaller than this will have the color that has been set in the GrayColorRed , GrayColorGreen and GrayColorBlue properties.

The maximum value depends on the image bits per pixel. For 8, 12 and 16-bit images the maximum value is 255, 4095 and 65535 respectively. However if you enter a value higher than the maximum, the value will be clipped at the maximum value.

See Also

Elements: | ColorizeGray method, GrayColorRed property, GrayColorGreen property, GrayColorThreshold property, GrayColorCount property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayScaleBlue property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayScaleBlue (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits) Gets or sets an array of blue color values for the colors to be mixed with or replace the original gray values in the GrayScaleToDuotone method.

See Also

Elements: | GrayScaleToDuotone method, GrayScaleGreen property, GrayScaleRed property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayScaleGreen property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayScaleGreen (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits) Gets or sets an array of green color values for the colors to be mixed with or replace the original gray values in the GrayScaleToDuotone method.

See Also

Elements: | GrayScaleToDuotone method, GrayScaleBlue property, GrayScaleRed property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


GrayScaleRed property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GrayScaleRed (short iIndex);
Overview | Refer to Grayscale Images

Remarks

(Raster Pro and above toolkits) Gets or sets an array of red color values for the colors to be mixed with or replace the original gray values in the GrayScaleToDuotone method.

See Also

Elements: | GrayScaleToDuotone method, GrayScaleGreen property, GrayScaleBlue property
Topics: | Raster Image Functions: Doing Color Expansion or Reduction


Green property (ILEADRasterProcess)

Green property (ILEADBalanceData)

Visual Basic example

Visual C++ example

Syntax | short Green
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets a value to be used for adjusting or balancing the green channel for the ColorIntensityBalance method. Valid values range from –100 to 100. Values > 0 increase the green component. Values < 0 decrease the green component. Using 0 leaves the green component unchanged.

Elements: | ColorIntensityBalance method, MidTone property, HighLight property Shadow property, Blue property, Red property
Topics: | Raster Images: Modifying Intensity Values


GreenGamma property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GreenGamma
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the gamma value. This value is used to modify the midtones for the green channel of the image. The value in this member is a 100 times the actual value. Therefore, if GreenGamma = 167 then the actual gamma value is 1.67. Likewise, if you want to use a gamma of 1.75, set this member to 175. The default value is DEFAULT_GAMMA, which is 100 (actual gamma value of 1.00) which does not change the gamma value of the image.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMaxOutput property, RedMinOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


GreenMaxInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GreenMaxInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s highlights to be mapped for the green channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a highlight and will be remapped to the value in GreenMaxOutput property.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, MasterMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


GreenMaxOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GreenMaxOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the highlights will be mapped for the green channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


GreenMinInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GreenMinInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s shadows to be mapped for the green channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a shadow and will be remapped to the value in GreenMinOutput.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, MasterMinInput property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


GreenMinOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short GreenMinOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the shadows will be mapped for the green channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


Highlight property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | ILEADBalanceData * Highlight
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets an ILEADBalanceData object that is used to control the bright tones for the ColorIntensityBalance method.

See Also

Elements: | ColorIntensityBalance method, MidTone property, Shadow property
Topics: | Raster Images: Modifying Intensity Values


hDocCleanRgn property (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long hDocCleanRgn
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) Window HRGN that is updated with a Windows region that contains all the elements removed by one of the Document Cleanup methods listed below. This property is updated when the method returns. It is updated only if the XXX_SINGLE_REGION flag is set in the Flags parameter of one of the following methods:

BorderRemove method

DotRemove method

HolePunchRemove method

InvertedText method

LineRemove method

Smooth method

Set this property to 0 at any time to free the resources associated with it.

See Also

Elements: | BorderRemove method, DotRemove method, HolePunchRemove method, InvertedText method, LineRemove method, Smooth method
Topics: | Raster Images: Cleaning - up 1-Bit Images


HistogramGrayTableSize property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long HistogramGrayTableSize ();
Overview | Refer to Using Histograms.

Remarks

(Read Only) (Medical only) Is the number of entries in the HistogramGrayTable. This property (along with the HistogramGrayTable) is filled after each call to the GetHistogramGray method.

Intensity levels in a grayscale bitmap can range from 0 to( 216 – 1), depending on whether the image is 12-bit or 16-bit grayscale, and the LowBit and HighBit of the image. The LowBit and HighBit identify which bits in a 12-bit or 16-bit entry are used. The LowBit and HighBit can be obtained by calling the GetMinMaxBits method and then looking at the MinBit and MaxBit properties.

Specifically, a histogram table for a 12-bit or 16-bit grayscale image will have 2(HighBit – LowBit + 1) entries.

Each intensity value present in the image corresponds to a specific table index. The number of entries in the HistogramGrayTable property can be found by examining the HistogramGrayTableSize property. The HistogramGrayTableSize property and the HistogramGrayTable property both can change after each call to the GetHistogramGray method. For more information on the relationship between the intensity value and the location of the count within the HistogramGrayTable, refer to the GetHistogramGray method.

See Also

Elements: | GetHistogramGray method, HistogramGrayTableSize property, GetHistogram method, HistogramTable property
Topics: | Raster Images: Using Histograms
 | Changing Brightness and Contrast


HistogramGrayTable property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long HistogramGrayTable (long nIndex);
Overview | Refer to Using Histograms.

Remarks

(Medical only) Is a table that charts the number of occurrences of each intensity level in a 12-bit or 16-bit grayscale bitmap.

Intensity levels in a grayscale bitmap can range from 0 to ( 216 – 1), depending on whether the image is 12-bit or 16-bit grayscale, and the LowBit and HighBit of the image. The LowBit and HighBit identify which bits in a 12-bit or 16-bit entry are used. The LowBit and HighBit can be obtained by calling the GetMinMaxBits method and then looking at the MinBit and MaxBit properties

Specifically, a histogram table for a 12-bit or 16-bit grayscale image will have 2(HighBit – LowBit + 1) entries.

Each intensity value present in the image corresponds to a specific table index. The number of entries in the HistogramGrayTable can be found by examining the HistogramGrayTableSize property. The HistogramGrayTableSize property and the HistogramGrayTable property both can change after each call to the GetHistogramGray method. For more information on the relationship between the intensity value and the location of the count within the HistogramGrayTable, refer to the GetHistogramGray method.

See Also

Elements: | GetHistogramGray method, HistogramGrayTableSize property, GetHistogram method, HistogramTable property
Topics: | Raster Images: Using Histograms
 | Changing Brightness and Contrast


HistogramTable property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long HistogramTable (long iIndex);
Overview | Refer to Using Histograms.

Remarks

Is a table that charts the number of occurrences of each intensity level in the bitmap.

Intensity levels range from:

Range | Meaning
0 to 255 | for bitmaps other than 12 or 16-bit grayscale.
0 to 4095 | for 12-bit bitmaps.
0 to 65535 | for 16-bit bitmaps.

The current intensity values correspond to the table indexes. You can load the table with values for red, green, blue, or all color channels. Use the GetHistogram method to update the table.

See Also

Topics: | Raster Images: Using Histograms
 | Changing Brightness and Contrast


HistogramTableSize property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long HistogramTableSize;
Overview | Refer to Using Histograms.

Remarks

Specifies the number of entries in the HistogramTable property.

This value that must be set for this property depends on the color resolution (bits per pixel) of the image, as follows:

Table Size | BPP
65536 | 64 or 48
256 | Any other color (non-grayscale) value, or grayscale 8

For 12 and 16 bit grayscale images, use the HistogramGrayTableSize property

See Also

Elements: | HistogramTable property, GetHistogram method, HistogramGrayTableSize property
Topics: | Raster Images: Using Histograms
 | Changing Brightness and Contrast


HSICount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSICount
Overview | Refer to Correcting Colors

Remarks

Gets or sets the number of elements in the HSIHue, HSISaturation,

HSIIntensity, HSIOuterLow, HSIOuterHigh, HSIInnerLow; HSIInnerHigh properties.

This property must be set before you can assign values to the other HIS properties.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIHue property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIHue(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the hue color range information used by the HueSaturationIntensity method.

The hue information is the angular amount to change the hue, in hundredths of degrees at the specified index. Valid values range from –18000 through 18000. This value is divided internally by 100.

See Also

Elements: | HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIInnerHigh property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIInnerHigh (long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the end of the color range to be fully changed at the specified index. The valid range is between the HSIOuterLow property and HSIOuterHigh property values.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIInnerLow property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIInnerLow(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the start of the color range to be fully changed at the specified index.

The valid range is between the HSIOuterLow property and HSIOuterHigh property values.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIIntensity property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIIntensity(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the color range intensity information used by the HueSaturationIntensity method.

The intensity information is the percentage by which to change the intensity , in tenths of percent at, the specified index. Valid values range from –1000 through 1000. This value is divided internally by 10.

See Also

Elements: | HSIHue property, HSISaturation property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIOuterHigh property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIOuterHigh(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the end of the color range to be changed, at the specified index. Valid values range from –359 through 359.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIInnerLow property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSIOuterLow property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSIOuterLow(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the start of the color range to be changed, at the specified index. Valid values range from –359 through 359.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HSISaturation property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HSISaturation(long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the saturation color range information used by the HueSaturationIntensity method.

The saturation information is the percentage by which to change the saturation, in tenths of a percent, at the specified index. Valid values range from –1000 through 1000. This value is divided internally by 10.

See Also

Elements: | HSIHue property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HSICount property, HueSaturationIntensity method
Topics: | Raster Images: Modifying Intensity Values


HTable property (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short HTable (long lIndex);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Hue lookup table. This is one of the four tables that the RemapHue method uses to change the bitmap's hue, saturation and value. This property is used only if the bUseHTable parameter is set to TRUE when the RemapHue method is called. Hue, Saturation, and Value levels range from 0 to 255. The current hue, saturation and value of a pixel correspond to the table indexes. If the bUseMaskTable parameter is set to TRUE when the RemapHue method is called and the MaskTable(i) entry for a particular hue is not zero, then the hue is changed to the hue in HTable(i). If MaskTable(i) is 0 then HTable(i) is ignored. For example, if RemapHue is called with both bUseMaskTable and bUseHTable set to TRUE, then if a pixel has a hue of 85 and the MaskTable(85) is not 0, the hue of the pixel is changed to HTable(85).

Traditionally, hue ranges from 0 to 359. For the lookup table, the range of 0 to 359 is remapped to a range of 0..255. For example,

Color | Hue(0..359) | Hue(0..255)
Red | 0 | 0
Green | 120 | 85
Blue | 240 | 170

See Also

Elements: | RemapHue method, MaskTable property, STable property, VTable property, HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Modifying Intensity Values


HueSaturationIntensity Method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short HueSaturationIntensity (ILEADRaster* pRaster, short iHue, short iSaturation, short iIntensity)
Overview | Refer to Correcting Colors

Remarks

Changes the hue, saturation and brightness of all or specified colors in the image.

This method combines the basic functionality found in the Hue Saturation, and Intensity methods. In addition, special options can be specified in the HSIHue, HSISaturation, HSIIntensity, HSIOuterLow, HSIOuterHigh, HSIInnerLow; HSIInnerHigh properties.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | HSIHue property, HSISaturation property, HSIIntensity property, HSIOuterLow property, HSIOuterHigh property, HSIInnerLow property, HSIInnerHigh property, HSICount property, Intensity method, GammaCorrect method, Contrast method, HistoContrast method, StretchIntensity method, RemapIntensity method, Invert method, Saturation method, HistoEqualize method, Fill method, GetHistogram method, WindowLevel method, EdgeDetector method, MathFunction method, RevEffect method, Segment method, SubtractBackground method
Topics: | Raster Images: Modifying Intensity Values


LightAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightAngle
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the light angle, in hundredths of a degree. This property is used if the LightFlags property is set to FL_TRIGONOMETRY or to FL_FREEHAND. Valid values for range from -18000 to 18000. This value is divided internally by 100.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightAvr property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LightAvr (short iIndex);
Overview | Refer to Changing Brightness and Contrast

Remarks

Gets or sets the new average pixel value at the specified for the entire bitmap in the bitmap. The size of this property equals either one if lFlag is YUV_SPACE or GRAY_SPACE or three if lFlag is RGB_SPACE where the first element corresponds to the new blue upper side average value, the second element to the green, and the last element to the red.

See Also

Elements: | LightControl method, LightUpperAvr property, LightLowerAvr property
Topics: | Raster Image Functions: Modifying Intensity Values


LightBlueAmplitude property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightBlueAmplitude
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits.) Gets or sets a value that represents the amplitude of the blue channel, if FL_ADD is set in the LightFlags property.

This property is ignored when grayscale images are used or when FL_MUL or FL_LINEAR_QUADRATIC is set in the LightFlags property.

Possible values for the LightBlueAmplitude property are from 0–100.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightFlags property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightFlags
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a flag that indicates how the light is generated. Possible values are:

Value | Meaning
FL_LINEAR_QUADRATIC | [0x1000] If this flag is set, the light will be computed according to the distance from the center which is represented by LightXOrigin and LightYOrigin properties, The brightness increase for every pixel is proportional to the distance to the effect’s center. If this flag is set, do not set FL_TRIGONOMETRY or FL_FREEHAND.
FL_TRIGONOMETRY | [0x2000] If this flag is set then the light will be generated by a sine or cosine function. If this is set, the LightFrequency, LightAngle, LightXOrigin and LightYOrigin properties are used to compute the light. If this flag is set, do not set FL_LINEAR_QUADRATIC or FL_FREEHAND.
FL_FREEHAND | [0x4000] If this flag is set, the user will pass the light shape in the UserShape property. If this flag is set, the LightAngle, UserShape and UserShapeCount properties will be used. The LightAngle property will determine the angle of the light lines compared to the X axis. If this flag is set, do not set FL_LINEAR_QUADRATIC or FL_TRIGONOMETRY.
FL_LINEAR_INNER | [0x0001] The linear light will be concentrated at the center (LightXOrigin, LightYOrigin ) and will decrease as it moves away from the center. This flag is valid only if FL_LINEAR_QUADRATIC is also set.
FL_LINEAR_OUTER | [0x0002] The linear light will be concentrated at the far points from the center and will decrease inwards towards the center (LightXOrigin, LightYOrigin ). This flag is valid only if FL_LINEAR_QUADRATIC is also set.
FL_QUADRATIC_INNER | [0x0004] The Quadratic light will be concentrated at the center (LightXOrigin, LightYOrigin ) and will decrease as it moves away from the center. This flag is valid only if FL_LINEAR_QUADRATIC is also set.
FL_QUADRATIC_OUTER | [0x0008] The Quadratic light will be concentrated at the far points from the center and will decrease inwards towards the center (LightXOrigin, LightYOrigin ). This flag is valid only if FL_LINEAR_QUADRATIC is also set.
FL_UNIDIRECTION | [0x0010] A sine or cosine function will generate the light as lines. This flag is valid only if FL_TRIGONOMETRY is also set. The lines are parallel and have no center. The LightAngle property determines the angle formed by these lines with the X axis.
FL_CIRCLES | [0x0020] Sine or cosine function will generate the light as circles around the center (LightXOrigin, LightYOrigin). This flag is valid only if FL_TRIGONOMETRY is also set.
FL_ADD | [0x0040] The LightRedAmplitude, LightGreenAmplitude, and LightBlueAmplitude properties are multiplied with the results of the selected function (sine, cosine, freehand). The results are then added to the pixel values of the equivalent channel. These functions as well as the real buffer values are from –1 to 1. This flag is valid only if FL_TRIGONOMETRY or FL_FREEHAND is also set.
FL_MUL | [0x0080] Multiply the color factor specified by the LightGreenAmplitude proeprty with the results of the selected function (sine, cosine, freehand). The results are multiplied with every channel value. This flag is valid only if FL_TRIGONOMETRY or FL_FREEHAND is also set.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightFrequency property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightFrequency
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the frequency of the light. This property is used if the LightFlags property is set to FL_TRIGONOMETRY or to FL_FREEHAND. Valid values range from 1 – 10000. This value is divided internally by 100 (corresponding to a real interval of 0.01 – 100.0).

See Also

Elements: | LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightGreenAmplitude property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightGreenAmplitude
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits.) Gets or sets a value that represents the amplitude of the green channel, if FL_ADD is set in the LightFlags property.

This property is ignored when grayscale images are used or when FL_MUL or FL_LINEAR_QUADRATIC is set in the LightFlags property.

Possible values for the LightGreenAmplitude property are from 0–100.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightLowerAvr property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LightLowerAvr (short iIndex);
Overview | Refer to Changing Brightness and Contrast

Remarks

Gets or sets a new average pixel value at the specified index for those pixels with values between the average pixel value for the entire bitmap and the highest pixel value. The size of the array equals one, if lFlag in the LightControl method is set to YUV_SPACE or GRAY_SPACE, or three, if lFlag is RGB_SPACE. If lFlag is RGB_SPACE the first element corresponds to the new blue lower average value, the second element to the green, and the last element to the red.

See Also

Elements: | LightControl method, LightUpperAvr property, LightAvr property
Topics: | Raster Image Functions: Modifying Intensity Values


LightPhase property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightPhase
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the phase shift angle, in hundredths of a degree. This property is used if the LightFlags property is set to FL_TRIGONOMETRY. Possible values for LightPhase are from -18000 to 18000. This value will be divided internally by 100.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightRedAmplitude property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightRedAmplitude
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits.) Gets or sets a value that represents the amplitude of the master channel or the amplitude of the red channel.

If the bitmap is grayscale, this property represents the amplitude of the master channel. If the bitmap is color and FL_MUL or FL_LINEAR_QUADRATIC is set in the LightFlags property, this property represents the amplitude of each channel. If the bitmap is color and FLB_ADD is set in the LightFlags property, this represents the amplitude of the red channel. This value is an integer with a value greater than or equal to 0. This value will be multiplied with the results of the selected function (sine, cosine, UserShape, …). These results are then added to the pixel values. These values as well as the real buffer values are from –1 to 1.

Possible values for the LightRedAmplitude property are from 0–100.

See Also

Elements: | LightFrequency property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightUpperAvr property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short LightUpperAvr (short iIndex);
Overview | Refer to Changing Brightness and Contrast

Remarks

Gets or sets a new average pixel value at the specified index for those pixels with values between 0 and the average pixel value for the entire bitmap. The size of the array equals one, if lFlag in the LightControl method is set to YUV_SPACE or GRAY_SPACE, or three, if lFlag is RGB_SPACE. If lFlag is RGB_SPACE the first element corresponds to the new blue lower average value, the second element to the green, and the last element to the red.

See Also

Elements: | LightControl method, LightUpperAvr property, LightAvr property
Topics: | Raster Image Functions: Modifying Intensity Values


LightXOrigin property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightXOrigin
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the X coordinate of the origin, in pixels. This property is used if the LightFlags property is set to FL_TRIGONOMETRY and FL_CIRCLES or to FL_LINEAR_QUADRATIC.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightYOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LightYOrigin property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long LightYOrigin
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the Y coordinate of the origin, in pixels. This property is used if the LightFlags property is set to FL_TRIGONOMETRY and FL_CIRCLES or to FL_LINEAR_QUADRATIC.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightPhase property, UserShapeCount property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


LineProfileBlue property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LineProfileBlue(long iIndex);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Array that contains the blue values for the line that was specified in the LineProfile method.

The number of points in the array is contained in the LineProfileSize property.

This property is updated by the LineProfile method.

See Also

Elements: | LineProfile method, LineProfileRed property, LineProfileGreen property, LineProfileSize property
Topics: | Raster Images: Getting Current Information


LineProfileGreen property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LineProfileGreen(long iIndex);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Array contains the green values for the line that was specified in the LineProfile method.

The number of points in the array is contained in the LineProfileSize property.

This property is updated by the LineProfile method.

See Also

Elements: | LineProfile method, LineProfileRed property, LineProfileBlue property, LineProfileSize property
Topics: | Raster Images: Getting Current Information


LineProfileRed property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LineProfileRed(long iIndex);
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Array that contains the red values for the line that was specified in the LineProfile method.

The number of points in the array is contained in the LineProfileSize property.

This property is updated by the LineProfile method.

See Also

Elements: | LineProfile method, LineProfileGreen property, LineProfileBlue property, LineProfileSize property
Topics: | Raster Images: Getting Current Information


LineProfileSize property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LineProfileSize();
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Indicates the size of the arrays (LineProfileRed, LineProfileGreen and LineProfileBlue properties) used to store the R, G and B profile for each pixel in a line.

This property is updated by the LineProfile method.

See Also

Elements: | LineProfile method, LineProfileRed property, LineProfileGreen property, LineProfileBlue property
Topics: | Raster Images: Getting Current Information


LUTColorsCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

long LUTColorsCount

Remarks

(Read only) Gets the number of entries between the start color and the end color of the CountLUTColors method.

See Also

Elements: | LUTColorsFirstIndex property, CountLUTColors method
Topics: | Raster Images: Palettes


LUTColorsFirstIndex property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

long LUTColorsFirstIndex

Remarks

(Read only) Gets the index of the last occurrence of the starting color of the CountLUTColors method.

See Also

Elements: | LUTColorsCount property, CountLUTColors method
Topics: | Raster Images: Palettes


Message property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | BSTR Message
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets text that will be added to or extracted from an image.

When adding a message to a bitmap this property refers to the text message that will be added. If you want to add a file, set this property to NULL.

See Also

Elements: | Password property, FileName property, Directory property, StartX property, StartY property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


MultitoneColors property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | OLE_COLOR MultitoneColors (short iIndex);
Overview | Refer to Grayscale Images

Remarks

Gets or sets an array of RGB colors, that will be added to the grayscale bitmap. This property is ignored when the DistType parameter of GrayScaleToMultitone is set to DT_USER. If the toolkit is generating the gradient colors, the user sets the desired base color(s) in this parameter when GrayScaleToMultitone is called. The number of entries in the array depends on the value of ToneType: 1 for DT_MONOTONE, 2 for DT_DUOTONE, 3 for DT_TRITONE, 4 for DT_QUADTONE. When the toolkit generates the array of gradient colors, this parameter will be updated with that array.

See Also

Elements: | GrayScaleToMultitone method, MultitoneGradient property
Topics: | Using Color Values in LEADTOOLS


MultitoneGradient property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | OLE_COLOR MultitoneGradient (short iRow, short iCol);
Overview | Refer to Grayscale Images

Remarks

Gets or sets a user-defined array of palette entries that will hold the set of color shade gradients. This property is used when the DistType parameter of the GrayScaleToMultitone method is set to DT_USER.

See Also

Elements: | GrayScaleToMultitone method, MultitoneColors property
Topics: | Using Color Values in LEADTOOLS


ObjectOrientationAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ObjectOrientationAngle
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read Only) Gets the orientation angle of the object’s axis. Valid values are in degrees from –180.00 to 180.00, with negative values produced from clockwise rotation and where 0 is the horizon.

This property is updated by the GetObjectInfo method.

See Also

Elements: | ObjectXPos property, ObjectYPos property, ObjectRoundness property, GetObjectInfo method
Topics: | Raster Images: Analysis Image Object or Region Analysis


ObjectRoundness property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ObjectRoundness
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read Only) Gets the object’s roundness( compactness ). This ratio will be 0 for a line and 100 for a circle.

This property is updated by the GetObjectInfo method.

See Also

Elements: | ObjectXPos property, ObjectYPos property, ObjectOrientationAngle property, GetObjectInfo method
Topics: | Raster Images: Analysis Image Object or Region Analysis


ObjectXPos property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ObjectXPos
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read OnlyGets the x coordinate (in pixels) of the object’s center of mass. To get the actual results, divide this property by 100.

This property is updated by the GetObjectInfo method.

See Also

Elements: | ObjectYPos property, ObjectOrientationAngle property, ObjectRoundness property, GetObjectInfo method
Topics: | Raster Images: Analysis Image Object or Region Analysis


ObjectYPos property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ObjectYPos
Overview | Refer to Bitmaps and Bitmap Lists

Remarks

(Read Only) Gets the y coordinate (in pixels) of the object’s center of mass. To get the actual results, divide this property by 100.

This property is updated by the GetObjectInfo method.

See Also

Elements: | ObjectXPos property, ObjectOrientationAngle property, ObjectRoundness property, GetObjectInfo method
Topics: | Raster Images: Analysis Image Object or Region Analysis


Mark property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | ILEADMarkInfo * Mark (long lIndex);
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets an array of ILEADMarkInfo objects that contain information used when searching for registration marks.

To search for registration marks, call the SearchRegMarks method.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, MarksCount property, SearchRegMarks method
Topics: | Raster Images: Document Imaging


MarkCMPointX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long MarkCMPointX (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets an array of X coordinates that represent the center of mass for each corresponding registration mark specified in the MarkPointX and MarkPointY properties.

See Also

Elements: | GetMarksCenterMass method, MarkPointX property, MarkPointY property, MarkCMPointY property
Topics: | Raster Images: Document Imaging


MarkCMPointY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long MarkCMPointY (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets an array of Y coordinates that represent the center of mass for each corresponding registration mark specified in the MarkPointX and MarkPointY properties.

See Also

Elements: | GetMarksCenterMass method, MarkPointX property, MarkPointY property, MarkCMPointX property
Topics: | Raster Images: Document Imaging


MarkPointX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long MarkPointX (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array of X coordinates for points that represent the location of registration marks.

See Also

Elements: | GetMarksCenterMass method, MarkPointY property, MarkCMPointX property, MarkCMPointY property
Topics: | Raster Images: Document Imaging


MarkPointY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long MarkPointY (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array of Y coordinates for points that represent the location of registration marks.

See Also

Elements: | GetMarksCenterMass method, MarkPointX property, MarkCMPointX property, MarkCMPointY property
Topics: | Raster Images: Document Imaging


MarksCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long MarksCount
Overview | Refer to Detecting Registration Marks

Remarks

(Document/Medical only) Gets or sets the number of entries in the Mark property.

See Also

Elements: | Height property, Type property, Width property, MinScale property, MaxScale property, Top property, Left property, Right property, NumberOfExpectedMarks property, Bottom property, DetectedMarkCount property, DetectedMarkPointX property, DetectedMarkPointY property, MarksCount property, SearchRegMarks method.
Topics: | Raster Images: Document Imaging


MaskTable property (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MaskTable (long lIndex);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Lookup table that identifies the valid values in the HTable. This is one of the four tables that the RemapHue method uses to change the bitmap's hue, saturation and value. Hue, Saturation, and Value levels range from 0 to 255. The current hue, saturation and value of a pixel correspond to the table indexes. If the bUseMaskTable parameter is set to TRUE when the RemapHue method is called, then this table is used to identify which values in the HTable property are valid. If MaskTable(i) is non-zero, then HTable(i) is to be used. If MaskTable(i) is 0 then HTable(i) is ignored.

See Also

Elements: | RemapHue method, HTable property, STable property, VTable property, HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Modifying Intensity Values


MasterGamma property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MasterGamma
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the gamma value. This value is used to modify the midtones of the image. The value in this member is a 100 times the actual value. Therefore, if MasterGamma = 167 then the actual gamma value is 1.67. Likewise, if you want to use a gamma of 1.75, set this member to 175. The default value is DEFAULT_GAMMA, which is 100 (actual gamma value of 1.00) which does not change the gamma value of the image.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


MasterMaxInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MasterMaxInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s highlights to be mapped. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a highlight and will be remapped to the value in MasterMaxOutput property.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


MasterMaxOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MasterMaxOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the highlights will be mapped. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinInput property, MasterMinOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


MasterMinInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MasterMinInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s shadows to be mapped. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a shadow and will be remapped to the value in the MasterMinOutput property.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


MasterMinOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short MasterMinOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the shadows will be mapped. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinIntput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


MidTone property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | ILEADBalanceData * MidTone
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets an ILEADBalanceData object that is used to control the medium tones for the ColorIntensityBalance method.

See Also

Elements: | ColorIntensityBalance method, Shadow property, HighLight property
Topics: | Raster Images: Modifying Intensity Values


OverlayAttributes property (ILEADRasterProcess)

Visual Basic example

Visual C++ 6.0 example

Syntax | ILEADOverlayAttributes * OverlayAttributes
Overview | Refer to Overlays Overview.

Remarks

(Medical only) Gets or sets the attributes of an overlay.

When setting the attributes of an overlay, the properties specified by the OverlayAttributes property should be set to the desired values before calling the SetOverlayAttributes method. These properties are listed below:

ActivationLayer property

BitPosition property

BitsAllocated property

Color property

Columns property

Description property

Flags property

ImageFrameOrigin property

Label property

NumberFramesInOverlay property

OriginX property

OriginY property

ROIArea property

ROIMean property

ROIStandardDeviation property

Rows property

Subtype property

Type property

See Also

Elements: | OriginX property, Color property, Flags property, BitPosition property, OriginY property, Rows property, Type property, BitsAllocated property, Columns property, Description property, Subtype property, Label property, ROIMean property, ROIStandardDeviation property, ROIArea property, ImageFrameOrigin property, NumberFramesInOverlay property, GetOverlayCount method, ActivationLayer property, SetOverlayAttributes method, GetOverlayAttributes method, GetOverlayBitmap method, SetOverlayBitmap method, UpdateOverlayBits method
Topics: | Raster Images: Combining Images


Password property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | BSTR Password
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets a string that contains the password that will be used when adding the message to or extract the message from the bitmap. To use the default password set this parameter to NULL. The default password is "LEAD Technologies".

See Also

Elements: | Message property, FileName property, Directory property, StartX property, StartY property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


PerspectivePointsX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short PerspectivePointsX (long lIndex);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Raster Pro and above only) Gets or sets the X-axis coordinates of the new locations of image corners, It should contain four values; values at indices 0, 1, 2 and 3 determine the new x-axis coordinates of the left-top, right-top, left-bottom and right-bottom image corners respectively.

See Also

Elements: | Perspective method, PerspectivePointsY property, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Spherize method
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images.


PerspectivePointsY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short PerspectivePointsY (long lIndex);
Overview | Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

(Raster Pro and above only) Gets or sets the Y-axis coordinates of the new locations of image corners, It should contain four values; values at indices 0, 1, 2 and 3 determine the new y-axis coordinates of left-top, right-top, left-bottom and right-bottom image corners respectively.

See Also

Elements: | Perspective method, PerspectivePointsX property, AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Swirl method, Wave method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method, Spherize method
Topics: | Raster Images: Doing Geometric Transformations.
 | Raster Images: Filtering Images.


Red property (ILEADRasterProcess)

Red property (ILEADBalanceData)

Visual Basic example

Visual C++ example

Syntax | short Red
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets a value to be used for adjusting or balancing the red channel for the ColorIntensityBalance method. Valid values range from –100 to 100. Values > 0 increase the red component. Values < 0 decrease the red component. Using 0 leaves the red component unchanged.

Elements: | ColorIntensityBalance method, MidTone property, HighLight property Shadow property, Blue property, Green property
Topics: | Raster Images: Modifying Intensity Values


RedGamma property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RedGamma
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that represents the gamma value. This value is used to modify the midtones for the red channel of the image. The value in this member is a 100 times the actual value. Therefore, if RedGamma = 167 then the actual gamma value is 1.67. Likewise, if you want to use a gamma of 1.75, set this member to 175. The default value is DEFAULT_GAMMA, which is 100 (actual gamma value of 1.00) which does not change the gamma value of the image.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMaxOutput property, RedMinOutput property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


RedMaxInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RedMaxInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s highlights to be mapped for the red channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a highlight and will be remapped to the value in RedMaxOutput property.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


RedMaxOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RedMaxOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the highlights will be mapped for the red channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMinOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


RedMinInput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RedMinInput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the image’s shadows to be mapped for the red channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images. Any value greater than or equal to this will be considered a shadow and will be remapped to the value in RedMinOutput.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, MasterMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


RedMinOutput property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short RedMinOutput
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the value to which the shadows will be mapped for the red channel. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.

This property is updated by the AutoColorLevel method, if the lFlags parameter is AUTO_NOPROCESS.

Set this property before calling the ColorLevel method to have the ColorLevel method use this value.

See Also

Elements: | MasterMinInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, MasterMaxInput property, RedMaxInput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method, AutoColorLevel method
Topics: | Raster Image Functions: Modifying Intensity Values


RemapHueTablesSize Property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RemapHueTablesSize
Overview | Refer to Changing Brightness and Contrast.

Remarks

Gets or sets the number of entries in the RemapHue tables. Possible values are:

Value | Meaning
65536 | For 16-bit gray or 48-bit images.
4096 | For 12-bit images.
256 | For other-bits images.
 | The RemapHue tables are the HTable, STable, VTable and the MaskTable.

See Also

Elements: | RemapHue method, ShowRemapHueDlg method , MaskTable property, HTable property, STable property, VTable property
Topics: | Raster Images: Modifying Intensity Values


ReferencePointsX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long ReferencePointsX (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array X coordinates for the center of mass points for the registration marks in the reference bitmap. The user is responsible for providing this information.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, TransformationAngle property, XTranslation property, XScale property, ReferencePointsY property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


ReferencePointsY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long ReferencePointsY (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array Y coordinates for the center of mass points for the registration marks in the reference bitmap. The user is responsible for providing this information.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, TransformationAngle property, XTranslation property, XScale property, ReferencePointsX property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


ReplaceColorFuzziness property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ReplaceColorFuzziness (long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets an array of variance values used to indicate the range of colors to be replaced for the specified index. This must be a nonzero value.

See Also

Elements: | ReplaceColorValue property, ReplaceColorsCount property, ColorReplace method
Topics: | Raster Images: Modifying Intensity Values


ReplaceColorsCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ReplaceColorsCount
Overview | Refer to Correcting Colors

Remarks

Gets or sets the number of elements in the ReplaceColorValue, and ReplaceColorFuzziness properties.

This property must be set before you can set the ReplaceColorValue and ReplaceColorFuzziness properties.

See Also

Elements: | ReplaceColorValue property, ReplaceColorFuzziness property, ColorReplace method
Topics: | Raster Images: Modifying Intensity Values


ReplaceColorValue property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ReplaceColorValue (long lIndex)
Overview | Refer to Correcting Colors

Remarks

Gets or sets the OLE_COLOR value that specifies the color to be replaced, at the specified index. You can specify an OLE_COLOR value such as the return value of the Windows RGB macro.

See Also

Elements: | ReplaceColorFuzziness property, ReplaceColorsCount property, ColorReplace method
Topics: | Raster Images: Modifying Intensity Values
 | Using Color Values in LEADTOOLS


RemapTable property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long RemapTable (long iIndex);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Is the lookup table that the RemapIntensity method uses to change the bitmap's intensity values.

Intensity levels range from:

Range | Meaning
0 to 255 | for bitmaps other than 12 or 16-bit grayscale.
0 to 4095 | for 12-bit bitmaps.
0 to 65535 | for 16-bit bitmaps.

The current intensity values correspond to the table indexes. The values of the entries are the new values to be applied.

See Also

Elements: | RemapIntensity method
Topics: | Raster Images: Modifying Intensity Values


RemapTableSize property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RemapTableSize;
Overview | Refer to Changing Brightness and Contrast.

Remarks

Specifies the number of entries in the RemapTable property.

This value that must be set for this property depends on the color resolution (bits per pixel) of the image, as follows:

BPP | Table Size
Color 64, 48 or grayscale 16 | 65536
Grayscale 12 | 4096
Any other value | 256

See Also

Elements: | RemapIntensity method, RemapTable property
Topics: | Raster Images: Modifying Intensity Values


RgnPerimeterLength property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long RgnPerimeterLength
Overview | Refer to Creating and Using a Bitmap Region

Remarks

(Read Only) Gets the perimeter length of the region. The length is expressed in pixels.

This property is updated by the GetRgnPerimeterLength method.

See Also

Elements: | GetRgnPerimeterLength method
Topics: | Raster Images: Creating and Using a Region


SelectiveColorBlack property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectiveColorBlack (short iIndex);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the percentage of black in the color at the specified index. Valid values range from –100 to 100, which is interpreted as –100% to 100%.

See Also

Elements: | AutoColorLevel, ColorLevel, SelectiveColor method, SelectiveColorMagenta property, SelectiveColorYellow property, SelectiveColorCyan property
Topics: | Raster Image Functions: Modifying Intensity Values


SelectiveColorCyan property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectiveColorCyan (short iIndex);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the percentage of cyan in the color at the specified index. Valid values range from –100 to 100, which is interpreted as –100% to 100%.

See Also

Elements: | AutoColorLevel, ColorLevel, SelectiveColor method, SelectiveColorMagenta property, SelectiveColorYellow property, SelectiveColorBlack property
Topics: | Raster Image Functions: Modifying Intensity Values


SelectiveColorMagenta property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectiveColorMagenta (short iIndex);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the percentage of magenta in the color at the specified index. Valid values range from –100 to 100, which is interpreted as –100% to 100%.

See Also

Elements: | AutoColorLevel, ColorLevel, SelectiveColor method, SelectiveColorCyan property, SelectiveColorYellow property, SelectiveColorBlack property
Topics: | Raster Image Functions: Modifying Intensity Values


SelectiveColorYellow property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short SelectiveColorYellow (short iIndex);
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Gets or sets a value that specifies the percentage of yellow in the color at the specified index. Valid values range from –100 to 100, which is interpreted as –100% to 100%.

See Also

Elements: | AutoColorLevel, ColorLevel, SelectiveColor method, SelectiveColorMagenta property, SelectiveColorCyan property, SelectiveColorBlack property
Topics: | Raster Image Functions: Modifying Intensity Values


Shadow property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | ILEADBalanceData * Shadow
Overview | Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits.) Gets or sets an ILEADBalanceData object that is used to control the dark tones for the ColorIntensityBalance method.

See Also

Elements: | ColorIntensityBalance method, MidTone property, HighLight property
Topics: | Raster Imagens: Modifying Intensity Values


ShiftAmount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long ShiftAmount
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Read only) Gets the value by which the intensity values were shifted by the ShiftMinimumToZero method.

This property is updated by calling ShiftMinimumToZero method.

See Also

Elements: | ShiftMinimumToZero method, ConvertUnsignedToSigned method, ConvertSignedToUnsigned method, ShiftZeroToNegative method
Topics: | Raster Images: Modifying Intensity Values


SliceDeskewAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long SliceDeskewAngle;
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Raster Pro and above toolkits) This property is updated with the amount that the Slice method rotates the sliced bitmap. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. This property is updated only if the SLICE_DESKEW value is set in the lFlags parameter of the Slice method.

See Also

Elements: | OnSliceBitmap Event, Slice method, ContinueSlicing property
Topics: | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Creating and Using a Region


STable property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short STable (long lIndex);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Saturation lookup table. The saturation indicates the amount of white present in a color. This is one of the four tables that the RemapHue method uses to change the bitmap's hue, saturation and value. This property is used only if the bUseSTable parameter is set to TRUE when the RemapHue method is called. Hue, Saturation, and Value levels range from 0 to 255. The current hue, saturation and value of a pixel correspond to the table indexes.

If the bUseMaskTable and bUseSTable parameters are set to TRUE when the RemapHue method is called and the MaskTable(i) entry for a particular hue is not zero, then the saturation is changed to the saturation in STable(i). If MaskTable(i) is 0 then STable(i) is ignored. For example, if RemapHue is called with both bUseMaskTable and bUseSTable set to TRUE, then if a pixel has a hue of 85 and the MaskTable(85) is not 0, the saturation of the pixel is changed to STable(85).

If the bUseMaskTable parameter is FALSE and the bUseSTable parameter is TRUE when the RemapHue method is called, then the Saturation for each color present in the image will be changed to STable(i). For example, if a pixel has a hue of 70, the saturation of the pixel is changed to STable(70). If the next pixel has a hue of 75, the saturation of that pixel is changed to STable(75).

Saturation entries range from 0 to 255 where

Saturation 0 contains the most white.
Saturation 255 contains no white.

See Also

Elements: | RemapHue method, MaskTable property, HTable property, VTable property, HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Modifying Intensity Values


StartX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short StartX
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets the X coordinate of the point at which the message will be added to or extracted from the image. To use the default position set this parameter to NULL.

See Also

Elements: | Message property, Password property, FileName property, Directory property, StartY property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


StartY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short StartY
Overview | Refer to Non-Image Data

Remarks

(Document/Medical only) Gets or sets the Y coordinate of the point at which the message will be added to or extracted from the image. To use the default position set this parameter to NULL.

See Also

Elements: | Message property, Password property, FileName property, Directory property, StartX property, AddMessage method, ExtractMessage method
Topics: | Raster Images: Getting and Setting File Information


TransformationAngle property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long TransformationAngle
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets the angle of rotation, in hundredths of degrees (+/-). This can be a number from 1 to 36,000. A positive value means the image is rotated clockwise, while a negative value means the image is rotated counter-clockwise.

This property is updated by the GetTransformationParameters method. It is used to set the lAngle parameter of the ApplyTransformationParameters method.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, YTranslation property, XTranslation property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


TransformedPointsX property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long TransformedPointsX (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array X coordinates for the transformed center of mass points for the registration marks in the reference bitmap. The user is responsible for providing this information.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, TransformationAngle property, XTranslation property, XScale property, ReferencePointsY property, ReferencePointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


TransformedPointsY property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long TransformedPointsY (short iIndex);
Overview | Refer to Detecting Registration Marks

Remarks

Gets or sets an array Y coordinates for the transformed center of mass points for the registration marks in the reference bitmap. The user is responsible for providing this information.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, TransformationAngle property, XTranslation property, XScale property, ReferencePointsY property, ReferencePointsX property, TransformedPointsX property
Topics: | Raster Images: Document Imaging


UserFilterData property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UserFilterData (long lRow, long lCol, short newVal)
Overview | Refer to Removing Noise

Remarks

Gets or sets an array of integers containing the user-defined matrix (mask). The elements are stored in row order (first row, second row, etc). This is the user-defined filter used by the UserFilter method.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterDivisor property, UserFilterYCenter property, UserFilterOffset property, UserFilterFlags property.
Topics: | Raster Images: Filtering Images


UserFilterDivisor property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserFilterDivisor
Overview | Refer to Removing Noise

Remarks

Gets or sets a value used to divide the final result of the UserFilter method. This must be a non-zero value. To use floating point values for the matrix elements and the divisor, multiply the matrix elements and the divisor with the same value, for example, 10, 100, 1000, etc.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterYCenter property, UserFilterOffset property, UserFilterFlags property,UserFilterData property
Topics: | Raster Images: Filtering Images


UserFilterFlags property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | UserFilterConstants UserFilterFlags
Overview | Refer to Removing Noise

Remarks

Value used to offset the final result of the output.

This property is used by the UserFilter method to define a user-defined filter for filtering bitmaps.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterDivisor property, UserFilterYCenter property, UserFilterOffset property, UserFilterData property.
Topics: | Raster Images: Filtering Images


UserFilterHeight property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserFilterHeight
Overview | Refer to Removing Noise

Remarks

Gets or sets the number of rows in the UserFilterData property.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterXCenter property, UserFilterYCenter property, UserFilterDivisor property, UserFilterOffset property, UserFilterFlags property, UserFilterData property
Topics: | Raster Images: Filtering Images


UserFilterOffset property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | short UserFilterOffset
Overview | Refer to Removing Noise

Remarks

Gets or sets a value used to offset the result of the UserFilter method process.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterDivisor property, UserFilterYCenter property, UserFilterFlags property, UserFilterData property.
Topics: | Raster Images: Filtering Images


UserFilterWidth property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserFilterWidth
Overview | Refer to Removing Noise

Remarks

Gets or sets the number of columns in the UserFilterData property.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterHeight property, UserFilterXCenter property, UserFilterYCenter property, UserFilterDivisor property, UserFilterOffset property, UserFilterFlags property, UserFilterData property.
Topics: | Raster Images: Filtering Images


UserFilterXCenter property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserFilterXCenter
Overview | Refer to Removing Noise

Remarks

Gets or sets the row position of the UserFilterData property to be used as the filter/mask center.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterYCenter property, UserFilterDivisor property, UserFilterOffset property, UserFilterFlags property, UserFilterData property
Topics: | Raster Images: Filtering Images


UserFilterYCenter property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserFilterYCenter
Overview | Refer to Removing Noise

Remarks

Gets or sets the column position of the UserFilterData property to be used as the filter/mask center.

This property is used by the UserFilter method to apply a user-defined filter to a bitmap.

See Also

Elements: | UserFilter method, UserFilterWidth property, UserFilterHeight property, UserFilterXCenter property, UserFilterDivisor property, UserFilterOffset property, UserFilterFlags property, UserFilterData property
Topics: | Raster Images: Filtering Images


UserLookupTablePointCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserLookupTablePointCount
Overview | Refer to Using Histograms.

Remarks

(Read only) Gets the number of entries in the lookup table that were actually modified. This property is filled by calling GetUserLookupTable.

See Also

Elements:

RemapIntensity method, RemapTable property, RemapTableSize property, UserLUTCurveX property, UserLUTCurveY property, UserLUTCurveSize property, GetUserLookupTable method


UserLUTCurveSize property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserLUTCurveSize;
Overview | Refer to Using Histograms.

Remarks

Specifies the number of points in the User Lookup Table Curve. Assign to this value to allocate the array of points before setting X and Y-coordinates.

See Also

Elements: | GetUserLookupTable method, RemapIntensity method, RemapTable property, RemapTableSize property, UserLUTCurveX property, UserLUTCurveY property
Topics: | Changing Brightness and Contrast


UserLUTCurveX property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserLUTCurveX(long iIndex);
Overview | Refer to Using Histograms.

Remarks

Specifies the X coordinate of a point on the User Lookup Table curve.

For more details on using this property, see the GetUserLookupTable method.

See Also

Elements: | GetUserLookupTable method, RemapIntensity method, RemapTable property, RemapTableSize property, UserLUTCurveX property, UserLUTCurveY property
Topics: | Changing Brightness and Contrast


UserLUTCurveY property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax | long UserLUTCurveY(long iIndex);
Overview | Refer to Using Histograms.

Remarks

Specifies the Y coordinate of a point on the User Lookup Table curve.

For more details on using this property, see the GetUserLookupTable method.

See Also

Elements: | GetUserLookupTable method, RemapIntensity method, RemapTable property, RemapTableSize property, UserLUTCurveX property, UserLUTCurveY property
Topics: | Changing Brightness and Contrast


UserPalette property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR UserPalette (short iIndex);
Overview | Refer to Managing Palettes.

Remarks

Sets a color in a palette that you define.

The user palette is an array of 256 elements. Each element is a long integer value containing the red, green and blue (RGB) components of the color. You can specify a color using the RGB function, and you can specify 256 or fewer colors.

To apply a palette to a bitmap, you must first use this property to set each of the colors in the array; then use the ColorRes method to implement the palette.

Palettes are used only for images that are 8 bits per pixel or less.

See Also

Topics: | Raster Images: Palettes
 | Using Color Values in LEADTOOLS
 | Raster Images: Doing Color Expansion or Reduction


UserShape property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long UserShape (long lIndex);
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or set an array of values that represent the shape drawn by the user. This property is used only if the LightFlags property is set to FL_FREEHAND. These values should be between –1000 and 1000. They are internally divided by 1000, so the real values are between –1 and 1.

You must set the UserShapeCount property before using this property.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShapeCount property, LightFlags property, FunctionalLight method
Topics: | Raster Images: Artistic Effects


UserShapeCount property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long UserShapeCount
Overview | Refer to Applying Artistic Effects

Remarks

(Raster Pro and above toolkits) Gets or sets the number of entries in the UserShape property. This property is used only if the LightFlags property is set to FL_FREEHAND.

This property must be set before using the UserShape property.

See Also

Elements: | LightFrequency property, LightRedAmplitude property, LightGreenAmplitude property, LightBlueAmplitude property, LightAngle property, LightXOrigin property, LightYOrigin property, LightPhase property, UserShape property, LightFlags property, FunctionalLight method
Topics: | Raster Image Functions: Artistic Effects


UserWindowCenter property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

double UserWindowCenter

Remarks

(Read only) Gets the center of the range of color intensities that define your window of interest, if the LUT is linear. Cannot be 0.

See Also

Elements: | UserWindowWidth property, GetLinearVOILUT method
Topics: | Raster Images: Palettes


UserWindowWidth property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Syntax

double UserWindowWidth

Remarks

(Read only) Gets the range of color intensities that define your window of interest, if the LUT is linear. Cannot be 0.

See Also

Elements: | UserWindowCenter property, GetLinearVOILUT method
Topics: | Raster Images: Palettes


VTable property (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short VTable (long lIndex);
Overview | Refer to Changing Brightness and Contrast.

Remarks

Value lookup table. The Value indicates the amount of black present in a color. This is one of the four tables that the RemapHue method uses to change the bitmap's hue, saturation and value. This property is used only if the bUseVTable parameter is set to TRUE when the RemapHue method is called. Hue, Saturation, and Value levels range from 0 to 255. The current hue, saturation and value of a pixel correspond to the table indexes.

If the bUseMaskTable and bUseVTable parameters are set to TRUE when the RemapHue method is called and the MaskTable(i) entry for a particular hue is not zero, then the value is changed to the value in VTable(i). If MaskTable(i) is 0 then VTable(i) is ignored. For example, if RemapHue is called with both bUseMaskTable and bUseVTable set to TRUE, then if a pixel has a hue of 85 and the MaskTable(85) is not 0, the value of the pixel is changed to VTable(85).

If the bUseMaskTable parameter is FALSE and the bUseVTable parameter is TRUE when the RemapHue method is called, then the Value for each color present in the image will be changed to VTable(i). For example, if a pixel has a hue of 70, the Value of the pixel is changed to VTable(70). If the next pixel has a hue of 75, the Value of that pixel is changed to VTable(75).

Value entries range from 0 to 255 where

Value 0 contains the most black.
Value 255 contains no black.

See Also

Elements: | RemapHue method, MaskTable property, HTable property, STable property, HSV_HfromRGB method, HSV_SfromRGB method, HSV_VfromRGB method, RGBfromHSV method
Topics: | Raster Images: Modifying Intensity Values


XScale property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long XScale
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets the amount of bitmap scaling along the x-axis (width). This is a percentage value.

This property is updated by the GetTransformationParameters method. It is used to set the lXScale parameter of the ApplyTransformationParameters method.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, YTranslation property, TransformationAngle property, XTranslation property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


XTranslation property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short XTranslation
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets the amount of bitmap translation along the x-axis (width), in hundredths of a pixel.

This property is updated by the GetTransformationParameters method. It is used to set the iXTranslation parameter of the ApplyTransformationParameters method.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, YTranslation property, TransformationAngle property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


YScale property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | long YScale
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets the amount of bitmap scaling along the y-axis (height). This is a percentage value.

This property is updated by the GetTransformationParameters method. It is used to set the lYScale parameter of the ApplyTransformationParameters method.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, YTranslation property, TransformationAngle property, XTranslation property, XScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


YTranslation property (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | short YTranslation
Overview | Refer to Detecting Registration Marks

Remarks

(Read only) Gets the amount of bitmap translation along the y-axis (height), in hundredths of a pixel.

This property is updated by the GetTransformationParameters method. It is used to set the iYTranslation parameter of the ApplyTransformationParameters method.

See Also

Elements: | GetTransformationParameters method, IsRegistrationMark method, SearchRegMarks method, GetMarksCenterMass method, XTranslation property, TransformationAngle property, XScale property, YScale property, TransformedPointsX property, TransformedPointsY property
Topics: | Raster Images: Document Imaging


BorderRemove event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void BorderRemove (OLE_HANDLE hRgn, long uBorderToRemove, float fBoundingRectLeft, float fBoundingRectTop, float fBoundingRectWidth, float fBoundingRectHeight);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered once for each border found by the BorderRemove method. It is triggered a maximum of four times for each call to the BorderRemove method , if the EnableDocCleanEvents property has been set to TRUE before calling the BorderRemove method . Set the DocCleanSuccess property to SUCCESS_REMOVE to have the border removed. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the border unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the BorderRemove method is set to BORDER_IMAGE_UNCHANGED and BORDER_SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region that contains all the changes.

Note: hRgn is only valid during this event. To use the hRgn after the event has terminated, make a copy of it using the SetRgnHandle method.

See Also

Elements: | BorderRemove method, DocCleanSuccess property , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


DotRemove event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void DotRemove (long hRgn, float fBoundingRectLeft, float fBoundingRectTop, float fBoundingRectWidth, float fBoundingRectHeight, long iWhiteCount, long iBlackCount);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered once for each dot, speck, or blob that is detected, if the EnableDocCleanEvents property has been set to TRUE before calling the DotRemove method.Set the DocCleanSuccess property to SUCCESS_REMOVE to have the dot removed. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the dot unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the BorderRemove method is set to DOT_IMAGE_UNCHANGED | DOT_SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region that contains all the changes.

Note: hRgn is only valid during this event. To use the hRgn after the event has terminated, make a copy of it using the SetBitmapRgnHandle method.

See Also

Elements: | DotRemove method , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


HolePunchRemove event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void HolePunchRemove (long hRgn, float fBoundingRectLeft, float fBoundingRectTop, float fBoundingRectWidth, float fBoundingRectHeight, long iHoleIndex, long iHoleTotalCount, long iWhiteCount, long iBlackCount);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered once for each occurring hole in the hole-punch configuration, if the EnableDocCleanEvents property has been set to TRUE before calling the HolePunchRemove method. For example, if there are three holes, the event gets triggered three times. Set the DocCleanSuccess property to SUCCESS_REMOVE to have a particular hole removed. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the hole unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the HolePunchRemove method is set to HOLEPUNCH_IMAGE_UNCHANGED and HOLEPUNCH_SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region that contains all the changes.

Note:

hRgn is only valid during this event. To use the hRgn after the event has terminated, make a copy of it using the SetBitmapRgnHandle method.

See Also

Elements: | HolePunchRemove method , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


InvertedText event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void InvertedText (long hRgn, float fBoundingRectLeft, float fBoundingRectTop, float fBoundingRectWidth, float fBoundingRectHeight, long iWhiteCount, long iBlackCount);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered once for each area of inverted text that is detected, if the EnableDocCleanEvents property has been set to TRUE before calling the InvertedText method. Set the DocCleanSuccess property to SUCCESS_REMOVE to have the area inverted. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the area unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the InvertedText method is set to INVERTEDTEXT_IMAGE_UNCHANGED | INVERTEDTEXT _SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region that contains all the changes.

Note: hRgn is only valid during this event. To use the hRgn after the event has terminated, make a copy of it using the SetBitmapRgnHandle method.

See Also

Elements: | InvertedText method , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


LineRemove event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void LineRemove (long nStartRow, long nStartCol, long nLength, OLE_HANDLE hRgnLine);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered for each line found by the LineRemove method , if the EnableDocCleanEvents property has been set to TRUE before calling the LineRemove method .Set the DocCleanSuccess property to SUCCESS_REMOVE to have the line removed. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the line unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the LineRemove method is set to LINE_IMAGE_UNCHANGED | LINE_SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region that contains all changes.

Note: hRgnLine is only valid during this event. To use the hRgnLine after the event has terminated, make a copy of it using the SetBitmapRgnHandle method.

See Also

Elements: | LineRemove method , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


OnSliceBitmap event (ILEADRasterProcess)

Visual Basic example

Visual C++ example

Syntax | void OnSliceBitmap(long Bitmap, long lLeft, long lTop, long lWidth, long lHeight, long lAngle);
Overview | Refer to Examining and Altering Bitmaps

Remarks

(Raster Pro and above toolkits) Handles each slice segment found by the Slice method. This event is fired once for each slice that is detected.

See Also

Elements: | ContinueSlicing property, Slice method, SliceDeskewAngle property.
Topics: | Raster Images: Creating and Maintaining Lists of Images
 | Raster Images: Creating and Using a Region


Smooth event (ILEADRasterProcess)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Smooth (long nBumpOrNick, long nStartRow, long nStartCol, long nLength, long uHorV);
Overview | Refer to Cleaning - up 1-Bit Images

Remarks

(Document/Medical) This event is triggered for each bump and nick found by the Smooth method , if the EnableDocCleanEvents property has been set to TRUE before calling the Smooth method. Set the DocCleanSuccess property to SUCCESS_REMOVE to have the bump removed or the nick filled. Set the DocCleanSuccess property to SUCCESS_NOREMOVE to leave the bump or nick unchanged. Set the DocCleanSuccess property to 0 to abort. If the uFlags parameter of the Smooth method is set to SMOOTH_IMAGE_UNCHANGED | SMOOTH_SINGLE_REGION, then the value of the DocCleanSuccess property affects only the internal single region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements: | Smooth method , EnableDocCleanEvents property
Topics: | Raster Images: Cleaning - up 1-Bit Images


BrowseDir method (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short BrowseDir (BSTR pszDirectory);
Overview | Refer to Thumbnail Browser.

Remarks

Browses the specified directory for supported images, and generates thumbnails for each image file that is found.

Each generated thumbnail can be processed in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event,ContinueBrowse property,Filter property,ThumbnailWidth property,ThumbnailHeight property, ThumbnailBitsPerPixel property,MaintainAspect property,ForceSize property,ThumbnailBackgroundColor property,LoadStamp property,Resample property,StopOnError property,IncludeSubDirectories property,ExpandMultipage property,MaxSizeDisk property,MaxSizeMem property,DitherFlags property,PaletteFlags property
Topics: | Raster Images: Using the Thumbnail Browser


CreateThumbnailFromFile method (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CreateThumbnailFromFile (BSTR pszFilename, long nPage);
Overview | Refer to Thumbnail Browser.

Remarks

Generates a thumbnail from the specified image file.

The generated thumbnail can be processed in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, ContinueBrowse property, Filter property, ThumbnailWidth property, ThumbnailHeight property, ThumbnailBitsPerPixel property, MaintainAspect property, ForceSize property, ThumbnailBackgroundColor property, LoadStamp property, Resample property, StopOnError property, IncludeSubDirectories property, ExpandMultipage property, MaxSizeDisk property, MaxSizeMem property, DitherFlags property, PaletteFlags property
Topics: | Raster Images: Using the Thumbnail Browser


ContinueBrowse property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL ContinueBrowse
Overview | Refer to Thumbnail Browser.

Remarks

If this property is set to True during the ThumbnailEvent event, thumbnail generation will continue. If you wish to stop thumbnail generation, set this property to false in the ThumbnailEvent event.

See Also

Elements: | EnableMethodErrors property, StopOnError property, ThumbnailEvent event, BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


DitherFlags property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | ThumbnailColorResDitherConstants DitherFlags
Overview | Refer to Thumbnail Browser.

Remarks

Indicates the dithering options that should be used when both ForceSize and MaintainAspect are True and the source image is not 24-bit. In this case, the thumbnail image is converted to 24-bit, then, combined with a "background" bitmap. Then, the resulting bitmap is returned to the thumbnail image's original bit-depth using this setting.

Possible values are:

Setting | Description
THMB_CRD_NODITHERING | Use nearest color matching.
THMB_CRD_FLOYDSTEINDITHERING | Use Floyd-Steinberg dithering.
THMB_CRD_STUCKIDITHERING | Use Stucki dithering.
THMB_CRD_BURKESDITHERING | Use Burkes dithering.
THMB_CRD_SIERRADITHERING | Use Sierra dithering.
THMB_CRD_STEVENSONARCEDITHERING | Use Stevenson Arce dithering.
THMB_CRD_JARVISDITHERING | Use Jarvis dithering.
THMB_CRD_ORDEREDDITHERING | Use ordered dithering, which is faster but less accurate than other dithering methods.
THMB_CRD_CLUSTEREDDITHERING | Use clustered dithering.

See Also

Elements: | BrowseDir method, PaletteFlags property, InfoBits property, ThumbnailBitsPerPixel property, ForceSize property, MaintainAspect property, ColorRes method (ILEADRasterProcess)
Topics: | Raster Images: Using the Thumbnail Browser


EnableMethodErrors property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Thumbnail Browser.

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Elements: | ContinueBrowse property, StopOnError property
Topics: | Raster Images: Using the Thumbnail Browser


ExpandMultipage property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL ExpandMultipage
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether or not to expand multipage files. If True, each page from a multipage file will be loaded.

If this property is set to True, the Thumbnail Browser will expand any multipage files it finds, and generate thumbnails for each page.

This defaults to False.

See Also

Elements: | BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


Filter property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR Filter
Overview | Refer to Thumbnail Browser.

Remarks

Character string containing the file filter to browse for. Ex. *.jpg.

This defaults to "*.*", which searches all files.

See Also

Elements: | BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


ForceSize property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL ForceSize
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether the generated thumbnail should be forced to the requested size even if MaintainAspect is set to TRUE. If set to TRUE, the thumbnail bitmap will be generated by creating a "canvas" bitmap with the requested size, and then centering the actual image inside that bitmap. Note this is a slower process.

This property is ignored if MaintainAspect is False.

Default setting is False.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property, MaintainAspect property, ThumbnailBackgroundColor property, Resample property
Topics: | Raster Images: Using the Thumbnail Browser


IncludeSubDirectories property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL IncludeSubDirectories
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether or not to recursively search subdirectories when looking for files.

If this property is set to True, the Thumbnail Browser will search for files in the specified directory, and any subdirectories.

This defaults to False.

See Also

Elements: | BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


InfoBits property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoBits
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the number of bits per pixel of the file from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoTotalPages property, InfoPage property, InfoSizeDisk property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoCompression property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR InfoCompression
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the compression method of the file from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoFormat property, InfoWidth property, InfoHeight property, InfoTotalPages property, InfoPage property, InfoSizeDisk property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoFormat property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | RasterFileConstants InfoFormat
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the format of the file from which the thumbnail was generated.

For possible values, refer to Formats of Input Files.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoWidth property, InfoHeight property, InfoTotalPages property, InfoPage property, InfoSizeDisk property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoHeight property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoHeight
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the height of the image from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoTotalPages property, InfoPage property, InfoSizeDisk property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoPage property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoPage
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the number of the page within the file, from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoTotalPages property, InfoSizeDisk property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoSizeDisk property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | long InfoSizeDisk
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the size of the file from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoTotalPages property, InfoPage property, InfoSizeMem property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoSizeMem property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | long InfoSizeMem
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the amount of memory required to load the original image from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoPage property, InfoTotalPages property, InfoSizeDisk property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoTotalPages property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoTotalPages
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the total number of pages in the file from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoPage property, InfoSizeMem property, InfoSizeDisk property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoWidth property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoWidth
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the width of the image from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoTotalPages property, InfoHeight property, InfoPage property, InfoSizeMem property, InfoSizeDisk property, InfoXRes property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoXRes property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoXRes
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the x resolution of the original image from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoPage property, InfoSizeMem property, InfoSizeDisk property, InfoTotalPages property, InfoYRes property
Topics: | Raster Images: Using the Thumbnail Browser


InfoYRes property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InfoYRes
Overview | Refer to Thumbnail Browser.

Remarks

(Read-only) Is the y resolution of the original image from which the thumbnail was generated.

This property is updated by the successful generation of a thumbnail. You can read this property in the ThumbnailEvent event.

See Also

Elements: | ThumbnailEvent event, BrowseDir method, InfoBits property, InfoCompression property, InfoFormat property, InfoWidth property, InfoHeight property, InfoPage property, InfoSizeMem property, InfoSizeDisk property, InfoTotalPages property, InfoXRes property
Topics: | Raster Images: Using the Thumbnail Browser


LoadStamp property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL LoadStamp
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether or not to attempt to load stamps from file formats that support preview images, such as JPEG and LEAD CMP.

Default setting is True.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property, MaintainAspect property, ThumbnailBackgroundColor property, ForceSize property, Resample property
Topics: | Raster Images: Using the Thumbnail Browser


MaintainAspect property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL MaintainAspect
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating if the aspect ratio of the image should be maintained when generating thumbnails. When set to TRUE, the generated thumbnail's width and height will not match both ThumbnailWidth and ThumbnailHeight if the original aspect ratio was not the same as the ratio between ThumbnailWidth and ThumbnailHeight. If you desire the thumbnail be generated with exactly the requested width and height while still maintaining aspect ratio of the actual image, set both MaintainAspect and ForceSize to True.

Default setting is True.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property, ForceSize property, ThumbnailBackgroundColor property, Resample property
Topics: | Raster Images: Using the Thumbnail Browser


MaxSizeDisk property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MaxSizeDisk
Overview | Refer to Thumbnail Browser.

Remarks

This value specifies the file size limit of files for which the thumbnail browser will attempt to load.

Set this to 0 to indicate there should be no file size limit.

This property defaults to 0.

See Also

Elements: | BrowseDir method, MaxSizeMem property, InfoSizeDisk property, InfoSizeMem property
Topics: | Raster Images: Using the Thumbnail Browser


MaxSizeMem property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | long MaxSizeMem
Overview | Refer to Thumbnail Browser.

Remarks

This value specifies the limit of the required memory to load an image for images that the thumbnail browser will attempt to load.

Set this to 0 to indicate there should be no memory size limit.

This property defaults to 0.

See Also

Elements: | BrowseDir method, MaxSizeMem property, InfoSizeDisk property, InfoSizeMem property
Topics: | Raster Images: Using the Thumbnail Browser


PaletteFlags property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | ThumbnailColorResPaletteConstants PaletteFlags
Overview | Refer to Thumbnail Browser.

Remarks

Indicates the palette option or color order that should be used when both ForceSize and MaintainAspect are True and the source image is not 24-bit. In this case, the thumbnail image is converted to 24-bit, then, combined with a "background" bitmap. Then, the resulting bitmap is returned to the thumbnail image's original bit-depth using this setting.

Possible values are:

Setting | Description
THMB_CRP_FIXEDPALETTE | Use the LEAD fixed palette.
THMB_CRP_NETSCAPEPALETTE | Use the fixed palette that is employed by Netscape Navigator and by Microsoft Internet Explorer.
THMB_CRP_OPTIMIZEDPALETTE | Create an optimized palette.
THMB_CRP_IDENTITYPALETTE | Insert the Windows system palette, and optimize the remaining colors.
THMB_CRP_BYTEORDERBGR | Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
THMB_CRP_BYTEORDERRGB | Use RGB color order. This flag only has meaning when going to 16 bits per pixel or higher.
THMB_CRP_BYTEORDERGRAY | Use grayscale. This flag is only valid for 12 or 16-bit grayscale images. 12 and 16-bit grayscale images are supported in the Document/Medical toolkits only.

See Also

Elements: | BrowseDir method, DitherFlags property, InfoBits property, ThumbnailBitsPerPixel property, ForceSize property, MaintainAspect property, ColorRes method (ILEADRasterProcess)
Topics: | Raster Images: Using the Thumbnail Browser


Resample property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL Resample
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether or not to use interpolated resize when generating thumbnails.

Interpolated resize is slower, but produces better quality thumbnails.

Default setting is True.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property, MaintainAspect property, ThumbnailBackgroundColor property, ForceSize property, LoadStamp property
Topics: | Raster Images: Using the Thumbnail Browser


SkipFile property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL SkipFile
Overview | Refer to Thumbnail Browser.

Remarks

Indicates whether to skip the file passed to the ThumbnailEvent event. Possible values are:

Value | Meaning
TRUE | If the nStatusCode parameter of the ThumbnailEvent event is BROWSE_PRELOAD, then skip the file indicated in the pszFilename parameter of the ThumbnialEvent event. This allows the user to avoid the internal file information processing. If the nStatusCode parameter is any other value, the file will not be skipped.
FALSE | Do not skip the file indicated in the pszFilename parameter of the ThumbnailEvent event.

See Also

Elements: | EnableMethodErrors property, StopOnError property, ThumbnailEvent event, BrowseDir method, ContinueBrowse property
Topics: | Raster Images: Using the Thumbnail Browser


StopOnError property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL StopOnError
Overview | Refer to Thumbnail Browser.

Remarks

Flag indicating whether or not to stop generating thumbnails when an error occurs.

Default setting is False.

See Also

Elements: | EnableMethodErrors property, ContinueBrowse property, ThumbnailEvent event, BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


ThumbnailBackgroundColor property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR ThumbnailBackgroundColor
Overview | Refer to Thumbnail Browser.

Remarks

Background color to use if both ForceSize and MaintainAspect are True.

Default setting is RGB(128,128,128).

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property, MaintainAspect property, ForceSize property
Topics: | Raster Images: Using the Thumbnail Browser
 | Using Color Values in LEADTOOLS


ThumbnailBitsPerPixel property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ThumbnailBitsPerPixel
Overview | Refer to Thumbnail Browser.

Remarks

Specifies the bits per pixel for each generated thumbnail bitmap.

You can specify 0 to indicate the thumbnail should be the same bits per pixel as the original file from which is was generated.

Default setting is 24.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailHeight property
Topics: | Raster Images: Using the Thumbnail Browser


ThumbnailHeight property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ThumbnailHeight
Overview | Refer to Thumbnail Browser.

Remarks

Specifies the requested height of the generated thumbnails.

If 0 is specified for either the ThumbnailHeight property or the ThumbnailWidth property, the image will not be resized. The whole image will be returned in the ThumbnailEvent event.

If -1 is specified for either the ThumbnailHeight property or the ThumbnailWidth property, the image will not be loaded at all. The ThumbnailEvent event will occur for each file, but will only receive file information, not a valid image.

Default setting is 80.

See Also

Elements: | BrowseDir method, ThumbnailWidth property, ThumbnailBitsPerPixel property, MaintainAspect property, ForceSize property, ThumbnailBackgroundColor property, Resample property
Topics: | Raster Images: Using the Thumbnail Browser


ThumbnailWidth property (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ThumbnailWidth
Overview | Refer to Thumbnail Browser.

Remarks

Specifies the requested width of the generated thumbnails.

If 0 is specified for either the ThumbnailHeight property or the ThumbnailWidth property, the image will not be resized. The whole image will be returned in the ThumbnailEvent event.

If -1 is specified for either the ThumbnailHeight property or the ThumbnailWidth property, the image will not be loaded at all. The ThumbnailEvent event will occur for each file, but will only receive file information, not a valid image.

Default setting is 80.

See Also

Elements: | BrowseDir method, ThumbnailHeight property, ThumbnailBitsPerPixel property, MaintainAspect property, ForceSize property, ThumbnailBackgroundColor property, Resample property
Topics: | Raster Images: Using the Thumbnail Browser


ThumbnailEvent event (ILEADRasterThumbnail)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ThumbnailEvent (long Bitmap, BSTR pszFilename, short nStatusCode, short nPercent);
Overview | Refer to Thumbnail Browser.

Remarks

Occurs during thumbnail generation.

You must use this event to process each generated thumbnail. The value you specify in the ContinueBrowse property determines whether the browsing operations is continued or aborted.

You can also use this event to detect progress of image loading.

See Also

Elements: | ContinueBrowse property, EnableMethodErrors property, StopOnError property, BrowseDir method
Topics: | Raster Images: Using the Thumbnail Browser


BooleanItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL BooleanItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the Boolean item value from the Boolean array.

This property is valid when the Type property value is VALUE_ARRAY_BOOLEAN

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, BooleanValue property


BooleanValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL BooleanValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the Boolean value.

This property is valid when the Type property value is VALUE_BOOLEAN

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, BooleanItemValue property


DispatchValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | IDispatch * DispatchValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the dispatch value.

This property is valid when the Type property value is VALUE_DISPATCH

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property


DoubleItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | double DoubleItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the double item value from the double array.

This property is valid when the Type property is one of the following values:

VALUE_ARRAY_ULONG

VALUE_ARRAY_UINT

VALUE_ARRAY_DOUBLE

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, DoubleValue property


DoubleValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | double DoubleValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the double value.

This property is valid when the Type property is one of the following values:

VALUE_ULONG

VALUE_UINT

VALUE_DOUBLE

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, DoubleItemValue property


EnableMethodErrors property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Using ILEADRasterVariant object

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). Possible values are:

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

See Also

Elements:

Type property, ItemCount property, Error property, ShortValue property, ShortItemValue property, LongValue property, LongItemValue property, FloatValue property, FloatItemValue property, DoubleValue property, DoubleItemValue property, BooleanValue property, BooleanItemValue property, StringValue property, StringItemValue property, DispatchValue property


Error property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | short Error
Overview | Refer to Using ILEADRasterVariant object

Remarks

(Read only) Gets the last error value for the last operation in the ILEADRasterVariant object.

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, ShortValue property, ShortItemValue property, LongValue property, LongItemValue property, FloatValue property, FloatItemValue property, DoubleValue property, DoubleItemValue property, BooleanValue property, BooleanItemValue property, StringValue property, StringItemValue property, DispatchValue property


FloatItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | float FloatItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the float item value from the float array.

This property is valid when the Type property value is VALUE_ARRAY_FLOAT.

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, FloatValue property


FloatValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | float FloatValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the float value.

This property is valid when the Type property value is VALUE_FLOAT.

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, FloatItemValue property


ItemCount property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | long ItemCount
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the value items count. Pass 0 to this property to free the associated memory for the values contained in the ILEADRasterVaraint object.

Setting any value for this property will allocate an array of the specified item value type.

This property is valid to be used with the following value types:

VALUE_ARRAY_BYTE

VALUE_ARRAY_SHORT

VALUE_ARRAY_USHORT

VALUE_ARRAY_LONG

VALUE_ARRAY_ULONG

VALUE_ARRAY_INT

VALUE_ARRAY_UINT

VALUE_ARRAY_FLOAT

VALUE_ARRAY_DOUBLE

VALUE_ARRAY_BOOLEAN

VALUE_ARRAY_STRING

See Also

Elements:

Type property, EnableMethodErrors property, Error property, ShortItemValue property, LongItemValue property, FloatItemValue property, DoubleItemValue property, BooleanItemValue property, StringItemValue property


LongItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LongItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the long item value from the long array.

This property is valid when the Type property is one of the following values:

VALUE_ARRAY_USHORT

VALUE_ARRAY_LONG

VALUE_ARRAY_INT

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, LongValue property


LongValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | long LongValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the long value.

This property is valid when the Type property is one of the following values:

VALUE_USHORT

VALUE_LONG

VALUE_INT

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, LongItemValue property


ShortItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ShortItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the short item value from the short array.

This property is valid when the Type property is one of the following values:

VALUE_ARRAY_BYTE

VALUE_ARRAY_SHORT

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, ShortValue property


ShortValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ShortValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the short value.

This property is valid when the Type property is one of the following values:

VALUE_CHAR

VALUE_BYTE

VALUE_SHORT

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, ShortItemValue property


StringItemValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR StringItemValue(long iIndex)
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the string item value from the string array.

This property is valid when the Type property value is VALUE_ARRAY_STRING

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, StringValue property


StringValue property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR StringValue
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the string value.

This property is valid when the Type property value is VALUE_STRING.

See Also

Elements:

Type property, ItemCount property, EnableMethodErrors property, Error property, StringItemValue property


Type property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | ValueType Type
Overview | Refer to Using ILEADRasterVariant object

Remarks

Gets and sets the value type of the value contained in the ILEADRasterVariant object.

See Also

Elements:

ItemCount property, EnableMethodErrors property, Error property, ShortValue property, ShortItemValue property, LongValue property, LongItemValue property, FloatValue property, FloatItemValue property, DoubleValue property, DoubleItemValue property, BooleanValue property, BooleanItemValue property, StringValue property, StringItemValue property, DispatchValue property


vType property (ILEADRasterVariant)

Visual Basic example

Visual C++ 5.0 example

Syntax | ValueType vType
Overview | Refer to Using ILEADRasterVariant object.

Remarks

Gets or sets the value type of the value contained in the ILEADRasterVariant object. Please note that this is exactly like the Type property. However, in VB Script, "Type" is a keyword, so the Type property will not work.

See Also

Elements: | ItemCount property, EnableMethodErrors property, Error property, ShortValue property, ShortItemValue property, LongValue property, LongItemValue property, FloatValue property, FloatItemValue property, DoubleValue property, DoubleItemValue property, BooleanValue property, BooleanItemValue property, StringValue property, StringItemValue property, DispatchValue property
Topics: | Support: Using a Variant Object


AboutBox method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void AboutBox ();
Overview | Refer to Getting LEADTOOLS Toolkit Information.

Remarks

Displays information about the LEADTOOLS COM Object/Control.

See Also

Topics:

Support: Version and License Information


BitmapToClient method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BitmapToClient (float X, float Y);
Overview | Refer to Displaying an Image.

Remarks

Converts the given bitmap coordinates to client coordinates.

The values passed should be in ScaleMode units.

Calling this method will update the ConvertX and ConvertY properties with the converted values.

See Also

Elements: | ScaleMode property, ClientToBitmap, BitmapWidth property, BitmapHeight property, ScaleWidth property, ScaleHeight property, ConvertX property, ConvertY property
Topics: | Working with the Control: Client Area Usage,
 | Raster Images: Displaying Images


ClientToBitmap method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ClientToBitmap (float X, float Y);
Overview | Refer to Displaying an Image

Remarks

Converts the given client coordinates to bitmap coordinates.

The values passed should be in ScaleMode property units.

Calling this method will update the ConvertX and ConvertY properties with the converted values.

See Also

Elements: | ScaleMode property, BitmapToClient method, BitmapWidth property, BitmapHeight property, ScaleWidth property, ScaleHeight property, ConvertX property, ConvertY property
Topics: | Working with the Control: Client Area Usage,
 | Raster Images: Displaying Images


CreateZoomView method (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | short CreateZoomView(ILEADRasterZoomView * ZoomView);
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Creates a new Zoom View and associates it with the LEAD Raster View Control.

When the zoomed view is no longer needed, call the DestroyZoomView method to stop the specified Zoom View procedure and to detach it from the Raster View Control.

See Also

Elements: | DstLeft property, DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images Using Color Values in LEADTOOLS


DestroyZoomView method (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | short DestroyZoomView (long lIndex);
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Destroys the specified Zoom View, and releases all resources associated with it.

When a zoomed view is no longer needed, call the DestroyZoomView method to stop the specified Zoom View procedure and to detach it from the RasterView Control.

You must call this method for each Zoom View you have created before destroying the window with which the Zoom Views are associated.

If you need to destroy all the zoomed views that are attached to a specified window, destroy them from the last Zoom View to the first Zoom View. For example, if you have 5 Zoom Views associated with the specified window you need to do the following:

In VB

Dim nCount As Integer
Dim i As Integer
If (LEADRasterView1.HasZoomView) Then
nCount = LEADRasterView1.ZoomViewsCount
For i = nCount - 1 To 0 Step -1
LEADRasterView1.DestroyZoomView i
Next i
End If

In MFC

int nCount;

if(m_RasterView.GetHasZoomView())
{
nCount = m_RasterView.GetZoomViewsCount();
for (int i = 0; i<nCount ;++i)
m_RasterView.DestroyZoomView(nCount-i-1);
}

See Also

Elements: | DstLeft property, DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method
Topics: | Raster Images: Displaying Images Using Color Values in LEADTOOLS


ForceRepaint method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ForceRepaint ();
Overview | Refer to Displaying an Image.

Remarks

Repaints the image on the screen.

See Also

Elements: | AutoRepaint property, PaintRgnOnly property, RepaintRect method, EnablePaint property
Topics: | Raster Images: Displaying Images


GetClientDC method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetClientDC ();
Overview | Refer to Using the Windows API.

Remarks

Returns the device context of the Raster View Control's client area on the screen. You can use the device context with Windows API functions, such as GDI drawing functions.

You should use the ReleaseClientDC method when the device context is no longer needed.

See Also

Elements: | ReleaseClientDC method
Topics: | Working with the Control: Client Area Usage


GetFloaterHandle method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetFloaterHandle ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Stores a copy of the floater bitmap's region and returns a Windows region handle that you can use to retrieve or delete the stored region.

Keep in mind that the region data contains only positioning information relative to the floater bitmap, not the bitmap's pixel values.

To retrieve the stored region and add it to the bitmap, use the SetRgnHandle method. To delete the stored region, use the DeleteRgnHandle method.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | GetRgnHandle method, DeleteRgnHandle method, FreeRgn method, SetRgnHandle method
Topics: | Raster Images: Creating and Using a Region


GetPalette method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long GetPalette (long hDC);
Overview | Refer to Managing Palettes

Remarks

Returns the handle of the palette used by the specified device context.

Use this method with the SetDDB method to specify the DDB's palette.

See Also

Topics:

Raster Images: Palettes


GetZoomView method (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | short GetZoomView (ILEADRasterZoomView ** ZoomView);
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets the properties for the specified zoom view.

To change the current options for the specified Zoom View, change the values in the ILEADRasterZoomView object and pass it to the UpdateZoomView method.

See Also

Elements: | DstLeft property, DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images Using Color Values in LEADTOOLS


IsPtInFloater method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL IsPtInFloater (float fx, float fy);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Lets you see whether a point in the Raster View Control's client area is in the floater.

This method is commonly used in the MouseDown event to test whether the mouse click selects the floater. The coordinates of the point are relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property. To avoid translating mouse position coordinates, set the scale mode to your development system's default (twips in Visual basic, pixels in C++).

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | Floater property, FloaterVisible property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


PrintEnd method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void PrintEnd (long hDC);
Overview | Refer to Printing an Image.

Remarks

Ejects the page and ends the print job.

Use the PrintStart method to begin a print job; use the Render method to print an image; then use the PrintEnd method to eject the page and end the print job.

See Also

Elements: | Render method, PrintStart method
Topics: | Raster Images: Printing Images


PrintNewPage method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void PrintNewPage (long hDC);
Overview | Refer to Printing an Image

Remarks

Ejects the page and starts a new page without ending the print job.

Use the PrintStart method to begin a print job; use the Render method to print an image; then use the PrintEnd method to eject the page and end the print job.

See Also

Elements: | PrintStart method, PrintEnd method, Render method
Topics: | Raster Images: Printing Images


PrintStart method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PrintStart ();
Overview | Refer to Printing an Image.

Remarks

Starts a print job on the default printer.

This method returns an hDC that you can use when calling the Render method to print an image.

To eject the page and end the print job, call the PrintEnd method.

See Also

Elements: | Render method, PrintEnd method
Topics: | Raster Images: Printing Images


ReleaseClientDC method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ReleaseClientDC ();
Overview | Refer to Using the Windows API.

Remarks

Reverses the action of the GetClientDC method.

You should use this method when the Raster View Control's client area no longer needs to be available for Windows API functions.

See Also

Elements: | GetClientDC method
Topics: | Working with the Control: Client Area Usage


Render method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Render (long hDC, float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Printing an Image.

Remarks

Prints an image or displays the image in any device context.

You must specify the device context, and the position and dimensions of the printed image. The measurements use the scale mode of the device context.

The source rectangle, normally used for displaying an image, can also be used to limit which part of the bitmap is printed. For an illustration of how the source rectangle works, refer to Specifying Both the Source and Destination Rectangles. To specify the source rectangle, you can use the SetSrcRect method. (You can also use the source clipping rectangle, but that is usually unnecessary, and the code is more complex.)

See Also

Elements | PrintEnd method, PrintStart method
Topics | Raster Images: Printing Images


RepaintRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short RepaintRect (float fLeft, float fTop, float fWidth, float fHeight, BOOL bErase);
Overview | Refer to Displaying an Image.

Remarks

Repaints the specified rectangular area in the Raster View Control's client area.

See Also

Elements: | AutoRepaint property, ForceRepaint method, PaintRgnOnly property
Topics: | Raster Images: Displaying Images
 | Raster Images: Creating and Using a Region


SetDstClipRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetDstClipRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Displaying an Image.

Remarks

Sets the destination clipping rectangle that is used when painting an image.

The clipping rectangle 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.

See Also

Elements: | SetDstRect method, SetSrcClipRect method, SetSrcRect method
Topics: | Raster Images: Displaying Images


SetDstRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetDstRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Displaying an Image.

Remarks

Sets the destination rectangle that is used when painting an image.

The destination rectangle determines how the source rectangle is scaled and how the image is positioned in the device context.

Because of a Windows limitation, destination rectangle measurements, when converted to pixels, cannot exceed the maximum value of an integer. On WIN32 systems, this is rarely a problem. LEADTOOLS returns an ERROR_INV_RANGE error if the problem occurs. An alternative for scaling large images is to make the source rectangle smaller, using the SetSrcRect method.

The AutoScroll property must be FALSE before setting DstLeft or DstTop.

See Also

Elements: | SetDstClipRect method, SetSrcClipRect method, SetSrcRect method
Topics: | Raster Images: Displaying Images


SetFloaterDstClipRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetFloaterDstClipRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Sets the destination clipping rectangle that is used when painting a floater.

A floater is an additional bitmap that is associated with the Main Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Main Control's client area.

If the AutoSetRects property is set to True, the clipping rectangle defaults to the full client area of the Main Control. Therefore, you do not have to set this rectangle unless you want to display only part of the floater.

To position and scale the floater, refer to the SetFloaterDstRect method.

See Also

Elements: | SetFloaterDstRect method
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


SetFloaterDstRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetFloaterDstRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Positions and sizes the display of the floater by setting destination rectangle.

This method is commonly used in the MouseMove event to reposition the floater in the client area. If the floater is visible, its region is automatically repainted when you set the destination rectangle. If the AutoSetRects property is set to True, the destination rectangle defaults to the size of the floater bitmap. Therefore, you must use this method to set the destination rectangle to the desired position.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | SetFloaterDstClipRect method
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


SetMagGlassPos method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SetMagGlassPos (float fXPos, float fYPos);
Overview | Refer to Using the Magnifying Glass

Remarks

Moves the Magnifying Glass to the (fXPos, fYPos) position on the screen.

This method is used to move the Magnifying Glass to the specified position on the screen when the user is manually updating the Magnifying Glass. It is used in conjunction with the ShowMagGlass method. To manually update the Magnifying Glass, MAGGLASS_MANUAL_UPDATE must be set in the MagGlassFlags property.

If the Magnifying Glass is displayed, then this method will move the Magnifying Glass to the specified (fXPos, fYPos) position and it will be displayed there. If the Magnifying Glass is hidden, then this method will move the Magnifying Glass to the specified position, but will not display it.

This method can be called in the LEADRasterView MouseMove event to control the position of the Magnifying Glass.

Note:

This method can be used only if the MAGGLASS_MANUAL_UPDATE flag was set in the MagGlassFlags property.

See Also

Elements | MagGlassFlags property, MagGlassCursor event, StartMagGlass method, StopMagGlass method, ShowMagGlass method, UpdateMagGlassFromHandle method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


SetRubberBandRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void SetRubberBandRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Sets the position and size of a rubberband, which is a one-pixel outline of a rectangle on the display surface.

Typically, you would use this method to outline an area that the user selects with a mouse. The unit of measure is determined by the ScaleMode property. This method works with the following properties:

The RubberbandVisible property lets you set the rubberband to be visible or invisible (effectively, turning it on or off).

The RubberbandHeight property is the current height.

The RubberbandLeft property is the current X coordinate of the origin of the rubberband.

The RubberbandTop property is the current Y coordinate of the origin of the rubberband..

The RubberbandWidth property is the current width.

See Also

Topics:

Working with the Control: Client Area Usage


SetSrcClipRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetSrcClipRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Displaying an Image.

Remarks

Sets the source clipping rectangle that is used when painting an image.

The clipping rectangle specifies the portion of the source rectangle to paint. This is used for updating the display when part of the source bitmap has changed.

See Also

Elements: | SetDstClipRect method, SetDstRect method, SetSrcRect method
Topics: | Raster Images: Displaying Images


SetSrcRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short SetSrcRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Displaying an Image.

Remarks

Sets the source rectangle that is used when painting an image.

The source rectangle specifies the part of the bitmap to use as the display source.

See Also

Elements: | SetDstClipRect method, SetDstRect method, SetSrcClipRect method
Topics: | Raster Images: Displaying Images


ShowMagGlass method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ShowMagGlass (VARIANT_BOOL bShowMagGlass);
Overview | Refer to Using the Magnifying Glass

Remarks

Shows or hides the Magnifying Glass on the screen.

This method is used to control the display of the Magnifying Glass on the screen when the user is manually updating the Magnifying Glass. It is used in conjunction with the SetMagGlassPos method. To manually update the Magnifying Glass, MAGGLASS_MANUAL_UPDATE must be set in the MagGlassFlags property.

This method can be called with bShowMagGlass set to TRUE, when the left mouse button is pressed, to show the Magnifying Glass. It can be called with bShowMagGlass set to FALSE when the left mouse button is released to hide the Magnifying Glass.

Note:

This method can be used only if the MAGGLASS_MANUAL_UPDATE flag was set in the MagGlassFlags property.

See Also

Elements | MagGlassFlags property, MagGlassCursor event, StartMagGlass method, StopMagGlass method, SetMagGlassPos method, UpdateMagGlassFromHandle method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


ShowPanWin method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ShowPanWin (BOOL bShow);
Overview | Refer to Using a PanWindow.

Remarks

Shows or hides the PanWindow. Can only be used if the Raster View control currently has a bitmap loaded.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, PanWin event
Topics: | Raster Images: Displaying and Printing


StartMagGlass method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short StartMagGlass (float fWidth, float fHeight, short nZoom, OLE_COLOR clrPen, OLE_COLOR clrBack, boolean bEllipse, float fBorderSize, boolean b3D, CrosshairConstants Crosshair, boolean bIgnoreRgn, boolean bCenter);
Overview | Refer to Using the Magnifying Glass

Remarks

Starts the Magnify Glass procedure.

The appearance of the magnifying glass depends on the values of bEllipse, clrPen, b3D and fBorderSize. This can be seen in the table below:

bEllipse | b3D | fBorderSize | ClrPen | Result
TRUE | Ignored | Valid | Valid | An elliptical magnifying glass of border size fBorderSize and border color clrPen.
FALSE | FALSE | Valid | Valid | A rectangular magnifying glass with a flat border of width fBorderSize and border color clrPen.
FALSE | TRUE | Ignored | Ignored | A rectangular magnifying glass with a 3D border having a set width and color.

The following properties can be used to control the painting options for the magnifying glass:

PanWinPaintPalette property

PanWinBitonalScaling property

PanWinPaintDither property

PanWinPaintScaling property

The cursor for the magnifying glass can have one of the following default shapes:

When bEllipse = TRUE, the default cursor will be:

When bEllipse = FALSE, the default cursor will be:

A custom shape can be used by setting the following properties:

PanWinPointer = 99 ' custom
PanWinCursor = Your custom cursor image

Note: To make use of other shapes of the Magnifying Glass use the UpdateMagGlassShape method.

See Also

Elements: | StopMagGlass method , UpdateMagGlassShape method
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS


StopMagGlass method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short StopMagGlass ();
Overview | Refer to Using the Magnifying Glass

Remarks

Stops the Magnify Glass procedure.

See Also

Functions: | StartMagGlass method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


UpdateMagGlass method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short UpdateMagGlass (VARIANT vColorBuffer, VARIANT vMaskPlane, long nMaskPlaneStart , long nMaskPlaneEnd, BOOL bUpdateBitmap);
Overview | Refer to Using the Magnifying Glass

Remarks

Updates the bitmap that the Magnifying Glass displays in the zoomed Magnifying Glass display area.

This method can only be called if the MagGlassExt event has been enabled by setting the EnableMagGlassEvent property to TRUE. If the EnableMagGlassEvent property has been set to TRUE, information about the non-updated parts of the bitmap, can be obtained from the MagGlassExt event. This information can then be used with LEADTOOLS Internet methods, available in the Multimedia/Internet toolkits, to fill a vColorBuffer with pixel values of the non-updated pixels of the bitmap. Once this vColorBuffer is filled and received, it can be sent to this method to update the bitmap that the Magnifying Glass displays in the zoomed Magnifying Glass display area. For an example, refer to the Ltnetcomn.chm help file in the HELP directory.

The vColorBuffer can also be filled without using the LEADTOOLS Internet methods. Match vMaskPlane to the original bitmap and fill vColorBuffer with the corresponding pixel colors. The following example explains this procedure.

The figure below represents a bitmap 29 pixels wide and 20 pixels high. The pixels are represented by the small blue squares.

Enable the occurrence of the MagGlassExt event by setting the EnableMagGlassEvent property to TRUE and start the Magnifying Glass. When the left mouse button is pressed while moving the mouse over the bitmap, a MagGlassExt event is generated and receives the (nMaskPlaneStart, nMaskPlaneEnd, vMaskPlane) information. Each time a MagGlassExt event is generated, it indicates that part of the bitmap needs to be updated. The bitmap can be updated by calling the UpdateMagGlass method with the nMaskPlaneStart, nMaskPlaneEnd and vMaskPlane received by the MagGlassExt event.

The large black squares in the figure above represent portions of the bitmap. Each portion can contain a maximum of 64 pixels (8 by 8). Occasionally, portions may have less than 64 pixels, especially those portions at the edge of the bitmap. Each portion is represented by 1 bit of the bytes in the vMaskPlane array.

For example, if the Magnifying Glass is moved over the bitmap from pixel coordinate (9, 3), shown in red in the image above, to (28, 17), shown in green in the image above, then the following portions are affected: 1, 2, 3, 5, 6, 7, 9, 10 and 11.

Therefore, 9 portions are represented in the vMaskPlane. Each portion is represented by 1 bit within the vMaskPlane. Therefore, 2 bytes are needed in the vMaskPlane to represent the 9 portions of the bitmap. Each portion will be mapped to a byte in the vMaskPlane array as follows:

Portion Number | Bit Index | Byte Index
1 | 0 | 0
2 | 1 | 0
3 | 2 | 0
5 | 3 | 0
6 | 4 | 0
7 | 5 | 0
9 | 6 | 0
10 | 7 | 0
11 | 0 | 1

So, the vMaskPlane received from the MagGlassExt event will contain 2 bytes. Each bit of those 2 bytes will be filled with zero or one indicating whether or not the portion has been updated. The nMaskPlaneStart parameter of the callback will equal 1 and the nMaskPlaneEnd parameter will equal 11.

The next step is to check each bit value. If the bit value is 1 the corresponding portion needs to be updated, so vColorBuffer must be filled with the corresponding pixel colors. Start with the portion indicated in nMaskPlaneStart. In this example that is portion number 1. If the bit representing portion 1 has a value of 1, then the vColorBuffer should be filled with the corresponding pixels from the original bitmap. You must always start filling the vColorBuffer array from the first pixel in the portion. For portion 1, the first pixel has coordinates (8, 0). Move through the row until the last pixel of that portion is reached. In this case, the last pixel in the first row of portion 1 has coordinates (15, 0). Next, move to the next row and add the pixel colors of this row to vColorBuffer. Continue in this manner until the last pixel of the portion is reached. In this example the last pixel in portion 1 has the coordinates (15,7).

Having finished one portion, move to the next portion. In this example the next portion is portion 2. Check the bit value in vMaskPlane for this portion. Suppose it has a bit value of 0. For this portion, do not fill vColorBuffer with the pixel colors of the original bitmap. Proceed through the remaining portions until the portion indicated by nMaskPlaneEnd is reached.

By following this procedure vColorBuffer can be filled with the necessary pixel colors and passed, along with other information, to this method (UpdateMagGlass) and used to update the zoomed image displayed in the Magnifying Glass display area.

If the bUpdateBitmap flag is set to TRUE, then the LEAD RasterView Control's bitmap will be updated.

See Also

Functions: | StartMagGlass method, StopMagGlass method, EnableMagGlassEvent property, MagGlassExt event
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


UpdateMagGlassExt2 method (ILEADRasterView)

UpdateMagGlass2 method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short UpdateMagGlass2 (VARIANT vColorBuffer, VARIANT vMaskPlane, long nMaskPlaneStart , long nMaskPlaneEnd, BOOL bUpdateBitmap);
Overview | Refer to Using the Magnifying Glass

Remarks

Updates the bitmap that the Magnifying Glass displays in the zoomed Magnifying Glass display area.

This method can only be called if the MagGlassExt2 event has been enabled by setting the EnableMagGlassEvent property to TRUE. If the EnableMagGlassEvent property has been set to TRUE, information about the non-updated parts of the bitmap, can be obtained from the MagGlassExt2 event. This information can then be used with LEADTOOLS Internet methods, available in the Multimedia/Internet toolkits, to fill a vColorBuffer with pixel values of the non-updated pixels of the bitmap. Once this vColorBuffer is filled and received, it can be sent to this method to update the bitmap that the Magnifying Glass displays in the zoomed Magnifying Glass display area. For an example, refer to the Ltnetcomn.chm help file in the HELP directory.

The vColorBuffer can also be filled without using the LEADTOOLS Internet methods. Match vMaskPlane to the original bitmap and fill vColorBuffer with the corresponding pixel colors. The following example explains this procedure.

The figure below represents a bitmap 29 pixels wide and 20 pixels high. The pixels are represented by the small blue squares.

Enable the occurrence of the MagGlassExt2 event by setting the EnableMagGlassEvent property to TRUE and start the Magnifying Glass. When the left mouse button is pressed while moving the mouse over the bitmap, a MagGlassExt2 event is generated and receives the (nMaskPlaneStart, nMaskPlaneEnd, vMaskPlane) information. Each time a MagGlassExt2 event is generated, it indicates that part of the bitmap needs to be updated. The bitmap can be updated by calling the UpdateMagGlass2 method with the nMaskPlaneStart, nMaskPlaneEnd and vMaskPlane received by the MagGlassExt2 event.

The large black squares in the figure above represent portions of the bitmap. Each portion can contain a maximum of 64 pixels (8 by 8). Occasionally, portions may have less than 64 pixels, especially those portions at the edge of the bitmap. Each portion is represented by 1 bit of the bytes in the vMaskPlane array.

For example, if the Magnifying Glass is moved over the bitmap from pixel coordinate (9, 3), shown in red in the image above, to (28, 17), shown in green in the image above, then the following portions are affected: 1, 2, 3, 5, 6, 7, 9, 10 and 11.

Therefore, 9 portions are represented in the vMaskPlane. Each portion is represented by 1 bit within the vMaskPlane. Therefore, 2 bytes are needed in the vMaskPlane to represent the 9 portions of the bitmap. Each portion will be mapped to a byte in the vMaskPlane array as follows:

Portion Number | Bit Index | Byte Index
1 | 0 | 0
2 | 1 | 0
3 | 2 | 0
5 | 3 | 0
6 | 4 | 0
7 | 5 | 0
9 | 6 | 0
10 | 7 | 0
11 | 0 | 1

So, the vMaskPlane received from the MagGlassExt2 event will contain 2 bytes. Each bit of those 2 bytes will be filled with zero or one indicating whether or not the portion has been updated. The nMaskPlaneStart parameter of the callback will equal 1 and the nMaskPlaneEnd parameter will equal 11.

The next step is to check each bit value. If the bit value is 1 the corresponding portion needs to be updated, so vColorBuffer must be filled with the corresponding pixel colors. Start with the portion indicated in nMaskPlaneStart. In this example that is portion number 1. If the bit representing portion 1 has a value of 1, then the vColorBuffer should be filled with the corresponding pixels from the original bitmap. You must always start filling the vColorBuffer array from the first pixel in the portion. For portion 1, the first pixel has coordinates (8, 0). Move through the row until the last pixel of that portion is reached. In this case, the last pixel in the first row of portion 1 has coordinates (15, 0). Next, move to the next row and add the pixel colors of this row to vColorBuffer. Continue in this manner until the last pixel of the portion is reached. In this example the last pixel in portion 1 has the coordinates (15,7).

Having finished one portion, move to the next portion. In this example the next portion is portion 2. Check the bit value in vMaskPlane for this portion. Suppose it has a bit value of 0. For this portion, do not fill vColorBuffer with the pixel colors of the original bitmap. Proceed through the remaining portions until the portion indicated by nMaskPlaneEnd is reached.

By following this procedure vColorBuffer can be filled with the necessary pixel colors and passed, along with other information, to this method (UpdateMagGlass2) and used to update the zoomed image displayed in the Magnifying Glass display area.

If the bUpdateBitmap flag is set to TRUE, then the LEAD RasterView Control's bitmap will be updated.

See Also

Elements: | StartMagGlass method, StopMagGlass method, EnableMagGlassEvent property, MagGlassExt2 event
Topics: | Raster Images: Displaying Images


UpdateMagGlassFromHandle method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Syntax | short UpdateMagGlassFromHandle (OLE_HANDLE hBitmap, VARIANT_BOOL bUpdateBitmap);
Overview | Refer to Using the Magnifying Glass

Remarks

Updates the bitmap that the Magnifying Glass uses to paint the zoomed area.

This function provides a new bitmap that the Magnifying Glass can display in the zoomed area. The dimensions of the bitmap referenced by hBitmap should be equal to the dimensions of the Magnifying Glass bitmap.

If bUpdateBitmap is TRUE, the bitmap of the ILEADRasterView control will be updated with parts of the bitmap referenced by hBitmap as the cursor moves over the ILEADRasterView control's bitmap.

Note:

This method can be used only if the MAGGLASS_MANUAL_UPDATE flag was set in the MagGlassFlags property.

See Also

Elements | MagGlassFlags property, MagGlassCursor event, StartMagGlass method, StopMagGlass method, ShowMagGlass method, SetMagGlassPos method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


UpdateMagGlassShape method (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short UpdateMagGlassShape (MagGlassShapeFlags MagGlassShape, long hMagGlassRgn);
Overview | Refer to Using the Magnifying Glass.

Remarks

Updates the Magnifying Glass shape.

The Magnifying Glass procedure must be started, by calling the StartMagGlass method, before calling UpdateMagGlassShape.

The width and height of the Magnifying Glass will be changed according to the width and height of the passed hMagGlassRgn parameter if the MagGlassShape parameter was set to MAGGLASS_SHAPE_HRGN.

See Also

Functions: | StartMagGlass method, StopMagGlass method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


UpdateZoomView method (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | short UpdateZoomView (ILEADRasterZoomView * ZoomView);
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Updates the properties for the specified zoom view at the specified index with new settings.

See Also

Elements: | DstLeft property, DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images Using Color Values in LEADTOOLS


WindowLevel method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short WindowLevel ();
Overview | Refer to Examining and Altering Bitmaps.

Remarks

(Document/ Medical Imaging only) Sets up the paint or paint and image processing functions' window leveling options for a specific bitmap.

There are four properties associated with this method: LevelLowBit property, LevelHighBit property, LevelLUT property and LevelLUTLength property. They are all reset to their default values within this method.

This method provides "on demand" window leveling for the paint functions and does not alter the image data.

See Also

Elements: | LevelLowBit property, LevelHighBit property, LevelLUTLength property ,LevelLUT property, GetMinMaxBits method, GetMinMaxVal method
Topics: | Raster Images: Palettes


ZoomIn method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ZoomIn ();
Overview | Refer to Capturing an Image from the Screen.

Remarks

Changes the mouse pointer to a magnifying glass in the center of a rectangle and begins a "ZoomIn" screen capture. When the user moves the mouse pointer, the area inside the "ZoomIn" rectangle is captured to the Raster View Control and zoomed by the amount specified in the PaintZoomFactor property.

The initial size of the zoom rectangle is based on the size of the control and the existing PaintZoomFactor property at the time ZoomIn is called. During the capture, pressing the +,- or PageUp, PageDown keys will adjust the ZoomIn rectangle and zoom factor. Once the left mouse button is clicked, the capture is completed, the image is stored in the Raster View Control's Bitmap, and the ZoomInDone event is generated.

There is one property associated with this method. The EnableZoomInRect property determines whether or not to show the ZoomIn rectangle.

See Also

Elements: | ZoomInDone event, Capture method, EnableZoomInRect property
Topics: | Raster images: Capturing a screen image


ZoomToRect method (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short ZoomToRect (float fLeft, float fTop, float fWidth, float fHeight);
Overview | Refer to Displaying an Image

Remarks

Adjusts the destination display rectangle to zoom in on the part of the image that you specify.

You specify a rectangle in the Raster View Control's client area. This method increases the dimensions of the destination display rectangle so that your rectangle is enlarged and centered to fit the client area. If scroll bars are turned on, they are adjusted to the new size and position.

Because of a Windows limitation, destination rectangle measurements, when converted to pixels, cannot exceed the maximum value of an integer. On WIN32 systems, this is rarely a problem. LEADTOOLS returns an ERROR_INV_RANGE error if the problem occurs. An alternative for scaling large images is to make the source rectangle smaller, using the SetSrcRect method.

See Also

Topics:

Raster Images: Displaying Images


AnimationBackColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR AnimationBackColor
Overview | Refer to Playing an Animation.

Remarks

Background color for animation playback.

This property applies to the temporary target bitmap that LEADTOOLS creates for animation playback.

This property is initialized when you take any of the following actions which create or replace the control's bitmap list:

Load an image file.

Capture an image from the screen.

Load one or more images using the TWAIN device.

Copy another control's bitmap list by assigning the BitmapList property.

When you load an animated GIF file, the initial value is based on the global background color specified in the file. Otherwise, the default is black.

When you save an animated GIF file, this value is saved as a global value in the file.

When setting this property, you can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index (based on the AnimationPalette property) as explained in Using Palette Indexes As Color Values.

See Also

Elements: | AnimationBitsPerPixel property, AnimationPalette property, AnimationWidth property, AnimationHeight property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images
 | Using Color Values in LEADTOOLS


AnimationBitsPerPixel property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AnimationBitsPerPixel
Overview | Refer to Playing an Animation.

Remarks

Specifies the bits per pixel of the target bitmap that is used for animation playback.

This property applies to the temporary target bitmap that LEADTOOLS creates for animation playback.

This property is initialized when you take any of the following actions which create or replace the control's bitmap list:

Load an image file.

Capture an image from the screen.

Load one or more images using the TWAIN device.

Copy another control's bitmap list by assigning the BitmapList property.

If you make any subsequent changes in the color resolution of the loaded bitmaps, you should update this property before playing the list as an animation.

See Also

Elements: | AnimationBackColor property, AnimationPalette property, AnimationWidth property, AnimationHeight property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images


AnimationEnable property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AnimationEnable
Overview | Refer to Playing an Animation.

Remarks

Starts or stops an animation playback.

Setting | Description
TRUE | Starts an animation playback.
FALSE | Stops an animation playback.

See Also

Elements: | AutoAnimate property, AutoAnimationLoop property, AnimationLoop property, Animate event
Topics: | Raster Images: Playing Animated Images


AnimationHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnimationHeight
Overview | Refer to Playing an Animation.

Remarks

Specifies the height of the target bitmap that is used for animation playback. The unit of measure is determined by the ScaleMode property.

This property applies to the temporary target bitmap that LEADTOOLS creates for animation playback.

This property is initialized when you take any of the following actions which create or replace the control's bitmap list:

Load an image file.

Capture an image from the screen.

Load one or more images using the TWAIN device.

Copy another control's bitmap list by assigning the BitmapList property.

If you resize the loaded bitmaps, this property is not updated, and you may need to update this property before playing the list as an animation.

When you load an animated GIF file, the initial value is based on the global height specified in the file. Otherwise, the default is the same as the first bitmap in the list.

When you save an animated GIF file, this value is saved as a global value in the file.

See Also

Elements: | AnimationBackColor property, AnimationBitsPerPixel property, AnimationPalette property, AnimationWidth property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images


AnimationLoop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AnimationLoop
Overview | Refer to Playing an Animation.

Remarks

Controls whether an animation plays continuously.

Setting | Description
TRUE | After the last bitmap in the list, the playback begins again with the first bitmap.
FALSE | After the last bitmap in the list, the playback stops.

When you save an animated GIF file, this value is saved as a global value in the file.

See Also

Elements: | AutoAnimate property, AutoAnimationLoop property, AnimationEnable property, Animate event
Topics: | Raster Images: Playing Animated Images


AnimationPalette property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR AnimationPalette (short iIndex);
Overview | Refer to Playing an Animation.

Remarks

Sets a color in the palette used for animation playback. This is a property of the temporary target bitmap.

The palette is an array of 256 elements. Each element is a long integer value containing the red, green and blue (RGB) components of the color. You can specify a color using the RGB function.

Palettes are used only for images that are 8 bits per pixel or less.

This property is initialized when you take any of the following actions which create or replace the control's bitmap list:

Load an image file.

Capture an image from the screen.

Load one or more images using the TWAIN device.

Copy another control's bitmap list by assigning the BitmapList property.

When you load an animated GIF file, the initial value is based on the global palette specified in the file. Otherwise, the default is the same as the first bitmap in the list.

When you save an animated GIF file, this value is saved as a global value in the file.

See Also

Elements | AnimationBackColor property, AnimationBitsPerPixel property, AnimationWidth property, AnimationHeight property
Topics | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images
 | Using Color Values in LEADTOOLS


AnimationWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float AnimationWidth
Overview | Refer to Playing an Animation.

Remarks

Specifies the width of the target bitmap that is used for animation playback. The unit of measure is determined by the ScaleMode property.

This property applies to the temporary target bitmap that LEADTOOLS creates for animation playback.

This property is initialized when you take any of the following actions which create or replace the control's bitmap list:

Load an image file.

Capture an image from the screen.

Load one or more images using the TWAIN device.

Copy another control's bitmap list by assigning the BitmapList property.

If you resize the loaded bitmaps, this property is not updated, and you may need to update this property before playing the list as an animation.

When you load an animated GIF file, the initial value is based on the global width specified in the file. Otherwise, the default is the same as the first bitmap in the list.

When you save an animated GIF file, this value is saved as a global value in the file.

See Also

Elements: | AnimationBackColor property, AnimationBitsPerPixel property, AnimationPalette property, AnimationHeight property
Topics: | Raster Images: Saving Files
 | Raster Images: Getting and Setting File Information
 | Raster Images: Playing Animated Images


Appearance property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short Appearance
Overview | Refer to Displaying an Image.

Remarks

(persistent property, available at design time) Determines whether the Control has a flat or three-dimensional appearance.

Setting | Description
RASTERVIEW_APPEARANCE_FLAT | Flat appearance
RASTERVIEW_APPEARANCE_THREED | Three-dimensional appearance

See Also

Elements: | BackColor property, BorderStyle property
Topics: | Working with the Control: General Behavior
 | Raster Images: Displaying Images


AutoAnimate property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoAnimate
Overview | Refer to Playing an Animation.

Remarks

(Persistent property, available at design time) Causes an animation to begin playing as the file containing an animation is loaded.

Animation may be slower while a file is loading. An alternative for more reliable playback speed is to set the AnimationEnable property after the file is loaded.

Setting | Description
TRUE | Enables the play-while-load feature.
FALSE | Disables the play-while-load feature.

See Also

Elements: | AutoAnimationLoop property, AnimationLoop property, AnimationEnable property, Animate event
Topics: | Raster Images: Playing Animated Images


AutoAnimationLoop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short AutoAnimationLoop
Overview | Refer to Playing an Animation.

Remarks

(Persistent property, available at design time) Lets you force continued looping of an animation after it is loaded if the AutoAnimate property is TRUE.

Animated GIF files may continue looping by default, but for AVI files, you must set this property if you want continuous looping after the file is loaded.

Setting | Description
AUTOANIMATIONLOOP_DEFAULT | Use the files default value for continuous looping after loading.
AUTOANIMATIONLOOP_INFINITE | Force continuous looping after loading.

See Also

Elements: | AutoAnimate property, AnimationLoop property, AnimationEnable property, Animate event
Topics: | Raster Images: Playing Animated Images


AutoPan property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoPan;
Overview | Refer to Using a PanWindow.

Remarks

Contains a value that indicates whether you can pan an image. Possible values are:

Value | Meaning
TRUE | Panning the image is enabled.
FALSE | Panning the image is disabled.

To pan the image, click the mouse inside the image and then drag the mouse to pan.

This is very similar to using the PanWindow, without the extra window.

See Also

Elements: | PanWin event, PanWinHeight property, PanWinIcon property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


AutoRepaint property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoRepaint
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Enables automatic repainting of the bitmap.

When this property is TRUE, any change in the bitmap causes the bitmap to repaint. At run time, you can set the property to FALSE temporarily to change more than one property before repainting. Alternatively, you can use the ForceRepaint method to control repainting.

Setting | Description
TRUE | Enables automatic repainting of the bitmap.
FALSE | Disables automatic repainting of the bitmap.

See Also

Elements: | ForceRepaint method, PaintRgnOnly property, RepaintRect method, EnablePaint property
Topics: | Raster Images: Displaying Images


AutoRubberBand property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoRubberBand
Overview | Refer to Marking a Selection with a Rubberband.

Remarks

Automates the rubberband so that it appears whenever the mouse is moved with the left button down.

The rubberband is a one-pixel outline of a rectangle on the display surface. It is automatically resized with each mouse movement.

Value | Meaning
TRUE | Enable automation of the rubberband.
FALSE | Disable automation of the rubberband.

See Also

Elements: | RubberBand event
Topics: | Working with the Control: Client Area Usage


AutoScroll property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoScroll
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Enables automatic implementation of scroll bars.

Setting | Description
TRUE | Enables automatic implementation of scroll bars if the image display is bigger than the control.
FALSE | Disables automatic implementation of scroll bars.

See Also

Elements: | AutoRepaint property, AutoSetRects property, PaintSizeMode property, PaintZoomFactor property, AutoSize property
Topics: | Raster Images: Displaying Images


AutoSetRects property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoSetRects
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Enables or disables the automatic adjustment of display rectangles when bitmap dimensions change.

Setting | Description
TRUE | The source and destination display rectangles change when the bitmap changes. This occurs, for example, when loading a bitmap. The top and left values change to 0. The width and height values change according to the settings of the PaintSizeMode property and the PaintZoomFactor property.
FALSE | Disables automatic adjustment of rectangles.

Note: If you disable automatic adjustment of rects, you must update all four rects in order for the display to be correct when the size of the image is changed.

See Also

Elements: | AutoRepaint property, PaintSizeMode property, PaintZoomFactor property, AutoScroll property, AutoSize property
Topics: | Raster Images: Displaying Images


AutoSize property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL AutoSize
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Automatically sizes the Control to the size of the bitmap, if possible.

If the bitmap is larger than the current window, the control is resized to fit the image, regardless of the size of its container.

This property is effective when loading a bitmap and when taking any action (such as rotating a bitmap) that changes the dimensions of the bitmap.

Setting | Description
TRUE | Automatically size of the control to the size of the bitmap, if possible.
FALSE | the size of the bitmap does not affect the size of the control.

See Also

Elements: | AutoRepaint property, AutoSetRects property, PaintSizeMode property, PaintZoomFactor property, AutoScroll property
Topics: | Raster Images: Displaying Images


BackColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR BackColor
Overview | Refer to Displaying an Image.

Remarks

Sets the background color of the control.

See Also

Elements: | Appearance property, BorderStyle property
Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS
 | Raster Images: Displaying Images


BackErase property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL BackErase
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Causes the control to erase the background before painting. This erases the previous image before displaying the next image. Otherwise, the next image overlaps the previous image.

Setting | Description
TRUE | Erase the background of the control.
FALSE | Do not erase the background of the control.

See Also

Elements: | BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


BitonalScaling property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BitonalScalingConstants BitonalScaling
Overview | Refer to Displaying an Image.

Remarks

(Document/Medical only, persistent property, available at design time) Sets options to improve the display of bitonal bitmaps when they are scaled (zoomed in or zoomed out).

Setting | Description
BITONALSCALING_NORMAL | Causes bitonal images to be displayed normally when they are scaled.
BITONALSCALING_FAVORBLACK | Enables a bias in preserving black objects when displaying zoomed-out 1-bit images. This can prevent the disappearance of fine lines and details, but it slows down the display.
BITONALSCALING_SCALETOGRAY | Enables grayscaling of 1-bit images when they are displayed. This improves the readability of the images when they are zoomed in or zoomed out, but it slows down the display.

See Also

Elements: | BackErase property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


BorderStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short BorderStyle
Overview | Refer to Displaying an Image.

Remarks

Sets the border style of the Main Control.

Setting | Description
0 | No border.
1 | Place a single line border around the control.

See Also

Elements: | Appearance property, BackColor property
Topics: | Working with the Control: General Behavior
 | Raster Images: Displaying Images


CenterImage property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CenterImage
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Enables or disables the automatic adjustment of display rectangles in order to center the image in the control's client area, when the width and/or height of the destination rectangle is smaller than the width and/or height of the client area.

For example, this can be used to center a small image when it is displayed in a control that is larger than the image's dimensions. This can also be used in conjunction with PaintSizeMode property and PaintZoomFactor property to center an image when the zoomed display dimensions are smaller than the control's dimensions.

See Also

Elements: | AutoSetRects property, DstLeft property, DstTop property, DstWidth property, DstHeight property, DstClipLeft property, DstClipTop property, DstClipHeight property, DstClipWidth property, AutoScroll property, PaintSizeMode property, PaintZoomFactor property
Topics: | Raster Images: Displaying Images


ConvertX property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ConvertX
Overview | Refer to Displaying an Image

Remarks

(Read only, Runtime only) This property is updated by calling ClientToBitmap or BitmapToClient. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | ScaleMode property, BitmapToClient method, ClientToBitmap method, ConvertY property
Topics: | Working with the Control: Client Area Usage,
 | Raster Images: Displaying Images


ConvertY property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ConvertY
Overview | Refer to Displaying an Image

Remarks

(Read only, Runtime only) This property is updated by calling ClientToBitmap or BitmapToClient. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | ScaleMode property, BitmapToClient method, ClientToBitmap method, ConvertX property
Topics: | Working with the Control: Client Area Usage,
 | Raster Images: Displaying Images


DoubleBuffer property (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL DoubleBuffer
Overview | Refer to Displaying an Image.

Remarks

(Document/Medical only) (Persistent property, available at design time) Enables or disables double buffered image display in the control. Use this to avoid flicker when the control repaints invalidated areas. Possible values are:

Value | Meaning
TRUE | Enable double buffering
FALSE | Disable double buffering

This is especially useful when displaying annotations on the image. Without enabling double buffered painting, the image is painted first, and then the annotations are rendered. This can cause flicker, and, it allows the portion under the annotation objects, for example a Redact object, to be visible.

See Also

Elements: | BackErase property, AutoRepaint property, PaintRgnOnly property, RepaintRect method, EnablePaint property
Topics: | Raster Images: Displaying Images
 | Implementing Annotations


DstClipHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstClipHeight
Overview | Refer to Displaying an Image.

Remarks

The height of the destination clipping rectangle used when painting.

The initial value is the height of the bitmap. You can set this property or use the SetDstClipRect method to change the value. The position of the clipping rectangle is relative to the RasterView Control. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DstClipLeft property, DstClipTop property, DstClipWidth property
Topics: | Raster Images: Displaying Images


DstClipLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstClipLeft
Overview | Refer to Displaying an Image.

Remarks

The X coordinate of the origin of the destination clipping rectangle used when painting.

The initial value is 0. You can set this property or use the SetDstClipRect method to change the value. The position of the clipping rectangle is relative to the RasterView Control. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DstClipHeight property, DstClipTop property, DstClipWidth property
Topics: | Raster Images: Displaying Images


DstClipTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstClipTop
Overview | Refer to Displaying an Image.

Remarks

The Y coordinate of the origin of the destination clipping rectangle used when painting.

The initial value is 0. You can set this property or use the SetDstClipRect method to change the value. The position of the clipping rectangle is relative to the RasterView Control. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DstClipHeight property, DstClipLeft property, DstClipWidth property
Topics: | Raster Images: Displaying Images


DstClipWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstClipWidth
Overview | Refer to Displaying an Image.

Remarks

The width of the destination clipping rectangle used when painting.

The initial value is the width of the bitmap. You can set this property or use the SetDstClipRect method to change the value. The position of the clipping rectangle is relative to the RasterView Control. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DstClipHeight property, DstClipLeft property, DstClipTop property
Topics: | Raster Images: Displaying Images


DstHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstHeight
Overview | Refer to Displaying an Image.

Remarks

The height of the destination rectangle used when painting.

The initial value is the height of the bitmap. You can set this property or use the SetDstRect method to change the value. The position of the rectangle is relative to the RasterView Control. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | DstLeft property, DstTop property, DstWidth property
Topics: | Raster Images: Displaying Images


DstLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstLeft
Overview | Refer to Displaying an Image.

Remarks

The X coordinate of the origin of the destination rectangle used when painting.

The initial value is 0. You can set this property or use the SetDstRect method to change the value. The position of the rectangle is relative to the Main Control. The unit of measure is determined by the ScaleMode property.

The AutoScroll property must be FALSE before setting DstLeft or DstTop.

See Also

Elements: | DstHeight property, DstTop property, DstWidth property
Topics: | Raster Images: Displaying Images


DstTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstTop
Overview | Refer to Displaying an Image.

Remarks

The Y coordinate of the origin of the destination rectangle used when painting.

The initial value is 0. You can set this property or use the SetDstRect method to change the value. The position of the rectangle is relative to the Main Control. The unit of measure is determined by the ScaleMode property.

The AutoScroll property must be FALSE before setting DstLeft or DstTop.

See Also

Elements: | DstHeight property, DstLeft property, DstWidth property
Topics: | Raster Images: Displaying Images


DstWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float DstWidth
Overview | Refer to Displaying an Image.

Remarks

The width of the destination rectangle used when painting.

The initial value is the width of the bitmap. You can set this property or use the SetDstRect method to change the value. The position of the rectangle is relative to the Main Control. The unit of measure is determined by the ScaleMode property.

Because of a Windows limitation, destination rectangle measurements, when converted to pixels, cannot exceed the maximum value of an integer. On WIN32 systems, this is rarely a problem. LEADTOOLS returns an ERROR_INV_RANGE error if the problem occurs. An alternative for scaling large images is to make the source rectangle smaller, using the SetSrcRect method.

See Also

Elements: | DstHeight property, DstLeft property, DstTop property
Topics: | Raster Images: Displaying Images


EffectDelay property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short EffectDelay
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Delay between graining steps, in milliseconds.

This property affects paint effects (specified by the PaintEffect property).

Use the EffectGrain and EffectDelay properties to control the speed of the display. EffectGrain controls the size of the painting increment, and EffectDelay controls the time between increments.

See Also

Elements: | PaintEffect property, TransitionEffect property
Topics: | Raster Images: Implementing Special Effects


EffectCycles property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EffectCycles
Overview | Refer to Using Special Effects When Painting.

Remarks

Gets or sets a value that represents the number of cycles or repetitions used to draw the wave. This property is valid only if the TransitionEffect property or the PaintEffect property is from the Wave class.

See Also

Elements: | PaintEffect property, TransitionEffect property, EffectSpeed property
Topics: | Raster Images: Displaying Images


EffectGrain property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short EffectGrain
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Graining size. This is the smallest size (pixel width or height) to be updated when painting an effect. Using a small grain makes the painting smoother, but takes longer to paint. Using a large grain makes the painting more coarse, but paints faster. Valid values are 1 to 256.

This property affects both paint effects (specified by the PaintEffect property) and transition effects (specified by the TransitionEffect property).

Use the EffectGrain and EffectDelay properties to control the speed of the display. EffectGrain controls the size of the painting increment, and EffectDelay controls the time between increments.

See Also

Elements: | PaintEffect property, TransitionEffect property
Topics: | Raster Images: Implementing Special Effects


EffectSpeed property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short EffectSpeed
Overview | Refer to Using Special Effects When Painting.

Remarks

Gets or sets a value that represents the speed of the wave. Valid values are 1 to 256. This property is valid only if the TransitionEffect property or the PaintEffect property is from the Wave class.

See Also

Elements: | PaintEffect property, TransitionEffect property, EffectCycles property
Topics: | Raster Images: Displaying Images


Enabled property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL Enabled
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

Enables the Main Control.

The setting takes effect at run time.

Setting | Description
TRUE | Allows the control to respond to events.
FALSE | Prevents the control from responding to events.

See Also

Topics:

Working with the Control: General Behavior


EnableFireMouse2Event property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableFireMouse2Event
Overview | Refer to Detecting Events.

Remarks

(Persistent property, available at design time) Enables the use of the MouseDown2, MouseMove2 and MouseUp2 events. Possible values are:

Value | Meaning
TRUE | [0x0001] Generate MouseXXX2 events.
FALSE | [0x0002] Do not generate MouseXXX2 events.

See Also

Elements: | Click event, DblClick event, MouseMove event, MouseDown event, MouseUp event, MouseDown2 event, MouseMove2 event, MouseUp2 event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


EnableMagGlassDraw property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMagGlassDraw
Overview | Refer to Customizing Magnifying Glass Painting.

Remarks

Enables or disables the generation of the MagGlassOwnerDraw event. Possible values are:

Value | Meaning
VARIANT_TRUE | Generate the MagGlassOwnerDraw event.
VARIANT_FALSE | Do not generate the MagGlassOwnerDraw event.

If this property is true, then after the StartMagGlass method is called, and the magnifying glass paints itself to the DC, but before the magnifying glass is displayed on the screen, the user can change what is in the DC, through the MagGlassOwnerDraw event. This allows the user to provide custom rendering of the magnifying glass, within the magnifying glass's display area. For example, this feature lets you render magnified annotations, which may be overlaid on the currently displayed image, or just simply override what is currently in the magnifying glass display area.

To stop the generation of the MagGlassOwnerDraw event, set this property to VARIANT_FALSE.

See Also

Elements | AnnMagGlass method, MagGlassOwnerDraw event StartMagGlass method, StopMagGlass method
Topics | Using the Magnifying Glass Implementing Annotations Raster Images: Displaying Images Annotations: Displaying Annotations
 | Using the Zoom View


EnableMagGlassEvent property (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableMagGlassEvent
Overview | Refer to Using the Magnifying Glass.

Remarks

(Persistent property, available at design time) Enables the use of the MagGlassExt event. Possible values are:

Value | Meaning
TRUE | [0x0001] Generate MagGlassExt events.
FALSE | [0x0002] Do not generate MagGlassExt events.

After calling the StartMagGlass method, LEADTOOLS will monitor the window's messages, looking for mouse messages, and processing them by displaying a "Magnifying Glass". If the MagGlassExt event has been enabled by setting the EnableMagGlassEvent property to TRUE, information about the non-updated parts of the bitmap used for the Magnifying Glass's zoomed area can be obtained from the MagGlassExt event. This event receives information when the left mouse button is pressed or released and when the mouse is moved while the left mouse button is pressed. This information can be used to get updated color information and pass that information to the UpdateMagGlass method.

If the MagGlassExt event has been enabled by setting the EnableMagGlassEvent property to TRUE, the UpdateMagGlass method must be called in order to paint the zoomed image in the Magnifying Glass display area.

To stop the generation of MagGlassExt events, set this property to FALSE.

See Also

Elements | MagGlassExt event, StartMagGlass method, StopMagGlass method, UpdateMagGlass method
Topics | Raster Images: Displaying Images
 | Using the Zoom View


EnableMouseWheel Property (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL EnableMouseWheel
Overview | Refer to Detecting Events.

Remarks

Gets or sets a value that indicates whether LEADTOOLS generates MouseWheel event. Possible values are:

Setting | Description
TRUE | Generate MouseWheel event.
FALSE | Do not generate MouseWheel event.

See Also

Elements | Click event, DblClick event, MouseDown event, MouseUp event, MouseWheel Event
Topics | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


EnableOCRDrawing property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableOCRDrawing
Overview | Refer to Displaying an Image.

Remarks

Enables or disables drawing data from the OCR engine in an ILEADRasterView object. Possible values are:

Value | Meaning
TRUE | Data from the OCR engine may be drawn in the ILEADRasterView object.
FALSE | Data from the OCR engine may not be drawn in the ILEADRasterView object.

The RasterDocument property must be set before using the EnableOCRDrawing property.

To draw the selected zone of the OCR document in the ILEADRasterView control, set the index of the selected zone in the SelectedZoneIndex property.

See Also

Elements: | RasterDocument property, SelectedZoneIndex property
Topics: | Raster Images: Displaying Images


EnableOLEDragMethod property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableOLEDragMethod
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Persistent property, available at design time) Enables the OLE Drag and Drop operation in the RasterView Control. Possible values are:

Setting | Description
TRUE | Enables the Drag and Drop operation in the RasterView control.
FALSE | Disables the Drag and Drop operation in the RasterView control.

If EnableOLEDragMethod is set to TRUE, an OLEStartDrag event will occur at the beginning of the Drag and Drop operation. While the image is being dragged over the RasterView control, the OLEDragOver event and the OLEGiveFeedback event will be fired continuously. At the end of the Drag and Drop operation the OLECompleteDrag event will be fired.

The drag-and-drop operation will paste the dragged image to another RasterView Control.

Note:

You should set this property to FALSE (0) before closing your window. Otherwise the operating system may not release the window.

See Also

Elements: | OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics: | Raster Images: Copying Images


EnablePaint property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnablePaint
Overview | Refer to Displaying an Image.

Remarks

Enables or disables the painting of a window. Possible values are:

Value | Meaning
TRUE | The control will repaint when its window is invalidated.
FALSE | The control will not repaint, even if it has a bitmap and its window is invalidated.

The default value is TRUE (control will repaint its window).

Note : that this should not be confused with AutoRepaint. AutoRepaint will not disable the paint when set to FALSE. When AutoRepaint is set to false, the control will not repaint automatically – it will repaint only when the window is invalidated or when you call ForceRepaint.

This can be illustrated like this:

EnablePaint = FALSE -> control will never paint its window.

EnablePaint = TRUE -> control will paint is window.

AutoRepaint = TRUE -> The control will repaint its window when:

1) its window is invalidated (when you move a window that covered the control.

2) you scrolled its window (by clicking its scroll bars or using the pan window or setting AutoPan to TRUE and dragging the mouse)

3) it detects that you changed its bitmap (you changed one or more pixels, or you called a method that changed the bitmap)

AutoRepaint = FALSE -> Control will repaint only in situation 1) or 2) from above. (In other words, it will disable its automatic repainting mechanism).

This property would be useful if you are going to change the control’s window size several times. In this case, you might want to disable the paint until you decide on the final size.

See Also

Elements: | AutoRepaint property, ForceRepaint method
Topics: | Raster Images: Displaying Images


EnableUseDefaultCursor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL EnableUseDefaultCursor
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Persistent property, available at design time) Gets or sets a value that indicates whether to use the default cursor in the OLE Drag and Drop operation in the RasterView Control. Possible values are:

Setting | Description
TRUE | Uses the default Drag-and-Drop cursor
FALSE | Uses the custom cursor specified in the OLEDragCursor property.

See Also

Elements: | OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableOLEDragMethod property
Topics: | Raster Images: Copying Images


EnableZoomInRect property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableZoomInRect
Overview | Refer to Capturing an Image from the Screen.

Remarks

Shows or hides the ZoomIn rectangle for the ZoomIn method. Possible values are:

Setting | Description
TRUE | Show the ZoomIn rectangle in addition to the mouse pointer.
FALSE | Show only the ZoomIn magnifying glass mouse pointer.

See Also

Elements: | ZoomIn method
Topics: | Raster images: Capturing a screen image


Floater property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long Floater
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Specifies the floater bitmap for the LEAD RasterView control.

A floater is an additional bitmap that is associated with the LEAD RasterView control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the LEAD RasterView control's client area.

You can create the floater bitmap by assigning the LEAD RasterView control's ILEADRaster Bitmap property to it. The floater bitmap that this creates is the size of the bounding rectangle of the main bitmap's region, and it contains the same region as the main bitmap.

You can also make a copy of the floater bitmap by assigning it to another ILEADRaster object's Bitmap property.

See Also

Elements: | FloaterVisible property, IsPtInFloater method
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstClipHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstClipHeight
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The height of the destination clipping rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is the height of the Raster View Control's client area. You can set this property or use the more-efficient SetFloaterDstClipRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipLeft property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstClipLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstClipLeft
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The X coordinate of the origin of the destination clipping rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is 0. You can set this property or use the more-efficient SetFloaterDstClipRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstClipTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstClipTop
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The Y coordinate of the origin of the destination clipping rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is 0. You can set this property or use the more-efficient SetFloaterDstClipRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstClipWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstClipWidth
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The width of the destination clipping rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is the height of the Raster View Control's client area. You can set this property or use the more-efficient SetFloaterDstClipRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the RasterView Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipTop property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstHeight
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The height of the destination rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is the unscaled height of the floater bitmap. You can set this property or use the more-efficient SetFloaterDstRect method to change the value.

The position of the rectangle is relative to the RasterView Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstLeft property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstLeft
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The X coordinate of the origin of the destination rectangle used when painting the RasterView Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is 0. You can set this property or use the more-efficient SetFloaterDstRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstTop property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstTop
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The Y coordinate of the origin of the destination rectangle used when painting the Main Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is 0. You can set this property or use the more-efficient SetFloaterDstRect method to change the value.

The position of the rectangle is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Main Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Main Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstWidth property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterDstWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterDstWidth
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

The width of the destination rectangle used when painting the Raster View Control's floater bitmap.

If the AutoSetRects property is set to True, the initial value of this property is the unscaled width of the floater bitmap. You can set this property or use the more-efficient SetFloaterDstRect method to change the value.

The position of the rectangle is relative to the Raster View Control's client area. The unit of measure is determined by the ScaleMode property.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | FloaterDstHeight property, FloaterDstLeft property, FloaterDstTop property, FloaterDstClipHeight property, FloaterDstClipLeft property, FloaterDstClipTop property, FloaterDstClipWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterHeight
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

(Read only) Is the unscaled height of the floater bitmap.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | FloaterWidth property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterVisible property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL FloaterVisible
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Displays or hides the Raster View Control's floater bitmap.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

See Also

Elements: | Floater property, IsPtInFloater method
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


FloaterWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FloaterWidth
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

(Read only) Is the unscaled width of the floater bitmap.

A floater is an additional bitmap that is associated with the Raster View Control. Its common application is to implement the interactive visual aspects of an outline-drag-and-paste operation. You use it to get a copy of the image in the current bitmap region, which the user can drag to another position in the Raster View Control's client area.

The unit of measure is determined by the ScaleMode property.

See Also

Elements: | FloaterHeight property
Topics: | Raster Images: Copying Images
 | Raster Images: Creating and Using a Region


ForePalette property (ILEADRasterView)

Syntax | BOOL ForePalette
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Causes the Raster View Control's palette to be used as a foreground palette.

The main purpose of this property is to overcome palette-handling problems in Access and FoxPro. Set this property to TRUE only if you are displaying single images. It can cause problems in a multiple document interface (MDI).

Although you can use this property with other development systems, there is no reason to do so. Consequently no examples are provided for this property.

Setting | Description
TRUE | Use the Raster View control's palette as a foreground palette.
FALSE | Use the Raster View control's palette as a background palette.

See Also

Elements: | BackErase property, BitonalScaling property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


FrameColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR FrameColor
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the border color of the three-dimensional frame that you add to the Raster View Control.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame. Other properties described in Adding a Frame to the Control, specify the inner and outer bands that give the frame a three-dimensional appearance.

See Also

Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS


FrameInnerHiliteColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR FrameInnerHiliteColor
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the inner highlight color of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS


FrameInnerShadowColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR FrameInnerShadowColor
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the inner shadow color of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS


FrameInnerStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | EfxFrameInnerStyleConstants FrameInnerStyle
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the style of the inner band of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

The following are possible values of the FrameInnerStyle property:

Value | Meaning
EFX_INNERSTYLE_INSET | Inner band inset
EFX_INNERSTYLE_RAISED | Inner band raised
EFX_INNERSTYLE_MAX | Inner band raised

See Also

Topics:

Working with the Control: General Behavior


FrameInnerThickness property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FrameInnerThickness
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the thickness of the inner band of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics:

Working with the Control: General Behavior


FrameOuterHiliteColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR FrameOuterHiliteColor
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the outer highlight color of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS


FrameOuterShadowColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR FrameOuterShadowColor
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the outer shadow color of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics: | Working with the Control: General Behavior
 | Using Color Values in LEADTOOLS


FrameOuterStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | EfxFrameOuterStyleConstants FrameOuterStyle
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the style of the outer band of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

The following are possible values of the FrameInnerStyle property:

Value | Meaning
EFX_OUTERSTYLE_INSET | Outer band inset
EFX_OUTERSTYLE_RAISED | Outer band raised
EFX_OUTERSTYLE_MAX | Outer band raised

See Also

Topics:

Working with the Control: General Behavior


FrameOuterThickness property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FrameOuterThickness
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the thickness of the outer band of the three-dimensional frame that you add to the Raster View Control. This property works with others described in Adding a Frame to the Control to give the frame a three-dimensional appearance.

The FrameThickness property determines the thickness of the frame, and you can set the thickness to 0 to disable the frame.

See Also

Topics:

Working with the Control: General Behavior


FrameThickness property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float FrameThickness
Overview | Refer to Adding a Frame to the Control.

Remarks

(Persistent property, available at design time) Specifies the thickness of the frame that you add to the Raster View Control. You can set the thickness to 0 to disable the frame.

Other properties described in Adding a Frame to the Control give the frame a three-dimensional appearance.

See Also

Topics:

Working with the Control: General Behavior


GradientEndColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR GradientEndColor
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a gradient color for use when you implement a transitional paint effect or when you draw a three-dimensional shape or text object.

A gradient color starts as one color and ends as another, with the specified number of transitional colors from start to end. Related properties work together as follows:

GradientStyle specifies the style.

GradientStartColor specifies the starting color.

GradientEndColor specifies the ending color.

GradientSteps specifies the number of colors from start to end.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Using Color Values in LEADTOOLS
 | Working with the Control: Client Area Usage


GradientStartColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR GradientStartColor
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a gradient color for use when you implement a transitional paint effect or when you draw a three-dimensional shape or text object.

A gradient color starts as one color and ends as another, with the specified number of transitional colors from start to end. Related properties work together as follows:

GradientStyle specifies the style.

GradientStartColor specifies the starting color.

GradientEndColor specifies the ending color.

GradientSteps specifies the number of colors from start to end.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Using Color Values in LEADTOOLS
 | Working with the Control: Client Area Usage


GradientSteps property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short GradientSteps
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a gradient color for use when you implement a transitional paint effect or when you draw a three-dimensional shape or text object.

A gradient color starts as one color and ends as another, with the specified number of transitional colors from start to end. Related properties work together as follows:

GradientStyle specifies the style.

GradientStartColor specifies the starting color.

GradientEndColor specifies the ending color.

GradientSteps specifies the number of colors from start to end.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Working with the Control: Client Area Usage


GradientStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | GradientStyleConstants GradientStyle
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Specifies the style of a gradient color for use when you implement a transitional paint effect.

A gradient color starts as one color and ends as another, with the specified number of transitional colors from start to end. Related properties work together as follows:

GradientStyle specifies the style.

GradientStartColor specifies the starting color.

GradientEndColor specifies the ending color.

GradientSteps specifies the number of colors from start to end.

For possible values of the GradientStyle property, refer to Gradients.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Working with the Control: Client Area Usage


HasMagGlass property (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | VARIANT_BOOL HasMagGlass;
Overview | Refer to Using the Magnifying Glass

Remarks

(Read only) Determines whether the control has a magnifying glass attached to it. Possible values are:

Value | Meaning
TRUE | The control has a magnifying glass attached to it.
FALSE | The control does not have a magnifying glass attached to it.

See Also

Functions: | StartMagGlass method, StopMagGlass method, UpdateMagGlassShape method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


HasZoomView property (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL HasZoomView
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) (Read Only) This property is updated with a value that indicates whether the specified window has a Zoom View attached to it. Possible values are:

Value | Meaning
True | The window has one or more Zoom Views attached to it.
False | The specified window does not have any Zoom Views attached to it.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, DstLeft property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


HScrollInfo property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADScrollInfo* HScrollInfo
Overview | Refer to Scrolling an Image.

Remarks

(Runtime only) Contains the object that references the control's horizontal scrollbar information.

The ILEADScrollInfo object has the following properties:

Property | Description
Min | (Read only) Long value that is updated with the minimum scroll range value.
Max | (Read only) Long value that is updated with the maximum scroll range value.
Page | Long value that gets or sets the scroll page size, in pixels.
Line | Long value that gets or sets the size of the scroll line, in pixels. This is the amount that will be scrolled by line left or line right. The line value must be <= the page value.
Pos | Long value that gets or sets the thumb position (current position) of the scrollbar. This value can be set to scroll the display.
Visible | (Read only) Boolean flag that indicates whether the scrollbar is visible. If this is TRUE, the scrollbar is visible. If this value is FALSE, the scrollbar is not visible.
Width | (Read only) Float value that is updated with the size of the of the scrollbar. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AutoScroll property, VScrollInfo property, Scroll event, Resize event
Topics: | Raster Images: Displaying Images


MagGlassFlags property (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MagGlassFlags
Overview | Refer to Using the Magnifying Glass

Remarks

Flags that indicate which colors in the zoomed image of the Magnifying Glass will be displayed, which colors will be masked, and whether the Magnifying Glass will be manually updated. Possible values are:

Value | Meaning
MAGGLASS_MASK_NORMAL | [0x0000] Only those colors present in the MagGlassMask property will be masked in the Magnifying Glass display area. All other colors will be displayed
MAGGLASS_MASK_INVERT | [0x0001] Only those colors present in the MagGlassMask property will be displayed in the Magnifying Glass display area. All other colors will be masked

The following flag indicates whether the Magnifying Glass will be manually updated.

Value | Meaning
MAGGLASS_MANUAL_UPDATE | [0x0002] LEADTOOLS will not handle the mouse events in order to manipulate the Magnifying Glass. The user must control the Magnifying Glass by using the ShowMagGlass and SetMagGlassPos methods.

See Also

Elements: | MagGlassMask property, MagGlassMaskCount property , StartMagGlass method, MagGlassCursor event, StartMagGlass method, StopMagGlass method, ShowMagGlass method, SetMagGlassPos method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassMask property (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR MagGlassMask (short iIndex);
Overview | Refer to Using the Magnifying Glass

Remarks

Array that specifies the color(s) to mask out of the zoomed magnifying glass display.

These colors will be replaced by the crBack parameter passed to the StartMagGlass.

Allocate this array by setting the MagGlassMaskCount property.

See Also

Elements: | MagGlassMaskCount property
Topics: | Raster Images: Displaying Images
 | Using Color Values in LEADTOOLS
 | Using the Zoom View


MagGlassMaskCount property (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MagGlassMaskCount
Overview | Refer to Using the Magnifying Glass

Remarks

The number of entries in the MagGlassMask property array.

Allocate the MagGlassMask property array by setting this property.

See Also

Elements: | MagGlassMask property
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassPaintContrast property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MagGlassPaintContrast
Overview | Refer to Using the Magnifying Glass

Remarks

(Persistent property, available at design time) Contrast correction value used by the Magnifying Glass when it paints the zoomed area.

Setting the contrast value that is used by the Magnifying Glass lets you adjust the displayed contrast of the zoomed area without changing the bitmap data.

Possible values range from -1000 to +1000. A positive value increases the contrast of the zoomed area. A negative value decreases the contrast of the zoomed area.

See Also

Elements: | MagGlassPaintGamma property, MagGlassPaintIntensity property, StartMagGlass method, StopMagGlass method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassPaintGamma property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MagGlassPaintGamma
Overview | Refer to Using the Magnifying Glass

Remarks

(Persistent property, available at design time) Gamma correction value used by the Magnifying Glass when it paints the zoomed area.

Setting the Magnifying Glass gamma correction that is used by the Magnifying Glass lets you adjust the displayed brightness of the zoomed area without changing the bitmap data.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

Because this property is an unsigned integer, it is 100 times the actual gamma value. For example, use 235 to set a gamma value of 2.35.

See Also

Elements: | MagGlassPaintContrast property, MagGlassPaintIntensity property, StartMagGlass method, StopMagGlass method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassPaintIntensity property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short MagGlassPaintIntensity
Overview | Refer to Using the Magnifying Glass

Remarks

(Persistent property, available at design time) Intensity correction value used by the Magnifying Glass when it paints the zoomed display area.

Setting the Magnifying Glass intensity value that is used by the Magnifying Glass lets you adjust the displayed brightness of the zoomed display area without changing the bitmap data.

Possible values range from -1000 to +1000. A positive value lightens the zoomed display area. A negative value darkens the zoomed display area.

See Also

Elements: | MagGlassPaintContrast property, MagGlassPaintGamma property, StartMagGlass method, StopMagGlass method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MouseIcon property (ILEADRasterView)

Visual Basic example

Other systems

Delphi 4 example

C++ Builder example

Syntax | IPictureDisp* MouseIcon
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

(Persistent property, available at design time) Sets a custom mouse icon.

You can set this property to a cursor or icon file. Then, you can set the MousePointer property to 99 to implement the custom mouse icon.

See Also

Elements: | MousePointer property
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MousePointer property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short MousePointer
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

(Persistent property, available at design time) Sets or returns the value that indicates the type of mouse pointer for the Raster View Control.

Setting | Meaning
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the MouseIcon property

See Also

Elements: | MouseIcon property
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


OLEDragCursor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | IPictureDisp* OLEDragCursor
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Persistent property, available at design time.) Gets or sets a custom mouse icon for the OLE Drag-and-Drop operation.

To use a custom mouse icon for the Drag and Drop operation, set this property to the desired icon and set the EnableUseDefaultCursor property to FALSE.

See Also

Elements: | EnableUseDefaultCursor property, EnableOLEDragMethod property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event
Topics: | Raster Images: Copying Images


OLEDropAllowed property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL OLEDropAllowed
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Persistent property, available at design time) Determines whether the ILEADRasterView Control will attempt to load an image file that is dropped onto it in a drag-and-drop operation.

If OLEDropAllowed is TRUE, an OLEDropFile event will occur for each file dropped.

The drag-and-drop operation loads the image at its own bits per pixel. If it is a multipage file, only the first page is loaded.

Note: You should set this property to FALSE (0) before closing your window. Otherwise the operating system may not release the window.

Note: When using the ILEADRasterView ActiveX control on a web page, you should set this property to False on the Unload Event. For example, in VBScript this is done as follows:

Sub Window_OnUnload
LEAD1.OLEDropAllowed = False
end Sub

Value | Meaning
TRUE | Loading an image through an OLE drag-and-drop operation is enabled.
FALSE | Loading an image through an OLE drag-and-drop operation is disabled.

See Also

Elements: | OLEDropFile event
Topics: | Working with the Control: General Behavior
 | Raster Images: Loading Files


PaintContrast property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintContrast
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Contrast correction value used by painting operations.

Setting the contrast value that is used for painting lets you adjust the displayed contrast of all images without changing the bitmap data.

Possible values range from -1000 to +1000. A positive value increases the contrast of the displayed image. A negative value decreases the contrast of the image.

When applying contrast, gamma, and intensity changes to an image, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property
Topics: | Raster Images: Displaying Images
 | Changing Brightness and Contrast


PaintDither property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintDitherConstants PaintDither
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Specifies the type of dithering to use when painting an image on a device with 256 colors or less.

Ordered dithering is faster than error diffusion, but the quality of the image is not as good.

Setting | Description
PAINTDITHER_ORDERED | Use ordered dithering.
PAINTDITHER_DIFFUSION | Use error diffusion.

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images
 | Raster Images: Doing Color Expansion or Reduction


PaintEffectMaxPasses property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintEffectMaxPasses
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Maximum passes for a pattern brush when implementing a paint effect. Use 1 for painting in one pass. Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

If you specify more than one pass, a pattern brush paints some of the pixels on each pass, and the painting is complete when you finish all of the passes. The PaintNotification event, which occurs before painting and after each pass, lets you change the behavior of the effect before it finishes.

See Also

Elements: | PaintEffect property, PaintEffectPass property, PaintNotification event , PaintNotificationDelay property
Topics: | Raster Images: Implementing Special Effects


PaintEffect property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | EfxPaintEffectConstants PaintEffect
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Sets the effect to be used when painting the image.

LEADTOOLS provides over 2000 defined constant identifiers for effects. Visual Basic users must include L_OCXEFX.BAS in order to use the defined constant identifiers. This file can be found in the lead\include directory.

For possible values for this property, refer to Effects.

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


PaintEffectPass property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintEffectPass
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) The current pass during a paint effect.

You can set this value in the PaintNotification event if you want to skip or repeat a pass (for example, if you want to end with a blend of old and new images).

See Also

Elements: | PaintEffect property, PaintEffectMaxPasses property, PaintNotification event , PaintNotificationDelay property
Topics: | Raster Images: Implementing Special Effects


PaintGamma property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintGamma
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Gamma correction value used by painting operations.

Setting the gamma correction that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

Because this property is an unsigned integer, it is 100 times the actual gamma value. For example, use 235 to set a gamma value of 2.35.

When applying contrast, gamma, and intensity changes to an image, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images
 | Changing Brightness and Contrast


PaintIntensity property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintIntensity
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Intensity correction value used by painting operations.

Setting the intensity value that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

Possible values range from -1000 to +1000. A positive value lightens the displayed image. A negative value darkens the image.

When applying contrast, gamma, and intensity changes to an image, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintROP3 property, PaintGamma property, PaintContrast property
Topics: | Raster Images: Displaying Images
 | Changing Brightness and Contrast


PaintNotificationDelay property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintNotificationDelay
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Delay between paint passes, in milliseconds.

If you specify more than one pass when painting a special effect, a pattern brush paints some of the pixels on each pass, and the painting is complete when you finish all of the passes. The PaintNotification event occurs before painting and after each pass. The PaintNotificationDelay property specifies the delay in that event.

See Also

Elements: | PaintEffect property, TransitionEffect property, PaintEffectMaxPasses property, PaintEffectPass property, PaintNotification event, PaintTransitionPass property, PaintTransitionMaxPasses property
Topics: | Raster Images: Implementing Special Effects


PaintPalette property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintPaletteConstants PaintPalette
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Specifies whether to force use of a fixed palette when painting images on a device that displays 256 colors or less.

Using the fixed palette improves the overall display of multiple images. You can specify either the LEAD fixed palette or the Netscape fixed palette. The Netscape fixed palette is the same palette used by Netscape Navigator and Microsoft Internet Explorer.

Setting | Description
PAINTPALETTE_AUTO | Use the bitmap's own palette if available; otherwise use the LEAD fixed palette.
PAINTPALETTE_FIXED | Always use the LEAD fixed palette.
PAINTPALETTE_AUTONETSCAPE | Use the bitmap's own palette if available; otherwise use the Netscape fixed palette.
PAINTPALETTE_FIXEDNETSCAPE | Always use the Netscape fixed palette.

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintROP3 property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


PaintRgnOnly property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL PaintRgnOnly
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Determines whether only the current region of the bitmap paints. Painting can be automated with the AutoRepaint property or forced with the ForceRepaint method.

Value | Meaning
TRUE | Paint only the current region.
FALSE | Paint any part of the bitmap that is within the display rectangles.

See Also

Elements: | AutoRepaint property, ForceRepaint method, RepaintRect method, Transparent property
Topics: | Raster Images: Displaying Images
 | Implementing Transparency


PaintROP3 property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long PaintROP3
Overview | Refer to Displaying an Image.

Remarks

Specifies the Windows ROP3 code to use when painting.

The default (for normal painting) is SRCCOPY. You can specify any of the ROP3 codes that the Windows BitBlt function uses.

See Also

Elements: | BackErase property, BitonalScaling property, ForePalette property, PaintDither property, PaintEffect property, PaintPalette property, PaintGamma property, PaintIntensity property, PaintContrast property
Topics: | Raster Images: Displaying Images


PaintScaling property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintScalingConstants PaintScaling
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Type of resizing to use during painting.

Default is PAINTSCALING_NORMAL, which is the fastest.

Possible values are:

Value | Meaning
PAINTSCALING_NORMAL | [0] normal resize (fastest)
PAINTSCALING_RESAMPLE | [1] bilinear interpolation (slower than PAINTSCALING_NORMAL, but produces better looking results)
PAINTSCALING_BICUBIC | [2] bicubic interpolation (slowest, best quality)

For 1-bit images, the PaintScaling is considered only if BitonalScaling is BITONALSCALING_NORMAL. Otherwise, the FavorBlack and ScaleToGray options take precedence over PaintScaling.

PAINTSCALING_BICUBIC produces the same result as PAINTSCALING_RESAMPLE when zooming out on an image.

See Also

Elements: | BitonalScaling property
Topics: | Raster Images: Displaying Images


PaintSizeMode property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintSizeModeConstants PaintSizeMode
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Determines the behavior of the AutoSetRects property, which automatically adjusts the display rectangles. It adjusts the destination rectangle as follows:

Setting | Description
PAINTSIZEMODE_NORMAL | Width is the bitmap width. Height is the bitmap height.
PAINTSIZEMODE_STRETCH | Width is the control's client area width. Height is the client area height. The aspect ratio is not preserved.
PAINTSIZEMODE_FITSIDES | Width is the control's client area width. Height is set proportionally to maintain the aspect ratio. The AutoScroll property implements the vertical scroll bar.
PAINTSIZEMODE_FIT | The largest possible width or height is set to the control's client area width or height. The remaining dimension is set proportionally to maintain the aspect ratio.
PAINTSIZEMODE_ZOOM | The width and height are set to the bitmap width and height multiplied by the PaintZoomFactor property.

See Also

Elements: | AutoRepaint property, AutoSetRects property, PaintZoomFactor property, AutoScroll property, AutoSize property
Topics: | Raster Images: Displaying Images


PaintSizeUseDPI property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL PaintSizeUseDPI
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Gets or sets a value that indicates whether LEAD's automated scaling properties are used to account for the physical resolution of the bitmap. Possible values are:

Value | Meaning
TRUE | Account for the physical resolution.
FALSE | Do not account for the physical resolution.

The physical resolution of a bitmap is measured in dots per inch (DPI). When you load an image, the BitmapXRes and BitmapYRes properties are updated with the DPI values for the horizontal and vertical resolution. Some images have different horizontal and vertical resolutions (for example: 300 by 600). In such cases, the displayed images will appear elongated if you do not account for the resolution.

If the values of the BitmapXRes property and the BitmapYRes property are not equal, set the PaintSizeUseDPI property to TRUE to have LEAD's automated scaling properties account for the physical resolution of the bitmap. These automated scaling properties include:

AutoRepaint property

AutoScroll property

AutoSetRects property

AutoSize property

DstHeight property

DstLeft property

DstTop property

DstWidth property

PaintSizeMode property

PaintZoomFactor property

See Also

Elements: | AutoRepaint property, AutoScroll property, AutoSetRects property, AutoSize property, BitmapXRes property, BitmapYRes property, DstHeight property, DstLeft property, DstTop property, DstWidth property, PaintSizeMode property, PaintZoomFactor property
Topics | Raster Images: Displaying Images


PaintTransitionMaxPasses property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintTransitionMaxPasses
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Maximum passes for a pattern brush when implementing a paint transition. Use 1 for painting in one pass. Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

If you specify more than one pass, a pattern brush paints some of the pixels on each pass, and the painting is complete when you finish all of the passes. The PaintNotification event, which occurs before painting and after each pass, lets you change the behavior of the effect before it finishes.

See Also

Elements: | TransitionEffect property, PaintTransitionPass property, PaintNotification event , PaintNotificationDelay property
Topics: | Raster Images: Implementing Special Effects


PaintTransitionPass property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PaintTransitionPass
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) The current pass during a transition effect.

You can set this value in the PaintNotification event if you want to skip or repeat a pass (for example, if you want to end with a blend of old and new images).

See Also

Elements: | TransitionEffect property, PaintTransitionMaxPasses property, PaintNotification event , PaintNotificationDelay property
Topics: | Raster Images: Implementing Special Effects


PaintWhileLoad property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | VARIANT_BOOL PaintWhileLoad
Overview | Refer to Loading a Bitmap from a File.

Remarks

(Persistent property, available at design time) Causes the bitmap to paint while the image file is loading. This lets the user see the progress of the load.

This property works only when the display mode is 32K colors (16-bit) or higher.

Setting | Description
TRUE | Paint the bitmap while the image is loading.
FALSE | Paint the bitmap when the image is finished loading.

See Also

Topics:

Raster Images: Loading Files


PaintZoomFactor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float PaintZoomFactor
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Is the zoom factor that is used when the AutoSetRects property is TRUE.

You can read and write this property when the PaintSizeMode property is PAINTSIZEMODE_ZOOM.

This property is read only when the PaintSizeMode property is set to another value. When it is set to PAINTSIZEMODE_STRETCH, the zoom factor is the smallest of the width or height zoom factors (the aspect ratio is not preserved).

If the AutoSetRects property is FALSE, this property is not valid.

See Also

Elements: | AutoRepaint property, AutoSetRects property, PaintSizeMode property, AutoScroll property, AutoSize property
Topics: | Raster Images: Displaying Images


PanWinBitonalScaling property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BitonalScalingConstants PanWinBitonalScaling
Overview | Refer to Using a PanWindow.

Remarks

(Document/Medical only, persistent property, available at design time) Sets options to improve the display of bitonal bitmaps in the PanWindow. The default is BITONALSCALING_NORMAL.

Setting | Description
BITONALSCALING_NORMAL | Causes bitonal images to be displayed normally when they are scaled.
BITONALSCALING_FAVORBLACK | Enables a bias in preserving black objects when displaying zoomed-out 1-bit images. This can prevent the disappearance of fine lines and details, but it slows down the display.
BITONALSCALING_SCALETOGRAY | Enables grayscaling of 1-bit images when they are displayed. This improves the readability of the images when they are zoomed in or zoomed out, but it slows down the display.

See Also

Elements: | PanWin event, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinCursor property (ILEADRasterView)

Visual Basic example

Other Systems

Syntax | IPictureDisp*PanWinCursor
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Sets a custom mouse icon for the PanWindow.

You can set this property to a cursor or icon file. Then, you can set the PanWinPointer property to 99 to implement the custom PanWindow mouse icon.

See Also

Elements: | PanWinBitonalScaling property, PanWinevent, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PanWinHeight
Overview | Refer to Using a PanWindow.

Remarks

(Persistent and available at design time.) Sets the requested height of the PanWindow (the default is 150) or gets the current height of the Pan Window, when the Pan Window is visible. A "get" performed on an invisible window returns the height of the last active PanWindow, or, if a PanWindow has not been created, 150.

Note: the actual size of the PanWindow will depend on the aspect ratio of the image

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWin event, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinPaintDither property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintDitherConstants PanWinPaintDither
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time) Specifies the type of dithering to use when painting an image on a device with 256 colors or less in the PanWindow. The default is PAINTDITHER_ORDERED.

Ordered dithering is faster than error diffusion, but the quality of the image is not as good.

Setting | Description
PAINTDITHER_ORDERED | Use ordered dithering.
PAINTDITHER_DIFFUSION | Use error diffusion.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWin event, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinIcon property (ILEADRasterView)

Visual Basic example

Other Systems

Syntax | IPictureDisp* PanWinIcon
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Sets a custom PanWindow icon. This is the icon that will appear in the corner of the Pan Window's title bar if the PanWinSysMenu property is TRUE. This defaults to none, which means Windows will choose the icon.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWin event, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinPaintPalette property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintPaletteConstants PanWinPaintPalette
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time) Specifies whether to force the use of a fixed palette when painting images on a device that displays 256 colors or less in the PanWindow.

Using the fixed palette improves the overall display of multiple images. You can specify either the LEAD fixed palette or the Netscape fixed palette. The Netscape fixed palette is the same palette used by Netscape Navigator and Microsoft Internet Explorer. The default is PAINTPALETTE_AUTO.

Setting | Description
PAINTPALETTE_AUTO | Use the bitmap's own palette if available; otherwise use the LEAD fixed palette.
PAINTPALETTE_FIXED | Always use the LEAD fixed palette.
PAINTPALETTE_AUTONETSCAPE | Use the bitmap's own palette if available; otherwise use the Netscape fixed palette.
PAINTPALETTE_FIXEDNETSCAPE | Always use the Netscape fixed palette.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWin event, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinPaintScaling property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PaintScalingConstants PaintScaling
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time) Type of resizing to use when painting the PanWindow.

Default is PAINTSCALING_NORMAL, which is the fastest.

Possible values are:

Value | Meaning
PAINTSCALING_NORMAL | [0] normal resize (fastest)
PAINTSCALING_RESAMPLE | [1] bilinear interpolation (slower than PAINTSCALING_NORMAL, but produces better looking results)
PAINTSCALING_BICUBIC | [2] bicubic interpolation (slowest, best quality)

For 1-bit images, the PanWinPaintScaling is considered only if PanWinBitonalScaling is BITONALSCALING_NORMAL. Otherwise, the FavorBlack and ScaleToGray options take precedence over PanWinPaintScaling.

PAINTSCALING_BICUBIC produces the same result as PAINTSCALING_RESAMPLE when zooming out on an image.

See Also

Elements: | PanWinBitonalScaling property,PanWin event, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinPointer property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PanWinPointer
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Sets or gets the value that indicates the type of mouse pointer used in the Pan Window.

Setting | Meaning
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the PanWinCursor property

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWin event, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinRectColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR PanWinRectColor
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Gets or sets the color used to draw the Pan Window's Pan Rect. The default color is RED.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWin event, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing
 | Using Color Values in LEADTOOLS


PanWinSysMenu property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL PanWinSysMenu
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Indicates whether or not to include the system menu on the PanWindow. If PanWinSysMenu is TRUE, the system menu will be included on the PanWindow. If it is FALSE, the menu will not be included. The default is TRUE.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWin event, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinTitle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BSTR PanWinTitle
Overview | Refer to Using a PanWindow.

Remarks

(Persistent property, available at design time.) Gets or sets the string for the title bar of the PanWindow. The default is NULL.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWin event, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PanWinWidth
Overview | Refer to Using a PanWindow.

Remarks

(Persistent and available at design time.) Sets the requested width of the PanWindow (the default is 150) or gets the current width of the Pan Window, when the Pan Window is visible. A "get" performed on an invisible window returns the width of the last active PanWindow, or, if a PanWindow has not been created, 150.

Note: the actual size of the PanWindow will depend on the aspect ratio of the image

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWin event, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinX property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PanWinX
Overview | Refer to Using a PanWindow.

Remarks

(Persistent and available at design time.) Get or sets the X coordinate used to locate the PanWindow. The default is 0.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWin event, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PanWinY property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short PanWinY
Overview | Refer to Using a PanWindow.

Remarks

(Persistent and available at design time.) Get or sets the Y coordinate used to locate the PanWindow. The default is 0.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWin event, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


PatternBackColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR PatternBackColor
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape.

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor property specifies the foreground color of the pattern.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Using Color Values in LEADTOOLS
 | Working with the Control: Client Area Usage


PatternForeColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR PatternForeColor
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor property specifies the foreground color of the pattern.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Using Color Values in LEADTOOLS
 | Working with the Control: Client Area Usage


PatternStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | PatternStyleConstants PatternStyle
Overview | Refer to Gradients and Patterns.

Remarks

(Persistent property, available at design time) Works with related properties to specify a solid color or pattern for use when you implement a transitional paint effect or when you draw a three-dimensional shape.

Related properties work together as follows:

PatternStyle specifies the style, which can be solid, transparent (for three-dimensional shapes only), or any of several line patterns.

PatternBackColor specifies the background color of the pattern.

PatternForeColor propertyspecifies the foreground color of the pattern.

For a list of possible values, refer to PatternStyles.

See Also

Topics: | Raster Images: Implementing Special Effects
 | Raster Images: Drawing on a Bitmap
 | Working with the Control: Client Area Usage


PrinterScaleHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float PrinterScaleHeight
Overview | Refer to Printing an Image.

Remarks

(Read only) Gets the printable height of the default printer.

The unit of measure is determined by the ScaleMode property.

This property can be used with the Render method to print images.

See Also

Elements: | PrinterScaleWidth property, ScaleMode property
Topics: | Raster Images: Printing Images


PrinterScaleWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float PrinterScaleWidth
Overview | Refer to Printing an Image.

Remarks

(Read only) Gets the printable width of the default printer.

The unit of measure is determined by the ScaleMode property.

This property can be used with the Render method to print images.

See Also

Elements: | PrinterScaleHeight property, ScaleMode property
Topics: | Raster Images: Printing Images


Raster property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | ILEADRaster* Raster
Overview | Refer to Bitmaps and Bitmap Lists.

Remarks

Is the LEAD RasterView Control's internal ILEADRaster Object.

The LEAD RasterView Control contains an internal instance of an ILEADRaster object. You can use this property to get that object, which can then be passed as a reference to other LEADTOOLS COM Objects such as ILEADRasterIO and ILEADRasterProcess.

See Also

Elements: | RefBitmap property, Bitmap property
Topics: | Raster Images: Creating and Deleting Images
 | Raster Images: Copying Images


RasterDocument property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADRasterDocument* RasterDocument
Overview | Refer to Displaying an Image.

Remarks

Gets or sets the ILEADRasterDocument object that references the OCR engine and its associated OCR document pages.

The RasterDocument property, the EnableOCRDrawing property and the SelectedZoneIndex property let the user draw data from the OCR engine into the ILEADRasterView control. To do this:

  1. Start the OCR engine for a specific ILEADRasterDocument object.

  2. Set the ActivePageIndex property (ILEADRasterDocument) to the page to be drawn.

  3. Set the RasterDocument property (ILEADRasterView) to the valid ILEADRasterDocument object for which the OCR engine was started in step 1.

  4. Set the EnableOCRDrawing property to TRUE to allow the OCR engine data to be drawn in the ILEADRasterView control.

See Also

Elements: | EnableOCRDrawing property, SelectedZoneIndex property
Topics: | Raster Images: Displaying Images


RasterIO property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | LPDISPATCH RasterIO
Overview | Refer to Handling CMYK Files as Separate Bitmaps

Remarks

Gets or sets the ILEADRasterIO object that references the IO methods.

Set this property before loading CMYK Raster bitmaps by calling the LoadFileCMYKArray method, or enabling the painting of CMYK Raster bitmaps by setting the EnablePaintCMYKArray property.

See Also

Elements: | CMYKRaster property, CMYKRasterCount property, LoadFileCMYKArray method, SaveFileCMYKArray method, EnablePaintCMYKArray property
Topics | Raster Images: Loading Files


RenderCenter property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL RenderCenter
Overview | Refer to Printing an Image.

Remarks

Gets or sets a value that indicates whether an image is centered when it is printed or displayed in any device context, using the Render method. This property is only used if one of the following is true:

  • the fLeft parameter of the Render method is 0,

  • the fTop parameter of the Render method is 0,

  • both the fLeft and the fTop parameters of the Render method are 0.

Possible values are:

Setting | Description
TRUE | If only the fLeft parameter of the Render method is 0, the image will be centered horizontally; if only the fTop parameter of the Render method is 0, the image will be centered vertically; if both the fLeft and the fTop parameters of the Render method are 0, the image will be centered horizontally and vertically.
FALSE | The image will not be centered, but will be rendered at position fLeft, fTop on the DC.

See Also

Elements: | Render method
Topics: | Raster Images: Printing Images


RgnFrameColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR RgnFrameColor
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Color used to highlight a region by displaying a filled color representation of the region. This property is only valid when the RgnFrameType property is set to RGNFRAME_COLOR.

This color will be XORed with colors within a region to determine the new colors for displaying the region. The color corresponding to a particular part of the region is determined as follows:

Region Color Displayed = (color of pixel in region) XOR (crRgnColor)

This is particularly useful when displaying regions with black and white images. All black pixels in a region are displayed with color RgnFrameColor, and all white pixels are displayed ~(RgnFrameColor). For example, suppose that RgnFrameColor is light green (BGR 0x80FF40). All black pixels in the region are displayed as RgnFrameColor. All white pixels in the region are displayed as 0xFFFFFF XOR 0x80FF40 = 0x7F00BF, which is purple.

See Also

Elements: | RgnFrameType property
Topics: | Raster Images: Creating and Using a Region
 | Using Color Values in LEADTOOLS


RgnFrameType property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RgnFrameTypeConstants RgnFrameType
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Displays or hides an outline of the current region.

Value | Meaning
RGNFRAME_NONE | Hide the frame.
RGNFRAME_STATIC | Display a static frame. The frame, itself, is inside the region.
RGNFRAME_ANIMATED | Display an animated frame. The frame, itself, is inside the region.
RGNFRAME_COLOR | Display the region with the color indicated in the RgnFrameColor property.

See Also

Elements: | RgnMarkingMode property, RgnChange event
Topics: | Raster Images: Creating and Using a Region


RgnMarkingMode property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RgnMarkingModeConstants RgnMarkingMode
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Enables automatic creation of a bitmap region, based on MouseDown, MouseMove, and MouseUp events.

This method supports creation of a rectangle, rounded rectangle, ellipse, or freehand region. It automatically handles scaling differences between the displayed image and the bitmap. On the MouseDown event, it begins outlining where the region will appear on the screen. It updates the outline on each MouseMove event. Then, on the MouseUp event, it deletes the displayed outline and creates the bitmap region. To make an outline of the region visible at that point, you must set the RgnFrameType property.

Value | Meaning
RGNMARK_NONE | Disable automatic creation of a bitmap region.
RGNMARK_RECT | Enable creation of a rectangular region.
RGNMARK_ROUNDRECT | Enable creation of a rounded rectangular region.
RGNMARK_ELLIPSE | Enable creation of an elliptical region.
RGNMARK_FREEHAND | Enable creation of a freehand region, which is actually a polygonal region, with one vertex for each MouseMove event.

See Also

Elements: | RgnChange event, RgnFrameType property
Topics: | Raster Images: Creating and Using a Region


RubberBandHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RubberBandHeight
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Sets or gets the current height of the rubberband, which is a one-pixel outline of a rectangle on the display surface.

You can also use the SetRubberBandRect method to change the rectangle. Use the RubberbandVisible property to turn the rubberband on or off.

See Also

Elements: | RubberBandLeft property, RubberBandTop property, RubberBandVisible property, RubberBandWidth property, SetRubberBandRect method
Topics: | Working with the Control: Client Area Usage


RubberBandLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RubberBandLeft
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Sets or gets the current X coordinate of the origin of the rubberband, which is a one-pixel outline of a rectangle on the display surface.

You can also use the SetRubberBandRect method to change the rectangle. Use the RubberbandVisible property to turn the rubberband on or off.

See Also

Elements: | RubberBandHeight property, RubberBandTop property, RubberBandVisible property, RubberBandWidth property, SetRubberBandRect method
Topics: | Working with the Control: Client Area Usage


RubberBandTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RubberBandTop
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Sets or gets the current Y coordinate of the origin of the rubberband, which is a one-pixel outline of a rectangle on the display surface.

You can also use the SetRubberBandRect method to change the rectangle. Use the RubberbandVisible property to turn the rubberband on or off.

See Also

Elements: | RubberBandHeight property, RubberBandLeft property, RubberBandVisible property, RubberBandWidth property, SetRubberBandRect method
Topics: | Working with the Control: Client Area Usage


RubberBandVisible property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL RubberBandVisible
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Controls the visibility of the rubberband, which is a one-pixel outline of a rectangle on the display surface.

Typically, you would use this method to display an area that the user selects with a mouse. This method works with the following method and properties:

The SetRubberBandRect method sets the size and position of the rectangle.

The RubberbandHeight property is the current height.

The RubberbandLeft property is the current X coordinate of the origin of the rubberband.

The RubberbandTop property is the current Y coordinate of the origin of the rubberband..

The RubberbandWidth property is the current width.

Setting | Description
TRUE | Makes the rubberband visible (turning it on).
FALSE | Makes the rubberband invisible (turning it off).

See Also

Elements: | RubberBandHeight property, RubberBandLeft property, RubberBandTop property, RubberBandWidth property, SetRubberBandRect method
Topics: | Working with the Control: Client Area Usage


RubberBandWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float RubberBandWidth
Overview | Refer to Marking a Selection with a Rubberband

Remarks

Sets or gets the current width of the rubberband, which is a one-pixel outline of a rectangle on the display surface.

You can also use the SetRubberBandRect method to change the rectangle. Use the RubberbandVisible property to turn the rubberband on or off.

See Also

Elements: | RubberBandHeight property, RubberBandLeft property, RubberBandTop property, RubberBandVisible property, SetRubberBandRect method
Topics: | Working with the Control: Client Area Usage


SelectedZoneIndex property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SelectedZoneIndex
Overview | Refer to Displaying an Image.

Remarks

Gets or sets the index of the selected zone to be drawn in the ILEADRasterView control.

To draw OCR data in the ILEADRasterView control, set the EnableOCRDrawing property to TRUE.

To discontinue drawing the selected zone, set this property to –1.

See Also

Elements: | RasterDocument property, EnableOCRDrawing property
Topics: | Raster Images: Displaying Images


SrcClipHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcClipHeight
Overview | Refer to Displaying an Image.

Remarks

Is the height of the source clipping rectangle to use when painting.

The initial value is the height of the bitmap. You can set this property or use the SetSrcClipRect method to change the value.

The clipping rectangle specifies the portion of the source rectangle to paint. Generally, this rectangle is used for updating the display when part of the source bitmap has changed. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcClipLeft property, SrcClipTop property, SrcClipWidth property
Topics: | Raster Images: Displaying Images


SrcClipLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcClipLeft
Overview | Refer to Displaying an Image.

Remarks

Is the X coordinate of the origin of the source clipping rectangle to use when painting.

The initial value is 0. You can set this property or use the SetSrcClipRect method to change the value.

The clipping rectangle specifies the portion of the source rectangle to paint. Generally, this rectangle is used for updating the display when part of the source bitmap has changed. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcClipHeight property, SrcClipTop property, SrcClipWidth property
Topics: | Raster Images: Displaying Images


SrcClipTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcClipTop
Overview | Refer to Displaying an Image.

Remarks

Is the Y coordinate of the origin of the source clipping rectangle to use when painting.

The initial value is 0. You can set this property or use the SetSrcClipRect method to change the value.

The clipping rectangle specifies the portion of the source rectangle to paint. Generally, this rectangle is used for updating the display when part of the source bitmap has changed. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcClipHeight property, SrcClipLeft property, SrcClipWidth property
Topics: | Raster Images: Displaying Images


SrcClipWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcClipWidth
Overview | Refer to Displaying an Image.

Remarks

Is the width of the source clipping rectangle to use when painting.

The initial value is the width of the bitmap. You can set this property or use the SetSrcClipRect method to change the value.

The clipping rectangle specifies the portion of the source rectangle to paint. Generally, this rectangle is used for updating the display when part of the source bitmap has changed. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcClipHeight property, SrcClipLeft property, SrcClipTop property
Topics: | Raster Images: Displaying Images


SrcHeight property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcHeight
Overview | Refer to Displaying an Image.

Remarks

Is the height of the source rectangle to use when painting.

The initial value is the height of the bitmap. You can set this property or use the SetSrcRect method to change the value.

The source rectangle specifies the portion of the bitmap to paint. Generally, this rectangle is used with the destination rectangle to scale the display. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcLeft property, SrcTop property, SrcWidth property
Topics: | Raster Images: Displaying Images


SrcLeft property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcLeft
Overview | Refer to Displaying an Image.

Remarks

Is the X coordinate of the origin of the source rectangle to use when painting.

The initial value is 0. You can set this property or use the SetSrcRect method to change the value.

The source rectangle specifies the portion of the bitmap to paint. Generally, this rectangle is used with the destination rectangle to scale the display. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcHeight property, SrcTop property, SrcWidth property
Topics: | Raster Images: Displaying Images


SrcTop property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcTop
Overview | Refer to Displaying an Image.

Remarks

Is the Y coordinate of the origin of the source rectangle to use when painting.

The initial value is 0. You can set this property or use the SetSrcRect method to change the value.

The source rectangle specifies the portion of the bitmap to paint. Generally, this rectangle is used with the destination rectangle to scale the display. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcHeight property, SrcLeft property, SrcWidth property
Topics: | Raster Images: Displaying Images


SrcWidth property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float SrcWidth
Overview | Refer to Displaying an Image.

Remarks

Is the width of the source rectangle to use when painting.

The initial value is the width of the bitmap. You can set this property or use the SetSrcRect method to change the value.

The source rectangle specifies the portion of the bitmap to paint. Generally, this rectangle is used with the destination rectangle to scale the display. The unit of measure is determined by the ScaleMode property, and the position of the rectangle is relative to the origin of the bitmap.

See Also

Elements: | SrcHeight property, SrcLeft property, SrcTop property
Topics: | Raster Images: Displaying Images


TransitionDelay property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short TransitionDelay
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Delay between graining steps, in milliseconds.

This property affects transition effects (specified by the TransitionEffect property).

Use the EffectGrain and EffectDelay properties to control the speed of the display. EffectGrain controls the size of the painting increment, and TransitionDelay controls the time between increments.

See Also

Elements: | TransitionEffect property
Topics: | Raster Images: Implementing Special Effects


TransitionEffect property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | EfxPaintEffectConstants TransitionEffect
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Specifies the transitional effect to use when painting. For possible values, refer to the PaintEffect property.

A transition effect, if implemented, occurs before an image is painted. The transition can paint a solid color, a pattern, or a gradient color. The TransitionStyle property determines whether a transitional effect is used when painting.

LEADTOOLS provides over 2000 defined constant identifiers for effects. Visual Basic users must include L_OCXEFX.BAS in order to use the defined constant identifiers. This file can be found in the lead\include directory.

See Also

Elements: | PaintEffect property
Topics: | Raster Images: Implementing Special Effects


TransitionStyle property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | TransitionStyleConstants TransitionStyle
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Determines whether a transitional effect is used when painting, and determines whether the transition is based on pattern properties or gradient color properties.

A transition effect, if implemented, occurs before an image is painted. The transition can paint a solid color, a pattern, or a gradient color. The list of possible effects is the same as when painting an image. The TransitionEffect property specifies the effect to use.

Value | Meaning
EFX_TRANSITION_NONE | No transition effects.
EFX_TRANSITION_GRADIENT | Use the gradient color for the transition. Refer to Gradients and Patterns for related properties.
EFX_TRANSITION_PATTERN | Use a solid color or pattern for the transition. Refer to Gradients and Patterns for related properties.
EFX_TRANSITION_MAX | Use a solid color or pattern for the transition. Refer to Gradients and Patterns for related properties.

See Also

Elements: | TransitionEffect property
Topics: | Raster Images: Implementing Special Effects


Transparent property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL Transparent
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Makes the background of the control transparent.

You can set this property to TRUE to take advantage of related transparency properties when one control is positioned on top of another one.

Value | Meaning
TRUE | The background is transparent.
FALSE | The background color paints.

Setting this property to TRUE also results in the following property changes: AutoScroll is set to FALSE; Appearance is set to 0 (flat); and BorderStyle is set to 0 (no border).

See Also

Elements: | PaintRgnOnly property
Topics: | Working with the Control: General Behavior
 | Raster Images: Implementing Special Effects
 | Raster Images: Displaying Images
 | Raster Images: Creating and Using a Region
 | Implementing Transparency


VScrollInfo property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | ILEADScrollInfo* VScrollInfo
Overview | Refer to Scrolling an Image.

Remarks

(Runtime only) Contains the object that references the control's vertical scrollbar information.

The ILEADScrollInfo object has the following properties:

Property | Description
Min | (Read only) Long value that is updated with the minimum scroll range value.
Max | (Read only) Long value that is updated with the maximum scroll range value.
Page | Long value that gets or sets the scroll page size, in pixels.
Line | Long value that gets or sets the size of the scroll line, in pixels. This is the amount that will be scrolled by line up or line down. The line value must be <= the page value.
Pos | Long value that gets or sets the thumb position (current position) of the scrollbar. This value can be set to scroll the display.
Visible | (Read only) Boolean flag that indicates whether the scrollbar is visible. If this is TRUE, the scrollbar is visible. If this value is FALSE, the scrollbar is not visible.
Width | (Read only) Float value that is updated with the size of the of the scrollbar. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | AutoScroll property, HScrollInfo property, Scroll event, Resize event
Topics: | Raster Images: Displaying Images


WandColor property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | OLE_COLOR WandColor
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) The color of the wand when implementing a paint effect or transition effect.

The wand is a solid color bar that moves during an effect. Small grain sizes produce the best wand effects. Many of the effects listed in Effects can have a wand.

This property is used only if the WandSize property is greater than 0.

See Also

Elements: | PaintEffect property, TransitionEffect property
Topics: | Raster Images: Implementing Special Effects
 | Using Color Values in LEADTOOLS


WandSize property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | short WandSize
Overview | Refer to Using Special Effects When Painting.

Remarks

(Persistent property, available at design time) Thickness of the wand (in pixels) when implementing a paint effect or transition effect.

The wand is a solid color bar that moves during an effect. Small grain sizes produce the best wand effects. Many of the effects listed in Effects can have a wand.

You can set this property to 0 to disable the wand.

See Also

Elements: | PaintEffect property, TransitionEffect property
Topics: | Raster Images: Implementing Special Effects


Window property (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | long Window
Overview | Refer to Miscellaneous Methods and Properties.

Remarks

(Read only) Is the handle of the Raster View Control.

See Also

Topics:

Working with the Control: General Behavior


ZoomViewsCount property (ILEADRasterView)

Visual Basic example

Visual C++ example

Syntax | long ZoomViewsCount
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) (Read Only) Gets the number of Zoom Views that have been created on the Raster View control.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, DstLeft property, HasZoomView property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


Animate event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Animate (BOOL bEnable);
Overview | Refer to Playing an Animation.

Remarks

Occurs when an animation playback is started or stopped.

On a playback start, you can use this event to ensure that the AutoRepaint property is set to TRUE.

See Also

Elements: | AutoAnimate property, AutoAnimationLoop property, AnimationLoop property, AnimationEnable property
Topics: | Raster Images: Playing Animated Images


Click event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Click ();
Overview | Refer to Detecting Events.

Remarks

Occurs when the user presses and releases a mouse button over the control.

This is one of three events that occur in the following order:

1. | MouseDown event
2. | MouseUp event
3. | Click event

The first two events let you check which mouse button is pressed.

See Also

Elements: | DblClick event, MouseDown event, MouseMove event, MouseUp event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


DblClick event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void DblClick ();
Overview | Refer to Detecting Events.

Remarks

Occurs when the user double-clicks a mouse button over the LEAD RasterView Control.

This is one of four events that occur in the following order when the user double-clicks a mouse button:

1. | MouseDown event
2. | Click event
3. | MouseUp event
4. | DblClick event

The MouseDown and MouseUp events let you check which mouse button is pressed.

See Also

Elements: | Click event, MouseDown event, MouseMove event, MouseUp event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MagGlassCursor event (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Syntax | void MagGlassCursor ();
Overview | Refer to Using the Magnifying Glass

Remarks

Occurs when the Magnifying Glass is manually updated and the left mouse button is not pressed. It is used to let the user set a Magnifying Glass cursor for the ILEADRasterView Control's window.

To manually update the Magnifying Glass, MAGGLASS_MANUAL_UPDATE must be set in the MagGlassFlags property.

See Also

Elements | MagGlassFlags property, StartMagGlass method, StopMagGlass method, ShowMagGlass method, SetMagGlassPos method
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassExt event (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void MagGlassExt (long nMaskPlaneStart, long nMaskPlaneEnd, ILEADRasterVariant * vMaskPlane);
Overview | Refer to Using the Magnifying Glass

Remarks

This event is triggered for each WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP message received by the window to which the magnifying glass is attached. This event is triggered only if the EnableMagGlassEvent property is set to TRUE.

After calling the StartMagGlass method, LEADTOOLS will monitor the window's messages, looking for mouse messages, and processing them by displaying a "Magnifying Glass". If the MagGlassExt event has been enabled by setting the EnableMagGlassEvent property to TRUE, information about the non-updated parts of the bitmap can be obtained from the vMaskPlane parameter passed to this event. This event receives information when the left mouse button is pressed or released and when the mouse is moved while the left mouse button is pressed. This information can be used with LEADTOOLS Internet functionality, available only in the Multimedia/Internet toolkits, to get pixel values for the non-updated parts of the bitmap. Once this information is received, it can be passed to the UpdateMagGlass method to update the Magnifying Glass's zoomed display area.

If the MagGlassExt event has been enabled by setting the EnableMagGlassEvent property to TRUE, the UpdateMagGlass method must be called in order to paint the zoomed image in the Magnifying Glass display area.

See Also

Elements: | StartMagGlass method, StopMagGlass method, UpdateMagGlass method, EnableMagGlassEvent property
Topics: | Raster Images: Displaying Images
 | Using the Zoom View


MagGlassExt2 event (ILEADRasterView)

Visual Basic Example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void MagGlassExt2 (long nMaskPlaneStart, long nMaskPlaneEnd, VARIANT vMaskPlane);
Overview | Refer to Using the Magnifying Glass

Remarks

This event is triggered for each WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP message received by the window to which the magnifying glass is attached. This event is triggered only if the EnableMagGlassEvent property is set to TRUE.

After calling the StartMagGlass method, LEADTOOLS will monitor the window's messages, looking for mouse messages, and processing them by displaying a "Magnifying Glass". If the MagGlassExt2 event has been enabled by setting the EnableMagGlassEvent property to TRUE, information about the non-updated parts of the bitmap can be obtained from the vMaskPlane parameter passed to this event. This event receives information when the left mouse button is pressed or released and when the mouse is moved while the left mouse button is pressed. This information can be used with LEADTOOLS Internet functionality, available only in the Multimedia/Internet toolkits, to get pixel values for the non-updated parts of the bitmap. Once this information is received, it can be passed to the UpdateMagGlass2 method to update the Magnifying Glass's zoomed display area.

If the MagGlassExt2 event has been enabled by setting the EnableMagGlassEvent property to TRUE, the UpdateMagGlass2 method must be called in order to paint the zoomed image in the Magnifying Glass display area.

See Also

Elements: | StartMagGlass method, StopMagGlass method, UpdateMagGlass2 method, EnableMagGlassEvent property
Topics: | Raster Images: Displaying Images


MagGlassOwnerDraw event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MagGlassOwnerDraw (long hWnd, long hMemDC, long lXPos, long lYPos, long lMagGlassTop, long lMagGlassLeft, long lMagGlassBottom, long lMagGlassRight);
Overview | Refer to Customizing Magnifying Glass Painting

Remarks

Provides additional, user-defined Magnifying Glass painting.

If the EnableMagGlassDraw property is true, then after the StartMagGlass method is called, and the magnifying glass paints itself to the DC, but before the magnifying glass is displayed on the screen, the user can change what is in the DC, through this event. This allows the user to provide custom rendering of the magnifying glass, within the magnifying glass's display area. For example, this feature lets you render magnified annotations, which may be overlaid on the currently displayed image, or just simply override what is currently in the magnifying glass display area.

To stop the generation of the MagGlassOwnerDraw event, set the EnableMagGlassDraw property to VARIANT_FALSE.

See Also

Elements | AnnEnableMagGlass property, AnnMagGlass method, EnableMagGlassDraw property, StartMagGlass method, StopMagGlass method
Topics | Using the Magnifying Glass Implementing Annotations Raster Images: Displaying Images Annotations: Displaying Annotations
 | Using the Zoom View


MouseDown event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void MouseDown (short Button, short Shift, float x, float y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user presses a mouse button.

See Also

Elements: | Click event, DblClick event, MouseMove event, MouseUp event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseDown2 event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseDown2(short Button, short Shift, long x, long y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user presses a mouse button.

This events will be fired only if the value of EnableFireMouse2Event property is set to TRUE.

See Also

Elements: | Click event, DblClick event, MouseMove event, MouseDown event, MouseUp event, MouseMove2 event, MouseUp2 event, EnableFireMouse2Event property
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseMove event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void MouseMove (short Button, short Shift, float x, float y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user moves the mouse over the Raster View Control.

See Also

Elements: | Click event, DblClick event, MouseDown event, MouseUp event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseMove2 event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseMove2(short Button, short Shift, long x, long y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user moves the mouse over the Raster View Control.

This events will be fired only if the value of EnableFireMouse2Event property is set to TRUE.

See Also

Elements: | Click event, DblClick event, MouseMove event, MouseDown event, MouseUp event, MouseDown2 event, MouseUp2 event, EnableFireMouse2Event property
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseUp event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void MouseUp (short Button, short Shift, float x, float y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user releases a mouse button.

See Also

Elements: | Click event, DblClick event, MouseDown event, MouseMove event
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseUp2 event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseUp2(short Button, short Shift, long x, long y);
Overview | Refer to Detecting Events.

Remarks

Occurs when the user releases a mouse button.

This events will be fired only if the value of EnableFireMouse2Event property is set to TRUE.

See Also

Elements: | Click event, DblClick event, MouseMove event, MouseDown event, MouseUp event, MouseDown2 event, MouseMove2 event, EnableFireMouse2Event property
Topics: | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


MouseWheel event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void MouseWheel (short nDelta, short Shift, long x, long y);
Overview | Refer to Detecting Event.

Remarks

Occurs when the user rotates or clicks the mouse wheel over the Raster View Control, if the EnableMouseWheel property has been set to TRUE.

See Also

Elements | Click event, DblClick event, MouseDown event, MouseUp event, MouseWheel Event
Topics | Working with the Control: General Behavior
 | Working with the Control: Client Area Usage


OLECompleteDrag event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OLECompleteDrag(short Button, short Shift, long x, long y)
Overview | Refer to Loading a Bitmap from a File.

Remarks

Occurs when the Drag-and-Drop operation ends.

See Also

Elements: | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics: | Raster Images: Copying Images


OLEDragOver event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OLEDragOver(short Button, short Shift, long x, long y)
Overview | Refer to Loading a Bitmap from a File.

Remarks

Occurs repeatedly during the dragging process over the RasterView Control. It provides information about the keys used to fire the event and about the location of the cursor.

See Also

Elements: | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics: | Raster Images: Copying Images


OLEDropFile event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void OLEDropFile (BSTR pszName);
Overview | Refer to Loading a Bitmap from a File.

Remarks

OLEDropFile event occurs each time a file is _dropped in a drag and drop operation, if OLEDropAllowed is set to TRUE. The event takes the name of the file being dropped as a parameter.

See Also

Elements: | OLEDropAllowed
Topics: | Working with the Control: General Behavior
 | Raster Images: Loading Files


OLEGiveFeedback event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OLEGiveFeedback(BOOL *pbUseDefaultCursor)
Overview | Refer to Loading a Bitmap from a File.

Remarks

Occurs repeated during the dragging process to provide information on which cursor to display.

To use custom cursors instead of the default cursors, set the OLEDragCursor property to the desired cursor and set the EnableUseDefaultCursor property to FALSE. The user should specify whether to display the default cursor or a custom cursor in side the OLEGiveFeedback event by setting the EnableUseDefaultCursor property.

See Also

Elements: | EnableOLEDragMethod property, OLEDragCursor property, OLEStartDrag event, OLECompleteDrag event, OLEDragOver event, EnableUseDefaultCursor property
Topics: | Raster Images: Copying Images


OLEStartDrag event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Syntax | void OLEStartDrag(short Button, short Shift, long x, long y)
Overview | Refer to Loading a Bitmap from a File.

Remarks

Occurs when the Drag-and-Drop operation starts, if a drag can be accepted. A drag can be accepted if the EnableOLEDragMethod property has been set to TRUE.

To start the drag and drop operation, set the EnableOLEDragMethod property to TRUE. With the cursor inside the RasterView control, press the Left Mouse button and this event will occur.

See Also

Elements: | EnableOLEDragMethod property, OLEDragCursor property, OLECompleteDrag event, OLEDragOver event, OLEGiveFeedback event, EnableUseDefaultCursor property
Topics: | Raster Images: Copying Images


Paint event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Paint (long hDC);
Overview | Refer to Detecting Events.

Remarks

Occurs when part or all of the Raster View Object is exposed after it has been moved or enlarged, or after a window that was covering the object has been moved.

If the AutoRepaint property is set to TRUE, you do not have to write code for this event painting the Bitmap set in the Raster of the Raster View.

See Also

Elements: | Scroll event
Topics: | Working with the Control: Client Area Usage


PaintNotification event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void PaintNotification (short uPass, short uType);
Overview | Refer to Using Special Effects When Painting.

Remarks

Occurs before painting and after each pass when implementing a paint effect or transition effect.

This event lets you change the behavior of the effect before it finishes. The uType parameter lets you know whether a transition or an image is being painted. The uPass parameter works as follows:

Value | Meaning
0 | No passes have painted. The first pass is next.
1 | One pass has painted. The second pass is next.
2 | The second pass has painted. The third pass is next.

And so forth....

The PaintEffectMaxPasses property specifies the number of passes to complete the image or transition. You can set the PaintEffectPass property in this event if you want to skip or repeat a pass (for example, if you want to end with a blend of old and new images).

The PaintTransitionMaxPasses property specifies the number of passes to complete the transition. You can set the PaintTransitionPass property in this event if you want to skip or repeat a pass (for example, if you want to end with a blend of old and new images).

See Also

Elements: | PaintEffect property, TransitionEffect property, PaintEffectPass property, PaintEffectMaxPasses property ,PaintNotificationDelay property, PaintTransitionMaxPasses property, PaintTransitionPass property
Topics: | Raster Images: Implementing Special Effects


PanWin event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void PanWin (long hPanWin, short iFlag);
Overview | Refer to Using a PanWindow.

Remarks

This event is generated when the PanWindow is created, updated, destroyed, or moved.

See Also

Elements: | PanWinBitonalScaling property, PanWinCursor property, PanWinHeight property, PanWinIcon property, PanWinPaintDither property, PanWinPaintPalette property, PanWinPointer property, PanWinRectColor property, PanWinSysMenu property, PanWinTitle property, PanWinWidth property, PanWinX property, PanWinY property, ShowPanWin method
Topics: | Raster Images: Displaying and Printing


Resize event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Resize ();
Overview | Refer to Detecting Events.

Remarks

Occurs when the Raster View Object first appears and whenever the size of the object changes.

See Also

Topics:

Raster Images: Doing Geometric Transformations


RubberBand event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void RubberBand ();
Overview | Refer to Marking a Selection with a Rubberband.

Remarks

Occurs before the MouseUp event, when the AutoRubberBand property is set to TRUE.

See Also

Topics:

Working with the Control: Client Area Usage


Scroll event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void Scroll ();
Overview | Refer to Detecting Events.

Remarks

Occurs when a user drags the box on a Raster View Control's scrollbar.

This event occurs only if the AutoScroll property is set to TRUE.

See Also

Elements: | Paint event
Topics: | Working with the Control: Client Area Usage


ZoomInDone event (ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void ZoomInDone (long x, long y);
Overview | Refer to Capturing an Image from the Screen.

Remarks

Occurs when the user clicks the left mouse button after a screen capture has been started by calling ZoomIn.

See Also

Elements: | ZoomIn method, Capture method, EnableZoomInRect property
Topics: | Raster images: Capturing a screen image
 | C++ Builder Problems


AnnContainer property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long AnnContainer
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the handle to the root container object of the annotation object to be displayed. When this property is 0, no annotation will be displayed in the Zoom View.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, DstLeft property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


BorderColor property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | OLE_COLOR BorderColor
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets an OLE_COLOR value that indicates the color of the border for the Zoom View. This property is valid only when the BorderStyle property is set to ZOOM_VIEW_BORDERSTYLE_SIMPLE.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


BorderStyle property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long BorderStyle
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets a value that indicates which border style is to be used for the Zoom View. Possible values are:

Value | Meaning
ZOOM_VIEW_BORDERSTYLE_NONE | [0x0000]. Do not use a border for the Zoom View.
ZOOM_VIEW_BORDERSTYLE_SIMPLE | [0x0001] Use a flat border for a rectangular or rounded rectangular Zoom View.
ZOOM_VIEW_BORDERSTYLE_3D | [0x0002] Use a 3D border for a rectangular or rounded rectangular Zoom View..
ZOOM_VIEW_BORDERSTYLE_TEAROUT | [0x0004] Use a border that has a Torn out look for the Zoom View.
ZOOM_VIEW_BORDERSTYLE_ROUNDED | [0x0008] Use a rounded rectangular border for the Zoom View. This can be OR-ed only with ZOOMVIEWBORDERSTYLE_NONE or ZOOMVIEWBORDERSTYLE_SIMPLE.

The following figures illustrate the different styles that are available:

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


CalloutColor property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | OLE_COLOR CalloutColor
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets an OLE_COLOR value that represents the color to be used for the callout lines. This property is valid only if the EnableCallouts property is set to True.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, PenStyle property, Index property, SrcBorderStyle property, BorderColor property, SrcPenStyle property, EnableCallouts property, SrcBorderColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


CalloutPenStyle property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | ZoomViewPenStyleConstants CalloutPenStyle
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets a value that represents the pen style for the callout lines. This property is valid only if the EnableCallouts property is set to True. Possible values are:

Value | Meaning
PEN_STYLE_SOLID | [0x0001] The pen style is solid
PEN_STYLE_DASH | [0x0002] The pen style is dashed
PEN_STYLE_DOT | [0x0003] The pen style is dotted.
PEN_STYLE_DASHDOT | [0x0004] The pen style has alternating dashes and dots.
PEN_STYLE_DASHDOTDOT | [0x0005] The pen style has alternating dashes and double dots.
PEN_STYLE_NULL | [0x0006] The pen style is invisible.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


DstHeight property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long DstHeight
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the height of the destination rectangle, in screen coordinates. The initial value is 0, and this property is in pixels. This property is used when displaying a Zoom View. This property is used only when the ForceDst property is set to TRUE.

See Also

Elements: | DstLeft property, DstTop property, DstWidth property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


DstLeft property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long DstLeft
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the X coordinate, in pixels, of the origin of the destination rectangle based on screen coordinates. The initial value is 0. This property is used when displaying the Zoom View on the Raster View control.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


DstTop property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long DstTop
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the Y coordinate, in pixels, of the origin of the destination rectangle based on screen coordinates. The initial value is 0. This property is used when displaying the Zoom View on the Raster View control.

See Also

Elements: | DstLeft property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


DstWidth property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long DstWidth
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the width, in pixels, of the destination rectangle used when displaying a Zoom View. This property uses screen coordinates. The initial value is 0. This property is used only when the ForceDst property is set to TRUE.

See Also

Elements: | DstLeft property, DstTop property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


EnableCallouts property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL EnableCallouts
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Boolean value that enables or disables the callout lines. Possible values are:

Value | Meaning
True | Draw callout lines.
False | Do not draw callout lines.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, PenStyle property, SrcPenStyle property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


Enabled property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL Enabled
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Enables or disables the Zoom View. Possible values are:

Value | Meaning
True | Zoom View is enabled.
False | Zoom View is disabled.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, PenStyle property, SrcPenStyle property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, EnableCallouts property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


ForceDst property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | VARIANT_BOOL ForceDst
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only) Specifies whether the zoomed view will be forced to be the size of the destination rectangle. Possible values are:

Value | Meaning
TRUE | Force the zoomed view to be the size of the destination rectangle.
FALSE | Allow LEADTOOLS to calculate the size based on the ZoomFactor property and the SrcLeft, SrcTop, SrcWidth, SrcHeight properties.

When this property is set to TRUE, use the DstLeft, DstTop, DstWidth, and DstHeight properties to set the destination rectangle.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, PenStyle property, SrcPenStyle property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, EnableCallouts property, Enabled property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


Index property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long Index
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the Index for this Zoom View. This property is zero-based. Set this property before calling the GetZoomView method or the UpdateZoomView method.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderColor property, PenStyle property, BorderStyle property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


PenStyle property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | ZoomViewPenStyleConstants PenStyle
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets a value that indicates the pen style to be used for the border of the Zoom View. This property is valid only when the BorderStyle property is set to ZOOM_VIEW_BORDERSTYLE_SIMPLE. Possible values are:

Value | Meaning
PEN_STYLE_SOLID | [0x0001] The pen style is solid
PEN_STYLE_DASH | [0x0002] The pen style is dashed
PEN_STYLE_DOT | [0x0003] The pen style is dotted.
PEN_STYLE_DASHDOT | [0x0004] The pen style has alternating dashes and dots.
PEN_STYLE_DASHDOTDOT | [0x0005] The pen style has alternating dashes and double dots.
PEN_STYLE_NULL | [0x0006] The pen style is invisible.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcBorderColor property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | OLE_COLOR SrcBorderStyle;
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets an OLE_COLOR value that represents the color of the source area rectangle for the Zoom View. This property will be ignored if the SrcBorderStyle property is set to SOURCE__BORDERSTYLE_3D.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, PenStyle property, Index property, SrcBorderStyle property, BorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcBorderStyle property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long SrcBorderStyle
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets the border style for the source area. Possible values are:

Value | Meaning
SOURCE_BORDERSTYLE_SIMPLE | [0x0000] Use a border style that has a flat look.
SOURCE__BORDERSTYLE_3D | [0x0001] Use a 3D border style.

The following figure illustrates the possible values:

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderColor property, PenStyle property, Index property, BorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcHeight property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long SrcHeight
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets the height, in pixels and based on bitmap coordinates, of the source area to be zoomed.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcLeft property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long SrcLeft
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets the X coordinate, in pixels and based on bitmap coordinates, for the origin of the source area of the image to be zoomed.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcPenStyle property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | ZoomViewPenStyleConstants SrcPenStyle
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets a value that indicates the pen style to be used for the source area rectangle. This property is valid only when the SrcBorderStyle property is set to SOURCE_BORDERSTYLE_SIMPLE. Possible values are:

Value | Meaning
PEN_STYLE_SOLID | [0x0001] The pen style is solid
PEN_STYLE_DASH | [0x0002] The pen style is dashed
PEN_STYLE_DOT | [0x0003] The pen style is dotted.
PEN_STYLE_DASHDOT | [0x0004] The pen style has alternating dashes and dots.
PEN_STYLE_DASHDOTDOT | [0x0005] The pen style has alternating dashes and double dots.
PEN_STYLE_NULL | [0x0006] The pen style is invisible.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, Index property, SrcBorderStyle property, SrcBorderColor property, PenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcTop property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long SrcTop
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets the Y coordinate, in pixels and based on bitmap coordinates, for the origin of the source area of the image to be zoomed.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SrcWidth property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long SrcWidth
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical only.) Gets or sets the width, in pixels and based on bitmap coordinates, of the source area to be zoomed.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, DstLeft property, SrcTop property, SrcLeft property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, ZoomFactor property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


ZoomFactor property (ILEADRasterZoomView)

Visual Basic example

Visual C++ example

Syntax | long ZoomFactor
Overview | Refer to Using the Zoom View

Remarks

(Document/Medical) only.) Gets or sets a percentage value that represents the zoom factor for the zoomed view. This value is internally divided by 100. This value must be >= 100. For example, to zoom the image to 2X, specify 200 for this property.

See Also

Elements: | DstTop property, DstWidth property, DstHeight property, SrcLeft property, SrcTop property, SrcWidth property, SrcHeight property, BorderStyle property, BorderColor property, PenStyle property, Index property, SrcBorderStyle property, SrcBorderColor property, SrcPenStyle property, EnableCallouts property, CalloutColor property, CalloutPenStyle property, DstLeft property, Enabled property, ForceDst property, AnnContainer property, HasZoomView property, ZoomViewsCount property, CreateZoomView method, GetZoomView method, UpdateZoomView method, DestroyZoomView method
Topics: | Raster Images: Displaying Images


SegmentBottom property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentBottom
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that describes the bottom boundary of the segment rectangle.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentBottom property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentBottom property can be set to define the bottom boundary of a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentRight property, SegmentType property, SegmentColors property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentColors property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentColors(long nIndex)
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets an array of colors present in the segment.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentColors property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentColors property can be set to define the colors in a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentRight property, SegmentBottom Property, SegmentType property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentColorsCount property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentColorsCount
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets the number of colors in the segment.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentColorsCount property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentColorsCount property can be set to define the number of colors in a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentType property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentLeft property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentLeft
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that describes the left boundary of the segment rectangle.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentLeft property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentLeft property can be set to define the left boundary of a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentRight property, SegmentBottom Property, SegmentType property, SegmentColors property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentRight property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentRight
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that describes the right boundary of the segment rectangle.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentRight property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentRight property can be set to define the right boundary of a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentType property, SegmentColors property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentTop property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentTop
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that describes the top boundary of the segment rectangle.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentTop property is updated every time the PDFCompEvent event is fired.

As part of the UserSegmentInfo property, the SegmentTop property can be set to define the top boundary of a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method.

See Also

Elements: | PDFCompEvent Event, SegmentLeft property, SegmentRight property, SegmentBottom Property, SegmentType property, SegmentColors property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


SegmentType property (ILTSegmentInfo)

Visual Basic example

Visual C++ 5.0 example

Syntax | Long SegmentType
Overview | Refer to Creating a Compressed PDF File

Remarks

(Advanced PDF Plug in only) Gets or sets a value that describes the segment's type.

This property is one of the properties of the ILTSegmentInfo object. It may be accessed through the MRCSegmentInfo property or the UserSegmentInfo property.

As part of the MRCSegmentInfo property, the SegmentType property is updated every time the PDFCompEvent Event is fired.

As part of the UserSegmentInfo property, the SegmentType property can be set to define the type of a user-defined segment. Once all sub properties of the UserSegmentInfo property have been set, the user-defined segment can be inserted by calling the PDFCompInsertSegments method. Possible values are:

Value | Description
PDFCOMP_SEGMENT_TYPE_BACKGROUND | The segment is a background segment and it only has one color.
PDFCOMP_SEGMENT_TYPE_ONEBIT | The segment is a 1-bit image.
PDFCOMP_SEGMENT_TYPE_ONEBITBW | The segment is a 1-bit image with only black and white colors.
PDFCOMP_SEGMENT_TYPE_TWOBIT | The segment is a 2-bit image.
PDFCOMP_SEGMENT_TYPE_TWOBITGRAY | The segment is a 2-bit image with gray colors.
PDFCOMP_SEGMENT_TYPE_GRAY | The segment is a gray segment.
PDFCOMP_SEGMENT_TYPE_PICTURE | The segment is a picture segment.
PDFCOMP_SEGMENT_TYPE_TWOBITBW | The segment is a 2-bit image with only black and white colors.
PDFCOMP_SEGMENT_TYPE_ONECOLOR | The segment is a 1 color image.

See Also

Elements: | PDFCompEvent Event, SegmentTop property, SegmentLeft property, SegmentBottom Property, SegmentRight property, SegmentColors property, SegmentColorsCount property, MRCSegmentInfo property, UserSegmentInfo Property, PDFCompInsertSegments method
Topics: | PDF Compressor Functions: Creating a File


EnableMethodErrors property (All Objects)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableMethodErrors
Overview | Refer to Controlling Events.

Remarks

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

All LEADTOOLS COM Objects support this property.

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

See Also

Topics:

Working with the Control: General Behavior


EnableProgressEvent property (ILEADRasterIO, ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | BOOL EnableProgressEvent
Overview | Refer to Controlling Events.

Remarks

(Persistent property, available at design time) Specifies whether LEADTOOLS generates a ProgressStatus event, to indicate the completion percentage of the current LEADTOOLS functionality.

If this property is set to TRUE, you can use the ProgressStatus event to update a status bar or to detect a user interrupt.

This property can also be used to cancel a load process by setting it to FALSE during a load process.

Setting | Description
TRUE | Generate progress status events.
FALSE | If this property is set to FALSE outside the load process, ProgressStatus events will not be generated. If this property is set to FALSE during a load process, the load process is canceled.

See Also

Elements: | LoadOffset method
Topics: | Working with the Control: General Behavior


ProgressStatus event (ILEADRasterIO, ILEADRasterProcess, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void ProgressStatus (short iPercent);
Overview | Refer to Detecting Events.

Remarks

Occurs repeatedly as LEADTOOLS processes data, so that you can update a status bar or detect a user interrupt.

This event is generated only if the EnableProgressEvent property is set to TRUE.

To interrupt a process, set the EnableProgressEvent property to FALSE.

The following methods generate ProgressStatus events:

AddNoise method

Average method

BinaryFilter method

ColorMerge method

ColorRes method

ColorSeparate method

Combine method

Contrast method

Deskew method

Despeckle method

Emboss method

Fill method

Flip method

GammaCorrect method

GetHistogram method

Grayscale method

Halftone method

HistoContrast method

HistoEqualize method

Hue method

Intensity method

IntensityDetect method

Invert method

Load method

Median method

Mosaic method

Posterize method

RemapIntensity method

Reverse method

Rotate method

Saturation method

Save method

Sharpen method

Shear method

Size method

SpatialFilter method

StretchIntensity method

Underlay method

See Also

Topics:

Working with the Control: General Behavior


RgnChange event (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | void RgnChange ();
Overview | Refer to Creating and Using a Bitmap Region.

Remarks

Occurs each time the bitmap region is created or updated.

This event is especially useful with the RgnMarkingMode property, which automates the creation of regions.

See Also

Elements: | RgnMarkingMode property, RgnFrameType property
Topics: | Raster Images: Creating and Using a Region


ScaleHeight property (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ScaleHeight
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Is the height of the client area of the LEADRasterView Control.

This is the true client area, which you can use when painting to fit a destination rectangle to the bitmap. The unit of measure is determined by the ScaleMode property.

If you write this property, the actual height of the control does not change, but the current height is expressed using the value that you provide. This lets you use a custom coordinate system. For example, you could set the ScaleWidth and ScaleHeight both to 100; then express all coordinates as percentage offsets. For examples of a custom coordinate system, refer to the ScaleTop property.

This property is also present in the ILEADRaster Object. You can use this property when you don't have a control, but still want to use ScaleMode units.

See Also

Elements: | ScaleMode property, ScaleLeft property, ScaleTop property, ScaleWidth property
Topics: | Working with the Control: Client Area Usage
 | Raster Images: Displaying Images


ScaleLeft property (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ScaleLeft
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Is the X coordinate of the origin in a custom coordinate system for the client area.

This value is always 0, unless you change it to implement a custom coordinate system, as shown in the examples.

See Also

Elements: | ScaleMode property, ScaleHeight property, ScaleTop property, ScaleWidth property
Topics: | Working with the Control: Client Area Usage
 | Raster Images: Displaying Images


ScaleTop property (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ScaleTop
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Is the Y coordinate of the origin in a custom coordinate system for the client area.

This value is always 0, unless you change it to implement a custom coordinate system, as shown in the examples.

See Also

Elements: | ScaleMode property, ScaleHeight property, ScaleLeft property, ScaleWidth property
Topics: | Working with the Control: Client Area Usage
 | Raster Images: Displaying Images


ScaleMode property (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | RasterScaleModeConstants ScaleMode
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Specifies the unit of measure for the LEAD RasterView Control.

You can change the unit of measure at any time without affecting measurements that the control maintains. The control accepts floating point values and converts them to pixels internally. This means, for example, that if you set a property value in twips, the value that you get back may be slightly different, since it is rounded to the nearest pixel.

This property is also present in the ILEADRaster Object. You can use this property when you don't have a control, but still want to use ScaleMode units.

Setting | Description
0 | Indicates that one or more of the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties are set to custom values.
1 | Twips (1440 twips per logical inch; 567 twips per logical centimeter).
2 | Points (72 points per logical inch).
3 | Pixels (smallest unit of monitor or printer resolution).
4 | Characters (horizontal = 120 twips per unit; vertical = 240 twips per unit).
5 | Inches.
6 | Millimeters.
7 | Centimeters.

For an ILEADRaster object, you should not set the ScaleMode to SCALEMODE_USER , SCALEMODE_USER should only be used with ILEADRasterView objects.

See Also

Elements: | ScaleHeight property, ScaleLeft property, ScaleTop property, ScaleWidth property
Topics: | Working with the Control: Client Area Usage
 | Raster Images: Displaying Images


ScaleWidth property (ILEADRaster, ILEADRasterView)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

Syntax | float ScaleWidth
Overview | Refer to Displaying an Image.

Remarks

(Persistent property, available at design time) Is the width of the client area of the LEAD RasterView Control.

This is the true client area, which you can use when painting to fit a destination rectangle to the bitmap. The unit of measure is determined by the ScaleMode property.

If you write this property, the actual width of the control does not change, but the current width is expressed using the value that you provide. This lets you use a custom coordinate system. For example, you could set the ScaleWidth and ScaleHeight both to 100; then express all coordinates as percentage offsets. For examples of a custom coordinate system, refer to the ScaleTop property.

This property is also present in the ILEADRaster Object. You can use this property when you don't have a control, but still want to use ScaleMode units.

See Also

Elements: | ScaleMode property, ScaleHeight property, ScaleLeft property, ScaleTop property
Topics: | Working with the Control: Client Area Usage
 | Raster Images: Displaying Images


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 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 LSettings::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.

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.


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

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

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

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

Duplication and Distribution Agreements

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


JPEG 2000 Plug In Support Instructions

To implement JPEG 2000 Plug In support, you must do the following:

1. | Find the JPEG 2000 Plug In key on the JPEG 2000 Plug In Certificate e-mailed to you.
2. | Use the JPEG 2000 Plug In keyword with the UnlockSupport method to implement JPEG 2000 Plug In support in your application.


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

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

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


LEADTOOLS Nag Message

If you obtained a royalty-free LEADTOOLS product, simply distribute the LTR14N DLL from the REDIST\COM\NoNag directory.

If you obtained a royalty LEADTOOLS product (Document/Medical), then you will see a nag Message when you run your application. The LTR14N DLL that was installed into your system directory produces this message. This LTR14N DLL has the Document/Medical features unlocked for you. In order to remove the nag message, you must contact LEAD Technologies to obtain "keys" to unlock the specialized features in the "no-nag" LTR14N DLL, which is located in the REDIST\COM\NoNag directory. When you distribute your application, you must distribute the LTR14N DLL from the REDIST\COM\NoNag directory, and must unlock the specialized features in your application.


Syntax

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

Visual Basic Syntax

Visual C++ 5.0 Syntax


Visual Basic Constants for Key Codes

Do the following to find the Visual Basic key codes:

1. | On the View pull-down menu, select Object Browser....
2. | Select VB - Visual Basic objects and procedures.
3. | Select VBKeyCodeConstants.
4. | Select one of the listed constants.

A description of the constant appears at the bottom of the form.


Visual Basic Syntax

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

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

ActiveX Data Type | Visual Basic Data Type
boolean | Integer
BSTR | String
IPictureDisp | Picture
long | Long
OLE_COLOR | Long color value (such as the RGB return value)
short | Integer
float | Single
VARIANT_BOOL | Boolean


Visual C++ 5.0 Syntax

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

To add a LEAD RasterView control to your application, refer to the example in Loading and Displaying an Image.

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

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

Provide parameters as follows:

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

For example:

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

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

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

m_controlname.Setpropertyname(value);

For example:

m_Lead1.SetRubberBandVisible(FALSE);

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

value = m_controlname.Getpropertyname();

For example:

HeightFactor = m_Lead1.GetBitmapHeight();

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

m_controlname.Setpropertyname(index, value);

For example:

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

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

value = m_controlname.Getpropertyname(index);

For example:

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

In Version 5.0 of Visual C++, the MicroSoft compiler also has a #import directive, which can be used to import type library information from an ActiveX control or COM Object.

To add any of the LEAD COM Objects to your application you can use the following:

// get information for ILEADRaster
#import <ltr14n.dll> no_namespace, named_guids
// get information for ILEADRasterIO
#import <ltrio14n.dll> no_namespace, named_guids

Then, you can create instances of the objects. The following shows how to create

an instance of ILEADRaster, which is licensed, and an instance of ILEADRasterIO, which is not. Note, you can also use IClassFactory2::CreateInstanceLic to create ILEADRaster objects.

static const WCHAR BASED_CODE _szLicString[] =
L"LEADTOOLS OCX Copyright (c) 1990-2005 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLicString);
ILEADRasterFactory *pFactory=NULL;
ILEADRaster *pRaster=NULL;
CoCreateInstance(CLSID_LEADRasterFactory, NULL, CLSCTX_ALL,
IID_ILEADRasterFactory, (void**)&pFactory);
pRaster = (ILEADRaster*)pFactory->CreateObject("LEADRaster.LEADRaster.145", lpLic);
SysFreeString(lpLic);//free the string
pRaster->CreateBitmap(100.0f, 100.0f, 24);//create a bitmap
pFactory->Release();//release the object
pRaster->Release();//release the object

ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->put_EnableMethodErrors(FALSE);//1
pRasterIO->PutEnableMethodErrors(FALSE); //2
pRasterIO->EnableMethodErrors = FALSE; //3
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\chess.bmp", 0, 1, 1);
pRasterIO->Release();

Note that there are 3 different ways that you can access a COM Object's properties when you use the #import statement.

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

1) pObject->put_propertyname(value);
2) pObject->Putpropertyname(value);
3) pObject->propertyname = value;

For example:

pRasterIO->put_EnableMethodErrors(FALSE);//1
pRasterIO->PutEnableMethodErrors(FALSE); //2
pRasterIO->EnableMethodErrors = FALSE; //3

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

1) pObject->Get_propertyname(&value);
2) value = pObject->Getpropertyname();
3) value = pObject->propertyname;

For example:

VARIANT_BOOL bVal;
pRasterIO->get_EnableMethodErrors(&bVal); //1
bVal = pRasterIO->GetEnableMethodErrors();//2
bVal = pRasterIO->EnableMethodErrors; //3


Visual C++ Key Codes

The following are the Visual C++ key codes:

VK_A through VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'.
VK_0 through VK_9 are the same as their ASCII equivalents: '0' thru '9'.
VK_LBUTTON
VK_RBUTTON
VK_CANCEL
VK_MBUTTON
VK_BACK
VK_TAB
VK_CLEAR
VK_RETURN
VK_SHIFT
VK_CONTROL
VK_MENU
VK_PAUSE
VK_CAPITAL
VK_ESCAPE
VK_SPACE
VK_PRIOR
VK_NEXT
VK_END
VK_HOME
VK_LEFT
VK_UP
VK_RIGHT
VK_DOWN
VK_SELECT
VK_PRINT
VK_EXECUTE
VK_SNAPSHOT
VK_INSERT
VK_DELETE
VK_HELP

VK_NUMPAD0
VK_NUMPAD1
VK_NUMPAD2
VK_NUMPAD3
VK_NUMPAD4
VK_NUMPAD5
VK_NUMPAD6
VK_NUMPAD7
VK_NUMPAD8
VK_NUMPAD9
VK_MULTIPLY
VK_ADD
VK_SEPARATOR
VK_SUBTRACT
VK_DECIMAL
VK_DIVIDE
VK_F1
VK_F2
VK_F3
VK_F4
VK_F5
VK_F6
VK_F7
VK_F8
VK_F9
VK_F10
VK_F11
VK_F12
VK_F13
VK_F14
VK_F15
VK_F16
VK_F17
VK_F18
VK_F19
VK_F20
VK_F21
VK_F22
VK_F23
VK_F24
VK_NUMLOCK
VK_SCROLL


LEAD Bitmap in Memory

The LEAD bitmap in memory is not scaled. Therefore, when translating coordinates and measurements from the LEAD control's client area, you must account for the scaling (zooming) and the offsets (scrolling) of the image in the client area.

For a description of how to translate the coordinates, refer to the code example for the particular method, property, or event.

For an illustration of the relationship between a LEAD bitmap in memory and the LEAD control's client area, refer to Concepts and Definitions.


LEAD Control's Client Area

The LEAD control's client area is where the scaled image of the LEAD bitmap is displayed. Sometimes you must translate coordinates and measurements from the client area to the bitmap, which is not scaled.

For a description of how to translate the coordinates, refer to the code example for the particular method, property, or event.

For an illustration of the relationship between a LEAD bitmap in memory and the LEAD control's client area, refer to Concepts and Definitions.


Limited Support

This ActiveX element is supported only on the development systems with listed examples.


Only for Access and FoxPro Printing

The PrintStart and PrintEnd methods were added to the toolkit to overcome printing limitations in Access and FoxPro. Although you can use them in Visual Basic and Visual C++, there is no reason to do so. For printing examples in Visual Basic and Visual C++, refer to the Render method.


Only for Access Painting

The ForePalette property was added to the toolkit to overcome problems in using the background palette with Access 2.0. Although you can use this property with other development systems, there is no reason to do so.


Visual Basic Only

LEADTOOLS methods that reference picture objects were developed for Visual Basic. Picture objects in other development systems have not worked in tests and do not appear to be compatible.


WIN32 Internet Explorer Required

Asynchronous loading of a bitmap across the Internet requires Internet Explorer files that are available only for WIN32 applications.


Topic Selection

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

Sales@Leadtools.com
www.leadtools.com

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

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

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

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

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


Install Filters Example Page

.topic 0x152f Annotation Declaration Information Assume the following class member declarations: CLEADRasterView m_LEADRasterView1; // LEADRasterView control ILEADRasterAnnotation * m_pRasterAnn; // LEAD Annotation COM object The following code is called when the application starts CoCreateInstance( CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&m_pRasterAnn); //Unlock the annotation support //Note that L_KEY_DOCUMENT is a #define for the support key that you must supply m_LEADRasterView1.().(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT); //Attach the annotation object to the raster view control IDispatch *pDispatch=NULL; LPUNKNOWN pIUnknownNoRelease = m_LEADRasterView1.GetControlUnknown(); pIUnknownNoRelease->QueryInterface(IID_IDispatch, (void**)&pDispatch); m_pRasterAnn->(pDispatch); if(pDispatch) pDispatch->Release(); m_pRasterAnn->(TRUE); *** The following code is called when the application ends m_pRasterAnn->Release(); .topic 0x2b8b InstallFilter Java Script Note: This Page uses the LEADRasterIO COM Object to install LEAD CMP, GIF Filters. Install Filters Example Page .topic 0x2b8e C++ Builder Problems In some C++ Builder builds, when the user tries to handle some ActiveX controls’ events, he will get event handlers with incorrect parameter names. The following events in the LEAD Raster View Control generate this problem: To fix this problem try the following: If LEAD Raster View Control was not installed on your C++ Builder, ignore step A, and start from step B. Step A: If LEAD Raster View Control is already installed on your C++ Builder software, remove it as follows: 1. Open the package dclusr40.bpk, usually in the \Borland\CBuilder4\Lib folder (or the package that you installed LEAD Raster View Control on). 2. Remove the "LTRASTERVIEWLib_OCX.cpp" and "LTRASTERVIEWLib_OCX.dcr" files from the opened package. 3. Compile the dclusr40.bpk or the package that you opened in step 1 to uninstall LEAD Raster View Control. 4. Now you have to reinstall the LEAD Raster View Control, to reinstall it go to step B. Step B: To install the LEAD Raster View Control, do the following: 1. Use the Command prompt program. 2. Change the directory to the \Borland\CBuilder4\Imports folder. 3. Type this command line "tlibimp -p+ c:\windows\system32\ltrvw14N.OCX" without the quotation marks. (Change c:\windows\system32\ to your system folder where ltrvw14N.OCX resides). 4. Open the C++ Builder 4. 5. Open the package dclusr40.bpk, usually in the \Borland\CBuilder4\Lib\ folder (or any package you want to add the LEAD Raster View Control to). 6. Using the Add button, add the "Pascal" files "LTRASTERLib_TLB.pas", and "LTRASTERVIEWLib_TLB.pas" generated using the tlibimp command line in step B3. 7. Compile the dclusr40.bpk package. 8. Install the dclusr40.bpk, which will install the LEAD Raster View Control.


C++ Builder Problems

In some C++ Builder builds, when the user tries to handle some ActiveX controls’ events, he will get event handlers with incorrect parameter names. The following events in the LEAD Raster View Control generate this problem:

KeyDown event

KeyPress event

KeyUp event

ZoomInDone event

To fix this problem try the following:

If LEAD Raster View Control was not installed on your C++ Builder, ignore step A, and start from step B.

Step A:

If LEAD Raster View Control is already installed on your C++ Builder software, remove it as follows:

1. | Open the package dclusr40.bpk, usually in the \Borland\CBuilder4\Lib folder (or the package that you installed LEAD Raster View Control on).
2. | Remove the "LTRASTERVIEWLib_OCX.cpp" and "LTRASTERVIEWLib_OCX.dcr" files from the opened package.
3. | Compile the dclusr40.bpk or the package that you opened in step 1 to uninstall LEAD Raster View Control.
4. | Now you have to reinstall the LEAD Raster View Control, to reinstall it go to step B.

Step B:

To install the LEAD Raster View Control, do the following:

1. | Use the Command prompt program.
2. | Change the directory to the \Borland\CBuilder4\Imports folder.
3. | Type this command line "tlibimp -p+ c:\windows\system32\ltrvw14N.OCX" without the quotation marks. (Change c:\windows\system32\ to your system folder where ltrvw14N.OCX resides).
4. | Open the C++ Builder 4.
5. | Open the package dclusr40.bpk, usually in the \Borland\CBuilder4\Lib\ folder (or any package you want to add the LEAD Raster View Control to).
6. | Using the Add button, add the "Pascal" files "LTRASTERLib_TLB.pas", and "LTRASTERVIEWLib_TLB.pas" generated using the tlibimp command line in step B3.
7. | Compile the dclusr40.bpk package.
8. | Install the dclusr40.bpk, which will install the LEAD Raster View Control.


InstallFilter Java Script

Note: This Page uses the LEADRasterIO COM Object to install LEAD CMP, GIF Filters.

<HTML>
<HEAD>
<TITLE>Install Filters Example Page</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
function InstallFilters()
{
var bRetValue;

//Set the full url to the cab that contains the CMP filter dll.
RasterIO.SetFilterUrl("http://www.leadtools.com/cabs/CMPFilter.cab");

//Install the CMP filter dll, false indicate that the installation is not silent.
bRetValue = RasterIO.InstallFilter("CMP", false);

//Check if CMP Filter is successfully Installed

if(bRetValue)
alert("Installation of LEAD CMP Filter is successful");
else
alert("Installation of LEAD CMP Filter failed");

//Set the full url to the cab that contains the GIF filter dll.
RasterIO.SetFilterUrl("http://www.leadtools.com/cabs/GIFFilter.cab");

//Install the GIF filter dll, true indicate that the installation is silent.
RasterIO.InstallFilter("GIF", true);

}

</SCRIPT>
</HEAD>
<BODY onload="javascript:InstallFilters();">

<object
ID="RasterIO"
name="RasterIO"
classid="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
codebase="http://www.leadtools.com/COM/ltrio14n.cab">
</object>

</BODY>
</HTML>


Miscellaneous Methods and Properties

UnlockSupport method

IsSupportLocked method

MouseIcon property

MousePointer property

Enabled property

Window property


Return for AboutBox

Return Value

None.


Flags Parameter For AdaptiveContrast

Flags

Value that indicates the adjustment method. Possible values are:

Value | Meaning
ACE_EXP | [1] Apply exponential adjustment.
ACE_LIN | [2] Apply linear adjustment.


lAmount Parameter For AdaptiveContrast

lAmount

Value that represents an adjustment factor. Its range starts from 100 and has no upper limit.


lDim Parameter For AdaptiveContrast

lDim

Dimensions of the neighborhood used for filtering (lDim x lDim), in pixels.


pRaster Parameter For AdaptiveContrast

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for AdaptiveContrast

Return Value

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


Flags Parameter For AddBitmaps

Flags

Flag that indicates the operation to perform. Possible values are:

Value | Meaning
BC_ADD | Add the bitmaps in the specified list.
BC_AVE | Average the bitmaps in the specified list.


pRaster Parameter For AddBitmaps

pRaster

Pointer to the ILEADRaster object to be modified.


Return for AddBitmaps

Return Value

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


bBumpyShadow Parameter For AddBorder

bBumpyShadow

Boolean flag that indicates whether to increase the intensity near the far edge of the shadow. This flag is used only when bShadow is TRUE. Setting this flag to TRUE produces a good appearance for the shadow if nShadowSize is a value between 4 and 7. Possible values are:

Value | Meaning
TRUE | Increase the intensity near the far edge of the shadow.
FALSE | Do not increase the intensity near the far edge of the shadow.


bShadow Parameter For AddBorder

bShadow

Boolean flag that indicates whether to add a shadow to the border. Possible values are:

Value | Meaning
TRUE | Add a shadow to the border.
FALSE | Do not add a shadow to the border.


bSoftCurve Parameter For AddBorder

bSoftCurve

Boolean flag that indicates whether to give the border a soft curve appearance. This flag is used only when EffectStyle is BORDER_EFFECT_RAISED. Possible values are:

Value | Meaning
TRUE | Make the border more homogeneous in intensity, giving the appearance of a smoother curve.
FALSE | Do not make the border more homogeneous in intensity.


crGradientEnd Parameter For AddBorder

crGradientEnd

The ending color when Style is BORDER_STYLE_GRADIENT.


crGradientStart Parameter For AddBorder

crGradientStart

The starting color when Style is BORDER_STYLE_GRADIENT. This is also the color used when Style is BORDER_STYLE_OPAQUE.


EffectStyle Parameter For AddBorder

EffectStyle

Flag that indicates the change in the appearance of the border. By default there are no changes. The change also depends on the value of nCurveIntensity. If nCurveIntensity is zero, there are no changes. Possible values are:

Value | Meaning
BORDER_EFFECT_CURVEDIN | [1] Add a 3D appearance to the border by adding a high intensity color to the inner side of the border and a lower intensity color to the outer side of the border.
BORDER_EFFECT_CURVEDOUT | [2] Add a 3D appearance to the border by adding a high intensity color to the outer side of the border and a lower intensity color to the inner side of the border.
BORDER_EFFECT_RAISED | [3] Add a curved appearance to the border.


fBottomThickness Parameter For AddBorder

fBottomThickness

The thickness of the bottom side of the border. The unit of measure is determined by the ScaleMode property.


fLeftThickness Parameter For AddBorder

fLeftThickness

The thickness of the left side of the border. The unit of measure is determined by the ScaleMode property.


fRightThickness Parameter For AddBorder

fRightThickness

The thickness of the right side of the border. The unit of measure is determined by the ScaleMode property.


fTopThickness Parameter For AddBorder

fTopThickness

The thickness of the top side of the border. The unit of measure is determined by the ScaleMode property.


GradientStyle Parameter For AddBorder

GradientStyle

Flag that indicates the gradient style. This flag is used only when the Style parameter is BORDER_STYLE_GRADIENT. Possible values are:

Value | Meaning
BORDER_GRAD_INSIDEOUT | [0] The gradient starts from the inside of the border and progresses toward the outside of the border.
BORDER_GRAD_CENTEROUT | [1] The gradient starts from the center of the border and progresses toward both the inside and outside of the border.
BORDER_GRAD_CORNEROUT | [2] The gradient starts from the corners of the border.


Location Parameter For AddBorder

Location

Flag that indicates the position of the border. Possible values are:

Value | Meaning
BORDER_INSIDE | [0] The border will be within the bitmap.
BORDER_OUTSIDE | [1] The border will be outside the bitmap.


nCurveIntensity Parameter For AddBorder

nCurveIntensity

Value that indicates the degree to which to change the appearance of the border. This value is used only when the EffectStyle flag is set. The range is from –1000 to 1000.


nShadowSize Parameter For AddBorder

nShadowSize

Value that indicates the width of the shadow, in pixels. This value is used only when bShadow is TRUE.


pRaster Parameter For AddBorder

pRaster

Pointer to the ILEADRaster object to be modified.


pRasterTile Parameter For AddBorder

pRasterTile

Pointer to the ILEADRaster object that contains the tile bitmap. This is the bitmap the border is taken from when Style is BORDER_STYLE_TILES.


ShadowDirection Parameter For AddBorder

ShadowDirection

Flag that indicates the direction of the shadow. This value is used only when bShadow is TRUE. Possible values are:

Value | Meaning
BORDER_SHADOW_LEFT | [0] The shadow is on the left top side of the image.
BORDER_SHADOW_RIGHT | [1] The shadow is on the right bottom side of the image.
BORDER_SHADOW_SURROUND | [2] The shadow surrounds the border.


Return for AddBorder

Return Value

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


Style Parameter For AddBorder

Style

Flag that indicates the style of the border. Possible values are:

Value | Meaning
BORDER_STYLE_TRANSPARENT | [0] The border is transparent. Therefore, the bitmap itself shows through as the border.
BORDER_STYLE_OPAQUE | [1] Use a single color to create the border. The color used is crGradientStart.
BORDER_STYLE_GRADIENT | [2] The border contains a color gradient from crGradientStart to crGradientEnd.
BORDER_STYLE_TILES | [3] The border is taken from the bitmap referenced by the pRasterTile parameter.


bKeepFrameState Parameter For AddFrame

bKeepFrameState

Boolean flag that indicates the state of the frame bitmap. Possible values are:

Value | Meaning
TRUE | Keep the state of the frame bitmap and operate on a copy of the frame bitmap.
FALSE | Work on the original frame bitmap so this bitmap may be resized during the AddFrame method.


bUseMask Parameter For AddFrame

bUseMask

Boolean flag that indicates whether to force the bitmap to be put on a specific region of the frame bitmap. Possible values are:

Value | Meaning
TRUE | Select a region on the frame bitmap with the same color specified in crMask and place the bitmap in this region.
FALSE | Put the bitmap in the center of the frame bitmap.


crMask Parameter For AddFrame

crMask

Color used to specify the region on the frame bitmap, in which to put the bitmap. This value is used only if the bUseMask parameter is TRUE.


Location Parameter For AddFrame

Location

Flag that indicates the location of the frame with respect to the bitmap. Possible values are:

Value | Meaning
FRAME_INSIDE | [0] The frame will be within the original bitmap.
FRAME_OUTSIDE | [1] The frame will be outside the original bitmap.


pRaster Parameter For AddFrame

pRaster

Pointer to the ILEADRaster object to be modified.


pRasterFrame Parameter For AddFrame

pRasterFrame

Pointer to an ILEADRaster object that references the frame bitmap.


Quality Parameter For AddFrame

Quality

Flag that specifies the quality of the resulting bitmap. Possible values are:

Value | Meaning
FRAME_QUALITY_LOW | [0] Give the resulting bitmap normal quality.
FRAME_QUALITY_HIGH | [1] Give the resulting bitmap high quality.


Return for AddFrame

Return Value

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


SmoothEdge Parameter For AddFrame

SmoothEdge

Value that indicates the amount to smooth the edge between the frame and the original bitmap. In most cases, useful values are 30 and 50. This value is used only when the bUseMask parameter is FALSE.


iIndex Parameter For AddItem

iIndexBefore

Index of the item before which the new item should be inserted.


iType Parameter For AddItem

iType

Type of menu item to add. Possible values are:

Value | Meaning
ANN_MENUITEMTYPE_NORMAL | [0] Normal menu item.
ANN_MENUITEMTYPE_SEPARATOR | [1] Menu item is a separator.
ANN_MENUITEMTYPE_SUBMENU | [2] Menu item is a popup menu.


nID Parameter For AddItem

nID

The command ID for the new menu item. The ID value must be in the range ANN_EVENT_MENUFIRST [0x0100] to ANN_EVENT_MENULAST [0x01FF]. This parameter is not valid if iType is ANN_MENUITEMTYPE_SEPARATOR.


pszString Parameter For AddItem

pszString

String that contains the text for the new menu item. This parameter is not valid if iType is ANN_MENUITEMTYPE_SEPARATOR.


Return for AddItem

Return Value

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


pRaster Parameter For AddMessage

pRaster

Pointer to the ILeadRaster object that references the bitmap to which to add the message.


Return for AddMessage

Return Value

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


iChannel Parameter For AddNoise

iChannel

Possible values are:

Value | Meaning
CHANNEL_MASTER | All channels.
CHANNEL_RED | Red channel only.
CHANNEL_GREEN | Green channel only.
CHANNEL_BLUE | Blue channel only.


iRange Parameter For AddNoise

iRange

Percentage of coverage, expressed in tenths of a percent. Valid values are 0 to 1000.


pRaster Parameter For AddNoise

pRaster

ILEADRaster object to modified.


Return for AddNoise

Return Value

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


Direction Parameter For AddShadow

Direction

Angle value indicating the direction of the light source producing the shadow. Possible values are:

Value | Meaning
SHADOW_E | [0] East
SHADOW_NE | [1] Northeast
SHADOW_N | [2] North
SHADOW_NW | [3] Northwest
SHADOW_W | [4] West
SHADOW_SW | [5] Southwest
SHADOW_S | [6] South
SHADOW_SE | [7] Southeast


lFlags Parameter For AddShadow

lFlags

Type of the shadow. Possible values are:

Value | Meaning
SHADOW_CLR_RGB | [0] Shadows are colored.
SHADOW_CLR_GRAY | [1] Shadows are grayscale


lThreshold Parameter For AddShadow

lThreshold

Threshold value used to determine which pixels will be affected . Valid values range from 0 through 255. When lFlags = COLOR_RGB, any component (R, G, or B) of a pixel with a value less than the lThreshold value is not affected. When lFlags = COLOR_GRAY, any pixel where the master channel value is less than the lThreshold value is not affected.


pRaster Parameter For AddShadow

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for AddShadow

Return Value

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


lFlag Parameter For AddWeightedBitmaps

lFlag

Flag that indicates the operation to perform. Possible values are:

Value | Meaning
BC_AVG | [0x0001] Average the bitmaps in the specified list.
BC_ADD | [0x0002] Add the bitmaps in the specified list.
BC_AVGWEIGHTED | [0x0003] Average the bitmaps in the specified list, according to the array of weight factors in the Factor property .
BC_ADDWEIGHTED | [0x0004] Add the bitmaps in the specified list, according to the array of weight factors in the Factor property .


pRaster Parameter For AddWeightedBitmaps

pRaster

ILEADRaster object to be modified.


Return for AddWeightedBitmaps

Return Value

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


crDust Parameter For Aging

crDust

OLE_COLOR value representing the color of the dust.


crPits Parameter For Aging

crPits

OLE_COLOR value representing the color of the pits.


crScratch Parameter For Aging

crScratch

OLE_COLOR value representing the color of the scratch lines.


lDustDensity Parameter For Aging

lDustDensity

Dust density, expressed in tenths of a percent of the bitmap area. Valid values range between 0 and 1000. This value is divided internally by 10. If lDustDen = 1000 then dust density = 100% (that is, the number of dust points = the entire bitmap area.)


lFlags Parameter For Aging

lFlags

Flags that indicate the distortion type and the distortion color. You can use a bitwise OR (|) to specify one or more flags from each group.

The following flags indicate the distortion type:

Value | Meaning
AGING_ADD_NOTHING | [0x0000] Do not add any distortion type. In this case, the bitmap will be changed by random changes in the color intensity.
AGING_ADD_VSCRATCH | [0x0001] Add vertical scratch lines.
AGING_ADD_HSCRATCH | [0x0002] Add horizontal scratch lines.
AGING_ADD_DUST | [0x0004] Add dust.
AGING_ADD_PITS | [0x0008] Add pits.

The following flags indicate the distortion color:

Value | Meaning
AGING_SCRATCH_INV | [0x0000] Use pixel’s color inverse as scratch line color. If this flag is set, crScratch will be ignored.
AGING_SCRATCH_CLR | [0x0010] Use the crScratch as scratch line color.
AGING_DUST_INV | [0x0000] Use pixel’s color inverse as dust color. If this flag is set, crDust will be ignored.
AGING_DUST_CLR | [0x0020] Use the crDust as dust color.
AGING_PITS_INV | [0x0000] Use pixel’s color inverse as the color of the pits. If this flag is set, crPits will be ignored.
AGING_PITS_CLR | [0x0040] Use the crPits as the color of the pits.


lHScratchCount Parameter For Aging

lHScratchCount

Number of horizontal scratch lines.


lMaxPitSize Parameter For Aging

lMaxPitSize

Density of the pits, expressed in tenths of a percent of the bitmap area. Valid values range between 0 and 1000. This value is divided internally by 10. If lPitsDen = 1000 then the density of the pits = 100% (that is, the number of pits = the entire bitmap area.)


lMaxScratchLen Parameter For Aging

lMaxScratchLen

Maximum scratch line length, in pixels. Its minimum value is 2.


lPitsDensity Parameter For Aging

lPitsDensity

Density of the pits, expressed in tenths of a percent of the bitmap area. Valid values range between 0 and 1000. This value is divided internally by 10. If lPitsDen = 1000 then the density of the pits = 100% (that is, the number of pits = the entire bitmap area.)


lVScratchCount Parameter For Aging

lVScratchCount

Number of vertical scratch lines.


pRaster Parameter For Aging

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Aging

Return Value

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


fHeight Parameter For AlphaBlend

fHeight

The height of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For AlphaBlend

fLeft

The X coordinate of the origin of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fSrcLeft Parameter For AlphaBlend

fSrcLeft

The X coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fSrcTop Parameter For AlphaBlend

fSrcTop

The Y coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fTop Parameter For AlphaBlend

fTop

The Y coordinate of the origin of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For AlphaBlend

fWidth

The width of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


iOpacity Parameter For AlphaBlend

iOpacity

Opacity value used when combining the areas from the source and destination bitmaps. This value is between 0 and 255.


pRaster Parameter For AlphaBlend

pRaster

Pointer to the ILEADRaster object to be modified.


pRasterSrc Parameter For AlphaBlend

pRasterSrc

Pointer to the ILEADRaster object that contains the bitmap to be combined with the destination bitmap.


Return for AlphaBlend

Return Value

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


lIndex Parameter For Amplitudes

lIndex

Index into the array of amplitude values. Valid values are from 0 to AmplitudesCount – 1.


bEnable Parameter For Animate

bEnable

One of the following values:

TRUE | Animation playback is about to start.
FALSE | Animation playback has stopped.


iIndex Parameter For AnimationPalette

iIndex

Index into the array of colors.


Return for AnnAddUndoNode

Return Value

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


hObject Parameter for AnnAddUserHandle

hObject

Handle of the annotation object.


Return for AnnAddUserHandle

Return Value

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


AnchorX Parameter for AnnAdjustPoint

AnchorX

Value that represents the X coordinate of the anchor point.


AnchorY Parameter for AnnAdjustPoint

AnchorY

Value that represents the Y coordinate of the anchor point.


Angle Parameter for AnnAdjustPoint

Angle

Angle of rotation in radians. Ranges from -Pi to Pi, (-3.1415… - 3.1415) where a positive angle corresponds to clockwise rotation.


MoveX Parameter for AnnAdjustPoint

MoveX

Value that represents the X coordinate of the point to be adjusted.


MoveY Parameter for AnnAdjustPoint

MoveY

Value that represents the Y coordinate of the point to be adjusted.


nType Parameter for AnnAdjustPoint

nType

Type of adjustment to the point. Possible values are:

ANN_ADJUST_HORIZONTAL | [1]
ANN_ADJUST_VERITCAL | [2]
ANN_ADJUST_45_DEGREES_FAVOR_X | [3]
ANN_ADJUST_45_DEGREES_FAVOR_Y | [4]


Return for AnnAdjustPoint

Return Value

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


hObject Parameter For AnnBoundingRectHeight

hObject

Handle to the annotation object.


hObject Parameter For AnnBoundingRectLeft

hObject

Handle to the annotation object.


hObject Parameter For AnnBoundingRectTop

hObject

Handle to the annotation object.


hObject Parameter For AnnBoundingRectWidth

hObject

Handle to the annotation object.


hObject Parameter For AnnBringToFront

hObject

Handle to the annotation object.


Return for AnnBringToFront

Return Value

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


hAnnObject Parameter For AnnChange

hAnnObject

Handle to the annotation object.


hObject Parameter for AnnChangeUserHandle

hObject

Handle of the annotation object


Return for AnnChangeUserHandle

Return Value

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


uIndex Parameter for AnnChangeUserHandle

uIndex

Index of the user handle to change. The index is zero based.


Return for AnnClearTokenTable

Return Value

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


hAnnObject Parameter For AnnClicked

hAnnObject

Handle to the annotation object.


hContainer Parameter for AnnConvert

hContainer

Handle to the annotation container object.


nConvert Parameter for AnnConvert

nConvert

A value that specifies the direction of the conversion. Possible values are:

Value | Meaning
ANN_CONVERT_TO_CONTAINER | [1] Convert to container coordinates.
ANN_CONVERT_TO_CLIENT | [2] Convert to client coordinates.


Return for AnnConvert

Return Value

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


bEmpty Parameter For AnnCopy

bEmpty

One of the following values:

Value | Meaning
VARIANT_TRUE | Empty the clipboard before copying data to it.
VARIANT_FALSE | Add to the existing data on the clipboard.


bSelected Parameter For AnnCopy

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Copy only the selected objects.
VARIANT_FALSE | Copy all of the annotation objects.


iFormat Parameter For AnnCopy

iFormat

One of the following values:

Value | Meaning
ANN_FMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
ANN_FMT_WMF | 0x0001] Use the Windows WMF format.
ANN_FMT_ENCODED | [0x0004] Use a binary format for saving annotations. The file size is smaller, and it provides greater security.
ANN_FMT_XML | [0x0005] Save as an XML text format. This is LEAD’s new text based format which is upward-compatible. It should be used instead of ANN_FMT_NATIVE.


Return for AnnCopy

Return Value

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


bAutoInsert Parameter For AnnCreate

bAutoInsert

Flag that indicates whether to insert the created annotation object in AnnContainer. Possible values are:

Value | Meaning
VARIANT_TRUE | Automatically insert the annotation object in AnnContainer.
VARIANT_FALSE | Do not automatically insert the annotation object in AnnContainer.


bVisible Parameter For AnnCreate

bVisible

Flag that indicates whether the object will be visible. Possible values are:

Value | Meaning
VARIANT_TRUE | The annotation object will be visible with default properties.
VARIANT_FALSE | The annotation object will not be visible.


hAnnObject Parameter For AnnCreate

hAnnObject

Handle to the annotation object that is created.


bVisible Parameter For AnnCreateItem

bVisible

Flag that indicates whether the object will be visible. Possible values are:

Value | Meaning
TRUE | The annotation object will be visible with default properties.
FALSE | The annotation object will not be visible.


hContainer Parameter For AnnCreateItem

hContainer

Handle to the annotation object that is the container for the object to be created.


iType Parameter For AnnCreateItem

iType

The type of annotation object to create. For descriptions of object types, refer to Types of Annotations.


Return for AnnCreateItem

Return Value

Value | Meaning
<>0 | Handle to the newly created annotation object.
0 | An error occurred. Refer to Error Codes.


iType Parameter For AnnCreate

iType

The type of annotation object to create. For descriptions of object types, refer to Types of Annotations.


Return for AnnCreate

Return Value

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


fEmpty Parameter For AnnCut

fEmpty

One of the following values:

Value | Meaning
TRUE | Empty the clipboard before copying data to it.
FALSE | Add to the existing data on the clipboard.


fSelected Parameter For AnnCut

fSelected

One of the following values:

Value | Meaning
TRUE | Copy only the selected objects.
FALSE | Copy all of the annotation objects.


hObject Parameter For AnnCut

hObject

Handle to the annotation object.


iFormat Parameter For AnnCut

iFormat

One of the following values:

Value | Meaning
ANN_FMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
ANN_FMT_WMF | 0x0001] Use the Windows WMF format.
ANN_FMT_ENCODED | [0x0004] Use a binary format for saving annotations. The file size is smaller, and it provides greater security.
ANN_FMT_XML | [0x0005] Use the XML text format. This is LEAD’s new text based format which is upward-compatible. It should be used instead of ANN_FMT_NATIVE.


Return for AnnCut

Return Value

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


pRaster Parameter For AnnDataPath

pRaster

This parameter represents the ILEADRaster object to use when loading annotations.


pszURL Parameter For AnnDataPath

pszURL

String that contains the URL from which to load the annotations.


Return for AnnDataPath

Return Value

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


aptX Parameter for AnnDefine2

aptX

X coordinate of the point specified in the call to this method. This X coordinate is in container coordinates.


aptY Parameter for AnnDefine2

aptY

Y coordinate of the point specified in the call to this method. This Y coordinate is in container coordinates.


hObject Parameter for AnnDefine2

hObject

Handle to the annotation object.


Return for AnnDefine2

Return Value

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


uState Parameter for AnnDefine2

uState

Value that represents the state of the process of modifying the annotation object. Possible values are:

Value | Meaning
ANN_DEFINE_SETANCHORPOINT | [13] This is an anchor point. Use this value when rotating an annotation object around a point other than its center. When doing this, call AnnDefine2 with this flag set prior to calling AnnDefine2 with the ANN_DEFINE_BEGINROTATE flag set.
ANN_DEFINE_BEGINMOVEPOINT | [11] This is a starting point, used when moving one point on an annotation object. This can be used to move a single point on any of the following annotation objects:
 | ANN_OBJECT_LINE
 | ANN_OBJECT_POLYLINE
 | ANN_OBJECT_POLYGON
 | ANN_OBJECT_POINTER
 | ANN_OBJECT_FREEHAND
 | ANN_OBJECT_FREEHANDHOTSPOT
 | ANN_OBJECT_RULER
 | ANN_OBJECT_CROSSPRODUCT
 | ANN_OBJECT_PROTRACTOR
 | ANN_OBJECT_CURVE
 | ANN_OBJECT_CURVECLOSED
 | You can use ANN_DEFINE_BEGINMOVEPOINT to perform a simultaneous rotate and resize for the following objects:
 | (Note that you must set an anchor point prior to using ANN_DEFINE_BEGINMOVEPOINT)
 | ANN_OBJECT_RECT
 | ANN_OBJECT_ELLIPSE
 | ANN_OBJECT_HILITE
 | ANN_OBJECT_REDACT
 | ANN_OBJECT_TEXT
 | ANN_OBJECT_NOTE
 | ANN_OBJECT_STAMP
 | ANN_OBJECT_HOTSPOT


hObject Parameter For AnnDefine

hObject

Handle to the annotation object.


iState Parameter For AnnDefine

iState

Flag that indicates how to align the annotation toolbar. Possible values are given below, and may be combined:

Value

Meaning

ANN_DEFINE_BEGINSET

[0] This is the first point to define a new object.

ANN_DEFINE_BEGINMOVE

[1] This is the point from which to move the object.

ANN_DEFINE_BEGINROTATE

[2] This is the starting point for calculating the angle of rotation.

ANN_DEFINE_BEGINRESIZE

[3] This is the starting point for calculating how to resize the object.

ANN_DEFINE_BEGINSELECT

[4] This is the first corner of the rectangle used to select objects.

ANN_DEFINE_APPEND

[5] This is the next point when defining an object that requires more than two points.

ANN_DEFINE_UPDATE

[6] This is the current mouse position during creation of the object. Use this on a mouse move event to reflect the current shape of the object.

ANN_DEFINE_END

[7] This is the last point.

ANN_DEFINE_BEGINMOVESELECTED

[8] This is the point from which to move all selected objects.

ANN_DEFINE_BEGINROTATESELECTED

[9] This is the starting point for calculating the angle of rotation for all selected objects.

ANN_DEFINE_BEGINRESIZESELECTED

[10] This is the starting point for calculating the how to resize all selected objects.

ANNDEFINE_BEGINMOVEPOINT

[11] This is a starting point, used when moving one point on an annotation object. The behavior depends on the annotation object being manipulated. This can be used to move a single point on any of the following annotation objects:

ANN_OBJECT_LINE

ANN_OBJECT_POLYLINE

ANN_OBJECT_POLYGON

ANN_OBJECT_POINTER

ANN_OBJECT_FREEHAND

ANN_OBJECT_FREEHANDHOTSPOT

ANN_OBJECT_RULER

ANN_OBJECT_CROSSPRODUCT

ANN_OBJECT_PROTRACTOR

ANN_OBJECT_CURVE

ANN_OBJECT_CURVECLOSED

You can use ANNDEFINE_BEGINMOVEPOINT to perform a simultaneous rotate and resize for the following objects: When doing this, call AnnDefine with the ANNDEFINE_SETANCHORPOINT flag prior to calling AnnDefine with the ANNDEFINE_BEGINMOVEPOINT flag.

(Note that you must set an anchor point prior to using ANNDEFINE_BEGINMOVEPOINT)

ANN_OBJECT_RECT

ANN_OBJECT_ELLIPSE

ANN_OBJECT_HILITE

ANN_OBJECT_REDACT

ANN_OBJECT_TEXT

ANN_OBJECT_NOTE

ANN_OBJECT_STAMP

ANN_OBJECT_HOTSPOT

ANN_DEFINE_BEGINMOVENAME

[12] This is the starting point from which to move the object name.

ANNDEFINE_SETANCHORPOINT

[13] This is an anchor point. Use this value when rotating an annotation object around a point other than its center. When doing this, call AnnDefine with this flag prior to calling AnnDefine with the ANNDEFINE_BEGINROTATE flag.


Return for AnnDefine

Return Value

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


x Parameter For AnnDefine

x

X coordinate of a point. This coordinate is relative to the window of the LEAD control. Coordinates may be scaled using the ScaleMode.


y Parameter For AnnDefine

y

Y coordinate of a point. This coordinate is relative to the window of the LEAD control. Coordinates may be scaled using the ScaleMode.


lPage Parameter For AnnDeletePageArray

lPage

Number of the page to delete. The page number is 1-based. Therefore, the first page is page 1; the second page is page 2, etc.


pvMem Parameter For AnnDeletePageArray

pvMem

Pointer to an ILEADRasterVariant object, containing the annotation file in memory.


Return for AnnDeletePageArray

Return Value

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


lPage Parameter For AnnDeletePage

lPage

Number of the page to delete. The page number is 1-based. Therefore, the first page is page 1; the second page is page 2, etc.


hMem Parameter For AnnDeletePageMemory

hMem

A global handle (HGLOBAL) to the annotation file in memory. If the AnnSaveMemory method is used to create the file in memory, that method updates the handle and buffer size variables.


lPage Parameter For AnnDeletePageMemory

lPage

Number of the page to delete. The page number is 1-based. Therefore, the first page is page 1; the second page is page 2, etc.


Return for AnnDeletePageMemory

Return Value

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


pszName Parameter For AnnDeletePage

pszName

String containing the annotation file from which to delete the specified page.


Return for AnnDeletePage

Return Value

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


cToken Parameter for AnnDeleteTokenTable

cToken

Character representing the token to delete from the text token table. For example, to delete token "#c" from the text token table, pass ‘c’ for cToken.


Return for AnnDeleteTokenTable

Return Value

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


hObject Parameter for AnnDeleteUserHandle

hObject

Handle of the annotation object.


Return for AnnDeleteUserHandle

Return Value

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


uIndex Parameter for AnnDeleteUserHandle

uIndex

Index of the user handle to delete. The index is zero based.


hAnnObject Parameter For AnnDestroy

hAnnObject

Handle to the annotation object that is deleted.


hObject Parameter For AnnDestroy

hObject

Handle to the annotation object to be destroyed. If hObject is a container, then iFlags indicates which objects within the container to destroy.


iFlags Parameter For AnnDestroy

iFlags

Flag that indicates the objects to process. Use VARIANT_FALSE if hObject is not a container.

If hObject is a container, you can use VARIANT_FALSE (process only hObject), or you can combine some of the values given below, using a bitwise OR. For example, ANN_FLAG_SELECTED | ANN_FLAG_RECURSE processes only the selected objects.

Value | Meaning
ANN_FLAG_SELECTED | [0x0001] Enumerate only the selected objects.
ANN_FLAG_NOTCONTAINER | [0x0002] Enumerate all objects that are not containers.
ANN_FLAG_NOTTHIS | [0x0003] Enumerate all objects except hObject.
ANN_FLAG_RECURSE | [0x0004] Enumerate all objects contained in hObject and any contained in any sub-containers.
ANN_FLAG_CHECKMENU | [0x0020] Process objects only if the ANN_AUTOTEXT_MENU_DELETE menu item has not been disabled.


Return for AnnDestroy

Return Value

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


hAnnObject Parameter For AnnDrawn

hAnnObject

Handle to the annotation object.


hObject Parameter for AnnEncryptApply

hObject

Handle of the object


Return for AnnEncryptApply

Return Value

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


uEncryptFlags Parameter for AnnEncryptApply

uEncryptFlags

Flags that determine which objects to apply. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

Value | Meaning
ANN_ENCRYPTAPPLY_ENCRYPTOR | [0x001] Apply encryptor objects.
ANN_ENCRYPTAPPLY_DECRYPTOR | [0x002] Apply decryptor objects.
ANN_APPLYENCRYPT_BOTH | [0x003] Apply both encryptor and decryptor objects.


hObject Parameter For AnnEnumerate

hObject

The object being enumerated, most often a Container object.


hObject Parameter for AnnEnumerateHandle

hObject

Handle to the annotation object


Return for AnnEnumerateHandle

Return Value

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


hObject Parameter For AnnEnumerate

hObject

Handle of the object.


iFlags Parameter For AnnEnumerate

iFlags

Flag that indicates the objects to process. Possible values are:

Value | Meaning
ANN_FLAG_SELECTED | [0x0001] Enumerate only the selected objects.
ANN_FLAG_NOTCONTAINER | [0x0002] Enumerate all objects that are not containers.
ANN_FLAG_NOTTHIS | [0x0003] Enumerate all objects except hObject.
ANN_FLAG_RECURSE | [0x0004] Enumerate all objects contained in hObject and any contained in any sub-containers,
ANN_FLAG_USER | [0x0040] Process only those objects with users listed in pszUserList.


pszUserList Parameter For AnnEnumerate

pszUserList

String that contains the users.


Return for AnnEnumerate

Return Value

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


Return for AnnEnumerateTextToken

Return Value

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


Return for AnnFileInfoArray

Return Value

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


vMem Parameter For AnnFileInfoArray

vMem

A variant containing a byte-array that represents the annotation file in memory.


hMem Parameter For AnnFileInfoMemory

hMem

A global handle (HGLOBAL) to the annotation file in memory. If the AnnSaveMemory method is used to create the file in memory, that method updates the handle and buffer size variables.


lSize Parameter For AnnFileInfoMemory

lSize

The size in bytes, of the file referenced by hMem. If the AnnSaveMemory method is used to create the file in memory, that method updates the handle and buffer size variables.


pszName Parameter For AnnFileInfo

pszName

String containing the annotation file from which to obtain information


Return for AnnFileInfo

Return Value

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


hObject Parameter For AnnFixed

hObject

Handle to the annotation object


bSelected Parameter For AnnFlip

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Flip only the selected objects.
VARIANT_FALSE | Flip all of the annotation objects.


bUseHorz Parameter For AnnFlip

bUseHorz

One of the following values:

Value | Meaning
VARIANT_TRUE | Flip all objects on the axis specified by the fHorz parameter.
VARIANT_FALSE | Flip each object on its own center.


fHorz Parameter For AnnFlip

fHorz

The horizontal axis (Y value) on which the objects are flipped. This value is used only if the bUseHorz parameter is VARIANT_TRUE.

The position is relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.


Return for AnnFlip

Return Value

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


Return for AnnGetAngle

Return Value

Angle of the protractor object specified in hObject.


hObject Parameter For AnnGetAngle

hObject

Handle to the annotation object.


hObject Parameter For AnnGetArea

hObject

Handle to the annotation object from which to get the pixel count.


Return for AnnGetArea

Return Value

Object's pixel count.


hObject Parameter For AnnGetAutoBackColor

hObject

Handle to the annotation object.


iType Parameter For AnnGetAutoBackColor

iType

Type of object for which to get the background color. For descriptions of object types, refer to Types of Annotations.


Return for AnnGetAutoBackColor

Return Value

Background color of the specified object type.


hObject Parameter For AnnGetAutoMenuItemEnable

hObject

Handle to an annotation or automation object.


iItem Parameter For AnnGetAutoMenuItemEnable

iItem

Constant that specifies the menu or dialog box item to enable or disable. For lists of constants and their default values, refer to the following:

Annotation Automation Menu Strings

Annotation Automation Line Dialog Strings

Annotation Automation Fill Dialog Strings

Annotation Automation Text Dialog Strings

Annotation Automation Audio Dialog Strings

Annotation Automation Stamp Dialog Strings

Annotation Automation ROP2 Dialog Strings

Annotation Automation Lock/Unlock Dialog Strings

Annotation Automation Miscellaneous Dialog Strings

Annotation Automation Ruler Dialog Strings

Annotation Automation Point Dialog Strings

Annotation Automation Push Pin Dialog Strings

Annotation Automation Nodes Dialog Strings

Annotation Automation Protractor Dialog Strings

Annotation Automation Name Dialog Strings

Annotation Automation Stamp Metafile Dialog Strings

Annotation Automation ToolTip Dialog Strings

Annotation Automation Transparent Color Dialog Strings

Annotation Automation Capture Dialog Strings


iType Parameter For AnnGetAutoMenuItemEnable

iType

Constant that specifies an object's type. For descriptions of possible object types, refer to Types of Annotations. This parameter is valid only if hObject is an automation object.


Return for AnnGetAutoMenuItemEnable

Return Value

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


iItem Parameter For AnnGetAutoText

iItem

Constant that specifies the menu or dialog box item, which appears when the user presses the right mouse button. For lists of constants and their default values, refer to the following:

Annotation Automation Menu Strings

Annotation Automation Line Dialog Strings

Annotation Automation Fill Dialog Strings

Annotation Automation Text Dialog Strings

Annotation Automation Audio Dialog Strings

Annotation Automation Stamp Dialog Strings

Annotation Automation Lock/Unlock Dialog Strings

Annotation Automation Miscellaneous Dialog Strings

Annotation Automation ROP2 Dialog Strings

Annotation Automation Ruler Dialog Strings

Annotation Automation Point Dialog Strings

Annotation Automation Push Pin Dialog Strings

Annotation Automation Nodes Dialog Strings

Annotation Automation Protractor Dialog Strings

Annotation Automation Name Dialog Strings

Annotation Automation Stamp Metafile Dialog Strings

Annotation Automation ToolTip Dialog Strings

Annotation Automation Transparent Color Dialog Strings

Annotation Automation Capture Dialog Strings


Return for AnnGetAutoText

Return Value

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


hObject Parameter For AnnGetBackColor

hObject

Handle to the annotation object.


Return for AnnGetBackColor

Return Value

Object's background color.


Return for AnnGetBitmapDpiX

Return Value

Current horizontal Bitmap DPI value.


hObject Parameter For AnnGetBitmapDpiX

hObject

Handle to the annotation automation object.


Return for AnnGetBitmapDpiY

Return Value

Current vertical Bitmap DPI value.


hObject Parameter For AnnGetBitmapDpiY

hObject

Handle to the annotation automation object.


hObject Parameter For AnnGetBitmap

hObject

Handle to the annotation object.


pRaster Parameter For AnnGetBitmap

pRaster

ILEADRaster object in which the image is retrieved.


Return for AnnGetBitmap

Return Value

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


hObject Parameter For AnnGetContainer

hObject

Handle to the annotation object.


Return for AnnGetContainer

Return Value

Handle of the container. If the object does not have a container, the returned value is NULL.


hObject Parameter For AnnGetDistance2

hObject

Handle to the annotation automation object.


Return for AnnGetDistance2

Return Value

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


Return for AnnGetDistance

Return Value

Length of the ruler object. For objects having only one ruler, the return value will be the length. For cross products, protractors, and polyrulers, which have two or more rulers, the return value will be length of the primary ruler.


hObject Parameter For AnnGetDistance

hObject

Handle to the annotation object.


hObject Paremeter for AnnGetEncryptOptions

hObject

Handle of the annotation object


Return for AnnGetEncryptOptions

Return Value

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


hObject Parameter For AnnGetFillMode

hObject

Handle to the annotation object.


Return for AnnGetFillMode

Return Value

Object's fill mode constant. Possible fill mode values are:

Value | Meaning
ANN_FILLMODE_TRANSPARENT | [0] Transparent
ANN_FILLMODE_TRANSLUCENT | [1] Translucent
ANN_FILLMODE_OPAQUE | [2] Opaque


hObject Parameter For AnnGetFillPattern

hObject

Handle to the annotation object.


Return for AnnGetFillPattern

Return Value

Object's fill pattern constant. Possible fill pattern values are:

Value | Meaning
ANN_FILLPATTERN_SOLID | [0] Solid
ANN_FILLPATTERN_BDIAGONAL | [1] Backward diagonal
ANN_FILLPATTERN_CROSS | [2] Cross
ANN_FILLPATTERN_DIAGCROSS | [3] Diagonal cross
ANN_FILLPATTERN_FDIAGONAL | [4] Forward diagonal
ANN_FILLPATTERN_HORIZONTAL | [5] Horizontal
ANN_FILLPATTERN_VERTICAL | [6] Vertical


hObject Parameter For AnnGetFontBold

hObject

Handle to the annotation object.


Return for AnnGetFontBold

Return Value

Value indicating whether the font is bold. Possible values are:

Value | Meaning
TRUE | The font is bold
FALSE | The font is not bold.


hObject Parameter For AnnGetFontItalic

hObject

Handle to the annotation object.


Return for AnnGetFontItalic

Return Value

Value indicating whether the font is italic. Possible values are:

Value | Meaning
TRUE | The font is italic
FALSE | The font is not italic.


Return for AnnGetFontName

Return Value

Character string that contains the name of the font used by the annotation object.


hObject Parameter For AnnGetFontName

hObject

Handle to the annotation object.


Return for AnnGetFontSize

Return Value

Current unscaled font size of the annotation object.


hObject Parameter For AnnGetFontSize

hObject

Handle to the annotation object.


hObject Parameter For AnnGetFontStrikeThrough

hObject

Handle to the annotation object.


Return for AnnGetFontStrikeThrough

Return Value

Value indicating whether the font has a strike-through. Possible values are:

Value | Meaning
TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.


hObject Parameter For AnnGetFontUnderline

hObject

Handle to the annotation object.


Return for AnnGetFontUnderline

Return Value

Value indicating whether the font has an underline. Possible values are:

Value | Meaning
TRUE | The font has an underline.
FALSE | The font does not have an underline.


hObject Parameter For AnnGetForeColor

hObject

Handle to the annotation object.


Return for AnnGetForeColor

Return Value

The annotation object's current foreground color.


Return for AnnGetGaugeLength

Return Value

Object's gauge length.

Length is expressed in pixels, not in points. The length is for the whole line, not just from the end point of the ruler to the end point of the gauge - it is from one end of the gauge to the other end of the gauge.


hObject Parameter For AnnGetGaugeLength

hObject

Handle to the annotation automation object.


hObject Parameter For AnnGetGrouping

hObject

Handle of the annotation object.


Return for AnnGetGrouping

Return Value

Return | Meaning
True | Grouping is enabled.
False | Grouping is not enabled.


hObject Parameter For AnnGetHyperlinkParam

hObject

Handle of the annotation object.


iParamIndex Parameter For AnnGetHyperlinkParam

iParamIndex

Index value indicating the parameter to get , valid values are 1, 2, 3, 4, 5.


Return for AnnGetHyperlinkParam

Return Value

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


hObject Parameter For AnnGetHyperlinkString

hObject

Handle of the annotation object.


Return for AnnGetHyperlinkString

Return Value

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


hObject Parameter For AnnGetHyperlinkType

hObject

Handle of the annotation object.


Return for AnnGetHyperlinkType

Return Value

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


hObject Parameter For AnnGetLineStyle

hObject

Handle to the annotation object.


Return for AnnGetLineStyle

Return Value

Annotation object's current line style. Possible line style values are:

Value | Meaning
ANN_LINE_SOLID | [0] Solid line
ANN_LINE_DASH | [1] Dashed line
ANN_LINE_DOT | [2] Dotted line
ANN_LINE_DASHDOT | [3] Dash dot line
ANN_LINE_DASHDOTDOT | [4] Dash dot dot line
ANN_LINE_NULL | [5] No line

Note:

Windows displays all lines greater than 1 pixel as solid.

To see the possible line styles, refer to Illustration of Line Styles for Annotations.


Return for AnnGetLineStyle

Return Value

Annotation object's current line width.


hObject Parameter For AnnGetLineWidth

hObject

Handle to the annotation object.


hObject Parameter For AnnGetLocked

hObject

Handle of the annotation object.


Return for AnnGetLocked

Return Value

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


hObject Parameter For AnnGetMetafile

hObject

Handle to the annotation object.


Return for AnnGetMetafile

Return Value

Handle to a metafile.


hObject Parameter For AnnGetNameOffsetX

hObject

Handle to the annotation object.


Return for AnnGetNameOffsetX

Return Value

X-offset of the name of the annotation object specified in hObject.


hObject Parameter For AnnGetNameOffsetY

hObject

Handle to the annotation object.


Return for AnnGetNameOffsetY

Return Value

Y- offset of the name of the annotation object specified in hObject.


hObject Parameter for AnnGetNameOptions

hObject

Handle of the annotation object


Return for AnnGetNameOptions

Return Value

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


hObject Parameter For AnnGetNameRestrict

hObject

Handle to the annotation object.


Return for AnnGetNameRestrict

Return Value

Return | Meaning
TRUE | The name of the specified annotation object is restricted.
FALSE | The name of the specified annotation object is not restricted.


hObject Parameter For AnnGetNodes

hObject

Handle of the annotation object.


Return for AnnGetNodes

Return Value

A value that represents the number of nodes to skip before displaying another node. Possible values are:

Value | Meaning
0 | Show every node.
1 | Show a node, skip a node, show a node …
. |
. |
. |
9 | Show a node, skip the next nine, …


bSelected Parameter For AnnGetObjectFromTag

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
VARIANT_TRUE | Process only the selected objects.
VAIRANT_FALSE | Process all objects.


hObject Parameter For AnnGetObjectFromTag

hObject

Handle to a container object.


lTag Parameter For AnnGetObjectFromTag

lTag

The long value used as the object's tag.


Return for AnnGetObjectFromTag

Return Value

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


Return for AnnGetOffsetX

Return Value

The annotation object's X offset.


hObject Parameter For AnnGetOffsetX

hObject

Handle to the annotation object.


Return for AnnGetOffsetY

Return Value

The annotation object's Y offset.


hObject Parameter For AnnGetOffsetY

hObject

Handle to the annotation object.


hObject Parameter For AnnGetPointCount

hObject

Handle to the annotation object.


Return for AnnGetPointCount

Return Value

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


hObject Parameter for AnnGetPointOptions

hObject

Handle of the annotation object.


Return for AnnGetPointOptions

Return Value

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


hObject Parameter For AnnGetPointX

hObject

Handle to the annotation object.


pVarPoint Parameter for AnnGetPointX

pVarPoint

Array of floating-point numbers for the X coordinates of the vertices (corner points) of the specified annotation object.


Return for AnnGetPointX

Return Value

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


hObject Parameter For AnnGetPointY

hObject

Handle to the annotation object.


pVarPoint Parameter For AnnGetPointY

pVarPoint

Array of floating-point numbers for the Y coordinates of the vertices (corner points) of the specified annotation object.


Return for AnnGetPointY

Return Value

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


hObject Parameter For AnnGetPolyFillMode

hObject

Handle to the annotation object.


Return for AnnGetPolyFillMode

Return Value

Value of the polygonal fill-mode constant. Possible fill mode values are:

Value | Meaning
ANN_POLYFILL_WINDING | [0] All pixels that are inside the resulting exterior lines are filled.
ANN_POLYFILL_ALTERNATE | [1] The filled area includes the area between odd-numbered and even-numbered polygon sides on each scan line.


Return for AnnGetPredefinedMetafile

Return Value

Handle to the retrieved metafile.


nType Parameter For AnnGetPredefinedMetafile

nType

Constant that indicates the metafile to retrieve. Possible values are:

Value | Meaning
ANN_METAFILE_APPROVED | [0] predefined metafile - APPROVED
ANN_METAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
ANN_METAFILE_CHECKED | [2] predefined metafile -CHECKED
ANN_METAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
ANN_METAFILE_COPY | [4] predefined metafile - COPY
ANN_METAFILE_DRAFT | [5] predefined metafile - DRAFT
ANN_METAFILE_EXTENDED | [6] predefined metafile - EXTENDED
ANN_METAFILE_FAX | [7] predefined metafile - FAX
ANN_METAFILE_FAXED | [8] predefined metafile - FAXED
ANN_METAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
ANN_METAFILE_INVOICE | [10] predefined metafile - INVOICE
ANN_METAFILE_NOTICE | [11] predefined metafile - NOTICE
ANN_METAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
ANN_METAFILE_ONFILE | [13] predefined metafile - ON FILE
ANN_METAFILE_PAID | [14] predefined metafile - PAID
ANN_METAFILE_PASSED | [15] predefined metafile - PASSED
ANN_METAFILE_PENDING | [16] predefined metafile - PENDING
ANN_METAFILE_PROCESSED | [17] predefined metafile - PROCESSED
ANN_METAFILE_RECEIVED | [18] predefined metafile - RECEIVED
ANN_METAFILE_REJECTED | [19] predefined metafile - REJECTED
ANN_METAFILE_RELEASE | [20] predefined metafile - RELEASE
ANN_METAFILE_SENT | [21] predefined metafile - SENT
ANN_METAFILE_SHIPPED | [22] predefined metafile - SHIPPED
ANN_METAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
ANN_METAFILE_URGENT | [24] predefined metafile - URGENT
ANN_METAFILE_VOID | [25] predefined metafile - VOID
ANN_METAFILE_HOTSPOT | [26] predefined metafile for Hotspot and Freehand Hotspot


Return for AnnGetProtractoroptions

Return Value

Character string containing the abbreviation string that follows the angle.


hObject Parameter For AnnGetProtractoroptions

hObject

Handle to the annotation object.


hObject Parameter For AnnGetRgnHandle

hObject

Handle to the annotation object from which the region will be created.


Return for AnnGetRgnHandle

Return Value

Handle to the region, if the method is successful.


hObject Parameter For AnnGetROP2

hObject

Handle to the annotation object.


Return for AnnGetROP2

Return Value

Constant that specifies the ROP2 code for one or more objects. ROP2 codes specify how pen or brush colors are to be combined with the colors in the image. Possible ROP2 code values are:

Value | Meaning
ANN_ROP2_COPY | [0x0000] Draw the object using the object's color
ANN_ROP2_AND | [0x0001] Draw the object, performing an AND operation using the object's color and the background color. This creates a highlight effect. White objects become transparent.
ANN_ROP2_XOR | [0x0002]Draw the object, performing an XOR operation using the object's color and the background color. This creates an inverted effect. Black objects become transparent.


Return for AnnGetScalarX

Return Value

Horizontal scaling factor.


hContainer Parameter For AnnGetScalarX

hContainer

Handle to the annotation object.


Return for AnnGetScalarY

Return Value

Vertical scaling factor.


hContainer Parameter For AnnGetScalarY

hContainer

Handle to the annotation object.


hObject Parameter For AnnGetSecondaryBitmap

hObject

Handle to the annotation object.


pRaster Parameter For AnnGetSecondaryBitmap

pRaster

ILEADRaster object in which the image is retrieved.


Return for AnnGetSecondaryBitmap

Return Value

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


hObject Parameter for AnnGetSecondaryMetaFile

hObject

Handle of the annotation object


Return for AnnGetSecondaryMetaFile

Return Values

Handle to the metafile.


Return for AnnGetSelectCount

Return Value

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


hObject Parameter For AnnGetSelected

hObject

Handle to the annotation object.


Return for AnnGetSelected

Return Value

Value indicating whether the annotation object is selected. Possible values are:

Value | Meaning
TRUE | The object is selected.
FALSE | The object is not selected.


pVarList Parameter for AnnGetSelectList

pVarList

An array of object handles for the currently selected annotation objects. If no objects are selected, this is an Empty LEADRasterVariant.


Return for AnnGetSelectList

Return Value

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


hObject Parameter For AnnGetShowFlags

hObject

Handle to the annotation object.


Return for AnnGetShowFlags

Return Value

Value that indicates how the rulers, cross-products, and protractors will be shown. Possible values are:

Value | Meaning
ANN_SHOW_NONE | Do not display the ruler length or the ruler gauge. In this case, the ruler looks like a line.
ANN_SHOW_LENGTH | Display the ruler length.
ANN_SHOW_GAUGE | Display the ruler gauge.
ANN_SHOW_TICMARKS_ | Display the tic marks.


hObject Parameter For AnnGetTag

hObject

Handle to the annotation object.


Return for AnnGetTagpnTag

Return Value

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


Return for AnnGetText

Return Value

Character string containing the annotation object's character string.


hObject Parameter For AnnGetText

hObject

Handle to the annotation object.


hObject Parameter For AnnGetTopContainer

hObject

Handle to the annotation object.


Return for AnnGetTopContainer

Return Value

Handle of the root container.


hObject Parameter For AnnGetTransparentColor

hObject

Handle to the annotation object.


Return for AnnGetTransparentColor

Return Value

COLORREF value of the transparent color.


hObject Parameter For AnnGetTransparent

hObject

Handle of the annotation object


Return for AnnGetTransparent

Return Value

Value indicating whether the bitmap is using a transparent color. Possible values are:

Value | Meaning
TRUE | The bitmap is using a transparent color.
FALSE | The bitmap is not using a transparent color.


hObject Parameter For AnnGetType

hObject

Handle to the annotation object.


Return for AnnGetType

Return Value

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


Return for AnnGetUnit

Return Value

Character string containing the unit abbreviation string to be displayed after the distance.


hObject Parameter For AnnGetUnit

hObject

Handle to the annotation automation object.


hObject Parameter For AnnGetUserData

hObject

handle of the object.


pData Parameter For AnnGetUserData

pData

ILEADRasterVariant Object that binary data is read into.


Return for AnnGetUserData

Return Value

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


hObject Parameter for AnnGetUserHandle

hObject

Handle of the annotation object


hObject Parameter for AnnGetUserHandles

hObject

Handle of the annotation object


Return for AnnGetUserHandle

Return Value

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


Return for AnnGetUserHandles

Return Value

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


uIndex Parameter for AnnGetUserHandle

uIndex

Index of the user handle to get. The index is zero based.


hObject Parameter For AnnGetVisible

hObject

Handle to an annotation object.


Return for AnnGetVisible

Return Value

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


hObject Parameter For AnnGetWnd

hObject

Handle to the annotation object.


Return for AnnGetWnd

Return Value

The annotation object's window handle.


hObject Parameter For AnnGroup

hObject

Handle to a container object.


iFlags Parameter For AnnGroup

iFlags

Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

Value | Meaning
0 | Process only the specified object.
ANN_FLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. To get a list of selected objects, use the AnnGetSelectList method.
ANN_FLAG_NOTTHIS | [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANN_FLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANN_FLAG_NOTCONTAINER | [0x0002] (Used with ANN_FLAG_RECURSE) Process objects within containers, not the containers themselves.
ANN_FLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANN_FLAG_CHECKMENU | [0x0020] Process objects only if the ANN_AUTOTEXT_MENU_GROUP menu item has been selected.
ANN_FLAG_USER | [0x0040] Group only those objects with users listed in pszUserList.


pszUserList Parameter For AnnGroup

pszUserList

String that contains the list of users associated with the specified object. pszUserList has the form "User1,User2,…,UserN". This must be a NULL terminated string with user names separated by a comma. This parameter is valid only if ANN_FLAG_USER is set in iFlags.


Return for AnnGroup

Return Value

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


hContainer Parameter for AnnHitTestExt

hContainer

Handle to the container object that sets the scope of the search.


ptX Parameter for AnnHitTestExt

ptX

X coordinate of the point to test. Coordinates are relative to the associated window's client area.


ptY Parameter for AnnHitTestExt

ptY

Y coordinate of the point to test. Coordinates are relative to the associated window's client area.


Return for AnnHitTestExt

Return Value

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


hContainer Parameter For AnnHitTest

hContainer

Handle to the container object that sets the scope of the search.


Return for AnnHitTest

Return Value

A value that indicates which part of the annotation object was found at the specified point. The following are possible values:

Value | Meaning
ANN_HIT_NONE | [0] No part of the annotation object was found at the specified point.
ANN_HIT_BODY | [1] The annotation body was found at the specified point.
ANN_HIT_HANDLE | [2] The annotation handle was found at the specified point.
ANN_HIT_NAME | [3] The annotation name was found at the specified point.


x Parameter For AnnHitTest

x

X-coordinate of the point to test. The unit of measure is determined by the ScaleMode property.


y Parameter For AnnHitTest

y

Y-coordinate of the point to test. The unit of measure is determined by the ScaleMode property.


hObject Parameter For AnnHyperlink

hObject

Handle of the annotation object.


iParamCount Parameter For AnnHyperlink

iParamCount

Number of valid parameters. Possible values are 0 or 5. If iParamCount is 5, then lParam1, lParam2, lParam3, lParam4 and lParam5 are valid, otherwise they are undefined and should be ignored.


lParam1 Parameter For AnnHyperlink

lParam1

First parameter. This parameter is only valid if iParamCount is set to 5.


lParam2 Parameter For AnnHyperlink

lParam2

Second parameter. This parameter is only valid if iParamCount is set to 5.


lParam3 Parameter For AnnHyperlink

lParam3

Third parameter. This parameter is only valid if iParamCount is set to 5.


lParam4 Parameter For AnnHyperlink

lParam4

Fourth parameter. This parameter is only valid if iParamCount is set to 5.


lParam5 Parameter For AnnHyperlink

lParam5

Fifth parameter. This parameter is only valid if iParamCount is set to 5.


aObjects Parameter For AnnHyperlinkMenu

aObjects

Pointer to an array of selected objects.


uCount Parameter For AnnHyperlinkMenu

uCount

Number of objects in aObjects.


bStripContainer Parameter For AnnInsert

bStripContainer

Flag that indicates whether to insert a container. Possible values are:

Value | Meaning
VARIANT_TRUE | If the hObject parameter specifies a container, only the objects in the container will be inserted into the new container. In this case, the container specified in hObject is destroyed.
VARIANT_FALSE | If the hObject parameter specifies a container, the container and all objects within the container (objects and other containers ) will be inserted into the new container.
 | If the hObject parameter specifies an object, that object will be inserted into the new container.


hContainer Parameter For AnnInsert

hContainer

Handle to the container object.


hObject Parameter For AnnInsert

hObject

Handle to the annotation object to insert.


Return for AnnInsert

Return Value

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


Return for AnnInsertTokenTable

Return Value

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


Bottom Parameter For AnnIsFixedRect

Bottom

Bottom boundary of the rectangle representing the client area of a window.


hObject Parameter For AnnIsFixedRect

hObject

Handle to the annotation object for which to get or set this property.


Left Parameter For AnnIsFixedRect

Left

Left boundary of the rectangle representing the client area of a window.


Right Parameter For AnnIsFixedRect

Right

Right boundary of the rectangle representing the client area of a window.


Top Parameter For AnnIsFixedRect

Top

Top boundary of the rectangle representing the client area of a window.


lPage Parameter For AnnLoadArray

lPage

Page number. If vMem refers to a multipage-TIF file, lPage refers to the page in the TIF file from which to load the annotations. If vMem refers to an annotation file, lPage refers to one of the pages in the annotation file.


lSize Parameter For AnnLoadArray

lSize

Size of the data stored in vMem.


vMem Parameter For AnnLoadArray

pvMem

An ILEADRasterVariant byte array object that contains the the annotations to be loaded.


Return for AnnLoadArray

Return Value

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


hMem Parameter For AnnLoadMemory

hMem

A global handle (HGLOBAL) to the file in memory. If you use the AnnSaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


IPage Parameter For AnnLoadMemory

lPage

Page number. If hMem refers to a multipage-TIF file, lPage refers to the page in the TIF file from which to load the annotations. If hMem refers to an annotation file, lPage refers to one of the pages in the annotation file.


iSize Parameter For AnnLoadMemory

nSize

The size in bytes of the file referenced by hMem. If you use the AnnSaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


Return for AnnLoadMemory

Return Value

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


lPage Parameter For AnnLoad

nPage

Page number, in a multi-page TIF file, from which to load the annotations. For example, if iPage is 2, the annotations on page 2 of the file will be loaded.


pszFile Parameter For AnnLoad

pszFile

Character string containing the name of the file from which to load the annotations.


Return for AnnLoad

Return Value

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


bSelected Parameter For AnnLock

bSelected

If hObject is a container object, bSelected indicates whether all or only selected annotation objects will be locked. If bSelected is VARIANT_TRUE, only selected annotation objects will be locked. If bSelected is VARIANT_FALSE, all annotation objects will be locked.


hAnnObject Parameter For AnnLocked

hAnnObject

Handle to the annotation object.


hObject Parameter For AnnLock

hObject

Handle of the annotation object.


pszKey Parameter For AnnLock

pszKey

String containing the key used to lock the annotation objects.


Return for AnnLock

Return Value

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


hDC Parameter For AnnMagGlass

hDC

Handle to the magnifying glass device context (DC) in which the annotation objects will be drawn.


lMagHeight Parameter For AnnMagGlass

lMagHeight

Value that represents the height of the magnifying glass. This value is with respect to the image on which the annotations are drawn.


lMagWidth Parameter For AnnMagGlass

lMagWidth

Value that represents the width of the magnifying glass. This value is with respect to the image on which the annotations are drawn.


lMagXPos Parameter For AnnMagGlass

lMagXPos

X coordinate of the position of the magnifying glass. This value is with respect to the image on which the annotations are drawn.


lMagYPos Parameter For AnnMagGlass

lMagYPos

Y coordinate of the position of the magnifying glass. This value is with respect to the image on which the annotations are drawn.


nZoom Parameter For AnnMagGlass

nZoom

Value that indicates the magnification/zoom factor, in percent. This value must be >= 100. For example, to zoom the annotation object(s) 2X, specify 200 for nZoom.


Return for AnnMagGlass

Return Value

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


hMenu Parameter For AnnMenu

hMenu

References the menu that will be displayed.


Button Parameter For AnnMouseDown

Button

An integer that identifies the button that was pressed to cause the event. Possible values are:

Value | Meaning
1 | left button


Shift Parameter For AnnMouseDown

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. Possible values are:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For AnnMouseDown

x

The X coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


y Parameter For AnnMouseDown

y

The Y coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


Button Parameter For AnnMouseMove

Button

An integer that identifies any buttons pressed when the user moved the mouse. Possible values are:

Value | Meaning
0 | no button was pressed
1 | left button
2 | right button


Shift Parameter For AnnMouseMove

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. Possible values are:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For AnnMouseMove

x

The X coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


y Parameter For AnnMouseMove

y

The Y coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


Button Parameter For AnnMouseUp

Button

An integer that identifies the button that was released to cause the event. Possible values are:

Value | Meaning
1 | left button


Shift Parameter For AnnMouseUp

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is released. Possible values are:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For AnnMouseUp

x

The X coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


y Parameter For AnnMouseUp

y

The Y coordinate of the mouse pointer. This is a client coordinate and it depends on the ScaleMode property. If scroll bars are present, they are not taken into consideration.


bSelected Parameter For AnnMove

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Move only the selected object or objects.
VARIANT_FALSE | Move all annotation objects.


dxOffset Parameter For AnnMove

dxOffset

Amount to move the annotation objects horizontally (in the X direction).


dyOffset Parameter For AnnMove

dyOffset

Amount to move the annotation objects vertically (in the Y direction).


Return for AnnMove

Return Value

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


hObject Parameter For AnnNameBoundingRectHeight

hObject

Handle to the annotation object.


hObject Parameter For AnnNameBoundingRectLeftproperty

hObject

Handle to the annotation object.


hObject Parameter For AnnNameBoundingRectTop

hObject

Handle to the annotation object.


hObject Parameter For AnnNameBoundingRectWidth

hObject

Handle to the annotation object.


y Parameter For AnnNameRectHeight

hObject

Handle to the annotation object.


hObject Parameter For AnnNameRectLeft

hObject

Handle to the annotation object.


hObject Parameter For AnnNameRectTop

hObject

Handle to the annotation object.


hObject Parameter For AnnNameRectWidth

hObject

Handle to the annotation object.


pRasterView parameter For AnnParentRasterView

pRasterView

IDispatch to a LEAD RasterView control.


pVal parameter For AnnPasteReady

pVal

Variable to be updated with a value that indicates whether the Windows clipboard contains valid annotation data for pasting. Possible values are:

Value | Meaning
VARIANT_TRUE | The clipboard contains annotations that can be pasted.
VARIANT_FALSE | The clipboard does not contain annotations that can be pasted.


Return for AnnPaste

Return Value

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


hObject Parameter for AnnPopFixedState

hObject

Handle of the annotation object.


Return for AnnPopFixedState

Return Value

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


uType Parameter for AnnPredefinedRaster

uType

Value that indicates the bitmap to retrieve. Possible values are:

Value | Meaning
ANN_BITMAP_POINT | [0] Predefined metafile for an annotation point object.


hObject Parameter for AnnPushFixedState

hObject

Handle of the annotation object.


Return for AnnPushFixedState

Return Value

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


fRedactOnly Parameter For AnnRealize

bRedactOnly

One of the following values:

Value | Meaning
VARIANT_TRUE | Realize only redaction objects.
VARIANT_FALSE | Realize all annotation objects.


Return for AnnRealize

Return Value

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


hObject Parameter For AnnRectHeight

hObject

Handle to the annotation object.


hObject Parameter For AnnRectLeft

hObject

Handle to the annotation object.


hObject Parameter For AnnRectTop

hObject

Handle to the annotation object.


hObject Parameter For AnnRectWidth

hObject

Handle to the annotation object.


hObject Parameter For AnnRemove

hObject

Handle to the annotation object.


Return for AnnRemove

Return Value

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


bottom Parameter for AnnRestrictCursor

bottom

Value that represents the bottom boundary of the rectangle within which the cursor is restricted .


bRestrictClient Parameter for AnnRestrictCursor

bRestrictClient

Flag that specifies whether the cursor is restricted to the client window. Possible values are:

Value | Meaning
VARIANT_TRUE | Restrict the cursor to the client window.
VARIANT_FALSE | Do not restrict the cursor to the client window.


hContainer Parameter for AnnRestrictCursor

hContainer

Handle to the container object.


left Parameter for AnnRestrictCursor

left

Value that represents the left boundary of the rectangle within which the cursor is restricted.


ptX Parameter for AnnRestrictCursor

ptX

The X coordinate of the point around which the rectangle is centered.


ptY Parameter for AnnRestrictCursor

ptY

The Y coordinate of the point around which the rectangle is centered.


right Parameter for AnnRestrictCursor

right

Value that represents the right boundary of the rectangle within which the cursor is restricted .


Return for AnnRestrictCursor

Return Value

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


top Parameter for AnnRestrictCursor

top

Value that represents the top boundary of the rectangle within which the cursor is restricted .


bSelected Parameter For AnnReverse

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Reverse only the selected objects.
VARIANT_FALSE | Reverse all of the annotation objects.


bUseVert Parameter For AnnReverse

bUseVert

One of the following values:

Value | Meaning
VARIANT_TRUE | Reverse all objects on the axis specified by the fVert parameter.
VARIANT_FALSE | Reverse each object on its own center.


fVert Parameter For AnnReverse

fVert

The vertical axis (X value) on which the objects are reversed. This value is used only if the bUseVert parameter is VARIANT_TRUE.

The position is relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.


Return for AnnReverse

Return Value

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


AnnRotateAngle Parameter For hObject

hObject

Handle of the annotation object for which to get the rotation angle.


bSelected Parameter For AnnRotate

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Rotate only the selected objects.
VARIANT_FALSE | Rotate all of the annotation objects.


bUseCenter Parameter For AnnRotate

bUseCenter

One of the following values:

Value | Meaning
VARIANT_TRUE | Rotate all objects around the point specified by the fCenterX and fCenterY parameters.
VARIANT_FALSE | Rotate each object on its own center.


fAngle Parameter For AnnRotate

fAngle

The number of degrees to rotate the objects, expressed as a floating point value.


fCenterX Parameter For AnnRotate

fCenterX

The X coordinate of the point around which the objects are rotated. This value is used only if the bUseCenter parameter is VARIANT_TRUE.

The position is relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.


fCenterY Parameter For AnnRotate

fCenterY

The Y coordinate of the point around which the objects are rotated. This value is used only if the bUseCenter parameter is VARIANT_TRUE.

The position is relative to the bitmap in the control. The unit of measure is determined by the ScaleMode property.


Return for AnnRotate

Return Value

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


hObject Parameter For AnnRTFText

hObject

Handle to the annotation object for which to get or set this property.


uFormat Parameter For AnnRTFText

uFormat

Value that specifies the text format type. Possible values are:

Value | Meaning
RTF_FORMAT_TEXT | [0x0001] Retrieve the text as unformatted text.
RTF_FORMAT_RTF | [0x0002] Retrieve the text as rich text.


bSelected Parameter For AnnSaveArray

bSelected

Flag that indicates which objects to save. Possible values are:

Value | Meaning
VARIANT_TRUE | Save only the selected objects.
VARIANT_FALSE | Save all of the annotation objects.


iFormat Parameter For AnnSaveArray

iFormat

Value that indicates the format to use when saving the annotations.

Value | Meaning
ANN_FMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
ANN_FMT_WMF | [0x0001] Use the Windows WMF format.
ANN_FMT_TIFFTAG | [0x0002] Save all annotation properties, including those not supported by the Wang specification as an ANNTAG_TIFF tag.
ANN_FMT_WANGTAG | [0x0003] Save only the annotation properties supported by the Wang specification as an ANNTAG_TIFF tag.
ANN_FMT_ENCODED | [0x0004] Use a binary format for saving annotations. The file size is smaller, and it provides greater security.
ANN_FMT_XML | [0x0005] Save as an XML text format. This is LEAD’s new text based format which is upward-compatible. It should be used instead of ANN_FMT_NATIVE.


iModify Parameter for AnnSaveArray

iModify

Flag that indicates how to save a new page in a multipage annotation file. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
SAVE_APPEND | [1] The page is appended if the file exists.
SAVE_REPLACE | [2] Replace the page specified in the lSavePage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the lSavePage parameter.


IsavePage Parameter for AnnSaveArray

lSavePage

Number of the page to overwrite, append, replace, or insert, based on the iModify parameter. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, etc.


pVarArray Parameter for AnnSaveArray

pVarArray

An ILEADRasterVariant byte array object that contains the file in memory.


Return for AnnSaveArray

Return Value

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


bSelected Parameter For AnnSave

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Save only the selected objects.
VARIANT_FALSE | Save all of the annotation objects.


iFormat Parameter For AnnSave

iFormat

One of the following values:

Value | Meaning
ANN_FMT_NATIVE | Use LEAD's own format for annotations.
ANN_FMT_WMF | Use the Windows WMF format.


iModify Parameter For AnnSave

iModify

Flag that indicates how to save a new page in a multipage annotation file. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
SAVE_APPEND | [1] The page is appended if the file exists.
SAVE_REPLACE | [2] Replace the page specified in the lSavePage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the lSavePage parameter.


ISavePage Parameter For AnnSave

lSavePage

Number of the page to overwrite, append, replace, or insert, based on the iModify parameter. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, etc.


bSelected Parameter For AnnSaveMemory

bSelected

One of the following values:

Value | Meaning
VARIANT_TRUE | Save only the selected objects.
VARIANT_FALSE | Save all of the annotation objects.


iFormat Parameter For AnnSaveMemory

iFormat

One of the following values:

Value | Meaning
ANN_FMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANN_FMT_XML.
ANN_FMT_WMF | [0x0001] Use the Windows WMF format.
ANN_FMT_TIFFTAG | [0x0002] Save all annotation properties, including those not supported by the Wang specification as an ANN_TAG_TIFF tag.
ANN_FMT_WANGTAG | [0x0003] Save only the annotation properties supported by the Wang specification as an ANNTAG_TIFF tag.
ANN_FMT_ENCODED | [0x0004] Use a binary format for saving annotations. The file size is smaller, and it provides greater security.
ANN_FMT_XML | [0x0005] Save as an XML text format. This is LEAD’s new text based format which is upward compatible. It should be used instead of ANN_FMT_NATIVE.


iModify Parameter For AnnSaveMemory

iModify

Flag that indicates how to save a new page in a multipage annotation file. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
SAVE_APPEND | [1] The page is appended if the file exists.
SAVE_REPLACE | [2] Replace the page specified in the lSavePage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the lSavePage parameter.


lSavePage Parameter For AnnSaveMemory

lSavePage

Number of the page to overwrite, append, replace, or insert, based on the iModify parameter. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, etc.


phMem Parameter For AnnSaveMemory

phMem

Address of the long variable that you use to reference the file in memory. In C++, you declare the variable and pass its address. In most other languages, you pass the variable by reference. The method updates the value of the variable. The variable must be a global handle (HGLOBAL) and must be declared with the appropriate data type. To see the correct data type, refer to the code example for your development system.


pnSize Parameter For AnnSaveMemory

pnSize

Address of the long integer variable that you use to track the size of the file in memory. In C++, you declare the variable and pass its address. In most other languages, you pass the variable by reference. The method updates the value of the variable. The variable must be declared with the appropriate data type. To see the correct data type, refer to the code example for your development system.


Return for AnnSaveMemory

Return Value

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


pszFile Parameter For AnnSave

pszFile

A character string that specifies the file to save.


Return for AnnSave

Return Value

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


bSelected Parameter For AnnSaveTag

bSelected

A VARIANT_BOOL value indicating whether to save all objects within a container or only selected objects. If bSelected is VARIANT_TRUE, only selected annotation objects will be saved. If bSelected is VARIANT_FALSE, all annotation objects are saved.


fWangMode Parameter For AnnSaveTag

bWangMode

A VARIANT_BOOL value indicating whether to save annotations in a WANG compatible TIFF tag, or in the LEAD format.


pRasterIO Parameter For AnnSaveTag

pRasterIO

A pointer to the RasterIO object, created when the tag is saved.


Return for AnnSaveTag

Return Value

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


aObjects Parameter For AnnSelect

aObjects

Array of annotation object handles.


hContainer Parameter For AnnSelectPoint

hContainer

Handle to the annotation container object.


Return for AnnSelectPoint

Return Value

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


x Parameter For AnnSelectPoint

x

X coordinate of the point. The unit of measure is determined by the ScaleMode property.


y Parameter For AnnSelectPoint

y

Y coordinate of the point. The unit of measure is determined by the ScaleMode property.


bottom Parameter For AnnSelectRect

bottom

Bottom boundary of selection rectangle. The unit of measure is determined by the ScaleMode property.


hContainer Parameter For AnnSelectRect

hContainer

Handle to the annotation object.


hContainer Parameter For AnnSelectRectHeight

hContainer

Handle to the annotation container object.


left Parameter For AnnSelectRect

left

Left boundary of selection rectangle. The unit of measure is determined by the ScaleMode property.


hContainer Parameter For AnnSelectRectLeft

hContainer

Handle to the annotation container object.


right Parameter For AnnSelectRect

right

Right boundary of selection rectangle. The unit of measure is determined by the ScaleMode property.


Return for AnnSelectRect

Return Value

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


top Parameter For AnnSelectRect

top

Top boundary of selection rectangle. The unit of measure is determined by the ScaleMode property.


hContainer Parameter For AnnSelectRectTop

hContainer

Handle to the annotation container object.


hContainer Parameter For AnnSelectRectWidth

hContainer

Handle to the annotation container object.


uCount Parameter For AnnSelect

uCount

Number of selected annotation objects.


hObject Parameter For AnnSendToBack

hObject

Handle to the annotation object.


Return for AnnSendToBack

Return Value

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


crBack Parameter For AnnSetAutoBackColor

crBack

The COLORREF value that specifies the background color.


hObject Parameter For AnnSetAutoBackColor

hObject

Handle to the annotation object.


iType Parameter For AnnSetAutoBackColor

iType

Type of object for which to change the background color. For a list of possible values, refer to Types of Annotations.


Return for AnnSetAutoBackColor

Return Value

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


hObject Parameter For AnnSetAutoDefaults

hObject

Handle to the annotation object.


iFlags Parameter For AnnSetAutoDefaults

iFlags

Flag that indicates the objects to process. Use 0 if hObject is not a container.

If hObject is a container, you can use 0 (process only hObject), or you can combine some of the values given below, using a bitwise OR. For example, ANN_FLAG_SELECTED | ANN_FLAG_RECURSE processes only the selected objects.

Value | Meaning
ANN_FLAG_SELECTED | [0x0001] Enumerate only the selected objects.
ANN_FLAG_NOTCONTAINER | [0x0002] Enumerate all objects that are not containers.
ANN_FLAG_NOTTHIS | [0x0003] Enumerate all objects except hObject.
ANN_FLAG_RECURSE | [0x0004] Enumerate all objects contained in hObject and any contained in any sub-containers.


Return for AnnSetAutoDefaults

Return Value

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


hObject Parameter For AnnSetAutoMenuItemEnable

hObject

Handle to the annotation object.


iEnable Parameter For AnnSetAutoMenuItemEnable

iEnable

Flag that indicates whether to enable or disable the specified item. Possible values are:

Value | Meaning
ANN_MENU_ENABLED | Enable the menu item.
ANN_MENU_DISABLED | Disable the menu item.
ANN_MENU_DEFAULT | Enable or disable the menu item, based on the setting for the object type.


iFlags Parameter For AnnSetAutoMenuItemEnable

iFlags

Flag that indicates the objects to process. Use 0 if hObject is not a container.

If hObject is a container, you can use 0 (process only hObject), or you can combine some of the values given below, using a bitwise OR. For example, ANN_FLAG_SELECTED | ANN_FLAG_RECURSE processes only the selected objects.

Value | Meaning
ANN_FLAG_SELECTED | [0x0001] Process only the selected objects.
ANN_FLAG_NOTCONTAINER | [0x0002] Process all objects that are not containers.
ANN_FLAG_NOTTHIS | [0x0003] Process all objects except hObject.
ANN_FLAG_RECURSE | [0x0004] Process all objects contained in hObject and any contained in any sub-containers.
ANN_FLAG_USER | [0x0040] Process only those objects with users listed in pszUserList.


iItem Parameter For AnnSetAutoMenuItemEnable

iItem

Constant that specifies the menu or dialog box item to enable or disable. For lists of constants and their default values, refer to the following:

Annotation Automation Menu Strings

Annotation Automation Line Dialog Strings

Annotation Automation Fill Dialog Strings

Annotation Automation Text Dialog Strings

Annotation Automation Audio Dialog Strings

Annotation Automation Stamp Dialog Strings

Annotation Automation ROP2 Dialog Strings

Annotation Automation Lock/Unlock Dialog Strings

Annotation Automation Miscellaneous Dialog Strings

Annotation Automation Ruler Dialog Strings

Annotation Automation Point Dialog Strings

Annotation Automation Push Pin Dialog Strings

Annotation Automation Nodes Dialog Strings

Annotation Automation Protractor Dialog Strings

Annotation Automation Name Dialog Strings

Annotation Automation Stamp Metafile Dialog Strings

Annotation Automation ToolTip Dialog Strings

Annotation Automation Transparent Color Dialog Strings

Annotation Automation Capture Dialog Strings


iType Parameter For AnnSetAutoMenuItemEnable

iType

Constant that specifies an object's type. If hObject is an automation object, the specified menu item for all objects of type iType will be enabled or disabled. For descriptions of possible object types, refer to Types of Annotations.


pszUserList Parameter For AnnSetAutoMenuItemEnable

pszUserList

String that contains the list of users associated with the specified object. pszUserList has the form "User1,User2,…,UserN". This must be a NULL terminated string with user names separated by a comma. This parameter is valid only if ANN_FLAG_USER is set in iFlags.


Return for AnnSetAutoMenuItemEnable

Return Value

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


iItem Parameter For AnnSetAutoText

iItem

Constant that specifies the menu or dialog box item, which appears when the user presses the right mouse button. For lists of constants and their default values, refer to the following:

Annotation Automation Menu Strings

Annotation Automation Line Dialog Strings

Annotation Automation Fill Dialog Strings

Annotation Automation Text Dialog Strings

Annotation Automation Audio Dialog Strings

Annotation Automation Stamp Dialog Strings

Annotation Automation Lock/Unlock Dialog Strings

Annotation Automation Miscellaneous Dialog Strings

Annotation Automation ROP2 Dialog Strings

Annotation Automation Ruler Dialog Strings

Annotation Automation Point Dialog Strings

Annotation Automation Push Pin Dialog Strings

Annotation Automation Nodes Dialog Strings

Annotation Automation Protractor Dialog Strings

Annotation Automation Name Dialog Strings

Annotation Automation Stamp Metafile Dialog Strings

Annotation Automation ToolTip Dialog Strings

Annotation Automation Transparent Color Dialog Strings

Annotation Automation Capture Dialog Strings


pszText Parameter For AnnSetAutoText

pszText

The text string to use for the specified item.


Return for AnnSetAutoText

Return Value

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


bSelected Parameter For AnnSetBackColor

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetBackColor

hObject

Handle to the annotation object.


Return for AnnSetBackColor

Return Value

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


bSelected Parameter For AnnSetBitmap

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


bSelected Parameter For AnnSetBitmapDpiX

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fBitmapX Parameter For AnnSetBitmapDpiX

fBitmapDpix

The horizontal DPI value to set. Valid values are greater than or equal to 1.

If 0 or a positive value less than 1 is passed, the value will default to 150. If a negative value is passed, the method will return an error.


hObject Parameter For AnnSetBitmapDpiX

hObject

Handle to the annotation automation object.


Return for AnnSetBitmapDpiX

Return Value

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


bSelected Parameter For AnnSetBitmapDpiY

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fBitmapDpiY Parameter For AnnSetBitmapDpiY

fBitmapDpiY

The vertical DPI value to set. Valid values are greater than or equal to 1.

If 0 or a positive value less than 1 is passed, the value will default to 150. If a negative value is passed, the method will return an error.


hObject Parameter For AnnSetBitmapDpiY

hObject

Handle to the annotation automation object.


Return for AnnSetBitmapDpiY

Return Value

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


hObject Parameter For AnnSetBitmap

hObject

Handle to the annotation object.


pRaster Parameter For AnnSetBitmap

pRaster

ILEADRaster object that contains the bitmap to assign to the specified object.


Return for AnnSetBitmap

Return Value

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


hObject Paremeter for AnnSetEncryptOptions

hObject

Handle of the annotation object


Return for AnnSetEncryptOptions

Return Value

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


bSelected Parameter For AnnSetFillMode

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFillMode

hObject

Handle to the annotation object.


nFillMode Parameter For AnnSetFillMode

nFillMode

The constant that specifies the object's fill mode. Possible fill mode values are:

Value | Meaning
ANN_FILLMODE_TRANSPARENT | [0] Transparent
ANN_FILLMODE_TRANSLUCENT | [1] Translucent
ANN_FILLMODE_OPAQUE | [2] Opaque

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.


Return for AnnSetFillMode

Return Value

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


bSelected Parameter For AnnSetFillPattern

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFillPattern

hObject

Handle to the annotation object.


nFillPattern Parameter For AnnSetFillPattern

nFillPattern

The constant that specifies the fill pattern. Possible fill pattern values are:

Value | Meaning
ANN_FILLPATTERN_SOLID | [0] Solid
ANN_FILLPATTERN_BDIAGONAL | [1] Backward diagonal
ANN_FILLPATTERN_CROSS | [2] Cross
ANN_FILLPATTERN_DIAGCROSS | [3] Diagonal cross
ANN_FILLPATTERN_FDIAGONAL | [4] Forward diagonal
ANN_FILLPATTERN_HORIZONTAL | [5] Horizontal
ANN_FILLPATTERN_VERTICAL | [6] Vertical

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.


Return for AnnSetFillPattern

Return Value

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


bFontBold Parameter For AnnSetFontBold

bFontBold

Flag that indicates whether to make the font bold. Possible values are:

Value | Meaning
TRUE | Make the font bold
FALSE | Make the font not bold.


bSelected Parameter For AnnSetFontBold

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFontBold

hObject

Handle to the annotation object.


Return for AnnSetFontBold

Return Value

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


bFontItalic Parameter For AnnSetFontItalic

bFontItalic

Flag that indicates whether to make the font italic. Possible values are:

Value | Meaning
TRUE | Make the font italic
FALSE | Make the font not italic.


bSelected Parameter For AnnSetFontItalic

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFontItalic

hObject

Handle to the annotation object.


Return for AnnSetFontItalic

Return Value

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


bSelected Parameter For AnnSetFontName

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFontName

hObject

Handle to the annotation object.


pszFileName Parameter For AnnSetFontName

pszFontName

The character string containing the name of the font to assign.


Return for AnnSetFontName

Return Value

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


bSelected Parameter For AnnSetFontSize

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fFontSize Parameter For AnnSetFontSize

fFontSize

The font size to set, expressed as an unscaled value relative to the container.


hObject Parameter For AnnSetFontSize

hObject

Handle to the annotation object.


Return for AnnSetFontSize

Return Value

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


bFontStrikeThrough Parameter For AnnSetFontStrikeThrough

bFontStrikeThrough

Flag that indicates whether to apply or remove the strike-through. Possible values are:

Value | Meaning
TRUE | Apply a strike-through
FALSE | Remove the strike-through.


bSelected Parameter For AnnSetFontStrikeThrough

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFontStrikeThrough

hObject

Handle to the annotation object.


Return for AnnSetFontStrikeThrough

Return Value

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


bFontUnderline Parameter For AnnSetFontUnderline

bFontUnderline

Flag that indicates whether to apply or remove an underline. Possible values are:

Value | Meaning
TRUE | Underline the text.
FALSE | Remove the underline from the text.


bSelected Parameter For AnnSetFontUnderline

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetFontUnderline

hObject

Handle to the annotation object.


Return for AnnSetFontUnderline

Return Value

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


bSelected Parameter For AnnSetForeColor

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


ForeColor Parameter For AnnSetForeColor

ForeColor

The COLORREF value that specifies the foreground color.


hObject Parameter For AnnSetForeColor

hObject

Handle to the annotation object.


Return for AnnSetForeColor

Return Value

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


bSelected Parameter For AnnSetGaugeLength

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fGaugeLength Parameter For AnnSetGaugeLength

fGaugeLength

The new length of the ruler object's gauge.


hObject Parameter For AnnSetGaugeLength

hObject

Handle to the annotation automation object.


Return for AnnSetGaugeLength

Return Value

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


bAutoGroup Parameter For AnnSetGrouping

bAutoGroup

Flag that indicates whether or not to group the objects in a container. Possible values are:

Value | Meaning
TRUE | All objects in the container are to be grouped.
FALSE | Each object in the container can be modified and selected


hObject Parameter For AnnSetGrouping

hObject

Handle of the annotation object.


iFlags Parameter For AnnSetGrouping

iFlags

Flag that indicates the objects to process. Possible values are:

Value | Meaning
ANN_FLAG_SELECTED | [0x0001] Enumerate only the selected objects.
ANN_FLAG_NOTCONTAINER | [0x0002] Enumerate all objects that are not containers.
ANN_FLAG_NOTTHIS | [0x0003] Enumerate all objects except hObject.
ANN_FLAG_RECURSE | [0x0004] Enumerate all objects contained in hObject and any contained in any sub-containers,
ANN_FLAG_USER | [0x0040] Process only those objects with users listed in pszUserList.


Return For AnnSetGrouping

Return Value

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


hObject Parameter For AnnSetHyperlinkMsg

hObject

Handle of the annotation object.


uType Parameter For AnnSetHyperlinkMsg

iType

Value indicates the type of hyperlink. Possible values are:

Value | Meaning
ANN_LINK_NONE | (0) means that the object has no hyperlink
ANN_LINK_ANNEVENT | (1) means that the OnAnnHyperlink event will be sent with no parameters
ANN_LINK_ANNEVENT5 | (2) means that the OnAnnHyperlink event will be sent with 5 parameters


lParam1 Parameter For AnnSetHyperlinkMsg

lParam1

First parameter to the OnAnnHyperlink event.


lParam2 Parameter For AnnSetHyperlinkMsg

lParam2

Second parameter to the OnAnnHyperlink event.


lParam3 Parameter For AnnSetHyperlinkMsg

lParam3

Third parameter to the OnAnnHyperlink event.


lParam4 Parameter For AnnSetHyperlinkMsg

lParam4

Fourth parameter to the OnAnnHyperlink event.


lParam5 Parameter For AnnSetHyperlinkMsg

lParam5

Fifth parameter to the OnAnnHyperlink event.


Return for AnnSetHyperlinkMsg

Return Value

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


hObject Parameter For AnnSetHyperlinkString

hObject

Handle of the annotation object.


uType Parameter For AnnSetHyperlinkString

iType

Value indicating the type of hyperlink set. Possible values are:

Value | Meaning
ANN_LINK_NONE | (0) means that the object has no hyperlink
ANN_LINK_RUN | (3) that a program will be run
ANN_LINK_WEBPAGE | (4) that the default browser will be instructed to go to the specified web page.


pszHyperlink Parameter For AnnSetHyperlinkString

pszHyperlink

String containing the name of a program, with all required command line parameters, or the URL of a web page. For uType 3, pszHyperlink is the program to run with its command line parameters. For uType 4, pszHyperlink is the web URL. If you have a web page link, the default web browser will be run and instructed to go to that web page.


Return for AnnSetHyperlinkString

Return Value

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


bSelected Parameter For AnnSetLineStyle

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetLineStyle

hObject

Handle to the annotation object.


nLineStyle Parameter For AnnSetLineStyle

nLineStyle

The constant that specifies the line style. Possible line style values are:

Value | Meaning
ANN_LINE_SOLID | [0] Solid line
ANN_LINE_DASH | [1] Dashed line
ANN_LINE_DOT | [2] Dotted line
ANN_LINE_DASHDOT | [3] Dash dot line
ANN_LINE_DASHDOTDOT | [4] Dash dot dot line
ANN_LINE_NULL | [5] No line

Note:

Windows displays all lines greater than 1 pixel as solid.

To see the possible line styles, refer to Illustration of Line Styles for Annotations.


Return for AnnSetLineStyle

Return Value

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


bSelected Parameter For AnnSetLineWidth

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fLineWidth Parameter For AnnSetLineWidth

fLineWidth

The unscaled line width of an object, relative to its container object. The width is interpreted using the container's scaling factors, which are described in Low-Level Coordinate System for Annotations.


hObject Parameter For AnnSetLineWidth

hObject

Handle to the annotation object.


Return for AnnSetLineWidth

Return Value

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


bSelected Parameter For AnnSetMetafile

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hMetafile Parameter For AnnSetMetafile

hMetafile

Handle to a metafile.


hObject Parameter For AnnSetMetafile

hObject

Handle to the annotation object.


nType Parameter For AnnSetMetafile

nType

Constant that indicates the metafile to set. Possible values are:

Value | Meaning
ANN_METAFILE_USER | [0x7FFF] user-defined metafiles
ANN_METAFILE_APPROVED | [0] predefined metafiles - APPROVED
ANN_METAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
ANN_METAFILE_CHECKED | [2] predefined metafile -CHECKED
ANN_METAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
ANN_METAFILE_COPY | [4] predefined metafile - COPY
ANN_METAFILE_DRAFT | [5] predefined metafile - DRAFT
ANN_METAFILE_EXTENDED | [6] predefined metafile - EXTENDED
ANN_METAFILE_FAX | [7] predefined metafile - FAX
ANN_METAFILE_FAXED | [8] predefined metafile - FAXED
ANN_METAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
ANN_METAFILE_INVOICE | [10] predefined metafile - INVOICE
ANN_METAFILE_NOTICE | [11] predefined metafile - NOTICE
ANN_METAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
ANN_METAFILE_ONFILE | [13] predefined metafile - ON FILE
ANN_METAFILE_PAID | [14] predefined metafile - PAID
ANN_METAFILE_PASSED | [15] predefined metafile - PASSED
ANN_METAFILE_PENDING | [16] predefined metafile - PENDING
ANN_METAFILE_PROCESSED | [17] predefined metafile - PROCESSED
ANN_METAFILE_RECEIVED | [18] predefined metafile - RECEIVED
ANN_METAFILE_REJECTED | [19] predefined metafile - REJECTED
ANN_METAFILE_RELEASE | [20] predefined metafile - RELEASE
ANN_METAFILE_SENT | [21] predefined metafile - SENT
ANN_METAFILE_SHIPPED | [22] predefined metafile - SHIPPED
ANN_METAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
ANN_METAFILE_URGENT | [24] predefined metafile - URGENT
ANN_METAFILE_VOID | [25] predefined metafile - VOID
ANN_METAFILE_HOTSPOT | [26] predefined metafile for Hotspot and Freehand Hotspot
ANN_METAFILE_ENCRYPTOR | [27] predefined metafile for an encrypt object in the ‘encryptor’ state
ANNMETAFILE_DECRYPTOR | [28] predefined metafile for an encrypt object in the ‘decryptor’ state


Return for AnnSetMetafile

Return Value

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


bSelected Parameter For AnnSetNameOffsetX

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetNameOffsetX

hObject

Handle to the annotation object.


NameOffsetX Parameter For AnnSetNameOffsetX

NameOffsetX

X-offset to set for the name of the annotation object specified in hObject.


Return for AnnSetNameOffsetX

Return Value

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


bSelected Parameter For AnnSetNameOffsetY

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetNameOffsetY

hObject

Handle to the annotation object.


NameOffsetY Parameter For AnnSetNameOffsetY

NameOffsetY

Y- offset to set for the name of the annotation object specified in hObject.


Return for AnnSetNameOffsetY

Return Value

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


hObject Parameter for AnnSetNameOptions

hObject

Handle of the annotation object


Return for AnnSetNameOptions

Return Value

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


bNameRestrict Parameter For AnnSetNameRestrict

bNameRestrict

Flag that indicates whether to restrict the name of the specified annotation object. Possible values are:

Value | Meaning
TRUE | Restrict the name of the specified annotation object so that it fully appears on the bitmap.
FALSE | Do not restrict the name of the specified annotation object.


bSelected Parameter For AnnSetNameRestrict

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetNameRestrict

hObject

Handle to the annotation object.


Return for AnnSetNameRestrict

Return Value

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


bSelected Parameter For AnnSetNodes

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


bShowNodes Parameter For AnnSetNodes

bShowNodes

Flag that indicates whether to show the nodes. Possible values are:

Value | Meaning
TRUE | Show the nodes.
FALSE | Do not show the nodes.


hObject Parameter For AnnSetNodes

hObject

Handle of the annotation object.


nGapNodes Parameter For AnnSetNodes

nGapNodes

The distance between nodes. Use 0 to display all nodes. This value does not represent the distance in pixels. Instead, it refers to the number of nodes to skip before displaying another node. Possible values are:

Value | Meaning
0 | Show every node.
1 | Show a node, skip a node, show a node …
. |
. |
. |
9 | Show a node, skip the next nine, …
. |
. |

and so on.


Return for AnnSetNodes

Return Value

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


bSelected Parameter For AnnSetOffsetX

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.

Note:

Normally, you set this property only on the root container. The flag is included only to give you the same level of control as with other properties.


hObject Parameter For AnnSetOffsetX

hObject

Handle to the annotation object.


OffsetX Parameter For AnnSetOffsetX

OffsetX

The new value of the X offset.


Return for AnnSetOffsetX

Return Value

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


bSelected Parameter For AnnSetOffsetY

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.

Note:

Normally, you set this property only on the root container. The flag is included only to give you the same level of control as with other properties.


hObject Parameter For AnnSetOffsetY

hObject

Handle to the annotation object.


OffsetY Parameter For AnnSetOffsetY

OffsetY

The new value of the Y offset.


Return for AnnSetOffsetY

Return Value

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


hObject Parameter for AnnSetPointOptions

hObject

Handle of the annotation object.


Return for AnnSetPointOptions

Return Value

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


hObject Parameter For AnnSetPoints

hObject

Handle to the annotation object.


lPointCount Parameter For AnnSetPoints

lPointCount

The number of points in the array that you specify in the pPoints parameter.

Call this method once, passing 2 arrays of point coordinates, which must be in the order in which the vertices are connected. To define the line that closes a polygon, the last point in the array is connected to the first point of the array.

Alternatively, use the AnnDefine method to specify the array of points interactively.

AnnSetPoints works only with the following types of objects:

ANN_OBJECT_POINTER
ANN_OBJECT_FREEHAND
ANN_OBJECT_LINE
ANN_OBJECT_POLYGON
ANN_OBJECT_POLYLINE
ANN_OBJECT_POINT
ANN_OBJECT_PROTRACTOR
ANN_OBJECT_FREEHANDHOTSPOT
ANN_OBJECT_TEXTPOINTER
ANN_OBJECT_POLYRULER


Return for AnnSetPoints

Return Value

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


vXArray Parameter For AnnSetPoints

vXArray

1 dimensional array of float (Single) values that specifies the X-coordinates of the shape of the annotation.


vYArray Parameter For AnnSetLineStyle

vYArray

1 dimensional array of float (Single) values that specifies the Y-coordinates of the shape of the annotation.


bSelected Parameter For AnnSetPolyFillMode

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetPolyFillMode

hObject

Handle to the annotation object.


nPolyFillMode Parameter For AnnSetPolyFillMode

nPolyFillMode

The constant that specifies the polygon fill mode. Possible polygon fill mode values are:

Value | Meaning
ANN_POLYFILL_WINDING | [0] All pixels that are inside the resulting exterior lines are filled.
ANN_POLYFILL_ALTERNATE | [1] The filled area includes the area between odd-numbered and even-numbered polygon sides on each scan line.


Return for AnnSetPolyFillMode

Return Value

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


hMetafile Parameter For AnnSetPredefinedMetafile

hMetafile

Handle to the metafile used to replace the specified predefined metafile. Passing 0 will reset the predefined metafile specified by nType to its original metafile.


nType Parameter For AnnSetPredefinedMetafile

nType

Constant that indicates the metafile to change. Possible values are:

Value | Meaning
ANN_METAFILE_APPROVED | [0] predefined metafiles - APPROVED
ANN_METAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
ANN_METAFILE_CHECKED | [2] predefined metafile -CHECKED
ANN_METAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
ANN_METAFILE_COPY | [4] predefined metafile - COPY
ANN_METAFILE_DRAFT | [5] predefined metafile - DRAFT
ANN_METAFILE_EXTENDED | [6] predefined metafile - EXTENDED
ANN_METAFILE_FAX | [7] predefined metafile - FAX
ANN_METAFILE_FAXED | [8] predefined metafile - FAXED
ANN_METAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
ANN_METAFILE_INVOICE | [10] predefined metafile - INVOICE
ANN_METAFILE_NOTICE | [11] predefined metafile - NOTICE
ANN_METAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
ANN_METAFILE_ONFILE | [13] predefined metafile - ON FILE
ANN_METAFILE_PAID | [14] predefined metafile - PAID
ANN_METAFILE_PASSED | [15] predefined metafile - PASSED
ANN_METAFILE_PENDING | [16] predefined metafile - PENDING
ANN_METAFILE_PROCESSED | [17] predefined metafile – PROCESSED
ANN_METAFILE_RECEIVED | [18] predefined metafile - RECEIVED
ANN_METAFILE_REJECTED | [19] predefined metafile - REJECTED
ANN_METAFILE_RELEASE | [20] predefined metafile - RELEASE
ANN_METAFILE_SENT | [21] predefined metafile - SENT
ANN_METAFILE_SHIPPED | [22] predefined metafile - SHIPPED
ANN_METAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
ANN_METAFILE_URGENT | [24] predefined metafile - URGENT
ANN_METAFILE_VOID | [25] predefined metafile - VOID
ANN_METAFILE_HOTSPOT | [26] predefined metafile for Hotspot and Freehand Hotspot
ANN_METAFILE_ENCRYPTOR | [27] predefined metafile for an Encrypt object in the ‘encryptor’ state.
ANN_METAFILE_DECRYPTOR | [28] predefined metafile for an Encrypt object in the ‘decryptor’state


Return for AnnSetPredefinedMetafile

Return Value

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


bAcute Parameter For AnnSetProtractorOptions

bAcute

Flag that indicates whether to draw the inside or the outside angle of the protractor. Possible values are:

Value | Meaning
TRUE | Draw the inside (acute) angle. (<180 degrees)
FALSE | Draw the outside (obtuse) angle. (>180 degrees)


bSelected Parameter For AnnSetProtractorOptions

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


fArcRadius Parameter For AnnSetProtractorOptions

fArcRadius

The arc radius.


hObject Parameter For AnnSetProtractorOptions

hObject

Handle to the annotation object.


nPrecesion Parameter For AnnSetProtractorOptions

nPrecision

The number of digits after the decimal. ( "." ) Valid values are 0 – 200.


nUnit Parameter For AnnSetProtractorOptions

nUnit

Flag that indicates whether the unit of measurement for the angle is degrees or radians. Possible values are:

Value | Meaning
ANN_ANGLE_DEGREES | Measure the angle in degrees. The default abbreviation for this unit is the degree sign.
ANN_ANGLE_RADIANS | Measure the angle in radians. The default abbreviation for this unit is "rad".

Either of the above values can be combined with ANN_ANGLE_DEF_ABBR [0x4000] to restore the default unit abbreviation.


pszAbbrev Parameter For AnnSetProtractorOptions

pszAbbrev

Character string that contains the abbreviation to be put after the angle. Use NULL to set the default abbreviation for the specified unit.

To get the default abbreviations for the current angle unit, add ANN_ANGLE_DEF_ABBR [0x4000] to unit value passed in nUnit. In this case, pszAbbrev will be ignored.


Return for AnnSetProtractorOptions

Return Value

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


bSelected Parameter For AnnSetROP2

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetROP2

hObject

Handle to the annotation object.


nROP2 Parameter For AnnSetROP2

nROP2

Constant that specifies the ROP code for one or more objects. Possible ROP code values are:

Value | Meaning
ANN_ROP2_COPY | [0x0000] Draw the object using the object's color
ANN_ROP2_AND | [0x0001] Draw the object, performing an AND between the object's color and the background color. This creates a highlight effect. White objects become transparent.
ANN_ROP2_XOR | [0x0002]Draw the object, performing an XOR between the object's color and the background color. This creates an inverted effect. Black objects become transparent.

Default is ANN_ROP2_COPY.


Return for AnnSetROP2

Return Value

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


bSelected Parameter For AnnSetScalarX

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.

Note:

Normally, you set this property only on the root container. The flag is included only to give you the same level of control as with other properties.


fScalarX Parameter For AnnSetScalarX

fScalarX

The horizontal scaling factor to apply.


hObject Parameter For AnnSetScalarX

hObject

Handle to the annotation object.


Return for AnnSetScalarX

Return Value

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


bSelected Parameter For AnnSetScalarY

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.

Note:

Normally, you set this property only on the root container. The flag is included only to give you the same level of control as with other properties.


fScalarY Parameter For AnnSetScalarY

fScalarY

The vertical scaling factor to apply.


hObject Parameter For AnnSetScalarY

hObject

Handle to the annotation object.


Return for AnnSetScalarY

Return Value

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


bSelected Parameter For AnnSetSecondaryBitmap

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetSecondaryBitmap

hObject

Handle to the annotation object.


pRaster Parameter For AnnSetSecondaryBitmap

pRaster

ILEADRaster object that contains the bitmap to be set as the secondary bitmap.


Return for AnnSetSecondaryBitmap

Return Value

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


bSelected Parameter For AnnSetSelected

bSelected

Flag that indicates whether to change the selection status for the selected objects only, or for all objects. This value is valid only if hObject is a container object. Possible values are:

Value | Meaning
VARIANT_TRUE | Change the selection status of those objects within the container that have their Selected property set.
VARIANT_FALSE | Change the selection status for all objects. This is comparable to setting iFlags to ANN_FLAG_NOTCONTAINER | ANN_FLAG_RECURSE.


bValue Parameter For AnnSetSelected

bValue

Flag that indicates whether to select or deselect hObject. Possible values are:

Value | Meaning
VARIANT_TRUE | Select the specified object and all objects that it contains.
VARIANT_FALSE | Deselect the object and all objects that it contains.


hObject Parameter For AnnSetSelected

hObject

Handle to an annotation object.


Return for AnnSetSelected

Return Value

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


bSelected Parameter For AnnSetShowFlags

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetShowFlags

hObject

Handle to the annotation object.


nShowFlags Parameter For AnnSetShowFlags

nShowFlags

Flag that indicates how to display the rulers. Possible values are:

Value | Meaning
0 | Display neither the ruler length or the ruler gauge.
ANN_SHOW_LENGTH | Display the ruler length.
ANN_SHOW_GAUGE | Display the ruler gauge.
ANN_SHOW_TICMARKS | Display the tic marks.


Return for AnnSetShowFlags

Return Value

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


hObject Parameter For AnnSetTag

hObject

Handle to the annotation object.


iTag Parameter For AnnSetTag

nTag

The numeric tag to be assigned to the object.


Return for AnnSetTag

Return Value

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


bSelected Parameter For AnnSetText

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


pszText Parameter For AnnSetText

pszText

The character string to assign to the annotation object.


Return for AnnSetText

Return Value

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


bSelected Parameter For AnnSetTransparent

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


bTransparent Parameter For AnnSetTransparent

bTransparent

Flag that indicates whether to set bitmap objects to use a transparent color. Possible values are:

Value | Meaning
TRUE | Set the bitmap to use a transparent color.
FALSE | Do not set the bitmap to use a transparent color. This is the default.


bSelected Parameter For AnnSetTransparentColor

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


crTransparent Parameter For AnnSetTransparentColor

crTransparent

The fill color.


hObject Parameter For AnnSetTransparentColor

hObject

Handle to the annotation object.


Return for AnnSetTransparentColor

Return Value

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


hObject Parameter For AnnSetTransparent

hObject

Handle to the annotation object.


Return for AnnSetTransparent

Return Value

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


bSelected Parameter For AnnSetUnit

bSelected

Flag that indicates whether to process only the selected objects or all objects. Possible values are:

Value | Meaning
TRUE | Process only the selected objects.
FALSE | Process all objects.


hObject Parameter For AnnSetUnit

hObject

Handle to the annotation automation object.


nPrecision Parameter For AnnSetUnit

nPrecision

Number of digits to be displayed after the decimal place. Valid values are 0 – 200.


nUnit Parameter For AnnSetUnit

nUnit

The unit of measure of the ruler. Possible values are:

Value | Meaning
ANN_UNIT_INCHES | [0x0000] inches
ANN_UNIT_FEET | [0x0001] feet
ANN_UNIT_YARDS | [0x0002] yards
ANN_UNIT_MICROMETERS | [0x0003] micrometers
ANN_UNIT_MILIMETERS | [0x0004] millimeters
ANN_UNIT_CENTIMETERS | [0x0005] centimeters
ANN_UNIT_METERS | [0x0006] meters
ANN_UNIT_TWIPS | [0x0007] twips
ANN_UNIT_POINTS | [0x0008] points
ANN_UNIT_PIXELS | [0x0009] pixels
ANN_UNIT_SMART_METRIC | [0x0010] Smart Metric
ANN_UNIT_SMART_ENGLISH | [0x0011] Smart English

Any of the above values can also be combined with ANN_UNIT_DEF_ABBR [0x4000] to restore the default unit abbreviation.


pszUnitAbbrev Parameter For AnnSetUnit

pszUnitAbbrev

Address of the character string containing the unit abbreviation string to be displayed after the distance. To get the default abbreviations for the current unit of measurement, add ANN_UNIT_DEF_ABBR [0x4000] to unit value passed in nUnit. In this case, pszUnitAbbrev will be ignored.


Return for AnnSetUnit

Return Value

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


bSelected Parameter For AnnSetUser

bSelected

Flag that indicates whether to process only objects with their Selected property set, or process all objects within the container. This value is valid only for container objects. Possible values are:

Value | Meaning
VARIANT_TRUE | Process only those objects in the container with the Selected property set.
VARIANT_FALSE | Process all objects within the container.


hObject Parameter For AnnSetUserData

hObject

handle of the object.


pData Parameter For AnnSetUserData

pData

ILEADRasterVariant Object that contains the binary data to write.


Return for AnnSetUserData

Return Value

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


hObject Parameter For AnnSetUser

hObject

Handle to the annotation object.


pNewUser Parameter For AnnSetUser

pNewUser

String that contains the new user string.


pOldUser Parameter For AnnSetUser

pOldUser

String that contains the old user string.


Return for AnnSetUser

Return Value

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


bVisible Parameter For AnnSetVisible

bVisible

Flag that indicates whether to make the object or objects visible or invisible. Possible values are:

Value | Meaning
VARIANT_TRUE | Make the object or objects visible.
VARIANT_FALSE | Make the object or objects invisible.


hObject Parameter For AnnSetVisible

hObject

Handle to the annotation object.


iFlags Parameter For AnnSetVisible

iFlags

Flag that indicates the objects to process. Use 0 if hObject is not a container.

If hObject is a container, you can use 0 (process only hObject), or you can combine some of the values given below, using a bitwise OR. For example, ANN_FLAG_SELECTED | ANN_FLAG_RECURSE processes only the selected objects.

Value | Meaning
0 | Process only the specified object.
ANN_FLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. To get a list of selected objects, use the AnnGetSelectList method.
ANN_FLAG_NOTTHIS | [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANN_FLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANN_FLAG_NOTCONTAINER | [0x0002] (Used with ANN_FLAG_RECURSE) Process objects within containers, not the containers themselves.
ANN_FLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANN_FLAG_USER | [0x0040] Process only those objects that have a user included in pUserList. If pszUserList is NULL, process only those objects that do not have an associated user.


pUserList Parameter For AnnSetVisible

pUserList

String that contains the list of users associated with the specified object. pszUserList has the form "User1,User2,…,UserN". This must be a NULL terminated string with user names separated by a comma. This parameter is valid only if ANN_FLAG_USER is set in iFlags.


Return for AnnSetVisible

Return Value

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


hObject Parameter For AnnSetWnd

hObject

Handle to the root container.


hWnd Parameter For AnnSetWnd

hWnd

The window handle to assign to the object.


Return for AnnSetWnd

Return Value

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


hObject Parameter for AnnTextAlign

hObject

Handle of the annotation object for which to get or set the text alignment.


hObject Parameter for AnnTextExpandTokens

hObject

Handle of the annotation object for which to get or set this property


hObject Parameter for AnnTextPointerFixed

hObject

Handle of the annotation object for which to get or set this property


hObject Parameter for AnnTextRotate

hObject

Handle of the annotation object for which to get or set the rotation flag.


hObject Parameter for AnnTicMarkLength

hObject

Handle of the annotation object for which to get or set the tic mark length.


iTool Parameter For AnnToolChecked

iTool

Value that indicates the selected tool. For a list of possible values, refer to Annotation Toolbar Buttons.


Return for AnnUndo

Return Value

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


hObject Parameter For AnnUngroup

hObject

Handle to the annotation object.


iFlags Parameter For AnnUngroup

iFlags

Flags that determine which objects to process. Most of the flags apply only to container objects. The following are valid values:

Value | Meaning
0 | Process only the specified object.
ANN_FLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. To get a list of selected objects, use the AnnGetSelectList method.
ANN_FLAG_NOTTHIS | [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANN_FLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANN_FLAG_NOTCONTAINER | [0x0002] (Used with ANN_FLAG_RECURSE) Process objects within containers, not the containers themselves.
ANN_FLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANN_FLAG_CHECKMENU | [0x0020] Process objects only if the ANN_AUTOTEXT_MENU_UNGROUP menu item has been selected.
ANN_FLAG_USER | [0x0040] Ungroup only those objects with users listed in pszUserList.


pszUserList Parameter For AnnUngroup

pszUserList

String that contains the list of users associated with the specified object. pszUserList has the form "User1,User2,…,UserN". This must be a NULL terminated string with user names separated by a comma. This parameter is valid only if ANN_FLAG_USER is set in iFlags.


Return for AnnUngroup

Return Value

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


hAnnObject Parameter For AnnUnlocked

hAnnObject

Handle to the annotation object.


hObject Parameter For AnnUnlock

hObject

Handle of the annotation object.


pszKey Parameter For AnnUnlock

pszKey

String containing the key used to unlock the annotation objects.


Return for AnnUnlock

Return Value

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


bSelected Parameter For AnnUnrealize

bSelected

A VARIANT_BOOL value indicating whether to restore all objects within a container or only selected objects.


hObject Parameter For AnnUnrealize

hObject

Handle of the annotation object.


Return for AnnUnrealize

Return Value

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


nID Parameter For AnnUserMenu

nID

Identified the user-defined menu item that has been clicked. This is the same nID that was passed to the AddItem method.


Filter Parameter For AntiAlias

Filter

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.


iDim Parameter For AntiAlias

iDim

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.


iThreshold Parameter For AntiAlias

iThreshold

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.


pRaster Parameter For AntiAlias

pRaster

Pointer to the ILEADRaster object to be modified.


Return for AntiAlias

Return Value

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


dIntercept Parameter for ApplyLinearModalityLUT

dIntercept

"Rescale Intercept" : the value of "b" in the linear relationship between original pixel values and the new pixel values. (new pixel value) = m * (original pixel value) + b. Where "m" is the "Rescale Slope".


dslope Parameter for ApplyLinearModalityLUT

dslope

"Rescale Slope" : the value of "m" in the linear relationship between original pixel values and the new pixel values. (new pixel value) = m * (original pixel value) + b. Where "b" is the "Rescale Intercept".


Flags Parameter for ApplyLinearModalityLUT

Flags

Flags which determine the behavior of this method, Possible values are:

Value | Meaning
M_LUT_UPDATE_MIN_MAX | [0x0002] If set, the method will update MinVal property with the new minimum intensity value in the bitmap and MaxVal property with the new maximum intensity value.
M_LUT_ALLOW_RANGE_EXPANSION | [0x0008] If set, the method will adjust the high bit and / or low bit (if possible) inside the bitmap in order to be able to hold the range of pixel values after applying the modality LUT.


pRaster Parameter for ApplyLinearModalityLUT

pRaster

Pointer to the ILeadRaster object to be modified.


Return for ApplyLinearModalityLUT

Return Value

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


dCenter Parameter for ApplyLinearVOILUT

dCenter

Center of the window of interest.


dWidth Parameter for ApplyLinearVOILUT

dWidth

Width of the window of interest.


Flags Parameter for ApplyLinearVOILUT

Flags

Flags which determine the behavior of this method. Possible values are:

Value | Meaning
VOI_LUT_UPDATE_MIN_MAX | [0x0001] If set, the method will recalculate MinVal property based on the minimum intensity inside the bitmap and recalculate MaxVal propert based on the maximum intensity inside the bitmap.
VOI_LUT_REVERSE_ORDER | [0x0002] If set, the method will fill the bitmap display LUT in reverse order (light to dark instead of dark to light).


pRaster Parameter for ApplyLinearVOILUT

pRaster

Pointer to the ILeadRaster object to be modified.


Return for ApplyLinearVOILUT

Return Value

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


iFactor Parameter For ApplyMathLogic

iFactor

Mathematical or logical operation factor.


lFlags Parameter For ApplyMathLogic

lFlags

Flags that indicate the channel that will be used, the treatment of the input pixel values, the mathematical operation, and the treatment of the output pixel values. Use a bitwise OR ( | ) to specify one flag from each group. Refer to Flags for the ApplyMathLogic Method for the list of flags.


pRaster Parameter For ApplyMathLogic

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ApplyMathLogic

Return Value

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


Data Parameter for ApplyModalityLUT2

Data

Address of the VARIANT variable to be updated with the "LUT Data" as a safearray.


Flags Parameter for ApplyModalityLUT2

Flags

Flags which determine the behavior of this function , can take one or more of the following:

Value | Meaning
LUT_SIGNED | [0x0001] If set, the LUT entries are signed 16-bit values. If not set, the LUT entries are unsigned 16-bit values.
LUT_UPDATE_MIN_MAX | [0x0002] If set, the method will update MinVal property with the new minimum intensity value in the bitmap and MaxVal with the new maximum intensity value.


lFirstStoredPixelValueMapped Parameter for ApplyModalityLUT2

lFirstStoredPixelValueMapped

Indicates the first index whose remapped value is stored in the LUT. All pixels which are less than this value will be remapped to LUT[0].


pRaster Parameter for ApplyModalityLUT2

pRaster

Pointer to the ILeadRaster object to be modified.


Return for ApplyModalityLUT2

Return Value

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


Data Parameter for ApplyModalityLUT

Data

Address of the LEADRasterVariant variable to be updated with the "LUT Data" as a safearray.


Flags Parameter for ApplyModalityLUT

Flags

Flags which determine the behavior of this function , can take one or more of the following:

Value | Meaning
LUT_SIGNED | [0x0001] If set, the LUT entries are signed 16-bit values. If not set, the LUT entries are unsigned 16-bit values.
LUT_UPDATE_MIN_MAX | [0x0002] If set, the method will update MinVal property with the new minimum intensity value in the bitmap and MaxVal with the new maximum intensity value.


lFirstStoredPixelValueMapped Parameter for ApplyModalityLUT

lFirstStoredPixelValueMapped

Indicates the first index whose remapped value is stored in the LUT. All pixels which are less than this value will be remapped to LUT[0].


pRaster Parameter for ApplyModalityLUT

pRaster

Pointer to the ILeadRaster object to be modified.


Return for ApplyModalityLUT

Return Value

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


iXTranslation Parameter For ApplyTransformationParameters

iXTranslation

The amount of bitmap translation along the x-axis (width). This value is internally divided by 100. This value must be equal to the XTranslation property.


iYTranslation Parameter For ApplyTransformationParameters

iYTranslation

The amount of bitmap translation along the y-axis (height). This value is internally divided by 100. This value must be equal to the YTranslation property.


lAngle Parameter For ApplyTransformationParameters

lAngle

Angle of rotation, in hundredths of degrees (+/-). This can be a number from 1 to 36,000. This value is internally divided by 100. A positive value means the image is rotated clockwise, while a negative value means the image is rotated counter-clockwise. This value must be equal to the TransformationAngle property.


lFlags Parameter For ApplyTransformationParameters

lFlags

Flag that specifies the type of resizing to perform and which objects to preserve. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate the type of resizing to perform:

Value | Meaning
RGS_SIZE_NORMAL | [0x0001] Resize normally.
RGS_SIZE_RESAMPLE | [0x0002] Use linear interpolation and averaging to produce a higher-quality image.
RGS_SIZE_BICUBIC | [0x0003] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE.

The following are the flags that indicate which objects to preserve:

Value | Meaning
RGS_SIZE_FAVORBLACK [0x0010] | (Document/Medical only) Preserve black objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images.
RGS_SIZE_FAVORWHITE | [0x0020] (Document/Medical only) Preserve white objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORWHITE causes color images to be resampled, but applies the favor-white option to 1-bit, black-and-white images.


lXScale Parameter For ApplyTransformationParameters

lXScale

The amount of bitmap scaling along the x-axis (width). This is a percentage value. It is internally divided by 100. This value must be equal to the XScale property.


lYScale Parameter For ApplyTransformationParameters

lYScale

The amount of bitmap scaling along the y-axis (height). This is a percentage value. It is internally divided by 100. This value must be equal to the YScale property.


pRaster Parameter For ApplyTransformationParameters

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ApplyTransformationParameters

Return Value

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


Data Parameter for ApplyVOILUT2

Data

Address of the VARIANT variable to be updated with the "LUT Data" as a safearray


Flags Parameter for ApplyVOILUT2

Flags

Flags which determine the behavior of this function , can take one or more of the following:

Value | Meaning
VOI_LUT_UPDATE_MIN_MAX | [0x0001] If set, the method will recalculate MinVal property based on the minimum intensity inside the bitmap and recalculate MaxVal property based on the maximum intensity inside the bitmap.
VOI_LUT_REVERSE_ORDER | [0x0002] If set, the method will fill the bitmap display LUT in reverse order (light to dark instead of dark to light).


FirstStoredPixelValueMapped Parameter for ApplyVOILUT2

lFirstStoredPixelValueMapped

Indicates the first index whose remapped value is stored in the LUT. All pixels which are less than this value will be remapped to LUT[0].


pRaster Parameter for ApplyVOILUT2

pRaster

Pointer to the ILeadRaster object to be modified.


Return for ApplyVOILUT2

Return Value

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


Data Parameter for ApplyVOILUT

Data

Address of the LEADRasterVariant variable to be updated with the "LUT Data" as a safearray


Flags Parameter for ApplyVOILUT

Flags

Flags which determine the behavior of this function , can take one or more of the following:

Value | Meaning
VOI_LUT_UPDATE_MIN_MAX | [0x0001] If set, the method will recalculate MinVal property based on the minimum intensity inside the bitmap and recalculate MaxVal property based on the maximum intensity inside the bitmap.
VOI_LUT_REVERSE_ORDER | [0x0002] If set, the method will fill the bitmap display LUT in reverse order (light to dark instead of dark to light).


lFirstStoredPixelValueMapped Parameter for ApplyVOILUT

lFirstStoredPixelValueMapped

Indicates the first index whose remapped value is stored in the LUT. All pixels which are less than this value will be remapped to LUT[0].


pRaster Parameter for ApplyVOILUT

pRaster

Pointer to the ILeadRaster Object to bemodified.


Return for ApplyVOILUT

Return Value

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


Return for ArraySize

Return Value

The size of the specified byte array.


vMem Parameter For ArraySize

vMem

An ILEADRasterVariant byte array object that contains the file in memory.


pRaster Parameter For AutoBinary

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for AutoBinary

Return Value

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


lBlackClip Parameter For AutoColorLevel

lBlackClip

An unsigned integer that represents the percentage of black pixels to clip from the bitmap, in hundredths of a percent. Valid values range from 0 to 10000 (which represents 100%). Best results are found using 0.3 to 0.9 %. The default is DEFAULT_BLACK_CLIP, which indicates to clip 0.5% of the black pixels.


lFlags Parameter For AutoColorLevel

lFlags

A flag that indicates the type of leveling to perform. Possible values are:

Value | Meaning
AUTO_LEVEL | [1] Perform leveling on the individual R, G and B channels, treating each of the R, G and B channels as a separate entity. It introduces color cast on the image.
AUTO_CONTRAST | [2] Perform leveling on the MASTER channel (the grayscale values of the pixels). No color cast will be introduced.
AUTO_INTENSITY | [3] Perform leveling on the RGB channel (the sum of the R, G, and B channels). No color cast will be introduced.
AUTO_NOPROCESS | [4] Do not process the bitmap. Just update pLvlClr with the color leveling information used. The color leveling information used depends on which of the other flags was set with AUTO_NOPROCESS. Only one other flag may be set with AUTO_NOPROCESS.


lWhiteClip Parameter For AutoColorLevel

lWhiteClip

An unsigned integer that represents the percentage of pixels to clip from the bitmap, in hundredths of a percent. Valid values range from 0 to 10000 (which represents 100%). The default is DEFAULT_WHITE_CLIP, which indicates to clip 0.5% of the white pixels.


pRaster Parameter For AutoColorLevel

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for AutoColorLevel

Return Value

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


nMinHeight Parameter For AutoSegment

nMinHeight

Minimum segment height, in pixels. This should be at least 10.


nMinWidth Parameter For AutoSegment

nMinWidth

Minimum segment width, in pixels. This should be at least 10.


pRaster Parameter For AutoSegment

pRaster

ILEADRaster object that contains the image to be segmented.


Return for AutoSegment

Return Value

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


iThreshold Parameter For AutoTrim

iThreshold

Delta value for detecting blank space. Starting at each edge of the bitmap and evaluating toward the center, any change in intensity that is less than or equal to iThreshold is considered blank space. Valid values are 0 to 255.


pRaster Parameter For AutoTrim

pRaster

ILEADRaster object to be modified.


Return for AutoTrim

Return Value

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


iDim Parameter For Average

iDim

Size of the averaging neighborhood. It is the length, in pixels, of one side of a square.


pRaster Parameter For Average

pRaster

ILEADRaster object to be modified.


Return for Average

Return Value

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


fBlueToBlue Parameter For BalanceColors

fBlueToBlue

Value that represents the percentage of the blue color value that should be distributed to the blue component. Possible values are 0.0 to 1.0.


fBlueToGreen Parameter For BalanceColors

fBlueToGreen

Value that represents the percentage of the blue color value that should be distributed to the green component. Possible values are 0.0 to 1.0.


fBlueToRed Parameter For BalanceColors

fBlueToRed

Value that represents the percentage of the blue color value that should be distributed to the red component. Possible values are 0.0 to 1.0.


fGreenToBlue Parameter For BalanceColors

fGreenToBlue

Value that represents the percentage of the green color value that should be distributed to the blue component. Possible values are 0.0 to 1.0.


fGreenToGreen Parameter For BalanceColors

fGreenToGreen

Value that represents the percentage of the green color value that should be distributed to the green component. Possible values are 0.0 to 1.0.


fGreenToRed Parameter For BalanceColors

fGreenToRed

Value that represents the percentage of the green color value that should be distributed to the red component. Possible values are 0.0 to 1.0.


fRedToBlue Parameter For BalanceColors

fRedToBlue

Value that represents the percentage of the red color value that should be distributed to the blue component. Possible values are 0.0 to 1.0.


fRedToGreen Parameter For BalanceColors

fRedToGreen

Value that represents the percentage of the red color value that should be distributed to the green component. Possible values are 0.0 to 1.0.


fRedToRed Parameter For BalanceColors

fRedToRed

Value that represents the percentage of the red color value that should be distributed to the red component. Possible values are 0.0 to 1.0.


pRaster Parameter For BalanceColors

pRaster

ILEADRaster object to be modified.


Return for BalanceColors

Return Value

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


CenterX Parameter For Bending

CenterX

X coordinate of the center of the arc. This is ignored when either BND_HORZ or BND_VERT is set in the lFlags parameter.


CenterY Parameter For Bending

CenterY

Y coordinate of the center of the arc. This is ignored when either BND_HORZ or BND_VERT is set in the lFlags parameter.


crFill Parameter For Bending

crFill

The OLE_COLOR value that specifies the fill color for any exposed area. You can specify an OLE_COLOR value, such as the return value of the Windows RGB macro.


iValue Parameter For Bending

iValue

Amount of stretching where, positive values: stretch the pixels toward edges and negative values: stretch the pixels toward the center. Possible values range from–500 to 500.


lFlags Parameter For Bending

lFlags

Flags that indicate how to handle peripherally exposed areas, how to handle centrally exposed areas, and the type of bending.

You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle peripherally exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed area with crFill.
FILL_RPT | [0x0001] Stretch the edges of the image to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate how to handle an exposed center:

Value | Meaning
FILL_ROT | [0x0000] Rotate the image inside the arc pattern.
FILL_WOUTROT | [0x0010] Fill the exposed center as you would any other exposed area. This is determined by setting the FILL_CLR, FILL_RPT or FILL_NOCHG flags.

This flag is ignored if the iValue parameter is negative.

The following are the flags that indicate how the bitmap is bent:

Value | Meaning
BND_NORM | [0x0000] Stretch the image along the vertical and horizontal planes.
BND_HORZ | [0x0100] Stretch the image along the horizontal plane.
BND_VERT | [0x0200] Stretch the image along the vertical plane.


pRaster Parameter For Bending

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Bending

Return Value

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


iIndex Parameter For BezierX

iIndex

Index into the ordered array of X coordinates for the control points. This is a zero-based index.


iIndex Parameter For BezierY

iIndex

Index into the ordered array of Y coordinates for the control points. This is a zero-based index.


iType Parameter For BinaryFilter

iType

Pointer to the binary filter to use. You can use one of the following predefined filters:

Value | Meaning
BFLT_EROSION_OMNI BFLT_EROSION_HORZ BFLT_EROSION_VERT BFLT_EROSION_DIAG | Shrinks black objects in the bitmap. The effect is biased in the specified direction.
BFLT_DILATION_OMNI BFLT_DILATION_HORZ BFLT_DILATION_VERT BFLT_DILATION_DIAG | Enlarges black objects in the bitmap. The effect is biased in the specified direction.


pRaster Parameter For BinaryFilter

pRaster

ILEADRaster object to be modified.


Return for BinaryFilter

Return Value

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


iIndex Parameter for BooleanItemValue

iIndex

Index of the Boolean item value from the Boolean array.


bTile Parameter For BumpMap

bTile

Boolean flag that indicates whether to use tiling. Possible values are:

Value | Meaning
TRUE | use tiling
FALSE | do not to use tiling.


iAzimuth Parameter For BumpMap

iAzimuth

Value that describes the light source's angular position in the horizontal plane. The valid range is between –360 to 360.


iBright Parameter For BumpMap

iBright

Amount to change the intensity. The intensity ranges from -1000 to 1000. A positive value increases (or lightens) the brightness of the resulting image. A negative value decreases (or darkens) the brightness of the resulting image.


iDepth Parameter For BumpMap

iDepth

The apparent depth of this three-dimensional effect. Valid values are 0 to 1000, with 500 as normal.


iElevation Parameter For BumpMap

iElevation

Value that describes the light source's angular position in the vertical plane. The valid range is between 0 to 180.


iIntensity Parameter For BumpMap

iIntensity

Amount to change the intensity. The intensity ranges from -1000 to 1000. A positive value increases (or lightens) the brightness of the destination image. A negative value decreases (or darkens) the brightness of the destination image.


iXDst Parameter For BumpMap

iXDst

The X coordinate of the origin of the destination rectangle.


iXOffset Parameter For BumpMap

iXOffset

The X coordinate of the origin of the Bump rectangle.


iYDst Parameter For BumpMap

iYDst

The Y coordinate of the origin of the destination rectangle.


iYOffset Parameter For BumpMap

iYOffset

The Y coordinate of the origin of the Bump rectangle.


pBumpRas Parameter For BumpMap

pBumpRas

Pointer to the ILeadRaster object that references the bump bitmap.


pDstRast Parameter For BumpMap

pDstRast

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for BumpMap

Return Value

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


iBlueFactorB Parameter For ChannelMix

iBlueFactorB

The blue value to use for redistributing the bitmap's blue values


iBlueFactorConstant Parameter For ChannelMix

iBlueFactorConstant

The constant value to use for redistributing the bitmap's blue values


iBlueFactorG Parameter For ChannelMix

iBlueFactorG

The green value to use for redistributing the bitmap's blue values


iBlueFactorR Parameter For ChannelMix

iBlueFactorR

The red value to use for redistributing the bitmap's blue values


iGreenFactorB Parameter For ChannelMix

iGreenFactorB

The blue value to use for redistributing the bitmap's green values


iGreenFactorConstant Parameter For ChannelMix

iGreenFactorConstant

The constant value to use for redistributing the bitmap's green values


iGreenFactorG Parameter For ChannelMix

iGreenFactorG

The green value to use for redistributing the bitmap's green values


iGreenFactorR Parameter For ChannelMix

iGreenFactorR

The red value to use for redistributing the bitmap's green values


iRedFactorB Parameter For ChannelMix

iRedFactorB

The blue value to use for redistributing the bitmap's red values


iRedFactorConstant Parameter For ChannelMix

iRedFactorConstant

The constant value to use for redistributing the bitmap's red values


iRedFactorG Parameter For ChannelMix

iRedFactorG

The green value to use for redistributing the bitmap's red values


iRedFactorR Parameter For ChannelMix

iRedFactorR

The red value to use for redistributing the bitmap's red values


pRaster Parameter For ChannelMix

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ChannelMix

Return Value

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


bLuminance Parameter For ColorIntensityBalance

bLuminance

Value that indicates whether to preserve luminance. Possible values are:

Value | Meaning
TRUE | Preserve luminance.
FALSE | Do not preserve luminance


pRaster Parameter For ColorIntensityBalance

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ColorIntensityBalance

Return Value

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


pRasterDst Parameter For ColorizeGray

pRasterDst

Pointer to an ILEADRaster object that references the resulting bitmap.


pRasterSrc Parameter For ColorizeGray

pRasterSrc

Pointer to an ILEADRaster object that references the source 8, 12, or 16-bit grayscale bitmap. This bitmap will not be modified.


Return for ColorizeGray

Return Value

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


lFlags Parameter For ColorLevel

lFlags

Flag that indicates the channel being leveled. Possible values are:

Value | Meaning
LEVEL_RED | [0x0001] Red channel
LEVEL_GREEN | [0x0010] Green channel
LEVEL_BLUE | [0x0100] Blue channel
LEVEL_MASTER | [0x1000] All channels


pRaster Parameter For ColorLevel

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ColorLevel

Return Value

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


iBrightness Parameter For ColorReplace

iBrightness

Amount to change the brightness, in tenths of a percent. Valid values range from –1000 to 1000. This value is divided internally by 10. Positive values increase (or lighten) the brightness of the bitmap image. Negative values decrease (or darken) the brightness of the bitmap image.


iHue Parameter For ColorReplace

iHue

Angular amount to change the hue, in hundredths of a degree. Valid values range from –18000 to 18000. This value is divided internally by 100.


iSaturation Parameter For ColorReplace

iSaturation

Amount to change saturation, in tenths of a percent. Valid values range from –1000 to 1000. This value is divided internally by 10. Negative values decrease the saturation of colors. Positive values increase the saturation. The saturation level is increased or decreased by a percentage of its present saturation level. For example, an increase of 20% of the current saturation level "L" will raise the new saturation level "L1" to a value L = 0.20 * L. Likewise, increasing the saturation level 100% doubles the saturation level (L1 = L + 1.0 * L). Decreasing the saturation level 100% will set the new saturation level to 0. The saturation is set to 1000 (maximum value) if the new value exceeds 1000).


pRaster Parameter For ColorReplace

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for ColorReplace

Return Value

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


ColorSpace Parameter For ColorThreshold

ColorSpace

Color space on which the threshold is based. Possible values are

Value | Meaning
CLTH_RGB_SPACE | [0] RGB color space
CLTH_HSV_SPACE | [1] HSV color space
CLTH_HLS_SPACE | [2] HLS color space
CLTH_XYZ_SPACE | [3] XYZ color space
CLTH_YCrCb_SPACE | [4] YCrCb color space
CLTH_YUV_SPACE | [5] YUV color space
CLTH_LAB_SPACE | [6] LAB color space
CLTH_CMY_SPACE | [7] CMY color space


pRaster Parameter For ColorThreshold

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for ColorThreshold

Return Value

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


lIndex Parameter For ComponentFlags

lIndex

Index of the range values. Valid values are 0 to 2.


lIndex Parameter For ComponentMaxRange

lIndex

Index into the array of maximum range values. Valid values are 0 to 2.


lIndex Parameter For ComponentMinRange

lIndex

Index into the array of maximum range values. Valid values are 0 to 2.


lIndex Parameter For ContourX

lIndex

Index into the array of X coordinates. Possible values are from 0 to ContoursCount -1


lIndex Parameter For ContourY

lIndex

Index into the array of Y coordinates. Possible values are from 0 to ContoursCount-1


iBrightness Parameter For ContrastBrightIntensity

iBrightness

Amount of brightness change. The brightness ranges from -1000 to 1000. This value is divided internally by 1000. A positive value increases (or lightens) the brightness of the bitmap image. A negative value decreases (or darkens) the brightness of the bitmap image.


iContrast Parameter For ContrastBrightIntensity

iContrast

Amount of contrast change. The contrast ranges from -1000 to +1000. This value is divided internally by 1000. A positive value increases the contrast whereas a negative value decreases the contrast.


iIntensity Parameter For ContrastBrightIntensity

iIntensity

Amount of intensity change. The intensity ranges from -1000 to +1000. This value is divided internally by 1000. A positive value lightens the brightness pixels whereas a negative value darkens the brightness pixels.


pRaster Parameter For ContrastBrightIntensity

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ContrastBrightIntensity

Return Value

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


pRaster Parameter for ConvertUnsignedToSigned

pRaster

Pointer to the ILeadRaster object to be modified.


Shift Parameter for ConvertUnsignedToSigned

Shift

Flag that indicates how to process bits outside the low bit to high bit range. Possible values are:

Value | Meaning
PROCESS_RANGE_ONLY | [0x0001] Shift data by adding half the range to each pixel without changing bits outside the (LowBit-HighBit) range.
PROCESS_OUTSIDE_RANGE | [0x0002] Shift data by adding half the range to each pixel and set to zero all bits outside the (LowBit-HighBit) range.


Return for ConvertUnsignedToSigned

Return Value

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


pCorrelationRaster Parameter For Correlation

pCorrelationRaster

Pointer to an ILEADRaster object that references the bitmap for which to search.


pRaster Parameter For Correlation

pRaster

Pointer to an ILEADRaster object that references the bitmap to be searched.


Return for Correlation

Return Value

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


StepX Parameter For Correlation

StepX

Step size in the X direction (along image width), in pixels. For best results, use 1. Negative values are not allowed.


StepY Parameter For Correlation

StepY

Step size in the V direction (along image height), in pixels. For best results, use 1. Negative values are not allowed.


Threshold Parameter For Correlation

Threshold

Value that indicates the correlation threshold, which is a measure of association required to consider two areas to be correlated. If the correlation value between pCorrelationRaster and an area in pRaster is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).


iIndex Parameter For CorrelationX

iIndex

Index into the array of X coordinates. Valid values are from 0 to CorrelationCount – 1.


iIndex Parameter For CorrelationY

iIndex

Index into the array of Y coordinates. Valid values are from 0 to CorrelationCount – 1.


Flags Parameter For CountLUTColors

Flags

Flag that indicates whether the LevelLUT property contains signed or unsigned data. Possible values are:

Value | Meaning
COUNT_LUT_UNSIGNED | [0x0001] The LUT contains signed data.
COUNT_LUT_SIGNED | [0x0002] The LUT contains unsigned data.


Return for CountLUTColors

Return Value

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


crColor Parameter For Cubism

crColor

The color value that specifies the background color. This value is ignored if the CUB_BKG flag has been set in lFlags.


iBrightness Parameter For Cubism

iBrightness

A value that indicates the brightness of the bitmap. This value can be a number between -1000 and 1000. Negative values darken the image and positive values lighten the image.


iSpace Parameter For Cubism

iSpace

Space between cubes, in pixels. As iSpace decreases the concentration of cubes increases and vice versa. The valid range is from 1 to the image or region dimension (that is, min(Height, Width))


lAngle Parameter For Cubism

lAngle

The cube’s angle of orientation, in hundredths of a degree (+/-). This value is ignored if the CUB_RAND flag has been set in lFlags. Possible values are from–36000 to 36000.


lFlags Parameter For Cubism

lFlags

Flags that indicate the background color, cube shape and cube orientation. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate the background color:

Value | Meaning
CUB_BKG | [0x0001] Use the image itself as the background.
CUB_COLOR | [0x0002] Use the color in the crColor member as the background color.
The following are the flags that indicate the cube’s shape:
Value | Meaning
CUB_SQR | [0x0010] Cubes will have square shape.
CUB_RECT | [0x0020] Cubes will have rectangular shape.
The following are the flags that indicate the cube’s orientation:
Value | Meaning
CUB_RAND | [0x0100] Cubes will have random orientation.
CUB_ORNT | [0x0200] All cubes will have the orientation specified by the lAngle value.


lLength Parameter For Cubism

lLength

Cube side length, in pixels.


pRaster Parameter For Cubism

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Cubism

Return Value

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


iType Parameter For Cylindrical

iType

A value that indicates the cylinder shape. Possible values are:

Value | Meaning
CYL_HORZ | [0x0000] Stretch the pixels along the vertical plane (horizontal cylinder).
CYL_VERT | [0x0001] Stretch the pixels along the horizontal plane (vertical cylinder).


iValue Parameter For Cylindrical

iValue

Amount of stretching where positive values stretch the pixels toward the bitmap edges depending on the type of cylinder and negative values stretch the pixels toward the central line of the cylinder. The valid range from –100 to 100.


pRaster Parameter For Cylindrical

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Cylindrical

Return Value

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


Return for DefaultOptions

Return Value

An ILEADOptimizeOptions object pointer that contains the default optimization options.


lFlags Parameter For Deinterlace

lFlags

Flags that indicate how to deinterlace the image and whether to remove odd lines or even lines. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate how to deinterlace the image:

Value | Meaning
DEINTERLACE_NORMAL | [0x0001]Deinterlace the image by copying the data line into the removed lines.
DEINTERLACE_SMOOTH | [0x0002] Deinterlace the image by averaging the data lines and copying the averaged data into the removed lines.

The following are the flags that indicate whether to remove odd or even lines:

Value | Meaning
DEINTERLACE_ODD | [0x0010] Remove the odd lines.
DEINTERLACE_EVEN | [0x0020] Remove the even lines.


pRaster Parameter For Deinterlace

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Deinterlace

Return Value

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


pRaster Parameter For Desaturate

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Desaturate

Return Value

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


crFill Parameter For Deskew

crFill

Color used to fill the background following rotation. This is used only if DSK_FILL is set in lFlags.


pRaster Parameter For Deskew

pRaster

ILEADRaster object to be modified.


Return for Deskew

Return Value

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


lFlags Parameter For Deskew

lFlags

Flags that indicate whether or not to deskew the image and what background color to use. You can use a bitwise OR (|) to specify one flag from each group.

The following flags indicate whether to deskew the image after the method finds the skew angle:

Value | Meaning
DSKW_PROCESS | [0x00000000] Deskew (rotate) the image.
DSKW_NOPROCESS | [0x00000001] Don’t deskew (rotate) the image. Generally this flag is used to find the angle of rotation.

The following flags indicate what background color to use:

DSKW_FILL | [0x00000000] Use the color in crFill to fill areas exposed after rotation.
DSKW_NOFILL | [0x00000010] Let the method automatically find the suitable background color used to fill areas exposed after rotation. crFill is ignored in this case.

The following flags indicate image type:

DSKW_DOCUMENTIMAGE | [0x00000000] The image contains text only.
DSKW_DOCUMENTANDPICTURE | [0x00010000] The image contains text and pictures or light text.


lIndex Parameter For DetectedMarkPointX

lIndex

Index into the array of X coordinates. Valid values range from 0 to DetectedMarkCount – 1.


lIndex Parameter For DetectedMarkPointY

lIndex

Index into the array of Y coordinates. Valid values range from 0 to DetectedMarkCount – 1.


crColor Parameter For DiceEffect

crColor

Value that represents the color of the border that will be drawn around the dice blocks. This parameter will be used only if the DICE_BORDER flag is set.


lFlags Parameter For DiceEffect

lFlags

Flags that specify how to apply the effect. Possible values are:

Value | Meaning
DICE_BORDER | [0x0001] Draw borders around the dice blocks. The border color is given by crColor. Each block will draw the border on the inside of the edges. The border is 1 pixel wide. In places with adjacent blocks, the border will be 2 pixels wide because each block has a 1-pixel border. If the BITMAP_RESIZE flag is not set and the edge blocks have a different size than the inner blocks, the border will not be drawn for the right and the bottom edges.
DICE_SIZE | [0x0010] lXBlock and lYBlock contain the width and height of each block, in pixels.
DICE_COUNT | [0x0020] lXBlock and lYBlock contain the number of blocks per row and per column.
BITMAP_RESIZE | [0x0100] if this flag is set then the image will be resized to be sure that all blocks have equal size. If this flag is not set then the edge blocks might have a different size than the inner blocks. If the edge blocks have a different size, they will be manipulated differently. See the comments below for more information.


lRandomize Parameter For DiceEffect

lRandomize

The starting point for the randomization process. Valid values range from 0 through 500. Use 0 to have the method select the value.


lXBlock Parameter For DiceEffect

lXBlock

If the DICE_SIZE flag is set, this parameter represents the width of the each block, in pixels. If the DICE_COUNT flag is set, this parameter represents the number of blocks per row.


lYBlock Parameter For DiceEffect

lYBlock

If the user set the DICE_SIZE flag, this parameter represents the height of the each block, in pixels. If the user set the DICE_COUNT flag instead of DICE_SIZE flag, this parameter will represent the number of blocks per column.


pRaster Parameter For DiceEffect

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for DiceEffect

Return Value

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


lFlags Parameter For DigitalSubtract

lFlags

Flags that control how the method works. Possible values are:

Value | Meaning
0 | No enhancement.
DS_CONTRASTENH | [1] Perform a contrast enhancement after applying the subtraction.
DS_OPTIMIZERANGE | [2] Optimize and increase the tonal range of the bitmap after applying the subtraction.


pRasterDst Parameter For DigitalSubtract

pRasterDst

Pointer to an ILEADRaster object that references the resulting bitmap.


pRasterSrc Parameter For DigitalSubtract

pRasterSrc

Pointer to an ILEADRaster object that references the mask bitmap. This bitmap will not be modified.


Return for DigitalSubtract

Return Value

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


crBkColor Parameter For DirectionEdgeStatistical

crBkColor

The OLE_COLOR value that specifies the non edge color. You can specify an OLE_COLOR value, such as the return value of the Windows RGB macro.


crEdgeColor Parameter For DirectionEdgeStatistical

crEdgeColor

The OLE_COLOR value that specifies the edge color. You can specify an OLE_COLOR value, such as the return value of the Windows RGB macro.


iAngle Parameter For DirectionEdgeStatistical

iAngle

Angular amount that specifies edge detector direction, in hundredths of degrees. Valid values range from –18000 through 18000. . Positive valued angles are produced by counterclockwise rotation above the horizon and negative valued angles are produced by clockwise rotation below the horizon. This value is divided internally by 100.


lDim Parameter For DirectionEdgeStatistical

lDim

The dimension or the number of pixels used to calculate the edge in the specified direction.


lThreshold Parameter For DirectionEdgeStatistical

lThreshold

Threshold value used to determine which pixels are edge pixels. If the difference in the intensity value between the pixel being tested and the average intensity of the pixels in the lDim around it is greater than this value, the pixel is an edge pixel. The threshold range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. The threshold is applied on channels separately.


pRaster Parameter For DirectionEdgeStatistical

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for DirectionEdgeStatistical

Return Value

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


lFlags Parameter For DiscreteFourierTransformation

lFlags

Flags that indicate the transformation type, operation channel, frequency data type used to reconstruct the image, the clipping type, the used or computed frequencies range, the operation on the specified X harmonics range , and the operation on the specified Y harmonics range. You can use a bitwise OR (|) to specify one flag from each group.

The following flags represent the transformation type:

Value | Meaning
DFT_DFT | [0x0000001] Convert the image into frequency domain
DFT_IDFT | [0x0000002] Construct an image using the frequency components

The following flags represent the operation channel type:

Value | Meaning
DFT_BLUE | [0x0000010] Use the blue channel.
DFT_GREEN | [0x0000020] Use the green channel.
DFT_RED | [0x0000030] Use the red channel.
DFT_GRAY | [0x0000040] Use the master channel. If this flag is combined with FFT_IFFT, the reconstructed image will be gray.

The following flags represent the frequency data type used for constructing the image. This flag is used only if DFT_IDFT is set and will be ignored if DFT_DFT is set:

Value | Meaning
DFT_IDFT_MAG | [0x0000100] Construct the image from the frequency magnitude data only.
DFT_IDFT_PHS | [0x0000200] Construct the image from frequency phase data only.
DFT_IDFT_BOTH | [0x0000300] Construct the image from both magnitude and phase data.

The following flags represent the clipping type. This flag is used only if DFT_IDFT is set and ignored if DFT_DFT is set:

Value | Meaning
DFT_IDFT_CLIP | [0x0001000] Clip the constructed image values so they are between 0 and 255.
DFT_IDFT_SCL | [0x0002000] Scale the constructed image values so they are between 0 and 255.

The following flags represent which harmonics are used:

Value | Meaning
DFT_ALL | [0x0010000] Use or compute all harmonics. If this flag is used the range rectangle and the range flags will be ignored.
DFT_RANGE | [0x0020000] Use or compute the harmonics specified in the range rectangle.

The following flags represent the operations on the X Harmonics range:

Value | Meaning
DFT_INSIDE_X | [0x0100000] Use or compute only X harmonics inside the X range and ignore those outside the range.
DFT_OUTSIDE_X | [0x0200000] Use or compute only the X harmonics outside the X range and ignore those inside the range.

The following flags represent the operations on the Y Harmonics range:

Value | Meaning
DFT_INSIDE_Y | [0x1000000] Use or compute only Y harmonics inside the Y range and ignore those outside the range.
DFT_OUTSIDE_Y | [0x2000000] Use or compute only the Y harmonics outside the Y range and ignore those inside the range.


lMaxHarmonicX Parameter For DiscreteFourierTransformation

lMaxHarmonicX

Value that represents the maximum X harmonic. This value is (Width –1).


lMaxHarmonicY Parameter For DiscreteFourierTransformation

lMaxHarmonicY

Value that represents the maximum Y harmonic. This value is (Height –1).


lMinHarmonicX Parameter For DiscreteFourierTransformation

lMinHarmonicX

Value that represents the minimum X harmonic. This value is 0.


lMinHarmonicY Parameter For DiscreteFourierTransformation

lMinHarmonicY

Value that represents the minimum Y harmonic. This value is 0.


pRaster Parameter For DiscreteFourierTransformation

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for DiscreteFourierTransformation

Return Value

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


lFlags Parameter For DisplayFourierTransformation

lFlags

Flags that indicate the data to be shown and the plotting scale. You can use a bit-wise OR (|) to specify one flag from each group.

The following flags represent the data to be shown:

Value | Meaning
DSP_FT_MAG | [0x0001] Plot harmonics magnitude data.
DSP_FT_PHS | [0x0002] Plot harmonics phase data.

The following flags represent the plotting scale. These are ignored when DSP_FT_PHS is set:

Value | Meaning
DSP_FT_NORM | [0x0010] Plot harmonics magnitudes using the normal linear scale.
DSP_FT_LOG | [0x0020] Plot harmonics magnitudes using logarithmic scale.


pRaster Parameter For DisplayFourierTransformation

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for DisplayFourierTransformation

Return Value

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


iIndex Parameter for DoubleItemValue

iIndex

Index of the double item value from the double array.


crFillLower Parameter For DrawStar

crFillLower

Lower spoke side color.


crFillUpper Parameter For DrawStar

crFillUpper

Upper spoke side color.


iAngle Parameter For DrawStar

iAngle

Angle to rotate the star. This value is given in hundredths of a degree (+/-). This can be a number from 0 to 36,000. A positive value will rotate the star clockwise, while a negative value will rotate the star counter-clockwise.


iBorderOpac Parameter For DrawStar

iBorderOpac

Transparency, in percent, of the spoke border. The valid range is from –100 to 100.


iCenterX Parameter For DrawStar

iCenterX

X coordinate of the star center.


iCenterY Parameter For DrawStar

iCenterY

Y coordinate of the star center.


iDistOpac Parameter For DrawStar

iDistOpac

Percent of feathering in towards or outward from the spoke center. The valid range is from -100 to 100.


iHoleSize Parameter For DrawStar

iHoleSize

The hole size. This value is given as a percent of the whole star from which the rays start or in which they end. The valid range is from 0 to 100.


iOpacity Parameter For DrawStar

iOpacity

Transparency, in percent, between the star and the applied image. The valid range is from 0 to 100.


iPhase Parameter For DrawStar

iPhase

Angle to shift the star's rays. This value is given in hundredths of a degree (+/-). This can be a number from 0 to 36,000. A positive value will rotate the rays clockwise, while a negative value will rotate the rays counter-clockwise.


iSpoke Parameter For DrawStar

iSpoke

Number of spokes or rays directed inside or outside the star.


iSpokeDiv Parameter For DrawStar

iSpokeDiv

The percent by which to increment or decrement the size of the low part spoke. The valid range is from -100 to 100.


iStarHeight Parameter For DrawStar

iStarHeight

Star height.


iStarWidth Parameter For DrawStar

iStarWidth

Star width


lAngleOpac Parameter For DrawStar

lAngleOpac

Percent of feathering in towards or outward from the spoke border. The valid range is from -100 to 100.


lFlags Parameter For DrawStar

lFlags

Flag that indicates the direction of the rays. Possible values are:

Value | Meaning
STR_INSIDE | [0x0000] The rays are directed toward the center of the star.
STR_OUTSIDE | [0x0001] The rays are directed out from the center of the star.
STR_INNER | [0x0010] The rays fill the star outward from the center. This flag can only be used with STR_OUTSIDE.


pRaster Parameter For DrawStar

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for DrawStar

Return Value

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


iDim Parameter For Dry

iDim

Dimensions of the neighborhood used in creating the effect (iDim x iDim), in pixels.


pRaster Parameter For Dry

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Dry

Return Value

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


lDim Parameter For DynamicBinary

lDim

Dimensions of the neighborhood used when evaluating each pixel (lDim x lDim), in pixels. lDim should be at least 1.


lLocalContrast Parameter For DynamicBinary

lLocalContrast

Local contrast threshold. If the contrast of the area surrounding the pixel is below lLocalContrast, the pixel is converted to black or white using a global pre-calculated threshold. If the contrast of the area surrounding the pixel is higher than lLocalContrast, the local threshold value is calculated and used. The range for lLocalContrast is 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit.


pRaster Parameter For DynamicBinary

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for DynamicBinary

Return Value

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


Flags Parameter For EdgeDetectEffect

Flags

Flag that indicates the type of edge to generate. Possible values are:

Value | Meaning
EDGE_SOFT | [0] Generate softer (smoother) edges.
EDGE_SOLID | [1] Generate rougher edges.


lLevel Parameter For EdgeDetectEffect

lLevel

Value used to determine the brightness of the edges. Standard value is 50. Valid values range from 1 to 100. Big values will produce bright edges.


lThreshold Parameter For EdgeDetectEffect

lThreshold

Threshold value used to determine which pixels are going to be filtered. If the difference determined for a pixel is less than this value, the pixel is set to 0. If the difference is greater, the filter will be applied to the pixel.


pRaster Parameter For EdgeDetectEffect

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for EdgeDetectEffect

Return Value

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


crBk Parameter For EdgeDetectStatic

crBk

The OLE_COLOR value that specifies the non edge color. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


crEdge Parameter For EdgeDetectStatic

crEdge

The OLE_COLOR value that specifies the edge color. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iDim Parameter For EdgeDetectStatic

iDim

Dimensions of the neighborhood used to detect edges (iDim x iDim), in pixels.


iThreshold Parameter For EdgeDetectStatic

iThreshold

Threshold value used to determine which pixels are edge pixels. If the difference determined by the edge detector algorithm for a pixel is greater than this value, the pixel is an edge pixel.


pRaster Parameter For EdgeDetectStatic

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for EdgeDetectStatic

Return Value

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


pRaster Parameter For ExtractMessage

pRaster

Pointer to the ILeadRaster object that references the bitmap from which to extract the message.


Return for ExtractMessage

Return Value

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


lIndex Parameter For Factor

lIndex

Index into the array of weight values. Possible values are 0 to FactorCount – 1.


lFlags Parameter For FastFourierTransformation

lFlags

Flags that indicate the transformation type, operation channel, frequency data type used to reconstruct the image, and the clipping type. You can use a bit-wise OR (|) to specify one flag from each group.

The following flags represent the transformation type:

Value | Meaning
FFT_FFT | [0x0001] Convert the image into frequency domain.
FFT_IFFT | [0x0002] Construct an image from internal frequency components. The image will be stored in pRaster.

The following flags represent the operation channel type:

Value | Meaning
FFT_BLUE | [0x0010] Work on the blue channel.
FFT_GREEN | [0x0020] Work on the green channel.
FFT_RED | [0x0030] Work on the red channel.
FFT_GRAY | [0x0040] Work on the master Channel. If this flag is combined with FFT_IFFT, the reconstructed image will be gray.

The following flags represent the frequency data type used for constructing the image. This flag is used only if FFT_IFFT is set and will be ignored if FT_FFT is set:

Value | Meaning
FFT_IFFT_MAG | [0x0100] Construct the image from the frequency magnitude only.
FFT_IFFT_PHS | [0x0200] Construct the image from the frequency phase only.
FFT_IFFT_BOTH | [0x0300] Construct the image from both magnitude and phase.

The following flags represent the clipping type. This flag is used only if FFT_IFFT is set and will be ignored if FFT_FFT is set:

Value | Meaning
FFT_IFFT_CLIP | [0x1000] Clip the constructed image values to be between 0 and 255.
FFT_IFFT_SCL | [0x2000] Scale the constructed image. Valid values are between 0 and 255.


pRaster Parameter For FastFourierTransformation

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for FastFourierTransformation

Return Value

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


iIndex Parameter for FloatItemValue

iIndex

Index of the float item value from the float array.


Return for FreeFourierTransformation

Return Value

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


crFill Parameter For FreeHandShear

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iScale Parameter For FreeHandShear

iScale

Factor used to increase or decrease the various amplitude values in the Amplitudes property. Each value in the Amplitudes property is multiplied by this factor. The real factor value is the iScale value divided by 100. The valid range is from 0 to 100.


lFlags Parameter For FreeHandShear

lFlags

Flags that indicate how to handle exposed areas, and the direction of the shear wave. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle the exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed area with crFill.
FILL_RPT | [0x0001] Stretch the edges of the image to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the direction of the shear wave:

Value | Meaning
SHR_HORZ | [0x0000] Apply the shear wave horizontally.
SHR_VERT | [0x0010] Apply the shear wave vertically.


pRaster Parameter For FreeHandShear

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for FreeHandShear

Return Value

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


crFill Parameter For FreeHandWave

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iAngle Parameter For FreeHandWave

iAngle

Wave rotation angle in tenths of a degree (+/-). The valid range is from –3600 to 3600. The value in degrees is iAngle divided by 10.


iScale Parameter For FreeHandWave

iScale

Factor used to increase or decrease the various amplitude values in the Amplitudes property. Each value in the Amplitudes property is multiplied by this factor. The real factor value is the iScale value divided by 100.


iWaveLen Parameter For FreeHandWave

iWaveLen

Value that represents the wave length, if DIS_PER is set in the lFlags parameter. Possible values range from 1– 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in lFlags, this value is the number of repeated waves.


lFlags Parameter For FreeHandWave

lFlags

Flags that indicate how to handle exposed areas and the type of information contained in iWaveLen. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the type of information in the iWaveLen parameter:

Value | Meaning
DIS_PER | [0x0000] The value in iWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is set, the valid range of iWaveLen is from 1 to 100.
DIS_FRQ | [0x0010] The value in iWaveLen is the frequency, or the number of times the wave repeats.


pRaster Parameter For FreeHandWave

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for FreeHandWave

Return Value

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


crFill Parameter For FreePlaneBend

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iScale Parameter For FreePlaneBend

iScale

Factor used to multiply the various amplitude values in the Curve property. Each value in the Curve property is multiplied by this factor. For example, if you want to double the size of the amplitude values, use a iScale value of 2; to triple the amplitudes values, use a iScale value of 3, etc. The top practical limit for this parameter is the width and height of the bitmap.


lFlags Parameter For FreePlaneBend

lFlags

Flags that indicate how to handle exposed areas and the plane along which to stretch the pixels. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.
The following are the flags that indicate the plane in which the stretching is to occur:
Value | Meaning
FPB_HORZ | [0x0010] Stretch the pixels along the vertical plane.
FPB_VERT | [0x0020] Stretch the pixels along the horizontal plane.
FPB_VRHZ | [0x0030] Stretch the pixels along the horizontal and vertical plane.


pRaster Parameter For FreePlaneBend

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for FreePlaneBend

Return Value

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


CenterX Parameter For FreeRadBend

CenterX

X coordinate of the surface center.


CenterY Parameter For FreeRadBend

CenterY

Y coordinate of the surface center.


crFill Parameter For FreeRadBend

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iScale Parameter For FreeRadBend

iScale

Factor used to multiply the various amplitude values in the Curve property. Each value in the Curve property is multiplied by this factor. For example, if you want to double the size of the amplitude values, use an iScale value of 2; to triple the amplitudes values, use an iScale value of 3, etc. The top practical limit for this parameter is the width and height of the bitmap.


lFlags Parameter For FreeRadBend

lFlags

Flags that indicate how to handle peripherally exposed areas and areas exposed inside the surface. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle peripherally exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.
The following are the flags that indicate how to handle exposed areas inside the surface:
Value | Meaning
FILL_ROT | [0x0000] Rotate the image inside the surface pattern.
FILL_WOUTROT | [0x0010] Fill the exposed center the same way the peripherally exposed areas are filled.


pRaster Parameter For FreeRadBend

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for FreeRadBend

Return Value

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


lFlags Parameter For FrequencyFilter

lFlags

Flags that indicate the operation to be performed on the specified X and Y harmonics ranges. You can use a bit wise OR (|) to specify one flag from each group.

The following flags represent operations on the X harmonics range:

Value | Meaning
FRQ_INSIDE_X | [0x0001] Keep the X harmonics inside the X range and remove outside ones.
FRQ_OUTSIDE_X | [0x0002] Remove the X harmonics inside the X range and keep outside ones.

The following flags represent operations on the Y harmonics range:

Value | Meaning
FRQ_INSIDE_Y | [0x0010] Keep the Y harmonics inside the Y range and remove outside ones.
FRQ_OUTSIDE_Y | [0x0020] Remove the Y harmonics inside the Y range and keep outside ones.


lMaxHarmonicX Parameter For FrequencyFilter

lMaxHarmonicX

Value that represents the maximum X harmonic. This vlaue is (Width –1).


lMaxHarmonicY Parameter For FrequencyFilter

lMaxHarmonicY

Value that represents the maximum Y harmonic. This value is (Height –1).


lMinHarmonicX Parameter For FrequencyFilter

lMinHarmonicX

Value that represents the minimum X harmonic. This value is 0.


lMinHarmonicY Parameter For FrequencyFilter

lMinHarmonicY

Value that represents the minimum Y harmonic. This value is 0.


bOnOff Parameter For FrequencyFilterMask

bOnOff

Value that indicates whether the frequency components are removed if the corresponding pixel value is zero. Possible values are:

Value | Meaning
TRUE | If the pixel value equals zero the frequency components will be removed, otherwise no change.
FALSE | The frequency component in the pixel will be multiplied by the value of the pixel divided by 255.


pMaskRaster Parameter For FrequencyFilterMask

pMaskRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for FrequencyFilterMask

Return Value

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


Return for FrequencyFilter

Return Value

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


pRaster Parameter For FunctionalLight

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for FunctionalLight

Return Value

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


Channel Parameter For GetBitmapStatisticsInfo

Channel

Flag that indicates the channel for which to get the information. This value is ignored if the bitmap is 12 or 16-bit grayscale. Possible values are:

Value | Meaning
CHANNEL_MASTER | [0] All channels.
CHANNEL_RED | [1] Red channel only.
CHANNEL_GREEN | [2] Green channel only.
CHANNEL_BLUE | [3] Blue channel only.


lEnd Parameter For GetBitmapStatisticsInfo

lEnd

Indicates the ending color value of the range for the evaluation.


lStart Parameter For GetBitmapStatisticsInfo

lStart

Indicates the beginning color value of the range for the evaluation.


pRaster Parameter For GetBitmapStatisticsInfo

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for GetBitmapStatisticsInfo

Return Value

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


lFlags Parameter For GetCurvePoints

lFlags

Flag that indicates the method used to update the Amplitudes property. Possible values are:

Value | Meaning
GUB_CURVE | [0x0000] Fill the Amplitudes property with the best curve that passes through the points specified in the UserLUTCurveX and UserLUTCurveY properties.
GUB_LINEAR | [0x0001] Fill the Amplitudes property with lines that pass through the points specified in the UserLUTCurveX and UserLUTCurveY properties.


Return for GetCurvePoints

Return Value

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


Return for GetFeretsDiameter

Return Value

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


lFlags Parameter For GetLinearVOILUT

lFlags

Reserved for future use. Pass 0.


pRaster Parameter For GetLinearVOILUT

pRaster

Pointer to the ILEADObject to modify.


Return for GetLinearVOILUT

Return Value

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


pRaster Parameter For GetMarksCenterMass

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for GetMarksCenterMass

Return Value

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


bWeighted Parameter For GetObjectInfo

bWeighted

Flag that indicates the weighting factor. Possible values are:

Value | Meaning
TRUE | The pixel intensity value (color) will be used as a weighting factor.
FALSE | All non-zero pixels will have the same weight.


pRaster Parameter For GetObjectInfo

pRaster

The ILEADRaster object that references the bitmap for which to get the object info.


Return for GetObjectInfo

Return Value

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


pRaster Parameter For GetRgnContourPoints

pRaster

The ILEADRaster object that references the bitmap that contains the region.


Return for GetRgnContourPoints

Return Value

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


pRaster Parameter For GetRgnPerimeterLength

pRaster

The ILEADRaster object that references the bitmap containing the region.


Return for GetRgnPerimeterLength

Return Value

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


pRaster Parameter For GetTransformationParameters

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for GetTransformationParameters

Return Value

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


iCellHeight Parameter For GlassEffect

iCellHeight

Value that represents the height of a cell in pixels or the number of cells present across the height of the bitmap, based on the flags set in uFlags. The valid range is between 2 and half the bitmap height.


iCellWidth Parameter For GlassEffect

iCellWidth

Value that represents the width of a cell in pixels or the number of cells present across the width of the bitmap, based on the flags set in lFlags. The valid range is between 2 and half the bitmap width.


lFlags Parameter For GlassEffect

lFlags

Flags that indicate what type of data is in the iCellWidth and iCellHeight parameters. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate the type of data in the iCellWidth parameter:

Value | Meaning
GLASS _WFRQ | [0x0001] The parameter iCellWidth is the number of cells along the width of the bitmap.
GLASS_WPER | [0x0002] The parameter iCellWidth is the width of the cell in pixels.
The following are the flags that indicate the type of data in the iCellHeight parameter:
Value | Meaning
GLASS _HFRQ | [0x0010] The parameter iCellHeight is the number of cells along the height of the bitmap.
GLASS_HPER | [0x0020] The parameter iCellWidth is the height of the cell in pixels.


pRaster Parameter For GlassEffect

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for GlassEffect

Return Value

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


iBright Parameter For GlowFilter

iBright

Brightness factor used to create the "glow". This can be any number that is 0 or greater. If it is 0 the image will be black.


iDim Parameter For GlowFilter

iDim

Size of the neighborhood used to determine the width of the glow.


iThreshold Parameter For GlowFilter

iThreshold

Threshold value used to determine which pixels are edge pixels. If the difference determined for a pixel is greater than this value, the pixel is an edge pixel. Valid values range from 0 through 255. Use this parameter to control the number of edge pixels found.


pRaster Parameter For GlowFilter

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for GlowFilter

Return Value

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


iIndex Parameter For GrayColorBlue

iIndex

Index into the array of color values. Valid values range from 0 to GrayColorCount – 1.


iIndex Parameter For GrayColorGreen

iIndex

Index into the array of color values. Valid values range from 0 to GrayColorCount – 1.


iIndex Parameter For GrayColorRed

iIndex

Index into the array of color values. Valid values range from 0 to GrayColorCount – 1.


iIndex Parameter For GrayColorThreshold

iIndex

Index into the array of threshold values. Valid values range from 0 to GrayColorCount – 1.


iIndex Parameter For GrayScaleBlue

iIndex

Index into the array of blue color values. Valid values range from 0 to 255.


iIndex Parameter For GrayScaleGreen

iIndex

Index into the array of green color values. Valid values range from 0 to 255.


iIndex Parameter For GrayScaleRed

iIndex

Index into the array of red color values. Valid values range from 0 to 255.


crColor Parameter For GrayScaleToDuotone

crColor

An RGB color that will be used to create an array of colors internally. This parameter is used if the GrayScaleRed, GrayScaleBlue, and GrayScaleGreen. are not set. This parameter is ignored if these properties are set.


lFlags Parameter For GrayScaleToDuotone

lFlags

Flag that indicates whether colors will be mixed or replaced. Possible values are:

Value | Meaning
DT_MIX | [0x0000] Mix the old colors with the new ones
DT_REPLACE | [0x0001] Replace the old colors with the new ones


pRaster Parameter For GrayScaleToDuotone

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for GrayScaleToDuotone

Return Value

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


DistType Parameter for GrayScaleToMultitone

DistType

Flag that indicates the source of the colors to be added to the bitmap. Possible values are:

Value | Meaning
DT_LINEAR | [0] Use the linear gradient from dark to light, generated by the toolkit. If this flag is set, LEADTOOLS will ignore the pGradient parameter and update the pColor parameter with an array of colors generated by the toolkit.
DT_USER | [1] Use the user-defined gradient in the pGradient parameter.


Flags Parameter for GrayScaleToMultitone

Flags

Flag used to determine whether the new colors replace the old colors, or whether the new colors will be mixed with the old colors. Possible values are:

Value | Meaning
DT_MIX | [0] Mix the old colors with the new ones
DT_REPLACE | [1] Replace the old colors with the new ones


pRaster Parameter for GrayScaleToMultitone

pRaster

Pointer to the ILeadRaster object to be modified.


Return for GrayScaleToMultitone

Return Value

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


ToneType Parameter for GrayScaleToMultitone

ToneType

Flag that indicates the number of colors to add to the grayscale bitmap. Possible values are:

Value | Meaning
DT_MONOTONE | [0] Add one color.
DT_DUOTONE | [1] Add two colors.
DT_TRITONE | [2] Add three colors.
DT_QUADTONE | [3] Add four colors.


iAngle Parameter For Halftone

iAngle

The angle of rotation, expressed in hundredths of degrees. A value of 0 produces a horizontal halftone pattern. This parameter specifies the number of degrees to change the pattern. Positive values rotate the pattern clockwise; negative values rotate the pattern counterclockwise.

This value is ignored if the selected halftone pattern is HALFTONE_RECT, HALFTONE_CIRC, HALFTONE_RAND or HALFTONE_USERDEF.


iDim Parameter For Halftone

iDim

Value that indicates the size of the grain. This value is ignored if the selected halftone pattern is HALFTONE_VIEW or HALFTONE_PRINT. If the pattern is not HALFTONE_VIEW or HALFTONE_PRINT, iDim should be >= 1. If this parameter is < 1 this method will return ERROR_INV_PARAMETER (20013).


pRaster Parameter For Halftone

pRaster

ILEADRaster object to be modified.


Return for Halftone

Return Value

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


Type Parameter For Halftone

Type

Value that indicates the type of halftoning to perform. Possible values are:

Value | Meaning
HALFTONE_PRINT | Halftone for printing
HALFTONE_VIEW | Halftone for display
HALFTONE_RECT | Rectangular halftone
HALFTONE_CIRC | Circular halftone
HALFTONE_ELLIPS | Elliptical halftone
HALFTONE_RAND | Random halftone
HALFTONE_LINEAR | Linear halftone
HALFTONE_USERDEF | User defined halftone


pRaster Parameter For HolesRemovalBitmapRgn

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for HolesRemovalBitmapRgn

Return Value

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


lIndex Parameter For HSIHue

lIndex

Index into the array of hue values. Valid values are from 0 to HSICount –1.


lIndexParameter For HSIInnerHigh

lIndex

Index into the array of ending colors. Valid values are from 0 to HSICount –1.


lIndexParameter For HSIInnerLow

lIndex

Index into the array of starting colors. Valid values are from 0 to HSICount –1.


lIndex Parameter For HSIIntensity

lIndex

Index into the array of intensity values. Valid values are from 0 to HSICount –1.


lIndex Parameter For HSIOuterHigh

lIndex

Index into the array of ending colors. Valid values are from 0 to HSICount –1.


lIndex Parameter For HSIOuterLow

lIndex

Index into the array of starting colors. Valid values are from 0 to HSICount –1.


lIndex Parameter For HSISaturation

lIndex

Index into the array of saturation values. Valid values are from 0 to HSICount –1.


iHue Parameter For HueSaturationIntensity

iHue

Angular amount to change the hue, in hundredths of a degree. Valid values range from –18000 through 18000. This value is divided internally by 100.


iIntensity Parameter For HueSaturationIntensity

iIntensity

Percentage amount to change the intensity , in tenths of percent. Valid values range from –1000 (black) through 1000 (white). This value is divided internally by 10. Positive values increase (or lighten) the brightness of the bitmap image. Negative values decrease (or darken) the brightness of the bitmap image.


iSaturation Parameter For HueSaturationIntensity

iSaturation

Percentage amount to change saturation, in tenths of percent. Valid values range from –1000 through 1000. This value is divided internally by 10. Negative values decrease the saturation of colors. Positive values increase the saturation. The saturation level is increased or decreased by a percentage of its present saturation level. For example, an increase of 20% of the current saturation level "L" will raise the new saturation level "L1" to a value L = 0.20 * L. Likewise, increasing the saturation level 100% doubles the saturation level (L1 = L + 1.0 * L). Decreasing the saturation level 100% will set the new saturation level to 0. This process is carried out for every pixel. The saturation is set to 1000 (maximum value) if the new value exceeds 1000).


pRaster Parameter For HueSaturationIntensity

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for HueSaturationIntensity

Return Value

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


iHorzDim Parameter For Impressionist

iHorzDim

Horizontal effect size, in pixels. Possible values range from 1 – 100.


iVertDim Parameter For Impressionist

iVertDim

Vertical effect size, in pixels. Possible values range from 1 – 100.


pRaster Parameter For Impressionist

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Impressionist

Return Value

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


pRaster Parameter For InitFourierTransformation

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for InitFourierTransformation

Return Value

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


crIn Parameter For IntensityDetect

crIn

The color used to fill those pixels having an intensity value between iLow and iHigh. This parameter has no effect if the iChannel parameter is set to CHANNEL_MASTER. If for example the iChannel parameter is set to CHANNEL_RED, then the red component of crIn will be used to fill the pixels having a red component value between iLow and iHigh.


crOut Parameter For IntensityDetect

crOut

The color used to fill those pixels having an intensity value less than iLow or greater than iHigh. This parameter has no effect if the iChannel parameter is CHANNEL_MASTER. If for example the iChannel parameter is set to CHANNEL_RED, then the red component of crOut will be used to fill the pixels having a red component value less than iLow or greater than iHigh.


IChannel Parameter For IntensityDetect

iChannel

A value that indicates the channel to process. Possible values are:

Value | Meaning
CHANNEL_MASTER | [0x0000] Grayscale Channel.
CHANNEL_RED | [0x0001] Red Channel.
CHANNEL_GREEN | [0x0010] Green Channel.
CHANNEL_BLUE | [0x0100] Blue Channel.


iHigh Parameter For IntensityDetect

iHigh

Highest intensity to detect.


iLow Parameter For IntensityDetect

iLow

Lowest intensity to detect.


Return for IntensityDetect

Return Value

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


pRaster Parameter For IntensityDetect

pRaster

ILEADRaster object to be modified.


lHeight Parameter For IsRegistrationMark

lHeight

The height of the registration mark (in pixels).


lMaxScale Parameter For IsRegistrationMark

lMaxScale

Maximum scaling factor of mark to be detected. This is a percentage. It must not be lower than lMinScale, or an error will be returned.


lMinScale Parameter For IsRegistrationMark

lMinScale

Minimum scaling factor of mark to be detected. This is a percentage. It must not exceed lMaxScale, or an error will be returned.


lWidth Parameter For IsRegistrationMark

lWidth

The width of the registration mark (in pixels).


pRaster Parameter For IsRegistrationMark

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for IsRegistrationMark

Return Value

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


Type Parameter For IsRegistrationMark

Type

Value that specifies the type of registration mark for which to look. Possible values are:

Value | Meaning
RGS_T | [0x0000] T-shape registration mark.

Currently, only one registration mark is defined (T-shape). For more information, refer to the Results section for this method.


CenterX Parameter For LensFlare

CenterX

X coordinate of the point around which the effect is centered.


CenterY Parameter For LensFlare

CenterY

Y coordinate of the point around which the effect is centered.


crColor Parameter For LensFlare

crColor

The OLE_COLOR value that represents the color of the main flare.


iBright Parameter For LensFlare

iBright

The brightness of the flare. This value is divided internally by 100. This parameter affects the brightness of both the flare, and any lightened circles surrounding the flare.


lFlags Parameter For LensFlare

lFlags

Flag that indicates the lens type. Possible values are:

Value | Meaning
LNS_TYPE_1 | [0x0000] Standard lens
LNS_TYPE_2 | [0x0001] Moderate wide-angle lens
LNS_TYPE_3 | [0x0002] Moderate telephoto lens


pRaster Parameter For LensFlare

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for LensFlare

Return Value

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


iIndex Parameter For LightAvr

iIndex

Index into the array of new average pixel values. Possible values are:

0 | if lFlags in the LightControl method is set to YUV_SPACE or GRAY_SPACE.
0-> | if lFlags in the LightControl method is set to RGB_SPACE


lFlags Parameter For LightControl

lFlags

Flag that indicates which color space to remap. Possible values are:

Value | Meaning
RGB_SPACE | [0x0001] Use the histogram of RGB color space. (separated channels)
YUV_SPACE | [0x0002] Use the histogram of YUV color space.(Best results)
GRAY_SPACE | [0x0004] Use the histogram of a gray level representation of the image.


pRaster Parameter For LightControl

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for LightControl

Return Value

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


crAmbient Parameter For Light

crAmbient

The OLE_COLOR value that specifies the ambient color of the light sources.


crFill Parameter For Light

crFill

Color of the light.


iAmbient Parameter For Light

iAmbient

Factor used when mixing the ambient color with the image.


iBright Parameter For Light

iBright

Intensity or brightness of the light.


iCenterX Parameter For Light

iCenterX

X coordinate of the center of the ellipse used to represent the light.


iCenterY Parameter For Light

iCenterY

Y coordinate of the center of the ellipse used to represent the light.


iEdge Parameter For Light

iEdge

Percentage by which to smooth the light border. The valid range is from 0

to 100.


iHeight Parameter For Light

iHeight

Value that represents the height of the ellipse used to represent the light.


iImageBright Parameter For Light

iImageBright

Value that represents the brightness of the ambient light of the entire image. This can be any number that is 0 or greater. If it is 0 the image will be black. This value is divided internally by 100.


iLightNo Parameter For Light

iLightNo

The number of light sources.


iOpacity Parameter For Light

iOpacity

Opacity of the light.


iWidth Parameter For Light

iWidth

Value that represents the width of the ellipse used to represent the light.


lAngle Parameter For Light

lAngle

Angle by which to rotate the ellipse that represents the light. This value is given in hundredths of a degree (+/-). This can be a number from 0 to 36,000. A positive value will rotate the ellipse clockwise, while a negative value will rotate the ellipse counter-clockwise.


lFlags Parameter For Light

lFlags

Value that determines the light source type. Possible values are:

Value | Meaning
LGT_SPOTLIGHT | [0x0000] The light will appear as a spotlight, based on the values in the iWidth, iHeight, lAngle and iEdge parameters.
LGT_DIRELIGHT | [0x0001] The light will be applied to the whole image. If this flag is used, the iWidth, iHeight, lAngle, iEdge parameters will be ignored.


iIndex Parameter For LightLowerAvr

iIndex

Index into the array of new average pixel values. Possible values are:

0 | if lFlags in the LightControl method is set to YUV_SPACE or GRAY_SPACE.
0-> | if lFlags in the LightControl method is set to RGB_SPACE


pRaster Parameter For Light

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Light

Return Value

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


iIndex Parameter For LightUpperAvr

iIndex

Index into the array of new average pixel values. Possible values are:

0 | if lFlags in the LightControl method is set to YUV_SPACE or GRAY_SPACE.
0-> | if lFlags in the LightControl method is set to RGB_SPACE


iHeight Parameter For LocalHistoEqualize

iHeight

The height of the local histogram equalizer rectangle in pixels. The height should be more than zero.


iSmooth Parameter For LocalHistoEqualize

iSmooth

Size of the area to be used when smoothing the edges between localized blocks. Possible values range from 0 to 7, but if iHeight is less than or equal to 7 then the maximum value for this item is iHeight - 1. If iSmooth = 0 the method will operate without smoothing edges.


iType Parameter For LocalHistoEqualize

iType

Flag that indicates which color space to equalize. Possible values are:

Value | Meaning
RGB_SPACE | [0x0001] Linearize the number of pixels across the RGB color space. (Separated channels)
YUV_SPACE | [0x0002] Linearize the number of pixels across the YUV color space.(Best results)
GRAY_SPACE | [0x0004] Linearize the number of pixels per gray level in a gray level representation of the image.


iWidth Parameter For LocalHistoEqualize

iWidth

The width of the local histogram equalizer rectangle in pixels. The width should be more than zero.


ixExt Parameter For LocalHistoEqualize

ixExt

The extension of the width of the local histogram equalizer rectangle, in pixels.


iyExt Parameter For LocalHistoEqualize

iyExt

The extension of the height of the local histogram equalizer rectangle, in pixels.


pRaster Parameter For LocalHistoEqualize

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for LocalHistoEqualize

Return Value

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


iIndex Parameter for LongItemValue

iIndex

Index of the long item value from the long array.


iIndex Parameter For MarkCMPointX

iIndex

Index into the array of X coordinates. Valid values are from 0 to 2.


iIndex Parameter For MarkCMPointY

iIndex

Index into the array of Y coordinates. Valid values are from 0 to 2.


lIndex Parameter For Mark

lIndex

Index into the array of registration mark information.


iIndex Parameter For MarkPointX

iIndex

Index into the array of X coordinates. Valid values are from 0 to 2.


iIndex Parameter For MarkPointY

iIndex

Index into the array of Y coordinates. Valid values are from 0 to 2.


lFactor Parameter For MathFunction

lFactor

Factor used as an Amplitude factor when squaring, taking the log of or taking the square root of the color values, and as a Frequency factor when taking the sine or cosine of the color values. The value of lFactor is divided internally by different amounts, according to the type of the function being used. These amounts are as follows:

If Type is set to: | then the lFactor will be divided by:
MF_SQR | 10000 internally
MF_LOG | 10 internally
MF_SQRT | 10 internally
MF_SIN | 100 internally
MF_COS | 100 internally


pRaster Parameter For MathFunction

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for MathFunction

Return Value

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


Type Parameter For MathFunction

Type

Value that represents the function to be applied. Possible values are:

Value | Meaning
MF_SQR | [0] Square the values.
MF_LOG | [1] Take the log of the values.
MF_SQRT | [2] Take the square root of the values.
MF_SIN | [3] Take the sine of the values.
MF_COS | [4] Take the cosine of the values


iFactor Parameter For Multiply

iFactor

An integer which represents the factor to be used when multiplying image values. The factor used is equal to iFactor/100.


pRaster Parameter For Multiply

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Multiply

Return Value

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


lContrast Parameter For MultiScaleEnhancement

lContrast

Fraction of contrast enhancement applied to the image. Valid values range from 0 – 10000, which are interpreted as 0% - 100%. This value is internally divided by 10000. Greater values will produce stronger contrast.


lEdgeCoeff Parameter For MultiScaleEnhancement

lEdgeCoeff

The edge enhancement coefficient. This value will be internally divided by 100. Set this parameter to MSE_DEFAULT to use the default values (which is 170 interpreted as 1.7). This option will be used only if MSE_EDGEENH is set in lFlags. Any value (>= 0) is valid. A value of 100 will be interpreted as 1.0 and will keep the bitmap’s edges un-enhanced. Larger values will produce more visible edges. Smaller values will produce less visible edges. Practically, the enhancement levels out at 200000 (interpreted as 2000.0) – values bigger than that will not enhance the bitmap’s edges any more.


lEdgeLevels Parameter For MultiScaleEnhancement

lEdgeLevels

The number of levels that will be used for edge enhancement. Valid values are from 1 to the maximum number of levels of the image. If MSE_DEFAULT is set in in this parameter, the method will use the default number of levels (which is 3). This option will take effect only if the MSE_EDGEENH is set in lFlags. Passing zero will return an error code.


lFlags Parameter For MultiScaleEnhancement

lFlags

Flags that determine method behavior. You can specify none, one or both of the following values:

Value | Meaning
MSE_EDGEENH | [0x0010] Add the edge enhancement option to the method. When this flag is set, the lEdgeLevels and lEdgeCoeff parameters will be used.
MSE_LATRED | [0x0020] Add the latitude reduction option to the method.. When this flag is set, lLatitudeLevel and lLatitudeCoeff will be used.

You must also specify one of the following values:

Value | Meaning
MSE_GAUSSIAN | [0x0000] Use Gaussian filter.
MSE_RESAMPLE | [0x0001] Use resample filter.
MSE_BICUBIC | [0x0002] Use bicubic filter.
MSE_NORMAL | [0x0003] Use normal filter.


lLatitudeCoeff Parameter For MultiScaleEnhancement

lLatitudeCoeff

The latitude reduction coefficient. This value will be internally divided by 100. Pass MSE_DEFAULT for this parameter to use the default value (which is 140 interpreted as 1.4). This option will be used only if MSE_LATRED is set in lFlags. Any value (>= 0) is valid. A value of 100 will be interpreted as 1.0 and will keep the bitmap’s latitude un-enhanced. Decreasing latitude makes the bitmap brighter, increasing latitude makes the bitmap dimmer. Practically, the enhancement levels out at 200000 (interpreted as 2000,0) – values bigger than that will not decrease the bitmap’s latitude any more.


lLatitudeLevels Parameter For MultiScaleEnhancement

lLatitudeLevels

The number of levels that will be used for Latitude reduction. Valid values are from 1 to maximum number of levels of the image. You can also pass MSE_DEFAULT in this parameter to use the default level value (which is 5). This option will be used only if MSE_LATRED is set in lFlags. Passing zero will return an error code.


pRaster Parameter For MultiScaleEnhancement

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for MultiScaleEnhancement

Return Value

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


iIndex Parameter for MultitoneColors

iIndex

Index of the color. Possible values range from 0 to 3.


iCol Parameter for MultitoneGradient

iCol

Value that indicates the column of the pallete entry. Possible values range from 0 to 255.


iRow Parameter for MultitoneGradient

iRow

Value that indicates the row of the pallete entry. Possible values range from 0 to 3.


bLowerTrnsp Parameter For Ocean

bLowerTrnsp

Flag that indicates the transparency direction. Possible values are:

Value | Meaning
TRUE | Transparency increases as you move from the bottom of the bitmap to the top of the bitmap, line by line.
FALSE | Transparency increases as you move from the top of the bitmap to the bottom of the bitmap, line by line.


iAmplitude Parameter For Ocean

iAmplitude

Wave magnitude, in pixels.


iFrequency Parameter For Ocean

iFrequency

Number of repeated waves.


pRaster Parameter For Ocean

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Ocean

Return Value

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


CenterX Parameter For Pixelate

CenterX

Value that represents the X cordinate for the center of revolution when circular cells are used. This parameter will be ignored if PIX_RECT is set in lFlags.


CenterY Parameter For Pixelate

CenterY

Value that represents the Y cordinate for the center of revolution when circular cells are used. This parameter will be ignored if PIX_RECT is set in lFlags.


iCellHeight Parameter For Pixelate

iCellHeight

Value that represents the height of a rectangular cell, the number of rectangular cells present across the height of the bitmap, the number of cells along the radius of a circular cell, or the length of each cell along the radius of a circular cell, based on the flags set in lFlags. For more information, refer to the Remarks section.


iCellWidth Parameter For Pixelate

iCellWidth

Value that represents the width of a rectangular cell, the number of rectangular cells present across the width of the bitmap, the number of cells around the center point of a circular cell, or the length in degrees of each cell around the center point of a circular cell, based on the flags set in lFlags. For more information, refer to the Remarks section below.


iOpacity Parameter For Pixelate

iOpacity

Value that represents how transparent the cells are, compared to the original pixels. This is a percentage. Possible values are 0 – 100. (0 is total transparency and 100 is total opacity.)


lFlags Parameter For Pixelate

lFlags

Flags that indicate the values used to fill the cells, the shape of the cells, and what type of data is in the iCellWidth and iCellHeight parameters. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags indicate what values will be used to fill the cells:

Value | Meaning
PIX_MAX | [0x0000] Fill the cell with its maximum pixel value.
PIX_MIN | [0x0001] Fill the cell with its minimum pixel value.
PIX_AVR | [0x0002] Fill the cell with its average pixel value.

The following are the flags that indicate the shape of the cells:

Value | Meaning
PIX_RECT | [0x0000] Divide the image into rectangular cells. If this flag used, the iCellWidth value contains the cell width in pixels or the number of cells across the width of the bitmap. iCellHeight contains the cell height in pixels or the number of cells across the height of the bitmap.
PIX_RAD | [0x0010] Divide the image into circular cells, centered around CenterX,CenterY. If this flag is used, the iCellWidth value determines the angular component of the cell, and iCellHeight determines the radial component of the cell. Please note that PIX_RAD must be OR-ed with PIX_WPER or PIX_WFRQ

The following are the flags that indicate what information is contained in the iCellWidth and iCellHeight parameters:

Value | Meaning
PIX_WFRQ | [0x0100] Indicates the number of cells along the width of the bitmap if rectangular cells are used. If circular cells are used, this indicates the number of cells present around the center of the circle.
PIX_WPER | [0x0200] Indicates the width, in pixels of a cell, if rectangular cells are used. If circular cells are used, this indicates the number of degrees in each cell around the center point.
PIX_HFRQ | [0x0400] Indicates the number of cells along the height of the bitmap if rectangular cells are used. If circular cells are used, this indicates the number of cells present along the radius of the circle.
PIX_HPER | [0x0800] Indicates the height, in pixels of a cell, if rectangular cells are used. If circular cells are used, this indicates the radial length of each cell along the radius.


pRaster Parameter For Pixelate

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Pixelate

Return Value

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


CenterX Parameter For PlaneBend

CenterX

X coordinate of the point at which the camera or viewer is looking. This is also the point toward which the bitmaps will be bent. It may be outside the bitmap borders.


CenterY Parameter For PlaneBend

CenterY

Y coordinate of the point at which the camera or viewer is looking. This is also the point toward which the bitmaps will be bent. It may be outside the bitmap borders.


crBright Parameter For PlaneBend

crBright

The color value that specifies the color of an external light source that shines on the displayed bitmaps.


crFill Parameter For PlaneBend

crFill

The color value that specifies the background color.


iBendFactor Parameter For PlaneBend

iBendFactor

Determines the plane’s bending value. The range starts at 100 and increases indefinitely. If iBendFactor equals 100 the planes will not be bent. If iBendFactor > 100 planes will be bent. The value of this parameter is internally divided by 100.


iBrightLength Parameter For PlaneBend

iBrightLength

Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.


iDistance Parameter For PlaneBend

iDistance

Camera distance from the viewing screen, in pixels.


iEndBright Parameter For PlaneBend

iEndBright

Value that indicates the brightness of an external light source on the last bitmap displayed. Possible values range from 0 to 100. A value of 0 indicates no external light displayed on the bitmap. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.


iPlaneOffset Parameter For PlaneBend

iPlaneOffset

Distance between the parallel planes.


iRepeat Parameter For PlaneBend

iRepeat

Number of times the bitmap repeats along the Z-axis. If iRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.


iStartBright Parameter For PlaneBend

iStartBright

Value that indicates the brightness of an external light source on the first bitmap displayed. Possible values range from 0 to 100. A value of 0 indicates no external light displayed on the bitmap. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.


iStretch Parameter For PlaneBend

iStretch

Value that indicates whether to expand or compress the bitmap, and by how much. If iStretch < 100 bitmap will be expanded. If iStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.


iZValue Parameter For PlaneBend

iZValue

Viewing screen offset on the Z-axis, in pixels.


lFlags Parameter For PlaneBend

lFlags

Flags that indicate the background color and the planes to be shown.

You can use a bit wise OR (|) to specify one flag from each group. The following are the flags that indicate the background color:

Value | Meaning
PLANE_FILL_CLR | [0x0001] Use the crFill as a background color.
PLANE_NO_CHG | [0x0002] Use the image itself as a background
The following are the flags that indicate which planes (with respect to the Z-axis) will be shown. You can use a bit wise OR (|) to specify more than one plane. However, you can only combine PLANE_LEFT with PLANE_RIGHT or PLANE_UP with PLANE_DOWN.
Value | Meaning
PLANE_LEFT | [0x0010] The plane will be displayed to the left of the Z-axis.
PLANE_RIGHT | [0x0020] The plane will be displayed to the right of the Z-axis.
PLANE_UP | [0x0040] The plane will be displayed above the Z-axis.
PLANE_DOWN | [0x0080] The plane will be displayed below the Z-axis.


lPydAngle Parameter For PlaneBend

lPydAngle

The view angle, off the Z-axis. This value is given in hundredths of a degree (+/-). This can be a number from 0 to 36,000.


pRaster Parameter For PlaneBend

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for PlaneBend

Return Value

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


CenterX Parameter For Plane

CenterX

X coordinate of the point at which the camera or viewer is looking. It may be outside the bitmap borders.


CenterY Parameter For Plane

CenterY

Y coordinate of the point at which the camera or viewer is looking. It may be outside the bitmap borders.


crBright Parameter For Plane

crBright

The color value that specifies the color of an external light source that shines on the displayed bitmaps.


crFill Parameter For Plane

crFill

The color value that specifies the background color.


iBrightLength Parameter For Plane

iBrightLength

Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.


iDistance Parameter For Plane

iDistance

Camera distance from the viewing screen, in pixels.


iEndBright Parameter For Plane

iEndBright

Value that indicates the brightness of an external light source on the last bitmap displayed. Possible values range from 0 to 100. A value of 0 indicates no external light displayed on the bitmap. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.


iPlaneOffset Parameter For Plane

iPlaneOffset

Distance between the parallel planes.


iRepeat Parameter For Plane

iRepeat

Number of times the bitmap repeats along the Z-axis. If iRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.


iStartBright Parameter For Plane

iStartBright

Value that indicates the brightness of an external light source on the first bitmap displayed. Possible values range from 0 to 100. A value of 0 indicates no external light displayed on the bitmap. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.


iStretch Parameter For Plane

iStretch

Value that indicates whether to expand or compress the bitmap, and by how much. If iStretch < 100 bitmap will be expanded. If iStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.


iZValue Parameter For Plane

iZValue

Viewing screen offset on the Z-axis, in pixels.


lFlags Parameter For Plane

lFlags

Flags that indicate the background color and the planes to be shown. You can use a bit wise OR (|) to specify one flag from each group. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate the background color:

Value | Meaning
PLANE_FILL_CLR | [0x0001] Use the crFill as a background color.
PLANE_NO_CHG | [0x0002] use the image itself as a background
The following are the flags that indicate which planes (with respect to the Z-axis) will be shown. You can use a bit wise OR (|) to specify more than one plane.
Value | Meaning
PLANE_LEFT | [0x0010] The plane will be displayed to the left of the Z-axis.
PLANE_RIGHT | [0x0020] The plane will be displayed to the right of the Z-axis.
PLANE_UP | [0x0040] The plane will be displayed above the Z-axis.
PLANE_DOWN | [0x0080] The plane will be displayed below the Z-axis.


lPydAngle Parameter For Plane

lPydAngle

The view angle, off the Z-axis. This value is given in hundredths of a degree (+/-). This can be a number from 0 to 36,000.


pRaster Parameter For Plane

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Plane

Return Value

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


crFill Parameter For Polar

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


lFlags Parameter For Polar

lFlags

Flags that indicate how to handle exposed areas and the type of conversion. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the conversion type:

Value | Meaning
CART_TO_POL | [0x0000] Convert the image from Cartesian (rectangular) coordinates to polar coordinates.
POL_TO_CART | [0x0010] Convert the image from polar coordinates to Cartesian (rectangular) coordinates.


pRaster Parameter For Polar

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Polar

Return Value

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


CenterX Parameter For Punch

CenterX

X coordinate of the point around which the image will be pinched or punched.


CenterY Parameter For Punch

CenterY

Y coordinate of the point around which the image will be pinched or punched.


crFill Parameter For Punch

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iStress Parameter For Punch

iStress

Amount of punching intensity. This value is ignored when iValue is less than 0. Valid values range from 0 to 1000.


iValue Parameter For Punch

iValue

Amount of stretching where positive values pinch the image toward its center and negative values expand the image away from its center. Valid values range from –500 to 500.


lFlags Parameter For Punch

lFlags

Flags that indicate how to handle exposed areas, both centrally and peripherally. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle peripherally exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate how to handle centrally exposed areas:

Value | Meaning
FILL_ROT | [0x0000] Rotate the image inside the pinch pattern.
FILL_WOUTROT | [0x0010] Fill the exposed center the same way the peripherally exposed areas are filled.

This flag is ignored if the iValue is positive.


pRaster Parameter For Punch

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Punch

Return Value

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


crColor Parameter For PuzzleEffect

crColor

If PUZZLE_BORDER is set in lFlags, this value represents the color of the border that will be drawn around the blocks. This parameter is ignored if the PUZZLE_BORDER flag is not set.


lFlags Parameter For PuzzleEffect

lFlags

Flags that specify how to apply the puzzle effect. Possible values are:

Value | Meaning
PUZZLE_BORDER | [0x0001] Draw borders around the puzzle blocks. Use the crColor parameter to pass the border color. If the BITMAP_RESIZE flag is not set and the edge blocks have a different size than the inner blocks, the border will not be drawn for the right and the bottom edges.
PUZZLE_SHUFFLE | [0x0002] Shuffle the blocks around, controlling the randomization process by the lRandomize parameter. If this flag is not set, the blocks will stay in their original position.
PUZZLE_SIZE | [0x0010] Apply the puzzle effect using the the lXBlock and lYBlock parameters as the width and height of each block, in pixels.
PUZZLE_COUNT | [0x0020] Apply the puzzle effect using the the lXBlock and lYBlock parameters as the number of blocks per row and per column.
BITMAP_RESIZE | [0x0100] Resize the image to be sure that all blocks have equal size. If this flag is not set then the remainder of the image (edge blocks) will be manipulated differently than the inner blocks.


lRandomize Parameter For PuzzleEffect

lRandomize

The starting point for the randomization process. Valid values range from 0 through 500. Use 0 to have the method select the starting point.


lXBlock Parameter For PuzzleEffect

lXBlock

If the PUZZLE_SIZE flag is set, this value represents the width of the each block, in pixels. If the PUZZLE_COUNT flag is set, it represents the number of blocks per row.


lYBlock Parameter For PuzzleEffect

lYBlock

If the PUZZLE_SIZE flag is set, this value represents the height of the each block, in pixels. If the PUZZLE_COUNT flag is set, it represents the number of blocks per column.


pRaster Parameter For PuzzleEffect

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for PuzzleEffect

Return Value

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


CenterX Parameter For RadialBlur

CenterX

X coordinate of the point around which the pixels are rotated.


CenterY Parameter For RadialBlur

CenterY

Y coordinate of the point around which the pixels are rotated.


iDim Parameter For RadialBlur

iDim

An integer that represents the size of the neighborhood used in blurring. Increasing this value will increase the amount of blurring. Valid values range from 1 through 100.


iStress Parameter For RadialBlur

iStress

An integer that represents the amount of the blur intensity. Valid values range from 1 through 100.


pRaster Parameter For RadialBlur

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for RadialBlur

Return Value

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


CenterX Parameter For RadWave

CenterX

X ccordinate of the point from which the wave radiates.


CenterY Parameter For RadWave

CenterY

Y ccordinate of the point from which the wave radiates.


crFill Parameter For RadWave

crFill

The OLE_COLOR value that specifies the fill color for any exposed area. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iAmplitude Parameter For RadWave

iAmplitude

Value that represents the magnitude of the wave. Valid values range from 0 to 100.


iWaveLen Parameter For RadWave

iWaveLen

Value that represents the wave length, if DIS_PER is set in the lFlags parameter. Possible values range from 1 – 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in lFlags, this value is the number of repeated waves.


lFlags Parameter For RadWave

lFlags

Flags that indicate how to handle exposed areas and what type of information is in the iWaveLen parameter. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the type of information contained in the iWaveLen parameter:

Value | Meaning
DIS_PER | [0x0000] The value in iWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is set, the valid range of iWaveLen is from 0 to 100.
DIS_FRQ | [0x0010] The value in iWaveLen is the frequency, or the number of times the wave repeats.


lPhase Parameter For RadWave

lPhase

Wave phase shift, in hundredths of degrees. The valid range is from –36000 to 36000 (The value in degrees is lPhase divided by 100).


pRaster Parameter For RadWave

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for RadWave

Return Value

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


iIndex Parameter For ReferencePointsX

iIndex

Index into the array of X coordinates. Possible values are from 0 to 2.


iIndex Parameter For ReferencePointsY

iIndex

Index into the array of X coordinates. Possible values are from 0 to 2.


lIndex Parameter For ReplaceColorFuzziness

lIndex

Index into the array of variance values. Valid values are from 0 to ReplaceColorsCount -1.


lIndex Parameter For ReplaceColorValue

lIndex

Index into the array of colors to be replaced. Valid values are from 0 to ReplaceColorsCount -1.


lLineSpace Parameter For RevEffect

lLineSpace

The space (in pixels) between each wave.


lMaximumHeight Parameter For RevEffect

lMaximumHeight

The maximum height (in pixels) that the wave can reach.


pRaster Parameter For RevEffect

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for RevEffect

Return Value

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


crColor Parameter For RingEffect

crColor

The color used to fill the exposed area. This parameter is used only if lFlags contains RING_COLOR.


iAngle Parameter For RingEffect

iAngle

The rotation angle value for each ring compared to the inner ring, in hundredths of degrees. This parameter is used only if lFlags contains RING_FIXEDANGLE. The range of the acceptable values is from –18000 to 18000. This value is divided internally by 100.


iXOrigin Parameter For RingEffect

iXOrigin

The X-Coordinate (in pixels) for the origin of the rings.


iYOrigin Parameter For RingEffect

iYOrigin

The Y-Coordinate (in pixels) for the origin of the rings.


lFlags Parameter For RingEffect

lFlags

Flags which control the method behavior. These flags can be OR-ed together with any other flag, unless otherwise specified.

Value | Meaning
RING_COLOR | [0x0000] Controls the output of rings which have undefined areas. Fill the exposed areas with color crColor. If you use this flag, do not use RING_REPEAT or RING_NOCHANGE.
RING_REPEAT | [0x0001] Controls the output of rings which have undefined areas. Repeat the edges of the region and fill these values in the undefined areas. The edge will be repeated halfway throughout the missing portion of the ring. If you use this flag, do not use RING_COLOR or RING_NOCHANGE.
RING_NOCHANGE | [0x0002] Controls the output of rings which have undefined areas. Leave the edge pixels unchanged. If you rotate an incomplete ring, the original bitmap pixels will remain in places where you would have undefined portions of the ring. If you use this flag, do not use RING_COLOR or RING_REPEAT.
RING_FIXEDANGLE | [0x0010] Rotate each ring against the inner ring by a fixed rotation angle inAngle).
RING_RADIUS | [0x0100] Indicates that lRadius contains the width of each ring, in pixels. If you use this flag, do not use RING_MAXRADIUS.
RING_MAXRADIUS | [0x0200] Indicates that lRadius contains the maximum radius, in pixels, that corresponds to the external ring. In this case, the width of each ring is lRadius / (lRingCount + 1). If you use this flag, do not use RING_RADIUS.


lRadius Parameter For RingEffect

lRadius

If the flag RING_RADIUS is set in lFlags, this is the width of each ring, in pixels. If RING_MAXRADIUS is set in lFlags, this is the maximum radius, in pixels. In this latter case, the width of each ring is equal to lRadius / (lRingCount + 1).


lRandomize Parameter For RingEffect

lRandomize

The starting point for the randomization process. Valid range is 0-500. If 0, the method will pick the starting point. If > 0, this value will be the starting point.


lRingCount Parameter For RingEffect

lRingCount

Number of rings.


pRaster Parameter For RingEffect

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for RingEffect

Return Value

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


CenterX Parameter For Ripple

CenterX

X coordinate for the center of the Ripple wave.


CenterY Parameter For Ripple

CenterY

Y coordinate for the center of the Ripple wave.


crFill Parameter For Ripple

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iAmplitude Parameter For Ripple

iAmplitude

Wave magnitude(amount of displacement).


iAttenuation Parameter For Ripple

iAttenuation

Attenuation value. The attenuation value indicates how rapidly the wave amplitude decays as the wave travels along the radial line. The values range from 0 - 1000.


iFrequency Parameter For Ripple

iFrequency

Number of repeated waves along the radial line.


iPhase Parameter For Ripple

iPhase

Wave phase shift, in hundredths of a degree. The valid range is from –36000 to 36000 (The value in degrees is iPhase divided by 100).


lFlag Parameter For Ripple

lFlag

Flag that indicates how to handle exposed areas. Possible values are:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.


pRaster Parameter For Ripple

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Ripple

Return Value

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


crSample Parameter For SampleTarget

crSample

The OLE_COLOR value that specifies the sample color. The red value for the red channel, green value for the green channel, and the blue value for the blue channel.


crTarget Parameter For SampleTarget

crTarget

The OLE_COLOR value that specifies the target color. The red value for the red channel, green value for the green channel, and the blue value for the blue channel.


lFlags Parameter For SampleTarget

lFlags

Flags that indicates the channel for which to shift the color and how to remap the other values for that channel. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate the channel:

Value | Meaning
SAMP_RED | [0x0001] Shift the color in the red channel.
SAMP_GREEN | [0x0002] Shift the color in the green channel.
SAMP_BLUE | [0x0003] Shift the color in the blue channel.
SAMP_RGB | [0x0004] Shift the color in the red, green, and blue channels.
The following are the flags that indicate how other pixel values in the set channel will be affected:
Value | Meaning
SAMP_LOW | [0x0010] Remap the shadow values for the channel set in uFlags.
SAMP_MID | [0x0020] Remap the midtone values for the channel set in uFlags.
SAMP_HIGH | [0x0030] Remap the highlight values for the channel set in uFlags.


pRaster Parameter For SampleTarget

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for SampleTarget

Return Value

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


pRaster Parameter For SearchRegMarks

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for SearchRegMarks

Return Value

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


nIndex Parameter For SegmentColors

nIndex

Index into the array of colors. This index ranges from 0 to SegmentColorsCount - 1


Flags Parameter For Segment

Flags

Flag that indicates the color space used in the segmentation. Possible values are:

Value | Meaning
SGM_RGB | [1] Comparison done on red, green and blue difference.
SGM_Y | [2] Comparison done on Y channel difference of YUV space.
SGM_U | [3] Comparison done on U channel difference of YUV space.
SGM_V | [4] Comparison done on V channel difference of YUV space.
SGM_UV | [5] Comparison done on U and V channels difference of YUV space.


lThreshold Parameter For Segment

lThreshold

The tolerance value of each segment. Valid values for this parameter are: 0 to 255 for 1, 2, 3, 4, 5, 6, 7, 8, 24, and 32-bit bitmaps, 0 to 4095 for 12-bit bitmaps and 0 to 65535 for 16, 48, and 64-bit bitmaps.


pRaster Parameter For Segment

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for Segment

Return Value

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


bCombine Parameter For SelectData

bCombine

A flag which tells how to color the output pixels. Possible values are:

Value | Meaning
TRUE | Pixels with values greater than or equal to the threshold value are ANDed with crColor. The source pixel is first converted to 24-bit grayscale and then And-ed with crColor.
 | For pixels with values less than the threshold value, the RGB pixel value will be the same as the high byte source pixel value. That is R = G = B = High byte values of the source pixel.
FALSE | Pixels with values greater than or equal to the threshold value are set to crColor. Pixels with values less than the threshold value are set to black.


crColor Parameter For SelectData

crColor

Color that will be used for showing the variances in the bitmap.


lSrcHighBit Parameter For SelectData

lSrcHighBit

Position of the last bit used to construct the mask. This is inclusive (it is part of the mask). The value should not be less than lSrcLowBit. You can also pass –1, which is interpreted as "highest bit".


lSrcLowBit Parameter For SelectData

lSrcLowBit

Position of the first bit used to construct the mask. This is a zero based number.


lThreshold Parameter For SelectData

lThreshold

Value that indicates the threshold for showing the bitmap variances. If the mask value is greater or equal to the threshold value then the pixel will be colored using crColor. For more information, refer to the bCombine parameter.


pRasterDst Parameter For SelectData

pRasterDst

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


pRasterSrc Parameter For SelectData

pRasterSrc

Pointer to the ILeadRaster object that references an 8, 12, or 16-bit grayscale source bitmap. This bitmap will not be modified.


Return for SelectData

Return Value

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


iIndex Parameter For SelectiveColorBlack

iIndex

Index into the array of BLACK values. Valid values are from 0 to 8.


iIndex Parameter For SelectiveColorCyan

iIndex

Index into the array of CYAN values. Valid values are from 0 to 8.


iIndex Parameter For SelectiveColorMagenta

iIndex

Index into the array of MAGENTA values. Valid values are from 0 to 8.


pRaster Parameter For SelectiveColor

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for SelectiveColor

Return Value

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


iIndex Parameter For SelectiveColorYellow

iIndex

Index into the array of YELLOW values. Valid values are from 0 to 8.


lDstBitsPerPixel Parameter For ShiftData

lDstBitsPerPixel

Bits per pixel for the destination bitmap. The allowed values are 8, 12, or 16.


lDstLowBit Parameter For ShiftData

lDstLowBit

The bit position at which the selected mask will be copied into pRasterDst.


lSrcHighBit Parameter For ShiftData

lSrcHighBit

Position of the last bit used to construct the mask. This is inclusive (it is part of the mask). The value should not be less than lSrcLowBit. You can also pass –1, which is interpreted as "highest bit".


lSrcLowBit Parameter For ShiftData

lSrcLowBit

Position of the first bit used to construct the mask. This is a zero-based number.


pRasterDst Parameter For ShiftData

pRasterDst

Pointer to the ILeadRaster object that references the resulting bitmap.


pRasterSrc Parameter For ShiftData

pRasterSrc

Pointer to the ILeadRaster object that references an 8, 12, or 16-bit grayscale source bitmap. This bitmap will not be modified.


Return for ShiftData

Return Value

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


iIndex Parameter for ShortItemValue

iIndex

Index of the short item value from the short array.


pRaster Parameter For Skeleton

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Skeleton

Return Value

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


Threshold Parameter For Skeleton

Threshold

Threshold value used to binarize the bitmap before finding the skeleton; this parameter is ignored if the bitmap is a binary bitmap.


iAmount Parameter For SmoothEdges

iAmount

This is a percentage value that indicates blur size. 0 means no blurring and 100 means total blurring.


iThreshold Parameter For SmoothEdges

iThreshold

Threshold value used to determine which pixels are edge pixels. If the difference determined for a pixel is greater than this value, the pixel is an edge. Valid values range from 0 through 255.


pRaster Parameter For SmoothEdges

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for SmoothEdges

Return Value

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


CenterX Parameter For Spherize

CenterX

X coordinate of the center of the sphere.


CenterY Parameter For Spherize

CenterY

Y coordinate of the center of the sphere.


crFill Parameter For Spherize

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas.


iValue Parameter For Spherize

iValue

Amount of stretching where positive values stretch the central pixels toward the edges and negative values stretch the pixels toward the center. Valid values range from –500 to 500.


lFlags Parameter For Spherize

lFlags

Flags that indicate how to handle exposed areas outside the sphere and inside the sphere. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas outside the sphere:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate how to handle exposed areas inside the sphere:

Value | Meaning
FILL_ROT | [0x0000] Rotate the image inside the sphere pattern.
FILL_WOUTROT | [0x0010] Fill the exposed sphere pattern center as you would exposed areas outside the sphere.

This flag is ignored if the iValue is negative.


pRaster Parameter For Spherize

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Spherize

Return Value

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


iIndex Parameter for StringItemValue

iIndex

Index of the string item value from the string array.


lBrightnessFactor Parameter For SubtractBackground

lBrightnessFactor

Brightness factor for increasing or decreasing the brightness of the image. Valid values range from 0 – 400. If you pass 100 the brightness remains unchanged. Lower values darken the image while higher values lighten the image.


lFlags Parameter For SubtractBackground

lFlags

Flags that indicate whether the background is darker than the foreground, and whether to show the objects without the background. You must select one from each group. Possible values are:

The following flags represent whether the background is darker than the foreground:

Value | Meaning
SBK_BG_DARK | [0x00000000] The background in the current image is darker than the foreground.
SBK_BG_BRIGHT | [0x00000001] The background in the current image is brighter than the foreground.

The following flags represent whether to show the objects without a background:

Value | Meaning
SBK_RES_SHOW | [0x00000000] The output bitmap shows the result of the subtraction between the background and the original image.
SBK_BG_SHOW | [0x00000010] The output bitmap shows only the background.


lRollingBall Parameter For SubtractBackground

lRollingBall

The radius (in pixels) of the ball that will roll over the entire image to determine the background. Recommended value is 50.


pRasterParameter For SubtractBackground

pRaster

The ILeadRaster object that references the bitmap on which to apply the effect.


Return for SubtractBackground

Return Value

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


ShrinkSize Parameter For SubtractBackground

ShrinkSize

Shrink size ratio used to minimize the image internally in order to increase the speed with little loss of accuracy. Possible values are:

Value | Meaning
SBK_AUTO | [0] The Shrink Size depends on the ball size.
SBK_1_1 | [1] No Resize (Highest accuracy).
SBK_1_2 | [2] Resize to half width and height.
SBK_1_4 | [3] Resize to quarter width and height.
SBK_1_8 | [4] Resize to eighth width and height (very fast).


CenterX Parameter For Swirl

CenterX

X coordinate for the center of the swirl.


CenterY Parameter For Swirl

CenterY

Y coordinate for the center of the swirl.


iAngle Parameter For Swirl

iAngle

The degree of rotation. This value is in degrees (0…360…720, etc.).


pRaster Parameter For Swirl

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Swirl

Return Value

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


iHeight Parameter For TextureAlphaBlend

iHeight

Height of the area to be combined, in pixels. This height applies to both the source and the destination areas.


iOpacity Parameter For TextureAlphaBlend

iOpacity

Opacity value used when combining the resulting bitmap and the destination bitmap. This value is between 0 and 255.


iWidth Parameter For TextureAlphaBlend

iWidth

Width of the area to be combined, in pixels. This width applies to both the source and the destination areas.


iXDst Parameter For TextureAlphaBlend

iXDst

The X coordinate of the origin of the destination rectangle.


iXOffset Parameter For TextureAlphaBlend

iXOffset

X coordinate of the offset of the underlay bitmap, with respect to the destination bitmap.


iXSrc Parameter For TextureAlphaBlend

iXSrc

The X coordinate of the origin of the source rectangle. This applies to pRasterSrc and pRasterMask.


iYDst Parameter For TextureAlphaBlend

iYDst

The Y coordinate of the origin of the destination rectangle.


iYOffset Parameter For TextureAlphaBlend

iYOffset

Y coordinate of the offset of the underlay bitmap, with respect to the destination bitmap.


iYSrc Parameter For TextureAlphaBlend

iYSrc

The Y coordinate of the origin of the source rectangle. This applies to pRasterSrc and pRasterMask.


pRasterDst Parameter For TextureAlphaBlend

pRasterDst

Pointer to the ILEADRaster object that references the bitmap to be modified.


pRasterMask Parameter For TextureAlphaBlend

pRasterMask

Pointer to the ILEADRaster object that references the mask bitmap.


pRasterSrc Parameter For TextureAlphaBlend

pRasterSrc

Pointer to the ILEADRaster object that references the source bitmap.


pRasterUnderlay Parameter For TextureAlphaBlend

pRasterUnderlay

Pointer to an ILEADRaster object that references the underlay bitmap. The method will use this bitmap to underlay the mask bitmap. To ignore this parameter, pass 0.


Return for TextureAlphaBlend

Return Value

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


iIndex Parameter For TransformedPointsX

iIndex

Index into the array of X coordinates. Possible values are from 0 to 2.


iIndex Parameter For TransformedPointsY

iIndex

Index into the array of Y coordinates. Possible values are from 0 to 2.


CenterX Parameter For Tunnel

CenterX

X coordinate of the point at which the camera or the viewer is looking. It may be outside the bitmap borders.


CenterY Parameter For Tunnel

CenterY

Y coordinate of the point at which the camera or the viewer is looking. It may be outside the bitmap borders.


crBright Parameter For Tunnel

crBright

The color value that specifies the color of an external light source that shines in the tunnel.


crFill Parameter For Tunnel

crFill

The color value that specifies the background color.


iBrightLength Parameter For Tunnel

iBrightLength

Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.


iDistance Parameter For Tunnel

iDistance

Camera distance from the viewing screen, in pixels.


iEndBright Parameter For Tunnel

iEndBright

Value that indicates the brightness of an external light source at the end of the tunnel. Possible values range from 0 to 100. A value of 0 indicates no external light displayed at the end of the tunnel. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.


iRad Parameter For Tunnel

iRad

Tunnel radius.


iRepeat Parameter For Tunnel

iRepeat

Number of times the bitmap repeats along the Z-axis. If iRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.


iRotationOffset Parameter For Tunnel

iRotationOffset

Rotates the tunnel around the Z-axis in pixel steps. If TUN_AXIS_WIDTH option is selected then the bitmap width is along the Z-axis and iRotationOffset set to the bitmap height is equivalent to a complete cycle. If TUN_AXIS_HEIGHT is set, then the bitmap height is along the Z-axis and iRotationOffset set to the bitmap width is equivalent to a complete cycle.


iStartBright Parameter For Tunnel

iStartBright

Value that indicates the brightness of an external light source at the beginning of the tunnel. Possible values range from 0 to 100. A value of 0 indicates no external light is displayed at the beginning of the tunnel. A value of 100 indicates an external light source with full brightness is displayed.


iStretch Parameter For Tunnel

iStretch

Value that indicates whether to expand or compress the bitmap, and by how much. If iStretch < 100 bitmap will be expanded. If iStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.


iZValue Parameter For Tunnel

iZValue

Viewing screen offset on the Z-axis, in pixels.


lFlags Parameter For Tunnel

lFlags

Flags that indicate the background color and which bitmap dimension extends along the Z-axis. You can use a bit wise OR (|) to specify one flag from each group.

The following are the flags that indicate the background color:

Value | Meaning
PLANE_FILL_CLR | [0x0001] Use the crFill as a background color.
PLANE_NO_CHG | [0x0002] Use the image itself as a background.
The following are the flags that indicate which bitmap dimension is along the Z-axis:
Value | Meaning
TUN_AXIS_WIDTH | [0x0010] Bitmap width will be along the Z-axis.
TUN_AXIS_HEIGHT | [0x0010] Bitmap height will be along the Z-axis.


pRaster Parameter For Tunnel

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Tunnel

Return Value

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


pRaster Parameter For UserFilter

pRaster

The ILEADRaster object that references the bitmap to be modified.


Return for UserFilter

Return Value

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


nIndex Parameter For UserSegmentInfo

nIndex

A zero-based index of the user segments. Possible values are range from 0 to (UserSegmentInfoCount – 1).


lIndex Parameter For UserShape

lIndex

Index into the array of values. Valid values are from 0 to UserShapeCount – 1.


crFill Parameter For Wave

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iAmplitude Parameter For Wave

iAmplitude

Wave's magnitude. The values range from 1 to the length of the image's diagonal.


iAngle Parameter For Wave

iAngle

Wave's rotation angle in hundredths of a degree. The valid range is from –18000 to 18000 (The value in degrees is iAngle divided by 100).


iHorzFact Parameter For Wave

iHorzFact

Size of the horizontal wave, given as a percentage. The valid range is from 0 to 100.


iVertFact Parameter For Wave

iVertFact

Size of the vertical wave, given as a percentage. The valid range is from 0 to 100.


iWaveLen Parameter For Wave

iWaveLen

Value that represents the wave length, if DIS_PER is set in the lFlags parameter. Possible values range from 1 – 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in lFlags, this value is the number of repeated waves.


lFlags Parameter For Wave

lFlags

Flags that indicate how to handle exposed areas, the type of information in the iWaveLength parameter and the wave type. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the type of information in the iWaveLen parameter:

Value | Meaning
DIS_PER | [0x0000] The value in iWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is used, the valid range of iWaveLen is from 0 to 100.
DIS_FRQ | [0x0010] The value in iWaveLen is the frequency, or the number of times the wave repeats.

The following are the flags that indicate the wave type:

Value | Meaning
WV_SIN | [0x0000] The wave is a sinusoidal wave.
WV_COS | [0x0100] The wave is a sinusoidal wave shifted by 90 degrees.
WV_SQUARE | [0x0200] The wave is a square wave.
WV_TRIANG | [0x0300] The wave is a triangular wave.


pRaster Parameter For Wave

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Wave

Return Value

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


iAngle Parameter For Wind

iAngle

Direction of the thin lines used to create the wind effect, in hundredths of a degree. Possible values range form –36000 to 36000. (The value in degrees is lAngle divided by 100).


iDim Parameter For Wind

iDim

Size, in pixels, of the thin lines used to create the wind effect. Possible values range from 1 - 100.


iOpacity Parameter For Wind

iOpacity

Density, in pixels, of the thin lines used to create the wind effect. The valid range is from 0 to 100.


pRaster Parameter For Wind

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for Wind

Return Value

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


CenterX Parameter For ZoomBlur

CenterX

X coordinate of the point from which to blur the image.


CenterY Parameter For ZoomBlur

CenterY

Y coordinate of the point from which to blur the image.


iDim Parameter For ZoomBlur

iDim

A value that represents the amount of the blur.


iStress Parameter For ZoomBlur

iStress

A value that represents the amount of the blur intensity.


pRaster Parameter For ZoomBlur

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ZoomBlur

Return Value

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


CenterX Parameter For ZoomWave

CenterX

X coordinate of the center point from which the wave is zoomed.


CenterY Parameter For ZoomWave

CenterY

Y coordinate of the center point from which the wave is zoomed.


crFill Parameter For ZoomWave

crFill

The OLE_COLOR value that specifies the fill color for any exposed areas. You can specify a OLE_COLOR value, such as the return value of the Windows RGB macro.


iAmplitude Parameter For ZoomWave

iAmplitude

Zoom wave magnitude.


iFrequency Parameter For ZoomWave

iFrequency

The number of repeated waves along the radial line.


iPhase Parameter For ZoomWave

iPhase

Wave phase shift. The valid range is from –36000 to 36000. The real value is lPhase divided by 100.


iZoomFact Parameter For ZoomWave

iZoomFact

The percentage the wave grows as it moves from the image center. The valid range is from 0 to 100.


lFlag Parameter For ZoomWave

lFlag

Flag that indicates how to handle exposed areas. Possible values are:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.


pRaster Parameter For ZoomWave

pRaster

Pointer to the ILeadRaster object that references the bitmap on which to apply the effect.


Return for ZoomWave

Return Value

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


pRaster Parameter For BitmapDataPath

pRaster

ILEADRaster object to be updated with the bitmap that is being loaded asynchronously.


pszURL Parameter For BitmapDataPath

pszURL

String that contains the URL of the file to be loaded.


Return for BitmapDataPath

Return Value

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


iIndex Parameter For BitmapPalette

iIndex

Index into the array of colors.


Return for BitmapToClient

Return Value

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


X parameter For BitmapToClient

X

X coordinate to convert.


Y Parameter For BitmapToClient

Y

Y coordinate to convert.


BorderToRemove Parameter For BorderRemove

BorderToRemove

Flag that indicates which border to remove. These values can be combined using the OR operator (|). Possible values are:

Value | Meaning
BORDER_LEFT | Remove the left border.
BORDER_RIGHT | Remove the right border.
BORDER_TOP | Remove the top border.
BORDER_BOTTOM | Remove the bottom border.
BORDER_ALL | Remove all borders. This is the same as BORDER_LEFT | BORDER_RIGHT | BORDER_TOP | BORDER_BOTTOM.


fBoundingRectHeight Parameter For BorderRemove

fBoundingRectHeight

Height of the bounding rectangle of the border being processed.


fBoundingRectLeft Parameter For BorderRemove

fBoundingRectLeft

X coordinate of the origin of the bounding rectangle of the border being processed.


fBoundingRectTop Parameter For BorderRemove

fBoundingRectTop

Y coordinate of the origin of the bounding rectangle of the border being processed.


fBoundingRectWidth Parameter For BorderRemove

fBoundingRectWidth

Width of the bounding rectangle of the border being processed.


Flags Parameter For BorderRemove

Flags

Flags that determine the behavior of the border removal process. Flags may be combined using a bitwise OR. Possible values are:

Value | Meaning
BORDER_SINGLE_REGION: | For each border found by the BorderRemove method, if the DocCleanSuccess propertyDocCleanSuccessproperty is set to SUCCESS_REMOVE in the BorderRemove eventBorderRemoveevent, the removed border is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the border is not added to the single region. When the BorderRemove method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all removed borders. This is the case if the BORDER_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the removed borders. This is the case if the BORDER_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed .When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
BORDER_LEAD_REGION | This flag must be used in conjunction with BORDER_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all removed borders when the BorderRemove method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
BORDER_IMAGE_UNCHANGED | The original image is unchanged.
BORDER_CALLBACK_REGION | The BorderRemove eventBorderRemoveevent receives a Windows region that contains the current border to be removed. Setting this flag lets the user create his or her own composite of removed borders by combining the regions received by the event, if the DocCleanSuccess propertyDocCleanSuccessproperty is set to SUCCESS_REMOVE in the event. The regions can be combined using a logical OR operator. Combining all regions received by the event, that are removed, results in a region identical to the region created when BORDER_SINGLE_REGION is set in uFlags. When the region received by the event is no longer needed, it must be destroyed.
BORDER_USE_VARIANCE | Consider border variance when performing border removal. If this flag is passed, the iVariance parameter of this method is used. If this flag is not passed, the iVariance parameter is ignored.


hRgn Parameter For BorderRemove

hRgn

Windows region representing the border to be removed.


iBorderPercent Parameter For BorderRemove

BorderPercent

Percent of the image dimension in which the border will be found. For most images, use 20. For example, if an image is 200 pixels wide, iBorderPercent is set to 20 and uBorderToRemove is set to BORDER_LEFT, then the left border will be found in the area between the left edge of the image and a line 40 pixels from the left edge. If the border is closer to the edge of the image, use a smaller value. If the border is farther from the edge, use a larger value.


iVariance Parameter For BorderRemove

iVariance

Amount of variance tolerated in the border. If the border varies significantly in thickness, you should use a higher value for iVariance. Range is 0 to 10.


iWhiteNoiseLength Parameter For BorderRemove

iWhiteNoiseLength

Amount of white noise tolerated when determining the border. The units are in pixels. Values of 0 to 10 are sufficient for most images.


pRaster Parameter For BorderRemove

pRaster

ILEADRaster object to be modified.


Return for BorderRemove

Return Value

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


uBorderToRemove Parameter For BorderRemove

uBorderToRemove

Flag that indicates which border is being processed. Possible values are:

Value | Meaning
BORDER_LEFT | The left border is being processed.
BORDER_TOP | The top border is being processed.
BORDER_RIGHT | The right border is being processed.
BORDER_BOTTOM | The bottom border is being processed.


pszDirecotry Parameter For BrowseDir

pszDirectory

The starting directory for the browse operation.

If the IncludeSubDirectories property is True, subdirectories will also be searched.


Return for BrowseDir

Return Value

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


iButtonIndex Parameter For ButtonBitmapDown

iButtonIndex

Index indicating a button in the AnnToolbar object. The array is zero-based.


iButtonIndex Parameter For ButtonBitmapUp

iButtonIndex

Index indicating a button in the AnnToolbar object. The array is zero-based.


iButtonIndex Parameter For ButtonMenuText

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iButtonIndex Parameter For ButtonMenuTextID

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iToolIndex Parameter For ButtonMenuTextID

iToolIndex

Index into a list of menu items associated with the specified button in the annotation toolbar. This is a zero-based index.


iToolIndex Parameter For ButtonMenuText

iToolIndex

Index into a list of menu items associated with the specified button in the annotation toolbar. This is a zero-based index.


iButtonIndex Parameter For ButtonMenuTool

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iToolIndex Parameter For ButtonMenuTool

iToolIndex

Index into a list of menu items associated with the specified button in the annotation toolbar. This is a zero-based index.


iButtonIndex Parameter For ButtonToolCount

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iButtonIndex Parameter For ButtonTool

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iButtonIndex Parameter For ButtonToolTipText

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iButtonIndex Parameter For ButtonToolTipTextID

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


iButtonIndex Parameter For ButtonVisible

iButtonIndex

Index indicating a button in the AnnToolbar object. This is a zero-based index.


fHeight Parameter For Capture

fHeight

The height of the rectangle to capture. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For Capture

fLeft

The X coordinate of the origin of the rectangle to capture, relative to the specified device context. The unit of measure is determined by the ScaleMode property.


fTop Parameter For Capture

fTop

The X coordinate of the origin of the rectangle to capture, relative to the specified device context. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For Capture

fWidth

The width of the rectangle to capture. The unit of measure is determined by the ScaleMode property.


hDC Parameter For Capture

hDC

Handle to the source device. The mapping mode of the device context must be MM_TEXT.


Return for Capture

Return Value

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


nChange Parameter For Change

nChange

Value indicating the type(s) of change that has occurred. This can be one or more of the following, which may be combined using the "Or" operator.

Value | Meaning
CHANGE_NONE | No change
CHANGE_DIM | Dimensional change
CHANGE_DATA | Bitmap data change
CHANGE_PALETTE | Palette change
CHANGE_BACKGROUND | Background (gradient or pattern) changed
CHANGE_ANIMATION_PALETTE | Animation palette changed
CHANGE_LIST | Bitmap List changed
CHANGE_NEW_BITMAP | New image was loaded


nReserved1 Parameter For Change

nReserved1

Reserved for future use. Pass 0.


nReserved2 Parameter For Change

nReserved2

Reserved for future use. Pass 0.


Return for ClientToBitmap

Return Value

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


X parameter For ClientToBitmap

X

X coordinate to convert.


Y parameter For ClientToBitmap

Y

Y coordinate to convert.


Flags Parameter For ColorMerge

Flags

The type of separation that was used to create the grayscale bitmaps. Valid values are:

Value | Meaning
COLORSEP_RGB | Merge bitmaps from three RGB planes.
COLORSEP_CMYK | Merge bitmaps from four CMYK planes.
COLORSEP_CMY | Merge bitmaps from three CMY planes.
COLORSEP_HSV | Merge bitmaps from three HSV planes.
COLORSEP_HLS | Merge bitmaps from three HLS planes.


pRaster Parameter For ColorMerge

pRaster

ILEADRaster object to be modified.


Return for ColorMerge

Return Value

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


iIndex Parameter For ColorPlanes

iIndex

The index into the array of grayscale bitmaps that are the color separations. The separations follow the color order of the image data. In most cases, this is the same as the abbreviation of the color-plane model. For example, in a CMYK separation, ColorPlanes(0) is the cyan plane. The only exception is RGB, where the image data is usually stored as blue-green-red, and ColorPlanes(0) is the blue plane.


Dither Parameter For ColorRes

iDither

Dithering options. Note that the dithering options are useful only when the resulting bitmap requires a palette (when it is 8 bits per pixel or less).

The following are valid values:

Value | Meaning
CRD_NODITHERING | Use nearest color matching.
CRD_FLOYDSTEINDITHERING | Use Floyd-Steinberg dithering.
CRD_STUCKIDITHERING | Use Stucki dithering.
CRD_BURKESDITHERING | Use Burkes dithering.
CRD_SIERRADITHERING | Use Sierra dithering.
CRD_STEVENSONARCEDITHERING | Use Stevenson Arce dithering.
CRD_JARVISDITHERING | Use Jarvis dithering.
CRD_ORDEREDDITHERING | Use ordered dithering, which is faster but less accurate than other dithering methods.
CRD_CLUSTEREDDITHERING | Use clustered dithering.


iBitsPerPixel Parameter For ColorRes

iBitsPerPixel

The number of bits per pixel to increase or decrease the bitmap to. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, and 32.


iColors Parameter For ColorRes

iColors

The number of colors in the palette. Pass 0 for to get the default (such as 256 for 8 bits per pixel). Otherwise, do one of the following:

If you specify CRP_USERPALETTE in the iPalette parameter, pass the number of entries in your palette.

If you specify CRP_OPTIMIZEDPALETTE in the iPalette parameter, you can use this parameter to limit the number of colors that the method maps in the optimized palette.


Dither Parameter For ColorResList

iDither

Dithering options. Note that the dithering options are useful only when the resulting bitmaps require a palette (when they are 8 bits per pixel or less).

The following are valid values:

Value | Meaning
CRD_NODITHERING | Use nearest color matching.
CRD_FLOYDSTEINDITHERING | Use Floyd-Steinberg dithering.
CRD_STUCKIDITHERING | Use Stucki dithering.
CRD_BURKESDITHERING | Use Burkes dithering.
CRD_SIERRADITHERING | Use Sierra dithering.
CRD_STEVENSONARCEDITHERING | Use Stevenson Arce dithering.
CRD_JARVISDITHERING | Use Jarvis dithering.
CRD_ORDEREDDITHERING | Use ordered dithering, which is faster but less accurate than other dithering methods.
CRD_CLUSTEREDDITHERING | Use clustered dithering.


iBitsPerPixel Parameter For ColorResList

iBitsPerPixel

The number of bits per pixel to increase or decrease the bitmaps to. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, and 32.


iColors Parameter For ColorResList

iColors

The number of colors in the palette. Pass 0 for to get the default (such as 256 for 8 bits per pixel). Otherwise, do one of the following:

If you specify CRP_USERPALETTE in the iPalette parameter, pass the number of entries in your palette.

If you specify CRP_OPTIMIZEDPALETTE in the iPalette parameter, you can use this parameter to limit the number of colors that the method maps in the optimized palette.


Palette Parameter For ColorResList

iPalette

Palette options. The following are valid values:

Value | Meaning
CRP_FIXEDPALETTE | Use the LEAD fixed palette.
CRP_NETSCAPEPALETTE | Use the fixed palette that is employed by Netscape Navigator and by Microsoft Internet Explorer.
CRP_OPTIMIZEDPALETTE | Create an optimized palette.
CRP_IDENTITYPALETTE | Insert the Windows system palette, and optimize the remaining colors.
CRP_USERPALETTE | Use the palette specified in the UserPalette property.
CRP_BYTEORDERBGR | Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRP_BYTEORDERRGB | Use RGB color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRP_BYTEORDERGRAY | Use grayscale. This flag is only valid for 12 or 16-bit grayscale images. 12 and 16-bit grayscale images are supported in the Document/Medical toolkits only.


Return for ColorResList

Return Value

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


Palette Parameter For ColorRes

iPalette

Palette options.,The following are valid values:

Value | Meaning
CRP_FIXEDPALETTE | Use the LEAD fixed palette.
CRP_NETSCAPEPALETTE | Use the fixed palette that is employed by Netscape Navigator and by Microsoft Internet Explorer.
CRP_OPTIMIZEDPALETTE | Create an optimized palette.
CRP_IDENTITYPALETTE | Insert the Windows system palette, and optimize the remaining colors.
CRP_USERPALETTE | Use the palette specified in the UserPalette property.
CRP_BYTEORDERBGR | Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRP_BYTEORDERRGB | Use RGB color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRP_BYTEORDERGRAY | Use grayscale. This flag is only valid for 12 or 16-bit grayscale images. 12 and 16-bit grayscale images are supported in the Document/Medical toolkits only.


pRaster Parameter For ColorRes

pRaster

ILEADRaster object to be modified.


Return for ColorRes

Return Value

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


Flags Parameter For ColorSeparate

Flags

The type of separation. Valid values are:

Value | Meaning
COLORSEP_RGB | Create bitmaps for three RGB planes.
COLORSEP_CMYK | Create bitmaps for four CMYK planes.
COLORSEP_CMY | Create bitmaps for three CMY planes.
COLORSEP_HSV | Create bitmaps for three HSV planes.
COLORSEP_HLS | Create bitmaps for three HLS planes.


pRaster Parameter For ColorSeparate

pRaster

ILEADRaster object to be separated.


Return for ColorSeparate

Return Value

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


lDstPointCount Parameter For CombineBitmapWarp

lDstPointCount

Number of points in the array. The number of points should be 4. If there not 4 points in the vYArray or the vXArray, the method returns an error.


lFlags Parameter For CombineBitmapWarp

lFlags

Flags that affect the warp process. Possible values are:

Value | Meaning
0 | No interpolation
CBW_BILINEAR | Do a bilinear interpolation. This generally gives a better result.


lSrcHeight Parameter For CombineBitmapWarp

lSrcHeight

Height of the source bitmap that will be warped into the destination bitmap.


lSrcWidth Parameter For CombineBitmapWarp

lSrcWidth

Width of the source bitmap that will be warped into the destination bitmap.


lXSrc Parameter For CombineBitmapWarp

lXSrc

X coordinate of the origin of the area in the source bitmap to be warped.


lYSrc Parameter For CombineBitmapWarp

lYSrc

Y coordinate of the origin of the area in the source bitmap to be warped.


pRasterDst Parameter For CombineBitmapWarp

pRasterDst

Pointer to ILEADRaster object that contains the destination (Master) bitmap.


pRasterSrc Parameter For CombineBitmapWarp

pRasterSrc

Pointer to ILEADRaster object that contains the source (Slave) bitmap.


Return for CombineBitmapWarp

Return Value

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


vXArray Parameter For CombineBitmapWarp

vXArray

One-dimensional array of float (single) values that specifies the X-coordinates of the polygon. The array size should be 4. If the array size is not 4, the method returns an error.


vYArray Parameter For CombineBitmapWarp

vYArray

One-dimensional array of float (single) values that specify the Y-coordinates of the polygon. The array size should be 4. If the array size is not 4, the method returns an error.


fHeight Parameter For CombineExt

fHeight

The height of the rectangle to update. The unit of measure is determined by the ScaleMode property.


Flags Parameter For CombineExt

Flags

The flags are in four groups that define treatment of the source, treatment of the destination, the operation to use when combining the data, treatment of the resulting image, and the color plan for the destination, source and resulting images. The flags apply only to the defined rectangles (not necessarily the whole bitmap). You can use a bitwise OR ( | ) to specify one flag from each group. In high-level languages such as Visual Basic, you can use a plus (+) operator to specify more than one flag.

For a simple paste, use CB_OP_ADD and CB_DST_0 as the flags.

Refer to Flags for the CombineExt Method for the list of flags.


fLeft Parameter For CombineExt

fLeft

The X coordinate of the origin of the rectangle to update, relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fSrcLeft Parameter For CombineExt

fSrcLeft

The X coordinate of the origin of the source rectangle, relative to the source bitmap. The unit of measure is determined by the ScaleMode property.


fSrcTop Parameter For CombineExt

fSrcTop

The Y coordinate of the origin of the source rectangle, relative to the source bitmap. The unit of measure is determined by the ScaleMode property.


fTop Parameter For CombineExt

fTop

The Y coordinate of the origin of the rectangle to update, relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For CombineExt

fWidth

The width of the rectangle to update. The unit of measure is determined by the ScaleMode property.


pRasterDst Parameter For CombineExt

pRasterDst

Pointer to the ILEADRaster object to be modified.


pRasterSrc Parameter For CombineExt

pRasterSrc

Pointer to the ILEADRaster object that contains the bitmap to be combined with the destination bitmap.


Return for CombineExt

Return Value

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


fHeight Parameter For Combine

fHeight

The height of the rectangle to update. The unit of measure is determined by the ScaleMode property.


Flags Parameter For Combine

iFlags

The flags are in four groups that define treatment of the source, treatment of the destination, the operation to use when combining the data, and the treatment of the resulting image. The flags apply only to the defined rectangles (not necessarily the whole bitmap). You can use a bitwise OR ( | ) to specify one flag from each group. In high-level languages such as Visual Basic, you can use a plus (+) operator to specify more than one flag.

For a simple paste, use CB_OP_ADD and CB_DST_0 as the flags.

Refer to Flags for the Combine Method for the list of flags.


fLeft Parameter For Combine

fLeft

The X coordinate of the origin of the rectangle to update, relative to the bitmap's origin (0,0). The unit of measure is determined by the ScaleMode property.


fSrcLeft Parameter For Combine

fSrcLeft

The X coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fSrcTop Parameter For Combine

fSrcTop

The Y coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fTop Parameter For Combine

fTop

The Y coordinate of the origin of the rectangle to update, relative to the bitmap's origin (0,0). The unit of measure is determined by the ScaleMode property.


fWidth Parameter For Combine

fWidth

The width of the rectangle to update. The unit of measure is determined by the ScaleMode property.


pRasterDst Parameter For Combine

pRasterDst

ILEADRaster object to be updated the combined bitmap.


pRasterSrc Parameter For Combine

pRasterSrc

The source ILEADRaster object's bitmap to be combined with the destination ILEADRaster object's bitmap.


Return for Combine

Return Value

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


iIndex Parameter For Comment

iIndex

Index into the array of comments. For possible values, refer to Types of File Comments.


bstrDstFile Parameter For CompactFile

bstrDstFile

String containing the name of the file to which all the pages will be written. This cannot be NULL. If this is NULL, the method will return an error.


bstrSrcFile Parameter For CompactFile

bstrSrcFile

String containing the name of the file being compacted. All the pages will be read from this file.


iModify Parameter For CompactFile

iModify

Indicates how to save a new page in a multipage file that supports insert and replace operations. Possible values are:

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

The following file formats support append operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

FlashPix

AWD

Winfax

GIF

The following file formats support replace operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

The following file formats support insert operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX


lFlags Parameter For CompactFile

lFlags

Flag that indicates how to handle byte order when creating a new file. If the flag is not passed, the pages will be saved in Intel byte order. If you are modifying an existing file, this flag has no meaning – the pages will be saved in the same byte order used in the file. Possible values are:

Value | Meaning
USE_MOTOROLA_ORDER | [1] Save in Motorola byte order.


lPage Parameter For CompactFile

lPage

Specifies the start page if the LoadIFD property is not set. The lPage parameter of the CompactFile method designates the page relative to the virtual beginning of the file. The virtual beginning of the file is:

the real beginning of the file, if the LoadIFD property is not set or

the page indicated by LoadIFD, if the LoadIFD property is set.


lSavePage Parameter For CompactFile

lSavePage

The lSavePage parameter of the CompactFile method designates the page relative to the virtual beginning of the destination file. The virtual beginning of the file is:

the real beginning of the file, if the SaveIFD property is not set or

the page indicated by SaveIFD, if the SaveIFD property is set.

This parameter is used as follows:

If SAVE_INSERT is passed to the iModify parameter, all the pages are inserted before this page.

If SAVE_REPLACE is passed to the iModify parameter, this page and the remaining uPages – 1 will be replaced.

If neither of the above values are passed, then:

If lSavePage is 0, the file will be overwritten.

If lSavePage is <> 0, the pages will be appended to the end of the file.

Note that in case of conflict with the iModify parameter, the iModify parameter takes precedence.


Return for CompactFile

Return Value

Return | Meaning
0 | The method was successful.
ERROR_COMPACT_ABORTED | The method encountered an error while reading a page from the source file. Not all the pages have been copied to the destination file.
<>0 | An error occurred. Refer to Error Codes.


uPages Parameter For CompactFile

uPages

Number of pages to copy. Use 0 to copy all the pages. If uPages is > 0, only uPages will be copied to bstrDstFile.


nDeltaDir Parameter For ContourFilter

nDeltaDir

Maximum angle for the thinning algorithm. Values can be from 1 to 64. Default is 35.


nMaximumError Parameter For ContourFilter

nMaximumError

Maximum error for approximation algorithm. Values can be from 0 to 255. Default is 5. This parameter is only valid if Option is CONTOUR_APPROX_COLOR.


nThreshold Parameter For ContourFilter

nThreshold

Threshold of the gradient magnitude. , Values below this will be considered as background, and will be set to 0. Values can be from 1 to 254. A lower threshold provides a better quality image. Default is 15.


Option Parameter For ContourFilter

Option

Flag that controls the resulting image. This value tells the method what process to complete before returning. Possible values are:

Value | Meaning
CONTOUR_THIN | [0] return after the thinning algorithm
CONTOUR_LINK_BLACKWHITE | [1] return after contour linking, using only black and white
CONTOUR_LINK_GRAY | [2] return after contour linking, using 256 grayscale
CONTOUR_LINK_COLOR | [3] return after contour linking, using colors
CONTOUR_APPROX_COLOR | [4] return after line segment approximation, using colors


pRaster Parameter For ContourFilter

pRaster

ILEADRaster object to be modified.


Return for ContourFilter

Return Value

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


iChange Parameter For Contrast

iChange_

Amount of contrast change. Valid values are -1000 to +1000.


pRaster Parameter For Contrast

pRaster

ILEADRaster object to be modified.


Return for Contrast

Return Value

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


pRaster Parameter For ConvertSignedToUnsigned

pRaster

Pointer to the ILEADRaster object to be modified.


Shift Parameter For ConvertSignedToUnsigned

Shift

Flag that indicates how the shift will be done. Possible values are:

Value | Meaning
SHIFT_ZERO_TO_CENTER | [0x0000] Shift by 32768 (16-bit images) or by 2048 (12-bit images)
SHIFT_MIN_TO_ZERO | [0x0001] Shift all image data to make minimum value in the image 0 and the maximum value to the maximum possible value (65535 for 16-bit, 4095 for 12-bit).
SHIFT_NEG_TO_ZERO | [0x0002] Set all the negative pixels to 0 and leave the positive pixels unchanged.
SHIFT_RANGE_ONLY | [0x0003] Shift data by adding half the range to each pixel without changing bits outside the (LowBit-HighBit) range.
SHIFT_RANGE_PROCESS_OUTSIDE | [0x0004] Shift data by adding half the range to each pixel and set to zero all bits outside the (LowBit-HighBit) range.


Return for ConvertSignedToUnsigned

Return Value

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


iBlueFact Parameter For ConvertToColoredGray

iBlueFact

Value that represents the percentage or weight given to the blue value of each pixel in the bitmap. Possible values are 0 to 1000.


iBlueGrayFact Parameter For ConvertToColoredGray

iBlueGrayFact

Additional weighting factor (percentage) used to modify the blue component in the output pixel. This value can be negative. Possible values are -1000 to 1000.


iGreenFact Parameter For ConvertToColoredGray

iGreenFact

Value that represents the percentage or weight given to the green value of each pixel in the bitmap. Possible values are 0 to 1000.


iGreenGrayFact Parameter For ConvertToColoredGray

iGreenGrayFact

Additional weighting factor (percentage) used to modify the green component in the output pixel. This value can be negative. Possible values are -1000 to 1000.


iRedFact Parameter For ConvertToColoredGray

iRedFact

Value that represents the percentage or weight given to the red value of each pixel in the bitmap. Possible values are 0 to 1000.


iRedGrayFact Parameter For ConvertToColoredGray

iRedGrayFact

Additional weighting factor (percentage) used to modify the red component in the output pixel. This value can be negative. Possible values are -1000 to 1000.


pRaster Parameter For ConvertToColoredGray

pRaster

ILEADRaster object to be modified.


Return for ConvertToColoredGray

Return Value

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


Flags Parameter For Copy

Flags

Indicates how image data is placed on the clipboard. You can use a bitwise OR to pass more than one value. In high-level languages such as Visual Basic, you can use a plus (+) operator to specify more than one flag. Valid values are:

Value | Meaning
COPY_EMPTY | Empty the clipboard before copying data to it.
COPY_DIB | Copy DIB data to the clipboard.
COPY_DDB | Copy DDB data to the clipboard.
COPY_PALETTE | Copy palette data to the clipboard.
COPY_RGN | Copy the bitmap's region to the clipboard.


Dst Parameter For CopyMarkers

Dst

Pointer to an ILEADMarkers object to be updated with the copy of the markers.


Return for CopyMarkers

Return Value

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


Src Parameter For CopyMarkers

Src

Pointer to an ILEADMarkers object that contains the markers to be copied.


Return for Copy

Return Value

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


fHeight Parameter For CreateBitmap

fHeight

Height of the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For CreateBitmap

fWidth

Width of the bitmap. The unit of measure is determined by the ScaleMode property.


iBitsPerPixel Parameter For CreateBitmap

iBitsPerPixel

The number of bits per pixel. Valid values are 1, 4, 8, 16, 24, and 32. Use 0 to create an 8-bit image with a grayscale palette.


Return for CreateBitmap

Return Value

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


crTransparent Parameter For CreateFadedMask

crTransparent

Transparency color.


Flag Parameter For CreateFadedMask

Flag

Flags that indicate how the fade mask will be created. Possible values are:

Value | Meaning
FADE_OUTER | [0x0001] If this flag is set, the fade will be outside the bitmap's region. If this flag is not set, the fade will be inside the bitmap's region.
FADE_DUMPFILL | [0x0002] If this flag is set, the dump part of the mask will be filled with the dump color. The FADE_FILLCOLOR_START and FADE_WHITETOBLACK flags determine the dump color. If this flag is not set, the dump part is filled with the crTransparent color.
FADE_FILLCOLOR_START | [0x0004] If this flag is set, the dump color is the color used at the start of the fade. The start color may be white or black, based on the FADE_WHITETOBLACK. If this flag is not set, the dump color is the color at the end of the fade. If the FADE_DUMPFILL flag is not set, this flag is ignored.
FADE_WHITETOBLACK | [0x0008] If this flag is set, the fade starts with white and changes toward black. If this flag is not set, the fade changes from black to white.
FADE_NOTRANSPARENCY | [0x0010] If this flag is set, fill the transparency part with a color other than crTransparency. The color is either the same as the dump color, or its opposite, depending on whether the FADE_TRANSPARENCY_DUMPCOLOR flag is set. If the FADE_NOTRANSPARENCY flag is not set, fill the transparency with crTransparency. If the FADE_DUMPFILL flag is not set, this flag is ignored.
FADE_TRANSPARENCY_DUMPCOLOR | [0x0020] If this flag is set, the transparency color is the same as the dump color. If this flag is not set, the transparency color is the opposite of the dump color. This flag is used only if FADE_NOTRANSPARENCY is set


iFadeRate Parameter For CreateFadedMask

iFadeRate

Value that represents the rate at which the color will fade with each step. Values are between 0 and 255.


iInflate Parameter For CreateFadedMask

iInflate

Value that indicates the amount to expand resulting bitmap. This parameter is used only if FADE_OUTER is set in the Flag parameter.


iLength Parameter For CreateFadedMask

iLength

Value that represents the extent of the fade, in pixels.


iMaxGray Parameter For CreateFadedMask

iMaxGray

The maximum value of the fade color. Possible values are between 0 and 255.


iStepSize Parameter For CreateFadedMask

iStepSize

Step size at which the color will change. This value is in pixels.


pRaster Parameter For CreateFadedMask

pRaster

Pointer to the ILEADRaster object to be modified.


pRasterMask Parameter For CreateFadedMask

pRasterMask

Pointer to the ILEADRaster object that contains a bitmap. This bitmap must have a region.


Return for CreateFadedMask

Return Value

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


iAlign Parameter For Create

iAlign

Flag that indicates how to align the annotation toolbar. Possible values are given below, and may be combined:

Value | Meaning
ANN_TOOLALIGN_LEFT | [0x0000] Toolbar’s left margin will be at x.
ANN_TOOLALIGN_RIGHT | [0x0001] Toolbar’s right margin will be at x.
ANN_TOOLALIGN_TOP | [0x0002] Toolbar’s top margin will be at y.
ANN_TOOLALIGN_BOTTOM | [0x0003] Toolbar’s bottom margin will be at y.


Return for CreateMarkers

Return Value

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


Return for CreateMaskFromRgn

Return Value

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


Return for CreateObject2

Return Value

This method returns an IDispatch pointer to the created object.


pszClassID Parameter For CreateObject2

pszClassID

Character s tring that contains the object/control’s PROGID, for example "LEADRaster.LEADRaster.145". Please note that you can use a version independent value, such as "LEADRaster.LEADRaster".


pszLic Parameter For CreateObject2

pszLic

Character string that contains the license string for the object/control. For LEADTOOLS Version 14.5, use "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc.".


Return for CreateObject

Return Value

An IUnknown pointer to the created object.


pszClassID Parameter For CreateObject

pszClassID

Character string that contains the object/control’s PROGID, for example "LEADRaster.LEADRaster.145". Please note that you can use a version independent value, such as "LEADRaster.LEADRaster".


pszLic Parameter For CreateObject

pszLic

Character string that contains the license string for the object/control. For LEADTOOLS Version 14.5, use "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc.".


Return for Create

Return Value

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


nPage Parameter For CreateThumbnailFromFile

nPage

The page number (for multipage files) that contains the image to be loaded.

If the file is not a multipage file, pass 0.


pszFilename Parameter For CreateThumbnailFromFile

pszFilename

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


Return for CreateThumbnailFromFile

Return Value

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


fHeight Parameter For CreateUserBitmap

fHeight

Height of the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For CreateUserBitmap

fWidth

Width of the bitmap. The unit of measure is determined by the ScaleMode property.


iBitsPerPixel Parameter For CreateUserBitmap

iBitsPerPixel

The number of bits per pixel. Valid values are 1, 4, 8, 12, 16, 24, 32, 48, and 64. Use 0 to create an 8-bit image with a grayscale palette.


lDataSize Parameter For CreateUserBitmap

lDataSize

The size of the data from vData. If vData is empty, then this parameter is ignored. Should match the required size for the bitmap data.


Return for CreateUserBitmap

Return Value

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


vData Parameter For CreateUserBitmap

vData

Optional parameter that can specify the bitmap data. Can be an empty ILEADRasterVariant object, in which case the bitmap data is undefined.

The ILEADRasterVariant type must be VALUE_ARRAY_BYTE. Use the ShortItemValue Property of the ILEADRasterVariant object to specify the bitmap data.


x Parameter For Create

x

X coordinate for the annotation toolbar. This coordinate is relative to the window of the LEAD control. Coordinates may be scaled using the ScaleMode.


y Parameter For Create

y

Y coordinate for the annotation toolbar. This coordinate is relative to the window of the LEAD control. Coordinates may be scaled using the ScaleMode.


Return for CurveToBezier

Return Value

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


iIndex Parameter For CurveX

iIndex

Index into the ordered array of X coordinates of the points that define the curve. This is a zero-based index.


iIndex Parameter For CurveY

iIndex

Index into the ordered array of Y coordinates of the points that define the curve. This is a zero-based index.


nStatus Parameter For DataLoaded

nStatus

Refer to Error Codes.


nStatus Parameter For DataSaved

nStatus

Refer to Error Codes.


Return for dbAddNew

Return Value

None.


Return for dbClose

Return Value

None.


Return for dbDelete

Return Value

None.


Return for dbEdit

Return Value

None.


Return for dbMoveFirst

Return Value

None.


Return for dbMoveLast

Return Value

None.


lRows Parameter For dbMove

lRows

The number of rows to move to select a record. Negative numbers move backward; positive numbers move forward.


Return for dbMoveNext

Return Value

None.


Return for dbMovePrev

Return Value

None.


Return for dbMove

Return Value

None.


Return for dbOpen

Return Value

Value | Meaning
TRUE | The connection to the recordset was successful.
FALSE | The connection to the recordset failed.


iOptions Parameter For dbOpen

iOptions

Setting | Description
DB_OPENOPTIONS_NONE | You can update the recordset by adding new records or by editing or deleting existing records (if the data source allows the update).
DB_OPENOPTIONS_READONLY | You cannot add, edit, or delete records.
DB_OPENOPTIONS_APPENDONLY | You can only add records (if the data source allows the update).


pszConnect Parameter For dbOpen

pszConnect

Specifies a connect string. The connect string concatenates information, possibly including a data source name, a user ID valid on the data source, a user authentication string (password, if the data source requires one), and other information.

The whole connect string must be prefixed by the string "ODBC;" (uppercase or lowercase). The "ODBC;" string is used to indicate that the connection is to an ODBC data source. If you do not supply pszConnect, its value defaults to "ODBC;".


pszField Parameter For dbOpen

pszField

The name of the field to be used for LEADTOOLS images. This must be a long binary field.


pszSQL Parameter For dbOpen

pszSQL

Specifies the recordset to load as follows:

A NULL pointer.

The name of a table.

An SQL SELECT statement (optionally with an SQL WHERE or ORDER BY clause).

A CALL statement specifying the name of a predefined query (stored procedure).

In an SQL SELECT statement, the field containing the image must be specified first. For example, where photo is the image field and who is the sort field, the statement to select all records in the people table would be as follows:

SELECT photo,* FROM people ORDER BY who


Return for dbRequery

Return Value

Value | Meaning
TRUE | The rebuild was successful.
FALSE | The rebuild failed. In this case, the database is automatically closed.


iBitsPerPixel Parameter For dbUpdate

iBitsPerPixel

Pixel depth of the stored image.

Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files.


iFormat Parameter For dbUpdate

iFormat

Output format. This is a file format, although it is stored in a database field. For valid values, refer to Formats of Output Files.


iQuality Parameter For dbUpdate

iQuality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


Return for dbUpdate

Return Value

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


iCount Parameter For DeleteBitmapListItems

iCount

The number of bitmaps to delete.


iIndex Parameter For DeleteBitmapListItems

iIndex

Index of the first bitmap to delete.


Return for DeleteBitmapListItems

Return Value

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


iIndex Parameter For DeleteItem

iIndex

Index into the menu items in the RasterAnnMenu object. This is a zero-based index.


Return for DeleteItem

Return Value

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


iIndex Parameter For DeleteMarkerAt

iIndex

Value that represents the index of the marker to be deleted.


Return for DeleteMarkerAt

Return Value

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


iCount Parameter For DeleteMarker

iCount

An integer that represents how many markers to be deleted. This value is useful only if there is more than one marker of type lType in the file.

Pass 0 to delete all occurrences of markers of type lType.

Pass iCount > 0 to delete only the first iCount occurrences of lType.

Negative values are not allowed. If a negative number is passed to this method, it will return ERROR_INVALID_PARAMETER.


lType Parameter For DeleteMarker

lType

An integer that represents the ID of the marker(s) to be deleted. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which marker types are allowed.


Return for DeleteMarker

Return Value

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


lPage Parameter For DeletePage

lPage

Number of the page to delete. Possible values are:

Value | Meaning
-1 | Delete the last page.
>= 1 | Delete page iPage, where 1 is the first page, 2 is the second page, etc. The page indicated by iPage must exist, or an error will be returned.


pszName Parameter For DeletePage

pszName

Name of the file from which to delete the page.


Return for DeletePage

Return Value

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


Return for DeleteRgnHandle

Return Value

Value | Meaning
TRUE | The stored region was successfully deleted.
FALSE | The deletion failed.


hRgn Parameter For DeleteRgnHandle

hRgn

The handle of the stored region. The handle is returned by the method that stores the region.


nSegId Parameter For DeleteSegment

nSegId

Target segment identifier to be deleted


Return for DeleteSegment

Return Value

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


bstrFileName Parameter For DeleteTag

bstrFileName

String containing the name of the file from which to delete the tag.


nPage Parameter For DeleteTag

nPage

Number of the page from which the tag will be deleted. Use -1 to delete the tag from the last page. Use 1 to delete the tag from the first page.


Return for DeleteTag

Return Value

Return | Meaning
0 | The method was successful.
ERROR_TAG_MISSING | The requested tag is missing.
<>0 | An error occurred. Refer to Error Codes.


uFlags Parameter For DeleteTag

uFlags

Reserved for future use. Pass 0.


uTag Parameter For DeleteTag

uTag

The ID of the tag in the TIFF file. The tag IDs are between 0 and 65535.


pRaster Parameter For Despeckle

pRaster

ILEADRaster object to be modified.


Return for Despeckle

Return Value

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


lIndex Parameter For DestroyZoomView

lIndex

An integer that specifies the Index of the zoomed view to be destroyed. This is a zero-based index.


Return for DestroyZoomView

Return Value

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


Index Parameter For Distance

Index

Index into the array of length values. The index is zero based.


fBoundingRectHeight Parameter For DotRemove

fBoundingRectHeight

Height of the bounding rectangle of the dot being processed.


fBoundingRectLeft Parameter For DotRemove

fBoundingRectLeft

X coordinate of the origin of the bounding rectangle of the dot being processed.


fBoundingRectTop Parameter For DotRemove

fBoundingRectTop

Y coordinate of the origin of the bounding rectangle of the dot being processed.


fBoundingRectWidth Parameter For DotRemove

fBoundingRectWidth

Width of the bounding rectangle of the dot being processed.


Flags Parameter For DotRemove

Flags

Flags that determine the behavior of the dot removal process. Flags may be combined using a bitwise OR. Possible values are:

Value | Meaning
DOT_SINGLE_REGION: | For each dot found by the DotRemove method, if the DocCleanSuccess property is set to SUCCESS_REMOVE in the DotRemove event, the removed dot is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the dot is not added to the single region. When the DotRemove method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all removed dots. This is the case if the DOT_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster or
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the removed dots. This is the case if the DOT_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed.
 | When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
DOT_LEAD_REGION | This flag must be used in conjunction with DOT_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all removed dots when the DotRemove method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
DOT_IMAGE_UNCHANGED | The original image is unchanged.
DOT_USE_DPI | The unit of measure for all parameters of this method is thousandths of an inch. Use the image's DPI to convert to pixels. This allows the processing of many images with different DPI. If this flag is not set, the unit of measure is pixels.
DOT_CALLBACK_REGION | The DotRemove event receives a Windows region that contains the current dot to be removed. Setting this flag lets the user create his or her own composite of removed dots by combining the regions received by the event, if the DocCleanSuccess property was set to SUCCESS_REMOVE in the event. The regions can be combined using a logical OR operator. Combining all regions received by the event, that are removed, results in a region identical to the region created when DOT_SINGLE_REGION is set in uFlags.
DOT_USE_SIZE | Use the iMinDotWidth, iMinDotHeight, iMaxDotWidth, iMaxDotHeight parameters to indicate the size of the dots to remove. If this flag is not set, default values for the four sizes will be used. These defaults are as follows: iMinDotWidth = 1, iMinDotHeight = 1, iMaxDotWidth = 2 and iMaxDotHeight = 2.
DOT_USE_DIAGONALS | Considers pixels that are diagonal as part of the dot. Consider the "speck" below consisting of nine pixels.
 | If DOT_USE_DIAGONALS is used, this speck is considered a single dot that is 5x5 pixels. If DOT_USE_DIAGONALS is not used, the speck is considered three dots (2x2, 1x1, 2x2).


hRgn Parameter For DotRemove

hRgn

Windows region representing the dot to be removed.


iBlackCount Parameter For DotRemove

iBlackCount

Total number of black pixels in the dot being processed.


iMaxDotHeight Parameter For DotRemove

iMaxDotHeight

The maximum height of a dot to be removed. If DOT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iMaxDotWidth Parameter For DotRemove

iMaxDotWidth

The maximum width of a dot to be removed. If DOT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iMinDotHeight Parameter For DotRemove

iMinDotHeight

The minimum height of a dot to be removed. If DOT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iMinDotWidth Parameter For DotRemove

iMinDotWidth

The minimum width of a dot to be removed. If DOT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iWhiteCount Parameter For DotRemove

iWhiteCount

Total number of white pixels in the dot being processed.


pRaster Parameter For DotRemove

pRaster

ILEADRaster object to be modified.


Return for DotRemove

Return Value

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


fHeight Parameter For DrawEllipse

fHeight

The height of the rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For DrawEllipse

fLeft

The X coordinate of the origin of the bounding rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For DrawEllipse

fTop

The Y coordinate of the origin of the bounding rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For DrawEllipse

fWidth

The width of the ellipse in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawEllipse

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.

Values | Meaning
NULL | Nothing will be displayed.
<> NULL | Handle to the device context (DC) on which the ellipse will be drawn.


pRaster Parameter For DrawEllipse

pRaster

Pointer to the ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | Nothing will be drawn to a bitmap.
<> NULL | Pointer to the ILEADRaster interface referencing the bitmap raster. If the DrawPersistence property is TRUE, the ellipse will be drawn to the referenced raster bitmap.


Return for DrawEllipse

Return Value

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


fX1 parameter for DrawLine

fX1

The X coordinate of the beginning point of the line in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fX2 parameter for DrawLine

fX2

The X coordinate of the ending point of the line in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fY1 parameter for DrawLine

fY1

The Y coordinate of the beginning point of the line in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fY2 parameter for DrawLine

fY2

The Y coordinate of the ending point of the line in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawLine

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.

Values | Meaning
NULL | Nothing will be displayed.
<> NULL | Handle to the device context on which the line will be drawn.


pRaster Parameter For DrawLine

pRaster

Pointer to the ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | Nothing will be drawn to a bitmap.
<> NULL | Pointer to the ILEADRaster interface referencing the bitmap raster. If the DrawPersistence property is TRUE, the line will be drawn to the referenced raster bitmap.


Return for DrawLine

Return Value

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


fHeight Parameter For DrawRectangle

fHeight

The height of the rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For DrawRectangle

fLeft

The X coordinate of the origin of the rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For DrawRectangle

fTop

The Y coordinate of the origin of the rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For DrawRectangle

fWidth

The width of the rectangle in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawRectangle

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.

Values | Meaning
NULL | Nothing will be displayed.
<> NULL | Handle to the device context on which the rectangle will be drawn.


pRaster Parameter For DrawRectangle

pRaster

Pointer to the ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | Nothing will be drawn to a bitmap.
<> NULL | Pointer to the ILEADRaster interface referencing the bitmap raster. If the DrawPersistence property is TRUE, the rectangle will be drawn to the referenced raster bitmap.


Return for DrawRectangle

Return Value

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


BackgroundImage Parameter For DrawShape

BackgroundImage

LEAD bitmap used as the background image if the ShapeBackgroundStyle property requires one. To use a background image, the PatternStyle property must not be FXD_PATTERN_SOLID. Use 0 in this parameter if no background image is required.


hDC Parameter For DrawShape

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.

Values | Meaning
NULL | Nothing will be displayed
<> NULL | Handle to the device context on which the shape will be drawn.


pRaster Parameter For DrawShape

pRaster

Pointer to the ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | Nothing will be drawn to a bitmap.
<> NULL | Pointer to the ILEADRaster interface referencing the bitmap raster. If the DrawPersistence property is TRUE, the shape will be drawn to the referenced raster bitmap.


Return for DrawShape

Return Value

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


uShape Parameter For DrawShape

uShape

Constant that specifies the shape.


BackgroundImage Parameter For DrawText

ForegroundImage

LEAD control's bitmap to be used as the foreground of the text object (instead of the text color). Pass 0 if you do not want to use a bitmap as the foreground of the text object.

The bitmap that you specify is positioned at the origin of the text object's rectangle, and it is not scaled. Therefore the bitmap that you use for this purpose should be sized accordingly. In most cases it should be the same size as the rectangle.


hDC Parameter For DrawText

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.

Values | Meaning
NULL | Nothing will be displayed.
<> NULL | Handle to the device context on which the text will be drawn.


Return for DrawTextHeight

Return Value

Height of the specified string. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawTextHeight

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.

Values | Meaning
NULL | Nothing will be displayed
<> NULL | Handle to the device context on which the text is drawn.


pszText Parameter For DrawTextHeight

pszText

Text string to be evaluated.


fX Parameter For DrawTextOut

fX

The X coordinate of the origin of the text object in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


fY Parameter For DrawTextOut

fY

The Y coordinate of the origin of the text object in the ILEADRasterView Control's client area. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawTextOut

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.

Values | Meaning
NULL | Nothing will be drawn
<> NULL | will draw on the attached device context.


pRaster Parameter For DrawTextOut

pRaster

Pointer to ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | nothing will be drawn
<> NULL | will draw on the bitmap, if the DrawPersistence property is TRUE then the drawn will be a part of a bitmap


pszText Parameter For DrawTextOut

pszText

The text string to draw.


Return for DrawTextOut

Return Value

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


pRaster Parameter For DrawText

pRaster

Pointer to the ILEADRaster interface referencing the bitmap raster.

Values | Meaning
NULL | Nothing will be drawn to a bitmap.
<> NULL | Pointer to the ILEADRaster interface referencing the bitmap raster. If the DrawPersistence property is TRUE, the line will be drawn to the referenced raster bitmap.


Return for DrawText

Return Value

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


szText Parameter For DrawText

szText

Text string to be drawn.


Return for DrawTextWidth

Return Value

Width of the specified string. The unit of measure is determined by the ScaleMode property.


hDC Parameter For DrawTextWidth

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.

Values | Meaning
NULL | Nothing will be displayed
<> NULL | Handle to the device context on which the text is drawn.


pszText Parameter For DrawTextWidth

pszText

Text string to be evaluated.


Filter Parameter For EdgeDetectorExt

Filter

Flag that indicates which edge detection filter to apply. Possible values are:

Value | Meaning
EDG_SOBEL_VERT | [0x0101] Detect the vertical edges
EDG_SOBEL_HORZ | [0x0102] Detect the horizontal edges
EDG_SOBEL_ALL | [0x0103] Detect horizontal & vertical edges
EDG_PREWITT_VERT | [0x0201] Detect the vertical edges
EDG_PREWITT_HORZ | [0x0202] Detect the horizontal edges
EDG_PREWITT_ALL | [0x0203] Detect horizontal & vertical edges
EDG_LAPLACE_1 | [0x0301] Detect vertical & horizontal edges
EDG_LAPLACE_2 | [0x0302] Detect general edges
EDG_LAPLACE_3 | [0x0303] Detect general edges. (The filter used for this option is different than the filter used for the EDG_LAPLACE_2 filter.)
EDG_LAPLACE_DIAG | [0x0304] Detect the diagonal edges
EDG_LAPLACE_HORZ | [0x0305] Detect the horizontal edges
EDG_LAPLACE_VERT | [0x0306] Detect the vertical edges
EDG_GRADIENT_N | [0x0401] Detect north edges
EDG_GRADIENT_NE | [0x0402] Detect north east edges
EDG_GRADIENT_E | [0x0403] Detect east edges
EDG_GRADIENT_SE | [0x0404] Detect south east edges
EDG_GRADIENT_S | [0x0405] Detect south edges
EDG_GRADIENT_SW | [0x0406] Detect south west edges
EDG_GRADIENT_W | [0x0407] Detect west edges
EDG_GRADIENT_NW | [0x0408] Detect north west edges


lThreshold Parameter For EdgeDetectorExt

iThreshold

Threshold value used to determine which pixels are edge pixels. If the difference determined for a pixel is greater than this value, the pixel is an edge pixel.


pRaster Parameter For EdgeDetectorExt

pRaster

Pointer to the ILEADRaster object to be modified.


Return for EdgeDetectorExt

Return Value

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


Filter Parameter For EdgeDetector

Filter

Flag that indicates which edge detection filter to apply. Possible values are:

Value | Meaning
EDG_SOBEL_VERT | [0x0101] Detect the vertical edges
EDG_SOBEL_HORZ | [0x0102] Detect the horizontal edges
EDG_SOBEL_ALL | [0x0103] Detect horizontal & vertical edges
EDG_PREWITT_VERT | [0x0201] Detect the vertical edges
EDG_PREWITT_HORZ | [0x0202] Detect the horizontal edges
EDG_PREWITT_ALL | [0x0203] Detect horizontal & vertical edges
EDG_LAPLACE_1 | [0x0301] Detect vertical & horizontal edges
EDG_LAPLACE_2 | [0x0302] Detect general edges
EDG_LAPLACE_3 | [0x0303] Detect general edges. (The filter used for this option is different than the filter used for the EDG_LAPLACE_2 filter.)
EDG_LAPLACE_DIAG | [0x0304] Detect the diagonal edges
EDG_LAPLACE_HORZ | [0x0305] Detect the horizontal edges
EDG_LAPLACE_VERT | [0x0306] Detect the vertical edges
EDG_GRADIENT_N | [0x0401] Detect north edges
EDG_GRADIENT_NE | [0x0402] Detect north east edges
EDG_GRADIENT_E | [0x0403] Detect east edges
EDG_GRADIENT_SE | [0x0404] Detect south east edges
EDG_GRADIENT_S | [0x0405] Detect south edges
EDG_GRADIENT_SW | [0x0406] Detect south west edges
EDG_GRADIENT_W | [0x0407] Detect west edges
EDG_GRADIENT_NW | [0x0408] Detect north west edges


iThreshold Parameter For EdgeDetector

iThreshold

Threshold value used to determine which pixels are edge pixels. If the difference determined for a pixel is greater than this value, the pixel is an edge pixel.


pRaster Parameter For EdgeDetector

pRaster

Pointer to the ILEADRaster object to be modified.


Return for EdgeDetector

Return Value

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


Direction Parameter For Emboss

iDirection

The direction of the apparent light source. Valid values are:

Value | Meaning
EMBOSS_N | [0x0000] Affects the bitmap from North direction.
EMBOSS_NE | [0x0001] Affects the bitmap from North-East direction.
EMBOSS_E | [0x0002] Affects the bitmap from Esat direction.
EMBOSS_SE | [0x0003] Affects the bitmap from South-East direction.
EMBOSS_S | [0x0004] Affects the bitmap from South direction.
EMBOSS_SW | [0x0005] Affects the bitmap from South-West direction.
EMBOSS_W | [0x0006] Affects the bitmap from West direction.
EMBOSS_NW | [0x0007] Affects the bitmap from North- West direction.


iDepth Parameter For Emboss

iDepth

The apparent depth of this three-dimensional effect. Valid values are 0 to 1000, with 500 as normal.


pRaster Parameter For Emboss

pRaster

ILEADRaster object to be modified.


Return for Emboss

Return Value

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


hObject Parameter For EnableRestrictToContainer

hObject

Handle of the annotation object for which to get or set this property.


Return for EnsureVisible

Return Value

Actual number of lines scrolled to ensure visibility of the specified item.


nIndex Parameter For EnsureVisible

nIndex

0 based index of item to be made visible.


AnnHandleInfo Parameter For EnumerateHandle

AnnHandleInfo

Pointer to an ILEADRasterAnnHandleInfo object that contains information on the annotation handle being enumerated.


hObject Parameter For EnumerateHandle

hObject

Handle to the annotation object


nSegId Parameter For EnumSegments

nSegId

Segment Identifier


SegmentBottom Parameter For EnumSegments

SegmentBottom

Bottom segment boundary from the original bitmap.


SegmentLeft Parameter For EnumSegments

SegmentLeft

Left segment boundary from the original bitmap.


SegmentRight Parameter For EnumSegments

SegmentRight

Right segment boundary from the original bitmap.


SegmentTop Parameter For EnumSegments

SegmentTop

Top segment boundary from the original bitmap.


SegType Parameter For EnumSegments

SegType

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

SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLORED | [0x02] Segment is 1 bit colored text.
SEGTYPE_TEXT_2BIT_COLORED | [0x03] Segment is 2 bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.
SEGTYPE_BACKGROUND | [0x07] Segment is a background (The most prevalent color in the document is considered to be the background color.).
SEGTYPE_ONE_COLORED | [0x08] Segment is a one color.
SEGTYPE_TEXT_2BIT_BW | [0x09] Segment is 1-bit black and white text.


nItemsCount Parameter For ExportBitmapList

nItemsCount

Number of bitmaps to be exported starting from nStart.


nStart Parameter For ExportBitmapList

nStart

Index of the first bitmap in the ImageList control to be exported. This is a zero-based index.


Return for ExportBitmapList

Return Value

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


iAngle Parameter For FastRotate

iAngle

Degrees of rotation. Valid values are +-90, +-180, +-270, or +-360. Positive values are clockwise; negative values are counterclockwise.


pRaster Parameter For FastRotate

pRaster

ILEADRaster object to be modified.


Return for FeedLoad

Return Value

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


fHeight Parameter For FeatherAlphaBlend

fHeight

The height of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For FeatherAlphaBlend

fLeft

The X coordinate of the origin of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fSrcLeft Parameter For FeatherAlphaBlend

fSrcLeft

The X coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fSrcTop Parameter For FeatherAlphaBlend

fSrcTop

The Y coordinate of the origin of the source rectangle, relative to the source control. The unit of measure is determined by the ScaleMode property.


fTop Parameter For FeatherAlphaBlend

fTop

The Y coordinate of the origin of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For FeatherAlphaBlend

fWidth

The width of the rectangle to update, relative to the Main Control. The unit of measure is determined by the ScaleMode property.


pRaster Parameter For FeatherAlphaBlend

pRaster

Pointer to the ILEADRaster object to be modified.


pRasterMask Parameter For FeatherAlphaBlend

pRasterMask

Pointer to the ILEADRaster object that contains that contains the fade mask bitmap.


pRasterSrc Parameter For FeatherAlphaBlend

pRasterSrc

Pointer to the ILEADRaster object that contains the bitmap to be combined with the destination bitmap.


Return for FeatherAlphaBlend

Return Value

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


iSize Parameter For FeedLoad

iSize

The size of your buffer.


pvBuffer Parameter For FeedLoad

pvBuffer

Your buffer, defined as an array of bytes.


crFill Parameter For Fill

crFill

The fill color. You can specify a COLORREF value (the return value of the RGB macro), or you can specify a palette index as explained in Using Palette Indexes As Color Values.


pRaster Parameter For Fill

pRaster

ILEADRaster object to be modified.


Return for Fill

Return Value

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


nItemsCount Parameter For ImportBitmapList

nItemsCount

Number of bitmaps to be imported, starting from nStart.

Note:

(nStart + nItemsCount) should not exceed the number of bitmaps in the BitmapList parameter.


nStart Parameter For ImportBitmapList

nStart

Index of the first bitmap in the BitmapList to be imported. This is a zero-based index.


pszDefaultText Parameter For ImportBitmapList

pszDefaultText

Character string that contains the text for the bitmaps to be imported.


pszExtendedText Parameter For ImportBitmapList

pszExtendedText

Character string that contains the extra text for the bitmaps to be imported.


Return for ImportBitmapList

Return Value

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


bAscending Parameter For SortExt

bAscending

Flag that indicates whether to sort the items in the ImageList Control in ascending order. Possible values are:

Value | Meaning
TRUE | Sort the items in the ImageList Control in ascending order.
FALSE | Sort the items in the ImageList Control in descending order.


bCaseSensitive Parameter For SortExt

bCaseSensitive

Flag that indicates whether to sort the items in the ImageList Control with case sensitivity. Possible values are:

Value | Meaning
TRUE | Sort the items in the ImageList Control using case sensitivity.
FALSE | Sort the items in the ImageList Control without using case sensitivity.


bUseExtText Parameter For SortExt

bUseExtText

Flag that indicates whether to sort the items in the ImageList Control based on their TextExt property, Possible values are:

Value | Meaning
TRUE | Sort the items in the ImageList Control based on their TextExt property of the Item property.
FALSE | Sort the items in the ImageList Control based on their Text property of the Item property.


lFlags Parameter For SortExt

lFlags

Reserved for future use. Pass 0.


Return for SortExt

Return Value

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


lAngleA Parameter For AdjustTint

lAngleA

Value that represents the amount of change in the A angle, in hundredths of degrees.

Valid values range between –18000 and 18000.


lAngleB Parameter For AdjustTint

lAngleB

Value that represents the amount of change in the B angle, in hundredths of degrees.

Valid values range between –18000 and 18000.


pRaster Parameter For AdjustTint

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for AdjustTint

Return Value

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


uItem Parameter For AnnAutoCursor

uItem

Value that specifies the cursor to be displayed on various actions. Possible values are:

Value | Meaning
ANN_AUTOCURSOR_DEFAULT | [0] Displayed when cursor is over the annotation container, and other action is occurring. The default is the windows predefined cursor IDC_ARROW.
ANN_AUTOCURSOR_DRAWNEW | [1] Displayed when drawing a new annotation (design mode). This is displayed on all tools except for ANNTOOL_SELECT (which displays the ANNAUTOCURSOR_DEFAULT).
ANN_AUTOCURSOR_HANDLE | [2] Displayed in design mode, when cursor is over an annotation handle.
ANNAUTOCURSOR_HOTSPOT | [3] Displayed in run mode, when cursor over one of the following objects:
 | ANN_OBJECT_BUTTON
 | ANN_OBJECT_HOTSPOT
 | ANN_OBJECT_FREEHANDHOTSPOT
 | ANN_OBJECT_AUDIO
 | ANN_OBJECT_VIDEO
 | ANN_OBJECT_PUSHPIN
ANN_AUTOCURSOR_MOVE | [4] Displayed in design mode, when an annotation is selected and the cursor is over the selected annotation (but not over the annotation handle).
ANN_AUTOCURSOR_SELECT | [5] Displayed in design mode, when hovering over an unselected annotation. The default is the windows predefined cursor IDC_IBEAM.
ANN_AUTOCURSOR_TEXT | [6] Displayed in design mode, when entering text into one of the following text annotations:
 | ANN_OBJECT_TEXT
 | ANN_OBJECT_TEXTPOINTER
 | ANN_OBJECT_RTF
 | ANN_OBJECT_NOTE
The default is the windows predefined cursor IDC_IBEAM.
ANN_AUTOCURSOR_WAIT | [7] Displayed during any wait operation. The default is the windows predefined cursor IDC_WAIT.
ANN_AUTOCURSOR_ROTATE_GRIPPER | [8] Displayed when hovering over gripper rotate handle. The rotate handles are displayed only after calling the AnnSetOptions method with the OPTIONS_NEW_ROTATE flag set.
ANN_AUTOCURSOR_ROTATE_CENTER | [9] Displayed when hovering over rotate center handle. The rotate handles are displayed only after calling the AnnSetOptions method with the OPTIONS_NEW_ROTATE flag set.
Note: | The following cursors are displayed only after calling the AnnSetOptions method with the ANN_OPTIONS_NEW_CURSORS flag set:
ANN_AUTOCURSOR_SIZENS | [10] Displayed when hovering over the north most or south most side select handles in a rectangular object. Note that the side select handles are only displayed after calling the AnnSetOptions method with the ANN_OPTIONS_NEW_SIDE_HANDLES flag set.
ANN_AUTOCURSOR_SIZENESW | [11] Displayed when hovering over the North-east or South-west select handles in a rectangular object.
ANN_AUTOCURSOR_SIZEWE | [12] Displayed when hovering over the west most or east most side select handles in a rectangular object. Note that the side select handles are only displayed after calling the AnnSetOptions method with the ANN_OPTIONS_NEW_SIDE_HANDLES flag set.
ANN_AUTOCURSOR_SIZENWSE | [13] Displayed when hovering over the North-west or South-east select handles in a rectangular object.
ANN_AUTOCURSOR_SELECT_OUTLINE | [14] Displayed when doing a drag-type select in automation mode.
Note: | The following cursors are displayed when the corresponding tool is active. For example, when the PolyLine tool is active in automation mode, the ANN_AUTOCURSOR_TOOL_POLYLINE_CURSOR will be shown.
ANN_AUTOCURSOR_TOOL_LINE_CURSOR | [15]
ANN_AUTOCURSOR_TOOL_RECT_CURSOR | [16]
ANN_AUTOCURSOR_TOOL_ELLIPSE_CURSOR | [17]
ANN_AUTOCURSOR_TOOL_POLYLINE_CURSOR | [18]
ANN_AUTOCURSOR_TOOL_POLYGON_CURSOR | [19]
ANN_AUTOCURSOR_TOOL_POINTER_CURSOR | [20]
ANN_AUTOCURSOR_TOOL_FREEHAND_CURSOR | [21]
ANN_AUTOCURSOR_TOOL_HILITE_CURSOR | [22]
ANN_AUTOCURSOR_TOOL_REDACT_CURSOR | [23]
ANN_AUTOCURSOR_TOOL_TEXT_CURSOR | [24]
ANN_AUTOCURSOR_TOOL_NOTE_CURSOR | [25]
ANN_AUTOCURSOR_TOOL_STAMP_CURSOR | [26]
ANN_AUTOCURSOR_TOOL_BUTTON_CURSOR | [27]
ANN_AUTOCURSOR_TOOL_HOTSPOT_CURSOR | [28]
ANN_AUTOCURSOR_TOOL_AUDIO_CURSOR | [29]
ANN_AUTOCURSOR_TOOL_RULER_CURSOR | [30]
ANN_AUTOCURSOR_TOOL_CROSSPRODUCT_CURSOR | [31]
ANN_AUTOCURSOR_TOOL_POINT_CURSOR | [32]
ANN_AUTOCURSOR_TOOL_PROTRACTOR_CURSOR | [33]
ANN_AUTOCURSOR_TOOL_VIDEO_CURSOR | [34]
ANN_AUTOCURSOR_TOOL_PUSHPIN_CURSOR | [35]
ANN_AUTOCURSOR_TOOL_FREEHANDHOTSPOT_CURSOR | [36]
ANN_AUTOCURSOR_TOOL_CURVE_CURSOR | [37]
ANN_AUTOCURSOR_TOOL_CURVECLOSED_CURSOR | [38]
ANN_AUTOCURSOR_TOOL_ENCRYPT_CURSOR | [39]
ANN_AUTOCURSOR_TOOL_TEXTPOINTER_CURSOR | [40]
ANN_AUTOCURSOR_TOOL_POLYRULER_CURSOR | [41]
ANN_AUTOCURSOR_TOOL_RTF_CURSOR | [42]
ANN_AUTOCURSOR_TOOL_RUBBERSTAMP_CURSOR | [43]


dCalibrateLength Parameter For AnnCalibrateRuler

dCalibrateLength

Length to be assigned to the ruler.


dDpiRatioXtoY Parameter For AnnCalibrateRuler

dDpiRatioXtoY

The ratio of the horizontal resolution (dots per inch or DPI) to the vertical resolution. It must be in the range of 1/100 to 100 inclusive. For most images, the ratio is 1.


hObject Parameter For AnnCalibrateRuler

hObject

Handle to an ANN_OBJECT_RULER object.


lCalibrateUnit Parameter For AnnCalibrateRuler

lCalibrateUnit

Unit of measure for the length. Possible values are:

Value | Meaning
ANN_UNIT_INCHES | [0] Inches.
ANN_UNIT_FEET | [1] Feet.
ANN_UNIT_YARDS | [2] Yards.
ANN_UNIT_MICROMETERS | [3] Micrometers.
ANN_UNIT_MILLIMETERS | [4] Millimeters.
ANN_UNIT_CENTIMETERS | [5] Centimeters.
ANN_UNIT_METERS | [6] Meters.


Return for AnnCalibrateRuler

Return Value

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


hObject Parameter For AnnGetFillModeExt

hObject

Handle to the annotation object.


Return for AnnGetFillModeExt

Return Value

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


Return for AnnGetOptions

Return Value

Annotation options. Possible values are:

Return | Meaning
ANN_OPTIONS_NEW_STAMP_METAFILES | [0x0001] Uses the new rubber stamp styles
ANN_OPTIONS_NEW_TOOLBAR | [0x0002] Displays the new XP style annotation toolbar
ANN_OPTIONS_NEW_ALPHA | [0x0004] Displays the new "alpha" option in the Fill mode dialog
ANN_OPTIONS_NEW_ROTATE | [0x0008] Displays the rotate handles on objects in design mode
ANN_OPTIONS_NEW_SIDE_HANDLES | [0x0010] Displays the side handles on rectangular objects in design mode
ANN_OPTIONS_NEW_MULTI_SELECT | [0x0020] Displays a multi-select outline of multiply selected objects, along with the new multi-select resize behavior
ANN_OPTIONS_NEW_CURSORS | [0x0040] Displays the different cursors for each of the annotation tools, and when hovering over handles in design mode.
ANN_OPTIONS_NEW_ESC_CANCEL | [0x0080] Allows the user to cancel the current action by pressing ESC. Actions include annotation creation and manipulation.
ANN_OPTIONS_NEW_CALIBRATE_RULER | [0x0100] Enables the ruler calibrate feature in design mode
ANN_OPTIONS_NEW_DOT_DASH_LINES | [0x0200] Draws the dash and dot line styles with line width greater than 1 pixel.
ANN_OPTIONS_NEW_TEXT_OPTIONS | [0x0400] Enables the new text annotation options including show/hide text, show/hide border, and changing text color.
ANN_OPTIONS_NEW_ALL | Enables ALL the new options. The value for this constant is the logical "or" of all the above flags.


hObject Parameter For AnnGetRotateOptions

hObject

Handle to the annotation object.


lFlags Parameter For AnnGetRotateOptions

lFlags

Flag that identifies whether to update the AnnShowRotateHandles property, and whether to reset the handles to the original orientation. Possible values are one or more of the following constants. You can combine values together when appropriate by using a bitwise OR ( | ). Possible values are:

Value | Meaning
ANN_ROTATE_SHOW_ROTATE_HANDLES | [1] Update the AnnShowRotateHandles property.
ANN_ROTATE_RESET_ROTATE_HANDLES | [2] Reset the rotate handles to their original orientation.


Return for AnnGetRotateOptions

Return Value

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


hObject Parameter For AnnGetTextOptions

hObject

Handle to the annotation object.


lFlags Parameter For AnnGetTextOptions

lFlags

Flags that identify which property will be updated. Possible values are:

Value | Meaning
ANN_TEXT_SHOW_TEXT | [0x001] The AnnShowText parameter will be updated.
ANN_TEXT_SHOW_BORDER | [0x002] The bShowBorder parameter will be updated.
ANN_TEXT_TEXTCOLOR | [0x004] The crText parameter will be updated.
ANN_TEXT_ALL | Logical or of all above flags


Return for AnnGetTextOptions

Return Value

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


bSelected Parameter For AnnSetFillModeExt

bSelected

Flag that indicate which objects to process. Possible values are:

Value | Meaning
TRUE | Process only for selected objects.
FALSE | Process all annotation objects.


hObject Parameter For AnnSetFillModeExt

hObject

Handle to the annotation object.


nAlpha Parameter For AnnSetFillModeExt

nAlpha

Value that specifies the object’s alpha value. This is only valid if nFillMode is ANN_FILLMODE_ALPHA. Possible values are: -1..255. For an explanation of these values, refer to the Comments section.


nFillMode Parameter For AnnSetFillModeExt

nFillMode

The constant that specifies the object's fill mode. Possible fill mode values are:

Value | Meaning
ANN_FILLMODE_TRANSPARENT | [0] Transparent
ANN_FILLMODE _TRANSLUCENT | [1] Translucent
ANN_FILLMODE _OPAQUE | [2] Opaque
ANN_FILLMODE _ALPHA | [3] Alpha


Return for AnnSetFillModeExt

Return Value

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


lOptions Parameter For AnnSetOptions

lOptions

Options to enable. Use a bitwise OR to specify more than one value. Possible values are:

Value | Meaning
ANN_OPTIONS_NEW_STAMP_METAFILES | [0x0001] Uses the new rubber stamp styles
ANN_OPTIONS_NEW_TOOLBAR | [0x0002] Displays the new XP style annotation toolbar
ANN_OPTIONS_NEW_ALPHA | [0x0004] Displays the new "alpha" option in the Fill mode dialog
ANN_OPTIONS_NEW_ROTATE | [0x0008] Displays rotate handles on objects in design mode
ANN_OPTIONS_NEW_SIDE_HANDLES | [0x0010] Displays side handles on rectangular objects in design mode
ANN_OPTIONS_NEW_MULTI_SELECT | [0x0020] Displays a multi-select outline of multiply selected objects, along with the new multi-select resize behavior
ANN_OPTIONS_NEW_CURSORS | [0x0040] Displays different cursors for each of the annotation tools, and when hovering over handles in design mode.
ANN_OPTIONS_NEW_ESC_CANCEL | [0x0080] Allows the user to cancel the current action by pressing ESC. Actions include annotation creation and manipulation.
ANN_OPTIONS_NEW_CALIBRATE_RULER | [0x0100] Enables the ruler calibrate feature in design mode
ANN_OPTIONS_NEW_DOT_DASH_LINES | [0x0200] Draws the dash and dot line styles with line width greater than 1 pixel.
ANN_OPTIONS_NEW_TEXT_OPTIONS | [0x0400] Enables the new text annotation options including show/hide text, show/hide border, and changing text color.
ANN_OPTIONS_NEW_ALL | Enables ALL the new options. The value for this constant is the logical "or" of all the above flags.


Return for AnnSetOptions

Return Value

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


bSelected Parameter For AnnSetRotateOptions

bSelected

Flag that indicates which objects to process. Possible values are:

Value | Meaning
TRUE | Set the rotate options only for the selected objects.
FALSE | Set the rotate options for all annotation objects.


bShowRotateHandles Parameter For AnnSetRotateOptions

bShowRotateHandles

Flag that indicates whether to show or hide the annotation rotate handles. Possible values are:

Value | Meaning
TRUE | Show the annotation object rotate handles.
FALSE | Hide the annotation object rotate handles.


hObject Parameter For AnnSetRotateOptions

hObject

Handle to the annotation object.


lFlags Parameter For AnnSetRotateOptions

lFlags

Flag that identifies which parameters are valid, and whether to reset the handles to the original orientation. Possible values are one or more of the following constants. You can combine values together when appropriate by using a bitwise OR ( | ). Possible values are:

Value | Meaning
ANN_ROTATE_SHOW_ROTATE_HANDLES | [1] The bShowRotateHandles parameter is valid.
ANN_ROTATE_RESET_ROTATE_HANDLES | [2] Reset the rotate handles to the original orientation.


lReserved Parameter For AnnSetRotateOptions

lReserved

Reserved for future use.


Return for AnnSetRotateOptions

Return Value

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


bSelected Parameter For AnnSetTextOptions

bSelected

Flag that indicate which objects to process. Possible values are:

Value | Meaning
TRUE | Set the Text option only for the selected objects.
FALSE | Set the Text option for all annotation objects.


bShowBorder Parameter For AnnSetTextOptions

bShowBorder

Boolean value that indicates whether to show the border. Possible values are:

Value | Meaning
TRUE | Show the border.
FALSE | Do not show the border.


bShowText Parameter For AnnSetTextOptions

bShowText

Boolean value that indicates whether to show the text. Possible values are:

Value | Meaning
TRUE | Show the text.
FALSE | Do not show the text.


crText Parameter For AnnSetTextOptions

crText

An OLE_COLOR value that represents the color to be used for the text.


hObject Parameter For AnnSetTextOptions

hObject

Handle to the annotation object.


lFlags Parameter For AnnSetTextOptions

lFlags

Flags that identify which parameter are valid, or to execute an operation that does not depend on a field. Possible values are one or more of the following constants "or"ed together. Possible values are:

Value | Meaning
ANN_TEXT_SHOW_TEXT | [0x001] The bShowText parameter is valid
ANN_TEXT_SHOW_BORDER | [0x002] The bShowBorder parameter is valid
ANN_TEXT_TEXTCOLOR | [0x004] The crText parameter is valid
ANN_TEXT_ALL | Logical "or" of all above flags


lReserved Parameter For AnnSetTextOptions

lReserved

Reserved for future use. Use zero.


Return for AnnSetTextOptions

Return Value

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


hObject Parameter For AnnTextEdit

hObject

Handle to the text-based annotation object.


Return for AnnTextEdit

Return Value

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


lBackGroundThreshold Parameter For AutoSegmentExt

lBackGroundThreshold

Threshold value used to separate image objects from the background. Best values are from 5 to 35.


lCleanSize Parameter For AutoSegmentExt

lCleanSize

Value that indicates the cleaner size used to remove the noise inside the segmented image. Possible values range from 0 to 10, where 0 means to skip the cleaning stage.


lColorThreshold Parameter For AutoSegmentExt

lColorThreshold

Threshold value used to combine colors. Colors that are closer together than this amount will be combined. The best value is 25. Values saturate at 443.


lCombineThreshold Parameter For AutoSegmentExt

lCombineThreshold

Threshold value used to merge segments. Best values are from 75 to 125.


lFlags Parameter For AutoSegmentExt

lFlags

Flags that indicate segmentation preference, whether to force segments to be 2-bit segments, and whether to search for background segments. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate the segmentation preference, and whether to force segments to be 2-bit segments:

SGM_FAVOR_ONEBIT | [0x0000] The prefer segments type upon the others is one bit.
SGM_FAVOR_TWOBIT | [0x0001] The prefer segments type upon the others is two bit.
SGM_FORCE_ONEBIT | [0x0002] Force all two-bit segment types to be two bit segments.
SGM_FORCE_TWOBIT | [0x0003] Force all one-bit segment types to be two bit segments.

The following are the flags that indicate whether to search for background segments:

SGM_WITHBKGRND | [0x0000] Search for background segments.
SGM_WITHOUTBKGRND | [0x0010] Do not search for background segments.


lSegmentQuality Parameter For AutoSegmentExt

lSegmentQuality

Threshold value used to determine whether the segment is a picture segment. Possible values range from 0 to 100. Use 0 to set all possible picture segments to 2-bit without loss of a lot of information. Use 100 to set all picture segments to 2 bit only if they are very very close to 2-bit.


pRaster Parameter For AutoSegmentExt

pRaster

ILEADRaster object that contains the image to be segmented.


Return for AutoSegmentExt

Return Value

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


crMortarColor Parameter For BricksTexture

crMortarColor

Value that specifies the mortar color.


lBricksHeight Parameter For BricksTexture

lBricksHeight

Flat area of the brick height, in pixels. V alid range is from 0 to the bitmap height.


lBricksRoughness Parameter For BricksTexture

lBricksRoughness

Brick roughness.

Valid values range from 0 to 300.

At 0, the brick looks completely smooth. Use higher values to increase the roughness of the brick surface.


lBricksRoughnessEevenness Parameter For BricksTexture

lBricksRoughnessEevenness

Weathering factor for the bricks. Valid range is from 0 to 10. The higher the value the more weathered the bricks look.


lBricksWidth Parameter For BricksTexture

lBricksWidth

Flat area of the brick width, in pixels. Valid range is from 0 to the bitmap width.


lEdgeWidth Parameter For BricksTexture

lEdgeWidth

Perceived edge width, in pixels, which represents the brick edge width when the brick is viewed from the perpendicular to the front of the brick. Minimum value is 1. See the following figure:


lFlags Parameter For BricksTexture

lFlags

Flags that indicate which type of brick edge to use, and which mortar style to use. You can specify no flags, one flag, or combine one flag from each group of flags by using a bitwise OR (|).

The following flags indicate which type of shading to use on the brick edges:

Value | Meaning
BRICKS_SOLID | [0x0000] Use bricks with solid edges.
BRICKS_SMOOTHEDOUT | [0x0001] Use bricks with edges that fade from in to out.
BRICKS_SMOOTHEDIN | [0x0002] Use bricks with edges that fade from out to in.

The following flags indicate which type of mortar to use:

Value | Meaning
BRICKS_TRANSPARENTMORTAR | [0x0000] Use transparent mortar.
BRICKS_COLOREDMORTAR | [0x0010] Use crMortarColor mortar.


lMortarRoughness Parameter For BricksTexture

lMortarRoughness

Mortar roughness.

Valid values range from 0 to 300.

At 0, the mortar looks completely smooth. Use higher values to increase the roughness.


lMortarRoughnessEevenness Parameter For BricksTexture

lMortarRoughnessEevenness

Weathering factor for the mortar.

Valid values range from 0 to 10.

The higher the value the more weathered the mortar looks.


lMortarWidth Parameter For BricksTexture

lMortarWidth

Mortar width, or the space between two adjacent bricks.


lOffsetX Parameter For BricksTexture

lOffsetX

The X distance between the bitmap origin and the first brick origin, in pixels.


lOffsetY Parameter For BricksTexture

lOffsetY

The Y distance between the bitmap origin and the first brick origin, in pixels.


lRowDifference Parameter For BricksTexture

lRowDifference

Horizontal distance between the first brick of the first row and the first brick on the next row, in pixels. Setting this value to zero will make a grid-like wall. Valid range is from 0 to bitmap width.


lShadeAngle Parameter For BricksTexture

lShadeAngle

Angle, in degrees, that identifies from which side the light will hit the brick edges, resulting in a brightening of the opposite angle edges, and the darkening of the other edges.

Valid values are range from 0 to 360.


pRaster Parameter For BricksTexture

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for BricksTexture

Return Value

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


lEmboss Parameter For Canvas

lEmboss

Apparent depth of the canvas image.

Valid values range from 0 to 200.

When lTransparency is at 100, and lEmboss is 0 only the image displays. Increasing lEmboss increases the apparent depth of the canvas image.


lFlags Parameter For Canvas

lFlags

Flags that identify how to distribute the canvas image with respect to the image and how to handle resizing.

The following flags identify how the distribute the canvas image with respect to the image:

Value | Meaning
CANVAS_FIT | [0x0000] Fit the canvas image so it has the same dimensions as the bitmap that is being applied to the canvas, without tiling.
CANVAS_SHIFT | [0x0010] Shift the canvas image by the amount specified in lTilesOffset.

The following flags identify which resizing method to use to resize the canvas image in order to fit the original image:

Value | Meaning
SIZE_NORMAL | [0x0000] Resize normally.
SIZE_RESAMPLE | [0x0002] Use linear interpolation and averaging to produce a higher quality image.
SIZE_BICUBIC | [0x0004] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE.


lTilesOffset Parameter For Canvas

lTilesOffset

The amount to shift every row of canvas image from the origin. This parameter is not used when lFlags is set to CANVAS_FIT.


lTransparency Parameter For Canvas

lTransparency

The transparency amount between the image and the canvas.

Valid values range from 0 to 100.

When set to 0, only the canvas image displays, and when set to 100, the canvas image is barely visible.


lXOffset Parameter For Canvas

lXOffset

The X distance between the canvas origin point and the image origin point (in pixels).

Valid values range from –Canvas bitmap width to +Canvas bitmap width.


lYOffset Parameter For Canvas

lYOffset

The Y distance between the canvas origin point and the image origin point (in pixels).

Valid values range is from –Canvas bitmap height to +Canvas bitmap height.


pRaster Parameter For Canvas

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


pRasterThumb Parameter For Canvas

pRasterThumb

Pointer to the ILEADRaster object that references the canvas bitmap.


Return for Canvas

Return Value

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


crBackColor Parameter For Clouds

crBackColor

Value that specifies the fill color for the areas outside the cloud.


crCloudsColor Parameter For Clouds

crCloudsColor

Value that specifies the fill color for the cloud.


Flags Parameter For Clouds

Flags

Flag that indicates how the effect is applied. Possible values are:

Value | Meaning
CLD_PURE | [0x0000] Create a pure cloud texture.
CLD_DIFFERENCE | [0x0001] Apply the difference between the created cloud texture and the original image.
CLD_OPACITY | [0x0002] Combine the cloud colors with the colors of the original image by using the lOpacity value.


lDensity Parameter Clouds

lDensity

Value that indicates the detail in the cloud.

Possible values are 0 or greater.

Use larger values to increase the detail in the clouds, smaller values for blurring.


lFrequency Parameter For Clouds

lFrequency

Value that controls the number of clouds inside the image.

Possible values are 0 or greater.


lOpacity Parameter For Clouds

lOpacity

Value that indicates the transparency, in percent, between the cloud's image and the original image.

Valid values range from 0 to 100.

This parameter is used if the CLD_OPACITY or CLD_DIFFERENCE flag is set to the Flags parameter.

A value of 0 indicates that no clouds are being used while the value of 100 represents a mix of clouds and image.


lSeed Parameter For Clouds

lSeed

Seed value that controls the cloud creation process.

Possible values are 0 or greater.


pRaster Parameter For Clouds

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Clouds

Return Value

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


lIndex Parameter For ColoredBall

lIndex

Index into the array of colors.


crBkgColor Parameter For ColoredBalls

crBkgColor

Background color.


crHighLight Parameter For ColoredBalls

crHighLight

Highlight color.


crShadingColor Parameter For ColoredBalls

crShadingColor

Shade (or gradient) color.


lAvrBallClrOpacity Parameter For ColoredBalls

lAvrBallClrOpacity

Average ball color opacity.

Valid values range from:

0 to 255 for 8-bit

0 to 4095 for 12-bit

0 to 65535 for 16-bit.


lBallClrOpacityVariation Parameter For ColoredBalls

lBallClrOpacityVariation

Ball color opacity variation.

Valid values range from 0 to 100.

Use 0 to have all pixels assigned the same opacity. Use 100 to have the opacity vary from 0 to 2 X lAvrBallClrOpacity.


lFlags Parameter For ColoredBalls

lFlags

Flags that indicate which background color, shade (or gradient) type, ball type and ball color type to use. You can use a bit wise OR (|) to specify one flag from each group.

The following flags indicate how to draw the shading:

Value | Meaning
CLRBALLS_SHADING_SINGLE | [0x0001] Use only the background color (i.e. no shading).
CLRBALLS_SHADING_LEFTRIGHT | [0x0002] Draw shading as vertical lines that move from left to right.
CLRBALLS_SHADING_TOPBOTTOM | [0x0003] Draw shading as horizontal lines that move from top to bottom.
CLRBALLS_SHADING_CIRCULAR | [0x0004] Draw shading as concentric circles.
CLRBALLS_SHADING_ELLIPTICAL | [0x0005] Draw shading as concentric ellipses.

The following flags indicate which type of ball to use:

Value | Meaning
CLRBALLS_STICKER | [0x0010] Use Balls that will overlap like stickers.
CLRBALLS_BALL | [0x0020] Use Balls that will adjust like bubbles.

The following flags indicate how to treat the background:

Value | Meaning
CLRBALLS_IMAGE | [0x0100] Make the background the same as the image.
CLRBALLS_COLOR | [0x0200] Make the background using crBkgColor and crShadingColor with the specified shade type.

The following flags indicate which type of ball coloring to use:

Value | Meaning
CLRBALLS_BALLCLR_MASK | [0x1000] Have the Ball color block image colors.
CLRBALLS_BALLCLR_OPACITY | [0x2000] Use the opacity value when combining image colors with ball colors.


lHighLightAng Parameter For ColoredBalls

lHighLightAng

Light source direction of the highlight color on the ball. This value is in hundredths of degrees (+/-). A positive value will rotate the highlight color clockwise, while a negative value will rotate the highlight color counter-clockwise.

Valid values range from –36000 to + 36000.


lNumBalls Parameter For ColoredBalls

lNumBalls

Number of balls that will be drawn in the image.


lRipple Parameter For ColoredBalls

lRipple

The number of shades that are used to produce the background. This value is divided internally by 100. For example, if lRipple = 200 the actual frequency is 2. This value is ignored if the CLRBALLS_SHADING_SINGLE flag is set to lFlags parameter.


lSize Parameter For ColoredBalls

lSize

Average ball size, in pixels.


lSizeVariation Parameter For ColoredBalls

lSizeVariation

Ball size variation.

Valid values range from 0 to 100.

Use 0 to have all balls the same size. Use 100 to have the size vary from 0 to 2 X uSize.


pRaster Parameter For ColoredBalls

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ColoredBalls

Return Value

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


lDim Parameter For ColoredPencil

lDim

Value that represents the size of the pencil coloring neighborhood. It is the length, in pixels, of one side of a square. Valid values range from 0 to 100. Increasing this value increases the thickness of the edges that are detected.


lRatio Parameter For ColoredPencil

lRatio

Value that represents how much the bitmap colors should be adjusted so they appear to be colored pencil colors.

Valid values range from 0 to 100.

A value of 0 means that the bitmap will not have any change in pixel values whereas a value of 100 means that the maximum possible amount will be added to the pixel values.


pRaster Parameter For ColoredPencil

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ColoredPencil

Return Value

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


lBlackAngle Parameter For ColorHalfTone

lBlackAngle

Black screen angle in hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise.

Valid values are from –36000 to + 36000.


lCyanAngle Parameter For ColorHalfTone

lCyanAngle

Cyan screen angle in hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise.

Valid values are from –36000 to + 36000.


lMagentaAngle Parameter For ColorHalfTone

lMagentaAngle

Magenta screen angle in hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise.

Valid values are from –36000 to + 36000.


lMaxRad Parameter For ColorHalfTone

lMaxRad

Maximum dot (i.e. circle) size, in pixels. This value should not be less than 5.


lYellowAngle Parameter For ColorHalfTone

lYellowAngle

Yellow screen angle in hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise.

Valid values are from –36000 to + 36000.


pRaster Parameter For ColorHalfTone

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ColorHalfTone

Return Value

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


lIndex Parameter For CorrelationListIndex

lIndex

Index into the array of indices.


lThreshold Parameter For CorrelationList

lThreshold

Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in BitmapList property and an area in a bitmap referenced by pRaster is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).


lXStep Parameter For CorrelationList

lXStep

Step size in the X direction (along image width), in pixels. For best results, use 1.


lYStep Parameter For CorrelationList

lYStep

Step size in the Y direction (along image height), in pixels. For best results, use 1.


pRaster Parameter For CorrelationList

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for CorrelationList

Return Value

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


lIndex Parameter For CorrelationListX

lIndex

Index into the array of X-coordinates that represent the top left corners of the correlated areas.


lIndex Parameter For CorrelationListY

lIndex

Index into the array of Y-coordinates that represent the top left corners of the correlated areas.


fHeight Parameter For CreateUserBitmap2

fHeight

Height of the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For CreateUserBitmap2

fWidth

Width of the bitmap. The unit of measure is determined by the ScaleMode property.


iBitsPerPixel Parameter For CreateUserBitmap2

iBitsPerPixel

The number of bits per pixel. Valid values are 1, 4, 8, 12, 16, 24, 32, 48, and 64. Use 0 to create an 8-bit image with a grayscale palette.


lDataSize Parameter For CreateUserBitmap2

lDataSize

The size of the data from vData. If vData is empty, then this parameter is ignored. Should match the required size for the bitmap data.


Return for CreateUserBitmap2

Return Value

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


vData Parameter For CreateUserBitmap2

vData

Optional parameter that can specify the bitmap data. Can be an empty variant, in which case the bitmap data is undefined.


Return for CreateZoomView

Return Value

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


ZoomView Parameter For CreateZoomView

ZoomView

An ILEADRasterZoomView object that will be used to set the Zoom View properties at specified index.


bBiLevel Parameter For DecodeABIC

bBiLevel

Flag that indicates whether the input data is bi-level or grayscale. Possible values are:

Value | Meaning
VARIANT_TRUE | Input data pointed to by pInputData is 1-bit Bi-level.
VARIANT_FALSE | Input data pointed to by pInputData is 4-bit Grayscale.


lAlign Parameter For DecodeABIC

lAlign

Number of bytes used for aligning the uncompressed raw data pointed to by pOutputData.


lHeight Parameter For DecodeABIC

lHeight

Height of the compressed data image, in pixels.


lWidth Parameter For DecodeABIC

lWidth

Width of the compressed ABIC data image, in pixels.


pInputData Parameter For DecodeABIC

pInputData

ILEADRasterVariant object that contains the ABIC compressed data.


pOutputData Parameter For DecodeABIC

pOutputData

ILEADRasterVariant object that will be updated with the uncompressed raw data.


Return for DecodeABIC

Return Value

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


crFill Parameter For DeskewExt

crFill

Color used to fill the background following rotation. This value is used only if DSK_FILL is set in lFlags.


Return for DeskewExt

Return Value

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


lAngleRange Parameter For DeskewExt

lAngleRange

Maximum angle of deskew, in hundredths of degrees.

Valid values range from 0 to 4500.

This value is divided internally by 100.


lAngleResolution Parameter For DeskewExt

lAngleResolution

Deskew angle precision.

Valid values range from 1 to lAngleRange (maximum deskew angle).

The real value is divided by 10.


lFlags Parameter For DeskewExt

lFlags

Flags that indicate whether to deskew the image, which background color to use, whether to deskew the image if the skew angle is very small, which type of interpolation is to be used, and whether the image is mostly text or text and pictures. You can use a bitwise OR (|) to specify one flag from each group.

The following flags indicate whether to deskew the image after the method finds the skew angle:

Value | Meaning
DSKW_PROCESS | [0x00000000] Deskew (rotate) the image.
DSKW_NOPROCESS | [0x00000001] Do not deskew (rotate) the image. Use this flag to find the angle of rotation.

The following flags indicate which background color to use to fill areas exposed after rotation:

Value | Meaning
DSKW_FILL | [0x00000000] Use the color in crFill to fill areas exposed after rotation.
DSKW_NOFILL | [0x00000010] Let the method automatically find the suitable background color to fill areas exposed after rotation. Ignore the crFill parameter.

The following flags specify whether to deskew the image if the skew angle is very small:

Value | Meaning
DSKW_NOTHRESHOLD | [0x00000000] Deskew (rotate) the image for any deskew angle value.
DSKW_THRESHOLD | [0x00000100] Do not deskew the image if the deskew angle is very small (less than 0.5 degrees).

The following flags indicate which type of interpolation to perform:

Value | Meaning
DSKW_LINEAR | [0x00000000] Do not perform interpolation when rotating.
DSKW_RESAMPLE | [0x00001000] Perform bilinear interpolation when rotating.
DSKW_BICUBIC | [0x00002000] Perform bicubic interpolation when rotating.

The following flags indicate whether the image contains plain text or text and pictures:

Value | Meaning
DSKW_DOCUMENTIMAGE | [0x00000000] The image contains only text.
DSKW_DOCUMENTANDPICTURE | [0x00010000] The image contains text and pictures.


pRaster Parameter For DeskewExt

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


crGlowColor Parameter For DiffuseGlow

crGlowColor

Value that specifies the glow color.


lClearAmount Parameter For DiffuseGlow

lClearAmount

Value that represents how deeply the glow will penetrate into the non-glowing areas, expressed in tenths of a percent.

Valid values range from 0 – 1000.

A value of 0 indicates total glow diffusion, whereas a value of 1000 indicates the glow does not penetrate into any of the non-glowing areas.


lGlowAmount Parameter For DiffuseGlow

lGlowAmount

Glow intensity, expressed in tenths of a percent.

Valid values range from -1000 – 1000.

Use positive values to add glow to the brighter regions of the image, and negative values to add glow to the darker regions of the image.


lSpreadAmount Parameter For DiffuseGlow

lSpreadAmount

Value that represents the amount of blur in the glow diffusion, from 0 to 100 pixels.

Valid values range from 0 – 1000.

A value of 0 indicates none of the glow is diffused, whereas a value of 1000 indicates maximum diffusion.


lWhiteNoise Parameter For DiffuseGlow

lWhiteNoise

Percent of the bitmap to be covered with added pixels, expressed in tenths of a percent. The pixels will be added randomly.

Valid values range from 0 – 1000.


pRaster Parameter For DiffuseGlow

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for DiffuseGlow

Return Value

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


crFill Parameter For DisplaceMap

crFill

Value that specifies the fill color for any exposed areas.


lFlags Parameter For DisplaceMap

lFlags

Flags that indicate how to handle exposed areas, and the way to use the displacement map image. You can use a bitwise OR (|) to specify one flag from each group.

The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.
FILL_WRAP | [0x0003] Fill any exposed area with the opposite side of the image.

The following are the flags that indicate the way to use the displacement map image:

Value | Meaning
DSPL_TILE | [0x0000] Repeat the displacement map image to cover the image area.
DSPL_STRETCH | [0x0010] Stretch the displacement map image over the entire image area.


lHorzFact Parameter For DisplaceMap

lHorzFact

Horizontal displacement factor, in percent of the bitmap dimensions.

Valid values range from 0 to 100.


lVertFact Parameter For DisplaceMap

lVertFact

Vertical displacement factor, in percent of the bitmap dimensions.

Valid values range from 0 to 100.


pDisplacementMap Parameter For DisplaceMap

pDisplacementMap

Pointer to the ILEADRaster object that references the displacement map bitmap.


pRaster Parameter For DisplaceMap

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for DisplaceMap

Return Value

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


bBiLevel Parameter For EncodeABIC

bBiLevel

Flag that indicates whether to encode the uncompressed input data pointed to by pInputData as bi-level or grayscale. Possible values are:

Value | Meaning
VARIANT_TRUE | Encodes the input buffer as 1-bit Bi-level.
VARIANT_FALSE | Encodes the input buffer as 4-bit Grayscale.


lAlign Parameter For EncodeABIC

lAlign

Number of bytes used to align the uncompressed raw data pointed to by pInputData.


lHeight Parameter For EncodeABIC

lHeight

Height of the uncompressed raw data image, in pixels.


lWidth Parameter For EncodeABIC

lWidth

Width of the uncompressed raw data image, in pixels.


pInputData Parameter For EncodeABIC

pInputData

ILEADRasterVariant object that contains the uncompressed raw data.


pOutputData Parameter For EncodeABIC

pOutputData

ILEADRasterVariant object that will be updated with the resulting compressed ABIC data.


Return for EncodeABIC

Return Value

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


pRaster Parameter For Flip

pRaster

ILEADRaster object to be modified.


Return for Flip

Return Value

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


Return for ForceRepaint

Return Value

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


lOffset Parameter For Fragment

lOffset

Value that indicates the number of pixels the copied image is shifted.


lOpacity Parameter For Fragment

lOpacity

Value that indicates the transparency, in percent, of the copy in comparison to the original image. Possible values are range from 0 to 100.

A value of 0 means the resulting image will be black.

A value of 100 means that each copy's value will comprise 25% of the result.


pRaster Parameter For Fragment

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Fragment

Return Value

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


Return for FreeRgn

Return Value

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


flags Parameter For GammaCorrectExt

flags

Flag that indicates the color space to use. Possible values are:

Value | Meaning
GMCR_RGB_SPACE | [0X0001] Adjust the intensity of the pixel colors across the RGB color space.
GMCR_YUV_SPACE | [0X0002] Adjust the intensity of the pixel colors across the YUV color space.


lGamma Parameter For GammaCorrectExt

lGamma

Any value greater than 0 that represents the gamma value.

This value is divided internally by 100.


pRaster Parameter For GammaCorrectExt

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for GammaCorrectExt

Return Value

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


iGamma Parameter For GammaCorrect

iGamma

Unsigned integer that represents the gamma value.

Because this is an unsigned integer, it is 100 times the actual gamma value. For example, use 235 to set a gamma value of 2.35.


pRaster Parameter For GammaCorrect

pRaster

ILEADRaster object to be modified.


Return for GammaCorrect

Return Value

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


iRadius Parameter For GaussianFilter

iRadius

Value that indicates the radius of the neighborhood on which the filter is applied.


pRaster Parameter For GaussianFilter

pRaster

ILEADRaster object to be modified.


Return for GaussianFilter

Return Value

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


lPage Parameter For GetArrayInfo

lPage

The page number of the image, if the image is in a multipage file.

GIF, TIFF (MPT), and PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If you set the value of the page number to a number greater than the total number of pages in the file, this method updates the InfoPage property with the highest page number. Therefore, if you do not know how many pages are in a file, you can use this method to find out.

If the file is not a multipage file, pass 0.


iSize Parameter For GetArrayInfo

iSize

The size in bytes of the file referenced by vMem. If you use the SaveArray method to create the file in memory, that method updates your buffer size variable. Otherwise, your code must update and pass the appropriate variable.


pRaster Parameter For GetArrayInfo

pRaster

ILEADRaster object to be used as a reference for the ScaleMode.

The ScaleMode property of this object will be used for the units when filling the InfoWidth and InfoHeight properties.


Return for GetArrayInfo

Return Value

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


vMem Parameter For GetArrayInfo

vMem

An ILEADRasterVariant byte array object that contains the bitmap in memory.


pltVarSeg Parameter For GetBitmapClipSegments

pltVarSeg

An ILEADRasterVariant float array object that contains the pairs of horizontal offsets that represent the beginning and ending points of the segments present in the specified row.

The ILEADRasterVariant type must be VALUE_ARRAY_FLOAT. Use the FloatItemValue property to get the Offset Values.


Return for GetBitmapClipSegments

Return Value

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


y Parameter For GetBitmapClipSegments

y

The number of the row for which to get the segments. The first row is 0, and the last row is 1 less than the bitmap height.


Return for GetBitmapDC

Return Value

Return | Meaning
>0 | Function was successful. The return value is the HDC.
NULL | An error occurred.


Return for GetClientDC

Return Value

Return | Meaning
>0 | Function was successful. The return value is the HDC.
NULL | An error occurred.


Return for GetColorCount

Return Value

Number of colors


pRaster Parameter For GetColorCount

pRaster

ILEADRaster object to be modified.


hDC Parameter For GetDDB

hDC

Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.


Return for GetDDB

Return Value

Return | Meaning
>0 | Handle to the DDB.
0 | An error occurred.


DIBType Parameter For GetDIB2

DIBType

The type of DIB to get. Possible Values:

DIB | Value | Meaning
DIB_BITMAPINFOHEADER | (0) | DIB that uses a BITMAPINFOHEADER
DIB_BITMAPV4HEADER | (1) | DIB that uses a BITMAPV4HEADER. (introduced in Windows 95 and Windows NT 4.0)
DIB_BITMAPV5HEADER | (2) | DIB that uses a BITMAPV5HEADER (introduced in Windows 2000 and Windows 98)


Return for GetDIB

Return Value

Return | Meaning
>0 | Handle to the DIB.
0 | An error occurred.


lPage Parameter For GetFileInfo

lPage

The page number of the image, if the file is in a multipage file.

GIF, TIFF (MPT), or PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If you set the value of the page number to a number greater than the total number of pages in the file, this method updates the InfoPage property with the highest page number. Therefore, if you do not know how many pages are in a file, you can use this method to find out.

If the file is not a multipage file, pass 0.


pRaster Parameter For GetFileInfo

pRaster

ILEADRaster object to be used as a reference for the ScaleMode.

The ScaleMode property of this object will be used for the units when filling the InfoWidth and InfoHeight properties.


pszName Parameter For GetFileInfo

pszName

Character string containing the file name.


Return for GetFileInfo

Return Value

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


uFlags Parameter For GetFileInfo

uFlags

Flag that indicates whether or not to update the InfoTotalPages property. Possible values are:

Value | Meaning
0 | Do not update the InfoTotalPages property.
FILEINFO_TOTALPAGES | Update the InfoTotalPages property.


Return for GetFloaterHandle

Return Value

A handle to the stored region.


Flag Parameter For GetFunctionalLookupTable

Flag

Flag that indicates the function used to update the lookup table. Possible values are:

Value | Meaning
GL_EXP | [0x0000] Apply the exponential function.
GL_LN | [0x0001] Apply the natural logarithm function.
GL_LINEAR | [0x0002] Apply the linear function.
GL_SIGMOID | [0x0003] Apply the sigmoid function


nEnd Parameter For GetFunctionalLookupTable

nEnd

Index of the last entry in the lookup table to update. The indices of the table correspond to the intensity values.


nFactor Parameter For GetFunctionalLookupTable

nFactor

Value that indicates the factor to be applied in the function operation specified in the Flag parameter. This parameter is used only if Flag is GL_EXP, GL_SIGMOID or GL_LN. If GL_EXP or GL_SIGMOID is set in Flag the value of this parameter can be any integer (+/-). If GL_LN flag is set, its value should be >= 0. However, if nFactor = 0 the lookup table will be filled linearly from nStart to nEnd, regardless of the value set in Flag.


nStart Parameter For GetFunctionalLookupTable

nStart

Index of the first entry in the lookup table to update. The indices of the table correspond to the intensity values.


pRaster Parameter For GetFunctionalLookupTable

pRaster

Pointer to the ILEADRaster object to be modified.


Return for GetFunctionalLookupTable

Return Value

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


Return for GetGeoKey

Return Value

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


uTag Parameter For GetGeoKey

uTag

ID of the GeoKey to get. Values of the GeoKey ID range between 0 and 65535. Possible ranges are:

Range | Meaning
0..1023 | Do not use; reserved for future use.
1024..2047 | GeoTIFF configuration keys.
2048..3071 | Geographic/Geocentric CS Parameter Keys.
3072..4095 | Projected CS Parameter Keys.
4096..5119 | Vertical CS Parameter keys.
5120..32767 | Reserved.
32768..65535 | Private use – use to store your own data.


pRaster Parameter For GetHistogramGray

pRaster

ILEADRaster object to be modified.


Return for GetHistogramGray

Return Value

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


lFlags Parameter For GetHistogram

lFlags

Flags that indicate the channel for which to get the histogram and the bits to use in calculating the histogram. The following flags indicate the channel to use. This value is ignored if the bitmap is 12 or 16-bit grayscale. Possible values are:

Value | Meaning
CHANNEL_MASTER | All channels.
CHANNEL_RED | Red channel only.
CHANNEL_GREEN | Green channel only.
CHANNEL_BLUE | Blue channel only.

The following flags determine which bits to use when calculating the histogram. This value is used only if the bitmap is 12 or 16-bit grayscale. Possible values are:

Value | Meaning
HIST_LOWHIGH_BITS | [0x0000] Use the only the bits between the LowBit and HighBit values stored in the bitmap.
HIST_ALL_BITS | [0x0010] Use all the bits for calculating the histogram (the LowBit and HighBit values from the bitmap are ignored.


pRaster Parameter For GetHistogram

pRaster

ILEADRaster object to be modified.


Return for GetHistogram

Return Value

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


iLayer Parameter For GetLayerMaskBitmap

iLayer

Index into the array of layer mask bitmaps.


pRaster Parameter For GetLayerMaskBitmap

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


pRasterMask Parameter For GetLayerMaskBitmap

pRasterMask

Pointer to the ILEADRaster object that gets updated with the bitmap.


Return for GetLayerMaskBitmap

Return Value

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


iFormat Parameter For GetLoadResolution

iFormat

Value | Meaning
FILE_PCD | Kodak PhotoCD
FILE_FPX | Kodak FlashPix
FILE_JBIG | JBIG
FILE_JP2 | JPEG 2000. This file format contains image data and extra information about the contents and organization of the file.
FILE_J2K | JPEG 2000. This file format contains only a stream of image data.


Return for GetLoadResolution

Return Value

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


lIndex Parameter For GetMarker

lIndex

A value that represents the index of the marker to retrieve.


Return for GetMarker

Return Value

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


lFlags Parameter For GetMarkers

lFlags

Reserved for future use. Pass 0.


Return for GetMarkers

Return Value

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


hMem Parameter For GetMemoryInfo

hMem

A global handle (HGLOBAL) to the file in memory. If you use the SaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


lPage Parameter For GetMemoryInfo

lPage

The page number of the image, if the image is in a multipage file.

GIF, TIFF (MPT), and PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If you set the value of the page number to a number greater than the total number of pages in the file, this method updates the InfoPage property with the highest page number. Therefore, if you do not know how many pages are in a file, you can use this method to find out.

If the file is not a multipage file, pass 0.


iSize Parameter For GetMemoryInfo

iSize

The size in bytes of the file referenced by hMem. If you use the SaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


pRaster Parameter For GetMemoryInfo

pRaster

ILEADRaster object to be used as a reference for the ScaleMode.

The ScaleMode property of this object will be used for the units when filling the InfoWidth and InfoHeight properties.


Return for GetMemoryInfo

Return Value

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


Return for GetMemoryThresholds

Return Value

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


Return for GetMinMaxBits

Return Value

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


Return for GetMinMaxVal

Return Value

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


iIndex Parameter For GetOverlayAttributes

iIndex

The index of the overlay from which to get the attributes. This index is zero-based.


lFlags Parameter For GetOverlayAttributes

lFlags

Flags that determine which overlay attributes to get. These flags may be combined using "or". Possible values are:

Value | Meaning
OVERLAYATTRIBUTES_ORIGIN | [0x0001] Get the top-left position attribute. The OriginX property and the OriginY property will be updated with the top-left offset.
OVERLAYATTRIBUTES_COLOR | [0x0002] Get the color attribute. The Color property will be updated with the color.
OVERLAYATTRIBUTES_FLAGS | [0x0004] Get the flags attribute. The Flags property contains the new flags.
OVERLAYATTRIBUTES_BITINDEX | [0x0008] Get the corresponding bitplane position. The BitPosition property will be updated with the bitplane index.
OVERLAYATTRIBUTES_DICOM | [0x0010] Get the DICOM-related attributes. The following properties will be updated: Rows, Columns, Type, BitsAllocated, Description, Subtype, Label, ROIArea, ROIMean, ROIStandardDeviation, NumberFramesInOverlay, ImageFrameOrigin, ActivationLayer.


pRaster Parameter For GetOverlayAttributes

pRaster

Pointer to the ILEADRaster object from which to get the attributes.


Return for GetOverlayAttributes

Return Value

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


iIndex Parameter For GetOverlayBitmap

iIndex

The index of the overlay to get. This index is zero-based.


lFlags Parameter For GetOverlayBitmap

lFlags

Flags that determine how to retrieve the bitmap. You cannot combine these flags. Possible values are:

Value | Meaning
OVERLAY_COPY | [0] A copy of the overlay bitmap is retrieved from the overlay list.
OVERLAY_NOCOPY | [1] The actual overlay bitmap is retrieved. No copy is made. You should be careful when modifying the overlay bitmap because you can modify/invalidate the entry in the overlay bitmap list.
OVERLAY_MOVE | [3] The actual overlay bitmap is retrieved. The bitmap is also removed from the overlay list. This is recommended over OVERLAY_NOCOPY.


pOverlayRaster Parameter For GetOverlayBitmap

pOverlayRaster

Pointer to the ILEADRaster object to be updated with the retrieved overlay bitmap.


pRaster Parameter For GetOverlayBitmap

pRaster

Pointer to the ILEADRaster object from which to get the overlay bitmap.


Return for GetOverlayBitmap

Return Value

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


lFlags Parameter For GetOverlayCount

lFlags

Reserved for future use. Pass 0.


pRaster Parameter For GetOverlayCount

pRaster

Pointer to the ILEADRaster object for which to get the overlay count.


Return for GetOverlayCount

Return Value

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


pszFileName Parameter For GetPagesCount

pszFileName

Character string containing the name of the MRC file.


Return for GetPagesCount

Return Value

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


hDC Parameter For GetPalette

hDC

The device context that has the palette that you want to get.


Return for GetPalette

Return Value

The handle of the palette used by the specified device context.


Return for GetPicture

Return Value

Handle to the picture object.


Return for GetRgnArea

Return Value

The number of pixels in the bitmap region.


Return for GetRgnHandle

Return Value

A handle to the stored region.


pRaster Parameter For GetServerBitmap

pRaster

ILEADRaster object to receive the OLE Server's bitmap.


pServer Parameter For GetServerBitmap

pServer

LEAD OLE Server object.


Return for GetServerBitmap

Return Value

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


iIndex Parameter For GetSubMenu

iIndex

Index of the submenu to get.


ppAnnMenu Parameter For GetSubMenu

ppAnnMenu

Pointer to an ILEADRasterAnnMenu object. Possible values are:

Value | Meaning
NULL | An error occurred.
! NULL | Pointer to an AnnMenu object that references the specified submenu.


Return for GetSubMenu

Return Value

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


Return for GetTagCount

Return Value

The number of data values associated with the specified tag.


lTag Parameter For GetTagCount

lTag

Tag in the TIFF file from which to get the data count. Use 0 to get the data count from the tag read using the ReadTag method. Otherwise, use the tag value that was set using the SetTag method. For more information on tags available in the TIFF format, refer to the SetTag method.


lTag Parameter For GetTagData

lTag

Tag to identify the data in the TIFF file. Use 0 to get the data from the tag read using the ReadTag method. Otherwise, use the tag value that was set using the SetTag method. For more information on tags available in the TIFF format, refer to the SetTag method.


Return for GetTagData

Return Value

An ILEADRasterVariant object that contains the tag data. The variant can be a single value or an array of values.


lTag Parameter For GetTagType

lTag

Tag to identify the data in the TIFF file from which to get the data type. Use 0 to get the data type from the tag read using the ReadTag method. Otherwise, use the tag value that was set using the SetTag method. For more information on tags available in the TIFF format, refer to the SetTag method.


Return for GetTagType

Return Value

The data type of the specified tag. Possible values are:

Value | Meaning
TAG_BYTE | [1] Byte.
TAG_ASCII | [2] Byte in the range of 0 to 255.
TAG_SHORT | [3] Two bytes, unsigned.
TAG_LONG | [4] Four bytes, unsigned.
TAG_RATIONAL | [5] Eight bytes, used as a pair of unsigned long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_SBYTE | [6] Byte used as signed number in the range of -128 to +127.
TAG_UNDEFINED | [7] Byte, with application-defined usage.
TAG_SSHORT | [8] Two bytes, signed.
TAG_SLONG | [9] Four bytes, signed.
TAG_SRATIONAL | [10] Eight bytes, used as a pair of signed long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_FLOAT | [11] Four bytes used as a floating point number.
TAG_DOUBLE | [12] Eight bytes used as a double-precision floating point number.


Return for GetUserLookupTable

Return Value

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


Return for GetZoomView

Return Value

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


ZoomView Parameter For GetZoomView

ZoomView

An ILEADRasterZoomView object that will be updated with Zoom View Information at the specified index.


iBlueFact Parameter For GrayscaleExt

iBlueFact

Value that represents the percentage or weight given to the blue value of each pixel in the bitmap. Possible values are 0 to 1000.


iGreenFact Parameter For GrayscaleExt

iGreenFact

Value that represents the percentage or weight given to the green value of each pixel in the bitmap. Possible values are 0 to 1000.


iRedFact Parameter For GrayscaleExt

iRedFact

Value that represents the percentage or weight given to the red value of each pixel in the bitmap. Possible values are 0 to 1000.


pRaster Parameter For GrayscaleExt

pRaster

ILEADRaster object to be modified.


Return for GrayscaleExt

Return Value

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


iBitsPerPixel Parameter for Grayscale

iBitsPerPixel

Bits per pixel of the resultant bitmap.


pRaster Parameter For Grayscale

pRaster

ILEADRaster object to be modified.


Return for Grayscale

Return Value

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


crBackGround Parameter For HalfTonePattern

crBackGround

Value that specifies the background color for any exposed areas.


crForeGround Parameter For HalfTonePattern

crForeGround

Value that specifies the foreground color for any exposed areas.


Flags Parameter For HalfTonePattern

Flags

Flag that indicates which halftone pattern type to use. Possible values are:

Value | Meaning
HTPATTERN_DOT | [0x0001] Use a Dot pattern.
HTPATTERN_LINE | [0x0002] Use a Line pattern.
HTPATTERN_CIRCLE | [0x0003] Use a Circle pattern.
HTPATTERN_ELLIPSE | [0x0004] Use an Ellipse pattern.


lAngleContrast Parameter For HalfTonePattern

lAngleContrast

Angular pattern contrast, angular pattern only occurs if either HTPATTERN_CIRCLE or HTPATTERN_ELLIPSE option is selected. Increasing this value increases brightness of the "spokes" in the image.


lAngleOffset Parameter For HalfTonePattern

lAngleOffset

Angular pattern offset in a hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise. This parameter is used when either the HTPATTERN_CIRCLE or HTPATTERN_ELLIPSE option is selected.


lAngleRipple Parameter For HalfTonePattern

lAngleRipple

Angular pattern frequency, this parameter is used when either HTPATTERN_CIRCLE or HTPATTERN_ELLIPSE option is selected. This value determines how many "spokes" appear in the image.


lContrast Parameter For HalfTonePattern

lContrast

Halftone pattern contrast, increasing this value increases the pattern brightness, making it more visible.


lRipple Parameter For HalfTonePattern

lRipple

Halftone pattern frequency, internally, this value is divided by 100. For example, if lRipple = 200 the actual frequency is 2. Increasing this value increases the number of dots, lines, etc. in the pattern.


pRaster Parameter For HalfTonePattern

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for HalfTonePattern

Return Value

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


lOpacity Parameter For HighPassFilter

lOpacity

Value that represents the intensity of the effect.

Valid values are range from 0 to 100. At 100, only the object outlines remain.


lRadius Parameter For HighPassFilter

lRadius

Value greater than 0 that indicates the radius of the neighborhood on which the filter is applied, in pixels.


pRaster Parameter For HighPassFilter

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for HighPassFilter

Return Value

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


iChange Parameter For HistoContrast

iChange

Amount of contrast change. Valid values are -1000 to +1000.


pRaster Parameter For HistoContrast

pRaster

ILEADRaster object to be modified.


Return for HistoContrast

Return Value

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


Flags Parameter For HistoEqualize

Flags

Flag that indicates which color space to equalize. Possible values are:

Value | Meaning
RGB_SPACE | [0x0001] Linearizes the number of pixels across the RGB color space.(separated channels)
YUV_SPACE | [0x0002] Linearizes the number of pixels across the YUV color space.(Best results)
GRAY_SPACE | [0x0004] Linearizes the number of pixels per gray level in a gray level representation of the image.


pRaster Parameter For HistoEqualize

pRaster

ILEADRaster object to be modified.


Return for HistoEqualize

Return Value

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


nIndex Parameter For HistogramGrayTable

nIndex

Index into the array of long values.


iIndex Parameter For HistogramTable

iIndex

The index into the histogram table. The index corresponds to the intensity level. For example, use an index of 0 to get the number of occurrences of 0 intensity values.


Return for HitTest

Return Value

Return | Meaning
>=0 | The 0-based index of the item at the specified location
-1 | No item at the specified location.


x Parameter For HitTest

x

Horizontal position of the location in question.


y Parameter For HitTest

y

Vertical position of the location in question.


fBoundingRectHeight Parameter For HolePunchRemove

fBoundingRectHeight

Height of the bounding rectangle of the hole punch being processed.


fBoundingRectLeft Parameter For HolePunchRemove

fBoundingRectLeft

X coordinate of the origin of the bounding rectangle of the hole punch being processed.


fBoundingRectTop Parameter For HolePunchRemove

fBoundingRectTop

Y coordinate of the origin of the bounding rectangle of the hole punch being processed.


fBoundingRectWidth Parameter For HolePunchRemove

fBoundingRectWidth

Width of the bounding rectangle of the hole punch being processed.


Flags Parameter For HolePunchRemove

Flags

Flags that determine the behavior of the border removal process. Flags may be combined using a bitwise OR (|). Possible values are:

Value | Meaning
HOLEPUNCH_SINGLE_REGION: | For each hole punch found by the HolePunchRemove method, if the DocCleanSuccess property is set to SUCCESS_REMOVE in the HolePunchRemove event, the removed hole punch is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the hole punch is not added to the single region. When the HolePunchRemove method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all removed hole punches. This is the case if the HOLEPUNCH_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster or
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the removed hole punches. This is the case if the HOLEPUNCH_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed.
 | When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
HOLEPUNCH_LEAD_REGION | This flag must be used in conjunction with HOLEPUNCH_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all removed hole punches when the HolePunchRemove method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
HOLEPUNCH_IMAGE_UNCHANGED | The original image is unchanged.
HOLEPUNCH_USE_DPI | The unit of measure for all parameters of this method is thousandths of an inch. Use the image's DPI to convert to pixels. This allows the processing of many images with different DPI. If this flag is not set, the unit of measure for all parameters of this method is pixels.
HOLEPUNCH_CALLBACK_REGION | The HolePunchRemove event receives a Windows region that contains the current hole punch to be removed. Setting this flag lets the user create his or her own composite of removed hole punches by combining the regions received by the event, if the DocCleanSuccess property was set to SUCCESS_REMOVE in the event. The regions can be combined using a logical OR operator. Combining all regions received by the event, that are removed, results in a region identical to the region created when HOLEPUNCH_SINGLE_REGION is set in uFlags.
HOLEPUNCH_USE_SIZE | Use the iMinHoleWidth, iMinHoleHeight, iMaxHoleWidth, iMaxHoleHeight parameters of this method to indicate the size of the hole punches to remove. If this flag is not set, default values for the four sizes will be used. If HOLEPUNCH_USE_DPI is set, the defaults are calculated from the image DPI. Otherwise, the defaults are calculated from the image width and height.
HOLEPUNCH_USE_COUNT | Use the iMinHoleCount and iMaxHoleCount parameters of this method to indicate the number of hole punches to remove. If this flag is not set, default values for the two count values will be used. These default values are as follows: iMinHoleCount = 3 and iMaxHoleCount = 3.
HOLEPUNCH_USE_LOCATION | Use the iLocation parameter of this method to indicate the location of the hole punches to remove. If this flag is not set, a default of HOLEPUNCH_LEFT will be used.


hRgn Parameter For HolePunchRemove

hRgn

Windows region representing one of the holes of the hole punch pattern.


iBlackCount Parameter For HolePunchRemove

iBlackCount

Total number of black pixels in one of the holes of a hole punch pattern.


iHoleIndex Parameter For HolePunchRemove

iHoleIndex

Index of the hole within a hole punch pattern. The holes are numbered from 1 to n, where n is the total number of holes in the hole punch pattern.


iHoleTotalCount Parameter For HolePunchRemove

iHoleTotalCount

The total number of holes that make up the hole punch pattern. This value will not change for a particular call to the HolePunchRemove method.


iMaxHoleCount Parameter For HolePunchRemove

iMaxHoleCount

Maximum number of holes to detect. This member is valid only if HOLEPUNCH_USE_COUNT is set in Flags. If used, this must be greater than or equal to 2.


iMaxHoleHeight Parameter For HolePunchRemove

iMaxHoleHeight

The maximum height of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if HOLEPUNCH_USE_SIZE is set in Flags.


iMaxHoleWidth Parameter For HolePunchRemove

iMaxHoleWidth

The maximum width of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if HOLEPUNCH_USE_SIZE is set in Flags.


iMinHoleCount Parameter For HolePunchRemove

iMinHoleCount

Minimum number of holes to detect. This member is valid only if HOLEPUNCH_USE_COUNT is set in Flags.


iMinHoleHeight Parameter For HolePunchRemove

iMinHoleHeight

The minimum height of one of the holes of the hole punch configuration to be removed.. If HOLEPUNCH_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if HOLEPUNCH_USE_SIZE is set in uFlags.


iMinHoleWidth Parameter For HolePunchRemove

iMinHoleWidth

The minimum width of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if HOLEPUNCH_USE_SIZE is set in Flags.


iWhiteCount Parameter For HolePunchRemove

iWhiteCount

Total number of white pixels in one of the holes of a hole punch pattern.


Location Parameter For HolePunchRemove

Location

Indicates the location within the document of the hole-punches to remove. Possible values are:

Value | Meaning
HOLEPUNCH_LEFT | Searches for the hole-punch pattern on the left side of the document
HOLEPUNCH_RIGHT | Searches for the hole-punch pattern on the right side of the document
HOLEPUNCH_TOP | Searches for the hole-punch pattern across the top of the document
HOLEPUNCH_BOTTOM | Searches for the hole-punch pattern across the bottom of the document


pRaster Parameter For HolePunchRemove

pRaster

ILEADRaster object to be modified.


Return for HolePunchRemove

Return Value

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


cr Parameter For HSV_HfromRGB

cr

OLE_COLOR for which to return the corresponding Hue.


Return for HSV_HfromRGB

Return Value

Returns the Hue corresponding to the specified OLE_COLOR.


cr Parameter For HSV_SfromRGB

cr

OLE_COLOR for which to return the corresponding Saturation.


Return for HSV_SfromRGB

Return Value

Returns the Saturation corresponding to the specified OLE_COLOR.


cr Parameter For HSV_VfromRGB

cr

OLE_COLOR for which to return the corresponding Value.


Return for HSV_VfromRGB

Return Value

Returns the Value corresponding to the specified OLE_COLOR.


lIndex Parameter For HTable

lIndex

The index into the array. The first element of the array is 0. The values present in this array are hue values used to remap the hues of an image.


iAngle Parameter For Hue

iAngle

Angular amount to change the hue, in degrees.


pRaster Parameter For Hue

pRaster

ILEADRaster object to be modified.


Return for Hue

Return Value

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


pszFilters Parameter For IgnoreFilters

pszFilters

String containing which filters should be ignored. pszFilters has the same format as in PreLoadFilters method.


Return for IgnoreFilters

Return Value

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


iIndex Parameter For InfoPCDRes

iIndex

The index into the array of boolean values. Use the following constants as possible values:

Index | Resolution
PCDRES_BASE_OVER_64 | 64 x 96
PCDRES_BASE_OVER_16 | 128 x 192
PCDRES_BASE_OVER_4 | 256 x 384
PCDRES_BASE | 512 x 768
PCDRES_4BASE | 1024 x 1536
PCDRES_16BASE | 2048 x 3072


Bitmap Parameter For InsertAt

Bitmap

Bitmap to insert.


Data Parameter For InsertAt

Data

Data attribute for the new item to insert. You can use this for any extra information you wish to associate with the item.


nIndex Parameter For InsertAt

nIndex

Index at which to insert the new item.


pszText Parameter For InsertAt

pszText

Text attribute for the new item to insert.


Return for InsertAt

Return Value

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


Bitmap Parameter For Insert

Bitmap

Bitmap to insert.


hBitmap Parameter For InsertBitmapListItem

hBitmap

Bitmap to insert into the list. You can get a bitmap to insert by referencing the Bitmap property of another object.


iIndex Parameter For InsertBitmapListItem

iIndex

Position of the bitmap in the list. Use -1 to append the bitmap to the end of the list.


Return for InsertBitmapListItem

Return Value

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


Data Parameter For Insert

Data

Data attribute for the new item to insert. You can use this for any extra information you wish to associate with the item.


hBitmapList Parameter For InsertFromBitmapList

hBitmapList

Bitmap list from which items are to be inserted.


pszDefaultText Parameter For InsertFromBitmapList

pszDefaultText

Text attribute for the new items to be inserted.


Return for InsertFromBitmapList

Return Value

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


lIndex Parameter For InsertMarker

lIndex

An integer that represents the position where the marker will be inserted.

Pass 0 to insert the marker at the beginning (so this marker will become the first marker).

Pass 1 to insert the marker after the first marker (so this marker will become the second marker).

Pass lIndex > 0 to insert this marker after the first lIndex markers.

If there are fewer than lIndex markers in the collection, the marker will be appended at the end of the collection.

Pass 0xFFFFFFFF to insert this marker at the end of the collection.


Return for InsertMarker

Return Value

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


pszText Parameter For Insert

pszText

Text attribute for the new item to insert.


Return for Insert

Return Value

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


Return for InstallFilter

Return Value

Return | Meaning
TRUE | The function was successful.
FALSE | An error occurred.

Note : No Error Codes are available. The most common errors are forgetting to set the filter URL or misspelling the filter URL.


bSilent Parameter For InstallFilter

bSilent

Flag that indicates whether the user will be notified during the installation process.

Value | Meaning
TRUE | The installation will be silent. No messages will be displayed.
FALSE | The user will be notified of the basic steps of the installation process.


bstrFilterName Parameter For InstallFilter

bstrFilterName

A string indicating the filter name, three letters are used to specify any on LEAD Filter.

A complete list of filters that are supported is as follows:

XWD

XPM

XBM

WPG

WMF

WFX

VEC

TIF

TGA

SGI

RAS

PSD

PNM

PNG

PLT

PCX

PCT

PCD

MSP

MPG

MAC

LMB

LMA

JBG

ITG

IMG

IFF

ICA

GIF

FPX

FLC

FAX

EPS

DXF

DWG

DWF

DRW

DGN

CUT

CMP

CLP

CGM

CAL

BMP

AWD

AVI

ANI


Msg Parameter For InstallFilterMsg

Msg

Specifies the string to get or set. Possible Values:

Setting | Description
INSTALL_FILTER_MSG_START [0] | Specifies the string that is displayed when installation starts.
 | The default value is:
 | "In order to view this page properly, The following LEAD filter needs to be installed:\n"
 | This string will be immediately followed by the name of the filter DLL, for example LFCMP14S.DLL.
 | NOTE: \n is a Carriage Return + Line Feed.
INSTALL_FILTER_MSG_END [1] | Specifies the string that is displayed when installation is complete.
 | The default value is:
 | "Installation of these components is finished.\nIf no more components need to be installed, you may need to refresh the page."
 | NOTE: \n is a Carriage Return + Line Feed.
INSTALL_FILTER_MSG_INFO [2] | Specifies the string that is displayed as the title of the MessageBox.
 | The default value is:
 | "Information"


iChange Parameter For Intensity

iChange

Amount to change the intensity. The intensity ranges from -1000 to 1000. A positive value increases (or lightens) the brightness of the bitmap. A negative values decreases (or darkens) the brightness of the bitmap.


pRaster Parameter For Intensity

pRaster

ILEADRaster object to be modified.


Return for Intensity

Return Value

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


fBoundingRectHeight Parameter For InvertedText

fBoundingRectHeight

Height of the bounding rectangle of the inverted text being processed.


fBoundingRectLeft Parameter For InvertedText

fBoundingRectLeft

X coordinate of the origin of the bounding rectangle of the inverted text being processed.


fBoundingRectTop Parameter For InvertedText

fBoundingRectTop

Y coordinate of the origin of the bounding rectangle of the inverted text being processed.


fBoundingRectWidth Parameter For InvertedText

fBoundingRectWidth

Width of the bounding rectangle of the inverted text being processed.


Flags Parameter For InvertedText

Flags

Flags that determine the behavior of the inverted text removal process. Flags may be combined using a bitwise OR (|). Possible values are:

Value | Meaning
INVERTEDTEXT_SINGLE_REGION: | For each inverted text segment found by the InvertedText method, if the DocCleanSuccess property is set to SUCCESS_REMOVE, the inverted text is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the inverted text is not added to the single region. When the InvertedText method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all corrected Inverted text. This is the case if the INVERTEDTEXT_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster or
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the corrected Inverted text. This is the case if the INVERTEDTEXT_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed.
 | When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
INVERTEDTEXT_LEAD_REGION | This flag must be used in conjunction with INVERTEDTEXT_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all corrected Inverted text when the InvertedText method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
INVERTEDTEXT_IMAGE_UNCHANGED | The original image is unchanged.
INVERTEDTEXT_USE_DPI | The unit of measure for all parameters of this method is thousandths of an inch. Use the image's DPI to convert to pixels. This allows the processing of many images with different DPI. If this flag is not set, the unit of measure is pixels.
INVERTEDTEXT_CALLBACK_REGION | The InvertedText event receives a Windows region that contains the current inverted text to be inverted. Setting this flag lets the user create his or her own composite of inverted text by combining the regions received by the InvertedText event, if the event returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received by the event, that are removed, results in a region identical to the region created when INVERTEDTEXT_SINGLE_REGION is set in uFlags. When the region received by the event is no longer needed, it must be destroyed.
INVERTEDTEXT_USE_DIAGONALS | Considers pixels that are diagonal to the inverted text as part of the inverted text.


hRgn Parameter For InvertedText

hRgn

Windows region representing an area of inverted text.


iBlackCount Parameter For InvertedText

iBlackCount

Total number of black pixels in the inverted text region being processed.


iMaxBlackPercent Parameter For InvertedText

iMaxBlackPercent

The maximum percent of total pixels in an inverted text area that must be black. Areas with a higher percent of black pixels are not considered.


iMinBlackPercent Parameter For InvertedText

iMinBlackPercent

The minimum percent of total pixels in an inverted text area that must be black. Areas with a lower percent of black pixels are not considered.


iMinInvertHeight Parameter For InvertedText

iMinInvertHeight

The minimum height of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iMinInvertWidth Parameter For InvertedText

iMinInvertWidth

The minimum width of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iWhiteCount Parameter For InvertedText

iWhiteCount

Total number of white pixels in the inverted text region being processed.


pRaster Parameter For InvertedText

pRaster

ILEADRaster object to be modified.


Return for InvertedText

Return Value

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


pRaster Parameter For Invert

pRaster

ILEADRaster object to be modified.


Return for Invert

Return Value

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


iIndex Parameter For IOPalette

iIndex

The index into the array of colors


hWnd Parameter For ISISAcquire

hWnd

Window handle of the ISIS® dialog's parent.


InsertMode Parameter For ISISAcquire

InsertMode

Indicates how the newly scanned page is inserted into the destination object's BitmapList

Value | Meaning
ISIS_BITMAP_LIST_OVERWRITE | [1] Any existing items in the list are deleted.
ISIS_BITMAP_LIST_APPEND | [2] New page is appended at the end of the list
ISIS_BITMAP_LIST_REPLACE | [3] New page replaces current page in the list
ISIS_BITMAP_LIST_INSERT | [4] New page is inserted before current page in the list


bMultiPage Parameter For ISISAcquireMulti

bMultiPage

Flag indicating how to save the scanned images.

Value | Meaning
TRUE | Save scanned images in a single multipage TIFF file.
FALSE | Save each scanned image in a separate TIFF file. In this case, filenames are created using the string in pszBaseFileName and incrementing each filename by one. For example: if pszBaseFileName holds the string "Page", the filenames would be Page0001, Page0002, Page0003, etc..


Format Parameter For ISISAcquireMulti

Format

Value indicating the format to use when saving one or more images to one or more files. The available formats depend on whether or not the data is acquired in compressed form or in uncompressed form. If the data is uncompressed, that is if the ISIS® tags TAG_COMPRESSION has been set to TAG_COMPRESSION_NONE, any format supported by LEADTOOLS is valid. For a list of these formats, refer to Formats of Output Files.

If the data is compressed, the type of compression will determine the output format. If a format that is incompatible with the current compression is passed, an error will occur. Possible valid format values and the corresponding compressions are:

Value | Meaning
FILE_CCITT | [25] TIFF, compressed using CCITT. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_MG3 and Format is set to either FILE_CCITT or FILE_FASTEST.
FILE_CCITT_GROUP3_1DIM | [27] TIFF, compressed using CCITT, group 3, 1 dimension. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_G3 and Format is set to either FILE_CCITT_GROUP3_1DIM or FILE_FASTEST.
FILE_CCITT_GROUP4 | [29] TIFF, compressed using CCITT, group 4. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_G4 and Format is set to either FILE_CCITT_GROUP4 or FILE_FASTEST.
FILE_TIFLZW | [17] TIFF, compressed using LZW. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_LZW and Format is set to either FILE_TIFLZW or FILE_FASTEST.
FILE_TIF_PACKBITS | [87] TIFF, compressed using Packed Bits. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_32771 and Format is set to either FILE_TIF_PACKBITS or FILE_FASTEST.
FILE_FASTEST | [105] Saves the file as a TIFF using the current compression from the scanner.


hWnd Parameter For ISISAcquireMulti

hWnd

Window handle of the ISIS® dialog's parent.


InsertMode Parameter For ISISAcquireMulti

InsertMode

Indicates how the newly scanned page is inserted into the destination object's BitmapList

Value | Meaning
ISIS_BITMAP_LIST_OVERWRITE | [1] Any existing items in the list are deleted
ISIS_BITMAP_LIST_APPEND | [2] New page is appended at the end of the list
ISIS_BITMAP_LIST_REPLACE | [3] New page replaces current page in the list
ISIS_BITMAP_LIST_INSERT | [4] New page is inserted before current page in the list


pRaster Parameter For ISISAcquireMulti

pRaster

ILEADRaster object in which the images are scanned


hWnd Parameter For ISISAcquire

pszBaseFileName

Base filename string for the output file or files.

If bMultiPage is FALSE, save each scanned image in a separate TIFF file. In this case, filenames are created using the string in pszBaseFileName and incrementing each filename by one. By default, the numbering will begin with "0001" and will be incremented with each page scanned ("0002","0003", ... ). Each file will be saved according to the format indicated in nFormat. If a file already exists, for example "Page0002", it will be overwritten. The user can control the number of digits used in numbering the filenames by including asterisks '*' in the filename, before the extension. For example, passing "c:\temp\isis\test**.tif" for pszBaseFileName indicates to use only two digits in the filenames (test04.tif), while passing "c:\temp\isis\test*****.tif" for pszBaseFileName indicates to use only five digits in the filenames (test00001.tif). If no asterisks are included, the default of four digits will be used (test0003.tif).


Return for ISISAcquire

Return Value

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


uFlags Parameter For ISISAcquireMulti

uFlags

Flags indicating ISIS® Acquire options. Possible values are:

Value | Meaning
0 | Don't show the user interface.
ISIS_SHOWUI | [1] Show the user interface.
ISIS_MULTI_NOSAVE | [2] Do not save data to file.


pRaster Parameter For ISISAcquire

pRaster

ILEADRaster object into which the image is scanned.


uFlags Parameter For ISISAcquire

uFlags

Flags indicating ISIS® Acquire options. Possible values are:

Value | Meaning
0 | Don't show the user interface.
ISIS_SHOWUI | [1] Show the user interface.


Return for ISISGetTag

Return Value

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


uTag Parameter For ISISGetTag

uTag

One of the supported ISIS® tags. For more information on tags, refer to ISIS tags.


Return for ISISLoadDriver

Return Value

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


nPage Parameter For ISISPage

nPage

Number of the page just scanned.


pszFileName Parameter For ISISPage

pszFileName

Filename into which the page was saved.


hWnd Parameter For ISISSelect

hWnd

Window handle of the ISIS® dialog's parent.


Return for ISISSelect

Return Value

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


hWnd Parameter For ISISSetScanOptions

hWnd

Window handle of the ISIS® dialog's parent.


Return for ISISSetScanOptions

Return Value

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


Return for ISISSetTag

Return Value

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


uTag Parameter For ISISSetTag

uTag

One of the supported ISIS® tags. For more information on tags, refer to ISIS tags.


Value Parameter For ISISSetTag

Value

New value for the tag designated in uTag.


Return for ISISUnloadDriver

Return Value

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


Return for IsPtInFloater

Return Value

Return | Meaning
TRUE | The point is in the floater.
FALSE | The point is outside the floater.


fx Parameter For IsPtInFloater

fx

The X coordinate of the point to test. In the MouseDown event, you can use the event's X parameter.


fy Parameter For IsPtInFloater

fy

The Y coordinate of the point to test. In the MouseDown event, you can use the event's Y parameter.


Return for IsPtInRgn

Return Value

Return | Meaning
TRUE | The point is in the region.
FALSE | The point is outside the region.


fx Parameter For IsPtInRgn

fx

The X coordinate of the point to test. In the MouseDown event, you can use the event's X parameter.


fy Parameter For IsPtInRgn

fy

The Y coordinate of the point to test. In the MouseDown event, you can use the event's Y parameter.


Return for IsSupportLocked

Return Value

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


SupportType Parameter For IsSupportLocked

SupportType

The optional feature to check. For possible values, refer to the iType parameter of the UnlockSupport method.


iIndex Parameter For ItemChecked

iIndex

Index into the menu items in the AnnMenu object. This is a zero-based index.


iIndex Parameter For ItemEnabled

iIndex

Index into the menu items in the RasterAnnMenu object. This is a zero-based index.


iIndex Parameter For ItemID

iIndex

Index into the menu items in the RasterAnnMenu object. This is a zero-based index.


nIndex Parameter For ItemSelected

nIndex

The 0-based index of the item that was selected.


iIndex Parameter For ItemString

iIndex

Index into the menu items in the RasterAnnMenu object. This is a zero-based index.


iIndex Parameter For ItemType

iIndex

Index into the menu items in the RasterAnnMenu object. This is a zero-based index.


nIndex Parameter For ItemUnSelected

nIndex

Index of the item unselected. This is a zero-based index.


Return for J2KSetDefaults

Return Value

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


KeyCode Parameter For KeyDown

KeyCode

Each development system has its own way of handling key codes. The following topics provide a quick reference:

Visual Basic Constants for Key Codes.

Visual C++ Key Codes.


Shift Parameter For KeyDown

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


KeyAscii Parameter For KeyPress

KeyAscii

The standard numeric ANSI keycode. KeyAscii is passed by reference; changing it sends a different character to the object. Changing KeyAscii to 0 cancels the keystroke so that the object receives no character.


iBitsPerPixel Parameter For LoadArray2

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


lPage Parameter For LoadArray2

lPage

The page number of the image, if the file is in a multipage file.

GIF, TIFF (MPT), and PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If the file is not a multi-page file, pass 0.


lPages Parameter For LoadArray2

lPages

The number of pages to load. To load all pages in a multi-page file, pass -1. If the file is not a multi-page file, pass 1.


lSize Parameter For LoadArray2

lSize

The size in bytes of the data stored in memory. If you use the SaveArray method to create the file in memory, you calculate the size using the following:

Size = UBound(variant) – LBound(variant) + 1


pRaster Parameter For LoadArray2

pRaster

ILEADRaster object in which the image is loaded.


Return for LoadArray2

Return Value

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


vMem Parameter For LoadArray2

vMem

A VARIANT byte array that contains a file in memory.


Flags Parameter For MaskConvolution

Flags

Flag that indicates which mask to use in the convolution process. Possible values are:

Value | Meaning
MSKC_EMBOSS | [0x0000] Apply the Emboss Mask on the bitmap.
MSKC_EDGE | [0x0001] Apply the Edge Detection Mask on the bitmap.
MSKC_ESPLOTCH | [0x0002] Apply the Emboss-Splotch Mask on the bitmap.
MSKC_SPLOTCH | [0x0003] Apply the Splotch Mask on the bitmap.


lAngle Parameter For MaskConvolution

lAngle

Angle of the apparent light source, in hundredths of degrees.

Possible values range from –36000 to 36000.


lDepth Parameter For MaskConvolution

lDepth

The depth of the 3D effect.

This value is divided internally by 100.

This value is used as a multiplier for the individual mask values.


lHeight Parameter For MaskConvolution

lHeight

Non-zero value greater than 2, that represents the height of the mask matrix. This value determines the height of the 3D effect. The larger the value, the more complex and time-consuming the operations will be.


pRaster Parameter For MaskConvolution

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for MaskConvolution

Return Value

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


crBorderColor Parameter For MosaicTiles

crBorderColor

Value that specifies the transparency fill color for the tile border areas.


crTilesColor Parameter For MosaicTiles

crTilesColor

Value that specifies the transparency fill color for the tiles.


Return for MosaicTiles

Return Value

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


lCenterX Parameter For MosaicTiles

lCenterX

The X-coordinate of the point that represents the center of revolution when polar coordinates are used. This parameter is used if MSCT _POLAR is set to lFlags parameter.


lCenterY Parameter For MosaicTiles

lCenterY

The Y-coordinate of the point that represents the center of revolution when polar coordinates are used. This parameter is used if MSCT _POLAR is set to lFlags parameter.


lFlags Parameter For MosaicTiles

lFlags

Flags that indicate whether to use arc-shaped or rectangular-shaped tiles, and what type of shadowing to use, if any. You can use a bit wise OR (|) to specify one flag from each group.

The following flags indicate which tile shape should be used:

Value | Meaning
MSCT_CART | [0x0000] Draw rectangular tiles. If this flag is used, lTileWidth contains the tile width in pixels, and lTileHeight contains the tile height in pixels.
MSCT_POLAR | [0x0001] Draw arc-shaped tiles. If this flag used, lTileWidth contains the size of the curve in the tiles in degrees, and lTileHeight contains the radial length of the tiles (in pixels).

The following are the flags indicate how to apply the shadow on the tiles, or whether to use shadows:

Value | Meaning
MSCT_FLAT | [0x0000] Do not apply a shadow.
MSCT_SHADOWRGB | [0x0010] Apply colored shadows.
MSCT_SHADOWGRAY | [0x0020] Apply grayscale shadows.


lOpacity Parameter For MosaicTiles

lOpacity

Value that represents the weight, in percent, given to the image color and the border or tile color when determining the resulting color. For example, if lOpacity = 75, then 75% of the image color will be added to 75% of the border (or Tile) color. Final results are clipped if greater than 255.

Valid values range from 0 to 100.


lPenWidth Parameter For MosaicTiles

lPenWidth

Value that indicates the width of the pen used to draw tile boundaries, in logical units.

Valid values range from 1 to 15.

The pen uses the crBorderColor.


lShadowThreshold Parameter For MosaicTiles

lShadowThreshold

Value that determines which pixels will be affected by the shadow.

Valid values range from 0 to 255.

Pixel values less than the threshold value will be unaffected. This member will be used if the MSCT_SHADOWRGB flag or the MSCT_SHADOWGRAY flag is set in lFlags.


lTileHeight Parameter For MosaicTiles

lTileHeight

Value that represents the height of the tile. The lTileHeight differs according to the flags that are set in the lFlags parameter. Possible values are:

If lFlags contains | lTileHeight represents | Valid Range
MSCT_CART | The height of each rectangular tile, in pixels. | 1 to the image height, if there is no region. If there is a region, then the range of values is 1 to the region height.
MSCT_POLAR | The radial length of each arc-shaped tile, in pixels. | 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is 1 to the diagonal of the region rectangle.


lTileWidth Parameter For MosaicTiles

lTileWidth

Value that represents the width of the tile. The meaning of lTileWidth differs according to the flags that are set in the lFlags parameter. Possible values are:

If lFlags contains | lTileWidth represents | Valid Range
MSCT_CART | The width of each rectangular tile, in pixels. | 1 to the image width, if there is no region. If there is a region, then the range of values is 1 to the region width.
MSCT_POLAR | The size, in degrees, of the curve in the arc-shaped tiles. That is, the circle around the ptCenter is divided into tiles of uTileWidth degrees, as shown below: | 1 to 360. The circle can be divided into tiles from 1 degree to 360 degrees.


pRaster Parameter For MosaicTiles

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


ShadowAngle Parameter For MosaicTiles

ShadowAngle

Value indicating the direction of the light source that produces the shadow, this parameter is used if the MSCT_SHADOWRGB flag or the MSCT_SHADOWGRAY flag is set to lFlags parameter. Possible values are:

Value | Meaning
SHADOW_E | [0x0000] East
SHADOW_NE | [0x0001] Northeast
SHADOW_N | [0x0002] North
SHADOW_NW | [0x0003] Northwest
SHADOW_W | [0x0004] West
SHADOW_SW | [0x0005] Southwest
SHADOW_S | [0x0006] South
SHADOW_SE | [0x0007] Southeast


lIndex Parameter For MRCRaster

lIndex

Index into the array of ILEADRasterMrc object.

Possible values are range from 0 to MRCRasterCount – 1.


crBackColor Parameter For Offset

crBackColor

Value that specifies the fill color for any exposed areas. This is only useful when the Flags parameter is set to FILL_CLR.


Flags Parameter For Offset

Flags

Flag that indicates how to handle any exposed areas resulting from the bitmap shift. Possible values are:

Value | Meaning
OFFSET_FILL_CLR | [0x0000] Fill the exposed areas with crBackColor.
OFFSET_FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
OFFSET_FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.
OFFSET_FILL_WRAP | [0x0003] Fill any exposed areas with the opposite side of the image.


lHorizontalShift Parameter For Offset

lHorizontalShift

Horizontal shift of the bitmap, in pixels.


lVerticalShift Parameter For Offset

lVerticalShift

Vertical shift of the bitmap, in pixels.


pRaster Parameter For Offset

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Offset

Return Value

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


AnnHandleInfo Parameter For OnEnumerateHandle

AnnHandleInfo

Pointer to an ILEADRasterAnnHandleInfo object that contains information on the annotation handle being enumerated.


hObject Parameter For OnEnumerateHandle

hObject

Handle to the annotation object


bstrDescription Parameter For OnEnumerateTextTokenTable

bstrDescription

String that describes the token. This string appears on the text token table menu. For example, the string for token #0 in the default text token table is "Two Digit Month". The text token table menu is displayed by:

1. | Right-clicking on a Button, Note, PushPin, Rubber Stamp, Stamp, Text, or Text Pointer annotation object.
2. | Select Text option in menu that appears.
3. | Click the Insert Token button. A menu for the existing text token table appears, as shown in the following figure:
4. | Select the token to be inserted.


bstrToken Parameter For OnEnumerateTextTokenTable

bstrToken

String that contains the token. This can be ANY ascii character EXCEPT ‘#’, because the token ## is reserved to display the # character.


bstrTokenString Parameter For OnEnumerateTextTokenTable

bstrTokenString

String that contains any combination of existing strings or any new string. This parameter is vlid only if the TokenType parameter is ANN_TOKEN_TEXT. If the TokenType parameter is not ANN_TOKEN_TEXT, then bstrTokenString is ignored.


nTextTokenCount Parameter For OnEnumerateTextTokenTable

nTextTokenCount

Total number of tokens in the text token table.


TokenType Parameter For OnEnumerateTextTokenTable

TokenType

Value that identifies the type of token. Possible values are:

Value | Meaning
ANN_TOKEN_NONE | [0] String not treated as a token
ANN_TOKEN_SEPARATOR | [1] Add a separator to the automation token menu
ANN_TOKEN_TEXT | [2] A text string
ANN_TOKEN_DATE_YYYY | [3] Current four digit year
ANN_TOKEN_DATE_YY | [4] Current two digit year
ANN_TOKEN_DATE_MM | [5] Two digit representation of current month
ANN_TOKEN_DATE_DD | [6] Two digit representation of current day
ANN_TOKEN_DATE_MONTH_NAME | [7] Current month name (i.e. January)
ANN_TOKEN_DATE_DAY_OF_WEEK | [8] Current day of week (i.e. Monday)
ANN_TOKEN_TIME_HH_12 | [9] Current hour,using a 12 hour clock
ANN_TOKEN_TIME_HH_24 | [10] Current hour, using a 24 hour clock
ANN_TOKEN_TIME_MM | [11] Current minute (00-59)
ANN_TOKEN_TIME_SS | [12] Current second (00-59)
ANN_TOKEN_TIME_MILLISECONDS | [13] Current milliseconds (000-999)
ANN_TOKEN_AM_PM | [14] Time of day indicator (AM or PM)


crBackColor Parameter For Perlin

crBackColor

Value that represents the background color.


crPerlinColor Parameter For Perlin

crPerlinColor

Value that represents the perlin noise color.


lDensity Parameter For Perlin

lDensity

Value that represents the number of iterations that will be calculated.

Valid values range from 0 to 8.

No noise is created if the value is 0. Increasing this value increases the detail in the noise, as well as computation time.


lDenLayout Parameter For Perlin

lDenLayout

Value that represents the density of the layout for the produced noise.

Valid values range from 0 to 100.

When using a low nDenLayout value the noise will appear with light color.


lFlags Parameter For Perlin

lFlags

Flags that specify how to apply the effect, and which layout pattern to use for the noise. You can use a bit wise OR (|) to specify one flag from each group.

The following flags specify how to apply the effect:

Value | Meaning
PRL_PURE | [0x0000] Produce noise as a new bitmap.
PRL_COMBINE | [0x0001] Combine the noise and the bitmap pixels using the lOpacity value.
PRL_DIFFERENCE | [0x0002] Apply the difference between the noise and the bitmap pixels.

The following flags indicate which layout pattern to use for the noise:

Value | Meaning
PRL_CIRCLE | [0x0000] Lay out the noise in concentric circles. Set the center for the circle using lxCircle and lyCircle.
PRL_LINE | [0x0010] Lay out the noise in lines at a 45 degree angle.
PRL_RANDOM | [0x0020] Lay out the noise randomly.


lFreqLayout Parameter For Perlin

lFreqLayout

Value used to control the frequency of the circles or lines to be created for the noise bitmap. This parameter is used if the PRL_CIRCLE or PRL_LINE flag is set to lFlags parameter.

Valid values range from 0 to 100.

Increase this value to increase the number of circles or lines drawn.


lFrequency Parameter For Perlin

lFrequency

Value that represents the frequency component for both the x and y axis.

Valid values range from 0 to 16.

No noise is created if the value is 0. Increasing this value increases the noise.


lOpacity Parameter For Perlin

lOpacity

Value that represents the percentage to be used when combining the original bitmap with the noise.

Valid values range from 0 to 100.

This parameter is used if the PRL_COMBINE or PRL_DIFFERENCE flag is set. A value of 0 indicates that no noise is being used and a value of 100 represents a mix of noise and image.


lSeed Parameter For Perlin

lSeed

Value that represents the initial seeding value for the pseudo-randomization process. Use 0 for automatic seeding. If other parameters are kept the same, each seed value always produces the same effect. Each seed value produces an effect different from all of the other seed values.

Possible values are 0 or greater.


lxCircle Parameter For Perlin

lxCircle

The x coordinate, in pixels and in bitmap coordinates, for the center point of the concentric circles.

Valid values range from 0 to the width of the bitmap.

This parameter is only used if the PRL_CIRCLE flag is set.


lyCircle Parameter For Perlin

lyCircle

The y coordinate, in pixels and in bitmap coordinates, for the center point of the concentric circles.

Valid values range from 0 to the height of the bitmap.

This parameter is only used if the PRL_CIRCLE flag is set to lFlags parameter.


pRaster Parameter For Perlin

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Perlin

Return Value

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


crBkgColor Parameter For Perspective

crBkgColor

Background color.


Flags Parameter For Perspective

Flags

Flag that indicates how to create the background. Possible values are:

Value | Meaning
PERSPECTIVE_IMAGE | [0x0001] Use the same image as the background.
PERSPECTIVE_COLOR | [0x0002] Fill the back ground with crBkgColor.


lIndex Parameter For PerspectivePointsX

lIndex

Index into the array of X coordinates.


lIndex Parameter For PerspectivePointsY

lIndex

Index into the array of Y-coordinates.


pRaster Parameter For Perspective

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Perspective

Return Value

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


lBlueFreq Parameter For PlasmaFilter

lBlueFreq

Value that indicates which frequencies of blue color should be used to create plasma patterns. Valid range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. Use 0 to turn off processing for the blue frequencies.


lFlags Parameter For PlasmaFilter

lFlags

Flags that indicate which type of plasma effect to create, and which color pattern to use. You can use a bitwise OR (|) to specify one flag from each group.

The following flags indicate which type of plasma effect to create:

Value | Meaning
PLSTYP_VERTICAL | [0x0000] Create vertical lines of plasma.
PLSTYP_HORIZONTAL | [0x0001] Create horizontal lines of plasma.
PLSTYP_DIAGONAL | [0x0002] Create diagonal lines of plasma.
PLSTYP_CROSS | [0x0003] Create crossed lines of plasma.
PLSTYP_CIRCULAR | [0x0004] Create circles of plasma.
PLSTYP_RANDOM1 | [0x0005] Create randomly shaped plasma.
PLSTYP_RANDOM2 | [0x0006] Create a different type of randomly shaped plasma

The following flags indicate which color pattern to use:

Value | Meaning
PLSCLR_HUE | [0x0000] Use the first predefined color pattern
PLSCLR_RGB1 | [0x0010] Use the second predefined color pattern.
PLSCLR_RGB2 | [0x0020] Use the third predefined color pattern.
PLSCLR_CUST | [0x0030] Use the frequency parameters (lRedFreq, lGreenFreq, lBlueFreq) to generate user-defined plasma colors.


lGreenFreq Parameter For PlasmaFilter

lGreenFreq

Value that indicates which frequencies of green color should be used to create plasma patterns. Valid range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. Use 0 to turn off processing for the green frequencies.


lOpacity Parameter For PlasmaFilter

lOpacity

A percentage value that indicates the amount of blending between the plasma color patterns and the original image. Possible values range from 0 to 100. Use 0 when not using an image, and 100 when not using the plasma values.


lRedFreq Parameter For PlasmaFilter

lRedFreq

Value that indicates which frequencies of red color should be used to create plasma patterns. Valid range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. Use 0 to turn off processing for the red frequencies.


lShift Parameter For PlasmaFilter

lShift

The amount of color shift in the plasma color pattern. Valid range for the 16, 48, and 64-bit bitmaps is from 0 to 65535 and for 12-bit bitmaps from 0 to 4095. Otherwise, it is from 0 to 255. A value of 0 means there is no color shift.


lSize Parameter For PlasmaFilter

lSize

Value greater than 0 that represents the plasma size.

The value is divided internally by 100

The value, after it has been divided by 100, represents the size in pixels.


pRaster Parameter For PlasmaFilter

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for PlasmaFilter

Return Value

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


crColor Parameter For Pointillist

crColor

Value that represents fill color.


lFlags Parameter For Pointillist

lFlags

Flags that indicate which background and dot type to use. You can use a bit wise OR (|) to specify one flag from each group. The following flags indicate which background to use:

Value | Meaning
POINTILLIST_IMAGE | [0x0001] Use the image as the background.
POINTILLIST_COLOR | [0x0002] Fill the background with crColor.

The following flags indicate which dot type to use:

Value | Meaning
POINTILLIST_STICKER | [0x0010] Use dots that will overlap like stickers.
POINTILLIST_POINT | [0x0020] Use dots that will adjust like bubbles.


lSize Parameter For Pointillist

lSize

Value that represents dot size, in pixels.


pRaster Parameter For Pointillist

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Pointillist

Return Value

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


crColor Parameter For RomanMosaic

crColor

Value that specifies the fill color to be used between the tiles.


lBorder Parameter For RomanMosaic

lBorder

Value that indicates the border width (space between the tiles), in pixels.

Valid values range from 1 to 15.


lFlags Parameter For RomanMosaic

lFlags

Flags that indicate which type of tiles to draw, whether to apply shadows, and how to apply the shadows when shadowing is used. You can use a bit wise OR (|) to specify one flag from each group.

The following flags indicate which type of tiles to draw:

Value | Meaning
RMN_RECT | [0x0000] Draw rectangular tiles in a grid. When this flag is used lTileWidth contains the tile width in pixels, and lTileHeight contains the tile height in pixels.
RMN_CIRC | [0x0001] Draw rounded rectangular tiles in rings around the center of the bitmap. When this flag is used lTileWidth contains the radial component of the tile in pixels.
RMN_BOTH | [0x0002] Draw both rounded rectangular and rectangular tiles. Draw the largest circle that will fit inside the bitmap and fill that with rings of rounded rectangular tiles. Any part of the bitmap that is not covered by the rounded rectangular tiles gets covered with a grid of rectangular tiles.

The following flags indicate how to apply the shadow on the tiles, and whether to use shadowing:

Value | Meaning
RMN_FLAT | [0x0000] Do not apply shadows.
RMN_SHADOWRGB | [0x0010] Apply colored shadows.
RMN_SHADOWGRAY | [0x0020] Apply grayscale shadows.


lShadowThresh Parameter For RomanMosaic

lShadowThresh

Value that is used to determine which pixels will be affected by the shadow.

Valid values range from 0 through 255.

This parameter will be used if the RMN_SHADOWRGB flag or the RMN_SHADOWGRAY flag is set to lFlags parameter.

Pixels with values above this threshold will be affected.


lTileHeight Parameter For RomanMosaic

lTileHeight

Value that indicates the height of the tile. The meaning of the lTileHeight parameter differs according to the flags that are set in the lFlags member. Possible values are:

If lFlags contains | lTileHeight represents | Valid Range
RMN_RECT or RMN_BOTH | The height of each rectangular tile, in pixels. | 1 to the image height / 2, if there is no region. If there is a region, then the range of values is just the region height/2.
RMN_CIRC | Will be ignored. | Will be ignored.


lTileWidth Parameter For RomanMosaic

lTileWidth

Value that indicates the width of the tile, in pixels. The meaning of the lTileWidth parameter differs according to the flags that are set in the lFlags parameter. Possible values are:

If lFlags contains | lTileWidth represents | Valid Range
RMN_RECT | The width of each rectangular tile, in pixels. | 1 to the image width / 2, if there is no region. If there is a region, then the range of values is just the region width/2.
RMN_CIRC or RMN_BOTH | The radial length of each arc-shaped tile, in pixels | 1 to the half of the diagonal of the image, if there is no region. If there is a region, then the range of values is just the half of the diagonal of the region rectangle.


pRaster Parameter For RomanMosaic

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


ShadowAngle Parameter For RomanMosaic

ShadowAngle

Angle value that indicates the direction of the light source that produces the shadow. This parameter can be used if the RMN_SHADOWRGB flag or the RMN_SHADOWGRAY flag is set to the lFlags parameter. Possible values are:

Value | Meaning
SHADOW_E | [0x0000] East.
SHADOW_NE | [0x0001] Northeast.
SHADOW_N | [0x0002] North.
SHADOW_NW | [0x0003] Northwest.
SHADOW_W | [0x0004] West.
SHADOW_SW | [0x0005] Southwest.
SHADOW_S | [0x0006] South.
SHADOW_SE | [0x0007] Southeast.


Return for RomanMosaic

Return Value

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


lFormat Parameter For SaveList

lFormat

Output file format. For valid values, refer to Formats of Output Files.


pRaster Parameter For SaveList

pRaster

ILEADRaster object that contains the List of image to be saved


pszFileName Parameter For SaveList

pszFileName

Character string containing the output file name.


Return for SaveList

Return Value

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


lBackGroundThreshold Parameter For SegmentExt

lBackGroundThreshold

Threshold value used to separate image objects from the background. Best values are from 5 to 35.


lCleanSize Parameter For SegmentExt

lCleanSize

Value that indicates the cleaner size used to remove the noise inside the segmented image. Possible values range from 0 to 10, where 0 means to skip the cleaning stage.


lColorThreshold Parameter For SegmentExt

lColorThreshold

Threshold value used to combine colors. Colors that are closer together than this amount will be combined. The best value is 25. Values saturate at 443.


lCombineThreshold Parameter For SegmentExt

lCombineThreshold

Threshold value used to merge segments. Best values are from 75 to 125.


lFlags Parameter For SegmentExt

lFlags

Flags that indicate segmentation preference, whether to force segments to be 2-bit segments, and whether to search for background segments. You can use a bitwise OR (|) to specify one flag from each group:

The following are the flags that indicate the segmentation preference, and whether to force segments to be 2-bit segments:

Value | Meaning
SGM_FAVOR_ONEBIT | [0x0000] The prefer segments type upon the others is one-bit.
SGM_FAVOR_TWOBIT | [0x0001] The prefer segments type upon the others is two-bit.
SGM_FORCE_ONEBIT | [0x0002] Force all two-bit segment types to be two-bit segments.
SGM_FORCE_TWOBIT | [0x0003] Force all one-bit segment types to be two-bit segments.

The following are the flags that indicate whether to search for background segments:

SGM_WITHBKGRND | [0x0000] Search for background segments.
SGM_WITHOUTBKGRND | [0x0010] Do not search for background segments.


lSegmentQuality Parameter For SegmentExt

lSegmentQuality

Threshold value used to determine whether the segment is a picture segment. Possible values range from 0 to 100. Use 0 to set all possible picture segments to 2-bit without loss of a lot of information. Use 100 to set all picture segments to 2 bit only if they are very very close to 2-bit.


pRaster Parameter For SegmentExt

pRaster

ILEADRaster object that contains the image to be segmented.


Return for SegmentExt

Return Value

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


lDataSize Parameter For SetBitmapDataPointer2

lDataSize

The size of the data from vData. If vData is empty, then this parameter is ignored. Should match the required size for the bitmap data.


Return for SetBitmapDataPointer2

Return Value

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


vData Parameter For SetBitmapDataPointer2

vData

Parameter that can specify the bitmap data. Can be an empty variant, in which case the bitmap data pointer is set to NULL.


pRaster Parameter For ShiftMinimumToZero

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ShiftMinimumToZero

Return Value

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


lMaxInput Parameter For ShiftZeroToNegative

lMaxInput

The bitmap's maximum intensity value. This value can be obtained by calling the GetMinMaxVal method.


lMaxOutput Parameter For ShiftZeroToNegative

lMaxOutput

The maximum intensity value allowed in the resulting image. If this method results in an intensity value more than this value, the intensity value in the resulting image will be set to this maximum value.


lMinInput Parameter For ShiftZeroToNegative

lMinInput

The bitmap's minimum intensity value. This value can be obtained by calling the GetMinMaxVal method.


lMinOutput Parameter For ShiftZeroToNegative

lMinOutput

The minimum intensity value allowed in the resulting image. If this method results in an intensity value less than this value, the intensity value in the resulting image will be set to this minimum value.


lShiftAmount Parameter For ShiftZeroToNegative

lShiftAmount

The amount by which to decrease the bitmap's intensity values. This value is used to shift the bitmap data to include negative values.

To shift the data back the same amount that it was shifted by the ShiftMinimumToZero method, pass the value in the ShiftAmount property for this parameter.


pRaster Parameter For ShiftZeroToNegative

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ShiftZeroToNegative

Return Value

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


crVigColor Parameter For Vignette

crVigColor

Value that specifies the vignette object color.


lCenterX Parameter For Vignette

lCenterX

The X-axis coordinate of the center point for all vignette objects (circle, ellipse, rectangle, and square).


lCenterY Parameter For Vignette

lCenterY

The Y-axis coordinate of the center point for all vignette objects (circle, ellipse, rectangle, and square).


lFading Parameter For Vignette

lFading

Percent of feathering in towards or outward from the vignette object. Negative values mean that the feathering will start outside the boundaries of the object and increase toward the object. Positive values mean that the feathering will start on the boundaries of the object and increase away from the object.

Valid values range from -100 to 100.


lFadingRate Parameter For Vignette

lFadingRate

Value that indicates the fading rate, this value is used to controlling the fading process it will be divided by 100 internally.

Valid values range is from 0 to 100.


lFlags Parameter For Vignette

lFlags

Flags that indicate the shape of the vignette object, and the feathering direction.

The following flags indicate which vignette shape to use:

Value | Meaning
VIG_SQUARE | [0x0000] Make the vignette shape a square.
VIG_RECTANGLE | [0x0001] Make the vignette shape a rectangle.
VIG_CIRCLE | [0x0002] Make the vignette shape a circle.
VIG_ELLIPSE | [0x0003] Make the vignette shape an ellipse.

The following flags indicate how to use the fill color:

Value | Meaning
VIG_FILLIN | [0x0000] Use crVigColor to fill the inside of the vignette object.
VIG_FILLOUT | [0x0010] Use crVigColor as the fill color for the outside of the vignette object.


lHeight Parameter For Vignette

lHeight

Value that indicates the height in pixels of the vignette ellipse or rectangle objects. This parameter is ignored if the VIG_CIRCLE or VIG_SQUARE is set to lFlags parameter.


lWidth Parameter For Vignette

lWidth

Value that indicates the dimension of the vignette object in pixels.

Vignette shape | lWidth indication
Square | Square width
Rectangle | Rectangle width
Circle | Circle radius
Ellipse | Ellipse width


pRaster Parameter For Vignette

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for Vignette

Return Value

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


crFill Parameter For ZigZag

crFill

Value that specifies the fill color for any exposed areas.


lAmplitude Parameter For ZigZag

lAmplitude

Non-zero value that represents the magnitude of the wave (amount of displacement), if ZG_RAD is set in the lFlags parameter.

Valid values range from 1 – 100.


lAttenuation Parameter For ZigZag

lAttenuation

Attenuation value. The attenuation value indicates how rapidly the wave amplitude decays as the wave travels along the radial line.

Valid values range from 1 – 100.


lFlags Parameter For ZigZag

lFlags

Flags that indicate how to handle exposed areas, and the wave radiation type. You can use a bitwise OR (|) to specify one flag from each group. The following are the flags that indicate how to handle exposed areas:

Value | Meaning
FILL_CLR | [0x0000] Fill any exposed areas with crFill.
FILL_RPT | [0x0001] Stretch the image edges to fill the exposed area.
FILL_NOCHG | [0x0002] Leave the exposed area as is, without changing it.

The following are the flags that indicate the wave radiation type:

Value | Meaning
ZG_RAD | [0x0000] Create distortion waves around the Center point represented by the lXCenter and lYCenter.
ZG_POND | [0x0010] Create distortion waves that resemble the ripples in a pond.


lFrequency Parameter For ZigZag

lFrequency

Number of times the waves repeat along the radial line.


lPhase Parameter For ZigZag

lPhase

Wave phase shift, in hundredths of degrees.

Valid values range from –36000 to 36000 (The value in degrees is lPhase divided by 100).


lXCenter Parameter For ZigZag

lXCenter

The X-axis coordinate of the center point of the zigzag wave.


lYCenter Parameter For ZigZag

lYCenter

The Y-axis coordinate of the center point of the zigzag wave.


pRaster Parameter For ZigZag

pRaster

Pointer to the ILEADRaster object that references the bitmap on which to apply the effect.


Return for ZigZag

Return Value

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


KeyCode Parameter For KeyUp

KeyCode

Each development system has its own way of handling key codes. The following topics provide a quick reference:

Visual Basic Constants for Key Codes.

Visual C++ Key Codes.


Shift Parameter For KeyUp

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


iLayer Parameter For LayerBlendModeKey

iLayer

Index into the array of layer blend mode keys.


pRaster Parameter For LayerBlendModeKey

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


iLayer Parameter For LayerClipping

iLayer

Index into the array of layer clipping values.


pRaster Parameter For LayerClipping

pRaster

Poniter to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


iLayer Parameter For LayerLeft

iLayer

If this value is 0, the property contains information that was last read from the file using the LoadLayer method.

If this value is > 0, this is an index into the array of layer left positions.


pRaster Parameter For LayerLeft

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


iLayer Parameter For LayerOpacity

iLayer

Index into the array of layer opacity values.


pRaster Parameter For LayerOpacity

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


iLayer Parameter For LayerTop

iLayer

If this value is 0, the property contains information that was last read from the file using the LoadLayer method.

If this value is > 0, this is an index into the array of layer top positions.


pRaster Parameter For LayerTop

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed only when iLayer is > 0.


iIndex Parameter For LevelLUT

iIndex

Short value containing an index into the LevelLUT.

It is used to get or set a color stored in LevelLUT.


iIndex Parameter For LineProfileBlue

iIndex

Index into the array of colors.


iIndex Parameter For LineProfileGreen

iIndex

Index into the array of colors.


pRaster Parameter For LineProfile

pRaster

ILEADRaster object to be modified.


iIndex Parameter For LineProfileRed

iIndex

Index into the array of colors.


Return for LineProfile

Return Value

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


xEnd Parameter For LineProfile

xEnd

x-coordinate of the end point for the line. Information for this point is included in the arrays.


xStart Parameter For LineProfile

xStart

x-coordinate of the starting point for the line.


yEnd Parameter For LineProfile

yEnd

y-coordinate of the end point for the line. Information for this point is included in the arrays.


yStart Parameter For LineProfile

yStart

y-coordinate of the starting point for the line.


Flags Parameter For LineRemove

Flags

Flags that determine the behavior of the line removal process. Flags may be combined using a bitwise OR. Possible values are:

Value | Meaning
LINE_SINGLE_REGION: | For each line found by the LineRemove method, if the DocCleanSuccess property is set to SUCCESS_REMOVE in the LineRemove event, the removed line is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the line is not added to the single region. When the LineRemove method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all removed lines. This is the case if the LINE_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster or
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the removed lines. This is the case if the LINE_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed.
 | When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
LINE_LEAD_REGION | This flag must be used in conjunction with LINE_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all removed lines when the LineRemove method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
LINE_IMAGE_UNCHANGED | The original image is unchanged.
LINE_USE_DPI | The unit of measure for all parameters of this method is thousandths of an inch. Use the image's DPI to convert to pixels. This allows the processing of many images with different DPI. If this flag is not set, the unit of measure is pixels.
LINE_CALLBACK_REGION | The LineRemove event receives a Windows region that contains the current line to be removed. Setting this flag lets the user create his or her own composite of removed lines by combining the regions received by the event, if the DocCleanSuccess property was set to SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received by the event, that are removed, results in a region identical to the region created when LINE_SINGLE_REGION is set in uFlags.
LINE_REMOVE_ENTIRE | Remove the entire line, even if the line passes through a character or a wall. Consider the line below.
 | Setting iMaxWallPercent as 80 and passing LINE_REMOVE_ENTIRE will remove the red pixels as shown below.
LINE_USE_GAP | Consider "gaps" in lines when performing line removal. If this flag is passed, the iGapLength parameter is used. If this flag is not passed, the iGapLength parameter is ignored.
LINE_USE_VARIANCE | Consider line variance when performing line removal. If this flag is passed, the iVariance parameter is used. If this flag is not passed, the parameter is ignored.


hRgnLine Parameter For LineRemove

hRgnLine

Windows region representing a line to be removed. It is the programmer's responsibility to delete this region when it is no longer needed.


iGapLength Parameter For LineRemove

iGapLength

Maximum length of a break or a hole in a line. This can be used to remove dotted lines, dashed lines, or lines that have breaks due to scanning. If LINE_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if LINE_USE_GAP is set in Flags.


iMaxLineWidth Parameter For LineRemove

iMaxLineWidth

Maximum average width of a line that is considered for removal. Lines that are greater in average width are not removed. If LINE_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iMinLineLength Parameter For LineRemove

iMinLineLength

Minimum length of a line considered for removal. Lines less than this length are not removed. If LINE_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iVariance Parameter For LineRemove

iVariance

Amount of width change that is tolerated between adjacent line slices. If LINE_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels. This parameter is valid only if LINE_USE_VARIANCE is set in Flags. For example, the following horizontal line is 30 pixels in length (X represents a pixel)

XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX

If iVariance is 2 pixels (i.e. tolerate width changes of 2 pixels or less), the first 10 columns and the last 10 columns of the line will be removed. The middle 10 columns will be unchanged. This helps preserve characters that intersect a line that is being removed.


iWall Parameter For LineRemove

iWall

Height of a wall. Walls are slices of a line that are too wide to be considered part of the line. Examples of walls include a character that a line passes through or a perpendicular line. If the image contains lines that pass through characters, set iWall to be equal to or a little larger than iMaxLineWidth. If LINE_USE_DPI is set in Flags, units are in thousandths of an inch, otherwise units are in pixels.


iWallPercent Parameter For LineRemove

iWallPercent

The maximum number of wall slices (expressed as a percent of the total length of the line) that are allowed. A line consists of wall slices and non-wall slices (see description of iWall). This field specifies that maximum number of wall slices (expressed as a percent of the total length of the line) that are allowed. Lines that have a wall percent that is larger than iMaxWallPercent will not be removed. For example, consider the line below that is 10 pixels in length, and 1 pixel in height in some places, and five pixels in height in other places.

Setting iMinLineLength to 10 pixels and iWall to four pixels will identify the line below as a candidate for removal. Note that the wall percent for this line is 60% (because six of ten line slices are walls). If iMaxWallPercent is 80 then the line will be removed (actually, the pixels marked as red will be removed). If iMaxWallPercent is 30, then the line will not be removed.


nLength Parameter For LineRemove

nLength

Length (in pixels) of the line.


nStartCol Parameter For LineRemove

nStartCol

The starting column of the line. The columns are zero-based.


nStartRow Parameter For LineRemove

nStartRow

The starting row of the line. The rows are zero-based.


pRaster Parameter For LineRemove

pRaster

ILEADRaster object to be modified.


Return for LineRemove

Return Value

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


uRemoveFlags Parameter For LineRemove

uRemoveFlags

Flag that indicates which lines to remove. Possible values are:

Value | Meaning
LINEREMOVE_HORIZONTAL | Remove horizontal lines
LINEREMOVE_VERTICAL | Remove vertical lines


iBitsPerPixel Parameter For LoadArray

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


lPage Parameter For LoadArray

lPage

The page number of the image, if the file is in a multipage file.

GIF, TIFF (MPT), and PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If the file is not a multi-page file, pass 0.


lPages Parameter For LoadArray

lPages

The number of pages to load. To load all pages in a multi-page file, pass -1. If the file is not a multi-page file, pass 1.


lSize Parameter For LoadArray

lSize

The size in bytes of the data stored in memory. If you use the SaveArray method to create the file in memory, you calculate the size using the following:

Size = UBound(variant) – LBound(variant) + 1


pRaster Parameter For LoadArray

pRaster

ILEADRaster object in which the image is loaded.


Return for LoadArray

Return Value

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


vMem Parameter For LoadArray

vMem

An ILEADRasterVariant byte array object that contains the file in memory.


iBitsPerPixel Parameter For LoadBuffer

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap.
4 | 4 bits per pixel in the resultant bitmap.
8 | 8 bits per pixel in the resultant bitmap.
12 | 12 bits per pixel in the resultant bitmap.
16 | 16 bits per pixel in the resultant bitmap.
24 | 24 bits per pixel in the resultant bitmap.
32 | 32 bits per pixel in the resultant bitmap.


lBufferAddress Parameter For LoadBuffer

lBufferAddress

Address of the memory location that contains the file in memory.


lPage Parameter For LoadBuffer

lPage

The page number (for multipage files) that contains the first image to be loaded.

If the file is not a multipage file, pass 0.


lPages Parameter For LoadBuffer

lPages

The number of pages to load. To load all pages in a multipage file, pass -1. If the file is not a multipage file, pass 1.


lSize Parameter For LoadBuffer

lSize

Size of the memory buffer in bytes.


pRaster Parameter For LoadBuffer

pRaster

Pointer to the ILEADRaster object in which the image is loaded.


Return for LoadBuffer

Return Value

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


pszFilename Parameter For LoadDatabase

pszFilename

String that contains the name of the file from which to load the database.


Return for LoadDatabase

Return Value

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


fileName Parameter For Load

fileName

A string that contains the name of the file from which to load the collection of metadata markers.


nBits Parameter For LoadFromFile

nBits

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
2 | 2 bit per pixel in the resultant bitmap
3 | 3 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
5 | 5 bit per pixel in the resultant bitmap
6 | 6 bit per pixel in the resultant bitmap
7 | 7 bit per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


nItems Parameter For LoadFromFile

nItems

The number of items to load. To load all pages in a multi-page file, pass -1. If the file is not a multi-page file, pass 1.


nStart Parameter For LoadFromFile

nStart

The number of the page, in a multi-page file, that contains the first image to be loaded.

If the file is not a multi-page file, pass 0.


pszFile Parameter For LoadFromFile

pszFile

Name of file from which items should be loaded.


Return for LoadFromFile

Return Value

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


iBitsPerPixel Parameter For Load

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


lPage Parameter For LoadICCProfile2

lPage

The page number (for multipage files) that contains the embedded ICC profile to load. If the file is not a multipage file, pass 0.


pData Parameter For LoadICCProfile2

pData

A VARIANT byte array that contains the actual ICC data.


pszName Parameter For LoadICCProfile2

pszName

String containing the name of the file containing the embedded ICC profile.


Return for LoadICCProfile2

Return Value

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


lPage Parameter For LoadICCProfile

lPage

The page number (for multipage files) that contains the embedded ICC profile to load. If the file is not a multipage file, pass 0.


pData Parameter For LoadICCProfile

pData

An ILEADRasterVariant byte array object that contains the actual ICC data.


pszName Parameter For LoadICCProfile

pszName

String containing the name of the file containing the embedded ICC profile.


Return for LoadICCProfile

Return Value

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


Return for Load

Return Value

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


lPage Parameter For Load

lPage

The page number (for multipage files) that contains the first image to be loaded.

If the file is not a multipage file, pass 0.


lPages Parameter For Load

lPages

The number of pages to load. To load all pages in a multipage file, pass -1. If the file is not a multipage file, pass 1.


iBitsPerPixel Parameter For LoadLayer

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 to 8 | The specified bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap.
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap
48 | 48 bits per pixel in the resultant bitmap
64 | 64 bits per pixel in the resultant bitmap


iLayer Parameter For LoadLayer

iLayer

Index of the layer to load. This index is zero-based. Pass 0 to load the first layer, 1 to load the second layer, etc.


pRaster Parameter For LoadLayer

pRaster

Pointer to the ILEADRaster object in which the image is loaded.


pszName Parameter For LoadLayer

pszName

Character string containing the name of the file from which to load the layer.


Return for LoadLayer

Return Value

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


lFlags Parameter For Load

lFlags

Reserved for future use. Pass 0.


hMem Parameter For LoadMemory

hMem

A global handle (HGLOBAL) to the file in memory. If you use the SaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


iBitsPerPixel Parameter For LoadMemory

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


lPage Parameter For LoadMemory

lPage

The page number of the image, if the file is in a multipage file.

GIF, TIFF (MPT), and PCX (DCX) files can be multipage files (containing more than one image). If you set the value to the page number of an image in the file, this method provides information about the specified image.

If the file is not a multipage file, pass 0.


lPages Parameter For LoadMemory

lPages

The number of pages to load. To load all pages in a multi-page file, pass -1. If the file is not a multi-page file, pass 1.


iSize Parameter For LoadMemory

iSize

The size in bytes of the file referenced by hMem. If you use the SaveMemory method to create the file in memory, that method updates your handle and buffer size variables. Otherwise, your code must update and pass the appropriate variables.


pRaster Parameter For LoadMemory

pRaster

ILEADRaster object to load into.


Return for LoadMemory

Return Value

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


nPageNo Parameter For Load

nPageNo

The page number to be loaded from the file.


pRaster Parameter For Load

pRaster

ILEADRaster object to receive the loaded image.


pszFileName Parameter For Load

pszFileName

Character string containing the name of the image file to be loaded.


iBitsPerPixel Parameter For LoadOffset

iBitsPerPixel

Resulting bitmap pixel depth. Possible values are:

Value | Meaning
0 | Keep the original file's pixel depth. (Do not convert).
1 to 8 | The specified bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap.
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap
48 | 48 bits per pixel in the resultant bitmap

64 bits per pixel in the resultant bitmap


lPage Parameter For LoadOffset

lPage

The page number of the image to load, if the file is in a multipage file. If the file is not a multipage file, pass 0.


lPages Parameter For LoadOffset

lPages

The number of pages to load. To load all pages in a multipage file, pass -1. If the file is not a multipage file, pass 1.


nBytesToLoad Parameter For LoadOffset

nBytesToLoad

The size of the embedded image file. (The embedded file may be a record within the larger file, and in such cases, this is the record size.) If this value does not match the size of the embedded image file, the method will return an error.


nOffsetBegin Parameter For LoadOffset

nOffsetBegin

The position (from the beginning of the file) of the first byte to load. If no image exists at this position, the method will return an error.


pRaster Parameter For LoadOffset

pRaster

ILEADRaster object to be modified.


pszName Parameter For LoadOffset

pszName

Character string containing the name of the file that has the image being loaded..


Return for LoadOffset

Return Value

Return | Meaning
0 | The function ran successfully.
<>0 | An error occurred. Refer to Error Codes.


pRaster Parameter For Load

pRaster

ILEADRaster object in which the image is loaded.


pszName Parameter For Load

pszName

Character string containing the name of the file to load.


fHeight Parameter For LoadResize

fHeight

New height of the image. The unit of measure is determined by the ScaleMode property.


Flags Parameter For LoadResize

Flags

Flag that indicates the type of resizing to use. Possible values are:

Value | Meaning
RESIZE_NORMAL | [0x0] Normal resizing.
RESIZE_RESAMPLE | [0x2] Linear interpolation resizing.
RESIZE_BICUBIC | [0x4] Bicubic interpolation resizing.


fWidth Parameter For LoadResize

fWidth

New width of the image. The unit of measure is determined by the ScaleMode property.


iBitsPerPixel Parameter For LoadResize

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 to 8 | The specified bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap.
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap
48 | 48 bits per pixel in the resultant bitmap
64 | 64 bits per pixel in the resultant bitmap


pRaster Parameter For LoadResize

pRaster

Pointer to the ILEADRaster object in which the image is loaded.


pszName Parameter For LoadResize

pszName

Character string containing the name of the file to load.


Return for LoadResize

Return Value

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


iIndex Parameter For LoadResolutionHeight

iIndex

The index into the array. The first element of the array is 0. The last element of the array is one less than the value of the LoadResolutionCount property.


iIndex Parameter For LoadResolutionWidth

iIndex

The index into the array. The first element of the array is 0. The last element of the array is one less than the value of the LoadResolutionCount property.


pRaster Parameter For LoadStamp

pRaster

ILEADRaster object in which the image is loaded.


pszName Parameter For LoadStamp

pszName

Character string containing the JPEG or LEAD CMP compressed file name.


Return for LoadStamp

Return Value

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


nMaskPlaneEnd Parameter For MagGlassExt2

nMaskPlaneEnd

The end position of the mask plane array.


nMaskPlaneStart Parameter For MagGlassExt2

nMaskPlaneStart

The start position of the mask plane array.


vMaskPlane Parameter For MagGlassExt2

vMaskPlane

An array of bit flags which represent a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


nMaskPlaneEnd Parameter For MagGlassExt

nMaskPlaneEnd

The end position of the mask plane array.


nMaskPlaneStart Parameter For MagGlassExt

nMaskPlaneStart

The start position of the mask plane array.


vMaskPlane Parameter For MagGlassExt

vMaskPlane

An array of bit flags which represent a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


iIndex Parameter For MagGlassMask

iIndex

Position within the array.


hMemDC Parameter For MagGlassOwnerDraw

hMemDC

Memory HDC into which the Magnifying Glass has been rendered. This is the HDC into which the event should render any additional information.


hWnd Parameter For MagGlassOwnerDraw

hWnd

Handle of the window to which the magnifying glass is attached.


lMagGlassBottom Parameter For MagGlassOwnerDraw

lMagGlassBottom

The X-coordinate, in client coordinates, that represents the bottom of the bounding rectangle of the Magnifying Glass.


lMagGlassLeft Parameter For MagGlassOwnerDraw

lMagGlassLeft

The Y-coordinate, in client coordinates, that represents the left side of the bounding rectangle of the Magnifying Glass.


lMagGlassRight Parameter For MagGlassOwnerDraw

lMagGlassRight

The Y-coordinate, in client coordinates, that represents the right side of the bounding rectangle of the Magnifying Glass.


lMagGlassTop Parameter For MagGlassOwnerDraw

lMagGlassTop

The X-coordinate, in client coordinates, that represents the top of the bounding rectangle of the Magnifying Glass.


lXPos Parameter For MagGlassOwnerDraw

lXPos

The X-coordinate of the current position, in client coordinates, of the Magnifying Glass.


lYPos Parameter For MagGlassOwnerDraw

lYPos

The Y-coordinate of the current position, in client coordinates, of the Magnifying Glass.


lIndex Parameter For MaskTable

lIndex

The index into the array. The first element of the array is 0. The values present in this array identify which values in the HTable property are valid.


iDim Parameter For MaxFilter

iDim

Dimensions of the neighborhood used for filtering (iDim x iDim), in pixels.


Return for MaxFilter

Return Value

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


iDim Parameter For Median

iDim

Dimensions of the neighborhood used for filtering (iDim x iDim), in pixels.


pRaster Parameter For Median

pRaster

ILEADRaster object to be modified.


Return for Median

Return Value

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


iDim Parameter For MinFilter

iDim

Dimensions of the neighborhood used for filtering (iDim x iDim), in pixels.


Return for MinFilter

Return Value

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


iDim Parameter For Mosaic

iDim

Dimensions of the tiles (iDim x iDim), in pixels.


pRaster Parameter For Mosaic

pRaster

ILEADRaster object to be modified.


Return for Mosaic

Return Value

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


bUnidirectional Parameter For MotionBlur

bUnidirectional

Flag that indicates whether the motion extends only in one direction. Possible values are:

Value | Meaning
TRUE | The motion blur effect is only in the direction specified in lAngle.
FALSE | The motion blur effect is along the line with that angle. For example, if lAngle is 0, the blur effect will occur in the 0 degree direction and the 180 degree direction.


iDim Parameter For MotionBlur

iDim

Size of the blur effect, in pixels.


lAngle Parameter For MotionBlur

lAngle

Value that represents the direction of the motion, in hundredths of a degree (+/-) this value can be a number from 1 to 36000. If the value is positive, the motion will be clockwise. If the value is negative, the motion is counter-clockwise.


pRaster Parameter For MotionBlur

pRaster

Pointer to the ILEADRaster object to be modified.


Return for MotionBlur

Return Value

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


Button Parameter For MouseDown2

Button

An integer that identifies the button that was released to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseDown2

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is released. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


X Parameter For MouseDown2

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Control.


Y Parameter For MouseDown2

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control.


Button Parameter For MouseDown

Button

An integer that identifies the button that was pressed to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseDown

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For MouseDown

x

The X coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the form that contains the ImageList Control.


x Parameter For MouseDown

y

The Y coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the form that contains the ImageList Control.


X Parameter For MouseDown

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Object. The unit of measure is determined by the form that contains the Raster View Object.


Y Parameter For MouseDown

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Object. The unit of measure is determined by the form that contains the Raster View Object.


Button Parameter For MouseMove2

Button

An integer that identifies the button that was released to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseMove2

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is released. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


X Parameter For MouseMove2

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Control.


Y Parameter For MouseMove2

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control.


Button Parameter For MouseMove

Button

An integer that identifies any buttons that were pressed when the user moved the mouse. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseMove

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For MouseMove

x

The X coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the form that contains the ImageList Control.


x Parameter For MouseMove

y

The Y coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the form that contains the ImageList Control.


X Parameter For MouseMove

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


Y Parameter For MouseMove

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


Button Parameter For MouseUp2

Button

An integer that identifies the button that was released to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseUp2

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is released. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


X Parameter For MouseUp2

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Control.


Y Parameter For MouseUp2

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control.


Button Parameter For MouseUp

Button

An integer that identifies the button that was released to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Button Parameter For MouseUp

Button

An integer that identifies the button that was pressed to cause the event. The following are possible values:

Value | Meaning
1 | left button
2 | right button


Shift Parameter For MouseUp

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For MouseUp

x

The X coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the ScaleMode property.


x Parameter For MouseUp

y

The Y coordinate of the mouse pointer relative to the origin of the ImageList Control. The unit of measure is determined by the ScaleMode property.


Shift Parameter For MouseUp

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is released. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


X Parameter For MouseUp

X

The X coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


Y Parameter For MouseUp

Y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


nDelta Parameter For MouseWheel

nDelta

Value that indicates whether the mouse wheel rotated forward or backward. If this value is –120, the mouse wheel was rotated backward. If this value is 120, the Mouse Wheel was rotated forward.


Shift Parameter For MouseWheel

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the mouse wheel is rotated .

The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


x Parameter For MouseWheel

x

The X coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


y Parameter For MouseWheel

y

The Y coordinate of the mouse pointer relative to the origin of the Raster View Control. The unit of measure is determined by the form that contains the Raster View Control.


fDx Parameter For OffsetRgn

fDx

The distance left (negative) or right (positive) to shift the region.


fDy Parameter For OffsetRgn

fDy

The distance up (negative) or down (positive) to shift the region.


Return for OffsetRgn

Return Value

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


iDim Parameter For Oilify

iDim

Dimensions of the neighborhood used for filtering (iDim x iDim), in pixels.


pRaster Parameter For Oilify

pRaster

ILEADRaster object to be modified.


Return for Oilify

Return Value

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


Button Parameter For OLECompleteDrag

Button

An integer that identifies the button that was pressed to cause the event. Possible values are:

Value | Meaning
1 | Left button
2 | Right button


Button Parameter For OLECompleteDrag

Button

Value that represents the button that caused the event. Possible values are:

Value | Meaning
1 | Left mouse button


Shift Parameter For OLECompleteDrag

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the Button parameter is pressed. Possible values are:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


Shift Parameter For OLECompleteDrag

Shift

Value that indicates which of the ALT, CTRL, and SHIFT keys are down when the button specified in the Button parameter generated the event. Possible values are:

Value | Meaning
1 | SHIFT key
2. | CTRL key
3 | CTRL/SHIFT keys
4 | ALT key
5 | ALT/SHIFT keys
6 | CTRL/ALT keys
7 | CTRL/ALT/SHIFT keys


x Parameter For OLECompleteDrag

x

The X coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


X Parameter For OLECompleteDrag

X

X coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


y Parameter For OLECompleteDrag

y

The Y coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


Y Parameter For OLECompleteDrag

Y

Y coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


Button Parameter For OLEDragOver

Button

An integer that identifies the button that was pressed to cause the event. Possible values are:

Value | Meaning
1 | Left button
2 | Right button


Button Parameter For OLEDragOver

Button

Value that represents the button used in the dragging process, which causes the event. Possible values are:

Value | Meaning
1 | Left mouse button


Shift Parameter For OLEDragOver

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


Shift Parameter For OLEDragOver

Shift

Value that indicates which of the ALT, CTRL, and SHIFT keys are down when the button specified in the Button parameter is pressed. Possible values are:

Value | Meaning
1 | SHIFT key
2. | CTRL key
3 | CTRL/SHIFT keys
4 | ALT key
5 | ALT/SHIFT keys
6 | CTRL/ALT keys
7 | CTRL/ALT/SHIFT keys


x Parameter For OLEDragOver

x

The X coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


X Parameter For OLEDragOver

X

X coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


y Parameter For OLEDragOver

y

The Y coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


Y Parameter For OLEDragOver

Y

Y coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


pszName Parameter For OLEDropFile

pszName

Name of the file being dropped.


pbUseDefaultCursor Parameter For OLEGiveFeedback

pbUseDefaultCursor

Pointer to a variable to be updated with a value that indicates whether to use the default cursors or not. In C++, declare the variable and pass its address. In most other languages, pass the variable by reference. Possible values are:

Value | Meaning
TRUE | Use default Drag-and-Drop cursors.
FALSE | Use user Drag-and-Drop cursors, you should set custom cursor into OLEDragCursor property.


Button Parameter For OLEStartDrag

Button

An integer that identifies the button that was pressed to cause the event. Possible values are:

Value | Meaning
1 | Left button
2 | Right button


Button Parameter For OLEStartDrag

Button

Value that represents the button that was pressed to cause the event. Possible values are:

Value | Meaning
1 | Left mouse button


Shift Parameter For OLEStartDrag

Shift

An integer that indicates which of the SHIFT, CTRL, and ALT keys are down when the button specified in the button argument is pressed. The following are possible values:

Value | Meaning
1 | SHIFT key
2 | CTRL key
4 | ALT key
3 | CTRL/SHIFT key
5 | ALT/SHIFT key
6 | CTRL/ALT key
7 | CTRL/ALT/SHIFT key


Shift Parameter For OLEStartDrag

Shift

Value that indicates which of the ALT, CTRL, and SHIFT keys are down when the button specified in the Button parameter is pressed. Possible values are:

Value | Meaning
1 | SHIFT key
2. | CTRL key
3 | CTRL/SHIFT keys
4 | ALT key
5 | ALT/SHIFT keys
6 | CTRL/ALT keys
7 | CTRL/ALT/SHIFT keys


x Parameter For OLEStartDrag

x

The X coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


X Parameter For OLEStartDrag

X

X coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


y Parameter For OLEStartDrag

y

The Y coordinate of the mouse pointer relative to the origin of the RasterView Control. The unit of measure is determined by the ScaleMode property.


Y Parameter For OLEStartDrag

Y

Y coordinate of the mouse pointer relative to the origin of the image list control. The unit of measure is determined by the ScaleMode property.


nPercent Parameter For OnOptimize

nPercent

An integer from 0 to 100 that indicates the completion percentage of the buffer optimization operation.


Bitmap Parameter For OnSliceBitmap

Bitmap

Optional parameter that points to the bitmap referencing the sliced bitmaps. This parameter is updated only if the SLICE_CUT_SLICES flag of the lFlags Parameter of the Slice method is used. Otherwise, it will be 0.


lAngle Parameter For OnSliceBitmap

lAngle

Deskew angle. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. This parameter is only valid if the lFlags parameter of the SliceBitmap method is set to SLICE_DESKEW.


lHeight Parameter For OnSliceBitmap

lHeight

The height, in pixels, for the extracted slice.


lLeft Parameter For OnSliceBitmap

lLeft

The left boundary, in pixels, of the extracted slice.


lTop Parameter For OnSliceBitmap

lTop

The top boundary, in pixels, of the extracted slice.


lWidth Parameter For OnSliceBitmap

lWidth

The width, in pixels, for the extracted slice.


bOptimizeEvent Parameter For OptimizeBuffer

bOptimizeEvent

Specifies whether the OptimizeBuffer method will generate an OnOptimize event. Possible values are:

Value | Meaning
VARIANT_TRUE | The OnOptimize event will be generated.
VARIANT_FALSE | The OnOptimize event will not be generated.


pOptimizedBuffer Parameter For OptimizeBuffer

pOptimizedBuffer

An ILEADRasterVariant byte array object that contains the optimized image in memory.


pOptimizeOptions Parameter For OptimizeBuffer

pOptimizeOptions

An ILEADOptimizeOptions object that contains the options used in optimization. Pass NULL to use the default optimization options.


pOrginalBuffer Parameter For OptimizeBuffer

pOrginalBuffer

An ILEADRasterVariant byte array object that contains the image in memory. The image format in memory should be one of the LEAD Image Optimizer Supported Formats.


Return for OptimizeBuffer

Return Value

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


bIncludeSubDirs Parameter For OptimizeDir

bIncludeSubDirs

Boolean flag that indicates whether to include sub-directories when optimizing. Possible values are:

Value | Meaning
VARIANT_TRUE | Include sub-directories when optimizing.
VARIANT_FALSE | Exclude sub-directories when optimizing.


bOptimizeDirEvent Parameter For OptimizeDir

bOptimizeDirEvent

Specifies whether the OptimizeDir method will generate an OnOptimizeDir event. Possible values are:

Value | Meaning
VARIANT_TRUE | OnOptimizeDir event will be generated.
VARIANT_FALSE | OnOptimizeDir event will not be generated.


pOptimizeOptions Parameter For OptimizeDir

pOptimizeOptions

An ILEADOptimizeOptions object that contains the options used in optimization. Pass NULL to use the default optimization options.


pszDirectory Parameter For OptimizeDir

pszDirectory

Character string that contains the full path directory of the supported images to optimize.


pszFileExt Parameter For OptimizeDir

pszFileExt

Character string that contains the extensions of the files to optimize.

To optimize all "gif" and "jpeg" files, pszFileExt should be set to "*.gif;*.jpeg".

To optimize all the supported files found in the pszDirectory directory, regardless of the their extensions, pszFileExt should be set to "*.*".


pszOptDirectory Parameter For OptimizeDir

pszOptDirectory

Character string that contains the full path directory in which to save the optimized image(s).


Return for OptimizeDir

Return Value

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


hDC Parameter For OwnerDrawItem

hDC

Handle to a device context. This is the device context on which the ImageList items will be drawn/painted.


Index Parameter For OwnerDrawItem

Index

Index of the item that needs to be painted. This is a 0-based index.


ItemBackBottom Parameter For OwnerDrawItem

ItemBackBottom

This is the Y coordinate of the bottom boundary of the background of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemBackLeft Parameter For OwnerDrawItem

ItemBackLeft

This is the X coordinate of the origin of the background of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemBackRight Parameter For OwnerDrawItem

ItemBackRight

This is the X coordinate of the right boundary of the background of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemBackTop Parameter For OwnerDrawItem

ItemBackTop

This is the Y coordinate of the origin of the background of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemBottom Parameter For OwnerDrawItem

ItemBottom

This is the Y coordinate of the bottom boundary of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemLeft Parameter For OwnerDrawItem

ItemLeft

This is the X coordinate of the origin of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemRight Parameter For OwnerDrawItem

ItemRight

This is the X coordinate of the right boundary of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


ItemTop Parameter For OwnerDrawItem

ItemTop

This is the Y coordinate of the origin of the ImageList item to be drawn/painted. The unit of measure is determined by the ScaleMode property.


hDC Parameter For Paintevent

hDC

The value of the DC used to paint the Bitmap of the raster view. This value can be used to paint anything to the same DC.


uPass Parameter For PaintNotification

uPass

The number of completed passes.


uType Parameter For PaintNotification

uType

The type of effect. The following are possible values:

Value | Meaning
EFX_NOTIFY_TRANSITION | Painting a transition.
EFX_NOTIFY_IMAGE | Painting an image.


hPanWin Parameter For PanWin

hPanWin

Handle to the Pan Window.


iFlag Parameter For PanWin

iFlag

The reason for the callback notification. Possible values are:

Value | Meaning
PANWIN_CREATED | [0] Pan Window was created.
PANWIN_UPDATED | [1] Pan Window was updated/repainted.
PANWIN_DESTROYED | [2] Pan Window was destroyed.
PANWIN_MOVED | [3] Pan Window was moved.
PANWIN_REPAINTED | [4] Pan Window image has been painted.(This occurs before the pan rect is painted.)


Flags Parameter For Paste

Flags

Determines whether the method tests the data on the clipboard or completes the paste.

Valid values are:

Value | Meaning
PASTE_ISREADY | Test to see if the clipboard contains data that can be pasted.
0 | Paste the data.


Return for Paste

Return Value

Return | Meaning
0 | If the Flags parameter is set to PASTE_ISREADY, this means that the clipboard does not contain a valid image. Otherwise, this means that the method was successful.
<>0 | If the Flags parameter is set to PASTE_ISREADY, this means that the clipboard contains a valid image. Otherwise, this means that an error occurred. Refer to Error Codes.


nPage Parameter For PDFCompEvent

nPage

A zero-based index of the current page.


Return for PDFCompFree

Return Value

None.


bEnablePDFCompEvent Parameter For PDFCompInit

bEnablePDFCompEvent

Flag that indicates whether to enable or disable firing the PDFCompEvent event. Possible values are:

Value | Meaning
TRUE | Enables firing the PDFCompEvent event.
FALSE | Disables firing the PDFCompEvent event.


Return for PDFCompInit

Return Value

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


pRaster Parameter For PDFCompInsertMRC

pRaster

ILEADRaster Object to be inserted in the PDF File.


Return for PDFCompInsertMRC

Return Value

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


pRaster Parameter For PDFCompInsertNormal

pRaster

ILEADRaster Object to be inserted in the PDF File.


Return for PDFCompInsertNormal

Return Value

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


bIsThereBackground Parameter PDFCompInsertSegments

bIsThereBackground

Flag that indicates whether to fill the background with a specific color before adding the user segments. Possible values are:

Value | Meaning
TRUE | Fill the background before adding the segments.
FALSE | Do not fill the background before adding the segments.


pRaster Parameter For PDFCompInsertSegments

pRaster

ILEADRaster Object to be inserted in the PDF File.


rgbBackgroundColor Parameter For PDFCompInsertSegments

rgbBackgroundColor

Background color.


Return for PDFCompInsertSegments

Return Value

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


Comp1Bit Parameter For PDFCompSetCompression

Comp1Bit

Value that indicates the 1-bit per pixel compression type to use. Possible values are:

Value | Meaning
PDFCOMP_1BIT_COMP_TYPE_ZIP | [0] Uses Zip Compression.
PDFCOMP_1BIT_COMP_TYPE_LZW | [1] Uses LZW Compression
PDFCOMP_1BIT_COMP_TYPE_CCITT_G3_1D | [2] Uses FAX G3_1D Compression.
PDFCOMP_1BIT_COMP_TYPE_CCITT_G3_2D | [3] Uses FAX G3_2D Compression.
PDFCOMP_1BIT_COMP_TYPE_CCITT_G4 | [4] Uses FAX G4 Compression.
PDFCOMP_1BIT_COMP_TYPE_JBIG2 | [5] Uses JBIG2 Compression.


Comp2Bit Parameter For PDFCompSetCompression

Comp2Bit

Value that indicates the 2-bits per pixel compression type to use. Possible values are:

Value | Meaning
PDFCOMP_2BIT_COMP_TYPE_ZIP | [0] Uses Zip Compression.
PDFCOMP_2BIT_COMP_TYPE_LZW | [1] Uses LZW Compression


CompPicture Parameter For PDFCompSetCompression

CompPicture

Value that indicates the Picture compression type to use. Possible values are:

Value | Meaning
PDFCOMP_PICTURE_COMP_TYPE_JPEG | [0] Uses JPEG Compression.
PDFCOMP_PICTURE_COMP_TYPE_JPEG_YUV422 | [1] Uses YUV422 JPEG Compression
PDFCOMP_PICTURE_COMP_TYPE_JPEG_YUV411 | [2] Uses YUV411 JPEG Compression
PDFCOMP_PICTURE_COMP_TYPE_JPEG_PROGRESSIVE | [3] Uses PROGRESSIVE JPEG Compression
PDFCOMP_PICTURE_COMP_TYPE_JPEG_PROGRESSIVE_YUV422 | [4] Uses PROGRESSIVE YUV422 JPEG Compression
PDFCOMP_PICTURE_COMP_TYPE_JPEG_PROGRESSIVE_YUV411 | [5] Uses PROGRESSIVE YUV411 JPEG Compression
PDFCOMP_PICTURE_COMP_TYPE_ZIP | [6] Uses Zip Compression
PDFCOMP_PICTURE_COMP_TYPE_LZW | [7] Uses LZW Compression.


nFlags Parameter For PDFCompSetCompression

nFlags

Flag that indicates the compression type to enable. Flags can be combined using the bitwise OR ( | ). Possible values are:

Value | Meaning
PDFCOMP_1BITCOMPRESSION_TYPE_ENABLED | [0] Enables 1 Bit Compression type.
PDFCOMP_2BITCOMPRESSION_TYPE_ENABLED | [2] Enables 2 Bit Compression type.
PDFCOMP_PICTURECOMPRESSION_TYPE_ENABLED | [4] Enables Picture Compression type.


Qfactor Parameter For PDFCompSetCompression

Qfactor

QFactor to use with JPEG Compression types. For a list of possible values, refer to Compression Quality Factors.


Return for PDFCompSetCompression

Return Value

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


OutputFileName Parameter For PDFCompWrite

OutputFileName

Character string that contains the output file name, including the path, of the document file to write.


Return for PDFCompWrite

Return Value

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


iCellHeight Parameter For PicturizeBitmapList

iCellHeight

Height of the thumbnail bitmap.


iCellWidth Parameter For PicturizeBitmapList

iCellWidth

Width of the thumbnail bitmap.


iLightnessFact Parameter For PicturizeBitmapList

iLightnessFact

Value that represents how much to lighten the thumbnail bitmap. Valid values are between 0 and 1000. This value is divided internally by 1000. Values between 0 and 499 darken the image. Values between 500 and 1000 lighten the image.


pRasterDst Parameter For PicturizeBitmapList

pRasterDst

Pointer to the ILEADRaster object to be modified.


pRasterList Parameter For PicturizeBitmapList

pRasterList

Pointer to the ILEADRaster object that contains the LEAD BitmapList used to create the thumbnail images, which are in turn used to picturize the destination bitmap.


Return for PicturizeBitmapList

Return Value

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


fCellHeight Parameter For Picturize

fCellHeight

The height of the images used to reconstruct the image. The units depend on the ScaleMode property.


fCellWidth Parameter For Picturize

fCellWidth

The width of the images used to reconstruct the image. The units depend on the ScaleMode property.


Flags Parameter For Picturize

Flags

Flags that control the behavior of the process. Possible values are given below. These values can be combined using OR (|) or +.

Value | Meaning
PICTURIZE_LOADALL | [0x0001] Load all files in memory.
PICTURIZE_RESIZE | [0x0002] Resize all images that are not the required size (fCellWidth x fCellHeight).
PICTURIZE_RESAMPLE | [0x0004] Resample the images that are not the required size (fCellWidth x fCellHeight). (slower process, better quality)
PICTURIZE_ONCE | [0x0010] Use an image only once throughout the process.
PICTURIZE_EQUALUSAGE | [0x0020] Use all images equally. That is, before an image will be used twice, all other images must be used at least once.
PICTURIZE_BESTFIT | [0x0040] Images will be resized to fit the image if the bitmap width or height is not a multiple of nCellWidth/nCellHeight.
0 | The picturize process will not use any of the above flags. It will: reload all the files each time you look for a rectangle to substitute and ignore all the images present in pszDirectory if their size is not fCellWidth x fCellHeight


pRaster Parameter For Picturize

pRaster

ILEADRaster object to be modified.


pszDirectory Parameter For Picturize

pszDirectory

String containing the name of the directory containing the images. Only the images in the specified directory are used. Images from subdirectories are NOT used.


Return for Picturize

Return Value

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


iCellHeight Parameter For PicturizeSingle

iCellHeight

Height of the thumbnail bitmap.


iCellWidth Parameter For PicturizeSingle

iCellWidth

Width of the thumbnail bitmap.


iLightnessFact Parameter For PicturizeSingle

iLightnessFact

Value that represents how much to lighten the thumbnail bitmap. Valid values are between 0 and 1000. This value is divided internally by 1000. Values between 0 and 499 darken the image. Values between 500 and 1000 lighten the image.


pRasterDst Parameter For PicturizeSingle

pRasterDst

Pointer to the ILEADRaster object to be modified.


pRasterThumb Parameter For PicturizeSingle

pRasterThumb

Pointer to the ILEADRaster object that contains the bitmap used to create the thumbnail.


Return for PicturizeSingle

Return Value

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


x Parameter For PixelData

x

X coordinate of the pixel. This is a zero-based value.


y Parameter For PixelData

y

Y coordinate of the pixel. This is a zero-based value.


x Parameter For Pixel

x

X coordinate of the pixel. This is a zero-based value.


y Parameter For Pixel

y

Y coordinate of the pixel. This is a zero-based value.


iIndex Parameter For PLTPenColor

iIndex

Index into the array of pen colors. This index should be >= 0 and <= 7.


iIndex Parameter For PLTPenWidth

iIndex

Index into the array of pen width values. This index should be >= 0 and <= 7.


iIndex Parameter For PolygonX

iIndex

The index into the ordered array of points.


iIndex Parameter For PolygonY

iIndex

The index into the ordered array of points.


iLevels Parameter For Posterize

iLevels

The number of color levels to use. Valid values are 2 through 64.


pRaster Parameter For Posterize

pRaster

ILEADRaster object to be modified.


Return for Posterize

Return Value

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


iCachedFilters Parameter For PreLoadFilters

iCachedFilters

Number of filters that should be loaded, but can be unloaded later to make room for other filters.


iFixedFilters Parameter For PreLoadFilters

iFixedFilters

Number of filters that should stay loaded in memory at all times.


pszFilters Parameter For PreLoadFilters

pszFilters

String containing the filters which should be loaded. If pszFilters is NULL, all file filters LEADTOOLS can find will be loaded and LEADTOOLS will determine the order in which the files will be used.


Return for PreLoadFilters

Return Value

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


hDC Parameter For PrintEnd

hDC

The handle to the device context, which was returned by the PrintStart method.


Return for PrintEnd

Return Value

None.


Return for PrintStart

Return Value

The device handles (hDC) for the default printer.


iPercent Parameter For ProgressStatus

iPercent

The completion percentage of the current LEADTOOLS functionality.


bAsFrame Parameter For ResizeRgn

bAsFrame

Flag that indicates whether to create a frame associated with the resized bitmap region. Possible values are:

Value | Meaning
TRUE | Create a frame of thickness iDim for the resized region. If Flag is set to RGN_EXPAND, the frame created will exist outside the boundaries of the resized region. If Flag is set to RGN_CONTRACT, the frame will be within the boundaries of the resized region.
FALSE | Resize the region only. Do not create a frame.


Flag Parameter For ResizeRgn

Flag

Flag that indicates whether to contract or expand the bitmap region. Possible values are:

Value | Meaning
RGN_EXPAND | [0x0001] Expand the region.
RGN_CONTRACT | [0x0002] Contract the region.


iDim Parameter For ResizeRgn

iDim

Number of pixels by which to resize the region.


Return for ResizeRgn

Return Value

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


iIndex Parameter For ReadComment

iIndex

Index into the array of comments. For possible values, refer to Types of File Comments.


lPage Parameter For ReadComment

lPage

The page number (for multipage files) that contains the image.

If the file is not a multipage file, pass 0.


pRaster Parameter For ReadComment

pRaster

ILEADRaster object to be used as a reference for the ScaleMode.

The ScaleMode property of this object will be used for the units when filling the InfoWidth and InfoHeight properties.


pszFile Parameter For ReadComment

pszFile

Character string containing the name of the file.


Return for ReadComment

Return Value

Value of the specified comment in an image file. For the data types of various comments, refer to Types of File Comments.


bstrFile Parameter For ReadFileGeoKey

bstrFile

A character string that contains the input file name to load.


Return for ReadFileGeoKey

Return Value

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


uTag Parameter For ReadFileGeoKey

uTag

GeoKey ID that you specified by calling the SetGeoKey method. Values of the GeoKey ID range between 0 and 65535. Possible ranges are:

Range | Meaning
0..1023 | Do not use; reserved for future use.
1024..2047 | GeoTIFF configuration keys.
2048..3071 | Geographic/Geocentric CS Parameter Keys.
3072..4095 | Projected CS Parameter Keys.
4096..5119 | Vertical CS Parameter keys.
5120..32767 | Reserved.
32768..65535 | Private use – used to store your own data.


pszFile Parameter For ReadLoadResolutions

pszFile

Character string containing the name of the file to examine.


Return for ReadLoadResolutions

Return Value

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


iPage Parameter For ReadTag

iPage

Number of the page within the specified file from which to read the specified tag. The first page is page 1. The specified page must exist. If the page does not exist, an error will be returned.


lTag Parameter For ReadTag

lTag

The tag to read from the specified file. For more information on tags available in the TIFF format, refer to the SetTag method.


hMem parameter for ReadTagMemory

hMem

A global handle (HGLOBAL) to the file in memory.


lPage name Parameter For ReadTagMemory

lPage

The number of the page within the specified file, from which to read the specified tag. The first page is page 1. The specified page must exist. If the page does not exist, an error will be returned.


lSize Parameter For ReadTagMemory

lSize

The size in bytes of the file referenced by hMem.


lTag Parameter For ReadTagMemory

lTag

The tag to be read from the specified file. For more information on tags available in the TIFF format, refer to the SetTag method.


Return for ReadTagMemory

Return Value

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


pszFile Parameter For ReadTag

pszFile

String that contains the name of the file from which to read the specified tag. Please note that this file must exist.


Return for ReadTag

Return Value

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


ReadyState Parameter For ReadyStateChange

ReadyState

The new value of the ReadyState property. The following are possible values:

Value | Description
READYSTATE_LOADING | Currently loading
READYSTATE_COMPLETE | Finished loading


Return for ReleaseBitmapDC

Return Value

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


Return for ReleaseClientDC

Return Value

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


bUseHTable Parameter For RemapHue

bUseHTable

Flag that indicates whether to use the HTable property. Possible values are:

Value | Meaning
TRUE | Use the HTable property, which is the Hue lookup table. If MaskTable(i) for a particular hue is not 0, then the hue is changed to the corresponding entry in HTable(i). For example, if a pixel has a hue of 85 and MaskTable(85) is NOT 0, then the hue of the pixel is changed to the the hue in HTable(85).
FALSE | The hue of each pixel is unchanged.


bUseMaskTable Parameter For RemapHue

bUseMaskTable

Flag that indicates whether to use the MaskTable property to identify valid values within the HTable property. Possible values are:

Value | Meaning
TRUE | Use the MaskTable property to identify which values in the HTable property are valid. If MaskTable(i) is not 0, then HTable(i) is to be used. If MaskTable(i) is 0, then HTable(i) is ignored.
FALSE | All entries in the HTable are marked as valid.


bUseSTable Parameter For RemapHue

bUseSTable

Flag that indicates whether to use the STable property. Possible values are:

Value | Meaning
TRUE | Use the STable property, which is the Saturation lookup table. If MaskTable(i) for a particular hue is not 0, then the saturation is changed to the corresponding entry in STable(i). For example, if a pixel has a hue of 85 and MaskTable(85) is NOT 0, then the saturation of the pixel is changed to the saturation in STable(85). If bUseHTable is FALSE, the saturation is changed to STable(85).
FALSE | The saturation of each pixel is unchanged.


bUseVTable Parameter For RemapHue

bUseVTable

Flag that indicates whether to use the VTable property. Possible values are:

Value | Meaning
TRUE | Use the VTable property, which is the Value lookup table. If MaskTable(i) for a particular hue is not 0, then the Value is changed to the corresponding entry in VTable(i). For example, if a pixel has a hue of 85 and MaskTable(85) is NOT 0, then the Value of the pixel is changed to the Value in VTable(85). If bUseHTable is FALSE, the Value is changed to VTable(85).
FALSE | The Value of each pixel is unchanged.


pRaster Parameter For RemapHue

pRaster

ILEADRaster object to be modified.


Return for RemapHue

Return Value

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


Channel Parameter For RemapIntensity

Channel

Possible values are:

Value | Meaning
CHANNEL_MASTER | All channels.
CHANNEL_RED | Red channel only.
CHANNEL_GREEN | Green channel only.
CHANNEL_BLUE | Blue channel only.


pRaster Parameter For RemapIntensity

pRaster

ILEADRaster object to be modified.


Return for RemapIntensity

Return Value

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


iIndex Parameter For RemapTable

iIndex

The index into the lookup table. The index corresponds to the current intensity value, and the value of the entry is the intensity value to be applied.


nIndex Parameter For Remove

nIndex

Index of the item to be removed.


iLightness Parameter For RemoveRedeye

iLightness

"Percentage" value that indicates whether the pixels that are replaced are lightened or darkened. If this value is greater than 100, the replaced pixels will be lightened. If this value is less than 100, the replaced pixels will be darkened. This method preserves the lightness of the original pixels and substitutes the red color with the new color.


iThreshold Parameter For RemoveRedeye

iThreshold

Threshold value that indicates which pixels will be changed by this method. All pixels with a red component value greater than this value will be changed. Pixels with a red component value less than this value will not be changed. This value is between 0 and 255.


pRaster Parameter For RemoveRedeye

pRaster

Pointer to ILEADRaster object to be modified.


rcNewColor Parameter For RemoveRedeye

rcNewColor

New color value used to replace the red color in the eyes.


Return for RemoveRedeye

Return Value

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


Return for Remove

Return Value

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


fHeight Parameter For Render

fHeight

The printed height. The value is in dots, and the actual height depends on the dots per inch (DPI) of the printer.


fLeft Parameter For Render

fLeft

X position to start the print. The value is in dots, and the actual position depends on the dots per inch (DPI) of the printer.


fTop Parameter For Render

fTop

Y position to start the print. The value is in dots, and the actual position depends on the dots per inch (DPI) of the printer.


fWidth Parameter For Render

fWidth

The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.


hDC Parameter For Render

hDC

Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT.


Return for Render

Return Value

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


bErase Parameter For RepaintRect

bErase

Specifies whether to erase the background before painting.

Setting | Description
TRUE | Erase the background.
FALSE | Do not erase the background.


fHeight Parameter For RepaintRect

fHeight

The height of the rectangle to paint.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For RepaintRect

fLeft

The X coordinate of the origin of the rectangle to paint.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For RepaintRect

fTop

The Y coordinate of the origin of the rectangle to paint.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For RepaintRect

fWidth

The width of the rectangle to paint.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


Return for RepaintRect

Return Value

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


bAsFrame Parameter For ResizeRgn

bAsFrame

Flag that indicates whether to create a frame associated with the resized bitmap region. Possible values are:

Value | Meaning
TRUE | Create a frame of thickness iDim for the resized region. If iFlag is RGN_EXPAND, the frame created will exist outside the boundaries of the resized region. If iFlag is RGN_CONTRACT, the frame will be within the boundaries of the resized region.
FALSE | Resize the region only. Do not create a frame.


iFlag Parameter For ResizeRgn

iFlag

Flag that indicates whether to contract or expand the bitmap region. Possible values are:

Value | Meaning
RGN_EXPAND | [0x0001] Expand the region.
RGN_CONTRACT | [0x0002] Contract the region.


pRaster Parameter For ResizeRgn

pRaster

ILEADRaster object to be modified.


pRaster Parameter For Reverse

pRaster

ILEADRaster object to be modified.


Return for Reverse

Return Value

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


nH Parameter For RGBfromHSV

nH

Hue of the color for which to return the RGB equivalent.


nS Parameter For RGBfromHSV

nS

Saturation of the color for which to return the RGB equivalent.


nV Parameter For RGBfromHSV

nV

Value of the color for which to return the RGB equivalent.


Return for RGBfromHSV

Return Value

The OLE_COLOR equivalent of the color specified by nH, nS and nV.


crFill Parameter For Rotate

crFill

The background fill color.

If the image is 8 bits per pixel or less, the color comes from the current palette, and it may not exactly match the specified color.

You can specify a COLORREF value (the return value of the RGB macro), or you can specify a palette index as explained in Using Palette Indexes As Color Values.


iAngle Parameter For Rotate

iAngle

Hundredths of degrees to rotate (+/-). This can be a number from 0 to 36,000. A positive value will rotate the bitmap in a clockwise rotation, while a negative value will rotate the bitmap in a counter-clockwise rotation.


iFlags Parameter For Rotate

iFlags

Flag to keep the resulting bitmap the same size as the original bitmap or to resize according to the rotation specified. Valid values are:

Value | Meaning
ROTATE_RESIZE | [0x0001] Size resulting bitmap as needed.
ROTATE_RESAMPLE | [0x0002] Perform bilinear interpolation when rotating.
ROTATE_BICUBIC | [0x0004] Perform bicubic interpolation when rotating.
0 | Do not resize the bitmap. Crop it.


pRaster Parameter For Rotate

pRaster

ILEADRaster object to be modified.


Return for Rotate

Return Value

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


Index Parameter For RulerUnit

Index

Index into the array of unit constants. The index is zero based.


iChange Parameter For Saturation

iChange

Amount to change saturation. Values are percentages between -1000 and 1000.


pRaster Parameter For Saturation

pRaster

ILEADRaster object to be modified.


Return for Saturation

Return Value

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


Format Parameter For SaveArray

Format

Output file format. For valid values, refer to Formats of Output Files.


iBitsPerPixel Parameter For SaveArray

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.


pRaster Parameter For SaveArray

pRaster

ILEADRaster object to save.


Quality Parameter For SaveArray

Quality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


Return for SaveArray

Return Value

An ILEADRasterVariant byte array object that contains the image data.


Format Parameter For SaveBuffer

Format

Output file format. For valid values, refer to Formats of Output Files.


iBitsPerPixel Parameter For SaveBuffer

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For valid values, refer to Formats of Output Files.


iModify Parameter For SaveBuffer

iModify

Indicates how to save a new page in a multipage file that supports insert and replace operations.

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten. This is comparable to bMultipage being FALSE in earlier versions.
SAVE_APPEND | [1] or [-1] The page is appended if the file exists. This is comparable to bMultipage being TRUE in earlier versions.
SAVE_REPLACE | [2] Replace the page specified in the SavePage property.
SAVE_INSERT | [3] Insert the new page before the page specified in the SavePage property.

The following file formats support append operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

FlashPix

AWD

Winfax

GIF

The following file formats support replace operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

The following file formats support insert operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX


pRaster Parameter For SaveBuffer

pRaster

Pointer to the ILEADRaster object that contains image to save.


Quality Parameter For SaveBuffer

Quality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


Return for SaveBuffer

Return Value

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


uRequiredSize Parameter For SaveBuffer

uRequiredSize

The minimum required size (in bytes) of the user allocated buffer.


bSelected Parameter For SaveDatabase

bSelected

Flag that indicates which items in the database to save. Possible values are:

Value | Meaning
TRUE | Save only selected items within the database.
FALSE | Save all items in the database.


pszFilename Parameter For SaveDatabase

pszFilename

String that contains the name of the file in which to save the database.


Return for SaveDatabase

Return Value

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


Format Parameter For Save

Format

Output file format. For valid values, refer to Formats of Output Files.


iBitsPerPixel Parameter For Save

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For valid values, refer to Formats of Output Files.


iModify Parameter For Save

iModify

Indicates how to save a new page in a multipage file that supports insert and replace operations.

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten. This is comparable to bMultipage being FALSE in earlier versions.
SAVE_APPEND | [1] or [-1] The page is appended if the file exists. This is comparable to bMultipage being TRUE in earlier versions.
SAVE_REPLACE | [2] Replace the page specified in the SavePage property.
SAVE_INSERT | [3] Insert the new page before the page specified in the SavePage property

The following file formats support append operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

FlashPix

AWD

Winfax

GIF

The following file formats support replace operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

The following file formats support insert operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX


Format Parameter For SaveMemory2

Format

Output file format. For valid values, refer to Formats of Output Files.


iBitsPerPixel Parameter For SaveMemory2

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.


iModify Parameter For SaveMemory2

iModify

Flag that indicates how to save a new page in a multi-page file that supports insert and replace operations. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
SAVE_APPEND | [1] The page is appended if the file exists
SAVE_REPLACE | [2] Replace the page specified in the SavePage property.
SAVE_INSERT | [3] Insert the new page before the page specified in the Savepage property.


pRaster Parameter For SaveMemory2

pRaster

ILEADRaster object to save.


Quality Parameter For SaveMemory2

Quality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


Return for SaveMemory2

Return Value

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


Format Parameter For SaveMemory

Format

Output file format. For valid values, refer to Formats of Output Files.


iBitsPerPixel Parameter For SaveMemory

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.


phMem Parameter For SaveMemory

phMem

Address of the OLE_HANDLE variable that you use to reference the file in memory. In C++, you declare the variable and pass its address. In most other languages, you pass the variable by reference. The method updates the value of the variable. The variable must be a global handle (HGLOBAL) and must be declared with the appropriate data type. To see the correct data type, refer to the code example for your development system.


piSize Parameter For SaveMemory

piSize

Address of the long integer variable that you use to track the size of the file in memory. In C++, you declare the variable and pass its address. In most other languages, you pass the variable by reference. The method updates the value of the variable. The variable must be declared with the appropriate data type. To see the correct data type, refer to the code example for your development system.


pRaster Parameter For SaveMemory

pRaster

ILEADRaster object to save.


Quality Parameter For SaveMemory

Quality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


Return for SaveMemory

Return Value

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


iModify Parameter For Save

iModify

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

Value | Meaning
SAVE_OVERWRITE | [0] Do not insert/replace/append. Overwrite any existing file. This is comparable to bMultipage being FALSE in earlier versions.
SAVE_APPEND | [1] or [-1] Append the page if the file exists. This is comparable to bMultipage being TRUE in earlier versions.
SAVE_REPLACE | [2] Replace the page specified in the iPage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the iPage parameter.


iPage Parameter For Save

iPage

Value that represents a page number in a multi-page MRC file. This parameter is used only if the iModify parameter is SAVE_REPLACE or SAVE_INSERT. If iModify is SAVE_REPLACE, iPage represents the number of the page to be replaced (the first page is page 1). If iModify is SAVE_INSERT, iPage represents the number of the page in front of which the new page will be inserted. For example, if iPage is 1 and iModify is SAVE_INSERT, then the page being saved becomes the first page in the file.


lFormat Parameter For Save

lFormat

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

Value | Meaning
FILE_LEAD_MRC | Use the LEAD proprietary T44 format. The default file extension is *.MRC.
FILE_TIF_LEAD_MRC | Use a TIF format with the LEAD proprietary T44 format as a subtype. The default file extension is *.TIF.
FILE_PDF_LEAD_MRC | [338] PDF compression using MRC segmentation.


pRaster Parameter For Save

pRaster

ILEADRaster object that contains the image to be saved.


pszFileName Parameter For Save

pszFileName

Character string that contains the output file name.


Return for Save

Return Value

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


pszName Parameter For Save

pszName

Character string containing the output file name.


Quality Parameter For Save

Quality

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


nIndex Parameter For SaveResolutionHeight

iIndex

Index into the array of heights.


nIndex Parameter For SaveResolutionWidth

nIndex

Index into the array of widths.


iModify Parameter For SaveT44

iModify

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

This value is ignored when saving using an lFormat of FILE_MRC.

Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0] Do not insert/replace/append. Overwrite any existing file. This is comparable to bMultipage being FALSE in earlier versions.
SAVE_APPEND | [1] or [-1] Append the page if the file exists. This is comparable to bMultipage being TRUE in earlier versions.
SAVE_REPLACE | [2] Replace the page specified in the iPage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the iPage parameter.


iPage Parameter For SaveT44

iPage

Represents a page number in a multi-page MRC file.

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

This parameter is used only if the iModify parameter is SAVE_REPLACE or SAVE_INSERT. If iModify is SAVE_REPLACE, iPage represents the number of the page to be replaced (the first page is page 1). If iModify is SAVE_INSERT, iPage represents the number of the page in front of which the new page will be inserted. For example, if iPage is 1 and iModify is SAVE_INSERT, then the page being saved becomes the first page in the file.


lFormat Parameter For SaveT44

lFormat

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

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


pRaster Parameter For SaveT44

pRaster

ILEADRaster object that contains the image to be saved.


pszFileName Parameter For SaveT44

pszFileName

Character string that contains the output file name.


Return for SaveT44

Return Value

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


bSelected Parameter For SaveToFile

bSelected

Indicates which items to save.

Value | Meaning
True | Save only items that have the Selected attribute equal to True
False | Save all items


nBits Parameter For SaveToFile

nBits

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For valid values, refer to Formats of Output Files.


nFormat Parameter For SaveToFile

nFormat

Output file format. The following are valid values:

Value | Meaning
FILE_PCX | ZSoft PCX
FILE_GIF | CompuServe GIF
FILE_TIF | Tagged Image File Format
FILE_JTIF | Jpeg Tag Image File Format
FILE_TIFLZW | TIF Format with LZW compression
FILE_LEAD1JTIF | JPEG 4:1:1
FILE_LEAD2JTIF | JPEG 4:2:2
FILE_CCITT | TIFF CCITT
FILE_CCITT_GROUP3_1DIM | CCITT Group3 one dimension
FILE_CCITT_GROUP3_2DIM | CCITT Group3 two dimensions
FILE_CCITT_GROUP4 | CCITT Group4 two dimensions
FILE_FPX | FlashPix, no compression
FILE_FPX_SINGLE_COLOR | FlashPix, compression 'single color' method
FILE_FPX_JPEG | FlashPix, compression JPEG
FILE_FPX_JPEG_QFACTOR | FlashPix, compression JPEG, specify qFactor
FILE_TIF_CMYK | TIFF no compression, CMYK data
FILE_TIFLZW_CMYK | TIFF LZW compression, CMYK data
FILE_TIF_PACKBITS | TIFF PackBits compression, RGB data
FILE_TIF_PACKBITS_CMYK | TIFF PackBits compression, CMYK data
FILE_TIF_YCC | TIFF YCbCr color space, no compression
FILE_TIFLZW_YCC | TIFF YCbCr color space, LZW compression
FILE_TIF_PACKBITS_YCC | TIFF YCbCr color space, PackBits compression
FILE_AWD | Microsoft Fax format
FILE_TIF_CMP | Tagged Image File with CMP Compression
FILE_TIF_JBIG | Tagged Image File with JBIG Compression
FILE_TIF_J2K | Tagged Image File with JPEG2000 Compression
FILE_TIF_CMW | CMW Tagged Image File


nQFactor Parameter For SaveToFile

nQFactor

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.


pszFile Parameter For SaveToFile

pszFile

Name of the file into which items should be saved.

Note:

If you specify an existing file, and the format supports the append operation, the items will be appended to the existing file.


Return for SaveToFile

Return Value

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


iIndex Parameter For CMYKRaster

iIndex

Index for the raster bitmap from the CMYK raster list. This is a zero based index. Possible values are:

Value | Meaning
0 | Index for the C plane
1 | Index for the M plane
2 | Index for the Y plane
3 | Index for the K plane
4 | Index for the Alpha plane


lSegId1 Parameter For CombineSegments

lSegId1

ID of the first segment to be combined.


lSegId2 Parameter For CombineSegments

lSegId2

ID of the second segment to be combined.


Return for CombineSegments

Return Value

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


pRasterMrc Parameter For CopySegmentationHandle

pRasterMrc

ILEADRasterMrc object that contains the source raster MRC object.


Return for CopySegmentationHandle

Return Value

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


Return for CreateNewSegment

Return Value

Return | Meaning
>= 0 | Index of the newly added segment. The method was successful.
-1 | An error occurred.


pRaster Parameter For CreateNewSegment

pRaster

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


SegmentBottom Parameter For CreateNewSegment

SegmentBottom

Bottom segment boundary from the original bitmap.


SegmentLeft Parameter For CreateNewSegment

SegmentLeft

Left segment boundary from the original bitmap.


SegmentRight Parameter For CreateNewSegment

SegmentRight

Right segment boundary from the original bitmap.


SegmentTop Parameter For CreateNewSegment

SegmentTop

Top segment boundary from the original bitmap.


SegType Parameter For CreateNewSegment

SegType

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

Value | Meaning
SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLOR | [0x02] Segment is 1 bit colored text.
SEGTYPE_TEXT_2BIT_COLOR | [0x03] Segment is 2 bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.
SEGTYPE_BACKGROUND | [0x07] Segment is a background (The most prevalent color in the document is considered to be the background color.)
SEGTYPE_ONE_COLORED | [0x08] Segment is a one color.
SEGTYPE_TEXT_2BIT_BW | [0x09] Segment is 1-bit black and white text.


index Parameter For Element

index

Index into the array of elements for the current marker.


ElementCount Parameter For EnumerateMarkers

ElementCount

Value that indicates the number of elements in the enumerated marker.


lType Parameter For EnumerateMarkers

lType

An integer that represents the ID of the marker(s) being enumerated. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which marker types are allowed.


bstrDescription Parameter For EnumerateTextTokenTable

bstrDescription

String that describes the token. This string appears on the text token table menu. For example, the string for token #0 in the default text token table is "Two Digit Month". The text token table menu is displayed by:

1. | Right-clicking on a Button, Note, PushPin, Rubber Stamp, Stamp, Text, or Text Pointer annotation object.
2. | Select Text option in menu that appears.
3. | Click the Insert Token button. A menu for the existing text token table appears, as shown in the following figure:
4. | Select the token to be inserted.


bstrToken Parameter For EnumerateTextTokenTable

bstrToken

String that contains the token. This can be ANY ascii character EXCEPT ‘#’, because the token ## is reserved to display the # character.


bstrTokenString Parameter For EnumerateTextTokenTable

bstrTokenString

String that contains any combination of existing strings or any new string. This parameter is vlid only if the TokenType parameter is ANN_TOKEN_TEXT. If the TokenType parameter is not ANN_TOKEN_TEXT, then bstrTokenString is ignored.


nTextTokenCount Parameter For EnumerateTextTokenTable

nTextTokenCount

Total number of tokens in the text token table.


TokenType Parameter For EnumerateTextTokenTable

TokenType

Value that identifies the type of token. Possible values are:

Value | Meaning
ANN_TOKEN_NONE | [0] String not treated as a token
ANN_TOKEN_SEPARATOR | [1] Add a separator to the automation token menu
ANN_TOKEN_TEXT | [2] A text string
ANN_TOKEN_DATE_YYYY | [3] Current four digit year
ANN_TOKEN_DATE_YY | [4] Current two digit year
ANN_TOKEN_DATE_MM | [5] Two digit representation of current month
ANN_TOKEN_DATE_DD | [6] Two digit representation of current day
ANN_TOKEN_DATE_MONTH_NAME | [7] Current month name (i.e. January)
ANN_TOKEN_DATE_DAY_OF_WEEK | [8] Current day of week (i.e. Monday)
ANN_TOKEN_TIME_HH_12 | [9] Current hour,using a 12 hour clock
ANN_TOKEN_TIME_HH_24 | [10] Current hour, using a 24 hour clock
ANN_TOKEN_TIME_MM | [11] Current minute (00-59)
ANN_TOKEN_TIME_SS | [12] Current second (00-59)
ANN_TOKEN_TIME_MILLISECONDS | [13] Current milliseconds (000-999)
ANN_TOKEN_AM_PM | [14] Time of day indicator (AM or PM)


bstrFile Parameter For EnumFileGeoKeys

bstrFile

A character string contains the name of the file in which to enumerate GeoKeys.


lPage Parameter For EnumFileGeoKeys

lPage

For a multipage GeoTIFF file, this is the page index that determines the page on which to enumerate the tags.

If the file is a multipage GeoTIFF, the first page index is 1, the second page index is 2, and so on.

If the file is a single page GeoTIFF, always pass 1 to this parameter.


Return for EnumFileGeoKeys

Return Value

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


uFlags Parameter For EnumFileGeoKeys

uFlags

Flags parameter reserved for future use. Pass 0.


bstrFileName Parameter For EnumFileTags

bstrFileName

String containing the name of the file in which to enumerate the tags.


lPage Parameter For EnumFileTags

lPage

Specifies the page number on which to enumerate the tags.


Return for EnumFileTags

Return Value

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


uFlags Parameter For EnumFileTags

uFlags

Flags parameter. Reserved for future use. Pass 0.


uCount Parameter For EnumGeoKeys

uCount

The number of items specified by the GeoKeyData property.


uTag Parameter For EnumGeoKeys

uTag

GeoKey ID identifying the GeoTIFF key.


uType Parameter For EnumGeoKeys

uType

The type of GeoKey. Indicates whether the data specified to GeoKeyData property is SHORT, DOUBLE or ASCII. Possible values are:

Value | Meaning
TAG_ASCII | [2] Byte in the range of 0 to 255. Null-terminated.
TAG_SHORT | [3] Two bytes, unsigned.
TAG_DOUBLE | [12] Eight bytes used as a double-precision floating-point number.


Return for EnumMarkers

Return Value

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


uCount Parameter For EnumTags

uCount

Number of elements of type uType. Note that this is not the same as the number of bytes. For example, if uCount is 10 and uType is TAG_LONG, you will need 10 x 4 = 40 bytes to read the tag data.


uTag Parameter For EnumTags

uTag

Tag to identify the data in the TIFF file. This may be any tag specified using the SetTag method, or any other tag added by the TIFF filter when saving the file. For example, all of the TIFF comments would generate a particular TIFF tag.


uType Parameter For EnumTags

uType

Tagged data type. Valid values are:

Value | Meaning
TAG_BYTE | [1] Byte.
TAG_ASCII | [2] Byte in the range of 0 to 255.
TAG_SBYTE | [6] Byte used as signed number in the range of -128 to +127.
TAG_UNDEFINED | [7] Byte, with application-defined usage.
TAG_SHORT | [3] Two bytes, unsigned.
TAG_SSHORT | [8] Two bytes, signed.
TAG_LONG | [4] Four bytes, unsigned.
TAG_SLONG | [9] Four bytes, signed.
TAG_RATIONAL | [5] Eight bytes, used as a pair of unsigned long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_SRATIONAL | [10] Eight bytes, used as a pair of signed long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_FLOAT | [11] Four bytes used as a floating point number.
TAG_DOUBLE | [12] Eight bytes used as a double-precision floating point number.


bstrFileName Parameter For LoadFileCMYKArray

bstrFileName

String that contains the name of the file to load. The page being loaded must be CMYK, otherwise the function will fail and return the ERROR_INV_COLORSPACE error code. (All of the pages in the file do not have to be CMYK, just the page being loaded.)


lPage Parameter For LoadFileCMYKArray

lPage

Specifies the start page. Page 0 is the first page, page 1 is the second page, etc. The pages will be read starting with this page. The lPage parameter of the LoadFileCMYKArray method designates the page relative to the virtual beginning of the file. The virtual beginning of the file is:

the real beginning of the file, if the LoadIFD property is not set

or

the page indicated by LoadIFD, if the LoadIFD property is set.


nBitsPerPixel Parameter For LoadFileCMYKArray

nBitsPerPixel

The resulting bitmap pixel depth. Possible values are:

Value | Meaning
8 | Each plane will be a grayscale 8 bits per pixel bitmap
16 | Each plane will be a grayscale 16 bits per pixel bitmap


Return for LoadFileCMYKArray

Return Value

Return | Meaning
0 | The function was successful.
ERROR_INV_COLORSPACE | Invalid color space.
<>0 | An error occurred. Refer to Error Codes.


pRaster Parameter For LoadSegmentation

pRaster

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


pszFileName Parameter For LoadSegmentation

pszFileName

Character string containing the input file name.


Return for LoadSegmentation

Return Value

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


bstrFileName Parameter For ReadFileCommentOffset

bstrFileName

String containing the name of the file in which to read.


nBytesToLoad Parameter For ReadFileCommentOffset

nBytesToLoad

The size of the embedded image file. (The embedded file may be a record within the larger file, and in such cases, this is the record size.)


nOffsetBegin Parameter For ReadFileCommentOffset

nOffsetBegin

The position, from the beginning of the file, of the first byte to load.


pVarComment Parameter For ReadFileCommentOffset

pVarComment

Pointer to ILEADRasterVariant that will hold the comment field.


Return for ReadFileCommentOffset

Return Value

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


uType Parameter For ReadFileCommentOffset

uType

The type of comment. Refer to Types of File Comments.


bSavePlanar Parameter For SaveFileCMYKArray

bSavePlanar

Enables or disables saving in planar mode. Possible values are:

Value | Meaning
TRUE | Enable saving in planar mode
FALSE | Disable saving in planar mode


bstrFileName Parameter For SaveFileCMYKArray

bstrFileName

String containing the name of the image file to save.


nBitsPerPixel Parameter For SaveFileCMYKArray

nBitsPerPixel

Resulting bits per pixel for each plane. Possible values are:

Value | Meaning
0 | Default bits per pixel. LEADTOOLS will pick the closest valid value.
8 | Save 8 bits per component. The generated file will contain 32 bits (no alpha) or 40 bits (with alpha). Note that the GetFileInfo method will report 8 bits less (24 or 32-bit).
16 | Save 16 bits per component. The generated file will contain 64 bits (no alpha) or 80 bits (with alpha). Note that the GetFileInfo method will report 16 bits less (48 or 64-bit).


nFormat Parameter For SaveFileCMYKArray

nFormat

Output file format. Possible values are:

Value | Meaning
FILE_TIF_CMYK | [85] Tagged Image File, with no compression and with CMYK color space.
FILE_TIF_PACKBITS_CMYK | [88] Tagged Image File with PackBits Compression and CMYK color space.
FILE_TIFLZW_CMYK | [86] Tagged Image File with LZW Compression and CMYK color space.


nQFactor Parameter For SaveFileCMYKArray

nQFactor

Reserved for future use. Pass 2.


Return for SaveFileCMYKArray

Return Value

Return | Meaning
0 | The function was successful.
ERROR_INV_COLORSPACE | Invalid color space.
<>0 | An error occurred. Refer to Error Codes.


uFlags Parameter For SaveFileCMYKArray

uFlags

Value that determines whether an existing file will be overwritten. Possible values are:

Value | Meaning
0 | [0x0000] If the output file exists, it will be overwritten.
SAVEFILE_MULTIPAGE | [0x0004] If the output file exists and is a valid TIFF file, the new image will be appended to the end of the file.


lPage Parameter For SaveICCProfile2

lPage

The page number (for multipage files) on which to embed the ICC profile. If the file is not a multipage file, pass 0.


pData Parameter For SaveICCProfile2

pData

A VARIANT byte array that contains the ICC profile to save or embed.


pszName Parameter For SaveICCProfile2

pszName

String containing the name of the file in which to save or embed an ICC profile.


Return for SaveICCProfile2

Return Value

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


lPage Parameter For SaveICCProfile

lPage

The page number (for multipage files) on which to embed the ICC profile. If the file is not a multipage file, pass 0.


pData Parameter For SaveICCProfile

pData

An ILEADRasterVariant byte array object that contains the ICC profile to save or embed.


pszName Parameter For SaveICCProfile

pszName

String containing the name of the file in which to save or embed an ICC profile.


Return for SaveICCProfile

Return Value

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


iBitsPerPixel Parameter For SaveOffset

iBitsPerPixel

Resulting file's pixel depth.The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits. For valid values, refer to Formats of Output Files.


iFormat Parameter For SaveOffset

iFormat

Output file format. For valid values, refer to Formats of Output Files


iModify Parameter For SaveOffset

iModify

Indicates how to save a new page in a multipage file that supports insert and replace operations.

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten. This is comparable to bMultipage being FALSE in earlier versions.
SAVE_APPEND | [1] or [-1] The page is appended if the file exists. This is comparable to bMultipage being TRUE in earlier versions.
SAVE_REPLACE | [2] Replace the page specified in the SavePage property.
SAVE_INSERT | [3] Insert the new page before the page specified in the SavePage property,.

The following file formats support append operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

FlashPix

AWD

Winfax

GIF

The following file formats support replaces operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

The following file formats support insert operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX


iOffsetBegin Parameter For SaveOffset

iOffsetBegin

Offset within the file at which to begin saving


iQuality Parameter For SaveOffset

iQuality

This parameter is used when saving an image file to LEAD or JPEG.formats. Qfactor is a number that determines the degree of loss in the compression process. For possible values, refer to Compression Quality Factors.


pRaster Parameter For SaveOffset

pRaster

ILEADRaster object to save.


pszName Parameter For SaveOffset

pszName

Character string containing the output file name


Return for SaveOffset

Return Value

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


pszFileName Parameter For SaveSegmentation

pszFileName

Character string containing the output file name.


Return for SaveSegmentation

Return Value

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


Format Parameter For SaveWithStamp

Format

Type of compression to use. Valid values are:

Value | Meaning
FILE_CMP | LEAD CMP compression format.
FILE_JFIF | JPEG File Interchange Format using YUV 4:4:4 color spacing.
FILE_LEAD2JFIF | JPEG File Interchange Format using YUV 4:2:2 color spacing.
FILE_LEAD1JFIF | JPEG File Interchange Format using YUV 4:1:1 color spacing.
FILE_EXIF_JPEG_411 | Exif 2.0 file containing a JPEG compressed image. uses 4:1:1 subsampling (called 4:2:0 sampling in other places).


fStampHeight Parameter For SaveWithStamp

fStampHeight

Height of the stamp to store within the compressed image. Maximum height of the stamp is 255 pixels. The unit of measure is determined by the ScaleMode property.


fStampWidth Parameter For SaveWithStamp

fStampWidth

Width of the stamp to store within the compressed image. Maximum width of the stamp is 255 pixels. The unit of measure is determined by the ScaleMode property.


iBitsPerPixel Parameter For SaveWithStamp

iBitsPerPixel

Pixel depth of the main image in the file. Valid values are:

Value | Meaning
8 | For grayscale.
24 | For True color.


iStampBits Parameter For SaveWithStamp

iStampBits

Pixel depth of the stamp. Valid values are:

Value | Meaning
8 | For 8-bit stamp image.
24 | For 24-bit stamp image.


pRaster Parameter For SaveWithStamp

pRaster

ILEADRaster object to be saved.


pszName Parameter For SaveWithStamp

pszName

Character string containing the output file name.


Quality Parameter For SaveWithStamp

Quality

Compression quality factor to use for the specified compression format. This value can be any integer ranging from 2 to 255 for all the supported compression methods. In addition, the LEAD CMP compression format can use any one of the following enhanced options:

Value | Meaning
QFACTOR_PQ1 | Perfect Quality compression Option 1.
QFACTOR_PQ2 | Perfect Quality compression Option 2.
QFACTOR_QFS | Quality Far more important than Size.
QFACTOR_QMS | Quality More important than Size.
QFACTOR_QS | Quality and Size are equally important.
QFACTOR_SQS | Size more important than Quality - Sharp.
QFACTOR_SQT | Size more important than Quality - less Tiling.
QFACTOR_MCQ | Maximum Compression, keeping quality as good as possible.
QFACTOR_MC | Maximum Compression.


Return for SaveWithStamp

Return Value

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


Return for ScrollItems

Return Value

Return value is the actual number of lines scrolled.


nAmount Parameter For ScrollItems

nAmount

The amount to scroll. Positive values scroll forward in the list, while negative values scroll backwards. The direction (either horizontal or vertical) of the scroll depends on the current setting for ScrollStyle.


bFlag Parameter For SelectAll

bFlag

Flag that indicates the new status of the Selected attribute for all items in the ImageList Control.


Return for SelectAll

Return Value

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


Index Parameter For SelectedItems

Index

Index into the array of selected ImageList items. This is a 0-based index. This value must be between 0 and SelectedCount - 1.


hMenu Parameter For SetAnnMenuhMenu

hMenu

Menu handle to be used by the ILEADRasterAnnMenu interface.


Return for SetAnnMenu

Return Value

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


newVal Parameter For SetBitmapCompression

newVal

New compression to set. For possible values, refer to the LoadCompressed property.


pRaster Parameter For SetBitmapCompression

pRaster

Pointer to the ILEADRaster object to be modified.


lDataSize Parameter For SetDataPointer

lDataSize

The size of the data from vData. If vData is empty, then this parameter is ignored. Should match the required size for the bitmap data.


Return for SetDataPointer

Return Value

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


vData Parameter For SetDataPointer

vData

Parameter that can specify the bitmap data. Can be an empty ILEADRasterVariant object, in which case the bitmap data pointer is set to NULL.

The ILEADRasterVariant type must be VALUE_ARRAY_BYTE. Use the ShortItemValue property in the ILEADRasterVariant object to specify the bitmap data.


hBitmap Parameter For SetDDB

hBitmap

DDB to convert.


hDC Parameter For SetDDB

hDC

Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.


hPalette Parameter For SetDDB

hPalette

Handle to the palette used by the DDB. You can use the GetPalette method to get the palette handle.


Return for SetDDB

Return Value

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


hDIB Parameter For SetDIB

hDIB

Handle to the DIB to be converted.


Return for SetDIB

Return Value

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


fHeight Parameter For SetDstClipRect

fHeight

The height of the clipping rectangle. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetDstClipRect

fLeft

The X coordinate of the origin of the clipping rectangle.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetDstClipRect

fTop

The Y coordinate of the origin of the clipping rectangle.

The position is relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetDstClipRect

fWidth

The width of the clipping rectangle. The unit of measure is determined by the ScaleMode property.


Return for SetDstClipRect

Return Value

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


fHeight Parameter For SetDstRect

fHeight

The height of the destination rectangle. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetDstRect

fLeft

The X coordinate of the origin of the destination rectangle.

The position is relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetDstRect

fTop

The Y coordinate of the origin of the destination rectangle.

The position is relative to the Main Control. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetDstRect

fWidth

The width of the destination rectangle. The unit of measure is determined by the ScaleMode property.


Return for SetDstRect

Return Value

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


bstrValue Parameter For SetFilterUrl

bstrValue

String indicating the full URL for the filter (i.e) "http://www.leadtools.com/filters/CMPFilter.cab"


Return for SetFilterUrl

Return Value

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


fHeight Parameter For SetFloaterDstClipRect

fHeight

The height of the destination clipping rectangle.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetFloaterDstClipRect

fLeft

The X coordinate of the origin of the destination clipping rectangle.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetFloaterDstClipRect

fTop

The Y coordinate of the origin of the destination clipping rectangle.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetFloaterDstClipRect

fWidth

The width of the destination clipping rectangle.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


Return for SetFloaterDstClipRect

Return Value

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


fHeight Parameter For SetFloaterDstRect

fHeight

The height of the destination rectangle.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetFloaterDstRect

fLeft

The X coordinate of the origin of the destination rectangle.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetFloaterDstRect

fTop

The Y coordinate of the origin of the destination rectangle.

The position is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetFloaterDstRect

fWidth

The width of the destination rectangle.

The measurement is relative to the Main Control's client area. The unit of measure is determined by the ScaleMode property.


Return for SetFloaterDstRect

Return Value

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


Return for SetGeoKey

Return Value

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


uTag Parameter For SetGeoKey

uTag

ID of the GeoKey to set. Values of the GeoKey ID range between 0 and 65535. Possible ranges are:

Range | Meaning
0..1023 | Do not use; reserved for future use.
1024..2047 | GeoTIFF configuration keys.
2048..3071 | Geographic/Geocentric CS Parameter Keys.
3072..4095 | Projected CS Parameter Keys.
4096..5119 | Vertical CS Parameter keys.
5120..32767 | Reserved.
32768..65535 | Private use – use to store your own data


iLayer Parameter For SetLayerMaskBitmap

iLayer

Index into the array of layer mask bitmaps.


pRaster Parameter For SetLayerMaskBitmap

pRaster

Pointer to the ILEADRaster object that contains a bitmap list.

This parameter is needed since iLayer is always > 0 for this method.


pRasterMask Parameter For SetLayerMaskBitmap

pRasterMask

Pointer to the ILEADRaster object that contains the new mask bitmap.


Return for SetLayerMaskBitmap

Return Value

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


fHeight Parameter For SetLoadResolution

fHeight

Height of the bitmap to load. You can pass 0 to get the default.


Format Parameter For SetLoadResolution

Format

Value | Meaning
FILE_PCD | Kodak PhotoCD
FILE_FPX | Kodak FlashPix
FILE_JP2 | JPEG 2000. This file format contains image data and extra information about the contents and organization of the file.
FILE_J2K | JPEG 2000. This file format contains only a stream of image data.
FILE_JBIG | JBIG


fWidth Parameter For SetLoadResolution

fWidth

Width of the bitmap to load. You can pass 0 to get the default.


pRaster Parameter For SetLoadResolution

pRaster

ILEADRaster object used as reference for the ScaleMode.

This object's ScaleMode property determines the units for fWidth and fHeight.


Return for SetLoadResolution

Return Value

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


fXPos Parameter for SetMagGlassPos

fXPos

The X coordinate of the new position of the Magnifying Glass, relative to the ILEADRasterView Control. The unit of measure is determined by the ScaleMode property.


fYPos Parameter for SetMagGlassPos

fYPos

The Y coordinate of the new position of the Magnifying Glass, relative to the ILEADRasterView Control. The unit of measure is determined by the ScaleMode property.


Return for SetMagGlassPos

Return Value

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


lFlags Parameter For SetMarkers

lFlags

Reserved for future use. Pass 0.


Marker Parameter For SetMarkers

Marker

Pointer to an ILEADMarkers object that contains the markers to be set.


Return for SetMarkers

Return Value

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


Return for SetMemoryInfo

Return Value

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


Return for SetMemoryThresholds

Return Value

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


iMaxBit Parameter For SetMinMaxBits

iMaxBit

The maximum bit value of the pixels in the image. For example, in a 12-bit grayscale image MaxBit would be <= 11 and MinBit would be >= 0.


iMinBit Parameter For SetMinMaxBits

iMinBit

The minimum bit value of the pixels in the image. For example, in a 12-bit grayscale image MaxBit would be <= 11 and MinBit would be >= 0.


Return for SetMinMaxBits

Return Value

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


bUpdatePos Parameter For SetMousePos

bUpdatePos

Flag that indicates whether to update the cursor position to (x, y). Possible values are:

Value | Meaning
VARIANT_TRUE | Move the cursor to (x, y).
VARIANT_FALSE | Keep the cursor where it is. (The automation object will think the cursor is at (x, y).)


Return for SetMousePos

Return Value

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


x Parameter For SetMousePos

x

The new X coordinate for the automation object to use when processing the mouse messages.


y Parameter For SetMousePos

y

The new Y coordinate for the automation object to use when processing the mouse messages.


iIndex Parameter For SetOverlayAttributes

iIndex

The index of the overlay for which the attributes are being set. This index is zero-based.


lFlags Parameter For SetOverlayAttributes

lFlags

Flags that determine which overlay attributes to set. These flags can be combined using ‘or’. Possible values are:

Value | Meaning
OVERLAYATTRIBUTES_ORIGIN | [0x0001] The top-left position attribute should be set. The OriginX property and the OriginY property contain the new top-left offset.
OVERLAYATTRIBUTES_COLOR | [0x0002] The color attribute should be set. The Color property contains the new color.
OVERLAYATTRIBUTES_FLAGS | [0x0004] The flags should be set. The Flags property contains the new flags.
OVERLAYATTRIBUTES_BITINDEX | [0x0008] The corresponding bitplane position should be set. The BitPosition property contains the new bitplane index.
OVERLAYATTRIBUTES_DICOM | [0x0010] The DICOM-related attributes should be set. This includes the following properties: Rows, Columns, Type, BitsAllocated, Description, Subtype, Label, ROIArea, ROIMean, ROIStandardDeviation, NumberFramesInOverlay, ImageFrameOrigin, ActivationLayer.


pRaster Parameter For SetOverlayAttributes

pRaster

Pointer to the ILEADRaster object for which to set the attributes.


Return for SetOverlayAttributes

Return Value

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


iIndex Parameter For SetOverlayBitmap

iIndex

The index of the overlay for which to set the bitmap This index is zero-based.


lFlags Parameter For SetOverlayBitmap

lFlags

Flags that determine how to set the bitmap for the overlay. You cannot combine these flags. Possible values are:

Value | Meaning
OVERLAY_COPY | [0] A copy of the overlay bitmap is inserted in the overlay list. pOverlayRaster will not be affected.
OVERLAY_NOCOPY | [1] pOverlayRaster is set into the overlay list without making a copy. You should be careful when modifying the overlay bitmap because you can modify/invalidate the entry in the overlay bitmap list. A safer way of quickly setting the data is to use OVERLAY_MOVE.
OVERLAY_MOVE | [3] pOverlayRaster is moved into the overlay list. It will also be reset, so you cannot make changes to it. This is recommended over OVERLAY_NOCOPY.


pOverlayRaster Parameter For SetOverlayBitmap

pOverlayRaster

Pointer to the ILEADRaster object that contains the new overlay bitmap.


pRaster Parameter For SetOverlayBitmap

pRaster

Pointer to the ILEADRaster object for which to set the bitmap.


Return for SetOverlayBitmap

Return Value

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


pPicture Parameter For SetPicture

pPicture

Address of the picture object.


Return for SetPicture

Return Value

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


CombineMode Parameter for SetRgnBorder

CombineMode

Flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


crBorderColor Parameter for SetRgnBorder

crBorderColor

Border color.


crLowerTolerance Parameter for SetRgnBorder

crLowerTolerance

Lower tolerance values that set the lower stopping point for the region.


crUpperTolerance Parameter for SetRgnBorder

crUpperTolerance

Upper tolerance values that set the upper stopping point for the region.


Return for SetRgnBorder

Return Value

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


x Parameter for SetRgnBorder

x

X coordinate of a point. The color of the specified point will be used to set the region.


y Parameter for SetRgnBorder

y

Y coordinate of a point. The color of the specified point will be used to set the region.


CombineMode Parameter For SetRgnColor

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


crMatch Parameter For SetRgnColor

crMatch

The color that defines the region.

You can specify a COLORREF color value (the return value of the RGB macro), or you can specify a palette index as explained in Using Palette Indexes As Color Values.


iCombineMode Parameter For SetRgnColorHSVRange

iCombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


nH0 Parameter For SetRgnColorHSVRange

nH0

The minimum Hue of the HSV color range.


nH1 Parameter For SetRgnColorHSVRange

nH1

The maximum Hue of the HSV color range.


nS0 Parameter For SetRgnColorHSVRange

nS0

The minimum Saturation of the HSV color range.


nS1 Parameter For SetRgnColorHSVRange

nS1

The maximum Saturation of the HSV color range.


nV0 Parameter For SetRgnColorHSVRange

nV0

The minimum Value of the HSV color range.


nV1 Parameter For SetRgnColorHSVRange

nV1

The maximum Value of the HSV color range.


Return for SetRgnColorHSVRange

Return Value

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


crLower Parameter For SetRgnColorRGBRange

crLower

OLE_COLOR that contains the minimum (inclusive) R, G and B values. A pixel must have R,G, and B all greater than or equal to crLower and less than or equal to crUpper to be included in the region.


crUpper Parameter For SetRgnColorRGBRange

crUpper

OLE_COLOR that contains the maximum (inclusive) R, G and B values. A pixel must have R,G, and B all greater than or equal to crLower and less than or equal to crUpper to be included in the region.


iCombineMode Parameter For SetRgnColorRGBRange

iCombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


Return for SetRgnColorRGBRange

Return Value

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


Return for SetRgnColor

Return Value

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


CombineMode Parameter For SetRgnCurve

CombineMode

Flag that indicates the action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Flags for Setting a Region.


FillMode Parameter For SetRgnCurve

FillMode

Flag that indicates how to handle complex crossing lines. The following are valid values, which are illustrated below:

Value | Meaning
L_POLY_WINDING | [0] All pixels that are inside the resulting exterior lines are in the region.
L_POLY_ALTERNATE | [1] The region includes the area between odd-numbered and even-numbered polygon sides on each scan line.


Return for SetRgnCurve

Return Value

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


CombineMode Parameter For SetRgnEllipse

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


fHeight Parameter For SetRgnEllipse

fHeight

The height of the region's bounding rectangle. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetRgnEllipse

fLeft

The X coordinate of the origin of the region's bounding rectangle. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetRgnEllipse

fTop

The Y coordinate of the origin of the region's bounding rectangle. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetRgnEllipse

fWidth

The width of the region's bounding rectangle. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


Return for SetRgnEllipse

Return Value

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


CombineMode parameter name Parameter For SetRgnFromMask

CombineMode

The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Flags for Setting a Region.


Return for SetRgnFromMask

Return Value

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


CombineMode Parameter For SetRgnHandle

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


fDx Parameter For SetRgnHandle

fDx

The horizontal distance to offset the region when adding it to the bitmap. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fDy Parameter For SetRgnHandle

fDy

The vertical distance to offset the region when adding it to the bitmap. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


hRgn Parameter For SetRgnHandle

hRgn

Handle to the stored region. The handle is returned by the method that stores the region.


Return for SetRgnHandle

Return Value

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


CombineMode Parameter For SetRgnMagicWand

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


crLowerTolerance Parameter For SetRgnMagicWand

crLowerTolerance

Lower tolerance values that set the lower stopping point for the region.


crUpperTolerance Parameter For SetRgnMagicWand

crUpperTolerance

Upper tolerance values that set the upper stopping point for the region.


Return for SetRgnMagicWand

Return Value

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


x Parameter For SetRgnMagicWand

x

X coordinate of a point. The color of the specified point will be used to set the region.


y Parameter For SetRgnMagicWand

y

Y coordinate of a point. The color of the specified point will be used to set the region.


CombineMode Parameter For SetRgnPolygon

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


iFillMode Parameter For SetRgnPolygon

iFillMode

Flag that indicates how to handle complex crossing lines. The following are valid values, which are illustrated below:

Value | Meaning
L_POLY_WINDING | All pixels that are inside the resulting exterior lines are in the region.
L_POLY_ALTERNATE | The region includes the area between odd-numbered and even-numbered polygon sides on each scan line.


Return for SetRgnPolygon

Return Value

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


CombineMode Parameter For SetRgnRect

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


fHeight Parameter For SetRgnRect

fHeight

The height of the region. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetRgnRect

fLeft

The X coordinate of the origin of the region. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetRgnRect

fTop

The Y coordinate of the origin of the region. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetRgnRect

fWidth

The width of the region. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


Return for SetRgnRect

Return Value

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


CombineMode Parameter For SetRgnRoundRect

CombineMode

Boolean flag that determines how the added region interacts with the existing region. For possible values, refer to Flags for Setting a Region.


fHeight Parameter For SetRgnRoundRect

fHeight

The height of the region's bounding rectangle. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fHeightEllipse Parameter For SetRgnRoundRect

fHeightEllipse

The height of the ellipse that describes the arc of the rounded corners. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetRgnRoundRect

fLeft

The X coordinate of the origin of the region's bounding rectangle. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetRgnRoundRect

fTop

The Y coordinate of the origin of the region's bounding rectangle. Coordinates are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetRgnRoundRect

fWidth

The width of the region's bounding rectangle. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


fWidthEllipse Parameter For SetRgnRoundRect

fWidthEllipse

The width of the ellipse that describes the arc of the rounded corners. Measurements are unscaled relative to the LEAD bitmap in memory. The unit of measure is determined by the ScaleMode property.


Return for SetRgnRoundRect

Return Value

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


fHeight Parameter For SetRubberBandRect

fHeight

The height of the rubberband. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetRubberBandRect

fLeft

The X coordinate of the origin of the rubberband. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetRubberBandRect

fTop

The Y coordinate of the origin of the rubberband. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetRubberBandRect

fWidth

The width of the rubberband. The unit of measure is determined by the ScaleMode property.


Return for SetRubberBandRect

Return Value

None.


nSegId Parameter For SetSegmentData

nSegId

ID of the segment to be updated.


pRaster Parameter For SetSegmentData

pRaster

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


SegmentBottom Parameter For SetSegmentData

SegmentBottom

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


SegmentLeft Parameter For SetSegmentData

SegmentLeft

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


SegmentRight Parameter For SetSegmentData

SegmentRight

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


SegmentTop Parameter For SetSegmentData

SegmentTop

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


SegType Parameter For SetSegmentData

SegType

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

SEGTYPE_TEXT_1BIT_BW | [0x01] Segment is 1-bit black and white text.
SEGTYPE_TEXT_1BIT_COLOR | [0x02] Segment is 1 bit colored text.
SEGTYPE_TEXT_2BIT_COLOR | [0x03] Segment is 2 bit colored text.
SEGTYPE_GRAYSCALE_2BIT | [0x04] Segment is 2-bit grayscale.
SEGTYPE_GRAYSCALE_8BIT | [0x05] Segment is 8-bit grayscale.
SEGTYPE_PICTURE | [0x06] Segment is an image.
SEGTYPE_BACKGROUND | [0x07] Segment is a background (The most prevalent color in the document is considered to be the background color.)
SEGTYPE_ONE_COLORED | [0x08] Segment is a one color.
SEGTYPE_TEXT_2BIT_BW | [0x09] Segment is 1-bit black and white text.


Return for SetSegmentData

Return Value

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


Bitmap Parameter For SetSelectionBitmap

Bitmap

Bitmap to use as the selection bitmap .


crTransparent Parameter For SetSelectionBitmap

crTransparent

Color value of the transparent color.


Return for SetSelectionBitmap

Return Value

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


pServer Parameter For SetServerBitmap

pServer

LEAD OLE Server object.


Return for SetServerBitmap

Return Value

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


fHeight Parameter For SetSrcClipRect

fHeight

The height of the clipping rectangle. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetSrcClipRect

fLeft

The X coordinate of the origin of the clipping rectangle. The position is relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetSrcClipRect

fTop

The Y coordinate of the origin of the clipping rectangle. The position is relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetSrcClipRect

fWidth

The width of the clipping rectangle. The unit of measure is determined by the ScaleMode property.


Return for SetSrcClipRect

Return Value

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


fHeight Parameter For SetSrcRect

fHeight

The height of the source rectangle. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For SetSrcRect

fLeft

The X coordinate of the origin of the source rectangle.

The position is relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fTop Parameter For SetSrcRect

fTop

The Y coordinate of the origin of the source rectangle.

The position is relative to the bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For SetSrcRect

fWidth

The width of the source rectangle. The unit of measure is determined by the ScaleMode property.


Return for SetSrcRect

Return Value

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


iType Parameter For SetTag

iType

Tagged data type. If vData contains data of a different type than that specified in this parameter, the data in vData will be converted to the type specified here. Valid values are:

Value | Meaning
TAG_BYTE | [1] Byte.
TAG_ASCII | [2] Byte in the range of 0 to 255.
TAG_SHORT | [3] Two bytes, unsigned.
TAG_LONG | [4] Four bytes, unsigned.
TAG_RATIONAL | [5] Eight bytes, used as a pair of unsigned long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_SBYTE | [6] Byte used as signed number in the range of -128 to +127.
TAG_UNDEFINED | [7] Byte, with application-defined usage.
TAG_SSHORT | [8] Two bytes, signed.
TAG_SLONG | [9] Four bytes, signed.
TAG_SRATIONAL | [10] Eight bytes, used as a pair of signed long integers, where the first number is the numerator and the second is the denominator of a fraction.
TAG_FLOAT | [11] Four bytes used as a floating point number.
TAG_DOUBLE | [12] Eight bytes used as a double-precision floating point number.


lCount Parameter For SetTag

lCount

The number of data items, based on the tagged data type. For example, if the buffer size is 16 and the data type is TAG_DOUBLE, the count is 2. vData may actually contain more items than indicated by lCount. If vData contains more than lCount items, the extra items will be ignored.


lTag Parameter For SetTag

lTag

Tag to identify the data in the TIFF file. Generally, you can specify a private tag in the range of 0x8000 to 0xFFFE. However, LEADTOOLS returns an error if you use any of the following registered tags:

Value | Meaning
0x8298 | Copyright comment
0x8769 | General Exif comments
0x8825 | Exif GPS comments

LEADTOOLS does NOT return an error if you set:

Value | Meaning
0x80A4 | Annotation TIFF tag defined as ANNTAG_TIFF.

Note that the tag with index 0 is reserved and will be filled by calling the ReadTag method.


Return for SetTag

Return Value

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


vData Parameter For SetTag

vData

An ILEADRasterVariant array object that contains the tag data. The type of data is indicated by the ILEADRasterVariant object’s Type and the number of items in vData is indicated by the ILEADRasterVariant object’s ItemCount.


iChange Parameter For Sharpen

iChange

The amount to change the sharpness. Valid values range from -1000 to + 1000.


pRaster Parameter For Sharpen

pRaster

ILEADRaster object to modified.


Return for Sharpen

Return Value

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


bHorizontal Parameter For Shear

bHorizontal

TRUE for horizontal shear, or FALSE for vertical shear.


crFill Parameter For Shear

crFill

The fill color.If the image is 8 bits per pixel or less, the color comes from the current palette, and it may not exactly match the specified color.

You can specify a COLORREF value (the return value of the RGB macro), or you can specify a palette index as explained in Using Palette Indexes As Color Values.


iAngle Parameter For Shear

iAngle

The angle of slant. Positive values are for clockwise angles; negative values are for counterclockwise angles. The angle is expressed in hundredths of degrees, with a limit of 4500 (45 degrees).


pRaster Parameter For Shear

pRaster

ILEADRaster object to modified.


Return for Shear

Return Value

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


bShowMagGlass Parameter for ShowMagGlass

bShowMagGlass

Flag that indicates whether to show or hide the Magnifying Glass. Possible values are:

Value | Meaning
TRUE | Show the Magnifying Glass.
FALSE | Hide the Magnifying Glass.


Return for ShowMagGlass

Return Value

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


bShow Parameter For ShowPanWin

bShow

Specifies whether to show PanWindow.

Setting | Description
TRUE | Show the PanWindow.
FALSE | Hide the PanWindow.


Return for ShowPanWin

Return Value

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


fHeight Parameter For Size

fHeight

New height. The unit of measure is determined by the ScaleMode property.


Flags Parameter For Size

Flags

Possible values are:

Value | Meaning
RESIZE_NORMAL | [0x0000] Use the normal resizing method.
RESIZE_RESAMPLE | [0x0002] Resize the bitmap, using interpolation and averaging to produce a higher-quality image than is achieved with normal resizing.
RESIZE_FAVORBLACK | [0x0001] (Document/Medical only) Preserve black objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a plus (+) operator to combine this flag with another one. For example, RESIZE_RESAMPLE + RESIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images.
RESIZE_FAVORBLACK_OR_RESAMPLE | [0x0003] Uses FavorBlack for 1-bit images and Resample for color images.
RESIZE_BICUBIC | [0x0004] Uses bicubic interpolation.
RESIZE_FAVORBLACK_OR_BICUBIC | [0x0005] Uses FavorBlack for 1-bit images and Bicubic for color images.


fWidth Parameter For Size

fWidth

New width. The unit of measure is determined by the ScaleMode property.


Return for Size

Return Value

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


bEnableSliceEvent Parameter For Slice

bEnableSliceEvent

Value that specifies whether the Slice method will generate the OnSliceBitmap Event. Possible values are:

Value | Meaning
VARIANT_TRUE | Generate the OnSliceBitmap Event.
VARIANT_FALSE | Do not generate the OnSliceBitmap Event.


crFill Parameter For Slice

crFill

OLE_COLOR used to fill the background following rotation. This parameter is used only if the SLICE_DESKEW flag is set.


lFlags Parameter For Slice

lFlags

Value that indicates how to handle the deskew operation, which rotation interpolation type is to be used, and whether to cut the slice from the original image. You can use a bitwise OR (|) to specify one flag from each group.

The following flags indicate whether to deskew the image. Possible values are:

Value | Meaning
SLICE_DESKEW | [ 0x0000] Do not deskew the sliced bitmap.
SLICE_WITHOUT_DESKEW | [ 0x0001] Deskew the sliced bitmap.

The following flags indicate which rotation interpolation type is to be used. Possible values are:

SLICE_DESKEW_LINEAR | [ 0x0000] Do not perform any interpolation methods when rotating.
SLICE_DESKEW_RESAMPLE | [ 0x0010] Perform bilinear interpolation when rotating.
SLICE_DESKEW_BICUBIC | [ 0x0020] Perform bicubic interpolation when rotating.

The following flags indicate whether to cut the slice from the original image. Possible values are:

SLICE_WITHOUT_CUT | [ 0x0000] Do not cut the slice from its original image. Send the NULL value to the Bitmap parameter of the OnSliceBitmap Event.
SLICE_CUT_SLICES | [0x0100] Cut the slice from its original image. Send a pointer to the created bitmap to the Bitmap parameter of the OnSliceBitmap Event.

If the SLICE_CUT_SLICES and SLICE_DESKEW lFlags are used the function cuts the slices from the deskewed image.


lMaxDeskewAngle Parameter For Slice

lMaxDeskewAngle

Maximum angle of deskew, in hundredths of a degree. Possible values range from 0 to 1000. The value in degrees is lMaxDeskewAngle divided by 100. This parameter is used only if the SLICE_DESKEW flag is set.


pRaster Parameter For Slice

pRaster

Pointer to the ILeadRaster object that references the bitmap to which to apply the effect.


Return for Slice

Return Value

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


Index Parameter For SmartUnit

Index

Index into the array of unit constants. The index is zero based.


Flags Parameter For Smooth

Flags

Flags that determine the behavior of the smoothing process. Flags may be combined using a bitwise OR . Possible values are:

Value | Meaning
SMOOTH_SINGLE_REGION: | For each bump or nick found by the Smooth method, if the DocCleanSuccess property is set to SUCCESS_REMOVE in the Smooth event, the removed bump or nick is added to an internal single region. If the DocCleanSuccess property is set to SUCCESS_NOREMOVE, the bump or nick is not added to the single region. When the Smooth method returns, either
 | 1. LEADRasterView.Raster will contain a region that contains all removed bumps or nicks. This is the case if the SMOOTH_LEAD_REGION has also been set. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster or
 | 2. the hDocCleanRgn property will reference a Windows region that contains all the removed bumps or nicks. This is the case if the SMOOTH_LEAD_REGION has NOT been set. When hDocCleanRgn is no longer needed, it must be destroyed.
 | When the region (either LEAD or Windows) is no longer needed, it must be destroyed.
SMOOTH_LEAD_REGION | This flag must be used in conjunction with SMOOTH_LEAD_SINGLE_REGION. If this flag is set, the LEADRasterView.Raster will contain a region that contains all removed bumps or nicks when the Smooth method returns. This region can be destroyed using the DeleteRgnHandle method of LEADRasterView.Raster.
SMOOTH_IMAGE_UNCHANGED | The original image is unchanged.
SMOOTH_FAVOR_LONG | Processes long bumps or nicks before short bumps or nicks. If this flag is not passed, short is favored over long. For example:
 | Smooth the following image with iLength == 3
 | X X
 | XXXXXXXXXX
 | Favoring short would remove the two "bumps" giving:
 | XXXXXXXXXX
 | Favoring long would fill in the "gap" giving:
 | XXXXX
 | XXXXXXXXXX


iLength Parameter For Smooth

iLength

Length of the bump (or nick) to remove (or fill). All bumps and nicks less than or equal to this size are processed. This value is in pixels.


nBumpOrNick Parameter For Smooth

nBumpOrNick

Flag that indicates whether to remove bumps or fill in nicks. Possible values are:

Value | Meaning
SMOOTH_BUMP | Remove a bump.
SMOOTH_NICK | Fill in a nick.


nLength Parameter For Smooth

nLength

Length (in pixels) of the bump or nick.


nStartCol Parameter For Smooth

nStartCol

The starting column of the bump or nick. The columns are zero-based.


nStartRow Parameter For Smooth

nStartRow

The starting row of the bump or nick. The rows are zero-based.


pRaster Parameter For Smooth

pRaster

ILEADRaster object to modified.


Return for Smooth

Return Value

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


uHorV Parameter For Smooth

uHorV

Flag that indicates whether the element being smoothed is vertical or horizontal. Possible values are:

Value | Meaning
SMOOTH_HORIZONTAL_ELEMENT | A horizontal bump or nick
SMOOTH_VERTICAL_ELEMENT | A vertical bump or nick


iThreshold Parameter For Solarize

iThreshold

Threshold at or above which colors are to be inverted. The valid range is 0-255.


pRaster Parameter For Solarize

pRaster

ILEADRaster object to modified.


Return for Solarize

Return Value

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


bAscending Parameter For Sort

bAscending

Flag indicating direction of the sort.

Value | Meaning
True | sort in ascending order
False | sort in descending order


Return for Sort

Return Value

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


sfType Parameter For SpatialFilter

sfType

Refer to List of Spatial Filters.


Return for SpatialFilter

Return Value

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


lIndex Parameter For STable

lIndex

The index into the array. The first element of the array is 0. The values present in this array are Saturation values used to remap an image.


iBitsPerPixel Parameter For StartFeedLoad

iBitsPerPixel

Resulting bitmap pixel depth. The following are valid values:

Value | Meaning
0 | Keep the original file's pixel depth (Do not convert).
1 | 1 bit per pixel in the resultant bitmap
4 | 4 bits per pixel in the resultant bitmap
8 | 8 bits per pixel in the resultant bitmap
12 | 12 bits per pixel in the resultant bitmap
16 | 16 bits per pixel in the resultant bitmap
24 | 24 bits per pixel in the resultant bitmap
32 | 32 bits per pixel in the resultant bitmap


lPage Parameter For StartFeedLoad

lPage

The page number (for multipage files) that contains the first image to be loaded.If the file is not a multipage file, pass 0.


lPages Parameter For StartFeedLoad

lPages

The number of pages to load. If the file is not a multipage file, pass 1.


pRaster Parameter For StartFeedLoad

pRaster

ILEADRaster object in which to load the image.


Return for StartFeedLoad

Return Value

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


b3D Parameter For StartMagGlass

b3D

Flag that indicates whether the border of a rectangular magnifying glass appears as 3D or flat. This value is valid only if bEllipse is FALSE. Possible values are:

Value | Meaning
TRUE | The rectangular magnifying glass appears with a 3D border.
FALSE | The rectangular magnifying glass appears with a flat border.


bCenter Parameter For StartMagGlass

bCenter

Flag that indicates how to center the magnified area. Possible values are:

Value | Meaning
TRUE | The zoomed rectangle is centered on the center of the pixel at the center of the magnifying glass.
FALSE | The zoomed rectangle is centered on the top, left corner of the pixel at the center of the magnifying glass.


bEllipse Parameter For StartMagGlass

bEllipse

Flag that indicates the shape of the magnifying glass. Possible values are:

Value | Meaning
TRUE | The magnifying glass is an Ellipse
FALSE | The magnifying glass is a Rectangle


bIgnoreRgn Parameter For StartMagGlass

bIgnoreRgn

Flag that indicates whether to magnify only the region in the source bitmap, or to ignore it. Possible values are:

Value | Meaning
TRUE | Ignore any existing regions within the source bitmap.
FALSE | Magnify only the region within the source bitmap. Data outside the region will be replaced with the color in clrBack.


clrBack Parameter For StartMagGlass

clrBack

The color to use for painting areas not covered by the zoomed image. (i.e. When the magnifying glass is not completely over the image.)


clrPen Parameter For StartMagGlass

clrPen

The color for the border of the magnifying glass.

This is ignored when bEllipse = FALSE and b3D = TRUE.


Crosshair Parameter For StartMagGlass

Crosshair

Specifies the type of crosshair. Possible values are:

Value | Meaning
CROSSHAIR_NONE | [0] No Crosshair
CROSSHAIR_FINE | [1] The crosshair is one pixel wide and uses the color in clrPen
CROSSHAIR_INVERTPEN | [2] The crosshair is three pixels wide. The center pixel uses the color in clrPen. The outer pixels use the inverse of the color in clrPen.
CROSSHAIR_INVERTSCREEN | [3] The crosshair is three pixels wide. The center pixel uses the color in clrPen. The outer pixels use the inverse of the screen color.


fBorderSize Parameter For StartMagGlass

fBorderSize

The size of the magnifying glass border in pixels. This value is ignored when bEllipse = FALSE and b3D = TRUE. In this case the magnifying glass appears as a rectangle with a 3D border. The 3D border has a thickness of 2 pixels, one pixel for the highlight color and one for the shadow color.


fHeight Parameter For StartMagGlass

fHeight

The height of the magnifying glass. Minimum size is 10 pixels.


fWidth Parameter For StartMagGlass

fWidth

The width of the magnifying glass. Minimum size is 10 pixels.


nZoom Parameter For StartMagGlass

nZoom

The zoom factor for the Magnification, in percentage. This value must be >= 100. For example, to zoom the image 2X, specify 200 for nZoom.


Return for StartMagGlass

Return Value

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


pRaster Parameter For StartSegmentation

pRaster

ILEADRaster object that contains the image to be segmented.


Return for StartSegmentation

Return Value

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


Return for StopFeedLoad

Return Value

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


Return for StopMagGlass

Return Value

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


Return for StopSegmentation

Return Value

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


pRaster Parameter For StetchIntensity

pRaster

ILEADRaster object to modified.


Return for StretchIntensity

Return Value

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


Flags Parameter For SwapColors

Flags

Flag that indicates which color channels to swap. Possible values are:

Value | Meaning
SWAP_RG | Swap the red and green channels. (Change red to green and green to red.)
SWAP_RB | Swap the red and blue channels. (Change red to blue and blue to red.)
SWAP_GB | Swap the green and blue channels. (Change green to blue and blue to green.)
SWAP_RGBR | Change red to green, green to blue and blue to red.
SWAP_RBGR | Change red to blue, blue to green and green to red.


pRaster Parameter For SwapColors

pRaster

ILEADRaster object to be modified.


Return for SwapColors

Return Value

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


Bitmap Parameter For ThumbnailEvent

Bitmap

Bitmap of the generated thumbnail.

This is only valid when nStatus is equal to 0.


nPercent Parameter For ThumbnailEvent

nPercent

When nStatusCode is BROWSE_LOADING, this indicates the percentage completion of the current file load operation.


nStatusCode Parameter For ThumbnailEvent

nStatusCode

This is the status code for the browse operation. This indicates success or failure when browsing for files and generating thumbnails.

This can be any of the following

Value | Meaning
0 | Success.
BROWSE_LOADING | [2] Indicates the file is being loaded
BROWSE_SKIPPED | [3] Indicates the file was skipped because it exceeded the specified size range
BROWSE_PRELOAD | [4] Indicates that LEADTOOLS has found a file and is about to determine the file format and attempt to create a thumbnail for it. If you want to avoid the internal processing overhead, you can set the SkipFile to false, which will cause LEADTOOLS to skip the file.
any other value | An error occurred. Refer to Error Codes.


pszFilename Parameter For ThumbnailEvent

pszFilename

Character string containing the name of the file that is being loaded or for which the thumbnail was generated.


lPage Parameter For TransformFile

lPage

Number of the page to transform. This is used only for multi-page files. Pass 1 to rotate the first page of the file.


pszNameDst Parameter For TransformFile

pszNameDst

Character string containing the name of the output file. This can be the same as the input file. If this parameter is NULL or "", then the name of the output file is the same as the input file.


pszNameSrc Parameter For TransformFile

pszNameSrc

Character string containing the name of the input file.


Return for TransformFile

Return Value

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


Transform Parameter For TransformFile

Transform

Flags that indicate the transform to be performed. Possible values are:

Value | Meaning
FILE_TRANSFORM_FLIP | [0x0001] Flip the image.
FILE_TRANSFORM_REVERSE | [0x0002] Reverse the image.
FILE_TRANSFORM_ROTATE90 | [0x0004] Rotate the image clockwise by 90 degrees.
FILE_TRANSFORM_ROTATE180 | [0x0008] Rotate the image clockwise by 180 degrees.
FILE_TRANSFORM_ROTATE270 | [0x000C] Rotate the image clockwise by 270 degrees.


iMarker Parameter For TransformMarker

iMarker

ID of the JPEG marker. The JPEG markers are uniquely identified by a byte value. Possible values are 1 to 254. (0 and 255 are not allowed.)


iTransform Parameter For TransformMarker

iTransform

Flags that indicate the transform to be performed. These are the same flags passed to the TransformFile method. Possible values are:

Value | Meaning
FILE_TRANSFORM_FLIP | [0x0001] Flip the image.
FILE_TRANSFORM_REVERSE | [0x0002] Reverse the image.
FILE_TRANSFORM_ROTATE90 | [0x0004] Rotate the image clockwise by 90 degrees.
FILE_TRANSFORM_ROTATE180 | [0x0008] Rotate the image clockwise by 180 degrees.
FILE_TRANSFORM_ROTATE270 | [0x000C] Rotate the image clockwise by 270 degrees.


lSize Parameter For TransformMarker

lSize

Size of the JPEG marker. The size will be less than 65535. If this value is 0, then the marker does not have any extra data.


vData Parameter For TransformMarker

vData

An ILEADRasterVariant array object that contains the marker data.


fHeight Parameter For Trim

fHeight

The height of the rectangle. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For Trim

fLeft

The X coordinate of the origin of the rectangle.

The position is relative to the current bitmap. The unit of measure is determined by the ScaleMode property.


fTop Parameter For Trim

fTop

The X coordinate of the origin of the rectangle.

The position is relative to the current bitmap. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For Trim

fWidth

The width of the rectangle. The unit of measure is determined by the ScaleMode property.


pRaster Parameter For Trim

pRaster

ILEADRaster object to modified.


Return for Trim

Return Value

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


iFlags Parameter For Underlay

Flags

Indicators of how the underlying image is to be positioned. Valid values are:

Value | Meaning
UNDERLAY_TILE | Tile the underlay. This repeats the underlying image, so that it fills the target image. This method does not do any resizing; you are responsible for the size of the tiles.
UNDERLAY_STRETCH | Stretch the underlay to fit the dimensions of the target image.


pRasterSrc Parameter For Underlay

pRasterSrc

The bitmap to use as the underlying image. This is the image that appears to be on bottom and is grayscaled as it is combined with the target image.


Return for Underlay

Return Value

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


iType Parameter For UnlockSupport

iType

The optional feature to unlock.

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


pszKey Parameter For UnlockSupport

pszKey

The key to unlock the feature.


Return for UnlockSupport

Return Value

None.


ColorType Parameter For UnsharpMask

ColorType

Flag that indicates the color space in which to apply the mask. Possible values are:

Value | Meaning
RGB_SPACE | [0x0001] Apply the mask in the RGB color space.
YUV_SPACE | [0x0002] Apply the mask in the YUV color space.


iAmount Parameter For UnsharpMask

iAmount

Value that represents an adjustment factor. This is a percentage.


iRadius Parameter For UnsharpMask

iRadius

Value that indicates the size of the neighborhood used for blurring each pixel of the bitmap.


iThreshold Parameter For UnsharpMask

iThreshold

Value that indicates the threshold for modifying the original value of the pixel. If the difference in the original pixel value and the blurred pixel value is greater than the threshold value, the original pixel value will be modified.


pRaster Parameter For UnsharpMask

pRaster

ILEADRaster object to be modified.


Return for UnsharpMask

Return Value

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


bUpdateBitmap Parameter For UpdateMagGlass

bUpdateBitmap

Flag that indicates whether to update the LEAD RasterView Control’s bitmap. Possible values are:

Value | Meaning
TRUE | Update the LEAD RasterView Control’s bitmap.
FALSE | Do not update the LEAD RasterView Control’s bitmap.


bUpdateBitmap Parameter For UpdateMagGlassExt2

bUpdateBitmap

Flag that indicates whether to update the LEAD RasterView Control’s bitmap. Possible values are:

Value | Meaning
TRUE | Update the LEAD RasterView Control’s bitmap.
FALSE | Do not update the LEAD RasterView Control’s bitmap.


nMaskPlaneEnd Parameter For UpdateMagGlassExt2

nMaskPlaneEnd

The end position of the mask plane array.


nMaskPlaneStart Parameter For UpdateMagGlassExt2

nMaskPlaneStart

The start position of the mask plane array.


Return for UpdateMagGlassExt2

Return Value

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


vColorBuffer Parameter For UpdateMagGlassExt2

vColorBuffer

An array of updated colors that match the position of needed data on the mask plane array.


vMaskPlane Parameter For UpdateMagGlassExt2

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


bUpdateBitmap Parameter For UpdateMagGlassFromHandle

bUpdateBitmap

Flag that indicates whether to update the ILEADRasterView Control’s bitmap or not. Possible values are:

Value | Meaning
TRUE | Update the ILEADRasterView Control’s bitmap.
FALSE | Do not update the ILEADRasterView Control’s bitmap.


hBitmap Parameter For UpdateMagGlassFromHandle

hBitmap

A LEAD bitmap that references the bitmap that the Magnifying Glass will display in the zoomed area.


Return for UpdateMagGlassFromHandle

Return Value

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


nMaskPlaneEnd Parameter For UpdateMagGlass

nMaskPlaneEnd

The end position of the mask plane array.


nMaskPlaneStart Parameter For UpdateMagGlass

nMaskPlaneStart

The start position of the mask plane array.


hMagGlassRgn Parameter For UpdateMagGlassShape

hMagGlassRgn

Handle to a region that defines the Magnifying Glass shape. This parameter is used only if the nMagGlassShape parameter is MAGGLASS_SHAPE_HRGN.


MagGlassShape Parameter For UpdateMagGlassShape

MagGlassShape

Flags that indicate the shape of the magnifying glass. Possible values:

Value | Meaning
MAGGLASS_SHAPE_RECT | Magnifying Glass has a rectangular shape
MAGGLASS_SHAPE_ELLIPSE | Magnifying Glass has an elliptical shape
MAGGLASS_SHAPE_HRGN | Magnifying Glass has a custom shape, determined by the windows region passed in the hMagGlassRgn parameter.


Return for UpdateMagGlassShape

Return Value

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


Return for UpdateMagGlass

Return Value

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


vColorBuffer Parameter For UpdateMagGlass

vColorBuffer

An array of updated colors that match the position of needed data on the mask plane array.


vMaskPlane Parameter For UpdateMagGlass

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


iIndex Parameter For UpdateOverlayBits

iIndex

The index of the overlay being updated. This index is zero-based.


lFlags Parameter For UpdateOverlayBits

lFlags

Flags that determine whether the main bitmap or the overlay bitmap should be updated. Possible values are:

Value | Meaning
SETOVERLAYBITS_FROMOVERLAY | [0x0001] Update the main bitmap’s bits for the corresponding bitplane using the data from the overlay bitmap.
SETOVERLAYBITS_FROMBITMAP | [0x0002] Update the overlay bitmap with the bits from the corresponding bit plane of the main bitmap. Can be or-ed with SETOVERLAYBITS_CLEAR.
SETOVERLAYBITS_CLEAR | [0x0004] Clear the bits from the bitplane associated with the overlay that are not contained in the overlay bitmap (use only in combination with SETOVERLAYBITS_FROMOVERLAY)


pRaster Parameter For UpdateOverlayBits

pRaster

Pointer to the ILEADRaster object for which to update the bitmap.


Return for UpdateOverlayBits

Return Value

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


Return for UpdateZoomView

Return Value

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


ZoomView Parameter For UpdateZoomView

ZoomView

An ILEADRasterZoomView object that contains the new settings with the specified Zoom View Information at the specified index.


uIndex Parameter For UserHandle

uIndex

Index into an array of user-defined annotation handles. The index is zero based.


iIndex Parameter For UserLUTCurveX

iIndex

The index into the array of points.


iIndex Parameter For UserLUTCurveY

iIndex

The index into the array of points.


iIndex Parameter For UserPalette

iIndex

The index into the array of colors.


lIndex Parameter For VTable

lIndex

The index into the array. The first element of the array is 0. The short values present in this array are Values used to remap an image.


crEnd Parameter For WindowLevelFillLUT

crEnd

The ending color.


crStart Parameter For WindowLevelFillLUT

crStart

The starting color.


lFlags Parameter For WindowLevelFillLUT

lFlags

Flags that indicate how the range is used to fill the LUT and the type of LUT and whether the LUT contains signed or unsigned data. The following flags indicate how the range is used to fill the LUT:

Value | Meaning
FILLLUT_INSIDE | [0x0001] Fill the LUT between nLow and nHigh. ( inside the nLow...nHigh range )
FILLLUT_OUTSIDE | [0x0002] Fill the LUT below nLow and above nHigh. ( outside the nLow...nHigh range )

The following flags indicate the LUT type:

Value | Meaning
FILLLUT_LINEAR | [0x0010] LUT is linear.
FILLLUT_EXPONENTIAL | [0x0020] LUT is exponential.
FILLLUT_LOGARITHMIC | [0x0030] LUT is logarithmic.
FILLLUT_SIGMOID | [0x0030] LUT is sigmoid.

The following flags indicate whether the LUT contains signed or unsigned data:

Value | Meaning
FILLLUT_UNSIGNED | [0x0000] The LUT data is unsigned.
FILLLUT_SIGNED | [0x0100] The LUT data is signed.


nFactor Parameter For WindowLevelFillLUT

nFactor

Value that indicates the factor to be applied in the method operation specified in the lFlag parameter. This parameter is used only if lFlags is FILLLUT_EXPONENTIAL, FILLLUT_LOGARITHMIC or FILLLUT_SIGMOID. If FILLLUT_EXPONENTIAL or FILLLUT_SIGMOID flag is selected its value can be any integer (+/-). If FILLLUT_LOGARITHMIC flag is selected its value should be >= 0. If nFactor = 0, the lookup table will be filled linearly.


nHigh Parameter For WindowLevelFillLUT

nHigh

The highest grayscale value to window level.


nHighBit Parameter For WindowLevelFillLUT

nHighBit

High-bit value.


nLow Parameter For WindowLevelFillLUT

nLow

The lowest grayscale value to window level.


nLowBit Parameter For WindowLevelFillLUT

nLowBit

Low-bit value.


nMaxValue Parameter For WindowLevelFillLUT

nMaxValue

The highest grayscale value in the image.


nMinValue Parameter For WindowLevelFillLUT

nMinValue

The lowest grayscale value in the image.


Return for WindowLevelFillLUT

Return Value

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


pRaster Parameter For WindowLevel

pRaster

ILEADRaster object to modified.


Return for WindowLevel

Return Value

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


lPage Parameter For WriteComment

lPage

Number of the page within the specified file on which to write the comments. The first page is page 1. The specified page must exist. If the page does not exist, an error will be returned.


pszFile Parameter For WriteComment

pszFile

String that contains the name of the file in which to write the comment(s).


Return for WriteComment

Return Value

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


bstrFile Parameter For WriteFileGeoKey

bstrFile

A character string that contains the file name in which to write the GeoKeys.


iModify Parameter For WriteFileGeoKey

iModify

A value that indicates how to save a new page in a multipage file that supports insert and replace operations.

Value | Meaning
SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
SAVE_APPEND | [1] or [-1] The page is appended in case the file is exist.
SAVE_REPLACE | [2] Replace the page specified in the lPage parameter.
SAVE_INSERT | [3] Insert the new page before the page specified in the lPage parameter


lPage Parameter For WriteFileGeoKey

lPage

Specifies the start page. Page 0 is the first page, page 1 is the second page, etc. The pages will be saved starting with this page.


Return for WriteFileGeoKey

Return Value

Return | Meaning
0 | The method was successful.
ERROR_NOTHING_TO_DO | No GeoKeys have been set before calling this method.
<>0 | An error occurred. Refer to Error Codes.


iMarker Parameter For WriteMarker

iMarker

ID of the JPEG marker to write. The JPEG markers are uniquely identified by a byte value. Possible values are 1 to 254. (0 and 255 are not allowed.) This can be the same value that was passed to the TransformMarker event.


lSize Parameter For WriteMarker

lSize

Size of the JPEG marker. The size will be less than 65535. If this value is 0, then the marker does not have any extra data. If the value is greater than 0, the extra data is taken from vData.


Return for WriteMarker

Return Value

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


vData Parameter For WriteMarker

vData

An ILEADRasterVariant byte array object that contains the marker data to write. The size of this data is indicated in lSize.


fileName Parameter For WriteMetaData

fileName

A string that contains the name of the file in which to write the metadata.


lFlags Parameter For WriteMetaData

lFlags

Flags that describe which type of metadata should be written. Possible values are:

Value | Meaning
METADATA_COMMENTS | Write comments.
METADATA_TAGS | Write tags.
METADATA_MARKERS | Write markers.
METADATA_ALL | Write all metadata (tags, comments and markers).


Return for WriteMetaData

Return Value

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


lPage Parameter For WriteTag

lPage

Number of the page within the specified file on which to write the tag(s). The first page is page 1. The specified page must exist. If the page does not exist, an error will be returned.


pszFile Parameter For WriteTag

pszFile

String that contains the name of the file in which to write the tag(s). Please note that this file must exist.


Return for WriteTag

Return Value

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


x Parameter For ZoomInDone

x

x location of the ZoomIn capture, relative to the top, left corner of the screen. The unit of measure is determined by the ScaleMode property.


y Parameter For ZoomInDone

y

y location of the ZoomIn capture, relative to the top, left corner of the screen. The unit of measure is determined by the ScaleMode property.


Return for ZoomIn

Return Value

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


fHeight Parameter For ZoomToRect

fHeight

The height of the rectangle in the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fLeft Parameter For ZoomToRect

fLeft

The X coordinate of the origin of the rectangle in the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fTop Parameter For ZoomToRect

fTop

The Y coordinate of the origin of the rectangle in the Main Control's client area. The unit of measure is determined by the ScaleMode property.


fWidth Parameter For ZoomToRect

fWidth

The width of the rectangle in the Main Control's client area. The unit of measure is determined by the ScaleMode property.


Return for ZoomToRect

Return Value

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